Conceptcore
Algebraic and geometric error
Also called algebraic distance, geometric distance.
The residual of a linear equation such as Ah = 0 is cheap to minimize but has no geometric meaning; the image distance is meaningful but needs nonlinear optimization.
In the estimation problems of multiple view geometry two kinds of cost are minimized. The algebraic error is the residual of a system of linear equations in the unknown entries of a matrix; the geometric error is a sum of squared distances in the image, in pixels. The algebraic error has a closed-form minimizer by the SVD, but it weights the points in a way that depends on the data and on the coordinate frame. The geometric error is the statistically right cost, but it needs an iterative method and a starting point. This page compares the two; the reprojection error is the main geometric error and has its own page, and the Sampson distance is a first-order approximation that sits between them.
In plain words
There are two ways to ask how wrong a guess is. The first plugs the guess into the equations and looks at how far each equation is from zero. This is easy to make as small as possible, with one standard matrix step and no guessing. But an equation can be far from zero only because its numbers are large, so this way counts some points more than others for no good reason, and the count changes if you move the origin of the image. The second way measures, on the image, how far each predicted point is from where it was seen. This is what you really care about, and with typical camera noise it gives the most likely answer. But it can only be reduced step by step from a starting guess. So the usual recipe is to start with the first way and finish with the second.
The idea
Algebraic error. For a homography, each pair gives two linear equations , the first two entries of (see DLT for homographies). The algebraic distance of the pair is , and the DLT minimizes subject to . The constraint is needed, since would give 0.
Geometric error. It uses , the Euclidean distance between two image points. The common forms for a homography are:
- the transfer error , with the error in the second image only;
- the symmetric transfer error ;
- the reprojection error , minimized also over corrected points .
How they relate. Write and . The two equations are and , so
The algebraic distance is the transfer distance multiplied by the weight , the third entry of . The weight changes from point to point when is projective, and it depends on how is scaled. For an affine , the third row is , the weight is the same for all points, and the DLT minimizes the transfer error (HZ Section 4.2.5).
Frame dependence. Change the coordinates of the two images by similarities and . Distances in pixels change by fixed factors, so the minimizer of a geometric error moves with the data: the best becomes . The algebraic error with the constraint does not behave like this, because is not a fixed multiple of when contains a translation. So the DLT on raw coordinates gives an answer that depends on where the origin of each image is. Hartley normalization fixes the frame in a canonical way and removes this dependence.
Statistics. If the measured points have independent isotropic Gaussian noise, the maximum likelihood estimate minimizes the reprojection error (HZ Section 4.3). With noise only in the second image it minimizes the transfer error. The algebraic error has no such meaning.
Cost. The algebraic minimizer is one SVD of a matrix with a fixed number of columns, for pairs, with no start and no iterations. The geometric minimizer needs an iterative method such as Levenberg-Marquardt, a good start, and it can stop in a local minimum. This is why the usual pipeline is: algebraic estimate on normalized points, then geometric refinement.
Examples
- Same pixel error, different algebraic error. Let . The point maps to , so ; the point maps to , so . Suppose the measured matches are and . Both are 1 pixel from their predictions. The algebraic distances are and : the second point counts four times as much in the squared sum.
- The origin changes the answer. For , . Move the origin of image 2 by 100 pixels along : the same map is now , with Frobenius norm . Under the constraint the first form is divided by and the second by about 100, so the weights of this map drop by a factor of about 58 when the origin moves. A candidate matrix with other entries changes its norm by another factor, so the ranking of the candidates, and with it the minimizer, depends on the frame.
- Affine case. For , for every point, so the algebraic distance of every pair equals its transfer distance.
- Triangulation. The linear triangulation method minimizes an algebraic error and is not invariant to projective changes of frame; the optimal triangulation method minimizes the reprojection error of the point in both images.
Where it is used
- Linear initialization. The DLT, DLT resectioning, the eight-point algorithm and linear triangulation all minimize an algebraic error.
- Refinement. The Gold Standard method for homographies, bundle adjustment and optimal triangulation minimize a geometric error.
- Scoring in robust fitting. RANSAC tests each match against a threshold in pixels, so it needs a geometric distance or the Sampson distance, not the algebraic one.
- Reporting accuracy. Results are reported in pixels, as root mean square transfer or reprojection error, because those numbers have a meaning that does not depend on the frame.
References
- Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Section 4.2, Different cost functions (algebraic distance, geometric distance, reprojection error in both images, the geometric interpretation of the reprojection error and the Sampson error), Section 4.3, Statistical cost functions and maximum likelihood estimation, and Section 4.4, Transformation invariance and normalization
- Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Section 8.1, Pairwise alignment (linear and iterative least squares for 2D motion models)
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 | W4 complete |
|
Tag GPS316 Edit this page History Report an error Markdown