Skip to main content

OcrBackend

Trait OcrBackend 

Source
pub trait OcrBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn recognize(
        &self,
        image: ImageInput,
        hints: OcrHints,
    ) -> Result<Vec<OcrSpan>, OcrError>;
}
Expand description

Narrow OCR backend contract.

Required Methods§

Source

fn name(&self) -> &str

Stable backend name used in diagnostics.

Source

fn recognize( &self, image: ImageInput, hints: OcrHints, ) -> Result<Vec<OcrSpan>, OcrError>

Recognize flat spans from one finalized image.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl OcrBackend for TesseractBackend

Available on crate feature ocr-tesseract only.