pub struct Detector { /* private fields */ }Expand description
High-level chessboard-corner detector.
Owns the pyramid and detector-specific scratch buffers so the caller can reuse them across successive frames.
Implementations§
Source§impl Detector
impl Detector
Sourcepub fn new(cfg: DetectorConfig) -> Result<Self, ChessError>
pub fn new(cfg: DetectorConfig) -> Result<Self, ChessError>
Build a detector with the given config.
§Errors
Returns ChessError::Upscale when the DetectorConfig::upscale
configuration is invalid.
Sourcepub fn with_default() -> Self
pub fn with_default() -> Self
Build a detector with the default config.
Sourcepub fn config(&self) -> &DetectorConfig
pub fn config(&self) -> &DetectorConfig
Borrow the active config.
Sourcepub fn set_config(&mut self, cfg: DetectorConfig) -> Result<(), ChessError>
pub fn set_config(&mut self, cfg: DetectorConfig) -> Result<(), ChessError>
Replace the active config.
§Errors
Returns ChessError::Upscale when the new config’s upscale
section is invalid.
Sourcepub fn config_mut(&mut self) -> &mut DetectorConfig
pub fn config_mut(&mut self) -> &mut DetectorConfig
Mutable access to the active config for ad-hoc tweaks. The
caller is responsible for keeping the config valid; callers
that change DetectorConfig::upscale should use
Self::set_config instead so the upscale invariants are
re-validated.
Sourcepub fn detect_u8(
&mut self,
img: &[u8],
width: u32,
height: u32,
) -> Result<Vec<CornerDescriptor>, ChessError>
pub fn detect_u8( &mut self, img: &[u8], width: u32, height: u32, ) -> Result<Vec<CornerDescriptor>, ChessError>
Detect chessboard corners from a raw 8-bit grayscale buffer.
§Errors
Returns ChessError::DimensionMismatch if img.len() != width * height. Returns ChessError::Upscale if the upscale
configuration becomes invalid (this should not normally
happen — Detector::new / Detector::set_config validate
up-front).
Sourcepub fn detect(
&mut self,
img: &GrayImage,
) -> Result<Vec<CornerDescriptor>, ChessError>
pub fn detect( &mut self, img: &GrayImage, ) -> Result<Vec<CornerDescriptor>, ChessError>
Detect chessboard corners from an image::GrayImage.
§Errors
Returns ChessError::Upscale if the upscale configuration
becomes invalid.
Sourcepub fn diagnostics(&self) -> DetectorDiagnostics<'_>
pub fn diagnostics(&self) -> DetectorDiagnostics<'_>
Borrow a detector-bound diagnostics accessor.
The returned DetectorDiagnostics
exposes intermediate
detector outputs — the dense ChESS response map and the Radon
heatmap — sourced from this detector’s already-configured
DetectorConfig, so a caller holding a configured Detector
need not re-supply a config to obtain diagnostic data.
This is the detector-bound half of the diagnostics channel; the
free functions in crate::diagnostics serve stateless
callers. Both share the same opt-in, looser-stability
contract: diagnostic outputs are advisory and may change as the
detector internals evolve, independently of the
Detector::detect result contract.
Auto Trait Implementations§
impl Freeze for Detector
impl RefUnwindSafe for Detector
impl Send for Detector
impl Sync for Detector
impl Unpin for Detector
impl UnsafeUnpin for Detector
impl UnwindSafe for Detector
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> 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