Prompt
OCR not picking up fields from skewed scans
Latest observation
Oct 12, 2026
OpenAI APIWeb search: off
If your OCR is missing fields on skewed scans, the most common issue is that the text is no longer aligned well enough for the OCR engine to detect it reliably. Here are the main fixes, in order of impact:
1) Deskew the image first
Before OCR, run a deskew step to straighten the page. Even a small angle can hurt field detection.
- Detect page rotation/skew
- Rotate the image to make text lines horizontal
- Then run OCR
2) Crop and normalize the document
If fields are in fixed locations, skew causes them to shift outside expected bounding boxes. Try:
- Page boundary detection
- Perspective correction if the scan is warped
- Crop to the document area
- Resize to a consistent DPI/resolution
3) Improve image quality
Skewed scans are often also low quality.
- Increase contrast
- Convert to grayscale
- Denoise
- Sharpen slightly
- Binarize if the document is clean enough
4) Use layout-aware OCR or field matching
If you’re extracting specific fields from forms:
- Don’t rely only on raw text position
- Use OCR + layout analysis
- Match labels to nearby values
- Allow tolerance for rotated/shifted text boxes
5) If rotation varies, use multi-angle OCR
For heavily skewed or rotated scans:
- Run OCR on several rotated versions, e.g.
-5°, 0°, +5° - Pick the best result by confidence or field completeness
6) Train or tune for your document type
If this is a recurring form:
- Use templates
- Train a document parser
- Fine-tune OCR settings for that font/scan quality
Quick diagnostic
Ask yourself:
- Are fields missing only on angled scans?
- Is the text readable by eye but not extracted?
- Are boxes fixed-position or label-based?
- Is the issue skew, rotation, or perspective distortion?
If you want, I can help you with:
- a Python preprocessing pipeline for deskewing OCR scans, or
- a field extraction strategy for form scans.