Skip to main content

Module ocr

Module ocr 

Source
Expand description

OCR backend contract surface and concrete backends.

The OcrBackend trait is intentionally narrow: finalized image bytes in, flat OCR spans out. Preprocessing, multi-page orchestration, and layout reconstruction stay above or below this module so backend plurality can arrive later without widening the trust boundary.

Re-exports§

pub use tesseract::TesseractBackend;ocr-tesseract

Modules§

tesseractocr-tesseract
Tesseract subprocess OCR adapter.

Structs§

BBox
Bounding box in image pixel coordinates.
ImageInput
Finalized image payload for one OCR pass.
LanguageTag
Backend language tag.
OcrHints
OCR backend hints. Backends may downgrade hints they cannot support.
OcrResult
Result of an OCR pass: full text + a structured confidence summary.
OcrSpan
One OCR text span emitted by a backend.

Enums§

ImageFormat
Raster image format handed to an OCR backend.
OcrError
Closed OCR backend error surface.

Traits§

OcrBackend
Narrow OCR backend contract.

Functions§

detect_image_format
Detect the encoded image format from magic bytes.