Supported Camera Models
ORB-SLAM3 natively supports two camera models (from CameraModels/ directory):Built-in Camera Models
Built-in Camera Models
1. Pinhole Camera Model
Implementation:include/CameraModels/Pinhole.hProjection Model:k1, k2: Radial distortion coefficientsp1, p2: Tangential distortion coefficients- Optional:
k3for severe distortion
- Standard cameras
- Narrow to medium FOV (< 110°)
- Most webcams and industrial cameras
2. Kannala-Brandt Fisheye Model
Implementation:include/CameraModels/KannalaBrandt8.hProjection Model:- Wide-angle cameras (> 110° FOV)
- Fisheye lenses (up to 180° FOV)
- TUM-VI dataset cameras
Camera Calibration
Using Calibration_Tutorial.pdf
From README.md:234-235:
You can find a tutorial for visual-inertial calibration and a detailed description of the contents of valid configuration files at Calibration_Tutorial.pdf
The
Calibration_Tutorial.pdf file is located in the repository root and provides comprehensive calibration instructions.Calibration Methods
1. OpenCV Camera Calibration
1. OpenCV Camera Calibration
For pinhole cameras, use OpenCV’s calibration tools:
2. Kalibr for Visual-Inertial Calibration
2. Kalibr for Visual-Inertial Calibration
3. Fisheye Camera Calibration
3. Fisheye Camera Calibration
For wide-angle/fisheye cameras:For Kannala-Brandt model, use Kalibr with
pinhole-equi model.YAML Configuration for Custom Cameras
Pinhole Camera Configuration
Example fromExamples/Stereo-Inertial/EuRoC.yaml:
Pinhole Parameters Explanation
Pinhole Parameters Explanation
Intrinsic Parameters:
fx, fy: Focal lengths in pixelscx, cy: Principal point (optical center)width, height: Image resolution
k1, k2: Radial distortionp1, p2: Tangential distortion- Optional
k3: Third radial distortion term
fps: Frame rate (for time-based processing)RGB: Color order (0=BGR, 1=RGB)
Fisheye Camera Configuration
Example structure for Kannala-Brandt model:Kannala-Brandt uses 4 distortion parameters (k1-k4) instead of the radial-tangential model.
Stereo Camera Configuration
For stereo setups, add the stereo baseline transformation:Stereo Parameters Explanation
Stereo Parameters Explanation
Stereo.ThDepth:
- Close/far threshold (baseline times)
- Typical values: 35-60 for standard baselines
- Affects depth range and map point filtering
- 4×4 transformation matrix from left to right camera
- First 3×3: Rotation matrix
- Last column (first 3 rows): Translation vector (meters)
- Must be accurately calibrated for metric scale
IMU Configuration for Visual-Inertial
FromExamples/Stereo-Inertial/EuRoC.yaml:
Adding New Camera Models
Step 1: Implement Camera Model Class
Create a new camera model inheriting fromGeometricCamera:
Step 2: Implement Camera Methods
Step 3: Register Camera Model
Add your camera model to the Settings class:Step 4: Update CMakeLists.txt
Add your camera model to the build:Step 5: Create YAML Configuration
Testing and Validation
1. Test Projection/Unprojection
Unit Test Example
Unit Test Example
2. Validate with Checkerboard
Test your calibration by reprojecting checkerboard corners:3. Test with ORB-SLAM3
Run on a test sequence:Common Issues and Solutions
Tracking Fails Immediately
Tracking Fails Immediately
Symptoms: No features detected or tracking lost on first frameSolutions:
- Verify camera intrinsics are in pixels, not normalized
- Check image resolution matches YAML configuration
- Test feature detection independently:
- Ensure distortion coefficients are correct sign
Scale Drift in Stereo
Scale Drift in Stereo
Symptoms: Map scale changes over timeCauses:
- Incorrect stereo baseline
- Poor stereo calibration
- Wrong T_c1_c2 transformation
- Recalibrate stereo cameras using checkerboard
- Verify baseline measurement (physical distance)
- Check stereo rectification quality
- Validate with known-size objects in the scene
IMU Integration Fails
IMU Integration Fails
Symptoms: Tracking worse with IMU than withoutCauses:
- Wrong IMU.T_b_c1 transformation
- Incorrect IMU noise parameters
- Time synchronization issues
- Use Kalibr for camera-IMU calibration
- Verify IMU orientation relative to camera
- Check timestamp synchronization (should be < 1ms offset)
- Validate IMU noise from static recording:
Reference Documentation
- Calibration_Tutorial.pdf: Comprehensive calibration guide (repository root)
- GeometricCamera.h: Base camera class interface
- Pinhole.h / KannalaBrandt8.h: Reference implementations
- OpenCV Calibration Tutorial
- Kalibr Documentation
Best Practices
- Use high-quality calibration images (20-30 different poses)
- Cover entire image area during calibration
- Validate reprojection error (< 0.5 pixels)
- Test with rectified images first before implementing custom models
- Implement unit tests for projection/unprojection consistency
- Document parameter units clearly in YAML files
- Version control calibration files with datasets