Problemcore
Relative pose estimation
Also called relative orientation, two-view motion estimation.
Find the rotation and the direction of translation between two calibrated cameras from matched image points.
Relative pose estimation is the problem of finding the motion between two calibrated cameras from points matched in their images. The answer is a rotation and a translation with for the coordinates of every scene point in the two camera frames. Images alone cannot give the length of , so only its direction is found, which leaves five unknowns. The usual route goes through the essential matrix : estimate with the five-point algorithm inside RANSAC, or with the eight-point algorithm on clean matches, then factor it by essential matrix decomposition and choose among four poses by cheirality.
In plain words
You take two photos of a scene with the same calibrated camera, from two places. You want to know how the camera turned and in which direction it moved between the two shots. You find points that appear in both photos. Each pair of points gives one condition on the motion. The turn has three unknowns and the direction of travel has two, so five pairs are enough in principle. How far the camera moved cannot be found from the photos alone: a scene twice as large, seen from twice as far, gives the same photos. The scene points must also end up in front of both cameras, which removes false answers.
Definition
Input. Matched points , , in normalized image coordinates , where the intrinsic matrices and are known. Some matches may be wrong.
Output. A rotation and a unit vector , , such that the cameras and explain the correct matches: for each such match there is a scene point with and , in front of both cameras. With noise, the output minimizes a chosen cost:
- Algebraic error. . Cheap but without a geometric meaning.
- Sampson error. The first-order approximation of the distance of a match to the epipolar constraint; see Sampson distance.
- Reprojection error. Minimize over , and the scene points the sum of squared image distances; under independent Gaussian image noise this is the maximum likelihood estimate. It is two-view bundle adjustment.
Ambiguities. The scale of and of the scene is a gauge freedom and is fixed by . The constraint is the same for , and the twisted pair of each, so cheirality is part of the problem, not an extra.
Variants
- Uncalibrated cameras. Without only the fundamental matrix can be found, and the cameras only up to a projective transformation, by the projective reconstruction theorem.
- Known rotation. If is known, for example from a gyroscope, each match gives the linear equation , and two matches give as the cross product of two such normal vectors.
- Pure rotation. If , the images are related by the homography , and . The rotation is found from the homography, and no depth can be found.
- Planar scene. If all points lie on one plane, the images are related by a homography, and the pose can be found by homography decomposition, up to a two-fold ambiguity.
- Partly known calibration. An unknown focal length, shared or separate, adds unknowns and needs more matches.
- Many views. With more than two views, the relative poses of pairs are the input of rotation averaging and translation averaging on the view graph.
Examples
The running example. For and , the essential matrix is . The point maps to , so the match is , with depths 5 and 4.
Four poses from one matrix. The decomposition of this gives four poses. Only puts the point in front of both cameras, with depths . The pose gives depths , and the twisted pair gives and ; see essential matrix decomposition.
Scale. The cameras with the point give the same images. The output has .
Non-example. If all matches satisfy for one rotation, the camera did not move, and is not defined: every direction fits.
Known algorithms
| algorithm | matches | output | notes |
|---|---|---|---|
| five-point algorithm | 5 | up to 10 essential matrices | minimal; used inside RANSAC |
| eight-point algorithm, essential variant | 8 or more | one essential matrix | linear; on inliers only |
| normalized eight-point or seven-point, then | 8 or 7 | , then | ignores the calibration during the fit |
| essential matrix decomposition | 1 or more for the test | four candidates, chosen by cheirality | |
| nonlinear refinement | all inliers | Levenberg-Marquardt on the Sampson or reprojection error |
The usual pipeline is: feature matching, the five-point algorithm in RANSAC with the Sampson distance to count inliers, decomposition with cheirality, triangulation of the inliers, and a nonlinear refinement.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Eight-point algorithm | Θ(n) worst · average · best | Θ(n) extra | deterministicexactofflineiterative | 1 language |
| Pose recovery from the essential matrix | Θ(n) worst · average · best | Θ(1) extra | deterministicexactofflineiterative | 1 language |
| Five-point algorithm | Θ(n) worst · average · best | Θ(n) extra | deterministicexactofflineiterative | 1 language |
| Normalized eight-point algorithm | Θ(n) worst · average · best | Θ(n) extra | deterministicexactofflineiterative | 1 language |
| Seven-point algorithm | Θ(1) worst · average · best | Θ(1) extra | deterministicexactofflineiterative | 1 language |
Bounds
- Degrees of freedom. 3 for and 2 for the direction of , so 5. Each match gives one equation, so 5 matches are the minimum.
- Number of solutions. Five matches in general position give at most 10 complex essential matrices, by the result of Demazure (1988). Each essential matrix gives four poses, and cheirality keeps at most one of them for each point seen in front of the cameras.
- Exact recovery. With exact matches of points in general position and , eight matches fix linearly, and fixes up to the four choices.
- Degenerate scenes. If the points and both camera centers lie on certain quadric surfaces, two different poses explain the same images; these are the critical surfaces of Hartley and Zisserman (Section 22.2). Planar scenes are a special case for the eight-point algorithm but not for the five-point algorithm.
- Conditioning. A short baseline makes the direction of uncertain. With a narrow field of view, a small rotation and a small sideways translation have similar effects on the images.
Reductions
- To essential matrix estimation. Relative pose reduces to finding and then decomposing it, since and the pose determine each other up to the four choices and the scale.
- From the fundamental matrix. With known and , any estimate of gives , which must then be projected onto the essential matrices by the characterization.
- To triangulation. Once is known, the scene points follow by point triangulation, up to the global scale.
- Relation to absolute pose. If the scene points are known in one frame, the pose of the second camera is a perspective-n-point problem, which also fixes the scale.
Applications
- Visual odometry. The motion between successive frames, as in Nister's visual odometry and other visual odometry systems.
- Structure from motion. The first pair of incremental structure from motion, and the edges of the view graph in global structure from motion.
- Stereo calibration. The pose between the two cameras of a rig, when no calibration target is used; compare stereo camera calibration.
- Stereo rectification. The pose is needed to warp two images so that matches lie on the same rows, as in stereo rectification.
References
- Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Section 9.6, The essential matrix (the four solutions for the pose), Chapter 11 (computation of the fundamental matrix) and Section 22.2 (degenerate configurations of two views)
- Yi Ma, Stefano Soatto, Jana Kosecka and S. Shankar Sastry, An Invitation to 3-D Vision, Springer, 2004, Chapter 5, Section 5.2.1 (pose recovery from the essential matrix) and Section 5.3 (planar scenes and the homography)
- David Nister, An efficient solution to the five-point relative pose problem, IEEE Transactions on Pattern Analysis and Machine Intelligence 26(6), 2004, the five-point relative pose problem and its solution inside a robust estimator
- Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Section 11.3, Two-frame structure from motion
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag Z5A74Y Edit this page History Report an error Markdown