Skip to main content

Crate projective_grid

Crate projective_grid 

Source
Expand description

Generic 2D projective grid graph construction, traversal, and homography tools.

This crate provides reusable algorithms for building 4-connected grid graphs from detected 2D corners, assigning grid coordinates via BFS traversal, and computing projective mappings (homographies) for grid rectification.

It is pattern-agnostic: the NeighborValidator trait lets callers plug in pattern-specific logic (chessboard orientation checks, marker constraints, etc.) while the graph construction, traversal, and geometry remain generic.

§Hex Grid Support

The hex module provides 6-connected hexagonal grid counterparts for pointy-top axial coordinates (q, r).

§Built-in Validators

The validators module provides ready-to-use implementations of NeighborValidator and hex::HexNeighborValidator for common scenarios.

Re-exports§

pub use direction::NeighborDirection;
pub use direction::NodeNeighbor;
pub use graph::GridGraph;
pub use graph::GridGraphParams;
pub use graph::NeighborCandidate;
pub use graph::NeighborValidator;
pub use grid_alignment::GridAlignment;
pub use grid_alignment::GridTransform;
pub use grid_alignment::GRID_TRANSFORMS_D4;
pub use grid_index::GridIndex;
pub use grid_mesh::GridHomographyMesh;
pub use grid_rectify::GridHomography;
pub use grid_smoothness::find_inconsistent_corners;
pub use grid_smoothness::predict_grid_position;
pub use homography::estimate_homography;
pub use homography::homography_from_4pt;
pub use homography::Homography;
pub use traverse::assign_grid_coordinates;
pub use traverse::connected_components;

Modules§

direction
graph
grid_alignment
grid_index
grid_mesh
Per-cell homography mesh for projective grid rectification.
grid_rectify
Single global homography from grid corners.
grid_smoothness
Grid smoothness analysis: predict corner positions from neighbors.
hex
Hexagonal grid support for pointy-top axial coordinates.
homography
traverse
validators
Ready-to-use NeighborValidator and HexNeighborValidator implementations for common grid detection scenarios.

Traits§

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