Problemintro
Camera calibration
Also called camera resectioning, geometric camera calibration.
Estimate the intrinsic, extrinsic and distortion parameters of a camera from images of points whose 3D positions or structure are known.
Camera calibration is the problem of finding the numbers that describe how a camera forms its image: the intrinsic matrix , the lens distortion, and, for each image, the pose given by the extrinsic parameters and . The input is images of a target whose 3D geometry is known, such as a box with marks, a flat checkerboard or a set of measured points. Among the close pages, this page states the problem and compares the methods. DLT resectioning estimates a general matrix from a 3D target, with no distortion. Camera matrix decomposition splits such a into , and . Zhang's method uses several views of a plane. Tsai's method uses a constraint that radial distortion does not affect.
In plain words
A camera turns 3D points into pixels by a fixed rule. The rule depends on the focal length, where the optical axis meets the sensor, how the lens bends straight lines, and where the camera stands. Calibration finds these numbers. You show the camera an object whose shape you know exactly, such as a printed checkerboard, and take some photos. You find the corners in each photo. Then you search for the numbers that make the rule send each known corner as close as possible to where it shows in the photo. After this, you can turn any pixel into a ray in 3D, remove the lens bending, and measure real sizes and distances.
Definition
The usual camera model is a pinhole with distortion. A world point goes to camera coordinates , then to the normalized image point , then through a distortion map with parameters , and finally to the pixel
Write for this map. The axes of the camera are to the right, down and forward, and the pixel center of the top left pixel is .
Input. images. In image , the target points , with known 3D coordinates in the frame of the target, and their measured pixels , for .
Output. The intrinsics , the distortion parameters , and a pose for each image.
Criterion. Under independent Gaussian pixel noise with the same variance, the maximum likelihood estimate minimizes the total reprojection error
This is a nonlinear least squares problem. All the methods below either minimize directly from a starting guess, or give such a starting guess in closed form.
Variants
- By target. A 3D target with points not on one plane (the classic photogrammetry setup); a planar target, such as a checkerboard or a grid of ArUco or AprilTag marks; a 1D target, such as points on a stick moved about a fixed point; or no target at all, which is self-calibration from the images of a rigid scene. Calibration from the vanishing points of three orthogonal directions is a special case with scene structure instead of a target.
- By what is known. Intrinsics only, with the poses as nuisance parameters; intrinsics and the pose of one chosen view; or only the pose, with known, which is the perspective-n-point problem.
- By lens model. A pure pinhole; a pinhole with the Brown-Conrady radial and tangential distortion; a fisheye model for wide lenses; or a generalized camera that gives each pixel its own ray.
- By number of cameras. One camera, or several cameras with fixed relative poses, as in stereo camera calibration.
- By the constraints on . General five parameter ; zero skew; square pixels (); or a known principal point.
Examples
A direct check. Take a camera with zero skew, square pixels, unknown and principal point known, and no distortion. A point at in camera coordinates shows at . Then , so . Real calibration does not know the camera coordinates of the point, so it must find the pose at the same time, and that makes the problem nonlinear.
Counting for a checkerboard. A board with inner corners, seen in images, gives equations. The unknowns are 5 intrinsics, 2 radial distortion terms and 6 pose parameters per image, so unknowns. The problem is strongly overdetermined, which averages out the corner noise.
Counting for a 3D target. A general camera matrix has 11 degrees of freedom, so 6 points in general position are enough for the linear method; see the worked example on DLT resectioning.
Known algorithms
| method | target | start | distortion | page |
|---|---|---|---|---|
| DLT, decomposition, then geometric fit | 3D, not coplanar | closed form, from points | added in the fit | DLT resectioning, decomposition |
| Tsai (1987) | 3D, or planar with care | two linear stages | radial, one term | Tsai's method |
| Heikkila and Silven (1997) | 3D or planar | DLT | radial and tangential | none |
| Zhang (2000) | planar, views (2 with zero skew) | closed form from homographies | radial, in the fit | Zhang's method |
| vanishing points | scene with orthogonal directions | closed form | none | vanishing point calibration |
| self-calibration | none, a rigid scene | from the Kruppa equations or the absolute quadric | in a bundle adjustment | self-calibration |
All of these end, when accuracy matters, with a Levenberg-Marquardt minimization of over all parameters, which is a bundle adjustment with the 3D points held fixed. OpenCV's calibrateCamera and the MATLAB toolbox of Bouguet follow Zhang's start and this refinement.
| Algorithm | Time | Space | Properties | Code |
|---|---|---|---|---|
| Direct linear transformation for camera resectioning | Θ(n) worst · average · best | Θ(n) extra | deterministicexactofflineiterative | 1 language |
| Tsai's calibration method | O(T n) worst · average | O(n) extra | deterministicnot exactofflineiterative | 1 language |
| Calibration from vanishing points | Θ(1) worst · average · best | Θ(1) extra | deterministicexactofflineiterative | 1 language |
| Zhang's calibration method | O(n N + T n N^3) worst · average · best | O(n N^2) extra | deterministicnot exactofflineiterative | 1 language |
Bounds
- Identifiability with a 3D target (theorem). A finite camera matrix has 11 degrees of freedom and each point gives 2 equations, so at least 6 points are needed (5.5 in the count). If all points lie on one plane, is not determined: the DLT matrix has a null space of dimension at least 4. The full list of degenerate sets is in HZ section 22.1.
- Identifiability with a plane (theorem, Zhang 2000). Each view of a plane gives 2 linear equations on the 6 entries, up to scale, of , the image of the absolute conic. So 3 views in general position fix a general , and 2 views fix with zero skew. The two equations depend only on the orientation of the plane, so views of parallel planes, for example views that differ by a pure translation, give no new information.
- Optimality (theorem). Under independent, equal variance Gaussian pixel noise and exact target coordinates, minimizing is the maximum likelihood estimate. Linear methods minimize an algebraic error instead, and are not optimal.
- Accuracy (heuristic). The error of the parameters falls roughly as in the number of independent measurements, if the views are varied. Views that tilt the target strongly, and corners near the edges of the image, are what fix the principal point and the distortion; Zhang (2000) reports on synthetic data that tilts far from 0 degrees give better results than views facing the camera (a benchmark result).
- Input size. Every method reads all measurements, so no method is faster than linear in the data.
Reductions
- 3D target to linear algebra. Calibration without distortion from a 3D target reduces to finding the null vector of a matrix (DLT resectioning) and an RQ factorization (decomposition).
- Planar target to homographies. Each view of a plane at gives the homography by the DLT for homographies. The constraints and are linear in , and follows from by a Cholesky factorization.
- Known intrinsics to pose. If and the distortion are known, the pose of each view is a perspective-n-point problem.
- Refinement to nonlinear least squares. The final step is a sparse nonlinear least squares problem, solved by Levenberg-Marquardt.
- Stereo to two calibrations. A stereo rig is two calibrations that share the poses of the target, plus one fixed relative pose; see stereo camera calibration.
Applications
- Metric 3D reconstruction. Triangulation, stereo depth and structure from motion need to turn pixels into rays with true angles.
- Undistortion and rectification. Removing lens distortion, and making the rows of two stereo images match for stereo rectification.
- Augmented reality. Drawing virtual objects so that they line up with the real scene needs the true field of view and pose.
- Robotics and measurement. Visual servoing, the pose of parts on a conveyor, and photogrammetric measurement of sizes.
- Multi-camera systems. Rigs for motion capture, cars and 3D scanners are calibrated jointly so that all cameras share one frame.
References
- Richard Hartley and Andrew Zisserman, Multiple View Geometry in Computer Vision, second edition, Cambridge University Press, 2004, Chapter 6, Camera models; Chapter 7, Computation of the camera matrix P (the linear and gold standard methods, restricted cameras and radial distortion)
- Zhengyou Zhang, A flexible new technique for camera calibration, IEEE Transactions on Pattern Analysis and Machine Intelligence 22(11), 2000, 1330-1334, the whole paper (calibration from views of a plane, the closed form start and the maximum likelihood refinement)
- Roger Y. Tsai, A versatile camera calibration technique for high-accuracy 3D machine vision metrology using off-the-shelf TV cameras and lenses, IEEE Journal on Robotics and Automation 3(4), 1987, 323-344, the whole paper (the camera model with radial distortion and the two stage method)
- Janne Heikkila and Olli Silven, A four-step camera calibration procedure with implicit image correction, Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 1997, 1106-1112, the whole paper (linear start, nonlinear fit with radial and tangential distortion)
- Peter Sturm, Srikumar Ramalingam, Jean-Philippe Tardif, Simone Gasparini and Joao Barreto, Camera models and fundamental concepts used in geometric computer vision, Foundations and Trends in Computer Graphics and Vision 6(1-2), 2011, 1-183, the overview of camera models and of calibration approaches
- Richard Szeliski, Computer Vision, Algorithms and Applications, second edition, Springer, 2022, Chapter 11, Structure from motion and SLAM (the part on geometric intrinsic calibration)
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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 97AGWE Edit this page History Report an error Markdown