Skip to main content

calib_targets_aruco/
lib.rs

1//! ArUco/AprilTag marker dictionaries and decoding utilities.
2//!
3//! This crate focuses on:
4//! - embedded built-in dictionaries (compiled into the binary),
5//! - matching observed marker codes against those dictionaries,
6//! - decoding markers either from rectified grids or from per-cell image quads.
7//!
8//! It does **not** perform quad detection. Instead, it expects a grid model
9//! (for example from `calib-targets-chessboard`) or explicit cell corners.
10//!
11//! ## Quickstart
12//!
13//! ```
14//! use calib_targets_aruco::{builtins, scan_decode_markers, Matcher, ScanDecodeConfig};
15//! use calib_targets_core::GrayImageView;
16//!
17//! let dict = builtins::builtin_dictionary("DICT_4X4_50").expect("dict");
18//! let matcher = Matcher::new(dict, 1);
19//!
20//! let pixels = vec![0u8; 16 * 16];
21//! let view = GrayImageView {
22//!     width: 16,
23//!     height: 16,
24//!     data: &pixels,
25//! };
26//!
27//! let scan_cfg = ScanDecodeConfig::default();
28//! let markers = scan_decode_markers(&view, 4, 4, 4.0, &scan_cfg, &matcher);
29//! println!("markers: {}", markers.len());
30//! ```
31#![deny(missing_docs)]
32
33pub mod builtins;
34mod dictionary;
35mod matcher;
36mod scan;
37mod threshold;
38
39pub use dictionary::{Dictionary, DictionaryError};
40pub use matcher::{rotate_code_u64, Match, Matcher};
41pub use scan::{
42    decode_marker_in_cell, sample_cell, scan_decode_markers, scan_decode_markers_in_cells,
43    ArucoScanConfig, CellSamples, MarkerCell, MarkerDetection, ScanDecodeConfig,
44};