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:

  1. 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.

  2. 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

SolverEstimatesMethodChapter
Homography DLT homographySVD nullspaceHomography
Zhang's methodIntrinsics IAC constraintsZhang
Distortion fitLinear LS on residualsDistortion Fit
Iterative intrinsics + distortionAlternating refinementIterative
Planar pose from Decomposition + SVDPlanar Pose
P3P (Kneip) from 3 pointsQuartic polynomialPnP
DLT PnP from pointsSVD + SO(3) projectionPnP
8-point fundamental matrixSVD + rank constraintEpipolar
7-point fundamental matrixCubic polynomialEpipolar
5-point essential matrixAction matrix eigenvaluesEpipolar
Camera matrix DLTSVD + RQ decompositionCamera Matrix
Triangulation3D pointSVD nullspaceTriangulation
Tsai-LenzHand-eye Quaternion + linear LSHand-Eye
Rig extrinsics per cameraSE(3) averagingRig Init
Laser planePlane normal + distanceSVD on covarianceLaser 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.