Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ethz-asl/kalibr/llms.txt
Use this file to discover all available pages before exploring further.
kalibr_calibrate_cameras estimates the intrinsic parameters (focal length, principal point, distortion coefficients) for each camera in your rig simultaneously with the extrinsic transformations between them. The result is a camera chain description that other Kalibr tools and downstream pipelines can consume directly.
This guide covers camera-only calibration. If you also need to calibrate an IMU, run this step first and use the output
camchain.yaml as input to camera-IMU calibration.Prerequisites
- A ROS bag containing image topics from each camera, recorded while moving an AprilGrid target in front of the rig
- An
aprilgrid.yamltarget configuration file — see AprilGrid target reference - One camera model selected per camera — see camera models reference
Available camera models
| Model | Projection | Distortion | Typical use |
|---|---|---|---|
pinhole-radtan | Pinhole | Radial-tangential | Standard wide-angle lenses |
pinhole-equi | Pinhole | Equidistant (fisheye) | Fisheye lenses up to ~180° |
pinhole-fov | Pinhole | FOV | Wide-angle with single parameter |
omni-none | Omnidirectional | None | Catadioptric / fisheye, no distortion |
omni-radtan | Omnidirectional | Radial-tangential | Catadioptric and fisheye lenses |
eucm-none | Extended unified | None | Very wide FOV cameras |
ds-none | Double sphere | None | Cameras up to 195° FOV |
Step-by-step calibration
Record a calibration bag
Move the AprilGrid target (or the camera rig) through a wide variety of positions and orientations. Cover all parts of the image, including the corners. Aim for:
- At least several hundred frames per camera where the target is fully visible
- Slow, smooth motion to avoid motion blur
- Sufficient overlap between adjacent cameras so the graph stays connected
Prepare the target YAML
Create Measure
aprilgrid.yaml to describe your printed target:aprilgrid.yaml
tagSize on your actual printout. A 1 % error in tag size produces a proportional error in the recovered baseline.Run the calibrator
Provide one The tool initializes intrinsics from homographies, builds a multi-camera observation graph, and runs a nonlinear batch optimization. Progress and intermediate parameter estimates are printed to the terminal.
--model entry per camera topic in the same order:The number of
--models entries must equal the number of --topics entries. The tool exits with an error if they do not match.Inspect the output files
Three files are written next to the input bag (using the bag filename as prefix):
Open the PDF report and check that the reprojection errors are small (typically under 0.5 px for a well-calibrated system) and evenly distributed across the image plane.
| File | Contents |
|---|---|
MYROSBAG-camchain.yaml | Camera chain calibration (intrinsics + extrinsics for each camera) |
MYROSBAG-results-cam.txt | Detailed numeric results including reprojection error statistics |
MYROSBAG-report-cam.pdf | Visual report with reprojection error plots and corner observations |
Additional options
Restricting the time range
Use--bag-from-to to process only a portion of the bag:
Controlling frame rate
--bag-freq subsamples the bag at the given rate (Hz), which speeds up processing for high-frequency camera streams:
Approximate synchronization tolerance
For camera rigs without hardware synchronization,--approx-sync sets the maximum time difference (seconds) between images from different cameras that will be treated as a synchronized frame. The default is 0.02 s:
Exporting optimized poses
--export-poses writes a CSV file with the optimized target-to-camera poses for each accepted frame, which can be used for external analysis:
Troubleshooting
”Cameras are not connected through mutual observations”
The calibration graph requires every camera to share at least some frames in which both cameras observe the target simultaneously. This error means the graph is disconnected — one or more cameras never co-observe with the rest of the chain. Fix: Ensure the target is visible in all cameras at the same time during a portion of the recording. Widen the target, bring it closer, or adjust the camera pointing directions so that fields of view overlap.Optimization diverges repeatedly
The tool automatically restarts up to three times with fresh intrinsic initialization when the optimizer diverges. If it still fails:- Check that the selected model fits the lens. An omnidirectional model applied to a narrow-FOV pinhole lens, for example, is poorly conditioned.
- Use
--show-extractionto verify that the target is being detected correctly in the images. - Use
--verboseto inspect initialization values.
Poor reprojection errors
High reprojection errors or a biased spatial distribution of residuals in the PDF report usually indicate one of:- A mismatch between the chosen camera model and the actual lens
- Inaccurate
tagSizemeasurement - Motion blur or poor target detection in a significant fraction of frames
Camera models
Detailed explanation of all supported projection and distortion models.
AprilGrid target
How to print and configure the AprilGrid calibration target.