A calibration script for a dual camera setup using OpenCV and Python for the command line. Implements stereo calibration with ChArUco boards and provides a valid dataset for testing.
- Python 100%
| samples | ||
| .gitignore | ||
| AGENTS.md | ||
| calib.io_charuco_260x200_8x11_20_15_DICT_5X5.pdf | ||
| calibrate.py | ||
| expected_calibration_values.txt | ||
| LICENSE.md | ||
| README.md | ||
Dual Camera Calibration System
This project performs camera calibration using a ChArUco board to determine intrinsic and extrinsic parameters for two cameras. This repository is intended to serve as a reference for people trying to implement a ChArUco board calibration, providing all the assets needed to verify correct implementation. The ChArUco board used in this application and the sample images are available in the repository.
Features
- ChArUco Board Calibration: Uses OpenCV's ChArUco pattern for robust camera calibration
- Intrinsic Calibration: Computes focal length, principal point, and distortion coefficients
- Extrinsic Calibration: Determines relative position and orientation between two cameras
Board Specifications
- Type: ChArUco board
- Grid Size: 8 rows × 11 columns
- Checker Size: 20mm
- Marker Size: 15mm
- ArUco Dictionary:
DICT_5X5_50 - **Legacy: true
Requirements
- Python 3.x
- OpenCV (with contrib modules for ArUco)
- NumPy
Setup
-
Install dependencies:
pip install opencv-python opencv-contrib-python numpy -
Place calibration images in the
samples/directory- Images should be named in the format
camera_0_xxxx.jpgandcamera_1_xxxx.jpg - The
xxxxsuffix should match between camera pairs
- Images should be named in the format
Usage
Simply run the calibration script:
python calibrate.py
The script will:
- Detect ChArUco corners in each image
- Perform intrinsic calibration for both cameras
- Match image pairs and perform extrinsic calibration
- Output calibration results
Notes
- At least 5 images per camera are required for calibration
- Images must contain sufficient ChArUco markers (minimum 10 per image)
- Image pairs must be captured simultaneously to enable proper extrinsic calibration
- Reference calibration values are provided in
expected_calibration_values.txtfor verification
License
This project is licensed under the MIT License.
Credits
- @calibrate.py was developed by a human and optimized with Opencode and Devstral Small 2.