Why Calibration Matters
Proper calibration provides:- Accurate camera intrinsics: Correct focal length and principal point
- Distortion correction: Removes lens distortion for accurate feature tracking
- Stereo geometry: Precise baseline and relative pose between cameras
- IMU parameters: Noise characteristics and camera-IMU transformation
- Scale estimation: Correct metric scale in visual-inertial systems
Camera Calibration
Overview
Camera calibration determines:- Intrinsic parameters:
fx,fy,cx,cy - Distortion coefficients:
k1,k2,k3,p1,p2 - Stereo parameters: Relative transformation
T_c1_c2(for stereo rigs)
Calibration Requirements
Calibration target
Use a checkerboard or AprilTag pattern:
- Checkerboard: 8×6 or larger, with known square size
- AprilTag: Standard tag families with known dimensions
Image collection
Collect 20-50 images with the calibration target:
- Cover the entire image plane
- Vary distance and orientation
- Include tilted and corner positions
Recommended Calibration Tools
- Kalibr
- OpenCV
- ROS camera_calibration
Kalibr is recommended for both camera and camera-IMU calibration.Advantages:
- Supports multi-camera systems
- Camera-IMU calibration with temporal offset
- Excellent documentation and validation tools
- Outputs ready-to-use YAML files
ORB-SLAM3 Calibration Utilities
ORB-SLAM3 includes recorder utilities for RealSense cameras:Stereo Camera Calibration
For stereo systems, you need both individual camera calibrations and the stereo transformation.Stereo Baseline
The baseline (b) is the physical distance between camera optical centers:
Stereo Transformation Matrix
TheStereo.T_c1_c2 matrix encodes rotation and translation from left to right camera:
R: 3×3 rotation matrixt = [tx, ty, tz]: Translation vector (baseline)
Stereo Rectification
For pinhole cameras, ORB-SLAM3 can rectify images online if you provide rectification matrices:IMU Calibration
For visual-inertial configurations, calibrate IMU parameters:IMU Noise Parameters
Determine noise characteristics through Allan variance analysis or from datasheet:Allan Variance Method
Collect static IMU data
Record IMU measurements with the sensor completely stationary for 2-4 hours:
Camera-IMU Transformation
TheIMU.T_b_c1 matrix transforms from camera to IMU (body) frame:
- Kalibr (recommended): Estimates transformation from synchronized data
- CAD measurements: Use mechanical design specifications
- Hand-eye calibration: Specialized calibration routines
Calibration Tutorial PDF
ORB-SLAM3 includes a comprehensive calibration tutorial:- Detailed calibration procedures
- Camera model explanations
- IMU calibration workflow
- Configuration file format
- Troubleshooting common issues
Validation and Testing
Reprojection Error
Check calibration quality by examining reprojection error:Visual Validation
Check feature tracking
Run ORB-SLAM3 and observe feature distribution in the viewer:
- Features should be evenly distributed
- No clustering or warping at edges
Common Validation Issues
Features cluster in center
Features cluster in center
Cause: Distortion coefficients incorrect or missing.Solution: Recalibrate with more corner images and verify distortion model.
Stereo depth inconsistent
Stereo depth inconsistent
Cause: Incorrect stereo transformation or poor synchronization.Solution: Verify camera synchronization and recalibrate stereo parameters.
Scale drift in VI-SLAM
Scale drift in VI-SLAM
Cause: Incorrect IMU noise parameters or camera-IMU transformation.Solution:
- Verify IMU.T_b_c1 transformation (±180° errors are common)
- Re-run Allan variance analysis
- Check IMU timestamp synchronization
Tracking fails immediately
Tracking fails immediately
Cause: Extremely wrong intrinsics (wrong resolution, swapped fx/fy).Solution: Double-check image dimensions and parameter order in YAML.
Calibration Best Practices
Camera Calibration
- Use high-resolution calibration images
- Cover entire field of view
- 20-50 images minimum
- Multiple distances and angles
- Check reprojection error < 0.5px
IMU Calibration
- Static data collection: 2-4 hours
- Stable temperature environment
- Use Allan variance analysis
- Verify against datasheet values
- Test camera-IMU synchronization
Validation
- Test with known geometry
- Verify undistortion visually
- Check scale accuracy (VI-SLAM)
- Run on example datasets first
- Compare with other SLAM systems
Troubleshooting
- Start with monocular mode
- Test camera alone before IMU
- Verify timestamp synchronization
- Check coordinate frame conventions
- Review Calibration_Tutorial.pdf
Pre-Calibrated Examples
ORB-SLAM3 includes calibration files for common datasets and cameras:Next Steps
- Configuration Guide - Create configuration files from calibration
- Run EuRoC Examples - Test with pre-calibrated datasets
- ROS Integration - Use calibration with live camera feeds