applyPreprocessing

fun applyPreprocessing(image: BufferedImage, useAdaptive: Boolean = false, logSignature: String = DEFAULT_LOG_SIGNATURE): ImagePreprocessor.PreprocessResult?

Core image preprocessing: grayscale conversion, binarization, and median denoising.

Return

The preprocessing result, or null if preprocessing fails.

Parameters

image

The source image.

useAdaptive

When true, uses adaptive (local mean) thresholding instead of global Otsu. Adaptive thresholding handles uneven lighting and shadows better, making it suitable for difficult camera captures.

logSignature

Signature prefix shown in logs to identify the caller context.