projective_grid/lib.rs
1//! Generic 2D projective grid graph construction, traversal, and homography tools.
2//!
3//! This crate provides reusable algorithms for building 4-connected grid graphs
4//! from detected 2D corners, assigning grid coordinates via BFS traversal,
5//! and computing projective mappings (homographies) for grid rectification.
6//!
7//! It is pattern-agnostic: the [`NeighborValidator`] trait lets callers plug in
8//! pattern-specific logic (chessboard orientation checks, marker constraints, etc.)
9//! while the graph construction, traversal, and geometry remain generic.
10//!
11//! # Hex Grid Support
12//!
13//! The [`hex`] module provides 6-connected hexagonal grid counterparts for
14//! pointy-top axial coordinates `(q, r)`.
15
16pub mod direction;
17pub mod graph;
18pub mod grid_alignment;
19pub mod grid_index;
20pub mod grid_mesh;
21pub mod grid_rectify;
22pub mod grid_smoothness;
23pub mod hex;
24pub mod homography;
25pub mod traverse;
26
27pub use direction::{NeighborDirection, NodeNeighbor};
28pub use graph::{GridGraph, GridGraphParams, NeighborCandidate, NeighborValidator};
29pub use grid_alignment::{GridAlignment, GridTransform, GRID_TRANSFORMS_D4};
30pub use grid_index::GridIndex;
31pub use grid_mesh::GridHomographyMesh;
32pub use grid_rectify::GridHomography;
33pub use grid_smoothness::{find_inconsistent_corners, predict_grid_position};
34pub use homography::{estimate_homography, homography_from_4pt, Homography};
35pub use traverse::{assign_grid_coordinates, connected_components};