The Five Points Pose Problem : A New and Accurate Solution Adapted to any Geometric Configuration
Abstract
The goal of this paper is to estimate directly the rotation and translation between two stereoscopic images with the help of five homologous points. The methodology presented does not mix the rotation and translation parameters, which is comparably an important advantage over the methods using the wellknown essential matrix. This results in correct behavior and accuracy for situations otherwise known as quite unfavorable, such as planar scenes, or panoramic sets of images (with a null base length), while providing quite comparable results for more ”standard” cases. The resolution of the algebraic polynomials resulting from the modeling of the coplanarity constraint is made with the help of powerful algebraic solver tools (the Gröbner bases and the Rational Univariate Representation).
1 Introduction
The determination of the relative orientation between two cameras with the help of homologous points is the basis of many applications in the domains of photogrammetry and computer vision. The configuration often called ”minimal case problem” takes the intrinsic parameters (i. e. the elements of calibration) of the camera as a priori known. Then only five points homologous are necessary to estimate the remaining three unknowns of rotation and two ones of translation (up to a scale factor). This problem has been dealt by many authors, and most of recent methods published provide a resolution based on the properties of the essential matrix. Even if its use simplifies remarkably the problem of the relative orientation, in some cases, due to the fact that all parameters of rotation and translation are mixed, this is the origin of geometric ambiguousnesses. So as to improve this point, we propose in this article a model that separates completely the rotation and the translation unknowns. We show that the major advantage of this model is that it allows to solve degenerate problems such as pure rotations (null translation). We use an algebraic modeling for the coplanarity constraint, through a system of polynomial equations. We solve them with the help of powerful algebraic solver tools, the Gröbner bases and the Rational Univariate Representation. So as to assess this new approach, three cases have been processed: a classical case, a planar scene, and a case where the base length is close to zero. We will see that the new method is still accurate even for the last two cases  quite unfavorable  configurations. We will also compare with the Stewenius’s algorithm and see that in planar scenes the new algorithm is more accurate. An evaluation on real scenes will finally be presented.
2 Historical background of the five points relative pose problem.
It was for the first time demonstrated by Kruppa [1] in 1913 that the direct resolution of the relative orientation from 5 points in general contained at most 11 solutions. The described method consisted to find all intersections of two curves of degree 6. Unfortunately, one century ago, this method could not lead to a numerical implementation. Lately in [2], [3], [4], [5] it has been demonstrated that the number of solutions is in general equal to 10, including the complex solutions. Triggs [6] has provided a detailed version for a numeric implementation. Philip [7] presented in 1996 a solution using a polynomial of degree 13, and has proposed a numeric method to solve his system. The roots of his polynomial give directly the relative orientation. Philip has exploited the constraints on essential matrix. Philip’s ideas have been followed in 2004 by Nister [8] who has refined this algorithm, has obtained a order polynomial and has given a numerical resolution using a GaussJordan elimination. Since then, number of papers tried to give some improvements to the method of Nister, notably Stewenius [9] that has provided a polynomial resolution using the Gröbner bases. Many papers have proposed some modifications to the method of Nister in view of a numeric improvement [12], [13], or for a simplification of implementation [10], [11].
3 Geometry review of Relative Orientation
In this section we recall the various ways to present the geometry of relative orientation, that consist in the determination of the translation and the relative rotation between two images of a scene having a common informational part. In general, the position of the first camera is taken as the origin of the system (Fig. 1) and therefore the position of the second camera () is calculated in relationship to the first one. named as the principal point of the camera, is the focal length. is the world point, and the image projection of A on the left image is with coordinates , and in the right image. The vector of translation is the basis that relies the optic centers of the cameras ( and ). is the relative rotation between the two cameras.
A way for modelling the relative orientation is known as condition of coplanarity. This constraint has been often used by the community of computer vision since three decades. As pictured in the Fig. 1, the condition of coplanarity between two images expresses the fact that the vector , the vector (expressed in the reference of ), and the vector of the translation are in the same plane, called the epipolar plane. One can translate this condition by a null value for the triple product between these 3 vectors. In other words:
(1) 
4 Algebraic modelling of the fivepoints problem
In this section, different ways for algebraic modelling of the relative orientation are recalled. The goal is to obtain a polynomial system, so as to use the powerful mathematical tools developed for solving such systems.
The coplanarity constraint (equation 1) under its algebraic shape is expressed by the equation:
(2) 
In this equation the unknowns are the matrix of rotation and the translation . Different ways exist to parameter the system so as to obtain polynomials with the rotation and the translation as unknowns. In the present part the main modelling solutions for the rotation and the translation to be used in this research are described.
4.1 Modelling of the translation
The translation of unity length between the two centres of the cameras may be understood as imaging on the unity sphere its center. The translation has only 2 degree of freedom, and for that reason, with the relative orientation, the scale cannot be determined. The equation of the unity sphere is the following :
(3) 
The advantage of this constraint of normality on the translation is that it is quite possible to work even with a very small translation, allowing to compute precisely the rotation when the translation is null. In this case, as the base is null, the two homologous vectors and are deduced from each other by a rotation , so that . Thus the triple product is null whatever . The fact that we force the translation to be unity prevents that and therefore to suffer numeric instabilities. This implies in turn that the rotation will be correctly estimated in any case.
4.2 Modelling of the Rotation in 3D space
The rotation matrix in the 3D space has 3 degree of freedom. It is thus possible to express it with 3 parameters. However several representations with more than 3 parameters exist. The algebraic model will depend on the chosen representation. In the following part the main models for the coplanarity constraint are described.
Representation of the rotation using quaternions (4 parameters)
A quaternion is composed of 4 parameters, , with the vector part being . The quaternions provide a simple representation of the rotation. Indeed with the parameters of a unity quaternion , the matrix of rotation can be expressed in the following manner :
With such a model the number of unknowns for the rotation is 4.
Representation using Thompson rotation.
4.3 Algebraic modelling of the coplanarity constraint
Model with 7 equations
With the model of rotation matrix given by equation 4.2.1, every couple of homologous points ( and ) gives an equation of the type :
(5) 
5 couples of points gives 5 equations. It is otherwise necessary to add along with this equations the constraint of normality on the quaternion, as well as on the translation.
(6)  
(7) 
Finally, the unknowns of the system are
Model with 6 equations
While using the Thompson rotation matrix, the rotation is expressed with 3 parameters. The system will have 6 unknowns, considering the three parameters of translation. The polynomial expressing the coplanarity constraint for a couple of homologous points, taking for model the Thompson rotation, is the following :
(8) 
The constraint of normality on the translation (equation 3) is added to these 5 equations. So the system has 6 equations and 6 unknowns .
In conclusion of this section, we have built two polynomial systems, where the translation and rotation parameters are distinct and correspond to separated unknowns. Next, we show how to solve this type of polynomial systems.
5 Resolution of the polynomial systems
The ways to solve the polynomial systems are widely published [16], [17], and are briefly recalled for the reader not familiar with this topic. The resolution of a polynomial system consists in finding the zeros of an algebraic equation system such as : with where is a polynomial over the field of complex numbers. Differents types of solvers for polynomial equations exist, such as analytic solvers, subdivision solvers, geometric solvers, homotopic solvers and algebraic solvers [18]. In this paper the focus is on algebraic solvers, that exploit the known relationships between the unknowns. They subdivide the problem of the resolution into two steps : the first consists in transforming the system into one or several equivalent systems, but better adapted, and this constitutes what one will call an algebraic solution. The second step consists, in the case where one works in one subfield of the complex field, to calculate the numeric values of the solutions from the algebraic solution. We will see now briefly the principal tools used in this paper for solving polynomial systems. But first, some remainders of geometric algebra are necessary.
5.1 Notations
is the polynomial rings with rational coefficients and unknowns . is any subset of . A point is a zero of if . The variety of is the set of all common complex zeros :
(9) 
The ideal generated by a finite set of multivariate polynomials is defined as:
(10) 
The ideal contains all polynomials which can be generated as an algebraic combination of its generators. An ideal can be generated by many different sets of generators, which all have the same solutions.
5.2 Construction of the algebraic solver : an introduction to the Gröbner bases.
A Gröbner basis is a set of multivariate polynomials that has ”nice” algorithmic properties. Every set of polynomials can be transformed into a Gröbner basis. This process generalizes three familiar techniques : the Gauss elimination for solving linear systems of equations, the Euclidean algorithm for computing the greatest common divisor of two univariate polynomials, and the Simplex Algorithm for linear programming [3]. The Gröbner bases were developed initially by B. Buchberger in the years 1960 [19]. The first step, when we want to compute a Gröbner basis, is to define an monomial order. For polynomial rings with severable variables, there are many possible choices of monomial orders. Some of the most important orders are given in the following definitions.
Definition 1
Lexicographic Order (Lex)
Definition 2
Degree Reverse Lexicographic Order (DRL)
The DRL ordering, although somewhat nonintuitive, has some interesting computational properties.
The following terms and notation are present in the literature of Gröbner bases and will be useful later on.
The degree of a polynomial , denoted , is the highest degree of the terms in . The leading term of , denoted , is the term with the highest degree. The leading coefficient of denoted is the coefficient of the leading term in .
Finally Gröbner bases can be defined:
Definition 3
Fix a monomial order on , and
let be an ideal. A Gröbner base for (with respect to ) is a finite collection of polynomials with the property that for every nonzero , can be divided by for some .
Two principal questions immediately arise from this definition :

