10

I know of several mobile apps designed to tidy up photos of documents, snapped directly from a phone camera, but I'd like a PC program to do the same thing. I already have a bunch of photos of documents as image files on my PC, which are at higher quality than my phone could ever take!

I can do this in Photoshop fairly easily but it takes time; I would like something more automatic, something that'll assume I have a photo of one rectangular thing, and work out the correct transform for me.

Absolute best form would be a program that can take image file paths as command line arguments and pump out fixed images without interaction, or a minimal GUI app with ability to work in batches. I don't want to have to spend ages setting up each conversion.

I would prefer for the output to be image files but PDFs would be fine too.

Platform needs to be Windows.

3
  • What's the difference between perspective correction and rotation? Also, what can't done automatically in Photoshop? Nov 2, 2014 at 14:28
  • 2
    By 'perspective correction' I mean that the camera is never perfectly flat on to the document so there's a little (sometimes a lot!) of perspective warping, which isn't as simple to correct as applying rotation - it's skew, plus a bit of magic. This kind of thing: photoshopessentials.com/photo-editing/keystoning
    – Ben Hymers
    Nov 2, 2014 at 15:16
  • Thanks, I wasn't aware it was called keystone correction! Nov 2, 2014 at 15:26

4 Answers 4

5

You can use ImageMagick (Free, open source, cross-platform, CLI) to post-process all your scanned images at once:

2
  • Ah, I've used ImageMagick for some format conversion before, didn't know it could do this kind of thing. I'll investigate - thanks!
    – Ben Hymers
    Nov 2, 2014 at 15:19
  • ImageMagick is a great piece of software, but Adobe Photoshop is probably even better and can be scripted/automated as well :) Nov 2, 2014 at 15:28
3

You could use python and OpenCV to detect the document orientation and perspective, assuming that the document will normally be rectangular and have the longest edges vertical quicker on a grey scale version - this will give you the transform values to use and then you can apply the same.

There is an example, (in C), on SO: https://stackoverflow.com/questions/22656698/perspective-correction-in-opencv-using-python

0

2 options I found so far:

1- Free Option: PerspectiveImageCorrection. https://sourceforge.net/projects/perspectiveimg/ 2- Paid Option: Perspective Pilot. https://www.colorpilot.com/perspective.html

and to cover all requirements, I would use option 1 and a free software called "PhotoScap" combined.

0

I have similar need and have found Scan Tailor OSS.

It is not entirely automated. You use scantailor.exe GUI app to create a "project file" that contains configuration, then launch scantailor-cui.exe CUI that loads the file to do batch processing. (processing can be completed in GUI too)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.