#[non_exhaustive]pub struct DetectorConfig {
pub strategy: DetectionStrategy,
pub threshold: Threshold,
pub multiscale: MultiscaleConfig,
pub upscale: UpscaleConfig,
pub orientation_method: OrientationMethod,
pub merge_radius: f32,
}Expand description
High-level detection configuration.
Build one with DetectorConfig::chess,
DetectorConfig::chess_multiscale, DetectorConfig::radon, or
DetectorConfig::radon_multiscale and tweak only the fields you need.
The detector translates this into the low-level ChessParams /
RadonDetectorParams consumed by chess-corners-core at the detection
boundary.
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.strategy: DetectionStrategyDetector dispatch: ChESS or Radon, each carrying its own tuning.
threshold: ThresholdAcceptance threshold. Same enum is honoured by both detectors.
multiscale: MultiscaleConfigCoarse-to-fine multiscale configuration. SingleScale skips
the pyramid entirely. Honoured by both strategies.
upscale: UpscaleConfigPre-pipeline integer upscaling. Disabled skips the stage.
orientation_method: OrientationMethodOrientation-fit method used when building corner descriptors.
merge_radius: f32Merge radius (base-image pixels) for cross-level / cross-seed duplicate suppression. Honoured by both detectors.
Implementations§
Source§impl DetectorConfig
impl DetectorConfig
Sourcepub fn chess_multiscale() -> Self
pub fn chess_multiscale() -> Self
Three-level coarse-to-fine ChESS preset.
Sourcepub fn radon() -> Self
pub fn radon() -> Self
Whole-image Radon detector preset.
Single-scale; use Self::radon_multiscale for coarse-to-fine
Radon detection on larger frames.
Sourcepub fn radon_multiscale() -> Self
pub fn radon_multiscale() -> Self
Coarse-to-fine Radon preset. Measure against Self::radon on
your target frame sizes; this preset trades more configuration
machinery for less full-resolution detector work on large frames.
Sourcepub fn with_chess<F: FnOnce(&mut ChessConfig)>(self, f: F) -> Self
pub fn with_chess<F: FnOnce(&mut ChessConfig)>(self, f: F) -> Self
Set the active strategy to ChESS and apply f to the nested config.
If the current strategy is already ChESS, mutate it in place.
Otherwise, replace the strategy with ChessConfig::default and apply f.
Top-level fields (threshold, multiscale, upscale, orientation_method,
merge_radius) are untouched. When switching strategies, prefer the
preset constructors — Radon uses Relative(0.01) thresholds while
ChESS uses Absolute(0.0).
Sourcepub fn with_radon<F: FnOnce(&mut RadonConfig)>(self, f: F) -> Self
pub fn with_radon<F: FnOnce(&mut RadonConfig)>(self, f: F) -> Self
Mirror of Self::with_chess for the Radon strategy.
Sourcepub fn with_threshold(self, threshold: Threshold) -> Self
pub fn with_threshold(self, threshold: Threshold) -> Self
Replace the acceptance threshold.
Sourcepub fn with_multiscale(self, multiscale: MultiscaleConfig) -> Self
pub fn with_multiscale(self, multiscale: MultiscaleConfig) -> Self
Replace the multiscale configuration.
Sourcepub fn with_upscale(self, upscale: UpscaleConfig) -> Self
pub fn with_upscale(self, upscale: UpscaleConfig) -> Self
Replace the upscale configuration.
Sourcepub fn with_orientation_method(self, method: OrientationMethod) -> Self
pub fn with_orientation_method(self, method: OrientationMethod) -> Self
Replace the orientation-fit method used when building descriptors.
Sourcepub fn with_merge_radius(self, radius: f32) -> Self
pub fn with_merge_radius(self, radius: f32) -> Self
Replace the merge radius for cross-level duplicate suppression.
Sourcepub fn to_chess_params(&self) -> ChessParams
pub fn to_chess_params(&self) -> ChessParams
Translate this config into the low-level ChessParams consumed
by chess-corners-core. Only meaningful when
Self::strategy is the ChESS variant.
When the active strategy is DetectionStrategy::Radon, the
ChESS-specific fields fall back to their ChessParams::default()
values; callers should route through
Self::to_radon_detector_params instead.
Sourcepub fn to_radon_detector_params(&self) -> RadonDetectorParams
pub fn to_radon_detector_params(&self) -> RadonDetectorParams
Translate this config into the low-level RadonDetectorParams
consumed by chess-corners-core. Only meaningful when
Self::strategy is the Radon variant.
When the active strategy is DetectionStrategy::Chess, the
Radon-specific fields fall back to their
RadonDetectorParams::default() values; callers should route
through Self::to_chess_params instead.
Sourcepub fn to_coarse_to_fine_params(&self) -> Option<CoarseToFineParams>
pub fn to_coarse_to_fine_params(&self) -> Option<CoarseToFineParams>
Translate this config into the CoarseToFineParams that drive
the multiscale pipeline. Returns None when Self::multiscale
is MultiscaleConfig::SingleScale. Both ChESS and Radon honour
the same top-level multiscale settings.
Trait Implementations§
Source§impl Clone for DetectorConfig
impl Clone for DetectorConfig
Source§fn clone(&self) -> DetectorConfig
fn clone(&self) -> DetectorConfig
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 DetectorConfig
impl Debug for DetectorConfig
Source§impl Default for DetectorConfig
impl Default for DetectorConfig
Source§impl<'de> Deserialize<'de> for DetectorConfigwhere
DetectorConfig: Default,
impl<'de> Deserialize<'de> for DetectorConfigwhere
DetectorConfig: Default,
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 DetectorConfig
impl PartialEq for DetectorConfig
Source§fn eq(&self, other: &DetectorConfig) -> bool
fn eq(&self, other: &DetectorConfig) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for DetectorConfig
impl Serialize for DetectorConfig
impl Copy for DetectorConfig
impl StructuralPartialEq for DetectorConfig
Auto Trait Implementations§
impl Freeze for DetectorConfig
impl RefUnwindSafe for DetectorConfig
impl Send for DetectorConfig
impl Sync for DetectorConfig
impl Unpin for DetectorConfig
impl UnsafeUnpin for DetectorConfig
impl UnwindSafe for DetectorConfig
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().