Expand description
Image preprocessing utilities for OCR.
This module provides image preprocessing operations to improve OCR accuracy:
- Auto-resize large images
- Noise reduction
- Contrast enhancement
- Deskewing
- Border removal
Structs§
- Image
Preprocessor - Image preprocessor for OCR.
- Preprocess
Config - Preprocessing configuration.
Constants§
- DEFAULT_
MAX_ DIMENSION - Maximum image dimension (width or height) for automatic resizing.
Functions§
- adaptive_
threshold - Apply adaptive thresholding for binarization.
- denoise_
image - Apply noise reduction using median filter.
- deskew_
image - Detect and correct image skew (rotation).
- enhance_
contrast - Enhance image contrast using histogram equalization.
- remove_
borders - Remove borders from an image.
- resize_
if_ needed - Resize image if it exceeds the maximum dimension.