Skip to main content

OcrEngine

Trait OcrEngine 

Source
pub trait OcrEngine: Send + Sync {
    // Required method
    fn recognize(&self, gray: &GrayImage) -> Vec<OcrWord>;

    // Provided method
    fn recognize_psm(&self, gray: &GrayImage, _psm: &str) -> Vec<OcrWord> { ... }
}
Expand description

Raster OCR provider (SOLID: depend on this abstraction, not a CLI spawn).

Required Methods§

Source

fn recognize(&self, gray: &GrayImage) -> Vec<OcrWord>

Recognize words in a grayscale image (engine-default page segmentation).

Provided Methods§

Source

fn recognize_psm(&self, gray: &GrayImage, _psm: &str) -> Vec<OcrWord>

Optional PSM / layout hint for CLI engines; ignored by neural engines.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§