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.
| Aspect | Fixed threshold | Adaptive threshold |
|---|---|---|
| How the threshold is set | One value for the whole image | Calculated dynamically for each local region |
| Under uniform lighting | Works well | Binarizes reliably |
| With shadows or uneven lighting | Some modules are misread | Local thresholds keep the result stable |
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.