Deskew
Deskew is a tool for auto-straightening or deskewing scanned text documents. Deskew detects the orientation of text lines in the image. It rotates the image so the detected lines are horizontal. It is a command line tool for Windows, Linux, and Mac.
Recent user activities on Deskew
- a2ohm added Deskew as alternative(s) to ScanTailor Advanced
Deskew produces great results. The downside is that it does not have a graphical user interface.
I use Deskew a lot, for bulk processing of pages from scanned hardcopy reports and books, as a preparation step for uploading these to archive.org. What I have found easiest to do is to have a single batch file set up that I use for everything I run through Deskew.
FIRST, write a batch file in a text editor exactly like this:
etc, etc., up to
Name the batch file "Deskew.bat"
You can use a spreadsheet to step the filename numbering up by one on each line. Make it go up to 800 or so, so that it can handle practically all books, i.e. so Deskew can batch process up to 800 pages (or whatever you like). It doesn't matter if there are less input images than lines in the batch file; in other words, even if you only run the batch file on a directory with five images in it, it will terminate itself once those images are done, ignoring the other 795 'empty' lines in the 800-line batch file. The batch file I show here is set up to convert images to greyscale (that's the switch "-f g8"). If you don't want that, set the switch as "-f rgb24" for colour, or "-f b1" for black+white, or you could just omit the -f switch altogether if input and output are always to be the same. A full list of switches can be found at bitbucket.org/galfar/app-deskew. I have also assumed you will do all your image processing as tiff, but other formats are possible.
SECOND,
Unpack the Deskew zip file you downloaded to a convenient directory (the following example for Windows I assume you will unpack it into a subdirectory of Pictures). You then need to create two folders (read this bit carefully):
In C:\Users\yourname\Pictures\Deskew\Deskew, create a folder:
ImageIn
In other words: ```
C:\Users\yourname\Pictures\Deskew\Deskew\ImageIn
Theoretically, this is ideal for straightening ("deskewing") large amounts of scanned pages, i.e. images with some straight lines of text. It does its job of automatically rotating thes images to the right degree excellently. Unfortunately, the quality of the output images is not that excellent. The resolution is diminished and blur is introduced. I tried to follow the author's suggestion to convert to png instead of jpg, but it made no difference.