RSS/Atom feed Twitter
Site is read-only, email is disabled

batch rotate scanned images

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

7 of 7 messages available
Toggle history

Please log in to manage your subscriptions.

batch rotate scanned images T F 11 Aug 19:29
  batch rotate scanned images Olivier Ripoll 14 Aug 09:38
   batch rotate scanned images T F 14 Aug 17:49
    batch rotate scanned images Olivier Ripoll 15 Aug 09:28
     batch rotate scanned images T F 15 Aug 20:37
      batch rotate scanned images David Hodson 16 Aug 15:46
       batch rotate scanned images T F 16 Aug 23:11
T F
2006-08-11 19:29:16 UTC (over 17 years ago)

batch rotate scanned images

i'd like to scan several hundred of my 4x6 prints (photographs)

in my trials, the orientations of the tiff files end up being slightly off, randomly, by several degrees.

some need to be rotate by +2.3 degrees, others by +3.7, others by -1.2, etc ....

is there way to use gimp (or other linux software) to "automatically" correct the orientation? preferably by batch processing

thanks in advance

mike

Olivier Ripoll
2006-08-14 09:38:30 UTC (over 17 years ago)

batch rotate scanned images

T F wrote:

i'd like to scan several hundred of my 4x6 prints (photographs)

in my trials, the orientations of the tiff files end up being slightly off, randomly, by several degrees.

some need to be rotate by +2.3 degrees, others by +3.7, others by -1.2, etc ....

is there way to use gimp (or other linux software) to "automatically" correct the orientation? preferably by batch processing

thanks in advance

mike

Usually, for batch processing, the advice is to use imagemagick (or garphicsmagick), which should be already present on your system. http://www.imagemagick.org/script/index.php Imagemagick is a collection of small utilities (display, mogrify, convert, etc.). Since you probably do not want to overwrite the original file, what you want is "convert". See the man page here http://www.imagemagick.org/script/convert.php

The gimp solution to batch processing is David's Batch Processor: http://members.ozemail.com.au/~hodsond/dbp.html It should work also fine for you.

Best regards,

Olivier

T F
2006-08-14 17:49:50 UTC (over 17 years ago)

batch rotate scanned images

On 8/14/06, Olivier Ripoll wrote:

T F wrote:

i'd like to scan several hundred of my 4x6 prints (photographs)

in my trials, the orientations of the tiff files end up being slightly off, randomly, by several degrees.

some need to be rotate by +2.3 degrees, others by +3.7, others by -1.2, etc ....

is there way to use gimp (or other linux software) to "automatically" correct the orientation? preferably by batch processing

thanks in advance

mike

Usually, for batch processing, the advice is to use imagemagick (or garphicsmagick), which should be already present on your system. http://www.imagemagick.org/script/index.php Imagemagick is a collection of small utilities (display, mogrify, convert, etc.). Since you probably do not want to overwrite the original file, what you want is "convert". See the man page here http://www.imagemagick.org/script/convert.php

The gimp solution to batch processing is David's Batch Processor: http://members.ozemail.com.au/~hodsond/dbp.html It should work also fine for you.

Thanks. I'm an avid user of imagmagick. There is no "autorotate" feature, nor does David's.

Best, Mike

Olivier Ripoll
2006-08-15 09:28:40 UTC (over 17 years ago)

batch rotate scanned images

T F wrote:

On 8/14/06, Olivier Ripoll wrote:

T F wrote:

i'd like to scan several hundred of my 4x6 prints (photographs)

in my trials, the orientations of the tiff files end up being slightly off, randomly, by several degrees.

some need to be rotate by +2.3 degrees, others by +3.7, others by -1.2, etc ....

[...]

Thanks. I'm an avid user of imagmagick. There is no "autorotate" feature, nor does David's.

What I meant was you first group the files (e.g. in a folder) with +3.7, apply the batch to them etc.
I do not see how a software could easily find the angle. If the picture is not an image, but a graphic or a text, the Fourier transform [1] may be a tool for this. If the picture contains some white (triangular/frame) borders due to the rotation angle, there might also be a way, but in any case, automatic detection of the rotation angle would require some maths (maybe through lua and gluas[2], python, or gimp# [3]).

But these are just wild guesses.

Regards,

Olivier

[1] http://gfourier.sourceforge.net/ [2] http://pippin.gimp.org/plug-ins/gluas/index.html [3] http://gimp-sharp.sourceforge.net/

T F
2006-08-15 20:37:26 UTC (over 17 years ago)

batch rotate scanned images

T F wrote:

i'd like to scan several hundred of my 4x6 prints (photographs)

in my trials, the orientations of the tiff files end up being slightly off, randomly, by several degrees.

some need to be rotate by +2.3 degrees, others by +3.7, others by -1.2, etc ....

The angle varies from one image (scanned) to the next image. The variation is due to minor misalignments when the original is placed on the platten (by an automatic document feeder).

I was hoping to use someone else's script or plugin that calculates the angle on an image by image basis, and then does the rotation and crop.

If I need to code it myself, I would start by trying something like the following, probably with imagemagick.

1) for speed, reduce image to about 100px per edge 2) edge detect radius=0, which tends to draw a box around the image 3) quantize to 2 colors
4) save as ascii matrix of 0s and 1s 5) work with rows/columns as arrays
6) determine indicies of first 1s
7) calculate slope of least sq line
8) repeat for bottom, top, left, right sides 9) toss out anomolous slopes, avg the rest

David Hodson
2006-08-16 15:46:40 UTC (over 17 years ago)

batch rotate scanned images

T F wrote:

I was hoping to use someone else's script or plugin that calculates the angle on an image by image basis, and then does the rotation and crop.

To detect the rotation angle, try reading this paper: www.leptonica.com/papers/docskew.pdf

-- David (of the Batch Processor...)

T F
2006-08-16 23:11:11 UTC (over 17 years ago)

batch rotate scanned images

To detect the rotation angle, try reading this paper: www.leptonica.com/papers/docskew.pdf

Thanks David. I'm reading it.