Skip to content
bhaak edited this page Nov 28, 2011 · 4 revisions

Bildrichter (German for "image straightener") is a commandline Ruby program for deskewing scans of text pages using a custom heuristic.

It calculates the skew factor of a scanned page by fitting a line using the method of linear least squares through all the leftmost points and a line through all the rightmost points of a body of text and comparing the fitted lines with a completely vertical line (which of course is only an idealised).

Here are some examples.

Compared to other deskewing options like the Hough transform, it is rather slow and memory-intensive. But for my needs it's fast enough, has easily tweakable command line options, also works with non-monochrome images and the results are pretty satisfying despite its crude heuristic.

Other deskewing programs

Unpaper is a post-processing tool for scanned sheets of paper.

Leptonica is an open source C library for efficient image processing and image analysis operations, among others deskewing.

Clone this wiki locally