Mastering Camera Calibration
From Checkerboards to Real-World Accuracy
Why accurate intrinsics, distortion, and extrinsics are the bedrock of reliable perception in robotics.
Introduction
Cameras are the “eyes” of a robot, but without calibration they don’t see the world as it really is. Lens distortion, unknown focal lengths, and misaligned extrinsics can derail navigation, detection, and measurement tasks.
This post explains calibration in an educational, engineer-friendly way — including the math, practical steps, and pitfalls.
The Pinhole Camera Model
Calibration estimates parameters that describe how a 3D world point projects to a 2D image point. The classical pinhole model is:
The intrinsic matrix K has the form:
Here, are focal lengths in pixels, is the principal point, and is skew (usually zero).
Lens Distortion
Real lenses deviate from the ideal pinhole model. The two most common effects are radial and tangential distortion. With normalized image coordinates and , a popular model is:
Calibration Workflow
-
Collect data: print a rigid checkerboard; capture 15–30 images at diverse distances, tilts, and positions that cover the full field of view.
-
Detect corners: use sub-pixel corner refinement (e.g., OpenCV
findChessboardCorners+cornerSubPix). -
Estimate parameters: solve intrinsics + distortion by minimizing reprojection error.
-
Validate: overlay reprojected points; inspect RMS error and look for spatial bias.
Detected (noisy) vs. model reprojected corners overlay. Good calibrations show tight overlap.
Distortion bends straight lines. Undistortion maps curved observations back to straight lines.
Quantifying Accuracy
The most common metric is RMS reprojection error:
Reprojection error histogram (px). Well-calibrated systems often achieve < 0.5 px RMS.
Best Practices & Pitfalls
- Rigid target: mount the checkerboard on foam board or acrylic; paper warps invalidate the planarity assumption.
- Lighting: avoid glare and harsh shadows; use diffuse lighting for stable corner detection.
- Diverse viewpoints: collect near/far and large tilts; cover the whole image (especially edges).
- Time sync (multi-sensor): for camera-IMU or stereo rigs, temporal alignment matters as much as spatial alignment.
- Recalibrate after changes: remounting, impacts, or temperature extremes can shift parameters.
- Automate validation: keep a script that reports RMS error and visual overlays for every new calibration.
From Theory to Practice
Accurate calibration reduces downstream errors in SLAM, detection, and control, saving weeks of debugging and improving field reliability. Whether you’re building AMRs, agricultural robots, or inspection systems, a robust calibration pipeline is non-negotiable.
The theory is sound, but in practice, collecting calibration data with sufficient quality may be underestimated. Key considerations to make while setting up calibration data acquisition:
- Calibration target choice: For industrial applications, even if it is just for development or exploration, choose the right calibration target to fit the Field of View (FOV), Depth of Field (DOF), resolution and type of your camera. If possible, always go for industrial calibration targets which have the patterns etched or printed onto them with known accuracy metrics. If you have to use a printed target due to time or budget constraints for the initial phase of your project, then try to use thicker and durable paper (or other similar printing medium) and make sure to check the scaling of your print.
- Lighting setup: Depending on your camera's sensor type, lighting sensitivity to different wavelengths, lens specifications and calibration target type, it is critical to design the right setup for lighthing during calibration. Typically for calibration, the target should be imaged by the camera from different poses. It is highly critical that reflections are avoided and that the target is as uniformly exposed to light as possible. The wavelength of the lighting setup or its combination could be critical for an accurate calibration as well. In the end, the more accurate you can detect the features on the calibration board, the better and long-lasting your calibration is.
- Calibration Lifespan: Thermal cycles, vibrations and other various factors due to the use of the final setup creates variations in the calibration parameters over the lifespan of a product. Hence, in the design, implementation and validation phases of your product, you have to determine how the product's usage will effect calibration validity, how frequent calibration would be have to be repeated, and if it is at all possible to do re-calibration on the field, performed by the user. Ideally, if this calibration lifespan should be much longer than the product lifecycle. But in practice, it may actually result in frequent recalibration requirement if such internal and external disturbances to the imaging system is not taken into account during the design phase. Material choice in parts, build and assembly quality, thermal and vibration isolation or even the choice of internal fasteners could play a role in this.
Conceptual pinhole projection: 3D points map to the image plane through the camera center.
Need Help?
At Arioviz GmbH, we build calibration pipelines for single cameras, stereo rigs, and camera-IMU systems, and integrate them with ROS2.
If you’d like us to review your setup or build a turnkey calibration flow: get in touch!