preprocess Image
fun preprocessImage(inputFile: File, enabled: Boolean, useAdaptive: Boolean = false, logSignature: String = DEFAULT_LOG_SIGNATURE): BufferedImage
Preprocesses an image file to improve OCR accuracy. Applies: Grayscale conversion, adaptive binarization, noise reduction. All processing is in-memory; no temp files are written.
Return
The preprocessed image as a BufferedImage, or the original if preprocessing is disabled or fails.
Parameters
input File
The original image file.
enabled
Whether preprocessing is enabled.
use Adaptive
Whether to use adaptive thresholding.
log Signature
Signature prefix shown in logs to identify the caller context.
fun preprocessImage(image: BufferedImage, enabled: Boolean, useAdaptive: Boolean = false, logSignature: String = DEFAULT_LOG_SIGNATURE): BufferedImage
Preprocesses an image in-memory to improve OCR accuracy.
Return
The preprocessed image or the original if preprocessing is disabled or fails.
Parameters
image
The original image.
enabled
Whether preprocessing is enabled.
log Signature
Signature prefix shown in logs to identify the caller context.