the existence of Gröbner bases for any ideal .
Hilbert’s Basis Theorem says that : Every ideal has a Gröbner basis . Furthermore, . 
the issue of uniqueness of the Gröbner bases.
The Buchberger theorem proves that if we fix a term order, then every nonzero ideal has an unique reduced Gröbner basis with respect to this term order.
There are several possible algorithms to effectively compute Gröbner bases. The traditional one is Buchbergers algorithm, it has several variants and it is implemented in most general computer algebra systems like Maple, Mathematica, Singular [20], Macaulay2 [21], CoCoA [22] and the Salsa Software [23]. In this paper we use the Salsa Software with the F4 algorithm [24]. The Faugère F4 algorithm is based on the intensive use of linear algebra methods.
5.3 Application of Gröbner bases for systems solving
Gröbner bases () give important informations about the initial system of polynomial equations. Here some of these informations with their application on the 2 systems of polynomials defined in Section 4.2.2 and Section 4.3.2 are summarized:

Solvability of the polynomial system. It is easy to check if it is possible to solve the system of polynomials or not with the help of the Gröbner bases . If , the system has no solution. We check this on our two systems, and we find that: . In other terms is not empty.

Finite solvability of polynomial equations. It is easy to see whether the system has a finite number of complex solutions or not : we just check that for each , , there is an such that for some . This type of system is called zerodimensional system. In this case, the set of solutions does not depend on the chosen algebraically closed field. If we apply this on two systems, we find that the dimension of the two systems is zero. So the set of solutions is finite.

