ScandutDocument Scanner

What is perspective correction? (And why scans look flat)

Published September 1, 2026 · Updated September 26, 2026

Photograph a rectangular page from any real-world position and the rectangle becomes a trapezoid: nearer edges look longer, farther edges shorter. Perspective correction is the transformation that undoes this — the reason a phone photo can end up looking like it came from a flatbed scanner. This article explains the idea without equations, why finding the corners is the genuinely hard part, and what the technique cannot do.

The idea in one paragraph

If you know where the four corners of the page are in the photo, and you know the shape they should form (a flat rectangle), there is exactly one perspective transformation — a homography — that maps one onto the other. Apply it to every pixel and the trapezoid becomes a rectangle, as if the camera had been perfectly perpendicular to the page.

An intuition that helps: imagine the photo printed on a stretchy sheet, and imagine pulling its four corners onto the four corners of a rectangular frame. Everything in between stretches along smoothly. A homography is the mathematically exact version of that stretch — the one that matches how cameras actually project the world.

Why corner detection is the hard part

The math is a solved problem; finding the corners is not. A scanner has to distinguish the page edge from wood grain lines, shadow boundaries, and reflections that all look like edges. Scandut scores candidate rectangles by whether real image edges support each side, whether inside and outside differ consistently, and whether the interior actually contains print — then hands you the corners for a final drag-adjustment when the scene is genuinely ambiguous.

Why quality depends on the corners being exact

The transformation trusts the corners completely: a corner placed ten pixels inside the page pulls that whole edge inward, cropping text; ten pixels outside drags in a strip of the table. Worse, a single misplaced corner skews the geometry so straight lines lean subtly across the whole scan. This is why a magnifier appears while you drag, and why spending three seconds per corner on an important document is worth it.

Its limits

Perspective correction assumes the page is flat. A curled page or a book’s curved gutter needs additional dewarping, which is a harder problem. It also cannot create detail that is not there: text photographed at an extreme angle occupies few pixels, and straightening does not add resolution. Moderate angles correct beautifully; extreme ones are better re-shot.

A good rule: if the far edge of the page looks less than half as long as the near edge in your photo, the angle is too steep for a clean result. Re-shoot from higher above rather than fighting it in software.

Try it now: scan a document in your browser — free, no upload, no sign-up.