pub struct OcrDetector { /* private fields */ }Expand description
Adapts any OcrEngine into a Detector.
All modes sort spans top-to-bottom then left-to-right, and an empty span
list becomes DetectorOutput::None — so, under Mode::Change, “text
appeared” is the None -> Text/Spans transition.
Text mode joins span texts with \n into DetectorOutput::Text.
Number mode additionally parses the joined text; parse failures and
non-finite values become DetectorOutput::None (the never-NaN invariant).
Spans mode preserves per-span geometry and confidence in
DetectorOutput::Spans (whose equality is text-only — see the variant
docs — so OCR jitter does not fire change events).
Implementations§
Trait Implementations§
Source§impl Detector for OcrDetector
impl Detector for OcrDetector
fn evaluate( &mut self, view: &FrameView<'_>, ) -> Result<DetectorOutput, DetectorError>
Auto Trait Implementations§
impl !RefUnwindSafe for OcrDetector
impl !Sync for OcrDetector
impl !UnwindSafe for OcrDetector
impl Freeze for OcrDetector
impl Send for OcrDetector
impl Unpin for OcrDetector
impl UnsafeUnpin for OcrDetector
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
Mutably borrows from an owned value. Read more