#[non_exhaustive]pub struct DetectorConfig {
pub strategy: DetectionStrategy,
pub threshold: f32,
pub detection: DetectionParams,
pub multiscale: MultiscaleConfig,
pub upscale: UpscaleConfig,
pub orientation_method: Option<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: lower → more candidates, higher → fewer and stronger. ChESS reads it as an absolute response floor; Radon as a fraction of the per-frame maximum.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
detection— shared NMS / clustering thresholds applied by both strategies. SeeDetectionParams.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: f32Detector acceptance threshold.
ChESS reads it as an absolute floor on the raw response
R = SR − DR − 16·MR: a candidate is kept when R exceeds it.
Useful floors run roughly 30..=300 depending on image contrast;
the chess preset defaults to 30, which suppresses
texture noise while keeping well-formed corners.
Radon reads it as a fraction in [0.0, 1.0] of the per-frame
maximum response, because Radon’s (max − min)² score scales
with image size and has no portable absolute scale.
detection: DetectionParamsShared non-maximum-suppression and peak-clustering thresholds.
Honoured by both strategies. See DetectionParams.
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: Option<OrientationMethod>Orientation-fit method used when building corner descriptors, or
None to skip the per-corner fit entirely. When None, every
descriptor carries axes: None; positions and responses are
unaffected. Skipping orientation is the cheaper path for consumers
that derive board geometry themselves.
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 — ChESS reads threshold as an absolute response
floor, Radon as a fraction of the per-frame maximum.
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: f32) -> Self
pub fn with_threshold(self, threshold: f32) -> Self
Replace the acceptance threshold. See DetectorConfig::threshold
for the per-detector interpretation.
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 without_orientation(self) -> Self
pub fn without_orientation(self) -> Self
Skip the per-corner orientation fit. Descriptors are still produced
with subpixel positions and responses, but carry axes: None. Use
this when you derive board geometry yourself and don’t need the
per-corner axes — it removes the dominant per-corner cost.
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 with_detection<F: FnOnce(&mut DetectionParams)>(self, f: F) -> Self
pub fn with_detection<F: FnOnce(&mut DetectionParams)>(self, f: F) -> Self
Apply f to the shared DetectionParams (NMS / clustering
thresholds honoured by both strategies) and return the updated
config.
Sourcepub fn chess_params(&self) -> ChessParams
pub fn chess_params(&self) -> ChessParams
Lower this config into the ChessParams consumed by the
chess-corners-core response and detection stages. Use this when
driving the core stage functions directly instead of through
Detector. 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::radon_detector_params instead.
Sourcepub fn radon_detector_params(&self) -> RadonDetectorParams
pub fn radon_detector_params(&self) -> RadonDetectorParams
Lower this config into the RadonDetectorParams consumed by the
chess-corners-core Radon response and detection stages. Use this
when driving the core stage functions directly instead of through
Detector. 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::chess_params instead.
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 moreimpl Copy for DetectorConfig
Source§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 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§
impl<T> Any for Twhere
T: Any,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
impl<T> CloneAny for T
impl<T> CloneAnySend for T
impl<T> CloneAnySendSync for T
impl<T> CloneAnySync for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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().