Skip to main content

Crate projective_grid

Crate projective_grid 

Source
Expand description

Generic 2D projective grid construction and homography tools.

This crate provides reusable algorithms for turning a cloud of 2D points into a labelled grid: seed-and-grow BFS, boundary extension via fitted homography, and per-cell / global rectification.

Pattern-agnostic at the bottom (KD-tree, circular stats, mean-shift, DLT homography); pattern-specific at the top via the square::grow::GrowValidator trait — chessboard parity, ChArUco marker rules, etc. plug in there.

§Module layout

ModuleResponsibility
square::growSeed-and-grow BFS over a square lattice
square::extensionBoundary extension via globally-fit or local homography
square::seed2×2 seed primitives (cell size, midpoint violation)
square::validatePost-grow line / local-H residual checks
square::mesh / square::rectifyPer-cell mesh / global homography rectification
square::smoothnessMidpoint prediction + step-aware outlier detection
square::alignmentD4 transforms on integer grid coordinates
hexHex grid: index, mesh, rectify, smoothness, alignment (no grow path yet)
circular_statsUndirected-angle helpers (smoothing, plateau peak picking, double-angle 2-means)
global_step / local_stepCell-size estimation primitives
homography4-point + DLT homography with reprojection-quality diagnostics

Re-exports§

pub use affine::AffineTransform2D;
pub use global_step::estimate_global_cell_size;
pub use global_step::GlobalStepEstimate;
pub use global_step::GlobalStepParams;
pub use homography::estimate_homography;
pub use homography::estimate_homography_with_quality;
pub use homography::homography_from_4pt;
pub use homography::homography_from_4pt_with_quality;
pub use homography::Homography;
pub use homography::HomographyQuality;
pub use local_step::estimate_local_steps;
pub use local_step::LocalStep;
pub use local_step::LocalStepParams;
pub use local_step::LocalStepPointData;
pub use square::alignment::GridAlignment;
pub use square::alignment::GridTransform;
pub use square::alignment::GRID_TRANSFORMS_D4;
pub use square::index::GridCoords;
pub use square::mesh::SquareGridHomographyMesh;
pub use square::rectify::SquareGridHomography;
pub use square::smoothness::square_find_inconsistent_corners;
pub use square::smoothness::square_find_inconsistent_corners_step_aware;
pub use square::smoothness::square_predict_grid_position;
pub use topological::build_grid_topological;
pub use topological::AxisHint;
pub use topological::TopologicalComponent;
pub use topological::TopologicalError;
pub use topological::TopologicalGrid;
pub use topological::TopologicalParams;
pub use topological::TopologicalStats;
pub use component_merge::merge_components_local;
pub use component_merge::ComponentInput;
pub use component_merge::ComponentMergeResult;
pub use component_merge::ComponentMergeStats;
pub use component_merge::LocalMergeParams;

Modules§

affine
Generic 2D affine transform.
circular_stats
Circular-histogram + plateau-aware peak picking + double-angle 2-means helpers.
component_merge
Local-geometry-only component merge for square grids.
global_step
Automatic global cell-size estimation for a 2D corner cloud.
hex
Hexagonal grid support for pointy-top axial coordinates.
homography
local_step
Generic per-corner local grid-step estimation.
square
Square (4-connected) grid support.
topological
Topological grid construction (Shu/Brunton/Fiala 2009, axis-driven variant).

Traits§

Float
Trait alias for floating-point types supported by this crate.