There is a new version of Deskew command line tool introduced in post Deskewing Scanned Documents. Looks like quite a few people found it useful 🙂
What's new in the latest version?
- Background color can be defined (empty space around the original page after the rotation is filled with this color)
- "Area of interest" rectangle to force skew detection only into selected part of the page (useful when  e.g. noisy page borders or images confuse skew detection when processing the entire page)
- 64 bit and Mac OSX support
- PSD and TIFF file format support (TIFF only in Win32 for now, sorry)
- Display of skew detection stats and program parameters
Download
Deskew v1.30
» 4.3 MiB - 20,753 hits - June 19, 2019
Command line tool for deskewing scanned documents. Binaries for several platforms, test images, and Object Pascal source code included.
Source Code Repository
Public Mercurial source repository of Deskew is now hosted at BitBucket:Â https://bitbucket.org/galfar/app-deskew.
What an amazingly useful tool! I have a large format scanner that does not automatically deskew the scans and this is the perfect tool to do that. Thank you!
The only problem I see is that the output filename is always lowercase instead of keeping the case passed into the output variable. Other than that, it works flawlessly.
Thank you!
Heather
I’ll fix this in a new version (currently all command line params are lowercased for easier parsing).
I’m glad you find the tool useful.
Thanks for sharing your Deskew implementation. There seem to be a few Hough transform code snippets out there but I found no complete programs except yours (unless ScanTailor uses Hough, but it’s overkill for non-books). Out of the box your Hough also seems to beat unpaper’s method on my scans; perhaps unpaper would work better if I tuned it, but it’s handy not to *have* to.
nice tool.. Is there a way to make it handle multi-page tifs?
Support for multi page images is currently not implemented but won’t be hard to add (added to todo list for new version).
Support for multipage TIFFs would be divine! As it happens I don’t know how to batch this process for multiple files.
Hi,
id like use your script – can you help me with
syntax if i need deskew all images in directory (so not ../output/1.jpg ../input/1.jpg
but ../output/narovnane_obrazky ..input/obrazky_ k_ narovnani
thanks a lot
Hi, you have to use some shell/batch script for this that would iterate over files in the directory and call deskew for each one of them.
Check these links http://goo.gl/67BUl http://goo.gl/B4CU6 or Google for some examples of shell/batch scripts.
Hi,
I ran across your program looking for a Hough transform to use in remote sensing/GIS. My first test with an urban lidar scene did a great job finding the orientation of the streets and buildings. Are you aware of anyone trying such uses of your code?
Peter Guth
Hi, very interesting application of Hough.
I’m not aware of any usage of my code other than
text skew detection.
Maybe you could get even better results with modified
CalcHoughTransform procedure in RotationDetector unit.
It is now geared towards detecting horizontal lines
and with a bit of tweaking could be working better
also for vertical lines.