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:
s p c = K [ R | T ] p w {\displaystyle s\,p_{c}=K\,[\,R\,|\,T\,]\,p_{w}} . where p w = [ x y z 1 ] T {\displaystyle \textstyle p_{w}={\begin{bmatrix}x&y&z&1\end{bmatrix}}^{T}} is the homogeneous world point, p c = [ u v 1 ] T {\displaystyle \textstyle p_{c}={\begin{bmatrix}u&v&1\end{bmatrix}}^{T}} is the corresponding homogeneous image point, K {\displaystyle \textstyle K} is the matrix of intrinsic camera parameters, (where f x {\displaystyle \textstyle f_{x}} and f y {\displaystyle f_{y}} are the scaled focal lengths, γ {\displaystyle \textstyle \gamma } is the skew parameter which is sometimes assumed to be 0, and ( u 0 , v 0 ) {\displaystyle \textstyle (u_{0},\,v_{0})} is the principal point), s {\displaystyle \textstyle s} is a scale factor for the image point, and R {\displaystyle \textstyle R} and T {\displaystyle \textstyle 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:
… excerpt ends here. Continue reading the full article.
