calib-targets

Crates.iocalib-targets
lib.rscalib-targets
version0.2.2
created_at2025-12-28 10:11:27.732412+00
updated_at2026-01-03 17:59:55.76362+00
descriptionMain entry point crate for a collection of plain calibration target detectors built on top of ChESS corners
homepagehttps://vitalyvorobyev.github.io/calib-targets-rs/
repositoryhttps://github.com/VitalyVorobyev/calib-targets-rs
max_upload_size
id2008547
size93,842
Vitaly Vorobyev (VitalyVorobyev)

documentation

https://vitalyvorobyev.github.io/calib-targets-rs/api

README

calib-targets

Mesh-rectified grid

Fast, robust calibration target detection in Rust: chessboard, ChArUco, ArUco/AprilTag dictionaries, and marker boards.

Highlights

  • Shared TargetDetection output across detectors for consistent downstream processing.
  • End-to-end helpers (calib_targets::detect) that run ChESS corner detection for you (feature image, enabled by default).
  • Low-level detector crates are re-exported when you need custom pipelines.

Quickstart (chessboard)

cargo add calib-targets image
use calib_targets::detect;
use calib_targets::ChessboardParams;
use image::ImageReader;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let img = ImageReader::open("board.png")?.decode()?.to_luma8();
    let chess_cfg = detect::default_chess_config();
    let params = ChessboardParams::default();

    let result = detect::detect_chessboard(&img, &chess_cfg, params);
    println!("detected: {}", result.is_some());
    Ok(())
}

What you get back

All detectors produce a TargetDetection (returned directly for chessboards and embedded in higher-level result structs elsewhere). Each LabeledCorner includes pixel position, optional grid coordinates, optional logical id, optional target-space position, and a detector-specific score.

Supported targets

  • Chessboard: detect::detect_chessboard or chessboard::ChessboardDetector.
  • ChArUco: detect::detect_charuco or charuco::CharucoDetector.
  • Marker boards: detect::detect_marker_board or marker::MarkerBoardDetector.
  • ArUco/AprilTag dictionaries and decoding via aruco.

Features

  • image (default): enables calib_targets::detect helpers that use image::GrayImage and chess-corners.
  • tracing: enables tracing output across the workspace crates.

Examples (repo)

cargo run -p calib-targets --example detect_chessboard -- path/to/image.png
cargo run -p calib-targets --example detect_charuco -- path/to/image.png
cargo run -p calib-targets --example detect_markerboard -- path/to/image.png

Python bindings

Python bindings are provided via crates/calib-targets-py (module name calib_targets). See crates/calib-targets-py/README.md for setup.

pip install maturin
maturin develop
python crates/calib-targets-py/examples/detect_charuco.py path/to/image.png

Notes:

  • Python config accepts typed params classes or dict overrides (partial dicts are OK).
  • detect_charuco requires params and the board lives in params.board.
  • target_position is populated only when a board layout includes a valid cell size and alignment succeeds (for marker boards, set params.layout.cell_size or params["layout"]["cell_size"]).

Crate map

  • calib_targets::core – core types and homographies.
  • calib_targets::chessboard – chessboard detection.
  • calib_targets::aruco – ArUco/AprilTag dictionaries and decoding.
  • calib_targets::charuco – ChArUco alignment and IDs.
  • calib_targets::marker – checkerboard + circle marker boards.

Links

Commit count: 0

cargo fmt