Skip to main content

Crate calib_targets_core

Crate calib_targets_core 

Source
Expand description

Core types and utilities for calibration target detection.

This crate is intentionally small and purely geometric. It does not depend on any concrete corner detector implementation or image type, but it owns the shared detector configuration contracts used across the workspace.

§Quickstart

use calib_targets_core::{LabeledCorner, TargetDetection, TargetKind};
use nalgebra::Point2;

let corner = LabeledCorner::new(Point2::new(12.0, 8.0), 0.9);
let detection = TargetDetection::new(TargetKind::Chessboard, vec![corner]);

println!("{}", detection.corners.len());

§Includes

  • Homography estimation and warping helpers.
  • Lightweight grayscale image views and sampling.
  • Grid alignment and target detection types.

Modules§

io
Shared JSON IO helpers for config and report types.

Structs§

AxisEstimate
Local estimate of one undirected grid axis at a detected corner.
Coord
The canonical integer grid-coordinate type (u, v)u is the grid’s first axis (right), v the second (down). Re-exported from projective_grid so the whole workspace names a single type. Integer coordinate on a lattice.
DetectorConfig
High-level detection configuration.
GrayImage
Owned 8-bit grayscale image.
GrayImageView
Borrowed view over an 8-bit grayscale image.
GridTransform
An affine integer lattice-coordinate transform: destination = matrix * source + translation.
Homography
A 3×3 projective homography matrix.
HomographyQuality
Numerical quality of a homography matrix.
LabeledCorner
A corner that is part of a detected target, with optional ID info.
RectifiedView
A rectified (fronto-parallel) view of a detected board, plus the mapping back to the original image.
TargetDetection
One detected target (board instance) in an image.

Enums§

OrientationMethod
Method used to fit the two grid axes at a detected corner.
RectToImgMapper
Mapping from rectified-image coordinates back to original-image coordinates.
TargetKind
The kind of target that a detection corresponds to.

Constants§

GRID_TRANSFORMS_C4
The 4 rotations C4 on the integer grid: the orientation-preserving (determinant == +1) subgroup of GRID_TRANSFORMS_D4.
GRID_TRANSFORMS_D4
The 8 dihedral transforms D4 on the integer grid.

Functions§

axis_estimate_to_next
Promote AxisEstimate into the projective_grid crate’s generic local-axis shape.
cell_rect_corners_at
The four corners of a unit grid cell at gc, in canonical rectified space, in clockwise TL, TR, BR, BL order (the workspace-wide quad/homography order).
complete_cell_corners
The four image corners of the unit cell whose top-left intersection is grid (u, v), in TL, TR, BR, BL order (clockwise — the canonical quad order used for every homography fit in the workspace). Returns None if any of the cell’s four grid intersections is absent from the map.
corner_map_bounds
Inclusive grid-coordinate bounds (min_u, min_v, max_u, max_v) over a corner map’s keys, or None when the map is empty.
default_chess_config
Reasonable default settings for the chess-corners ChESS detector.
estimate_homography_rect_to_img
Estimate H such that p_dst ~ H * p_src from N >= 4 point correspondences.
estimate_homography_with_quality
Estimate H such that p_dst ~ H * p_src from N >= 4 point correspondences, returning the matrix together with its HomographyQuality.
homography_from_4pt
Compute H from exactly 4 point correspondences: dst ~ H * src.
homography_from_4pt_with_quality
4-point variant of estimate_homography_with_quality.
log_sigmoid
Numerically stable log(sigmoid(x)).
sample_bilinear
Bilinearly sample a grayscale image at sub-pixel (x, y).
sample_bilinear_fast
Bilinearly sample a grayscale image, skipping bounds checks on the hot path.
sample_bilinear_u8
Bilinearly sample a grayscale image and round the result to u8.
square_predict_grid_position
Predict a square-grid corner position from complete cardinal neighbor pairs.
warp_perspective_gray
Warp into a rectified image: for each destination pixel center, map to source image coordinates via H_img_from_rect and bilinear-sample.

Type Aliases§

CornerMap
A grid → image corner map: integer grid intersections to their sub-pixel image positions. The shared currency of the marker / ChArUco square-cell warp paths.
GridAlignment
Semantic alias for a transform that maps detected grid coordinates into a board/model coordinate frame.