Skip to main content

ValidationParams

Struct ValidationParams 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§line_tol_rel: f32

Straight-line fit collinearity tolerance (fraction of the per-corner scale).

§line_min_members: usize

Minimum members required to fit a line / column.

§local_h_tol_rel: f32

Local-H prediction tolerance (fraction of the per-corner scale).

§use_step_aware: bool

When 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: f32

When > 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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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

Source§

fn clone(&self) -> ValidationParams

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ValidationParams

Source§

impl Debug for ValidationParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ValidationParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.