ArticleslgStudy

science

Perspective-n-Point

Perspective-n-Point is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Perspective-n-Point rather than just read about it. In short: Perspective-n-Point (PnP) is the problem of estimating the pose of a camera given a set of n 3D points in the world and their corresponding 2D projections in an image. The camera pose consists of 6 degrees of freedom (DOF) which are made up of the rotation (roll, pitch, and yaw) and 3D translation of the camera with respect to an origin point in the world.

Key takeaways

  • Perspective-n-Point belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Perspective-n-Point to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Perspective-n-Point from memory before moving on to harder problems.

Reference excerpt

Perspective-n-Point (PnP) is the problem of estimating the pose of a camera given a set of n 3D points in the world and their corresponding 2D projections in an image. The camera pose consists of 6 degrees of freedom (DOF) which are made up of the rotation (roll, pitch, and yaw) and 3D translation of the camera with respect to an origin point in the world. This problem originates from camera calibration and has many applications in computer vision and other areas, including 3D tracking, robotics and augmented reality. A commonly used solution to the problem exists for n = 3 called P3P, and many solutions are available for the general case of n ≥ 3. A solution for n = 2 exists if feature orientations are available at the two points. Implementations of these solutions are available in open source software.

Problem specification

Definition Given a set of n 3D points in a world reference frame and their corresponding 2D image projections as well as the calibrated intrinsic camera parameters, determine the 6 DOF pose of the camera in the form of its rotation and translation with respect to the world. This follows the perspective projection model for cameras:

spc=K[R|T]pw. where pw=[xyz1]T is the homogeneous world point, pc=[uv1]T is the corresponding homogeneous image point, K is the matrix of intrinsic camera parameters, (where fx and fy are the scaled focal lengths, γ is the skew parameter which is sometimes assumed to be 0, and (u0,v0) is the principal point), s is a scale factor for the image point, and R and T are the desired 3D rotation and 3D translation of the camera (extrinsic parameters) that are being calculated. This leads to the following equation for the model:

s[uv1]=[fxγu00fyv0001][r11r12r13t1r21r22r23t2r31r32r33t3][xyz1].

Assumptions and data characteristics There are a few preliminary aspects of the problem that are common to all solutions of PnP. The assumption made in most solutions is that the camera is already calibrated. Thus, its intrinsic properties are already known, such as the focal length, principal image point, skew parameter, and other parameters. Some methods, such as UPnP or the Direct Linear Transform (DLT) applied to the projection model, are exceptions to this assumption as they estimate these intrinsic parameters as well as the extrinsic parameters which make up the pose of the camera that the original PnP problem is trying to find. For each solution to PnP, the chosen point correspondences cannot be colinear. In addition, PnP can have multiple solutions, and choosing a particular solution would require post-processing of the solution set. RANSAC is also commonly used with a PnP method to make the solution robust to outliers in the set of point correspondences. P3P methods assume that the data is noise free, most PnP methods assume Gaussian noise on the inlier set.

Methods This following section describes two common methods that can be used to solve the PnP problem that are also readily available in open source software and how RANSAC can be used to deal with outliers in the data set.

P3P When n = 3, the PnP problem is in its minimal form of P3P and can be solved with three point correspondences. However, with just three point correspondences, P3P yields up to four real, geometrically feasible solutions. For low noise levels a fourth correspondence can be used to remove ambiguity. The setup for the problem is as follows. Let P be the center of projection for the camera, A, B, and C be 3D world points with corresponding images points u, v, and w. Let X = |PA|, Y = |PB|, Z = |PC|, α=∠BPC, β=∠APC, γ=∠APB, p=2cos⁡α, q=2cos⁡β, r=2cos⁡γ, a′=|AB|, b′=|BC|, c′=|AC|. This forms triangles PBC, PAC, and PAB from which we obtain a sufficient equation system for P3P:

{Y2+Z2−YZp−b'2=0Z2+X2−XZq−c'2=0X2+Y2−XYr−a'2=0.

Solving the P3P system results in up to four geometrically feasible real solutions for R and T. The oldest published solution dates to 1841. A recent algorithm for solving the problem as well as a solution classification for it is given in the 2003 IEEE Transactions on Pattern Analysis and Machine Intelligence paper by Gao, et al. An open source implementation of Gao's P3P solver can be found in OpenCV's calib3d module in the solvePnP function. Several faster and more accurate versions have been published since, including Lambda Twist P3P which achieved state of the art performance in 2018 with a 50 fold increase in speed and a 400 fold decrease in numerical failures. Lambdatwist is available as open source in OpenMVG and at https://github.com/midjji/pnp.

EPnP Efficient PnP (EPnP) is a method developed by Lepetit, et al. in their 2008 International Journal of Computer Vision paper that solves the general problem of PnP for n ≥ 4. This method is based on the notion that each of the n points (which are called reference points) can be expressed as a weighted sum of four virtual control points. Thus, the coordinates of these control points become the unknowns of the problem. It is from these control points that the final pose of the camera is solved for. As an overview of the process, first note that each of the n reference points in the world frame, piw, and their corresponding image points, pic, are weighted sums of the four controls points, cjw and cjc respectively, and the weights are normalized per reference point as shown below. All points are expressed in homogeneous form.

piw=∑j=14αijcjw pic=∑j=14αijcjc ∑j=14αij=1 From this, the derivation of the image reference points becomes

sipiimg=K∑j=14αijcjc. Where piimg is the image reference points with pixel coordinate [uivi1]T. The homogeneous image control point has the form cjc=[xjcyjczjc]T. Rearranging the image reference point equation yields the following two linear equations for each reference point:

∑j=14αijfxxjc+αij(u0−ui)zjc=0 ∑j=14αijfyyjc+αij(v0−vi)zjc=0. Using these two equations for each of the n reference points, the system Mx=0 can be formed where x=[c1cTc2cTc3cTc4cT]T. The solution for the control points exists in the null space of M and is expressed as

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Perspective-n-Point

Start with the simplest possible case. Write down what Perspective-n-Point claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Perspective-n-Point before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Perspective-n-Point ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Perspective-n-Point

In research
Perspective-n-Point appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Perspective-n-Point in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Perspective-n-Point is common in secondary-school and first-year university syllabi. It links to neighbouring topics Photogrammetry, Science of photography, so understanding it makes those chapters shorter.
In everyday life
Look for Perspective-n-Point outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Perspective-n-Point” →

How to study Perspective-n-Point in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Perspective-n-Point means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Perspective-n-Point out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Perspective-n-Point in simple terms?

Perspective-n-Point (PnP) is the problem of estimating the pose of a camera given a set of n 3D points in the world and their corresponding 2D projections in an image. The camera pose consists of 6 degrees of freedom (DOF) which are made up of the rotation (roll, pitch, and yaw) and 3D translation…

Why does Perspective-n-Point matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Perspective-n-Point?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Perspective-n-Point.

Tags

  • Photogrammetry
  • Science of photography

Keep exploring