Prompt

How do I fix OCR not reading skewed scanned documents?

Artificial Intelligence / Computer Vision1 observationLast seen Oct 11, 2026

Latest observation

Oct 11, 2026OpenAI APIWeb search: off

OCR usually fails on skewed scans because the text baseline isn’t horizontal. The fix is deskewing before OCR.

What to do

  1. Detect the angle of the page/text.
  2. Rotate the image to make lines horizontal.
  3. Run OCR on the corrected image.

Common deskew methods

  • Hough transform: finds dominant text-line angles.
  • Min-area bounding box: estimates the page angle from foreground pixels.
  • Projection profiles: tries angles and picks the one with the sharpest horizontal text lines.

Quick example in Python with OpenCV

import cv2
import numpy as np

img = cv2.imread("scan.jpg")
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]

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

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

cv2.imwrite("deskewed.jpg", deskewed)

Then OCR deskewed.jpg instead of the original.

Also check scan quality

  • Increase resolution to 300 DPI or higher
  • Ensure good contrast
  • Remove shadows/noise
  • Crop borders if needed
  • If pages are curved or photographed, use dewarping too, not just deskewing

If you use Tesseract

Tesseract can benefit from preprocessing, but for small skew it may handle some automatically. For stronger skew, deskew first.

If you want, I can give you:

  • a ready-to-run Python script
  • a Tesseract-specific workflow
  • or help diagnose a sample image.

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.