Find which layer is failing
- Image quality: blur, skew, uneven lighting, too few pixels;
- Layout: multi-column pages, tables, invoices, vertical text;
- Language and typeface: mixed scripts, handwriting, decorative fonts.
Fixing the right layer beats swapping engines — most "low accuracy" complaints are stuck at the first one.
Seven things to do right now
- At least 300 DPI: when shooting with a phone, keep character height above 20 pixels — small text loses strokes outright;
- Straighten and deskew: beyond 5° of skew, accuracy drops noticeably; rotate scans before feeding them in;
- Raise contrast, even out lighting: avoid shadows and glare; convert to grayscale and boost contrast when needed;
- Binarize clean documents: black-and-white helps printed text a lot, but be careful with photos — light detail can vanish;
- Crop to the content area: removing headers, footers, watermarks and binding shadows prevents invented characters;
- Pick the right language: mixed Chinese/English needs a multi-language setup, and traditional Chinese, Japanese or Korean need their own packs;
- Process in chunks: page by page, or cell by cell for tables, beats feeding a whole document at once.
Handwriting and complex layouts
Handwriting, decorative fonts, vertical text and formulas remain hard — plan on manual review. For tables, detect lines and recognise cell by cell to avoid row/column bleed. For receipts and invoices, locate key regions (amount, date) first and target those.
Do not forget privacy
OCR usually touches IDs, contracts and receipts. Prefer local recognition, where the model runs in your browser and images are never uploaded; if a cloud service is unavoidable, mask ID and card numbers first. To check whether an online tool is genuinely local, disconnect the network and try again.
Real-world scenarios: tuning for three image types
- Screen captures: sharp but often fine-printed — upscaling 2x usually helps, and always crop away unrelated borders.
- Phone photos of documents: deskew, boost contrast, convert to grayscale, then recognise; skew and shadows are the main error sources.
- Tables and receipts: crop by column and recognise in segments, then stitch — far easier than cleaning up a whole-page result; always verify amounts and IDs by hand.
Common questions
Why are the line breaks messy? Recognition is split by visual line — post-process by merging very short lines. Zero versus the letter O? Use the right language pack and manually verify amounts and IDs. Why do engines disagree on the same image? Different models and pre/post-processing; improving the input image pays off most.
Recommended settings per source type
| Source | Pre-processing | Expected quality |
|---|---|---|
| Scans, PDF-to-image | 300 DPI, deskew, light binarisation | Best case, near lossless |
| Phone photos of documents | Crop to edges, boost contrast, fix perspective | Good; watch shadows and glare |
| Screenshots | Native resolution, never upscale | Very high when text is crisp |
| Tables and receipts | Split first, recognise per cell or field | Needs post-processing to align rows |
| Handwriting, display type, formulas | Maximise clarity | Limited; plan on manual review |
Post-processing matters just as much
- Rejoin broken lines: visual line breaks produce many short rows — merge them by punctuation and length;
- Normalise spaces and full/half-width forms: mixed scripts often leave stray spacing;
- Spot-check critical fields: amounts, identifiers and dates are expensive to get wrong;
- Keep the original next to the result: it makes errors traceable and helps you tune pre-processing later.
Try it: OCR text recognition
Pre-processing checklist
- Convert to greyscale: removes colour noise unless colour carries meaning;
- Binarise: adaptive thresholding markedly improves low-contrast scans;
- Deskew: even a slight rotation cuts accuracy, so correct the angle first;
- Crop the margins: trim irrelevant borders so attention is not spent on empty space;
- Scale up: for very small text, upscale so characters are 30px+ before recognition — usually better than feeding it as-is.