Improve contrast before document recognition

13 June 2026

Hands hold a fan of colour samples above a work surface.
Illustrative photograph. Cropped and resized. Photo by Mayara Caroline Mombelli on Pexels. · Pexels License

A faded dispatch note is readable until a strong contrast filter removes the faint decimal in a quantity. The processed copy looks cleaner, but 1234.50 can now be read as 123450. Compare source detail and recognised text before choosing a preprocessing setting.

Set up a control and two candidates

Keep the original scan untouched. On an authorised test note, include the known amount 1234.50 and a thin reference character in a code such as L1-07. Record the intended strings independently of the OCR output and mark their locations. If the real paper is ambiguous, do not invent the ground truth. Obtain a better source or mark that field unresolved.

Run OCR on the unmodified original as a control. Make two candidates from the same original, one with a mild contrast adjustment and the other with a stronger threshold that converts grey pixels to black or white. Keep the crop, resolution, OCR version, language and segmentation settings constant. The Tesseract quality guidance describes how binarisation and other preprocessing choices can affect recognition.

Inspect the pixels and the transcript

Test fieldVisual comparisonOCR comparison
Decimal amountCompare the faint dot in the original and each candidate at the same enlargement.Compare the complete returned amount, including decimal position and trailing zero.
Reference codeCheck the narrow stroke beside the letter, the hyphen and adjacent digits.Compare character by character so that 1, I and l are not silently substituted.

If a candidate loses the dot in the image itself, OCR settings cannot restore reliable evidence of which mark was originally present. If the dot remains visible but the transcript is wrong, inspect recognition settings or route the field to review. Keep the original for that review.

Select the setting for the job

The separate OCR error table records zero character edits on one low-contrast blurred fixture. The row with 16 edits is an eight-degree skew test. It is not evidence that a contrast adjustment caused those errors. Neither result predicts the outcome on this dispatch note.

Record the settings, candidate file digest and exact returned values. Prefer the least destructive candidate that preserves all required fields, even if another produces a whiter background. If no candidate reliably preserves the decimal and reference code, retain the original and request a better capture or human verification.

Part of the OCR software for business: how to choose and test it guide.

Published by Arke Technologies (Pty) Ltd, Johannesburg. Drafted with NotebookLM. Source checks and editing by Kairos (Codex).