Algorithm Search⌘K

Techniquecore

Reduced camera system

Also called Schur complement trick, point elimination in bundle adjustment.

Eliminate the point blocks of the bundle adjustment normal equations by a Schur complement, leaving a smaller system in the camera parameters only.

The reduced camera system is the linear system that remains when the point unknowns are eliminated from the normal equations of bundle adjustment. Each Gauss-Newton or Levenberg-Marquardt step of bundle adjustment solves

(UWWTV)(δaδb)=(eaeb),\begin{pmatrix} U & W \\ W^{\mathsf T} & V \end{pmatrix} \begin{pmatrix} \delta_a \\ \delta_b \end{pmatrix} = \begin{pmatrix} e_a \\ e_b \end{pmatrix},

where δa\delta_a holds the camera updates, δb\delta_b the point updates, UU is block diagonal with one block per camera, VV is block diagonal with one 3×33 \times 3 block per point, and WW has a block WijW_{ij} exactly where camera ii sees point jj. Because VV is block diagonal it is cheap to invert, and block Gaussian elimination gives the Schur complement system

S δa=ea−WV−1eb,S=U−WV−1WT,S \, \delta_a = e_a - W V^{-1} e_b, \qquad S = U - W V^{-1} W^{\mathsf T},

followed by δb=V−1(eb−WTδa)\delta_b = V^{-1} (e_b - W^{\mathsf T} \delta_a). The system in SS has only the camera unknowns, 6N6N for NN cameras with fixed intrinsics, against 6N+3n6N + 3n for the full system with nn points, and nn is usually far larger than NN. This is the core of sparse bundle adjustment, which factors SS, and of inexact Newton bundle adjustment, which solves it by conjugate gradients without forming it.

In plain words

In bundle adjustment, every measurement ties one camera to one point, and no measurement ties two points together. So if the cameras were known, each point could be fixed on its own with a tiny 3 by 3 system. The trick turns this around. For each point, it works out how the best position of that point depends on the cameras that see it, and it substitutes that into the equations for the cameras. What is left is a system about the cameras only, which is much smaller. After solving it, each point is updated alone. Nothing is approximated: the answer is the same as solving the whole big system at once.

When it applies

The trick applies to any symmetric positive definite system whose unknowns split into two groups, where the second group has a block diagonal (or otherwise cheap to factor) diagonal block. In bundle adjustment the two groups are the cameras and the points. The matrix is JTJJ^{\mathsf T} J for Gauss-Newton, or JTJ+μIJ^{\mathsf T} J + \mu I (or +μD+ \mu D) for Levenberg-Marquardt, and the right side is −JTr-J^{\mathsf T} r. VV is block diagonal because each residual involves one point only. If VV (or the damped VV) is positive definite, the elimination is exact and SS is positive definite too. It pays off when the eliminated group is the large one: 3n≫6N3n \gg 6N.

The template

  1. REDUCE-AND-SOLVE(U, V, W, e_a, e_b)
  2. 1for each point j: compute V_j^-1 ▷ 3 x 3, independent
  3. 2S <- U ; r <- e_a
  4. 3for each point j, for each camera i that sees j: Y_ij <- W_ij V_j^-1 ; r_i <- r_i - Y_ij e_b,j
  5. 4for each camera k that sees j: S_ik <- S_ik - Y_ij W_kj^T
  6. 5solve S δa = r ▷ dense or sparse Cholesky, or PCG
  7. 6for each point j: δb_j <- V_j^-1 (e_b,j - Σ_i W_ij^T δa_i)
  8. 7return δa, δb

Lines L1 to L4 build SS and the reduced right side point by point. Point jj contributes one 6×66 \times 6 term to SikS_{ik} for every pair of cameras (i,k)(i, k) that both see it, so SikS_{ik} is nonzero only when cameras ii and kk share a point. Line L5 solves the reduced system. Line L6 recovers each point from the cameras that see it. With cjc_j cameras seeing point jj and m=∑jcjm = \sum_j c_j observations, lines L1, L3 and L6 cost O(n+m)O(n + m), line L4 costs O(∑jcj2)O(\sum_j c_j^2), and a dense Cholesky factorization in line L5 costs O(N3)O(N^3), against O((6N+3n)3)O((6N + 3n)^3) for a dense solve of the full system.

Why it is exact (theorem). The second block row gives δb=V−1(eb−WTδa)\delta_b = V^{-1}(e_b - W^{\mathsf T} \delta_a). Substituting it into the first block row gives (U−WV−1WT)δa=ea−WV−1eb(U - W V^{-1} W^{\mathsf T}) \delta_a = e_a - W V^{-1} e_b. Conversely, any solution of the reduced system, with δb\delta_b from line L6, solves the full system. If the full matrix HH is positive definite, then for a≠0a \ne 0 and b=−V−1WTab = -V^{-1} W^{\mathsf T} a one gets (a,b)TH(a,b)=aTSa>0(a, b)^{\mathsf T} H (a, b) = a^{\mathsf T} S a > 0, so SS is positive definite and its Cholesky factorization exists.

