Hello,
my scanner supports scanning slides in landscape and portrait-mode. My idea is to do a quick preview-scan in landscape-mode, use some magic IM-command-sequence to find out if the image really is landscape or not and then scan the slide with the correct orientation.
If the image is in portrait-orientation but scanned as landscape, I will have an image where the left-quarter and the right-quarter of the image are black (the slide is 36x24mm, but the scan only captures the center of the portrait-mode slide which is 24x36mm). So the idea is to extract these two regions, do some noise-removal and compare against a pure black image. If the difference is low, than it should be a portrait-image. If it is high, it is in landscape orientation.
What is the most efficient way to do that?
Thanks, Bernhard
autodetection of portrait-images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: autodetection of portrait-images
why not just scan the whole slide and then remove the background using -fuzz and -trim
see http://www.imagemagick.org/Usage/crop/#trim
I also have two scripts that might help, autotrim and unrotate.
See http://www.fmwconcepts.com/imagemagick/index.html
see http://www.imagemagick.org/Usage/crop/#trim
I also have two scripts that might help, autotrim and unrotate.
See http://www.fmwconcepts.com/imagemagick/index.html