#[non_exhaustive]pub struct ValidationParams {
pub line_tol_rel: f32,
pub line_min_members: usize,
pub local_h_tol_rel: f32,
pub use_step_aware: bool,
pub step_deviation_thresh_rel: f32,
pub edge_shape: Option<EdgeShapeParams>,
}Expand description
Tolerances for the validation pass.
All spatial tolerances are expressed as ratios of either the
caller-supplied global cell_size or — when use_step_aware is
set — the per-corner local step derived from labelled grid
neighbours.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.line_tol_rel: f32Straight-line fit collinearity tolerance (fraction of the per-corner scale).
line_min_members: usizeMinimum members required to fit a line / column.
local_h_tol_rel: f32Local-H prediction tolerance (fraction of the per-corner scale).
use_step_aware: boolWhen true, line and local-H thresholds use a per-corner
local step computed from labelled grid neighbours via central
or one-sided finite differences ((step_u + step_v) / 2).
Corners without enough labelled neighbours fall back to the
global cell_size.
Set this when the grid is non-uniform in pixel space — perspective foreshortening, radial distortion, or rectified- then-rasterised images. Has no effect on uniform grids.
step_deviation_thresh_rel: f32When > 0 and use_step_aware is set, an additional flag
fires for corners whose local step deviates from the labelled-
set median by more than step_deviation_thresh_rel (relative).
E.g. 0.5 flags corners whose step is < 1/(1+0.5) of the
median or > (1+0.5)× the median.
Combined with line flags via the existing attribution rules
(rule 4: step-deviation flag + ≥ 1 line flag → outlier).
Set to 0.0 to disable.
edge_shape: Option<EdgeShapeParams>Optional final-gate checks for local square-grid edge shape.
Disabled by default to preserve the conservative grow-time validator. Enable this only for final precision gates that may remove labels or refuse the whole detection.
Implementations§
Source§impl ValidationParams
impl ValidationParams
Sourcepub fn new(
line_tol_rel: f32,
line_min_members: usize,
local_h_tol_rel: f32,
) -> Self
pub fn new( line_tol_rel: f32, line_min_members: usize, local_h_tol_rel: f32, ) -> Self
Construct fully-specified core tolerances. Step-aware mode is
off by default; call with_step_aware to enable it.
Sourcepub fn with_step_aware(self, deviation_thresh_rel: f32) -> Self
pub fn with_step_aware(self, deviation_thresh_rel: f32) -> Self
Enable per-corner step-aware thresholds. Pass
deviation_thresh_rel = 0.0 for thresholds-only without the
extra step-deviation flag.
Sourcepub fn with_line_tol_rel(self, value: f32) -> Self
pub fn with_line_tol_rel(self, value: f32) -> Self
Builder-style override for Self::line_tol_rel. Set to
f32::INFINITY to disable the line-collinearity check.
Sourcepub fn with_local_h_tol_rel(self, value: f32) -> Self
pub fn with_local_h_tol_rel(self, value: f32) -> Self
Builder-style override for Self::local_h_tol_rel. Set to
f32::INFINITY to disable the local-H residual check.
Sourcepub fn with_edge_length_band_rel(self, _value: f32) -> Self
pub fn with_edge_length_band_rel(self, _value: f32) -> Self
Builder-style no-op kept for facade compatibility.
The advanced validator has no unconditional edge-length-band
gate (the historical generic validate did; the advanced
validator replaces it with the opt-in Self::with_edge_shape_gate).
This builder accepts the value so callers that disable validation
by pushing every tolerance to f32::INFINITY keep compiling and
keep their intent — there is simply no band gate to widen here.
To disable the validator entirely, set line_tol_rel and
local_h_tol_rel to f32::INFINITY and leave the edge-shape gate
off (the default).
Sourcepub fn with_edge_shape_gate(self, edge_shape: EdgeShapeParams) -> Self
pub fn with_edge_shape_gate(self, edge_shape: EdgeShapeParams) -> Self
Enable local edge-shape validation for final labelled-grid precision gates.
Trait Implementations§
Source§impl Clone for ValidationParams
impl Clone for ValidationParams
Source§fn clone(&self) -> ValidationParams
fn clone(&self) -> ValidationParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ValidationParams
Source§impl Debug for ValidationParams
impl Debug for ValidationParams
Auto Trait Implementations§
impl Freeze for ValidationParams
impl RefUnwindSafe for ValidationParams
impl Send for ValidationParams
impl Sync for ValidationParams
impl Unpin for ValidationParams
impl UnsafeUnpin for ValidationParams
impl UnwindSafe for ValidationParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.