What is Camera Calibration?
Camera calibration is a process that estimates the geometric parameters of a camera, so that image points can be related to points in the scene.
A camera is calibrated when its principal distance, principal point offset and lens distortion are known (Remondino and Fraser, 2006). The principal distance is the focal length that photogrammetry uses. This page covers the parameters, the distortion models, the calibration methods, how to check a result, and what it means for drone surveys. The same word is also used for radiometric calibration, which is a different process (see the section on geometric and radiometric calibration).
What camera calibration estimates
The intrinsic parameters belong to one camera and lens. They do not depend on the scene. They are the focal length, the principal point (the optical center) and the lens distortion. The USGS guidelines call them the interior orientation parameters.
The extrinsic parameters are a rotation and a translation. They change the coordinates from the scene to the camera frame. They are different for every image, because the camera moves.
OpenCV uses the pinhole camera model. The focal lengths (fx, fy) are in pixel units. The principal point (cx, cy) is usually close to the image center. The two groups form the camera matrix, also written K or A:
- Row 1: fx, 0, cx
- Row 2: 0, fy, cy
- Row 3: 0, 0, 1
Zhang’s version of the matrix has one more term. It is a skew value that describes how far the two image axes are from a right angle. In OpenCV it is zero. The USGS model has two terms for the scale difference of the pixels in x and y. Remondino and Fraser say that terms for affinity and shear are rarely significant in modern digital cameras.
Software estimates the parameters in pixel units. To get a focal length in distance units, multiply it by the physical size of the pixel (USGS). Once a camera matrix is known, it can be reused as long as the focal length is fixed. If the image is scaled, scale the matrix values by the same factor. The distortion coefficients do not change with the resolution.
Lens distortion
A lens has many elements, so a straight line in the scene is not always a straight line in the image. This effect is distortion. It has two main parts.
- Radial distortion moves image points along the line from the principal point. It makes straight lines look curved, and it grows toward the edge of the image. OpenCV describes barrel and pincushion distortion as the two common forms. The common barrel distortion of consumer lenses is mostly the first radial term, k1 (Remondino and Fraser).
- Tangential (decentering) distortion appears when the lens elements are not centered on the optical axis. OpenCV describes the cause as a lens that is not parallel to the sensor. It is usually an order of magnitude or more smaller than radial distortion.
The basic OpenCV model has five coefficients: k1, k2, p1, p2 and k3. The k terms are radial and the p terms are tangential. The extended OpenCV model adds k4 to k6, four thin prism terms (s1 to s4) and a tilt term. OpenCV also has a separate fisheye model for lenses with a very wide field of view.
Photogrammetry uses an eight-term model that Brown formulated in 1971. It has the principal distance, the principal point offset (xp, yp), three radial coefficients and two decentering coefficients (Remondino and Fraser). The USGS guidelines write the same radial and decentering terms. OpenCV names the Brown-Conrady model as one of the two models that its rational distortion model combines. The other is the division model.
Distortion changes with the lens setting. Radial distortion changes with the focal length, and decentering distortion changes with the focus, but much less. A calibration is valid for the lens setting that was used.
Calibration methods
| Method | What you need | Where it is used |
|---|---|---|
| Planar pattern (Zhang) | A flat pattern such as a checkerboard, photographed from different orientations | On the ground before a flight |
| Laboratory test field | A calibration cage with coded targets and a fixed camera position | A calibration room |
| In situ range | A dense set of accurate control points | Large cameras on an aerial platform |
| Self-calibration | The survey images, tie points and a few ground control points | Most drone mapping |
Planar pattern. The camera sees a flat pattern from different orientations. Zhang’s method needs at least two. It finds a first solution in closed form, and then it refines the solution by maximum likelihood estimation. The OpenCV tutorials say that two snapshots are enough in theory. In practice, real images have noise, so use at least 10 good snapshots. OpenCV supports a chessboard, a ChArUco board and circle grids, and a circular grid needs fewer images. If the pattern stays parallel to its first position, or only moves by translation, a new image adds no constraint (Zhang, section 4). So turn the pattern between images.
In the OpenCV code, the pattern lies on the plane Z = 0. If the square size is known, for example 30 mm, the results are in millimeters. If it is not known, the results are in units of one square.
Laboratory test field. The USGS describes a calibration cage with three parallel panels. The panels have retroreflective targets and coded targets. The lens is focused at infinity. The camera takes images from three angular positions, and the software needs at least four coded targets that are common to the images.
In situ range. A calibration range has a dense set of accurate control points. A least-squares block adjustment gives the parameters. The USGS notes that this needs aerial images over the range, which can be inconvenient, and that the range needs careful maintenance.
Self-calibration. Structure from motion software finds tie points in many images. It estimates the interior orientation, the distortion and the exterior orientation together. The USGS states that this is the most common method in UAS-based mapping. It also explains why a laboratory calibration is not enough for a drone. The parameters can change between the laboratory and the field, because the sensors are not stable.
Self-calibration works only when the image network is strong. Remondino and Fraser list convergent images, orthogonal roll angles and a large number of well distributed points. The USGS adds that tie points should lie on stable surfaces and be seen from at least six locations.
How to check the result
The reprojection error shows how exact the parameters are. The software projects the known object points into the image with the estimated parameters. It then measures the distance to the points that it found in the image. The closer the error is to zero, the more accurate the parameters are (OpenCV). OpenCV reports the result as a root mean squared error (RMSE).
A self-calibrated survey is checked with ground points. The USGS keeps some ground control points out of the calibration and uses them as check points. The USGS also recommends that the calibration parameters and their uncertainties are stored in the metadata of the dataset.
Doming and flight design
Self-calibration can fail when all images look in nearly the same direction. The distortion estimate is then wrong, and the 3D model shows a broad vertical dome. James and Robson (2014) found that this error comes from near-parallel imaging directions together with an inaccurate correction of radial distortion. The doming has a linear relationship with the radial distortion. Oblique images reduce it. With no control points, the error fell by up to two orders of magnitude in their flight plans.
The USGS recommends two flight elevations in orthogonal directions. In its example, the north-south flights are 50 percent higher than the east-west flights. The tie points are then imaged many times and in different parts of the frame. This gives a more reliable estimate of the interior orientation.
Why calibration matters for accuracy
The USGS states that accurate orthoproducts are possible without a well calibrated camera, but that they then need a dense network of control points. The USGS says that such a network makes a project prohibitively expensive.
Accuracy does not come from the ground sample distance (GSD) alone. The ground control points must be at least three times as accurate as the accuracy that the imagery needs. Take a dataset with a 1 cm GSD. Say the control points have an accuracy of 2 cm (1 sigma) or better. The dataset may then have an accuracy of less than 6 cm (1 sigma). Control points from real-time kinematic (RTK) solutions have an accuracy of about 2 to 3 cm (1 sigma). With them, the USGS says the imagery can be checked only to about 6 cm.
Geometric and radiometric calibration
Geometric calibration describes the path of a light ray into the camera. Radiometric calibration is a separate process. It links the raw values of the sensor (digital numbers) to physical properties of the target, such as radiance, reflectance or temperature. The USGS says that without it the digital numbers have no meaning for scientific analysis. A geometric calibration does not give this link.
Use in drone inspection
A drone survey of an airfield measures distances, areas and positions from images. The geometry of the images comes from the camera calibration, so it affects every measurement taken from the images. The sources on this page set no airfield-specific calibration requirement for inspection cameras. For a survey, ask the provider three things:
- Which method was used, self-calibration or a laboratory calibration.
- How the result was checked, for example with check points that were not used in the calibration.
- Where the calibration parameters and their uncertainties are stored.
Frequently Asked Questions
- What is camera calibration?
- Camera calibration is the process that estimates the geometric parameters of a camera. With them, image points can be related to points in the scene. A camera is calibrated when its principal distance, principal point offset and lens distortion parameters are known (Remondino and Fraser, 2006).
- What are the parameters of a camera calibration?
- There are three groups. The intrinsic parameters are the focal length (fx, fy) and the principal point (cx, cy), written as a 3x3 camera matrix. The lens distortion coefficients are k1, k2, p1, p2 and k3 in the basic OpenCV model. The extrinsic parameters are a rotation and a translation. They place the camera in the scene and change with every image.
- What are the methods of camera calibration?
- There are four. A planar pattern such as a checkerboard is photographed from different orientations (Zhang's method). A laboratory test field with coded targets is photographed from fixed positions. An in situ calibration range with dense control points is flown. Self-calibration estimates the parameters from the survey images themselves, and it is the most common method in drone mapping.
- How many images does a checkerboard calibration need?
- Zhang's method needs at least two orientations of a planar pattern. The OpenCV tutorial asks for at least 10 good images, because real images contain noise. The pattern must be turned between images, because a second image with a parallel pattern gives no new constraint.
- Can a drone camera be calibrated during the survey?
- Yes. Most structure from motion software estimates the camera parameters from the survey images. This is self-calibration, and USGS users typically rely on it. Near-parallel images can give a wrong distortion estimate and a domed surface, and adding oblique images reduces this error (James and Robson, 2014).
- What is the Brown-Conrady distortion model?
- It is a lens distortion model with radial and decentering (tangential) terms. Brown (1971) formulated the eight-term photogrammetric version. It has three radial coefficients, two decentering coefficients, the principal distance and the principal point offset. OpenCV names the Brown-Conrady model as one part of its rational distortion model.
- How do you write the camera matrix from a focal length and a principal point?
- Put the focal lengths on the diagonal and the principal point in the last column. The matrix is [fx 0 cx / 0 fy cy / 0 0 1], with all values in pixels. Take fx = fy = 721.5 and a principal point of (609.6, 172.9). The matrix is then [721.5 0 609.6 / 0 721.5 172.9 / 0 0 1].
- How do you calibrate a camera in C++ with OpenCV?
- The OpenCV C++ tutorial finds the pattern corners in each image with cv::findChessboardCorners or cv::findCirclesGrid. It then calls cv::calibrateCameraRO, which returns the camera matrix, the distortion coefficients and the average reprojection error. The sample program is in samples/cpp/tutorial_code/calib3d/camera_calibration.
References
- opencv-calibration
- Camera Calibration (OpenCV-Python tutorial) OpenCV
- opencv-calibration-cpp
- Camera calibration With OpenCV (C++ tutorial) OpenCV
- opencv-calib3d
- Camera Calibration and 3D Reconstruction (calib3d module) OpenCV
- zhang-2000
- A Flexible New Technique for Camera Calibration (MSR-TR-98-71) Microsoft Research
- remondino-fraser-2006
- Digital camera calibration methods: considerations and comparisons ISPRS Commission V Symposium, IAPRS Volume XXXVI, Part 5, pp. 266-272
- usgs-ofr-2023-1033
- Guidelines for Calibration of Uncrewed Aircraft Systems Imagery (Open-File Report 2023-1033) U.S. Geological Survey
- james-robson-2014
- Mitigating systematic error in topographic models derived from UAV and ground-based image networks Earth Surface Processes and Landforms 39(10), 1413-1420 (DOI 10.1002/esp.3609)
This is a reference entry. TarmacView provides drone inspection services and doesn't sell the equipment or materials described in this glossary.