What SS means (theorem). The camera block of H−1H^{-1} is S−1S^{-1}. When HH is the information matrix of a Gaussian estimate, SS is the information matrix of the cameras alone, with the points marginalized out; this is why the same operation is called marginalization in SLAM.

Classic examples

A small worked case. Take two cameras and three points, each with one scalar unknown, with U=diag⁡(5,6)U = \operatorname{diag}(5, 6), V=diag⁡(2,2,1)V = \operatorname{diag}(2, 2, 1), camera 1 seeing points 1 and 2, camera 2 seeing points 2 and 3, all Wij=1W_{ij} = 1, ea=(1,2)e_a = (1, 2) and eb=(2,2,1)e_b = (2, 2, 1). Then

WV−1WT=(10.50.51.5),S=(4−0.5−0.54.5),r=ea−WV−1eb=(−1,0).W V^{-1} W^{\mathsf T} = \begin{pmatrix} 1 & 0.5 \\ 0.5 & 1.5 \end{pmatrix}, \quad S = \begin{pmatrix} 4 & -0.5 \\ -0.5 & 4.5 \end{pmatrix}, \quad r = e_a - W V^{-1} e_b = (-1, 0).

The off-diagonal −0.5-0.5 comes from point 2, the only point both cameras see. Solving gives δa=(−18/71,−2/71)\delta_a = (-18/71, -2/71), and line L6 gives δb=(80/71,81/71,73/71)\delta_b = (80/71, 81/71, 73/71). Substituting all five values into the original 5×55 \times 5 system confirms every equation; for example the first row is 5⋅(−18/71)+80/71+81/71=15 \cdot (-18/71) + 80/71 + 81/71 = 1.

Bundle adjustment. With 6 parameters per camera and 3 per point, a scene of 100 cameras and 100000 points has a full system of order 300600, but SS has order 600. This is the step of sparse bundle adjustment.

Large photo collections. With tens of thousands of cameras, SS itself is too large to factor densely. Inexact Newton bundle adjustment applies SS to vectors as Ux−W(V−1(WTx))U x - W (V^{-1} (W^{\mathsf T} x)) and solves by preconditioned conjugate gradients.

Marginalization in sliding windows. In sliding window bundle adjustment and visual-inertial odometry, old states leave the window by the same Schur complement, which keeps their information as a prior on the remaining states.

Outside vision. The same block elimination is static condensation in the finite element method and the interface system of nonoverlapping domain decomposition.

Variations

  • Eliminate the cameras instead. When there are far more cameras than points, which is rare, eliminate the camera blocks and solve for the points.
  • Sparse SS. When each camera shares points with only a few others, as in a long street sequence, SS is sparse, and a sparse Cholesky factorization with a fill-reducing ordering is much cheaper than a dense one.
  • Implicit SS. Never form SS; compute products with it, and solve iteratively.
  • Shared intrinsics. Parameters that all cameras share, such as one focal length, add a dense border to UU; they stay in the reduced system.
  • Points with extra structure. Inverse depth points (1 parameter) or line features change only the size of the VjV_j blocks.
  • Damping. For Levenberg-Marquardt, add μ\mu to both UU and VV before the elimination, so that the result is the exact damped step.

Pitfalls

  • Singular point blocks. A point seen by one camera has a rank 2 VjV_j in Gauss-Newton, and a point with a tiny triangulation angle has a nearly singular one. Damp VV, or remove such points, before line L1.
  • Damping only SS. Adding μ\mu to SS after the elimination is not the Levenberg-Marquardt step. Damp UU and VV first.
  • Gauge. Without fixed gauge parameters, HH and SS are singular in the undamped case; see gauge freedom. Fix a camera and a scale, or keep μ>0\mu > 0.
  • Dense fill. If one point is seen by all cameras, it alone makes SS dense. Many shared points in large scenes make SS dense even when JJ is very sparse.
  • Assuming SS is small. SS has order 6N6N; with NN in the tens of thousands it does not fit in memory as a dense matrix.

Exercises

  1. Show that SS is positive definite when HH is, and that det⁡H=det⁡V⋅det⁡S\det H = \det V \cdot \det S.
  2. In the worked case, change W22W_{22} from 11 to 00 (camera 2 no longer sees point 2). Show that SS becomes diagonal and explain why.
  3. Count the nonzero 6×66 \times 6 blocks of SS for NN cameras in a line, where each point is seen by two neighboring cameras only. What is the cost of a banded Cholesky factorization of SS?
  4. Prove that the camera block of H−1H^{-1} equals S−1S^{-1}.
  5. For a damped system with μ>0\mu > 0, show that eliminating the points and then solving gives the same step as the dense Levenberg-Marquardt solve, even when the undamped VjV_j are singular.

References

  1. 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, Section 6.1, The Schur complement and the reduced bundle system, and the rest of Section 6 on the network structure and fill
  2. Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Appendix 6, Iterative estimation methods (the partitioned normal equations of sparse Levenberg-Marquardt and their solution by eliminating the point parameters)
  3. 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 derivation of the reduced camera system from the block structure of the normal equations
  4. 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 Schur complement section (the reduced camera system and its implicit and explicit use)
  5. Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Chapter 11, Structure from motion and SLAM (bundle adjustment, exploiting sparsity)

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • three classic examples