Accurate camera intrinsics are one of the largest sources of error in visual-inertial odometry. A badly calibrated camera introduces systematic reprojection errors that the back-end optimizer cannot compensate for, leading to scale drift in monocular mode or inconsistent stereo baselines in stereo mode. VINS-Fusion ships a calibration binary — built from camodocal — that accepts a folder of checkerboard images and produces a camera YAML file you can reference directly in your main config.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/HKUST-Aerial-Robotics/Vins-Fusion/llms.txt
Use this file to discover all available pages before exploring further.
Supported camera models
VINS-Fusion supports three projection models. Choose the one that best matches your lens geometry. Pinhole (PINHOLE) is the standard rectilinear projection model. It is suitable for any camera with a field of view up to roughly 120°. The model stores four distortion coefficients (k1, k2, p1, p2) and four projection parameters (fx, fy, cx, cy).
MEI (MEI) is the unified central catadioptric / omnidirectional model developed by Mei and Rives. It adds a mirror parameter xi on top of the standard radial-tangential distortion model, and uses gamma1, gamma2, u0, v0 as projection parameters. This is the model used for EuRoC — the EuRoC cameras are standard rectilinear lenses, but the MEI model fits them well because of its extra flexibility.
Equidistant (EQUIDISTANT) implements the fisheye equidistant projection. Use this for cameras with fields of view exceeding 150° (e.g., GoPro, event cameras with fisheye optics).
Preparing calibration data
Print or display a checkerboard pattern and record a ROS bag or image sequence while moving the camera slowly in front of it. Aim for:- At least 30–50 images covering the full image plane including corners.
- Varied distances and tilt angles relative to the board.
- No motion blur — move slowly and pause briefly before capturing each frame.
calibrationdata (the tool’s default expected name):
-w, -h, and -s to your specific board.
Running the calibration tool
After building thecamera_models package, the calibration binary is available as:
| Flag | Meaning |
|---|---|
-w | Number of inner corners along the board width |
-h | Number of inner corners along the board height |
-s | Physical size of one square in millimetres |
-i | Path to the directory containing calibration images |
--camera-model | Projection model: pinhole, mei, or equidistant |
camera_pinhole.yaml) in the current working directory.
Run the calibration tool from the same directory where you want the output YAML to land, then copy or rename the file to match the
cam0_calib value in your main config.Camera YAML file format
Pinhole model
The pinhole model uses standard radial-tangential (Brown-Conrady) distortion. Thefx and fy fields are the focal lengths in pixels; cx and cy are the principal point in pixels.
cam0_pinhole.yaml from the EuRoC config directory.
MEI model
The MEI model adds amirror_parameters block with a single xi coefficient that controls how much the image departs from the pinhole geometry. Projection parameters are named gamma1, gamma2 (focal lengths) and u0, v0 (principal point).
cam0_mei.yaml from the EuRoC config directory, the model used by the default EuRoC configs shipped with VINS-Fusion.
The second camera (cam1_mei.yaml) has different values because the two EuRoC cameras are physically distinct lenses:
Referencing the calibration file in the main config
After calibrating, place the output YAML in the same directory as your main VINS-Fusion config file and setcam0_calib (and cam1_calib for stereo) to the filename — not an absolute path:
image_width and image_height fields in the main config must match the image_width and image_height in the camera YAML — they control the feature tracker’s image bounds.
Verifying calibration quality
After calibration, the tool reports the reprojection RMS error in pixels. Target values depend on the model and lens:| Camera type | Acceptable RMS reprojection error |
|---|---|
| Pinhole (rectilinear lens) | < 0.5 px |
| MEI (standard lens) | < 0.8 px |
| Equidistant (fisheye) | < 1.0 px |