Skip to main content

calib_targets_marker/
lib.rs

1//! Checkerboard marker target detector (checkerboard + 3 circles in the middle).
2//!
3//! Pipeline overview:
4//! - Detect a chessboard grid from ChESS corners (partial boards are allowed).
5//! - Score circular markers per-cell in image space.
6//! - Match circle candidates to the known layout and estimate the grid offset.
7//! - Return typed marker-board corners with optional board alignment.
8//!
9//! ## Quickstart
10//!
11//! ```
12//! use calib_targets_chessboard::ChessCorner;
13//! use calib_targets_core::GrayImageView;
14//! use calib_targets_marker::{
15//!     CellCoords, CirclePolarity, MarkerBoardDetector, MarkerBoardSpec, MarkerBoardParams,
16//!     MarkerCircleSpec,
17//! };
18//!
19//! let layout = MarkerBoardSpec {
20//!     rows: 6,
21//!     cols: 8,
22//!     cell_size: Some(1.0),
23//!     circles: [
24//!         MarkerCircleSpec {
25//!             cell: CellCoords { i: 2, j: 2 },
26//!             polarity: CirclePolarity::White,
27//!         },
28//!         MarkerCircleSpec {
29//!             cell: CellCoords { i: 3, j: 2 },
30//!             polarity: CirclePolarity::Black,
31//!         },
32//!         MarkerCircleSpec {
33//!             cell: CellCoords { i: 2, j: 3 },
34//!             polarity: CirclePolarity::White,
35//!         },
36//!     ],
37//! };
38//!
39//! let params = MarkerBoardParams::new(layout);
40//! let detector = MarkerBoardDetector::new(params);
41//!
42//! let pixels = vec![0u8; 32 * 32];
43//! let view = GrayImageView {
44//!     width: 32,
45//!     height: 32,
46//!     data: &pixels,
47//! };
48//! let corners: Vec<ChessCorner> = Vec::new();
49//!
50//! let _ = detector.detect_from_image_and_corners(&view, &corners);
51//! ```
52#![deny(missing_docs)]
53
54mod circle_score;
55mod coords;
56mod detect;
57mod io;
58mod match_circles;
59mod types;
60
61mod detector;
62
63pub mod diagnostics;
64
65pub use circle_score::{CircleCandidate, CirclePolarity, CircleScoreParams};
66pub use coords::{CellCoords, CellOffset};
67pub use detector::MarkerBoardDetector;
68pub use diagnostics::MarkerBoardDiagnostics;
69pub use io::{MarkerBoardDetectConfig, MarkerBoardDetectReport, MarkerBoardIoError};
70pub use types::{
71    CircleMatch, CircleMatchParams, MarkerBoardCorner, MarkerBoardDetectionResult,
72    MarkerBoardParams, MarkerBoardSpec, MarkerCircleSpec,
73};