calib_targets/lib.rs
1//! High-level facade crate for the `calib-targets-*` workspace.
2//!
3//! This crate provides:
4//! - stable, convenient re-exports of the underlying detector crates
5//! - (feature-gated) end-to-end helpers that run a ChESS corner detector
6//! (`chess-corners`) and then run a target detector on an image or raw buffer.
7//!
8//! ## Quickstart
9//!
10//! ```no_run
11//! use calib_targets::detect;
12//! use calib_targets::chessboard::ChessboardParams;
13//! use image::ImageReader;
14//!
15//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
16//! let img = ImageReader::open("board.png")?.decode()?.to_luma8();
17//! let chess_cfg = detect::default_chess_config();
18//! let params = ChessboardParams::default();
19//!
20//! let result = detect::detect_chessboard(&img, &chess_cfg, params);
21//! println!("detected: {}", result.is_some());
22//! # Ok(())
23//! # }
24//! ```
25//!
26//! ## Python bindings
27//!
28//! Python bindings live in `crates/calib-targets-py` and expose the
29//! `calib_targets` module. See `crates/calib-targets-py/README.md` in the
30//! repository for setup and the `detect_*` APIs. Config inputs accept typed
31//! Python classes or dict overrides; `detect_charuco` requires `params` with
32//! `params.board`. For marker boards, `target_position` is populated only when
33//! `params.layout.cell_size` (or `params["layout"]["cell_size"]`) is provided
34//! and alignment succeeds.
35//!
36//! ## API map
37//! - `calib_targets::core`: core types (corners, grids, homographies, images).
38//! - `calib_targets::chessboard`: chessboard detection from ChESS corners.
39//! - `calib_targets::aruco`: ArUco/AprilTag dictionaries and marker decoding.
40//! - `calib_targets::charuco`: ChArUco board alignment and IDs.
41//! - `calib_targets::marker`: checkerboard + circle marker boards.
42//! - `calib_targets::detect` (feature `image`): end-to-end helpers from `image::GrayImage`.
43//!
44//! ## Performance
45//!
46//! Benchmarks are coming. The goal is to be the fastest detector in this class
47//! while maintaining high sensitivity and accuracy.
48
49pub use calib_targets_aruco as aruco;
50pub use calib_targets_charuco as charuco;
51pub use calib_targets_chessboard as chessboard;
52pub use calib_targets_core as core;
53pub use calib_targets_marker as marker;
54
55pub use calib_targets_chessboard::ChessboardParams;
56pub use calib_targets_core::{Corner, GridCoords, LabeledCorner, TargetDetection, TargetKind};
57
58#[cfg(feature = "image")]
59pub mod detect;