Prompt

How do I extract data from poor-quality scans and skewed photos?

Technology / Data Infrastructure1 observationLast seen Oct 11, 2026

Latest observation

Oct 11, 2026OpenAI APIWeb search: off

To extract data from poor-quality scans and skewed photos, use a pipeline that fixes geometry first, then improves image quality, then runs OCR or table extraction.

Practical workflow

1) Correct the perspective and rotation

If the page is tilted, warped, or photographed at an angle:

  • Deskew: rotate the image so text lines are horizontal.
  • Perspective correction: fix trapezoid distortion from angled photos.
  • Crop: remove borders/background.

Common tools:

  • OpenCV for deskew/perspective correction
  • ScanTailor, Adobe Scan, Microsoft Lens for quick document cleanup

2) Improve image quality

For low-quality scans:

  • Convert to grayscale
  • Increase contrast
  • Reduce noise
  • Apply sharpening if needed
  • Use adaptive thresholding to make text clearer on uneven backgrounds
  • Upscale low-resolution images before OCR if text is tiny

3) Use OCR

Run OCR on the cleaned image.

Good OCR engines:

  • Tesseract: free, widely used
  • PaddleOCR: often better on difficult images
  • EasyOCR: simple to use
  • Cloud OCR: Google Vision, Azure OCR, AWS Textract

4) Post-process the text

OCR on bad images often has errors, so:

  • Spell-check or use a domain dictionary
  • Use regex to extract structured fields
  • Normalize dates, amounts, IDs, etc.
  • Compare multiple OCR passes if needed

5) If it’s a table or form

For tabular data:

  • Detect table structure first
  • Use tools like Camelot, Tabula for PDFs
  • For scanned forms/photos, use AWS Textract, Google Document AI, or PaddleOCR + table structure models

OpenCV example: deskew + OCR

import cv2
import numpy as np
import pytesseract

img = cv2.imread("scan.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

# Denoise
gray = cv2.GaussianBlur(gray, (3,3), 0)

# Threshold
thresh = cv2.adaptiveThreshold(
    gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
    cv2.THRESH_BINARY, 31, 11
)

# Find angle for deskew
coords = np.column_stack(np.where(thresh > 0))
angle = cv2.minAreaRect(coords)[-1]
if angle < -45:
    angle = -(90 + angle)
else:
    angle = -angle

(h, w) = thresh.shape[:2]
center = (w // 2, h // 2)
M = cv2.getRotationMatrix2D(center, angle, 1.0)
deskewed = cv2.warpAffine(thresh, M, (w, h), flags=cv2.INTER_CUBIC, borderMode=cv2.BORDER_REPLICATE)

text = pytesseract.image_to_string(deskewed, config="--oem 3 --psm 6")
print(text)

Tips for better results

  • Take photos in good lighting
  • Keep the camera parallel to the page
  • Use high resolution
  • Avoid shadows and reflections
  • Capture the entire document
  • If possible, scan at 300 DPI or higher

If you want the best accuracy

A strong combination is:

  1. Perspective correction
  2. Contrast enhancement
  3. OCR with PaddleOCR or a cloud OCR API
  4. Domain-specific cleanup rules

If you want, I can give you:

  • a Python script for skew correction and OCR,
  • a pipeline for tables/forms, or
  • recommendations for the best OCR tool for your type of document.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.