Module preprocessing

Module preprocessing 

Source
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§

ImagePreprocessor
Image preprocessor for OCR.
PreprocessConfig
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.