# An Accurate, Efficient, and Stable Perspective-n-Point Algorithm in 3D Space
###### Abstract  
The Perspective-n-Point problem is usually addressed by means of a projective imaging model of 3D points, but the spatial distribution and quantity of 3D reference points vary, making it difficult for the Perspective-n-Point algorithm to balance accuracy, robustness, and computational efficiency. To address this issue, this paper introduces Hidden PnP, a hidden variable method. Following the parameterization of the rotation matrix by CGR parameters, the method, unlike the existing best matrix synthesis technique (Grobner technology), does not require construction of a larger matrix elimination template in the polynomial solution phase. Therefore, it is able to solve CGR parameter rapidly, and achieve an accurate location of the solution using the Gauss-Newton method. According to the synthetic data test, the PnP algorithm solution, based on hidden variables, outperforms the existing best Perspective-n-Point method in accuracy and robustness, under cases of Ordinary 3D, Planar Case, and Quasi-Singular. Furthermore, its computational efficiency can be up to seven times that of existing excellent algorithms when the spatially redundant reference points are increased to 500. In physical experiments on pose reprojection from monocular cameras, this algorithm even showed higher accuracy than the best existing algorithm.  
Perspective-n-Point problem; CGR parameter matrix; Grobner technology; hidden PnP Article  
[PERSON], [PERSON], [PERSON], [PERSON], [PERSON], [PERSON] Accurate, Efficient, and Stable Perspective-n-Point Algorithm in 3D Space  
Appli  
1  
11
Footnote 10: email: [PERSON]@u-u.  
and images is adopted to establish the equation, and the linear method is used to solve the equation directly. Nevertheless, such a method exhibits larger error and is prone to noise interference when the number of spatial reference points \(n\geq 4\) and the spatial reference points are not in the same plane, which can be mostly explained by the failure to consider non-linear constraints in the imaging process. The corresponding P4P and P5P algorithms, when \(n=4\) and \(n=5\), proposed by some scholars lack the universal feature of the PnP algorithm. To avoid the defects of the linear method for the PnP problem, the non-linear method is adopted for some other PnP algorithms, such as in the literature in [11; 12; 13; 14; 15; 16; 17; 18; 19]. Among the examples from the literature, refs. [11; 12] employed the SoftPOSIT method and the orthogonal iteration method, respectively. The results demonstrated that the LHM algorithm outperformed the iterative methods for PnP problem. The LHM algorithm reduces the number of unknowns by parameterizing the imaging model, takes the residual sum of squares of the reference coordinates in the world coordinate system as the loss function, and obtains the parameters of the rotation matrix and translation matrix by means of iterative solution. Despite its better performance than the linear algorithm, in terms of computational accuracy and stability, the iterative algorithm may increase the computation burden, and even lead to non-convergence and local optimum of the calculation results if its initial value is beyond a certain range of the real solution; thus, failing the algorithm. In addition, the iterative method performs low computational accuracy and stability if the distribution of spatial reference points is similar to Quasi Singular and there are few redundant feature points in the distribution.