Zhang's Intrinsics from Homographies

Zhang's method is the most widely used technique for estimating camera intrinsics from a planar calibration board. Given homographies from multiple views of the board, it recovers the intrinsics matrix using constraints from the image of the absolute conic (IAC).

Problem Statement

Given: homographies from a planar calibration board to the image, computed from different viewpoints.

Find: Camera intrinsics .

Assumptions:

  • The calibration board is planar
  • At least 3 homographies from distinct viewpoints
  • The camera intrinsics are constant across all views
  • Distortion is negligible (or has been accounted for — see Iterative Intrinsics)

Derivation

Homography and Intrinsics

From the previous chapter, the homography from a board plane is:

where is an arbitrary scale and are columns of the rotation matrix. Let . Then:

Orthogonality Constraints

Since and are columns of a rotation matrix, they satisfy:

Substituting :

The Image of the Absolute Conic (IAC)

Define the symmetric matrix:

Since is symmetric, it has 6 independent entries. The constraints become:

Each homography gives 2 linear equations in the 6 unknowns of .

The Vectors

To write the constraints as a linear system, define the 6-vector:

where is the -th element of (1-indexed, column , row ). Then:

where .

The Linear System

For each homography , the two constraints become:

Stacking homographies gives a system:

With (giving equations), this is solved via SVD: is the right singular vector of corresponding to the smallest singular value.

Extracting Intrinsics from

Given , the intrinsics are recovered by a Cholesky-like factorization of .

The closed-form extraction:

Validity Checks

is definite, so the extraction fails when:

  • is not positive, or
  • and have different signs (negative focal length squared)

Either way no camera fits the homographies, and the solve returns DegenerateViews: the views do not constrain the intrinsics, typically because the board planes are parallel in every view (all fronto-parallel, or all tilted the same way).

Parallel Boards

A board's vanishing line is , so parallel boards share one vanishing line and give every view the same two constraints: has rank 2. With noisy corners the solve can then return an arbitrary rather than fail. The dataset-level initializer (estimate_intrinsics_iterative) therefore checks the views first: it takes as each board's normal, with a square-pixel camera centred on the observed corners whose focal length is their extent, and returns DegenerateViews when no normal lies more than 1° from the mean plane. Parallel boards read zero through any , up to the corner noise (about 0.15° for a board 40 % of the image wide and 0.2 px of noise); a focal length of the image extent reads the perspective the views show, which is what the constraints feed on.

Minimum Number of Views

  • homographies: 6 equations for the 6 unknowns of — the minimum for a unique solution. The solve also yields a skew term ; it is needed to recover and then discarded, because the camera model has no skew
  • : Only 4 equations, not enough for the general solve
  • : Overdetermined system; SVD gives the least-squares solution

Practical Considerations

View diversity: The views should include significant rotation around both axes. Pure translations leave the board planes parallel, and the intrinsics undetermined. Two orientations only, such as tilts about one axis both ways, give four constraints for the five unknowns, and leave one focal length nearly free; three distinct tilts about one axis determine the camera.

Distortion: Zhang's method assumes distortion-free observations. When applied to distorted pixels, the estimated is biased. The Iterative Intrinsics chapter addresses this with an alternating refinement scheme.

OpenCV equivalence: Zhang's method is the internal initialization step of cv::calibrateCamera. OpenCV does not expose it as a separate API.

API

#![allow(unused)]
fn main() {
let K = estimate_intrinsics_from_homographies(&homographies)?;
}

Returns FxFyCxCy with the estimated intrinsics. Typically followed by distortion estimation and non-linear refinement.

Reference

Zhang, Z. (2000). "A Flexible New Technique for Camera Calibration." IEEE Transactions on Pattern Analysis and Machine Intelligence, 22(11), 1330-1334.