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
The extraction can fail when:
- (degenerate: insufficient view diversity)
- and have different signs (negative focal length squared)
These cases indicate that the input homographies do not sufficiently constrain the intrinsics, typically because the views are too similar (e.g., all near-frontal).
Minimum Number of Views
- homographies: 6 equations for 6 unknowns — the minimum for a unique solution (with skew)
- : Only 4 equations; requires the additional assumption that (zero skew) to reduce unknowns to 5
- : Overdetermined system; SVD gives the least-squares solution
Practical Considerations
View diversity: The views should include significant rotation around both axes. Pure translations or rotations around a single axis lead to degenerate configurations where some intrinsic parameters are undetermined.
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 FxFyCxCySkew 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.