calib_targets_core/lib.rs
1//! Core types and utilities for calibration target detection.
2//!
3//! This crate is intentionally small and purely geometric. It does *not*
4//! depend on any concrete corner detector or image type.
5//!
6//! ## Quickstart
7//!
8//! ```
9//! use calib_targets_core::{Corner, TargetDetection, TargetKind};
10//! use nalgebra::Point2;
11//!
12//! let corner = Corner {
13//! position: Point2::new(10.0, 20.0),
14//! orientation: 0.0,
15//! orientation_cluster: None,
16//! strength: 1.0,
17//! };
18//!
19//! let detection = TargetDetection {
20//! kind: TargetKind::Chessboard,
21//! corners: Vec::new(),
22//! };
23//!
24//! println!("{:?} {}", corner.position, detection.corners.len());
25//! ```
26//!
27//! ## Includes
28//!
29//! - Homography estimation and warping helpers.
30//! - Lightweight grayscale image views and sampling.
31//! - Grid alignment and target detection types.
32
33mod corner;
34mod grid_alignment;
35mod homography;
36mod image;
37mod logger;
38mod orientation_clustering;
39mod rectify;
40
41pub use homography::{
42 estimate_homography_rect_to_img, homography_from_4pt, warp_perspective_gray, Homography,
43};
44pub use image::{
45 sample_bilinear, sample_bilinear_fast, sample_bilinear_u8, GrayImage, GrayImageView,
46};
47pub use rectify::{RectToImgMapper, RectifiedView};
48
49pub use corner::{Corner, GridCoords, LabeledCorner, TargetDetection, TargetKind};
50pub use grid_alignment::{GridAlignment, GridTransform, GRID_TRANSFORMS_D4};
51
52#[cfg(feature = "tracing")]
53pub use logger::init_tracing;
54
55pub use logger::init_with_level;
56pub use orientation_clustering::{
57 cluster_orientations, compute_orientation_histogram, estimate_grid_axes_from_orientations,
58 OrientationClusteringParams, OrientationClusteringResult, OrientationHistogram,
59};