Why Linear Initialization Matters
Non-linear optimization is the workhorse of camera calibration: it achieves sub-pixel reprojection error by jointly optimizing all parameters. But non-linear optimizers — Levenberg-Marquardt, Gauss-Newton, and their variants — are local methods. They converge to the nearest local minimum, which is only the global minimum if the starting point is sufficiently close.
The role of linear initialization is to provide that starting point.
The Init-Then-Refine Paradigm
Every calibration workflow in calibration-rs follows a two-phase pattern:
-
Linear initialization: Closed-form solvers estimate approximate parameters. These are fast, deterministic, and require no initial guess — but they achieve only ~5-40% accuracy on camera parameters.
-
Non-linear refinement: Levenberg-Marquardt bundle adjustment minimizes reprojection error starting from the linear estimate. This converges to <2% parameter accuracy and <1 px reprojection error.
The linear estimate does not need to be highly accurate. It needs to be in the basin of convergence of the non-linear optimizer — close enough that gradient-based iteration converges to the correct solution rather than a local minimum.
Why Not Just Optimize Directly?
Without initialization, you would need to guess intrinsics (), distortion (), and all camera poses ( per view). For a typical 20-view calibration:
- 4 intrinsics + 5 distortion + 20 × 6 pose = 129 parameters
- The cost landscape has many local minima
- A random starting point will almost certainly diverge or converge to a wrong solution
Linear initialization eliminates this problem by computing a reasonable estimate from the data structure alone.
Linear Solvers in calibration-rs
| Solver | Estimates | Method | Chapter |
|---|---|---|---|
| Homography DLT | homography | SVD nullspace | Homography |
| Zhang's method | Intrinsics | IAC constraints | Zhang |
| Distortion fit | Linear LS on residuals | Distortion Fit | |
| Iterative intrinsics | + distortion | Alternating refinement | Iterative |
| Planar pose | from | Decomposition + SVD | Planar Pose |
| P3P (Kneip) | from 3 points | Quartic polynomial | PnP |
| DLT PnP | from points | SVD + SO(3) projection | PnP |
| 8-point fundamental | matrix | SVD + rank constraint | Epipolar |
| 7-point fundamental | matrix | Cubic polynomial | Epipolar |
| 5-point essential | matrix | Action matrix eigenvalues | Epipolar |
| Camera matrix DLT | SVD + RQ decomposition | Camera Matrix | |
| Triangulation | 3D point | SVD nullspace | Triangulation |
| Tsai-Lenz | Hand-eye | Quaternion + linear LS | Hand-Eye |
| Rig extrinsics | per camera | SE(3) averaging | Rig Init |
| Laser plane | Plane normal + distance | SVD on covariance | Laser Init |
Common Mathematical Tools
Most linear solvers share a common toolkit:
- SVD (Singular Value Decomposition): Solves homogeneous systems via the right singular vector corresponding to the smallest singular value. This is the core of DLT methods.
- Hartley normalization: Conditions the DLT system for numerical stability by centering and scaling the input points.
- Polynomial root finding: Minimal solvers (P3P, 7-point F, 5-point E) reduce to polynomial equations.
The following chapters derive each algorithm in detail.