tesseract image.png output -c tessedit_char_whitelist=0123456789

Category: AI/ML Tooling

tesseract image.png output -c tessedit_char_whitelist=0123456789

Restrict OCR to specific characters

Limits recognition to the whitelisted characters, here digits only, which eliminates letters in numeric-only images like barcodes or account numbers. The -c flag sets a tesseract config variable directly on the command line. Add letters by extending the list.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.