Qraft

Binarization

Binarization converts grayscale pixels to binary (black/white) using a threshold. Fixed thresholds work under uniform lighting; adaptive thresholds (dynamically calculated per local region) handle uneven lighting - modern smartphone QR readers use adaptive methods.

The difference that led modern smartphone readers to adaptive thresholds.

AspectFixed thresholdAdaptive threshold
How the threshold is setOne value for the whole imageCalculated dynamically for each local region
Under uniform lightingWorks wellBinarizes reliably
With shadows or uneven lightingSome modules are misreadLocal thresholds keep the result stable
The same shadowed QR code image binarized with a fixed threshold and with an adaptive thresholdImage with a shadowFixed thresholdAdaptive threshold
Where a shadow falls across the right-hand side, a fixed threshold crushes that area to black, while an adaptive threshold keeps the pattern.

Challenging conditions: low-contrast codes, backlighting, reflective surfaces, and motion blur. Error correction compensates for some misclassifications, but high-contrast printing in appropriate environments remains the best approach.