Abstract
We present a fast and accurate solution to the perspective n-points problem, by way of a new approach to the \(n=4\) case. Our solution hinges on a novel separation of variables: given four 3D points and four corresponding 2D points on the camera canvas, we start by finding another set of 3D points, sitting on the rays connecting the camera to the 2D canvas points, so that the six pair-wise distances between these 3D points are as close as possible to the six distances between the original 3D points. This step reduces the perspective problem to an absolute orientation problem, which has a solution via explicit formula. To solve the first problem we set coordinates which are as orientation-free as possible: on the 3D points side our coordinates are the squared distances between the points. On the 2D canvas-points side our coordinates are the dot products of the points after rotating one of them to sit on the optical axis. We then derive the solution with the help of a computer algebra system. Our solution is an order of magnitude faster than state of the art algorithms, while offering similar accuracy under realistic noise. Moreover, our reduction to the absolute orientation problem runs two orders of magnitude faster than other perspective problem solvers, allowing extremely efficient seed rejection when implementing RANSAC.
Similar content being viewed by others
Notes
allowing for non-strict inequalities since we have not required the \(P_i\) to be distinct.
We did this calculation by using Singular to evaluate the coefficients of each \(Q_i\) and each \(\tau _{j,k} Q_i\), and then to calculate the gcd of \(Q_i\) and \(\tau _{j,k} Q_i\).
References
Boutin, M., & Kemper, G. (2004). On reconstructing n-point configurations from the distribution of distances or areas. Advances in Applied Mathematics, 32(4), 709–735.
Greuel, G. M., Pfister, G., & Schönemann, H. Singular 4-3-2 — A computer algebra system for polynomial computations. https://www.singular.uni-kl.de (2023).
Fletcher, R. (1971). Modified Marquardt Subroutine for Non-Linear Least Squares Technical report. NTIS Issue Number 197213, available online at https://ntrl.ntis.gov/NTRL/dashboard/searchResults/titleDetail/AERER6799.xhtml.
Gao, X., Hou, X., Tang, J., & Cheng, H. (2003). Complete solution classification for the perspective-three-point problem. IEEE Transactions on Pattern Analysis and Machine Intelligence, 25(8), 930–943.
Grunert, J. A. (1841). Das Pothenot’sche Problem, in erweiterter Gestalt; nebst Bemerkungen über seine Anwendung in der Geodäsie. Grunerts Archiv fur Mathematik und Physik, 1, 238–248.
Horn, B. K. P. (1987). Closed-form solution of absolute orientation using unit quaternions. Journal of the Optical Society of America A, 4(4), 629–642.
Hesch, J. A., & Roumeliotis, S. I. A Direct Least-Squares (DLS) method for PnP. in International Conference on Computer Vision, Barcelona, Spain, pp. 383-390 (2011).
Quan, L., & Lan, Z. (1999). Linear N-Point Camera Pose Determination. Transctions on pattern analysis and machine intelligence, 21(7).
Lu, C.-P., Hager, G. D., & Mjolsness, E. (2000). Fast and globally convergent pose estimation from video images. IEEE Transactions on Pattern Analysis and Machine Intelligence,22(6), 610–622.
Lagrange, J.-L. (1773). Solutions analytiques de quelques problémes sur les pyramides triangulaires. reprinted in 1869 in the 3rd volume of the Œuvres de Lagrange edited by J.-A. Serret and published by Gauthier-Villars.
Lepetit, V., Moreno-Noguer, F., & Fua, P. (2009). EP\(n\)P: An Accurate \(O(n)\) Solution to the P\(n\)P problem. International journal of computer vision, 81(2), 155–166.
Terzakis, G., & Lourakis, M. (2020). A Consistently Fast and Globally Optimal Solution to the Perspective-n-Point Problem. ECCV. Lecture Notes in Computer Science., 12346, 478–494.
Shafarevich, I. R. (1994). Algebraic Geometry vol 1: Varieties in Projective Space, Springer Verlag, Berlin Heidelberg. 2nd Edition.
Zheng, Y., Kuang, Y., Sugimoto, S., Åström, K., & Okutomi, M. (2013). Revisiting the PnP Problem: A Fast. eneral and Optimal Solution. in G2013 IEEE International Conference on Computer Vision, Sydney, NSW, Australia pp. 2344–2351.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by Luca Magri.
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Singular calculations
In order to obtain the quadratic polynomials \(Q_i\) referenced in Theorem 5.1, we begin by simply coding the equations in (4.1) of Proposition 4.4 into Singular, and letting I be the ideal generated by all six polynomials.

The chosen polynomial ordering is natural due to our desire to eliminate the last four variables from the ideal.
To compute \(Q_0\), the first two steps are straightforward: eliminate \(z_3\) and then \(z_2\) from the ideal I.

However, trying to directly eliminate \(z_1\) from the above ideal hit a computational brick wall; instead, after some experimentation, we defined a certain subideal, and were able to make the final elimination starting from it:

In defining J0_2, our ultimate choices are in fact rather natural: the three polynomials in the definition of J0_2 are simply the shortest three generators of I0_2, and the reason for using three of them is that this is the minimal number which would be expected to support eliminating \(z_1\) while still having a nontrivial equation in \(z_0\).
In any case, the final line of the above Singular code shows that we have produced an element of I of the desired form, so we thus define \(Q_0\):
Definition A.1
Let \(Q_0(x)\) be the polynomial obtained by replacing z0\(^{2}\) with x in the above J0_1[1], considered as a quadratic polynomial in x with coefficients being polynomials in the \(a_\bullet \), \(b_\bullet \), \(c_\bullet \), \(d_\bullet \).
To obtain \(Q_3\) we run the following code in the same spirit as our derivation of \(Q_0\):

We then get that J3_0[1] is of degree 2 in z3\(^{2}\), so we can define \(Q_3\):
Definition A.2
Let \(Q_3(x)\) be the polynomial obtained by replacing z3\(^{2}\) with x in the above J3_0[1], considered as a quadratic polynomial in x with coefficients being polynomials in the \(a_\bullet , b_\bullet , c_\bullet , d_\bullet \).
The coefficients of the \(Q_i\)
Below are the formulas for the coefficients of \(Q_0\) and \(Q_3\). The output of our Singular code was post processed to remove the * symbol:

In order to obtain the formulas for \(X_{1,j}\) and \(X_{2,j}\), as described in the proof of Theorem 5.1 one simply starts with the formulas for the \(X_{0,j}\), and applies a transposition to every variable index occurring in the formula. For \(Q_1\), all of the 0s and 1s are swapped, while for \(Q_2\) all of the 0s and 2s are swapped.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Lehavi, D., Osserman, B. A Polynomial Formula for the Perspective Four Points Problem. Int J Comput Vis 134, 133 (2026). https://doi.org/10.1007/s11263-025-02660-8
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1007/s11263-025-02660-8
