#[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() -> DetectorConfig
pub fn chess() -> DetectorConfig
Single-scale ChESS preset.
Sourcepub fn chess_multiscale() -> DetectorConfig
pub fn chess_multiscale() -> DetectorConfig
Three-level coarse-to-fine ChESS preset.
Sourcepub fn radon() -> DetectorConfig
pub fn radon() -> DetectorConfig
Whole-image Radon detector preset.
Single-scale; use Self::radon_multiscale for coarse-to-fine
Radon detection on larger frames.
Sourcepub fn radon_multiscale() -> DetectorConfig
pub fn radon_multiscale() -> DetectorConfig
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>(self, f: F) -> DetectorConfigwhere
F: FnOnce(&mut ChessConfig),
pub fn with_chess<F>(self, f: F) -> DetectorConfigwhere
F: FnOnce(&mut ChessConfig),
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>(self, f: F) -> DetectorConfigwhere
F: FnOnce(&mut RadonConfig),
pub fn with_radon<F>(self, f: F) -> DetectorConfigwhere
F: FnOnce(&mut RadonConfig),
Mirror of Self::with_chess for the Radon strategy.
Sourcepub fn with_threshold(self, threshold: f32) -> DetectorConfig
pub fn with_threshold(self, threshold: f32) -> DetectorConfig
Replace the acceptance threshold. See DetectorConfig::threshold
for the per-detector interpretation.
Sourcepub fn with_multiscale(self, multiscale: MultiscaleConfig) -> DetectorConfig
pub fn with_multiscale(self, multiscale: MultiscaleConfig) -> DetectorConfig
Replace the multiscale configuration.
Sourcepub fn with_upscale(self, upscale: UpscaleConfig) -> DetectorConfig
pub fn with_upscale(self, upscale: UpscaleConfig) -> DetectorConfig
Replace the upscale configuration.
Sourcepub fn with_orientation_method(
self,
method: OrientationMethod,
) -> DetectorConfig
pub fn with_orientation_method( self, method: OrientationMethod, ) -> DetectorConfig
Replace the orientation-fit method used when building descriptors.
Sourcepub fn without_orientation(self) -> DetectorConfig
pub fn without_orientation(self) -> DetectorConfig
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) -> DetectorConfig
pub fn with_merge_radius(self, radius: f32) -> DetectorConfig
Replace the merge radius for cross-level duplicate suppression.
Sourcepub fn with_detection<F>(self, f: F) -> DetectorConfigwhere
F: FnOnce(&mut DetectionParams),
pub fn with_detection<F>(self, f: F) -> DetectorConfigwhere
F: FnOnce(&mut DetectionParams),
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§fn default() -> DetectorConfig
fn default() -> 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<DetectorConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DetectorConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DetectorConfig
impl PartialEq for DetectorConfig
Source§impl Serialize for DetectorConfig
impl Serialize for DetectorConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
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>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
impl<T> Scalar for T
Source§impl<T> StrictAs for T
impl<T> StrictAs for T
Source§fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
fn strict_as<Dst>(self) -> Dstwhere
T: StrictCast<Dst>,
Source§impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
impl<Src, Dst> StrictCastFrom<Src> for Dstwhere
Src: StrictCast<Dst>,
Source§fn strict_cast_from(src: Src) -> Dst
fn strict_cast_from(src: Src) -> Dst
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.