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.
Find a file
2026-06-04 17:27:24 -03:00
samples initial commit 2026-06-04 12:46:13 -03:00
.gitignore included a charuco board 2026-06-04 12:58:39 -03:00
AGENTS.md initial commit 2026-06-04 12:46:13 -03:00
calib.io_charuco_260x200_8x11_20_15_DICT_5X5.pdf included a charuco board 2026-06-04 12:58:39 -03:00
calibrate.py optmized with AI 2026-06-04 13:31:01 -03:00
expected_calibration_values.txt corrected expected values file 2026-06-04 17:27:24 -03:00
LICENSE.md included a charuco board 2026-06-04 12:58:39 -03:00
README.md optmized with AI 2026-06-04 13:31:01 -03:00

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

  1. Install dependencies:

    pip install opencv-python opencv-contrib-python numpy
    
  2. Place calibration images in the samples/ directory

    • Images should be named in the format camera_0_xxxx.jpg and camera_1_xxxx.jpg
    • The xxxx suffix should match between camera pairs

Usage

Simply run the calibration script:

python calibrate.py

The script will:

  1. Detect ChArUco corners in each image
  2. Perform intrinsic calibration for both cameras
  3. Match image pairs and perform extrinsic calibration
  4. 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.txt for 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.