Skip to main content

Module extension

Module extension 

Source
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.

SubmoduleResponsibility
common (private)Shared per-cell attachment ladder
globalextend_via_global_homography + cell enumeration
localextend_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:

  1. 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.

  2. Same per-corner gates as BFS. Candidate filtering uses the policy’s is_eligible + label_of against required_label_at, accept_candidate, AND edge_ok against at least one already- labelled cardinal neighbour.

  3. Single-claim guarantee. Each attachment updates by_corner immediately, 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§

global
Global-homography boundary extension.
local
Local-homography boundary extension.

Structs§

ExtensionCommonParams
Parameters shared between ExtensionParams (global-H extension) and LocalExtensionParams (local-H extension).
ExtensionParams
Tuning knobs for extend_via_global_homography.
ExtensionStats
Diagnostic counters returned by both extension strategies.
LocalExtensionParams
Tuning knobs for extend_via_local_homography.