Counting number of finite solutions of the polynomial system. One important information is that the Gröbner basis also gives the number of solutions of the system. If we suppose that the system of polynomial equations has a finite number of solutions, then the number of solutions is equal to the cardinality of the set of monomials that are not multiple of the leading terms of the polynomials in the Gröbner basis (any term ordering may be chosen). This monomials are called basis monomials or standard monomials ().
For the system of 7 polynomial equations (Section 4.2.2), the number of the standard bases is equal to 80. It means that the system has a total of 80 complex solutions. This high figure is due to the symmetries of the 2 equations of constraints, for example the quaternion is equal to . It has been reminded previously in the literature that the maximum number of solutions for the essential matrix is 10. Every essential matrix gives 4 families of solutions, rotation and translation, which provides 40 families of solutions. In the present system, with the symmetry on the quaternion, there are twice more solutions, therefore the total is 80.
Using the system of polynomial equations defined in Section 4.3.2, the standards bases of this system are the following (in the DRL order):(11) Which makes a total of 40 bases and therefore 40 solutions. In the present paper the Salsa library has been used. It is quite possible to use the resolutions according to Stewenius [9] and [25], but it requires a heavier implementation work.
5.4 Finding the real roots of the polynomial systems
Once the Gröbner basis is calculated, different ways exist to find the roots of the system of polynomial equations, e.g. the method that solves the polynomial systems with the help of elimination and lex Gröbner basis. Another most popular way to solve polynomial systems is via eigenvalues and eigenvectors, with the help of standard monomials [16]. Here the emphasis is put on the other method, called the Rational Univariate Representation (abbreviated by RUR) [26]. Representing the roots of a system of polynomial equations in the RUR was first introduced by Leopold Kronecker [27], but started to be used in computer algebra only recently [28], [29], [26]. The RUR is the simplest way for representing symbolically the roots of a zerodimensional system without loosing information (multiplicities or real roots) since one can get all the information on the roots of the system by solving univariate polynomials. Let () where be a zerodimensional system with its solution set , Rational Univariate Representation of consists in expressing all the coordinates as functions of the roots of a univariate polynomial such as :
(12) 
where ( is a new variable). Computing a RUR reduces the resolution of a zerodimensional system to solving one polynomial with one variable and to evaluate rational fractions () as its roots. The goal is to compute all the real roots of the system (and only the real roots), providing a numerical approximation with an arbitrary precision (set by the user) of the coordinates. Many efficients algorithms have been implemented to calcultate RUR. More details are easily found in the literature, but a complete explication can be found in [30], [26], [31]. An implementation of the Rouillier algorithm for RUR computation can be found in the SALSA software [23].
6 Algorithm Outlines
Now, the different steps of our algorithm for the calculation of the relative orientation are described.
Step 1: 5 couples of homologous points are randomly selected with the RANSAC method [32] [33] [34].
Step 2: Build the system of polynomial equations.
Step 3: Solve polynomials system. In the present paper the Salsa library has been used (it is quite possible to use the resolutions according to Stewenius [9] and [25], it requires a heavier implementation work, but has the advantage that a great part of the calculation is made offline).
Step 4: Identify the solution with a physical sense. The ambiguity resolution may be done through the use of a third image [8], but we prefer to be able to work with only two images. It is important to find the ”true” solution in this very large set, and it is necessary to inject information bound to the geometry of the scene. We proceed in this way :

