Expand description
Boundary extension of a labelled grid via fitted homography.
Once an inner block of (i, j) labels has been grown, this pass
attempts to extend the labelled set outward by fitting a planar
homography on the existing labels and projecting integer cells
beyond the labelled boundary.
Two strategies are available:
-
extend_via_global_homography— fits a single global H over the entire labelled set. Cheap and simple, but the residual gate refuses extrapolation under heavy radial distortion or multi-region perspective (where one global H cannot fit simultaneously). The labelled set must also be large enough for the global fit to dominate boundary noise. -
extend_via_local_homography— fits a per-candidate H from the K nearest labelled corners (by grid distance). Each cell gets a local model that adapts to the local distortion regime; the per-candidate trust gate replaces the all-or-nothing global gate. Closer to APAP / moving-DLT in spirit. More compute (one DLT per candidate cell), but materially better recall on extreme-angle inputs and frames where a single H doesn’t fit.
Callers pick a strategy based on the expected input.
| Submodule | Responsibility |
|---|---|
common (private) | Shared per-cell attachment ladder |
global | extend_via_global_homography + cell enumeration |
local | extend_via_local_homography + deep cell enumeration + K-NN |
§Precision contract
Boundary-extension attachments must obey the same invariants as BFS attachments (zero false-positive labels). Three layers of defence:
-
Reprojection-residual gate. Median and worst-case residual of
|H · (i, j) − pos(label)|are measured on the labelled set; if either exceeds the configured thresholds (×cell_size), the pass refuses to extrapolate. -
Same per-corner gates as BFS. Candidate filtering uses the policy’s
is_eligible+label_ofagainstrequired_label_at,accept_candidate, ANDedge_okagainst at least one already- labelled cardinal neighbour. -
Single-claim guarantee. Each attachment updates
by_cornerimmediately, so a corner index can only be claimed by one cell.
Re-exports§
pub use global::extend_via_global_homography;pub use local::extend_via_local_homography;
Modules§
Structs§
- Extension
Common Params - Parameters shared between
ExtensionParams(global-H extension) andLocalExtensionParams(local-H extension). - Extension
Params - Tuning knobs for
extend_via_global_homography. - Extension
Stats - Diagnostic counters returned by both extension strategies.
- Local
Extension Params - Tuning knobs for
extend_via_local_homography.