Problemcore
Bundle adjustment
Also called photogrammetric bundle adjustment.
Refine all camera parameters and 3D points together to minimize the total reprojection error, a large sparse nonlinear least squares problem.
Bundle adjustment is the problem of refining a 3D reconstruction, all camera parameters and all 3D points together, so that the predicted image positions of the points agree as well as possible with the measured ones. The cost is the sum of the squared reprojection errors, possibly weighted or made robust, over all observations. The name comes from photogrammetry: each camera has a bundle of light rays through its center, and the problem adjusts the bundles until the rays meet the points. It is a nonlinear least squares problem with a special structure: each residual depends on one camera and one point only, so the Jacobian is very sparse and the normal equations have an arrow shape. Under Gaussian pixel noise its solution is the maximum likelihood reconstruction. It is the final, and usually the most accurate, step of structure from motion, and it runs repeatedly inside incremental structure from motion and visual SLAM. The cost is unchanged by a global similarity transformation (or a projective one, for uncalibrated cameras), which is the subject of gauge freedom. The algorithms are pages of their own: sparse bundle adjustment and inexact Newton bundle adjustment, both built on the reduced camera system.
In plain words
You have many photos of a scene, and in each photo you have marked where some scene points appear. You also have a rough guess of where each camera stood, where it looked, and where each point is in 3D. Bundle adjustment improves all these guesses at once. For every mark, it computes where the guessed point would appear in the guessed camera, and it measures the distance to the real mark. It then moves the cameras and the points together until the total of these squared distances is as small as possible. The result is the reconstruction that best explains the photos. Moving or turning the whole scene, or making it bigger, does not change any distance, so one camera and the scale must be fixed to get a single answer.
Definition
Input.
- cameras with start values. In the calibrated case, camera has a rotation and a translation , and a known intrinsic matrix . In the self-calibrating case, and lens distortion terms are unknowns too.
- points with start values.
- observations : point is measured at pixel in camera , optionally with a covariance .
The camera frame has right, down and forward, a world point maps to , it is in front of the camera if , and its pixel is with and pixel centers at integer coordinates.
Output. Parameters that minimize
where and is the identity for the plain least squares cost or a robust function such as the Huber cost. In practice a local minimizer near the start is found.
Structure. With 6 parameters per camera and 3 per point, there are residuals and unknowns. The residual depends only on camera and point , so each row pair of the Jacobian has one block and one block. The normal matrix has block diagonal and ; the block is nonzero only where camera sees point .
Gauge. For calibrated cameras, does not change under a similarity transformation of the world: , , , with 7 degrees of freedom. For uncalibrated projective cameras the invariance group is the projective group, with 15 degrees of freedom. So the minimizer is never unique, and is singular; see gauge freedom.
Variants
- Calibrated or self-calibrating. Intrinsics fixed, shared by all cameras, or one set per camera; often with radial and tangential distortion.
- Projective bundle adjustment. Unknown camera matrices and homogeneous points; the gauge has 15 degrees of freedom.
- Robust bundle adjustment. A robust , such as Huber or Cauchy, limits the effect of wrong matches; it is solved by reweighting, see M-estimators.
- Motion only and structure only. Fix the points and refine the cameras (perspective-n-point refinement), or fix the cameras and refine the points (optimal triangulation for two views). Each splits into independent small problems.
- Local and windowed. Refine only recent cameras and the points they see, as in sliding window bundle adjustment and the local bundle adjustment of ORB-SLAM.
- With other measurements. Add residuals for GPS positions, inertial measurements, known distances or control points.
- Other features and camera models. Lines, points at infinity in homogeneous form, inverse depth points, rolling shutter cameras, and fisheye or spherical cameras.
- Photometric bundle adjustment. Minimize differences of pixel intensities instead of feature positions, as in direct visual odometry.
Examples
A small synthetic scene. Four cameras with and look from a distance of about 5 at 20 points in a cube of side 2. Every camera sees every point: observations, 160 residuals. With camera 0 fixed, there are unknowns, of which one direction (the scale) is still a gauge freedom. Starting from cameras and points perturbed to an RMS reprojection error of 34.1 pixels, sparse Levenberg-Marquardt reaches pixels in 12 accepted steps on exact data, and the result equals the truth up to a scale of . With 1 pixel of Gaussian noise, the minimum cost is , lower than the cost of the true scene. The minimizer fits the noise better than the truth, as any maximum likelihood estimate does. These are measurements from the test of sparse bundle adjustment.
Counting. For calibrated cameras, the reconstruction is locally determined, up to the gauge, only if the number of residuals is at least the number of unknowns minus the gauge: . The example has . Two calibrated views of five points give : the count of the minimal five-point problem.
Large photo collections. Reconstructions from internet photos have thousands of cameras and millions of points, with each point seen by only a few cameras. Agarwal, Snavely, Seitz and Szeliski (2010) studied problems of this size.
Known algorithms
| algorithm | cost per iteration | note |
|---|---|---|
| Gauss-Newton or Levenberg-Marquardt, dense | only for tiny problems | |
| Sparse bundle adjustment | exact damped step via the reduced camera system | |
| Sparse bundle adjustment with sparse Cholesky of | depends on the fill of | for sparse camera graphs |
| Powell's dog leg, sparse | as sparse bundle adjustment | fewer factorizations after rejected steps |
| Inexact Newton bundle adjustment | for CG iterations | very large problems |
| Iteratively reweighted least squares around any of these | as the inner method | robust costs |
Here is the number of cameras that see point . All of these find a local minimizer from a good start. The start comes from incremental or global structure from motion, or from a factorization method.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Bundle adjustment in the large | O(k (m + N)) per_iteration | O(m + n + N) extra | deterministiciterativelocalmonotoneiterative | 1 language |
| Sparse bundle adjustment | O(m + n N^2 + N^3) per_iteration | O(m + N^2) extra | deterministiciterativelocalmonotoneiterative | 1 language |
Bounds
- No global guarantee. The cost is nonconvex, and the standard methods find a local minimizer only. No polynomial time algorithm for the global minimum of general bundle adjustment is known. The nonlinear least squares page shows that the general problem is NP-hard, but that proof uses residuals of another form and does not carry over to bundle adjustment.
- Accuracy bound (theorem). With independent Gaussian pixel noise of standard deviation , the covariance of any unbiased estimate of the gauge-fixed parameters is at least restricted to those parameters, the Cramér-Rao bound, and the maximum likelihood estimate reaches it to first order for small noise. Because of the gauge, the bound is stated for gauge-invariant quantities or for a fixed gauge; Kanatani and Morris (2001) treat this in detail.
- Expected residual. At the minimizer, is approximately chi-squared with degrees of freedom, so the RMS residual per coordinate is a little below . This is used to check the noise model.
- Cost of a step. Any exact method must at least read the observations, so a step costs . With the reduced camera system, the extra cost is that of solving a system.
Reductions
- To nonlinear least squares. Bundle adjustment is an instance of nonlinear least squares, with the rotation updated on by a local parametrization, for example .
- To the reduced camera system. Each Gauss-Newton or Levenberg-Marquardt step reduces exactly to a linear system in the camera parameters, followed by independent solves for the points.
- Affine cameras. For affine cameras with every point seen in every view, the maximum likelihood solution under isotropic Gaussian noise is given in closed form by the factorization method of Tomasi and Kanade, a truncated SVD (theorem; Hartley and Zisserman, Chapter 18).
- To pose graph optimization. Eliminating the points, or approximating their effect by relative pose constraints, gives a pose graph optimization problem, which is smaller and often used to start or to replace bundle adjustment in SLAM.
Applications
- Structure from motion: the final refinement, and repeated refinements during incremental reconstruction.
- Visual SLAM and visual odometry: local bundle adjustment over a window of key frames, as in ORB-SLAM and visual odometry systems.
- Aerial and close range photogrammetry, mapping and surveying, where the method comes from.
- Camera calibration: the final refinement of Zhang's method is a bundle adjustment with a known planar target.
- Multi-camera rigs and augmented reality, where the camera poses must be accurate to a fraction of a pixel.
References
- Bill Triggs, Philip F. McLauchlan, Richard I. Hartley and Andrew W. Fitzgibbon, Bundle adjustment, a modern synthesis, in Vision Algorithms, Theory and Practice, Lecture Notes in Computer Science 1883, Springer, 2000, 298-372, the whole survey: the problem and its cost functions (Sections 2 to 4), the network structure (Section 6), gauge freedom (Section 9) and the historical appendix
- Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Chapter 18, N-view computational methods (bundle adjustment and the affine factorization algorithm) and Appendix 6, Iterative estimation methods (sparse Levenberg-Marquardt)
- Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Chapter 11, Structure from motion and SLAM (bundle adjustment, exploiting sparsity, uncertainty and ambiguities)
- Manolis I. A. Lourakis and Antonis A. Argyros, SBA: A software package for generic sparse bundle adjustment, ACM Transactions on Mathematical Software 36(1), 2009, the problem statement and the sparse structure of the Jacobian
- Sameer Agarwal, Noah Snavely, Steven M. Seitz and Richard Szeliski, Bundle adjustment in the large, Computer Vision ECCV 2010, Lecture Notes in Computer Science 6312, Springer, 2010, 29-42, the problem statement for large photo collections and the experiments
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 A8YY0S Edit this page History Report an error Markdown