Skip to main content

OcrEngine

Trait OcrEngine 

Source
pub trait OcrEngine: Send + 'static {
    // Required method
    fn recognize(
        &mut self,
        view: &FrameView<'_>,
    ) -> Result<Vec<TextSpan>, DetectorError>;
}
Expand description

Pluggable OCR backend. The default ONNX/PaddleOCR implementation lives in the visual-cortex-ocr-onnx crate; any engine can slot in here. Returning an empty vec means “no text present” and is not an error.

Required Methods§

Source

fn recognize( &mut self, view: &FrameView<'_>, ) -> Result<Vec<TextSpan>, DetectorError>

Trait Implementations§

Source§

impl OcrEngine for Box<dyn OcrEngine>

Boxed engines are engines, so builder plumbing can defer construction.

Source§

fn recognize( &mut self, view: &FrameView<'_>, ) -> Result<Vec<TextSpan>, DetectorError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl OcrEngine for Box<dyn OcrEngine>

Boxed engines are engines, so builder plumbing can defer construction.

Source§

fn recognize( &mut self, view: &FrameView<'_>, ) -> Result<Vec<TextSpan>, DetectorError>

Implementors§