when intersecting the rays relative to all homologous couples of points, one keeps the solution where the rays cut themselves in front of the image,

for the 5 randomly selected couples, we calculate the distance to the world points. We keep only the solutions that give a depth superior to the value of the normalised baseline, i. e. 1, the other ones being considered as unrealistic,

the last step consists in selecting the solution which fits with the highest number of points. This hypothesis requires of course to have more than five points. Other methods exist to find the good solution among all those produced by the direct resolutions, but in general they consist in using a third image [8].
As an example, Fig. 2 illustrates the different steps. The reference image is in blue frame, all real solutions are presented in green frame, and the final solution has a red frame.
7 Results and Evaluation
Here we present the results of an experimentation on both synthetic and real data.
7.1 Experimentation on Synthetic Data
To quantify the performances of the presented method, synthetic data have been simulated. The parameters used for the simulations, are the same as Nister’s ones. The images size is 352 x 288 pixels (CIF). The field of view is 45 degrees wide. The distance to the scene is equal to 1. Several cases have been treated :

Simple configuration : the baseline between the 2 images has a length of 0.3, the depth varies from 0 to 2.

Planar Structure and short baseline (0.1) : a degenerate case where all simulated points are on the plane Z = 2.

Zero translation : the configuration of the points is the same as in the simple configuration, the main difference is that the baseline length is null.
In each configuration a Gaussian noise with a standard deviation varying between 0 and 1 pixel is added. The results are average of 100 times independant experiments. For each situation the minimal case only has been treated, corresponding to the minimum number of points required (5). No least square adjustment has been done. The geometry of the different configurations is illustrated in the Fig. 3.
(a)  (b)  (c) 
Results in the socalled easy configuration
. As a comparison our method has been confronted with Stewenius’s one, thanks to the codes that he kindly made downloadable on his website [35]. This allowed us to use it as a reference for the algorithm of 5 points. Two sorts of translations have been treated, one in X (sideway motion) and one in Z (forward motion). Our results are mostly similar, even slightly better. Remark: In these simulations, it is important to specify that the rotation between the two optical axes is always very well determined. The difference between the different methods is the precision of evaluation on the orientation of the base, so this is the assessment that we have used.
(a)  (b) 
Planar Structure and short base
. Several surfaces are known as ”dangerous” [36] the reason of this appellation is due to the fact that if the points chosen for the evaluation of the relative orientation are on this kind of surface, the configuration becomes degenerate. In the following, one of the most unfavorable configurations has been chosen. We note that the method of the 5 points of Stewenius is not robust in the sideways motion case. Besides, Sarkis [13] has shown this weakness of the algorithm, and concluded that it is better in such cases to use an homography. On the other hand, with the method presented here this kind of configuration does not lead to any problem.
(a)  (b)  (c) 
Results for a null base length
Even with a null translation, the rotation is very well defined. This is probably due to the fact that the parameters to estimate in our initial equations are completely separated. The rotation is not mixed with the translation. This may explain why a translation of zero length does not affect the results. Fig. 5(c).
7.2 Tests on Real Images
So as to test the algorithm presented in section 6, we have used the recently available image base set up by ISPRS [37] for relative orientation tests. We have checked especially our ambiguity resolution so as to find the good physical solution. The mean error on the baseline orientation is equal to and mean error on the rotation is . At the present time, an average of 20 seconds on a 1.65 GHz machine is necessary to get the solution. This time of calculation may be to improved by using offline resolutions as done by Stewenius.
8 Conclusion
In this paper a new method for the problem of the ”five points pose problem” has been described. The main difference with the previous methods is that the rotation and the translation are directly the unknowns of the system. Then we have shown that with the available tools of geometric algebra, this kind of system can be solved. The major advantage, when compared to other methods, is that it works accurately on all cases of plane scenes, or on couples of images with a null base.
References
 Kruppa, E.: Zur ermittlung eines objektes aus zwei perspektiven mit innerer orientierung. Other (1913) 1939–1948
 M., D.: Sur deux problemes de reconstruction. Technical Report 882, INRIA (1988)
 Faugeras, O.: ThreeDimensional Computer Vision: A Geometric Viewpoint. MIT Press (1993)
 Faugeras, O.D., Maybank, S.: Motion from point matches: multiplicity of solutions. International Journal of Computer Vision 4 (1990) 225–246
 Heyden, A., Sparr, G.: Reconstruction from calibrated camerasa new proof of the kruppademazure theorem. Journal of Mathematical Imaging and Vision 10 (March 1999) 123–142(20)
 Triggs, B.: Routines for relative pose of two calibrated cameras from 5 points. Technical report, INRIA (2000)
 Philip, J.: A noniterative algorithm for determining all essential matrices corresponding to five point pairs. Photogrammetric Record 15 (1996) 589–599
 Nistér, D.: An efficient solution to the fivepoint relative pose problem. IEEE Transactions on Pattern Analysis and Machine Intelligence 26 (2004) 756–777
 Stewénius, H., Engels, C., Nistér, D.: Recent developments on direct relative orientation. ISPRS Journal of Photogrammetry and Remote Sensing 60 (2006) 284–294
 Li, H., Hartley, R.: Fivepoint motion estimation made easy. (2006) I: 630–633
 Sarkis, M., Diepold, K., Hüper, K.: A fast and robust solution to the fivepoint relative pose problem using gaussnewton optimization on a manifold. In: IEEE International Conference on Accoustics, Speech and Signal Processing (ICASSP). (2007)
 Batra, D., Nabbe, B., Hebert, M.: An alternative formulation for five point relative pose problem. (2007) 21–21
 Segvic, M., Schweighofer, G., Pinz, A.: Performance evaluation of the fivepoint relative pose with emphasis on planar scenes. In: Performance Evaluation for Computer Vision, Austria, Workshop of the Austrian Association for Pattern Recognition (2007) 33–40
 Thompson, E.H.: A rational algebraic formulation of the problem of relative orientation, photogrammetric record. Photogrammetric Record 3 (1959) 152–159
 Faugère, J., Merlet, J., Rouillier, F.: On solving the direct kinematics problem for parallel robots. Technical Report 5923, INRIA (2006)
 Cox, D., Little, J., O’Shea, D.: Using Algebraic Geometry. 2 edn. Graduate texts in mathematics. SpringerVerlag New YorkBerlinParis (2004)
 Cox, D., Little, J., O’Shea, D.: Ideals, varieties, and algorithms an introduction to computational algebraic geometry and commutative algebra. 3 edn. Undergraduate texts in mathematics. SpringerVerlag New YorkBerlinParis (2007)
 Elkadi, M., Mourrain, B.: Introduction à la résolution des systèmes polynomiaux. Volume 57 of Mathématiques et Applications. SpringerVerlag (2007)
 Buchberger, B.: GroebnerBases: An Algorithmic Method in Polynomial Ideal Theory. In Bose, N., ed.: Multidimensional Systems Theory  Progress, Directions and Open Problems in Multidimensional Systems. Copyright: Reidel Publishing Company, Dordrecht  Boston  Lancaster, The Netherlands (1985) 184–232
 Greuel, G.M., Pfister, G., Schönemann, H.: Singular 3.0. A Computer Algebra System for Polynomial Computations, Centre for Computer Algebra, University of Kaiserslautern (2005) http://www.singular.unikl.de.
 Grayson, D.R., Stillman, M.E.: Macaulay 2, a software system for research in algebraic geometry. (http://www.math.uiuc.edu/Macaulay2/)
 CoCoATeam: CoCoA: a system for doing Computations in Commutative Algebra. (Available at http://cocoa.dima.unige.it)
 SALSA: Solvers for algebraic systems and applications. (http://www.inria.fr/recherche/equipes/salsa.en.html)
 Faugère, J.C.: A new efficient algorithm for computing gröbner bases (). Journal of Pure and Applied Algebra 139 (1999) 61–88
 Kukelova, Z., Pajdla, T.: A minimal solution to the autocalibration of radial distortion. In: CVPR 2007, Minneapolis, USA (2007)
 Rouillier, F.: On the rational univariate representation. In: International Conference on Polynomial System Solving. (2004) 75–79
 Kronecker, L.: Werke. Teubner, Leipzig (18951931)
 Rojas, J.M.: Solving degenerate sparse polynomial systems faster. Journal of Symbolic Computation 28 (1999) 155–186
 GonzalezVega, L.: Implicitization of parametric curves and surfaces by using multidimensional newton formulae. Journal of Symbolic Computation 23 (1997) 137–152
 Ouchi, K., Keyser, J., Rojas, J.M.: The exact rational univariate representation and its application. Technical Report 2003111, Department of Computer Science, 3112 Texas A&M University, College Station, TX,778433112 (2003)
 Rouillier, F.: Solving zerodimensional systems through the rational univariate representation. Journal of Applicable Algebra in Engineering, Communication and Computing 9 (1999) 433–461
 Fischler, M., Bolles, R.: Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Comm. of the ACM 24 (1981) 381–395
 Hartley, R.I., Zisserman, A.: Multiple View Geometry in Computer Vision. Second edn. Cambridge University Press, ISBN: 0521540518 (2004)
 Ma, Y., Soatto, S., Kosecka, J., Sastry, S.: An invitation to 3D vision, from images to models. Springer Verlag (2003)
 Stewenius, H.: Matlab code for the for solving the fivepoint problem. (http://vis.uky.edu/~stewe/FIVEPOINT/)
 Philip, J.: Critical point configurations of the 5, 6, 7, and 8point algorithms for relative orientations. Technical report, TRITAMAT, KTH,Sweden (1998)
 Camillo, H.: Test data sets for automatic image orientation. http://www.ipf.tuwien.ac.at/car/isprs/testdata/ (2007)