Next Article in Journal
Transient Responses of Repeated Transverse Impacts on Beams
Next Article in Special Issue
Boundary–Inner Disentanglement Enhanced Learning for Point Cloud Semantic Segmentation
Previous Article in Journal
Study and Design of Distributed Badminton Agility Training and Test System
Previous Article in Special Issue
LUMDE: Light-Weight Unsupervised Monocular Depth Estimation via Knowledge Distillation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Accurate, Efficient, and Stable Perspective-n-Point Algorithm in 3D Space

1
College of Automation, Nanjing University of Aeronautics and Astronautics, Nanjing 211100, China
2
College of Electrical and Information Engineering, Lanzhou University of Technology, Lanzhou 730050, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(2), 1111; https://doi.org/10.3390/app13021111
Submission received: 5 December 2022 / Revised: 7 January 2023 / Accepted: 11 January 2023 / Published: 13 January 2023
(This article belongs to the Special Issue 3D Scene Understanding and Object Recognition)

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 (Gröbner 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.

1. Introduction

In the field of computer vision, the Perspective-n-Point(PnP) problem refers to the determination of the relative position and gesture relation between the target and the camera by combining the image coordinates obtained from the camera with the coordinates of n known feature points of the target in the world coordinate system [1]. With the boom in robotics and space technology in recent years, the PnP problem has been widely studied and applied among fields including autonomous robot navigation [2], robot positioning [3], hand-eye calibration [4], spacecraft rendezvous and docking [5], target recognition and tracking [6], augmented reality, and SLAM [7].
The PnP problem is solvable when n ≥ 3, and it cannot be solved when n ≤ 2. When n = 3, P3P can be regarded as a minimal subset of the PnP problem. To be exact, when n ≥ 4, it is called a general PnP problem, which exhibits higher pose estimation accuracy than P3P because of the existence of more redundant information points. The ideal PnP algorithm features accuracy, stability, high efficiency, and universality. Instead, due to the difference of scenes, the PnP algorithm fails to achieve high-precision computational results with high efficiency and stability in actual practice.

1.1. Pnp Problems Solved by Linear and Non-Linear Methods

Table 1 shows that PnP algorithms can be divided into two main categories. The first is the linear method for the PnP problem, including the Tsai method [8], the HOMO method [9], and the direct linear transformation method (DLT) [10], etc. The linear method performs with fast solving speed, as the mapping relation between spatial reference points 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 ≥ 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.

1.2. A Non-Iterative Approach to Optimally Solving PnP Problems

Table 1 shows that scholars have used non-iterative methods to optimally solve the PnP problem in order to overcome the shortcomings of the iterative method. Firstly, the imaging model undergoes parameterization, simplification, and deformation to construct non-linear equations that can be used for optimization. Then, the Gröbner technique (Figure 1) is adopted to solve the non-linear equations (see [20,21] in detailed steps of Gröbner tool), and the required pose parameters are obtained. The first non-iterative PnP algorithm is the EPnP algorithm [13], which takes four spatial virtual points as reference points and uses these four points to represent the reference points in the rest of the space, and, finally, obtains the pose information through optimization. The EPnP algorithm requires less computational time, compared with the iterative method. However, the linear method it uses leads to unsatisfactory computational accuracy and poor stability when there is noise and to fewer spatial redundant points. The DLS algorithm [14], also a non-iterative method, first introduces the CGR (Cayley–Gibbs–Rodriguez) parameterized rotation matrix, and uses the matrix decomposition technique to process the rotation matrix. The processed rotation matrix parameterizes the translation vector through the relation derivation of the imaging model equation, leaving only three unknown parameters in the whole solution process. Finally, the pose estimation problem is transformed into an unconstrained square minimization problem by constructing a cost function. The introduction of the CGR parameterized rotation matrix and the application of the matrix decomposition technique in the solution process may incur singular value and complex computation, which greatly affects the accuracy, speed, and stability of the final solution pose. Among the non-iterative methods, the RPnP algorithm [15], which is different to the DLS algorithm, can be generally regarded as a phased solution method. First, the PnP problem is transformed into the P3P problem, that is, the spatial reference points are divided into groups of three, so as to obtain polynomial sets with the highest order of fourth. Then, the fourth-order polynomial sets, also non-linear equations, are transformed into linear equations through the linearization technique. Finally, the required pose parameters are obtained by solving the polynomial sets. The whole solution process of RPnP, though being a progressive and cohesive strategy, introduces linearization technology and adopts the non-global optimization method, which explains its fast computational speed, but less favorable stability and accuracy.
In addition, some PnP algorithms not only absorb the advantages of iterative methods, but also overcome their proneness to local optimum, including the ASPnP algorithm [16] and the OPnP [17] algorithm. Both of the aforementioned algorithms introduce the quaternion to represent the rotation matrix, express the translation matrix by the quaternion parameters through the imaging model equation, and directly construct the objective function for global optimization by means of such mathematical skills as rewriting the matrix form and introducing new variables. What merits attention, is that the method employs the Gröbner technique, instead of the Gauss–Newton method commonly used in the iterative method, to avoid local optimum when solving the third-order polynomial sets of the objective function. Nevertheless, the above two PnP algorithms construct a large elimination template matrix when using the Gröbner technique, which increases computational burden.
Some scholars have made continuous efforts to improve existing PnP algorithms. For example, Kneip et al. proposed the UPnP in 2014 [18], and Nakano proposed the optDLS [19] PnP algorithm in 2015, both of which improved the OPnP algorithm. Specifically, the UPnP algorithm applies to PnP problems under the perspective imaging model and those under the General Camera Model. The UPnP algorithm cannot match the OPnP algorithm in the Planar Case and Quasi Singular of reference points. The optDLS algorithm reduces the number of solutions and the running time of the algorithm by increasing the constraints of the objective function in OPnP. In 2018, Wang et al. [22] proposed the SRPnP algorithm, based on the RPnP algorithm. The algorithm only requires solving a univariate polynomial set of the highest order of 7 and a univariate polynomial of the highest order of 4, and, finally, uses the Gauss–Newton method for one accurate positioning. This algorithm divides the solution of PnP into three stages, each of which witnesses the formation of an optimization problem, and utilizes the optimization value obtained in the previous stage for computation. In this way, the SRPnP algorithm is more accurate and faster than the RPnP in solution, elevating it into being one of the best algorithms for solving the PnP problem. Wang also proposed the RDLT algorithm in 2020 [23]. This algorithm, while using the linear method to solve the PnP problem, improves the DLT algorithm by considering the imaging constraint relationship between points, which outperforms the traditional linear method in stability and accuracy, rivals the existing non-linear optimization method, and even exhibits far higher solving efficiency than the non-linear optimization method. In 2020, Wang et al. [24] proposed the WIEPnP algorithm, which adopted an iterative solution by setting the weight coefficient of the spatial reference points. The algorithm is still on a par with OPnP and SRPnP as to accuracy, without significant improvement.

1.3. Problems with Existing PnP Algorithms and Solutions

The above demonstrates that, among the PnP algorithms, except for the RDLT algorithm, the linear solution method is not as efficient, accurate, and stable as the non-linear solution method. The non-linear method, for solutions, adopts Gauss–Newton method, the Levenberg–Marquardt method for iteration, the orthogonal iteration method, and other iterative algorithms to solve the PnP problem. However, the selection of the initial value affects the accuracy, stability, and computational efficiency of the algorithms, which explains their less favorable performance compared with the non-iterative method. Among non-iterative methods, the PnP algorithm, with the best performance, introduces CGR (Cayley–Gibbs–Rodriguez) to parameterize the rotation matrix, and utilizes the parametrization of the imaging model equation to translate the vector. The Gröbner is employed to solve pose parameters, which avoids lengthy computational duration and local optimum caused by the unreasonable initial values of the iterative method. Instead, the polynomial sets formed by the PnP problem, are generally rather complex, and the application of the Gröbner technique to solve the polynomial sets requires the construction of a large elimination template matrix, which enlarges the computational burden to solve the PnP problem, and affects the real-time performance of the PnP algorithm in practical applications. In order to make up for the shortcomings of the above methods, and to improve the robustness, accuracy, efficiency, and universality of the PnP algorithm, this paper proposes the Hidden PnP, a method to solve polynomial sets based on hidden variables, which guarantees higher accuracy, stability, and efficiency in solving the PnP problem. The main contributions of this paper are as follows:
(1)
To prevent singularities in the rotation matrix parametrized by the CGR, a rotation matrix, R1, is constructed, and the rotation matrix, R, parametrized by the CGR is processed using R1.
(2)
In this paper, accuracy experiments and noise immunity experiments of the hidden variable method were carried out in three cases, i.e., Planar Case, Ordinary 3D and Quasi-Singular. The performance of some new PnP algorithms in recent years were compared and detailed experimental data given.
(3)
In this paper, the hidden variable-based PnP algorithm, and other PnP algorithms, were applied to the physical experiments with monocular vision cameras, and reprojection experiments of the corner points of calibration plates were carried out. In addition, detailed reprojection experimental error data for each PnP algorithm are given.
In the second section, the basic mathematical description of the PnP problem is given and the mathematical solution process of the hidden variables is described in detail. In the third section, simulation experiments and results analysis are carried out on Matlab software using synthetic data. In this section, the posited solution performance of the proposed hidden PnP method is compared with our Hidden PnP method in three cases, namely the Ordinary 3D case, the Planar Case and the Quasi-Singular case, as well as in the case of noise under these three cases. In addition, the section gives experimental data comparing the operational efficiency of various algorithms, and, finally, the algorithms are applied to the physical experiment of the reprojection error. Section 4 presents the conclusions and outlook.

2. Methods

2.1. Description of the PnP Mathematical Model

The imaging model of a camera projecting n 3D reference points under a 3D world onto a 2D image plane through a lens can be represented by the model in Figure 2. The equations of the projected imaging model from the world coordinate system to camera one can be expressed in the following form:
λ i P i = R q i + t , ( i = 1 ,   2 ,   3 ,   . . . ,   n )
where q i = [ X i , Y i , Z i ] T , (i = 1, 2, 3, ..., n) are the coordinates of n 3D spatial reference points in the world coordinate system, P i = [ u i , v i , 1 ] T , (i = 1, 2, 3, ..., n) are the plane coordinates of n points in the camera coordinate system, and t = [ t x , t y , t z ] T is the translation vector.

2.2. Parametric Representation of Rotation Matrices and Translation Vectors, and the Elimination of Depth Factors

Mathematically, the rotation matrix R is represented in more than one way, including direction cosine algorithm, Euler angle representation, unit quaternion representation, Cayley parameter representation (CGR), etc. This paper mainly employed the Cayley parameter representation (CGR), which is directly derived from the quaternion method. For example, the rotation matrix R, represented by the quaternion, is:
R = 1 s 1 + b 2 c 2 d 2 2 b c 2 d 2 b d + 2 c 2 b c + 2 d 1 b 2 + c 2 d 2 2 c d 2 b 2 b d 2 c 2 c d + 2 b 1 b 2 c 2 + d 2 = 1 s U
Among them, ( s = 1 + b 2 + c 2 + d 2 ) . The rotation angle closing to 180 leads to an extremely large rotation matrix, represented by CGR, leading to a singular value in the R matrix and a large calculation error. In response, a rotation matrix R 1 is constructed in the process of code implementation, R 1 is adopted to process the rotation matrix R, parameterized by CGR, and R is restored to its original state after obtaining the final result. In this way, the singularity caused by R parameterized by CGR is effectively avoided.
Equation (1) is rewritten into matrix form:
λ i u i v i 1 = R q i + t x t y t z , ( i = 1 ,   2 ,   3 ,   ,   n )
Meanwhile, the U matrix in Equation (2) is set to be:
U = r 1 T r 2 T r 3 T = 1 + b 2 c 2 d 2 2 b c 2 d 2 b d + 2 c 2 b c + 2 d 1 b 2 + c 2 d 2 2 c d 2 b 2 b d 2 c 2 c d + 2 b 1 b 2 c 2 + d 2
Multiply both sides of Equation (3) by s to obtain:
λ ^ i P i = r 1 T r 2 T r 3 T q i + t ^ , ( i = 1 ,   2 ,   3 ,   ,   n )
where λ ^ i = λ i s , P i = [ u i , v i , 1 ] T , t ^ i = s [ t x , t y , t z ] T = [ t ^ 1 , t ^ 2 , t ^ 3 ] T .
According to Equation (4), the depth factor satisfies:
λ ^ i = r 3 T q i + t 3 ^ , ( i = 1 ,   2 ,   3 ,   ,   n )
Therefore, Equation (5) is substituted into Equation (4) to eliminate all depth factors:
t 1 ^ t 3 ^ u i = r 3 T q i u i r 1 T q i
t 2 ^ t 3 ^ v i = r 3 T q i v i r 2 T q i
The new variable L = [ 1 , b , c , d , b 2 , b c , b d , c 2 , c d , d 2 ] T is introduced, and Equations (6) and (7) are rewritten into matrix forms:
A i t ^ = N ^ i L
where A i = 1 0 u i 0 1 v i ,
N ^ i = X i + Z i u i 2 Y i u i 2 Z i 2 X i u i 2 Y i X i Z i u i 2 Y i 2 X i u i 2 Z i X i Z i u i 2 Y i u i X i + Z i u i Y i + Z i v i 2 Z i + 2 Y i v i 2 X i v i 2 X i Y i Z i v i 2 X i 2 X i v i Y i Z i v i 2 Y i v i 2 Z i Y i + Z i v i
Since n spatial reference points all satisfy Equation (8), it can be obtained as follows:
A 1 A 2 A 3 A n t ^ = N 1 N 2 N 3 N n v A t ^ = N L
In the case that L has been specified, the linear least square fitting is used to obtain:
t ^ = A + N L
where A + = ( A T A ) 1 A T is the inverse matrix of Moore-Penrose matrix.
Equation (10) is substituted into Equation (8) to obtain:
( A i A + N i N i ) L = 0 A 1 A + N N 1 A 2 A + N N 2 A 3 A + N N 3 A n A + N N n L = 0
Let J = A 1 A + N N 1 A 2 A + N N 2 A 3 A + N N 3 A n A + N N n , Equation (11) is rewritten as:
J L = 0
In Equation (12), the J matrix of the following scale can be obtained through the above calculation, based on the known parameters in Equation (1):
J = j 11 j 12 j 13 j 14 j 15 j 16 j 17 j 18 j 19 j 1 , 10 j 21 j 22 j 23 j 24 j 25 j 26 j 27 j 28 j 29 j 2 , 10 j 31 j 32 j 33 j 34 j 35 j 36 j 37 j 38 j 39 j 3 , 10 j 2 n , 1 j 2 n , 2 j 2 n , 3 j 2 n , 4 j 2 n , 5 j 2 n , 6 j 2 n , 7 j 2 n , 8 j 2 n , 9 j 2 n , 10
Some existing PnP methods adopt the obtained Equation (12) to construct the objective function, and take the Gauss–Newton method, Levenberg–Marquardt iteration, orthogonal iteration, and other iterative methods, to solve the pose parameters. According to Section 1, the selection of the initial value and proneness to local optimum of the iterative methods undermine their calculation accuracy and speed. In addition, some PnP methods also use the Gröbner technique to solve the polynomial sets constructed here, which overcomes the defects of the iterative methods. Instead, its operational process generally requires a huge elimination template matrix, given the complexity of PnP problems, which seriously affects the efficiency of the algorithm. Accordingly, Section 4 employs a hidden variable method to solve the pose parameters of CGR in Equation (12).

2.3. The Application of Hidden Variable Method to Solve Pose Parameters

Due to the numerous polynomial manipulations, the simplification, and the deformation involved in this section, the application of a general calculation makes the derivation process rather complicated. Therefore, the extensively used symbolic operation in matlab software is adopted in this paper to simplify the mathematical description process of hidden variables, so that readers can easily and intuitively understand the derivation process.
Among them, J(:i), i = 1, 2, 3, ..., 10 denotes all elements of the ith column of the J matrix. In the hidden variables, L = [ 1 , b , c , d , b 2 , b c , b d , c 2 , c d , d 2 ] T , the new variables introduced in the previous section, are adopted, where b is set as a constant, and the remaining parameters are taken as unknowns. Then, the unknowns in Equation (12) are introduced as new variables to obtain the following equation in the form of a matrix:
Q c 2 d 2 c d = T ( b ) c d 1
where Q = [J(:8), J(:10), J(:9)],
T ( b ) = J 13 + J 16 b J 14 + J 17 b J 11 + J 12 b + J 15 b 2 J 23 + J 26 b J 24 + J 27 b J 21 + J 22 b + J 25 b 2 J 33 + J 36 b J 34 + J 37 b J 31 + J 32 b + J 35 b 2 J 2 n , 3 + J 2 n , 6 b J 2 n , 4 + J 2 n , 7 b J 2 n , 1 + J 2 n , 2 b + J 2 n , 5 b 2
According to Equation (13), c 2 , d 2 , and cd is solved through the following mathematical calculation, exhibiting the following closed-form solution:
c 2 d 2 c d = G T ( b ) c d 1 c 2 d 2 c d = W ( b ) c d 1
where G = ( Q T Q ) 1 Q T . The calculation results show that G is a 3 × 2n pure numerical matrix, and W(b) is a 3 × 3 polynomial matrix containing b. At the same time,
G = g 11 g 12 g 13 g 1 , 2 n g 21 g 22 g 23 g 2 , 2 n g 31 g 32 g 33 g 3 , 2 n
W ( b ) = w 12 + w 11 b w 14 + w 13 b w 17 + w 16 b + w 15 b 2 w 22 + w 21 b w 24 + w 23 b w 27 + w 26 b + w 25 b 2 w 32 + w 31 b w 34 + w 33 b w 37 + w 36 b + w 35 b 2 = W 11 W 12 W 13 W 21 W 22 W 23 W 31 W 32 W 33
where w 11 = G ( 1 : ) J ( : 6 ) , w 21 = G ( 2 : ) J ( : 6 ) , w 31 = G ( 3 : ) J ( : 6 ) ,
   w 12 = G ( 1 : ) J ( : 3 ) , w 22 = G ( 2 : ) J ( : 3 ) , w 32 = G ( 3 : ) J ( : 3 ) ,
   w 13 = G ( 1 : ) J ( : 7 ) , w 23 = G ( 2 : ) J ( : 7 ) , w 33 = G ( 3 : ) J ( : 7 ) ,
   w 14 = G ( 1 : ) J ( : 4 ) , w 24 = G ( 2 : ) J ( : 4 ) , w 34 = G ( 3 : ) J ( : 4 ) ,
   w 15 = G ( 1 : ) J ( : 5 ) , w 25 = G ( 2 : ) J ( : 5 ) , w 35 = G ( 3 : ) J ( : 5 ) ,
   w 16 = G ( 1 : ) J ( : 2 ) , w 26 = G ( 2 : ) J ( : 2 ) , w 36 = G ( 3 : ) J ( : 2 ) ,
   w 17 = G ( 1 : ) J ( : 1 ) , w 27 = G ( 2 : ) J ( : 1 ) , w 37 = G ( 3 : ) J ( : 1 ) .
Therefore, Equation (14) can be written as:
c 2 = c W 11 + d W 12 + W 13 d 2 = c W 21 + d W 22 + W 23 c d = c W 31 + d W 32 + W 33
By observing the relationship between the unknowns c, d, c 2 , d 2 , and cd in Equation (14), the following three identity constraint relations are established:
c 2 d = ( c d ) c ( c d ) d = d 2 c ( c d ) ( c d ) = ( c 2 ) ( d 2 )
Equation (15) is substituted into Equation (16) to obtain:
( c W 11 + d W 12 + W 13 ) d = ( c W 31 + d W 32 + W 33 ) c ( c W 31 + d W 32 + W 33 ) d = ( c W 21 + d W 22 + W 23 ) c ( c W 31 + d W 32 + W 33 ) 2 = ( c W 11 + d W 12 + W 13 ) ( c W 21 + d W 22 + W 23 )
Equation (17) can be expanded as follows:
s 11 c 2 + s 12 c d + s 13 c + s 14 d 2 + s 15 d = 0 s 21 c 2 + s 22 c d + s 23 c + s 24 d 2 + s 25 d = 0 s 31 c 2 + s 32 c d + s 33 c + s 34 d 2 + s 35 d + s 36 = 0
where s 11 = W 31 , s 12 = W 11 W 32 , s 13 = W 33 , s 14 = W 12 , s 15 = W 13 ,
   s 21 = W 21 , s 22 = W 31 W 22 , s 23 = W 23 , s 24 = W 32 , s 25 = W 33 ,
   s 31 = W 31 2 W 11 W 21 , s 32 = 2 W 31 W 32 W 12 W 21 W 11 W 22 ,
   s 33 = 2 W 31 W 33 W 13 W 21 W 11 W 23 , s 34 = W 32 2 W 12 W 22 ,
   s 35 = 2 W 32 W 33 W 13 W 22 W 12 W 23 , s 36 = W 33 2 W 13 W 23
Since Equation (18) still contains c 2 , d 2 , and cd coefficient, Equation (15) is substituted into Equation (18) to obtain:
( s 13 + s 11 W 11 + s 14 W 21 + s 12 W 31 ) c + ( s 15 + s 11 W 12 + s 14 W 22 + s 12 W 32 ) d + s 11 W 13 + s 14 W 23 + s 12 W 33 = 0
( s 23 + s 21 W 11 + s 24 W 21 + s 22 W 31 ) c + ( s 25 + s 21 W 12 + s 24 W 22 + s 22 W 32 ) d + s 21 W 13 + s 24 W 23 + s 22 W 33 = 0
( s 33 + s 31 W 11 + s 34 W 21 + s 32 W 31 ) c + ( s 35 + s 31 W 12 + s 34 W 22 + s 32 W 32 ) d + s 36 + s 31 W 13 + s 34 W 23 + s 32 W 33 = 0
At this time, Equations (19)–(21) are jointly written into a matrix form:
h 11 h 12 h 13 h 21 h 22 h 23 h 31 h 32 h 33 c d 1 = 0 H ( b ) c d 1 = 0
where h 11 = s 13 + s 11 W 11 + s 14 W 21 + s 12 W 31 ,
   h 12 = s 15 + s 11 W 12 + s 14 W 22 + s 12 W 32 ,
   h 13 = s 11 W 13 + s 14 W 23 + s 12 W 33 ,
   h 21 = s 23 + s 21 W 11 + s 24 W 21 + s 22 W 31 ,
   h 22 = s 25 + s 21 W 12 + s 24 W 22 + s 22 W 32 ,
   h 23 = s 21 W 13 + s 24 W 23 + s 22 W 33 ,
   h 31 = s 33 + s 31 W 11 + s 34 W 21 + s 32 W 31 ,
   h 32 = s 35 + s 31 W 12 + s 34 W 22 + s 32 W 32 ,
   h 33 = s 36 + s 31 W 13 + s 34 W 23 + s 32 W 33 .
According to Equation (22),
d e t ( H ( b ) ) = 0
After the operation and arrangement of Equation (23) with Matlab software, a polynomial equation, with the highest degree of 8 and only the unknown b, can, finally, be obtained:
E 8 b 8 + E 7 b 7 + E 6 b 6 + E 5 b 5 + E 4 b 4 + E 3 b 3 + E 2 b 2 + E 1 b = 0
where E i (i = 0, 1, 2, 3, ..., 8) is the known coefficient. The eigenvalue method is used to calculate the root of b, which has at most 8 roots. The value of c and d can be obtained by substituting b back into Equations (19)–(21), and, thus, clarifying the value of the rotation matrix R and translation vector t.

2.4. Precise Positioning Based on Gauss–Newton Iterative Method

In the previous section, the solution x is obtained with the help of Equation (24), but Equation (11) is not strictly satisfied, due to the presence of noise. As the solution, after using the hidden variable method, is very close to the optimal solution, the solution x is further accurately located thanks to the application of the Gauss–Newton method to solve the least square method. The iteration times of the Gauss–Newton method are no more than 2, given the optimal initial solution. Therefore, the pose measurement problem is taken as an optimization problem again, making the pose solution as close to the global optimal value as possible through precise positioning. The following mathematical description is given:
x = a r g m i n ( x T F T F x )
The F T F is the constructed 10 × 10 symmetric matrix, and the iterative equation of x is x = x + Δ x , where Δ x = [ ( F J ) T ( F J ) + λ I 3 × 3 ] 1 ( F J ) T F x , λ is the damping factor, and F J is the Jacobian matrix of F, having expression:
F J T = 0 1 0 0 2 b c d 0 0 0 0 0 1 0 0 b 0 2 c d 0 0 0 0 1 0 0 b 0 c 2 d

3. Experiments and Analysis

3.1. Testbed and Test Synthesis Data Generation

This section describes the Matlab simulation experiments conducted on Hidden PnP and the existing classical PnP algorithm, based on synthetic data, in terms of solving accuracy, anti-noise ability, and operational efficiency. The experimental results are compared and analyzed. The PnP algorithms involved in the comparison were LHM, EPnP+GN, RPnP, DLS, OPnP, SRPnP, RDLT, and ASPnP, etc. The simulation experiment was completed on a 4-core CPU model i5-4200H notebook with the main frequency of 2.80 GHz and a running memory of 8 G.
A virtual camera, with an image size of 640 × 480 pixels and a focal length of 800 pixels, was constructed on the Matlab platform. When generating random 3D reference points, the matrix composed of 3D reference points was set as Q = [ q 1 w , q 2 w , q 3 w , , q n w , ] T , as the solving accuracy of PnP algorithm was affected by the distribution of 3D spatial points, so as to reasonably test the solving accuracy of each PnP algorithm. According to the different rank of the matrix Q T Q , the following three situations could be selected to randomly generate 3D reference points:
(1) Ordinary 3D: rank( Q T Q ) = 3, in which 3D reference points were randomly generated within the range of [−2,2] × [−2,2] × [4,8]. In this case, the minimum eigenvalue was almost close to 0.
(2) Planar Case: rank( Q T Q ) = 2 in which 3D reference points were randomly generated within the range of [−2,2] × [−2,2] × [0,0]. In this case, all reference points were on the same plane.
(3) Quasi-Singular: rank( Q T Q ) = 3, in which 3D reference points were randomly generated within the range of [1,2] × [1,2] × [4,8], and the ratio of the minimum eigenvalue to the maximum eigenvalue was less than 0.05.
After generating the above initial 3D spatial reference points, a rotation matrix and a translation vector were first generated randomly as the truth values of the simulation experiment, which were respectively R t u r e and T t u r e . Secondly, the generated 3D spatial reference points were converted from the camera coordinate system to the world coordinate system. Finally, different PnP algorithms were adopted to convert the reference points in the world coordinate system, obtained in the previous step, to the image plane, and, thus, obtaining the estimated rotation matrix R e s t and translation vector T e s t . In order to be consistent with the definition of evaluation error in existing literature, this paper adopted the definition of error in [17]:
e r o t ( d e g r e e ) = max k 1 , 2 , 3 c o s 1 ( r k , t r u e T r k , e s t T ) × 180 / π
e r o t ( % ) = t e s t t t r u e t t r u e × 100
The performance of PnP algorithm was certainly immune from the definitions adopted.

3.2. Comparative Simulation Test of the Calculation Accuracy of PnP Methods under Different Circumstances

In this section, the method described in the previous section was adopted to generate 4 to 20 3D spatial reference points under the cases of Ordinary 3D, Planar Case, and Quasi-Singular, respectively, which served as the experimental input data of the PnP algorithm to be tested. At the same time, zero-mean Gauss noise, with a size of δ = 2 pixels, was added to the test image. In the test, each PnP algorithm was independently tested 500 times under a fixed number of 3D reference points. Due to the large number of algorithms and the data, the following graph could only be used for macroscopic performance comparison, and readers can refer to Appendix A (Table A1, Table A2 and Table A3) for the specific test data. Figure 3, Figure 4 and Figure 5 show the comparison of the mean errors (a,c) and median errors (b,d) of the rotation matrix and the translation vector in the Ordinary 3D, Planar, and Quasi-Singular cases, respectively, with spatial reference points n ranging from 4 to 20, and δ = 2. For all figure groups, the four sub-figures are: a. mean error of the rotation matrix; b. median error of rotation matrix; c. mean error of translation vector; d. median error of translation vector. To avoid repetitive expressions, only the different cases are given in the title of the figure.
According to the above simulation tests, due to the iterative method used and the sensitivity of the initial value problem, the LHM algorithm exhibited higher error and rapid fluctuation of accuracy error in Ordinary 3D, Planar Case, and the Quasi-Singular case, and especially so in the latter, compared with other PnP algorithms in the presence of fewer spatial redundant points. The EPnP+GN algorithm, which was also a non-iterative algorithm, also produced a large error when there was noise and few spatial redundant points, which came down to the linear solution method adopted. Meanwhile, it was found that, if the Gauss–Newton method was not introduced to optimize the solutions of EPnP+GN, the performance of the EPnP algorithm alone was as unsatisfactory as that of the LHM algorithm. Interested readers could conduct experiments to ascertain the performance gap. The authors no longer tested the difference alone. In the above three cases, the DLS algorithm fluctuated greatly, which could be explained by the lack of proper treatment regarding the singularity of the CGR parameters, and, thus, the poor accuracy error and stability of its solution. The RPnP algorithm used linearization to transform non-linear equations into linear equations, and its optimization was still non-global, which led to its less favorable solution error and stability, compared with OPnP, SRPnP, RDLT, ASPnP, and Hidden PnP, etc. The OPnP, SRPnP, RDLT, and ASPnP, etc. exhibited favorable stability, and the accuracy error and stability of the four algorithms were similar.
Through a detailed comparison of the simulation data, it was easy to see that the best performance among the above nine algorithms was the Hidden PnP, which had the smallest error in solution accuracy. In addition, this algorithm provided the best stability in solving the three cases, without large fluctuations. The reason for this was that the Hidden PnP could quickly calculate the solution near the optimal solution. On this basis, the algorithm used this solution as the initial value of the Gauss–Newton method to achieve the precise location of the solution in one or two iterative steps. This process avoided the problem of unreasonable choice of initial values when using the Gaussian–Newton method directly, and also avoided the operational instability and large computational burden caused by the need to construct a large matrix elimination template using the Gröbner basis technique. The Hidden PnP, therefore, had the high accuracy and universality sought by the PnP algorithm.

3.3. Comparative Simulation Test of Anti-Noise Performance of the PnP Method

The above simulation tests demonstrated the smaller accuracy error and better stability of the Hidden PnP, compared with other PnP algorithms, in different cases. Due to the interference of the environment and electronic equipment in practice, the collected information contained noise, so it was necessary to compare the anti-noise performance of the Hidden PnP algorithm and other PnP algorithms, which is a vital index of the comprehensive performance of a PnP algorithm. Accordingly, the following anti-noise performance simulation tests were conducted, in which the 3D spatial reference point n was set to be 10, and 10 different noise zero-mean Gaussian noises were set in Ordinary 3D, Planar Case, and Quasi-Singular case, respectively. The pixel value distribution started from δ = 0.5 pixels and increased to δ = 5 pixels by arithmetic sequence, with a tolerance of 0.5 pixels. In the above three cases, each PnP algorithm was independently tested 500 times for each fixed noise pixel value. Due to the large number of algorithms, compared in the simulation test, and the large amount of data, the following data curve could only be used as a macroscopic performance comparison display. Refer to Appendix B (Table A4, Table A5 and Table A6) for the specific test data. Figure 6, Figure 7 and Figure 8 shows the error comparison of zero-mean Gaussian image noise from 0.5 to 5 pixels in ordinary 3D, coplanar, and quasi-singularity cases, respectively. For all figure groups, the four sub-figures were: a. mean error of the rotation matrix; b. median error of rotation matrix; c. mean error of translation vector; d. median error of translation vector. The spatial reference point n = 10.
The above simulation test curve and data revealed that the LHM algorithm exhibited the worst anti-noise ability in the above three cases, and the solution accuracy error of the DLS and EPnP+GN algorithms jumped with larger noise pixels. The anti-noise ability of the RPnP algorithm was better than that of the DLS and EPnP+GN algorithms, but worse than that of the OPnP, SRPnP, RDLT, and ASPnP algorithms. It was obvious that the Hidden PnP algorithm had the best anti-noise ability among the above nine algorithms.

3.4. Comparative Simulation Test of Calculation Efficiency of Different PnP Methods

The above simulation tests demonstrated that the solution accuracy error of the Hidden PnP algorithm was smaller than that of existing excellent PnP algorithms in Ordinary 3D, Planar Case, and Quasi-Singular cases. The Hidden PnP outperformed in anti-noise ability, which, however, was not enough. As mentioned in the introduction, an excellent PnP algorithm should perform not only with stability, accuracy, and universality, etc., but also with high computational efficiency. This section compares the computational efficiency of algorithms, including LHM, EPnP+GN, RPnP, DLS, OPnP, SRPnP, RDLT, and ASPnP, with Hidden PnP. In this simulation experiment, the pixel value δ of zero-mean Gaussian noise was fixed to be 2, and the number of spatial reference points n in the PnP algorithms involved increased from 4 to 500. Each PnP algorithm was independently tested 1000 times with different numbesr of spatial reference points, and the average running time calculated.
As shown in Figure 9 and Table 2, the simulation results here were the same as those mentioned in the introduction. The main factor affecting the efficiency of the LHM algorithm was the iterative solution, the duration of which accelerated with increase of spatial redundant point quantity. The DLS algorithm transformed the pose estimation problem into an unconstrained least square minimization problem through the construction of a cost function, which failed to avoid increase in its computational time with more spatial redundant points. The computation time of the ASPnP and OPnP algorithms did not increase much with the climbing spatial reference points. However, the Gröbner technique required the construction of a large elimination template matrix, which was the main burden that affected the operational efficiency of these algorithms. It is worth noting that the phased solution of the RPnP algorithm had the fastest speed among all algorithms when the spatial reference point was n ≤ 200. Nevertheless, with the increase in the number of points, the computational time gradually increased. The SRPnP, as an improved version, also had the same problem. The RDLT algorithm adopted the traditional linear solution, considering the constraints between points, the efficiency of which was better than that of the ASPnP algorithm when the spatial reference point was n ≤ 100. To sum up, the runtime simulation results from the various algorithms showed that, at 500 spatial reference points, the hidden variable-based PnP algorithm had a computational efficiency 1.5 to 7 times higher than those of the other algorithms that are considered excellent.

3.5. Materials and Experimental Protocol for Physical Experiments

Based on synthetic data, the above section compared the performance of the Hidden PnP algorithm with the other eight PnP algorithms, and the Hidden PnP algorithm proved to have better accuracy, stability, anti-noise ability, and calculation speed. In this section, the authors applied the Hidden PnP algorithm and the other eight algorithms to physical objects, so as to reveal their actual performances.
The experimental materials employed included a high-resolution camera and high-precision checkerboard calibration board. In addition, the experiment adopted a Rmoncam G180 camera, featuring a distortionless angle of 120 (Figure 10a), a resolution of 1920 × 1080, and a pixel size of 3.01 μ m. Zhang’s camera calibration method [25] was also employed to calibrate the internal parameters of the Rmoncam G180 camera. As to the calibration board, a customized black and white checkerboard was utilized (Figure 10b), in which the size of each checkerboard was 30 mm × 30 mm, and the machining accuracy error was 0.01 mm. Table 3 depicts the internal parameters of the Rmoncam G180 camera’s calibration.
Figure 11 illustrates the specific experimental process. The cyan circle ‘∘’ in Figure 12 refers to the position of all corner points within the extraction range of corner points on the calibration plate. Figure 13 reveals the 10 images of the calibration plate under different attitudes, where blue ‘∘’ stands for the sub-pixel corner point randomly extracted by various PnP algorithms, while the red ‘+’ represents the reprojection corner point calculated through the PnP algorithms. The loss function to evaluate the performance of the PnP algorithms was constructed as:
δ ¯ = 1 100 i = 1 100 ( u i u ¯ i ) 2 + ( v i v ¯ i ) 2
The following can be observed from the reprojection error test data in Table 4: the DLS algorithm had the largest error, followed by the LHM algorithm. Except for the Hidden PnP algorithm, the error accuracy of the remaining six algorithms did not differ greatly. In general, the mean and median errors of reprojection coordinate points of the Hidden PnP algorithm were basically equal to, or even slightly superior to, the optimized algorithms, including OPnP, SRPnP, and ASPnP. Nonetheless, the solution method of the Hidden PnP performed with the best efficiency. The experiment on physical objects in this section also revealed that the Hidden PnP could match the best existing PnP method in solution accuracy, which supported the cost performance of the algorithm in solving PnP problems.
Figure 11. Flow chart of physical objects reprojection experiment.
Figure 11. Flow chart of physical objects reprojection experiment.
Applsci 13 01111 g011
Figure 12. Extraction range of corner points on calibration board.
Figure 12. Extraction range of corner points on calibration board.
Applsci 13 01111 g012
Figure 13. Ten images of the calibration plate at different distances and attitudes and the reprojection effects.
Figure 13. Ten images of the calibration plate at different distances and attitudes and the reprojection effects.
Applsci 13 01111 g013

4. Conclusions and Prospects

The PnP solution, based on a projective imaging model of 3D points, fails to cover accuracy, robustness, and efficiency simultaneously because of the diverse spatial distribution and quantity of 3D reference points, which prompted us to propose a new method for solving the PnP problem, the Hidden PnP. The Hidden PnP employs the CGR parameter to parameterize the rotation matrix. Differing from the best matrix synthesis technique, the Gröbner technique, the method reduces computational burdens, as it does not require construction of a large matrix elimination template in the polynomial solution phase. The CGR parameter matrix was solved by the hidden variable method, and the Gauss–Newton method was adopted for rapid and accurate location of a solution. The comparison test demonstrated that the Hidden PnP outperformed eight other algorithms in solution accuracy, stability, anti-noise ability, and calculation speed, in both synthetic data and real experiments, which supported its application to high precision position measurement in a common environment. Future work will, therefore, involve applying this algorithm to vision-based navigation for intelligent vehicles and UAVs with real-time positional measurement techniques.

Author Contributions

Conceptualization, R.Q., G.X., P.W. and Y.C.; Methodology, R.Q. and P.W.; Resources, G.X., Y.C. and W.D.; Software, R.Q. and P.W.; formal analysis, R.Q., G.X. and P.W.; Writing—original draft, R.Q.; Writing—review and editing, G.X., P.W. and R.Q. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported, in part, by the National Key Research and Development Plan, under Grant 2018YFB2003803, and, in part, by the National Natural Science Foundation of China, under Grants 62073161, 61905112 and U1804157.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

P3PPerspective-3-Point
P4PPerspective-4-Point
P5PPerspective-5-Point
PnPPerspective-n-Point
GNGauss-Newton iterative method
CGRCayley-Gibbs-Rodriguez
SLAMSimultaneous Localization and Mapping
DLTTraditional direct liner transformation
ASPnPAccurate and Scalable Solution to the Perspective-n-Point problem
RPnPA Robust O(n)Solution to the Perspective-n-Point problem
OptDLSOptimal DLS Method
SRPnPA simple, robust and fast method for the Perspective-n-Point problem
Hidden PnPhidden variable-based PnP algorithm

Appendix A

Table A1. Error comparison in the Ordinary 3D case.
Table A1. Error comparison in the Ordinary 3D case.
Algorithm4567891011121314151617181920
LHMmean_r13.07544.72512.51000.94730.72020.56880.42620.40570.37160.35420.32340.31220.31320.28500.26360.27370.2643
med_r1.37710.74890.61500.49030.45020.42370.38130.37060.33140.31560.29540.29720.28820.26540.25380.25170.2489
mean_t3.46791.78900.86950.53370.45410.38980.28530.273710.25190.23940.23550.20460.20670.20020.20340.18430.1840
med_t0.87070.43740.38250.30660.27430.26520.23580.21890.20010.20640.19500.16760.17670.16580.17660.15640.1566
EPnP+GNmean_r76.88485.55890.77450.61510.56000.48980.45360.43900.39060.38530.35670.34880.35140.31390.30040.30210.2911
med_r62.50520.76610.62970.52850.49790.44440.40940.40630.35700.35340.33340.31920.32620.29160.28320.28260.2719
mean_t84.10456.13230.62790.49370.45390.41670.38120.34890.32520.31860.29130.27340.26590.26700.26150.23360.2373
med_t25.36510.56230.47910.38820.33860.33420.29730.28330.25890.26450.23900.22560.23090.21890.21930.18910.1919
RPnPmean_r1.58390.97860.82740.66250.60470.51800.48340.48180.42880.42270.39630.37320.40690.36230.33410.36380.3328
med_r0.91320.71240.61700.53340.50190.45010.41160.43530.38940.37540.35350.34770.34810.32030.30410.33620.3049
mean_t0.87060.67300.58240.50430.46750.44350.40160.41420.37750.34910.36000.32070.33360.30900.32140.30140.2838
med_t0.56580.45720.43370.38150.35320.36110.31640.33110.28690.28620.28540.26240.25620.24610.26730.23950.2384
DLSmean_r1.71261.03782.20250.52281.62351.02652.54970.99341.61830.95331.53331.79040.91601.91071.23650.27641.3690
med_r0.80890.63070.56860.46560.43990.40490.37970.36930.32940.31250.30380.30020.28830.27710.25250.25640.2514
mean_t0.79900.89442.08030.36061.29891.05791.96190.85201.45620.85371.21391.47120.96131.55521.18960.18401.3562
med_t0.49040.36760.32810.27780.26260.25590.23860.21920.20050.20470.19340.16860.17460.16710.17670.15780.1561
OPnPmean_r1.08440.73660.63800.51880.47240.42590.39670.38170.34300.34020.31060.31060.30380.28210.26350.27220.2628
med_r0.80240.63210.56110.46140.43290.40750.36910.36310.32910.31300.29560.29540.28890.26700.25320.24850.2502
mean_t0.66260.47220.40350.35710.31190.29550.27540.26140.24040.23120.22770.20300.20080.19640.20190.18140.1818
med_t0.48230.36760.32810.28320.25230.25130.23090.21770.19940.20060.19140.16530.17580.16610.17400.15460.1566
SRPnPmean_r1.09250.73020.64230.51260.47480.42640.40120.38480.34600.34000.31780.31560.30820.28650.26740.27200.2628
med_r0.79140.62250.55510.45030.43080.40140.37620.36330.32780.30770.29960.30050.28840.27150.25100.25360.2472
mean_t0.62620.46620.40390.35600.31230.29540.27530.25970.24020.23120.22840.20280.20040.19740.20150.18140.1818
med_t0.46360.36880.32030.27950.25320.25000.23130.21320.19660.20140.18930.16740.17500.16310.17500.15430.1570
RDLTmean_r8.13811.34150.63820.51880.47240.42590.39670.38170.34300.34020.31060.31060.30380.28210.26350.27220.2628
med_r0.88140.63330.56110.46140.43290.40750.36910.36310.32910.31300.29560.29540.28890.26700.25320.24850.2502
mean_t1.63060.52070.40370.35710.31190.29550.27540.26140.24040.23120.22770.20300.20080.19640.20190.18140.1818
med_t0.54070.36760.32810.28320.25230.25130.23090.21770.19940.20060.19140.16530.17580.16610.17400.15460.1566
ASPnPmean_r1.18010.73590.69400.52150.47920.43530.43320.39000.35920.34590.32030.32750.31210.33740.28440.27620.2698
med_r0.80740.62540.56830.46510.43800.41050.37900.36860.32910.31140.30330.30260.28860.27400.25320.25490.2504
mean_t0.66880.47090.42090.35910.31300.29770.28080.26200.24170.23350.22850.20440.20230.21060.20450.18170.1822
med_t0.48690.37390.32500.27980.25670.25400.23240.21420.20120.20290.18960.16660.17570.16480.17510.15600.1570
Hidden PnPmean_r1.00960.68250.59210.48680.43740.39590.37460.36030.32130.31910.29110.29400.28400.26750.24520.25200.2432
med_r0.77240.57110.52310.43080.40470.36690.35300.33500.30530.29220.27470.27740.26820.25320.23660.22930.2305
mean_t0.62060.44720.39120.34570.30410.29110.27080.25750.23580.22830.22410.20060.19710.19630.20000.18050.1803
med_t0.46140.34230.31020.26980.24520.24360.21980.21160.19630.19990.18500.16410.16850.16170.17430.15370.1546
Note: mean_r and med_r represent mean error and median error of rotation matrix, respectively. mean_t and med_t represent the mean error and median error of the translation vector, respectively.
Table A2. Error comparison in the Planar Case.
Table A2. Error comparison in the Planar Case.
Algorithm4567891011121314151617181920
LHMmean_r47.608441.166638.517929.199635.254135.372330.195332.559527.341132.620827.360326.631724.999030.027224.138629.026127.5716
med_r17.305710.92266.04213.96394.39743.01462.57182.40911.51801.73601.23851.15471.62151.16101.04361.55801.2107
mean_t11.85807.48816.64244.74414.33243.86453.52533.33292.95972.79852.63142.59282.67322.34252.20642.30232.2538
med_t4.43632.92521.87591.33801.35401.05151.02700.98670.73590.85610.63100.61240.67810.62830.61730.68530.5652
EPnP+GNmean_r72.548752.776155.437343.629043.733847.646349.123754.207246.354253.321448.854249.044947.150744.550250.444545.766239.7199
med_r38.682611.04407.68764.04133.56323.15513.00512.80452.41112.37002.06791.93201.86531.65251.68501.57601.4522
mean_t31.145810.83528.60826.14555.36505.71934.85015.01414.07944.21413.85483.97623.29503.08373.38973.28712.6048
med_t14.92915.07014.13442.44291.87842.20161.61471.64941.29801.32111.23841.29761.01841.07241.16010.88450.8339
RPnPmean_r13.72715.35083.03982.17761.66701.65991.57121.39001.56111.25741.39941.22041.21331.11291.19331.21651.1784
med_r2.04871.64771.26441.13591.09540.97170.91960.89950.87590.77880.82190.77080.78300.73360.70490.69390.6917
mean_t2.86461.76231.14461.05260.89430.82620.86890.73950.67820.67340.64900.63750.53830.58010.63240.53770.5457
med_t1.15860.89320.69910.69150.61360.58450.59370.51730.42450.45760.43780.44870.37310.38380.38130.35630.3402
DLSmean_r3.51222.94642.42602.92212.54622.24543.92042.44942.13852.29302.39933.91471.89411.61002.33383.47972.4525
med_r1.61321.28571.02010.88610.81740.73580.77030.65040.61890.58020.56040.52320.51410.50950.46590.46480.4623
mean_t2.28292.28971.96812.49442.50192.10913.92742.26772.01801.92411.94484.19851.66311.40682.44172.63882.5014
med_t0.90780.71680.52600.47020.46520.44260.44660.36330.33420.34310.31360.32650.29850.270370.27600.27160.2727
OPnPmean_r2.63901.82391.47531.45020.98410.98690.95140.81940.80340.72220.70240.65110.67000.59550.57210.58490.5535
med_r1.58361.28971.01400.87490.81750.71510.75630.63840.61840.57480.55210.51670.51980.49650.45340.46050.4277
mean_t1.47201.02240.81030.70820.61560.57240.55810.47320.42450.42090.38700.40750.35670.35510.35910.32390.3174
med_t0.88020.69600.52770.45160.45920.42560.43360.35750.32240.33100.30130.31220.27800.26780.27550.25480.2520
SRPnPmean_r2.59631.85621.41611.30391.01420.98661.01940.86870.83840.75470.74660.67950.70010.62160.62010.66930.5857
med_r1.54981.24001.01410.87070.80910.73890.75730.63990.61600.56810.56380.51750.51160.50560.46660.46440.4632
mean_t1.54481.02000.78100.70410.60380.56490.55230.48610.42430.42910.38610.41150.35600.35460.37150.34070.3244
med_t0.83690.68110.50810.46370.45080.42460.41080.35530.33030.32050.29740.32010.27800.26610.26840.27250.2561
RDLTmean_r27.89869.41042.72831.45170.98811.29520.95040.82010.80380.72270.70240.64970.66970.59520.57290.58490.5533
med_r2.23861.34941.02190.89230.81280.71420.75610.63500.61500.57530.55030.51580.51940.49740.45380.46140.4273
mean_t4.86011.71101.00660.71030.61650.61020.55810.47370.42470.42100.38700.40760.35650.35510.35920.32390.3174
med_t1.21060.72450.53130.45190.46030.42080.42980.35980.32030.33080.30230.31140.27850.26700.27580.25780.2511
ASPnPmean_r12.10864.28742.44471.81091.37611.30701.40861.3700.86220.95461.14120.81690.82101.01470.81631.07890.6431
med_r1.78271.35451.04360.89180.81520.73750.77230.65780.62340.58170.55660.52670.52320.51150.46620.47000.4596
mean_t2.57041.31431.06460.78000.65100.64910.72300.57230.45060.52070.42910.44300.40740.48730.41240.35260.3315
med_t1.00660.72180.53150.47080.45230.43630.43710.35900.33370.34150.30950.32370.29700.27140.27530.27220.2650
Hidden PnPmean_r2.21231.62861.27071.10900.88880.87770.85820.73650.71610.64610.64730.57360.59860.54640.52630.53720.5011
med_r1.48381.18020.92720.80690.73130.66610.67510.58910.55100.53120.50150.46800.4720.45660.41640.41030.4130
mean_t1.26030.96130.71470.63700.57010.52970.52590.44060.39960.40070.36960.37850.33810.33920.33580.31430.2988
med_t0.82100.64140.46540.42130.41390.39860.39550.31360.30090.30480.27790.28510.26510.26130.25450.25510.2284
Note: mean_r and med_r represent mean error and median error of rotation matrix, respectively. mean_t and med_t represent the mean error and median error of the translation vector, respectively.
Table A3. Error comparison in the Quasi-Singular case.
Table A3. Error comparison in the Quasi-Singular case.
Algorithm4567891011121314151617181920
LHMmean_r88.536383.416076.366264.912959.471357.780453.261252.271545.990846.935244.380234.826934.890432.986041.769329.620727.1142
med_r114.8179113.0583107.27537.56162.53221.48961.44041.33850.96890.96290.82840.74230.75790.73130.75870.61660.5740
mean_t22.427523.532323.109621.519221.952622.120122.490223.999420.634122.297321.050417.142516.942217.035521.416415.158514.5199
med_t13.375314.377712.45026.31863.85562.48192.62391.84761.24481.28441.23370.95370.92840.96411.00830.84740.7319
EPnP+GNmean_r79.980322.01465.80363.06811.91690.91110.92530.80370.73830.70270.68570.64680.64260.62750.59200.55850.5544
med_r109.59471.69051.18970.97480.89910.80500.80550.71310.65090.61970.59870.58230.58390.53510.53560.51210.4868
mean_t85.951525.57837.55264.23052.87721.38901.41771.17681.17661.00311.04931.04880.84510.93530.86320.79290.8156
med_t35.42332.82691.77181.41471.32411.12031.07220.88590.89690.78600.86290.87470.65220.80470.70560.64560.7045
RPnPmean_r2.47541.52921.24791.27400.95380.85810.86100.78460.72370.68900.67230.65040.65310.63400.60770.56300.5647
med_r1.52161.30751.07440.91480.83160.75980.79670.69820.64370.61880.60170.58320.59670.57100.54830.51050.5024
mean_t3.42422.24081.83961.65561.51151.42161.36921.25211.28471.13561.14851.13971.12621.16221.10481.04471.0828
med_t1.75361.70591.34821.15991.18541.10571.01530.97261.03660.88780.89600.85050.89170.97170.85750.84540.8771
DLSmean_r2.50753.17151.82122.80812.45422.65682.35541.67201.99851.29622.17922.34212.45982.82392.22151.80872.1475
med_r1.46061.27131.04370.87940.80340.73000.75880.68850.61640.58610.57360.55530.55420.56520.50160.47370.4619
mean_t2.78703.76591.99552.29022.02882.43682.30091.65331.89061.43512.12462.12292.23862.23401.94131.64191.5749
med_t1.61991.47881.15361.01440.96940.84270.80760.75840.65470.62830.67160.61930.56690.64380.56780.54720.5149
OPnPmean_r1.89251.43841.19890.97760.89680.79940.81200.73180.66290.63800.62430.59950.59820.57960.54810.50830.5075
med_r1.44761.23641.00590.85740.79720.70710.74540.64770.58370.56590.55270.53860.53490.51240.47290.45290.4495
mean_t2.27921.81781.43811.16281.08620.98940.97100.86490.79130.74510.71720.73680.63740.70120.64200.59930.5948
med_t1.52951.44141.12410.97780.90970.81190.79070.72380.63830.62190.61000.58370.51890.59800.54550.50320.5020
SRPnPmean_r1.86801.44071.20950.99570.91670.83620.83450.76670.69810.65110.64770.63100.63160.62970.57940.53050.5305
med_r1.43321.23431.00210.82860.79980.73630.75630.68820.60600.56680.57540.55470.55120.56040.49140.46980.4664
mean_t2.12901.61881.31441.04511.00250.87580.84340.78500.72040.65810.66240.67060.56870.61170.59990.54110.5357
med_t1.30961.27550.97570.85240.79200.70560.67010.60340.56490.55260.53050.50350.43110.52320.47540.45880.4310
RDLTmean_r20.28516.04323.61670.97760.89680.79940.81200.73180.66290.63800.62430.59950.59820.57960.54810.50830.5075
med_r1.73251.24561.00850.85740.79720.70710.74540.64770.58370.56590.55270.53860.53490.51240.47290.45290.4495
mean_t9.41434.41182.10331.16281.08620.98940.97100.86490.79130.74510.71720.73680.63740.70120.64200.59930.5948
med_t1.95521.53401.14650.97770.90970.81190.79070.72380.63830.62190.61000.58370.51890.59800.54550.50320.5020
ASPnPmean_r2.14091.48131.25241.04840.93500.85380.84210.78110.71250.67320.65230.65270.64950.66670.60850.56660.5510
med_r1.45281.25721.02280.87520.80300.72730.76100.67300.61290.58280.57090.55320.54490.55850.49120.47200.4606
mean_t2.33471.83931.44141.21821.13391.02860.97710.90110.80750.76810.76320.76500.67960.72520.66490.61980.6496
med_t1.63151.47851.09540.98170.91230.83010.79250.74120.64620.62470.63750.59440.56580.63860.56770.53230.4971
Hidden PnPmean_r1.81361.39401.14020.92560.85050.75690.74560.70230.62400.61540.60220.56940.56850.54230.51960.48360.4949
med_r1.41741.16410.96620.80110.73920.66730.65300.62560.54910.53060.52130.49510.49920.49050.43790.41940.4173
mean_t1.98151.58161.27491.02200.94190.89080.82210.76880.69780.64590.64520.65460.57550.59230.54890.52310.5183
med_t1.33541.19690.91790.79790.74180.70170.61400.57040.53930.52930.49170.48220.44240.49280.44940.39410.3843
Note: mean_r and med_r represent mean error and median error of rotation matrix, respectively. mean_t and med_t represent the mean error and median error of the translation vector, respectively.

Appendix B

Table A4. Error comparison in ordinary 3D case.
Table A4. Error comparison in ordinary 3D case.
Algorithm0.511.522.533.544.55
LHMmean_r0.18070.18070.32200.41750.53930.60300.70310.83860.93431.0227
med_r0.09720.19520.26460.36050.46670.53710.63640.76460.82170.9407
mean_t0.10860.15370.21900.29470.35020.44610.49190.55680.62070.6865
med_t0.06060.11400.18210.23590.28180.36450.41720.45950.50960.5810
EPnP+GNmean_r0.11410.23000.33240.43710.56750.67530.78550.92131.04721.1810
med_r0.10370.20470.28900.40320.52460.59900.71600.84510.91601.1029
mean_t0.09250.19240.27300.36830.45620.59880.64000.70360.84480.9137
med_t0.07360.15400.21590.30600.37940.48190.53230.57000.71590.7540
RPnPmean_r0.12750.23340.35490.47710.59380.76430.84910.99581.10191.2677
med_r0.11300.20500.30830.42290.53230.64330.74520.90710.97751.1195
mean_t0.10750.19070.30730.40240.50640.64490.70000.85060.93450.9841
med_t0.08130.15840.23910.32590.40660.51560.55250.66500.75640.8090
DLSmean_r0.44751.14871.11471.22961.15242.10322.54931.41942.55003.1087
med_r0.09150.18750.25990.35990.46700.53280.63480.77460.82330.9797
mean_t0.38530.95461.09050.87490.89641.85092.08461.24602.26592.0337
med_t0.05580.10860.17550.23200.28030.36470.41790.47370.51780.5843
OPnPmean_r0.10010.20370.28630.38360.49680.58460.68130.82090.89241.0151
med_r0.09050.18420.26250.35450.46420.53440.62720.76510.81770.9449
mean_t0.06770.13340.20540.27470.33450.43350.47470.54920.60420.6784
med_t0.05540.10840.17050.23530.27640.35920.42070.46820.49820.5691
SRPnPmean_r0.10020.20520.29140.38920.49730.58410.69090.82700.89881.0289
med_r0.09080.18550.26160.35860.46510.52330.62990.76140.81140.9360
mean_t0.06780.13310.20630.27440.33350.43230.47060.54720.59910.6751
med_t0.05540.10960.16980.22800.27300.36040.41650.46250.48930.5630
RDLTmean_r0.10010.20370.28630.38360.49680.58460.68130.82090.89241.0151
med_r0.09050.18420.26250.35450.46420.53440.62720.76510.81770.9449
mean_t0.06770.133410.20540.27470.33450.43350.47470.54920.604250.6784
med_t0.05540.10840.17050.23530.27640.35920.42070.46820.49820.5691
ASPnPmean_r0.10100.20820.29730.39960.51000.82670.72031.07740.93471.0732
med_r0.09130.18650.26210.36140.47190.53220.63580.77740.82710.9787
mean_t0.06790.13410.20700.27350.33730.55530.47970.64910.61450.6926
med_t0.05550.10910.16960.22720.27540.36290.42210.46520.51540.5753
Hidden PnPmean_r0.09640.19580.26890.35880.45670.53470.61820.76060.82200.9265
med_r0.08890.17730.24320.33530.41690.49130.55800.69410.73930.8596
mean_t0.06730.13170.20330.26890.33040.42420.46470.53450.58660.6613
med_t0.05550.10840.16810.23150.27030.34520.40850.45260.49620.5577
Table A5. Error comparison in Planar case.
Table A5. Error comparison in Planar case.
Algorithm0.511.522.533.544.55
LHMmean_r29.901331.741734.083030.467634.883334.183233.961634.655831.779931.9322
med_r2.84683.21522.79732.07853.69893.10513.17862.92333.29854.2504
mean_t3.36373.52753.90043.44804.01744.03213.52963.49994.00434.3222
med_t0.66590.81650.83310.96651.25371.34881.24991.49561.56731.7776
EPnP+GNmean_r46.839342.677751.080648.385446.957745.888052.042852.903645.168150.2341
med_r0.71381.42162.15563.14493.79994.40345.24006.07516.24057.4797
mean_t3.74853.56325.00094.77055.35295.67496.05096.77266.80517.6502
med_t0.35750.73031.27461.89012.24812.42543.04873.52363.47203.7619
RPnPmean_r0.42610.83531.17781.51301.90982.37713.01382.97314.13764.6917
med_r0.24160.47580.68240.88611.23381.37061.74771.80441.98682.4974
mean_t0.18880.38620.56200.76510.95241.13761.28891.48231.75772.3301
med_t0.12710.26880.40040.54740.68860.79190.88371.08521.11131.3150
DLSmean_r0.42761.28542.69170.95755.00024.24903.45375.87775.02845.3160
med_r0.16480.36620.52330.67190.90631.05961.24451.46111.55961.8049
mean_t0.24011.07732.08540.52964.89744.18412.22315.10084.39774.4116
med_t0.08980.18850.29120.37450.52650.59840.68150.91060.89181.0721
OPnPmean_r0.23260.45860.73640.88151.08901.37461.75621.82472.61622.3749
med_r0.16520.35930.51070.65740.83891.02831.19751.42041.44751.7539
mean_t0.12400.25190.39740.51930.65450.78790.90721.07391.21021.3622
med_t0.08730.19020.28060.37600.48510.59230.66810.85760.90001.0170
SRPnPmean_r0.23570.46290.72050.90081.21791.47941.66441.96712.28052.3890
med_r0.16580.35790.51730.66850.87431.04661.22451.43971.51721.7760
mean_t0.12580.25180.39460.52340.66820.77300.90511.09561.18981.3577
med_t0.08980.18740.27880.37170.47930.58060.63980.83410.84241.0107
RDLTmean_r0.23270.45880.73680.88071.08521.37641.75211.83292.57842.8207
med_r0.16520.36070.51240.65500.83861.02911.19591.42961.44041.7471
mean_t0.12400.25210.39740.51910.65420.78790.90711.07461.21631.3757
med_t0.08750.19100.28160.37820.48460.58680.66470.86160.89471.0055
ASPnPmean_r0.41480.98661.19990.92211.33321.85752.21832.34002.77562.8859
med_r0.16710.36390.52510.67410.91681.07211.24831.46911.59371.8008
mean_t0.26000.42190.41550.52280.71400.85171.06621.27431.24711.5128
med_t0.08990.18770.29160.37190.52610.59500.67900.89650.88231.0750
Hidden PnPmean_r0.21590.42650.64580.78410.97841.23621.39081.64591.78012.0570
med_r0.15730.33590.46340.60460.79880.94361.10921.25751.24351.5755
mean_t0.11970.23950.36780.47880.62680.73510.83150.99761.07731.2631
med_t0.08470.17610.25680.33860.43840.54900.59390.75860.76820.9011
Table A6. Error comparison in Quasi-singularity case.
Table A6. Error comparison in Quasi-singularity case.
Algorithm0.511.522.533.544.55
LHMmean_r54.036454.392149.185154.754155.535053.809061.103750.834059.536348.8130
med_r0.54300.69380.96081.36681.95752.09702.75912.28523.13732.7422
mean_t24.007422.419820.353323.143323.908624.482924.622721.837125.105621.9802
med_t1.08781.16431.50352.28592.69783.33514.18973.20544.93883.9800
EPnP+GNmean_r0.22440.44130.63150.84881.73601.29712.68932.83643.24945.0486
med_r0.19700.38550.53530.77290.98311.11171.28411.59651.80462.0050
mean_t0.33420.64410.96401.24182.46581.92453.60313.72114.59486.5992
med_t0.25980.50300.77240.92101.43541.54201.91402.02682.47012.7201
RPnPmean_r0.21540.42200.61920.82041.06571.22641.56551.81082.70982.9224
med_r0.19040.38170.57500.75540.91991.10431.27031.51761.66041.8881
mean_t0.32900.66770.97601.29761.70742.06992.67633.53945.94006.7567
med_t00.24160.52240.79421.03131.35391.65451.80821.79702.38272.5840
DLSmean_r1.32460.94900.85342.35302.92404.30470.24234.31396.49047.9017
med_r0.18140.36070.51100.71160.88841.06141.28471.42871.64881.8967
mean_t1.33810.93271.11372.42782.92354.21913.29084.67325.98607.7954
med_t0.18570.39560.62320.71111.03051.16561.51681.49782.00952.2148
OPnPmean_r0.20090.39350.57410.76610.98481.14011.37361.56091.73851.9173
med_r0.18000.35760.50580.69690.83951.03581.19201.39281.54631.7345
mean_t0.23050.45190.72250.86221.16811.36801.64631.84622.05572.1876
med_t0.18900.36930.61910.67380.94071.22231.35061.41461.69981.7047
SRPnPmean_r0.20430.40020.58530.80171.01431.23211.44381.72372.34452.8959
med_r0.18310.36370.51660.71460.85961.04421.31451.39971.64071.8299
mean_t0.21700.42130.65100.79031.05471.22601.45961.64292.46502.9031
med_t0.16740.34430.55550.62050.80750.94311.12411.23591.62621.6205
RDLTmean_r0.20090.39350.57410.76610.98481.14011.37361.56091.73851.9173
med_r0.18000.35760.50580.69690.83951.03581.19201.39281.54631.7345
mean_t0.23050.45190.72250.86221.16811.36801.64631.84622.05572.1876
med_t0.18900.36930.61910.67380.94071.22231.35061.41461.69981.7047
ASPnPmean_r0.20860.40220.59880.84281.05031.31271.61881.74502.09892.6162
med_r0.18310.362710.51360.71790.86741.03551.30721.43471.64011.8674
mean_t0.22980.46050.73400.86661.22071.42451.79562.02312.50342.7405
med_t0.18330.37880.61390.69911.01331.12241.46621.49691.88962.0720
Hidden PnPmean_r0.19510.37810.55070.73790.93071.10991.30351.44501.72131.8770
med_r0.16930.34630.48220.66190.78910.98491.13541.24611.45991.6329
mean_t0.21500.41340.64320.76561.01641.15141.38011.53491.82601.8857
med_t0.16650.32780.55250.61210.80360.88531.07881.06221.44211.3561

References

  1. Fischler, M.A.; Bolles, R.C. Random Sample Consensus: A Paradigm for Model Fitting with Applications to Image Analysis and Automated Cartography. Commun. ACM 1981, 24, 381–395. [Google Scholar] [CrossRef]
  2. Gai, S.; Jung, E.J.; Yi, B.J. Multi-group localization problem of service robots based on hybrid external localization algorithm with application to shopping mall environment. Intell. Serv. Robot. 2016, 9, 257–275. [Google Scholar] [CrossRef]
  3. Hijikata, S.; Terabayashi, K.; Umeda, K. A simple indoor self-localization system using infrared LEDs. In Proceedings of the 2009 Sixth International Conference on Networked Sensing Systems (INSS), Pittsburgh, PA, USA, 17–19 June 2009; pp. 1–7. [Google Scholar] [CrossRef]
  4. Daniilidis, K. Hand-Eye Calibration Using Dual Quaternions. Int. J. Robot. Res. 1999, 18, 286–298. [Google Scholar] [CrossRef]
  5. Kelsey, J.; Byrne, J.; Cosgrove, M.; Seereeram, S.; Mehra, R. Vision-based relative pose estimation for autonomous rendezvous and docking. In Proceedings of the 2006 IEEE Aerospace Conference, Big Sky, MT, USA, 4–11 March 2006; p. 20. [Google Scholar] [CrossRef] [Green Version]
  6. Yao, N. Research of Monocular Vision Based Target Tracking and Positioning Techniques. Ph.D. Thesis, Shanghai Jiao Tong University, Shanghai, China, 2014. [Google Scholar]
  7. Park, J.S.; Lee, B.J. Vision-based real-time camera match moving using a known marker. Opt. Eng. 2008, 47, 027201. [Google Scholar] [CrossRef]
  8. Tsai, R.Y. An efficient and accurate camera calibration technique fro 3d machine vision. In Proceedings of the CVPR’86, Miami Beach, FL, USA, 22–26 June 1986; pp. 364–374. [Google Scholar]
  9. Shahzad, M.G.; Roth, G.; Mcdonald, C. Robust 2D Tracking for Real-Time Augmented Reality. 2002. Available online: https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=df4bae2e7b7000f80c2ebc01f64a8832b0d6330b (accessed on 7 January 2023).
  10. Abdel-Aziz, Y.; Karara, H.; Hauck, M. Direct Linear Transformation from Comparator Coordinates into Object Space Coordinates in Close-Range Photogrammetry. Photogramm. Eng. Remote Sens. 2015, 81, 103–107. [Google Scholar] [CrossRef]
  11. David, P.; Dementhon, D.; Duraiswami, R.; Samet, H. SoftPOSIT: Simultaneous pose and correspondence determination. Int. J. Comput. Vis. 2004, 59, 259–284. [Google Scholar] [CrossRef] [Green Version]
  12. Lu, C.P.; Hager, G.; Mjolsness, E. Fast and globally convergent pose estimation from video images. IEEE Trans. Pattern Anal. Mach. Intell. 2000, 22, 610–622. [Google Scholar] [CrossRef] [Green Version]
  13. Lepetit, V.; Moreno-Noguer, F.; Fua, P. Epnp: An accurate O(n) solution to the pnp problem. Int. J. Comput. Vis. 2009, 81, 155–166. [Google Scholar] [CrossRef]
  14. Hesch, J.A.; Roumeliotis, S.I. A Direct Least-Squares (DLS) method for PnP. In Proceedings of the 2011 International Conference on Computer Vision, Barcelona, Spain, 6–13 November 2011; pp. 383–390. [Google Scholar] [CrossRef] [Green Version]
  15. Li, S.; Xu, C.; Xie, M. A Robust O(n) Solution to the Perspective-n-Point Problem. IEEE Trans. Pattern Anal. Mach. Intell. 2012, 34, 1444–1450. [Google Scholar] [CrossRef] [PubMed]
  16. Zheng, Y.; Sugimoto, S.; Okutomi, M. ASPnP: An Accurate and Scalable Solution to the Perspective-n-Point Problem. IEICE Trans. Inf. Syst. 2013, E96.D, 1525–1535. [Google Scholar] [CrossRef] [Green Version]
  17. Zheng, Y.; Kuang, Y.; Sugimoto, S.; Åström, K.; Okutomi, M. Revisiting the PnP Problem: A Fast, General and Optimal Solution. In Proceedings of the 2013 IEEE International Conference on Computer Vision, Sydney, Australia, 1–8 December 2013; pp. 2344–2351. [Google Scholar] [CrossRef] [Green Version]
  18. Kneip, L.; Li, H.; Seo, Y. Upnp: An optimal O(n) solution to the absolute pose problem with universal applicability. In Computer Vision—ECCV 2014, Proceedings of the European Conference on Computer Vision, Zurich, Switzerland, 6–12 September 2014; Springer: Cham, Switerland, 2014; pp. 127–142. [Google Scholar] [CrossRef]
  19. Nakano, G. Globally Optimal DLS Method for PnP Problem with Cayley parameterization. In Proceedings of the British Machine Vision Conference (BMVC), Swansea, UK, 7–10 September 2015; Xie, X., Jones, M.W., Tam, G.K.L., Eds.; BMVA Press: Malvern, UK, 2015; pp. 78.1–78.11. [Google Scholar] [CrossRef] [Green Version]
  20. Kukelova, Z.; Bujnak, M.; Pajdla, T. Automatic generator of minimal problem solvers. In Computer Vision—ECCV 2008, Proceedings of the European Conference on Computer Vision, Marseille, France, 12–18 October 2008; Springer: Cham, Switzerland, 2008; pp. 302–315. [Google Scholar] [CrossRef] [Green Version]
  21. Ene, V.; rgen Herzog, J. Gröbner Bases in Commutative Algebra; American Mathematical Society: Providence, RI, USA, 2011; Volume 130, p. 164. [Google Scholar]
  22. Wang, P.; Xu, G.; Cheng, Y.; Yu, Q. A simple, robust and fast method for the perspective-n-point Problem. Pattern Recognit. Lett. 2018, 108, 31–37. [Google Scholar] [CrossRef]
  23. Wang, P.; Zhou, X.; An, A.; He, Q.; Zhang, A. Robust and linear solving method for Perspective-n-Point problem. Chin. J. Sci. Instrum. 2020, 41, 271–280. [Google Scholar] [CrossRef]
  24. Jiabao, W.; Shirong, Z.; Qingya, Z. Vision based real-time 3D displacement measurement using weighted iterative EPnP algorithm. Chin. J. Sci. Instrum. 2020, 41, 166–175. [Google Scholar]
  25. Zhang, Z. A flexible new technique for camera calibration. IEEE Trans. Pattern Anal. Mach. Intell. 2000, 22, 1330–1334. [Google Scholar] [CrossRef]
Figure 1. Schematic diagram of Gröbner generation framework.
Figure 1. Schematic diagram of Gröbner generation framework.
Applsci 13 01111 g001
Figure 2. Coordinate system diagram of camera imaging model.
Figure 2. Coordinate system diagram of camera imaging model.
Applsci 13 01111 g002
Figure 3. Error comparison in the Ordinary 3D case.
Figure 3. Error comparison in the Ordinary 3D case.
Applsci 13 01111 g003
Figure 4. Error comparison in the Planar Case.
Figure 4. Error comparison in the Planar Case.
Applsci 13 01111 g004
Figure 5. Error comparison in the Quasi-Singular case.
Figure 5. Error comparison in the Quasi-Singular case.
Applsci 13 01111 g005
Figure 6. Error comparison in ordinary 3D case.
Figure 6. Error comparison in ordinary 3D case.
Applsci 13 01111 g006
Figure 7. Error comparison in Planar case.
Figure 7. Error comparison in Planar case.
Applsci 13 01111 g007
Figure 8. Error comparison in Quasi-singularity case.
Figure 8. Error comparison in Quasi-singularity case.
Applsci 13 01111 g008
Figure 9. Comparison of the average running time of the PnP algorithm when the number of spatial reference points n ranged from 4 to 500.
Figure 9. Comparison of the average running time of the PnP algorithm when the number of spatial reference points n ranged from 4 to 500.
Applsci 13 01111 g009
Figure 10. (a) Rmoncam G180 camera. (b) High-precision checkerboard calibration board.
Figure 10. (a) Rmoncam G180 camera. (b) High-precision checkerboard calibration board.
Applsci 13 01111 g010
Table 1. The development of each PnP algorithm. (Note: Y means adopted, N means not adopted, L means Low, M means Median, H means Hight, + means better than this level, but worse than the next level.).
Table 1. The development of each PnP algorithm. (Note: Y means adopted, N means not adopted, L means Low, M means Median, H means Hight, + means better than this level, but worse than the next level.).
Algorithm NameDLTHOMOTsaiLHMPOSITEPnPDLSRPnPASPnPOPnPUPnPoptDLSSRPnPRDLTWIEPnP
Time197119811987200020022009201120122013201320142015201820202020
Linear MethodYYYNNNNNNNNNNYN
Optimization methodNNNYYYYYYYYYYNY
Iterative methodNNNYYNNNNNNNYNY
AccuracyLLLHM+MM+HH+H+HH+H+H+H+
EfficiencyH+H+HLLHMHMMM+M+HHH
Table 2. Comparison of the average running time of the PnP algorithm when the number of spatial reference points n ranged from 4 to 500 (unit: ms).
Table 2. Comparison of the average running time of the PnP algorithm when the number of spatial reference points n ranged from 4 to 500 (unit: ms).
Algorithm4255075100150200250300350400450500
LHM2.55097.700712.210516.819321.718630.428842.969053.120361.684871.198690.320899.2493119.3778
EPnP+GN1.68382.14032.21512.53642.91563.46276.35184.62275.66915.98006.62967.66688.3636
RPnP0.64580.75590.68700.99431.00581.48531.70702.38422.52212.93664.97165.94356.7481
DLS3.00374.85486.41488.87219.664217.061119.898121.011524.327928.381035.449239.273260.9486
OPnP20.133420.573619.789421.643920.336419.813520.655420.043819.960121.133125.793620.999619.6722
SRPnP1.68681.58871.61633.05892.42183.52394.53885.98756.35178.479613.1223014.426115.3281
RDLT1.69371.396851.663101.89112.35112.85333.36704.23104.80155.91699.95726.36486.6381
ASPnP2.56832.38862.40772.34882.48942.53422.61572.69692.80463.12483.05303.43923.2354
Hidden PnP1.47391.74461.66631.62591.49311.53472.03991.69661.71531.98072.19062.02422.2700
Table 3. Internal parameters of Rmoncam G180 camera.
Table 3. Internal parameters of Rmoncam G180 camera.
ParameterSpecific Data
Focal length f x = 735.725581 , f y = 735.80416
Principal point ( C C x , C C y ) = ( 598.40811 , 381.51785 )
Radial distortion coefficient k 1 = 0.06689 , k 2 = 0.08019
Tangential distortion coefficient p 1 = 0.00088 , p 2 = 0.00196
Table 4. Mean error ( m e a n e r r ) and median errors ( m e d e r r ) of reprojection coordinate points in 10 images of the calibration plate at different distances and attitudes (unit: pixel).
Table 4. Mean error ( m e a n e r r ) and median errors ( m e d e r r ) of reprojection coordinate points in 10 images of the calibration plate at different distances and attitudes (unit: pixel).
Algorithm12345678910
LHM m e a n e r r 45136.125.2134.553.329.151.134.130.322.3
m e d e r r 42.4123.622.4137.151.920.251.034.629.720.9
EPnP+GN m e a n e r r 14.810.610.219.78.719.46.19.518.615.1
m e d e r r 15.110.510.419.78.919.56.19.618.815.1
RPnP m e a n e r r 14.710.812.920.210.418.86.710.118.515.1
m e d e r r 14.710.810.920.29.118.86.210.118.615.1
DLS m e a n e r r 2541.72542.52606.11928.42156.42907.12470.42118.21889.52583.5
m e d e r r 2534.52551.72602.61936.52160.82913.12468.32118.71901.12584.3
OPnP m e a n e r r 14.710.510.420.18.718.96.69.932.514.9
m e d e r r 14.910.510.419.88.818.96.19.822.815.1
SRPnP m e a n e r r 14.810.510.219.88.618.95.89.618.514.8
m e d e r r 14.910.410.519.98.818.95.89.618.815.0
RDLT m e a n e r r 14.810.610.119.88.719.66.19.618.615.1
m e d e r r 14.910.610.419.89.119.66.09.618.815.1
ASPnP m e a n e r r 15.210.610.219.88.618.96.99.621.214.8
m e d e r r 14.910.410.419.98.818.95.89.618.915.0
Hidden PnP m e a n e r r 14.510.410.119.88.518.75.89.618.514.8
m e d e r r 14.810.410.419.78.818.95.89.618.715.0
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Qiao, R.; Xu, G.; Wang, P.; Cheng, Y.; Dong, W. An Accurate, Efficient, and Stable Perspective-n-Point Algorithm in 3D Space. Appl. Sci. 2023, 13, 1111. https://doi.org/10.3390/app13021111

AMA Style

Qiao R, Xu G, Wang P, Cheng Y, Dong W. An Accurate, Efficient, and Stable Perspective-n-Point Algorithm in 3D Space. Applied Sciences. 2023; 13(2):1111. https://doi.org/10.3390/app13021111

Chicago/Turabian Style

Qiao, Rui, Guili Xu, Ping Wang, Yuehua Cheng, and Wende Dong. 2023. "An Accurate, Efficient, and Stable Perspective-n-Point Algorithm in 3D Space" Applied Sciences 13, no. 2: 1111. https://doi.org/10.3390/app13021111

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop