#[non_exhaustive]pub enum OrientationMethod {
RingFit,
DiskFit,
}Expand description
Method used to fit the two grid axes at a detected corner.
The default Self::RingFit covers the vast majority of use cases. Use
Self::DiskFit when you need improved axis accuracy on corners with
strong projective skew (axis separation far from 90°).
All variants emit axes[0] and axes[1] under the same canonical
convention documented on crate::detect::CornerDescriptor:
axes[0].angle ∈ [0, π), axes[1].angle ∈ (axes[0].angle, axes[0].angle + π), and the CCW arc (axes[0], axes[1]) is a dark
sector of the corner. Downstream consumers can therefore compare
axes[0] slot parity between corners regardless of which method
produced them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RingFit
Fit the parametric two-axis chessboard intensity model
I(φ) = μ + A·tanh(β·sin(φ−θ₁))·tanh(β·sin(φ−θ₂)) to 16
ring samples via Gauss-Newton seeded from the 2nd-harmonic
orientation. Suspicious local minima are retried from a small
deterministic seed grid over the same 16 samples. When a
radius-10 descriptor ring is requested and still looks
suspicious, the canonical radius-5 ring is sampled as a cheap
safety check and used when it produces a valid contrast/residual
fit. Per-axis 1σ uncertainties are calibrated by a
piecewise-linear lookup table keyed on the contrast-relative
residual, bringing reported sigmas closer to the empirical RMSE.
This is the default method. Suitable for the full range of standard chessboard images.
DiskFit
Full-disk crossing-line estimator. Samples all image pixels in a
disk around the corner center and fits two possibly non-orthogonal
axes from the resulting gradient field. When local evidence is
weak or the ring fit already indicates a clean orthogonal corner,
falls back to Self::RingFit output transparently.
Use this when standard chessboards are imaged under strong
projective warp (axis separation far from 90°). Higher per-corner
cost than RingFit (~5–10× on typical hardware), but the lazy-gate
short-circuits on clean inputs so the average cost is much lower.
Output axes use the same canonical convention as Self::RingFit
— see the type-level doc comment above and
crate::detect::CornerDescriptor.
Trait Implementations§
Source§impl Clone for OrientationMethod
impl Clone for OrientationMethod
Source§fn clone(&self) -> OrientationMethod
fn clone(&self) -> OrientationMethod
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OrientationMethod
impl Debug for OrientationMethod
Source§impl Default for OrientationMethod
impl Default for OrientationMethod
Source§fn default() -> OrientationMethod
fn default() -> OrientationMethod
Source§impl<'de> Deserialize<'de> for OrientationMethod
impl<'de> Deserialize<'de> for OrientationMethod
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for OrientationMethod
impl PartialEq for OrientationMethod
Source§fn eq(&self, other: &OrientationMethod) -> bool
fn eq(&self, other: &OrientationMethod) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for OrientationMethod
impl Serialize for OrientationMethod
impl Copy for OrientationMethod
impl StructuralPartialEq for OrientationMethod
Auto Trait Implementations§
impl Freeze for OrientationMethod
impl RefUnwindSafe for OrientationMethod
impl Send for OrientationMethod
impl Sync for OrientationMethod
impl Unpin for OrientationMethod
impl UnsafeUnpin for OrientationMethod
impl UnwindSafe for OrientationMethod
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more