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 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 !RefUnwindSafe for Detector
impl !UnwindSafe for Detector
impl Freeze for Detector
impl Send for Detector
impl Sync for Detector
impl Unpin for Detector
impl UnsafeUnpin for Detector
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> 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