#[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.
§Common knobs
These fields are the primary surface for most callers:
strategy— choose ChESS or Radon and configure its parameters.threshold— control how many corners are returned: lowerRelativefraction orAbsolutefloor → more candidates; higher → fewer, stronger ones.multiscale— enable coarse-to-fine pyramid detection (Pyramid) or keep it off (SingleScale).upscale— pre-pipeline integer bilinear upscaling for low-resolution inputs where corners have fewer than 5 px of ring support.Disabledby default.orientation_method— how corner axis orientations are estimated when building descriptors.
§Advanced tuning
merge_radius— duplicate-suppression radius across pyramid levels. See the field docs below.
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: f32Advanced tuning. Merge radius in base-image pixels for
cross-level and cross-seed duplicate suppression. After seeds
detected at coarser pyramid levels are refined into the base
image, any two refined positions within this radius are merged
into a single output corner. Default is 3.0 px. Increase if
you see duplicate detections near the same physical corner;
decrease if distinct corners closer than 2·merge_radius pixels
are being merged.
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.
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,
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 moreSource§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().