You are on page 1of 4

Five-Point Motion Estimation Made Easy

Hongdong Li and Richard Hartley

RSISE, The Australian National University.
Canberra Research Labs, National ICT Australia.
Email: firstname.lastname@anu.edu.au

Abstract sion problem itself. In practice, a five-point algorithm also
offers many benefits in reality. As demonstrated in [11],
Estimating relative camera motion from two views is a (1)this five-point algorithm suffers fewer types of “critical
classical problem in computer vision. The minimal case for surface”. For example, a arbitrary plane is not dangerous for
such problem is the so-called five-point-problem, for which the five-point algorithm; (2)when a 5-pt algorithm is used as
the state-of-the-art solution is Nist´er’s algorithm [9]. How- a hypothesis-generator for RANSAC, its computational effi-
ever, due to the heuristic and ad hoc nature of the proce- ciency is much higher than 8pt algorithm; (3)somewhat sur-
dures it applies, to implement it is not so easy for non-expert prisingly, the accuracy of the 5pt estimation is also higher
users. This paper provides a much easier algorithm based than 8pt algorithm. This is because the minimal solver has
on hidden variable resultant technique. Instead of eliminat- better exploited all available geometric constraints of the
ing the unknown variables one by one (i.e., sequentially) problem.
using the Gaussian method as in [9], our algorithm elimi- In [3], we proposed a very simple resultant-based algo-
nates many unknowns all at once. Moreover, in the equation rithm to solve the six-point focal-length problem [4], which
solving stage, instead of back-substituting and solve all the has proven to be quite successful. In that paper we argue
unknowns sequentially, we compute the minimal singular that that was not an individual success, but rather generally
vector of the coefficient matrix, by which all the unknown applicable. This paper aims at substantializing such argu-
parameters can be estimated simultaneously. Experiments ment. It will show that by using the resultant technique the
on both simulation and real images have validated the new five-point problem can also be solved easily and elegantly.
algorithm.
2. Some Historic Reviews
1. Introduction It is well known that from five points only one can es-
timate the relative motion between two calibrated views
This paper studies the classical problem of estimating due to Kruppa, Demazure [5], Maybank and Faugeras [6],
relative camera motion from two views. Particularly, we are Hayde and Sparr [7] etc. [2]. However, despite the theoret-
interested in the minimal case problem. That is, to estimate ical progresses, there was no practical algorithmic imple-
the rigid motion from minimal five corresponding points of mentation of the theory until very recently [8] [9].
two views. Since the relative geometry between two view The state-of-the-art technique is Nist´er’s five-point algo-
is faithfully described by an essential matrix E, which is an rithm proposed in [9] or [10], which is based on a modified
real 3 by 3 homogeneous matrix, the task is therefore equiv- Gaussian-Jordan elimination procedure. His algorithm is
alent to estimating the essential matrix from five points. founded on Philip’s previous work but made significantly
The classical way of estimating E is using the eight- improvements. However, the technique he applied, espe-
point algorithm [1]. Because it is a linear algorithm and by cially the elimination sequences he adopted, is quite ad hoc
which the obtained accuracy is reasonably good it is widely and heuristic. For example, different sequences of elimi-
adopted as a benchmark algorithm. Considering this, why nation may lead to different computer programs. A cau-
do we need a five-point algorithm? The justifications to this tious reader may notice that even in Nister’s two versions
lie in both theoretic and practical aspects. In theory, the of implementations (cf.[9] and [10]) there are differences.
significance of having a minimal-case solver is quite ob- St`ewinius later revised this algorithm by porting the prob-
vious, which enable us a deeper understanding to the vi- lem into the Zp domain [11]. The Gr¨obner basis technique

.. where the coefficient ma- matrix E. z. 2. one therefore has enough equations to es- timate the essential matrix. i = 0. It is so simple that is almost self-explained. equation system will have non-trivial solutions if and only but only two of them are algebraically independent. denoted by E. matrix corresponding to a monomial vector: ment) and more efficient (in computation).. and collect an 2 . 2. mainly because of zF2 + wF3 . it must further satisfy two more constraints.. puting the minimal singular vector of the coefficient matrix. we hide the variable x1 ). sequentially). Given if det(C(x1 )) = 0. Non-expert user [x3 . z .. plus the above nine equations and the singularity all at once. vant unknowns one by one (i. Derivation of Our New 5pt Algorithm serving a static scene.1 Hidden Variable Resultant 0 m T Fm = 0. motion vectors of rotation and translation ([14]). x2 z. Consequently. Use some ad hoc procedures to extract the determinants of all the solutions can be found in one-shot. a hidden variable). trix C will depend on the hidden variable x1 . as a parameter (i. Writing down the epipolar equation eq. our new algorithm is easier (to imple. If 2EET E − tr(EET )E = 0.(4) and eq. reduce it to an upper triangle form.2 Algebraic Derivation 4. and epipolar geometry (or.(4). Using the fact that F is homogeneous. and the relationship becomes: Given a system of M homogeneous polynomial equa- −T −1 tions in N variables. (5) can apply it with comfort. However. pi (x1 . two 4 × 4 matrices. 2 2 3 2 xz . Since an essential matrix E is a faithful representation x1 ) as a parameter (that is. Five-point Motion Estimation tained. Rather than eliminating irrele. to be a valid essential a matrix equation: C(x1 )X = 0. y. x. 3 are the null-space bases. in the equation solving stage. xy. 4. Recover the essential matrix. Consider a camera. Its basic idea is If the camera is fully-calibrated. (2) purpose of this technique is to eliminate variables from a multivariate polynomial equation system. 5. condition eq. it some simple algebra we can re-write the equation system as has only five DOFs. · · · . then by of the motion (translation and rotation. xN ) = 0. Finally a 10-th degree univariate polynomial is ob- 3. y 2 . (1) Our algorithm is based on the hidden variable technique. tion. form a 9 × 20 coefficient existing algorithms. and the X which are characterized by the following result: is a vector space consisting of the homogeneous monomial terms of all other N -1 variables (say.(1) for the five points. we show that by com. y 2 z.. x2 . ality. without loss of gener- This paper provides a (hidden-variable) resultant-based. 3. is referred to [1]).is used to find suitable elimination sequences. x2 y. five corresponding points. our algorithm eliminates all the irrelevant unknowns all at once. which is probably the best known resultant technique for dition: algebraic elimination. say. Overview of Nist´er’s 5pt Algorithm Notice eq. one then obtains 10 solutions of z. y.. and extract the corresponding we simply list some fundamental results without explana.(2)again. 1. yz . A valid F must satisfy the following cubic singularity con. in x. Further. Back-substituting those real roots. Two corresponding image points m and m0 are then related by a fundamental matrix F: 5. M . as follows. They are all cubic Nist´er’s 5pt Algorithm (based on [9]) proceeds as fol. more. x2 . xy 2 . If we treat one of the unknowns (for example. For a moment let us treat the unknown z lows. y 3 .e.e. Solving it. Compared with 2. Then apply Gaussian-Jordan elimination to the 9×20 matrix. where Fi . xz. trix is reduced to an essential matrix.. x3 . with constant intrinsic matrix K. xN ).(2). 5. the matrix C is square). then the fundamental ma. This method 1. x2 . 1]. z . promising and quite general. (4) the number of equations equals the number of monomial terms in the vector X (i. The det(F) = 0. one can solve other un- We assume the reader is familiar with camera calibration knowns one by one.. Using the nine equations of eqs. and very easy to implement. one thus eliminates N -1 variables eq. ob. the complicate and special Gr¨obner technique it uses. is interesting. xyz. (3) 1. yz. To save space 5. then the This actually gives nine equations in the elements of E. followed by a second stage of elimi- nation. let w = 1. for i = K EK = F.e.(1). . their one can get a null-space representation F = xF0 + yF1 + algorithm is not easy to re-implement. there are five epipolar equations By such procedures. z. up to a scale).

As a result. The null-space noise = 1. tion results. will obtain at most ten solutions to the five-point problem. and a avoid the degenerate motion. of C(z) and extract x. first experiment is used to validate this result. one can find the solutions of x rank(2)modification) for noise-free case (in the left) and for and y simply as the right null-space of C(z). after applying the pro- There are many methods to solve the univariate resultant posed five-point algorithm. we have shown theoretically the determi- This result accords precisely with previous result. Torr’s Matlab SFM Toolbox [15]. 1]T . (6) 6. The top row figures are results by the hausted all the bi-variate combinations of variables x and y 8pt linear algorithm (with Hartley’s normalization and up to order three. and extract the motion vectors. the +. Fig-1 display the log10 error (using eq. In our experiments we simply use the first one. y.1547e−2 z 7 + . Now Our achieve this via an easier and more straightforward way. one then find the C(z)X(x. ˆi ˆi   E Ei E Ei trast. + (8) i ˆ i k kEi k kE kE ˆ i k kEi k suggests a much easier and more efficient way of solving other unknowns. Combining these nine equations with the singularity con- 1. y 2 . Compute the null-space Note that we have explicitly included the dependent vari. Back-substitute the real roots of z.2. Write down the five epipolar equations of the five points. Once all x. Experiment Validation 7.4625e−3 z 6 +. Both are the averages of 100 independent tests. Compute the symbolic determinant of the coefficient matrix C(z). y 3 . By contrast. or lowing 10-th degree determinant equation: Sturm’s bracketing method. the hidden-variable technique used by this paper also E = min min − . solution z. x. Solve Other Unknowns using SVD +.3477e−3 z 2 + . x2 y. By con. one can find the essen- ables x. No special attention has been paid to is greater than ten have been precisely cancelled-out.9100e−4 z 4 − . xy. y from the null-space. y. z have been solved. the solved z. x2 . one will (excitingly) find that terms whose degree uniform distribution. as in general we will have multiple To measure the estimation precision.(6) has ex. y. The bottom row are can be effectively computed through a numerical SVD de. Therefore. which is work [10]. 4.(8)) distribu- We notice that the monomial vector of eq. We generate synthetic image and essential matrix using tant.1 Algorithm Outlines Note its dimensionality is only ten. y) = 0. we now have totally ten equations in the above ten-dimensional monomial vector. Solving the determinant equation. 2. our results. However. conditions by linear algorithm and our algorithm. The monomials we obtain span a vector space of: tial matrix E. Recall that this matric equation will have non-trivial so- lutions if and only if the determinant of the coefficient ma- trix vanishes.0pixels case (in the right). for it is easy to implement.1060e−2 z 3 Once z is computed by solving the resultant equation. which is an univariate polynomial of the hidden vari. we adopt the for- roots of z. From five corresponding points. for example. ation. det(C(z)) = −. xy 2 . done multiple times.2). as shown 3 . This approach is the one adopted by the previous mula of [10]. Compute the null-space of the essential matrix. And the motion parameters can be extracted easily using method reported elsewhere [1]. able z in the coefficient matrix and the monomial vector.3233e−4 z 9 6. Recover the essential matrix. Then we have a general. dition (eq. the synthetic image size is set to be 512 × 512. we obtain for example the fol- equation. That is: 7. Cam- Inspecting the hidden-variable-resultant closely and era motions between two views are randomly drawn from a carefully. due to the multiplicities of each un- knowns. ized linear matrix equation: 3. 5. The 3D points are located in precisely tenth-degree polynomial is left. Notice that this back-substitution needs to be we then obtain ten complex roots. composition. we general positions (though can be on a single plane).1 Synthetic Data det(C(z)) = 0. X = [x3 . To resemble the real situ- able. In section 5. the computational efficiency is quite low. the back-substitution approach We also compare the estimation errors under different noise used in [10][9] is much more involved. the companion matrix method.2996e−5 z 10 − .coefficients matrix C with respect to the other two vari.3587e−5 other two unknowns are usually solved by back-substituting Solving this equation using the companion matrix method.8115e−3 z − .1496e−4 z 5 + . (7) This determinant is better known as a hidden-variable resul.9819e−3 z 8 − . but we nant of C(z) is a 10-th degree polynomial in z.

7 0.2 −14 −13. and D. IJCV. 1988. dependent experiments.2 ACK: NICTA is funded through the Australian Government’s 0 0 0. JMIV. IEEE PAMI-21(8): 774-780. We have proposed a new algorithm for solving the five- point motion estimation problem. The Development and Comparison era calibration information is assumed.8 0. Kosecka. Linear Estimation (log10 Error) Linear Estimation (log10 Error) 2 2 1. Green [2] R. Springer.Mutiview Geometry in computer vision. with Nist´er’s original algorithm.5 1.Little and D. 2005.5 −14 −13. [3] Hongdong Li. Zhong-Dan Lan. In Proc.a nally. INRIA-Technical Report. G. In addition.4 −1. but have not found signifi.2 5pt Estimation (log10 Error) 5pt Estimation (log10 Error) 1. planar scene. gorithm again. 1990. [11] David Nister and Henrik Stewenius. It is clear in both experiments that [6] Faugeras.6 −14. Soatto. In these experiments known cam.6 powerful RANSAC scheme.2 0.Nist´er. Figure 1.4 −2.0 pixels. tion.5 0. 2nd ECCV.8 −13.5 −3 −2.5 Figure 3. Triggs. Motion from Point Matches: Multiplicity of our algorithm is more accurate than the linear algorithm.3 New 5pt 1. in part through the ARC. [7] A. it is highly recommended to com. Sastry.Zisserman.H. A. gorithm more effectively. compare the numerical performance of our new algorithm [9] D.I.8 0. Figure 2.5 0. France. courtesy of Ox.5 log10 error in EM estimation:Noise =1.O’shea. in Proc. Using Algebraic Geometry for 7. May. IEEE-T-PAMI. An efficient solution to the five-point relative pose problem. bine it with the RANSAC scheme [9]. 2004. Sparr.5 0.1 0.2006. In proc. Red curve: by linear algorithm. 2nd Edi- known calibration information (see fig-3. IJCV.35 0.1 0. A result is shown in fig-2-Right. France. S.2 deeper understandings to the essential-matrix. 2004. estimation error vs. 4 .9 1 noise level (in pixels/512 image) Backing Australia’s Ability Initiative. scene.6 1. INRIA. 0.4 Linear 8pt 1.Stew´enius.INRIA. Routines for Relative Pose of Two Calibrated Cameras from 5 Points.8 −1. 4(3):225-246. Fig-3 shows the estimated epipolar lines super.6 −13.2 −2.5 −13 log10 error in EM estimation:Noise Free Case −12. In Proc. Solutions. 1992. Some standard test images with es- 0 0 timated epipolar lines (using the 5-pt algo- −15 −14. of Robust Methods for Estimating the Fundamental Matrix. IEEE-CVPR-2003. S.271300.3 0.6 −1.8 0.9 1 0.05 0.7 noise level (in pixels/512 image) 0. [4] H. 26(6). Top row: 8.25 1 we wish the new five-point algorithm. Bottom: by the proposed 5pt algorithm). will become a practical tool in 0. We test our algorithm on some standard real images with [12] D. A simpe solution to the six-point focal-elngth problem. Torr. [10] D. Right: noise=1.5 −1 −0. 2nd Edition. A minimal solution for relative pose with un- known focal length. algorithm. pp. 2005. Using Algebraic Geometry.6 0. Sur Deux Problemes de Reconstruction. This algorithm follows very simple hidden-variable resultant idea. noise level. log10 error distribution (Left: noise free case. Conclusion result by linear algorithm. Technical Re- port No 882. The results are the average of 100 times in. Springer-Verlag.4 0.S. Demazure.6 −2. Fi.5 freq x100 freq x100 1 1 0. Good results are obtained by our nation.1 0. Reconstruction from Calibrated Cameras .2003.2 Tests on Real Images Solving Polynomial Problems in Computer Vision. in fig-2-Left. Maybank. J.5 0. [14] Yi Ma. combining with the 0. Estimation of Relative Camera Positions for Uncali- curve: by the proposed 5pt algorithm) brated Cameras.1997.Nist´er. Cambridge University Press.We further [8] B.0pixel 0 rithm) superimposed on. Linear N-Point Camera Pose Determi- ford VGG and INRIA). 1999.5 1. [15] P.4 0. we verify that the five-point algorithm works well for New Proof of the Kruppa-Demazure Theorem. ECCV-2006. Murray. Right: a planar [1] R. Error in EM estimation Error in EM estimation 0. [5] M.5 0 0 −14.5 −2 −1.4 −13. 2003. References (Left: a general 3D scene. J.15 0. 1999.Hartley. cant difference.vol-10:1-20.4 structure and motion computation. v-24.Cox. An efficient solution to the five-point relative pose problem.6 0.An Invitation to 3-D Vi- sion: From Images to Geometric Models.8 −14.2 0. et al. short course at ICCV-2005.2 −2 −1.Hartley.2 0. and S. Heyden.4 −14.CVPR-2005. To use the 5pt al.W. 2000. and very easy to Error VS Noise (general 3D scene) Error VS Noise (Planar Scene) 0. we synthesize a single plane and test our al.3 0. [13] Long Quan. imposing on the images. We believe that the simplicity suggests more 0.4 Linear 8pt New 5pt implement.5 freq x100 1 freq x100 1 0.