Prompt
How can I improve OCR accuracy on photographed documents?
Latest observation
Nov 10, 2026
OpenAI APIWeb search: off
Improving OCR on photographed documents is mostly about improving the image before OCR runs. Here are the biggest wins:
1) Start with better capture
- Use even lighting: avoid shadows, glare, and reflections.
- Keep the camera parallel to the page to reduce perspective distortion.
- Fill the frame with the document.
- Use higher resolution and avoid digital zoom.
- Stabilize the camera with a tripod or two-handed support.
- Avoid motion blur by using a fast shutter or good light.
2) Fix perspective and alignment
- Deskew the image if the page is tilted.
- Correct perspective so the document is rectangular, not trapezoidal.
- Crop tightly to the document and remove background clutter.
3) Improve image quality before OCR
- Increase contrast between text and background.
- Convert to grayscale if color is unnecessary.
- Binarize/threshold for clean black text on white background.
- Denoise to remove speckles and camera noise.
- Sharpen carefully if text is slightly soft.
- Upscale low-resolution images if needed, but avoid over-processing.
4) Match OCR settings to the document
- Set the correct language.
- Specify page layout if your OCR tool supports it:
- single column
- multi-column
- forms/tables
- receipts/invoices
- Enable orientation detection.
- Use character whitelist for constrained fields like IDs, dates, or amounts.
5) Handle difficult documents
- For faint text, try better lighting and contrast enhancement.
- For handwriting, use handwriting-aware OCR models.
- For tables/forms, use OCR with layout analysis or table extraction.
- For mixed fonts or low-quality scans, try multiple preprocessing variants and pick the best OCR result.
6) Post-process the OCR output
- Use spellchecking and language models to correct likely errors.
- Validate patterns like dates, totals, invoice numbers, and IDs.
- If possible, compare against a dictionary or domain-specific terms.
7) Consider a better OCR engine
Some OCR engines are much better on photographed documents than others. If accuracy is important, try:
- commercial OCR APIs
- OCR tools with strong layout analysis
- document AI services for receipts, invoices, or forms
Simple practical pipeline
- Capture photo carefully
- Detect page edges and correct perspective
- Deskew and crop
- Convert to grayscale
- Denoise and increase contrast
- Run OCR with correct language/layout settings
- Post-correct the text
If you want, I can also give you:
- a Python/OpenCV preprocessing example
- recommendations for specific OCR engines
- or a step-by-step workflow for mobile photos