#[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 more