Bundle Adjustment
Bundle Adjustment (BA) is the joint nonlinear refinement of camera poses and 3D landmark positions that minimizes total reprojection error. The name comes from the “bundles of rays” connecting each camera center to the 3D points it observes — BA adjusts poses and points until these bundles agree with the image measurements as well as possible. It is the gold-standard back-end of feature-based SLAM and structure-from-motion.
The cost function
For camera pose observing landmark at pixel measurement , the reprojection error is
where is the camera projection function (pinhole model plus distortion). BA solves
where is the set of (pose, point) observation pairs, is the information matrix (inverse measurement covariance, typically scaled per pyramid level), and is an optional robust kernel (e.g., Huber) that caps the influence of outlier matches. Under Gaussian noise and correct associations, this is exactly the maximum-likelihood estimate.
How it is solved
BA is a nonlinear least-squares problem, solved iteratively with Gauss-Newton or Levenberg-Marquardt. Each iteration linearizes the residuals around the current estimate, , and solves the (damped) normal equations
Poses live on the manifold, so updates use a local parameterization: a 6-vector is mapped through the exponential map and composed with the current pose, , keeping the state a valid rigid transform at every step.
Sparsity and the Schur complement
Each residual involves exactly one pose and one point, so the Hessian approximation has the block structure
with () coupling only poses, () coupling only points, and the pose-point cross terms. Crucially, is block-diagonal with independent blocks per landmark, so it is trivially invertible. The Schur complement eliminates the points first:
reducing a -dimensional solve to a -dimensional one — decisive when (thousands of points, tens of keyframes). Landmark updates are then recovered by cheap back-substitution. This structure exploitation is what makes real-time BA feasible; it is built into g2o, Ceres, and GTSAM.
Gauge freedom: the cost is invariant to a global rigid transform of all poses and points (7 degrees of freedom for monocular, where scale is also free). Solvers fix this by anchoring the first keyframe (and, for monocular, one scale reference) or adding a prior; otherwise is singular.
Flavors used in practice
- Motion-only BA: fix landmarks, optimize a single camera pose — the tracking-thread pose refinement in ORB-SLAM.
- Local BA: optimize a window of recent/covisible keyframes and their landmarks, with neighboring keyframes fixed as anchors — runs continuously in the mapping thread.
- Global BA: optimize everything, typically after a loop closure, often initialized by pose-graph optimization to bring the trajectory close before the expensive full refinement.
- Structure-only BA: fix poses, refine points (e.g., after triangulating new landmarks).
Why it matters for SLAM
BA is the accuracy engine of modern visual SLAM: keyframe-based systems owe their precision to repeatedly re-optimizing poses and structure against raw image measurements rather than trusting incremental estimates. The comparison by Strasdat et al. that “optimization beats filtering” for visual SLAM is essentially a statement about BA. Understanding its sparse structure — and the Schur trick — also explains the architecture of every serious SLAM back-end library and why keyframe selection (keeping small) matters so much.