[Gimp-user] Image Rotation Auto Center



If I'm understanding correctly then you can make the task much easier.

Create a script that uses a two point path. The first point of the path to be
defined is the centre of rotation (the point that gives the x,y offset by which
the image must be moved) and the gradient of the straight line joining the ends
of the path gives the rotation that must be made.

The script should delete the path before it finishes to save you doing this
before processing the next image.

Remember that GIMP works in radians not degrees.

Whilst, for this application, the script doesn't need to offer user adjustable
parameters it might be as well to have parameters for the coordinates of the
centre of rotation and the angle (set the default values to 53, 672 and 40
degrees) - at least this would act as an aide memoire and at best it would allow
someone to use different values without editing the default values.

The work flow would then be:

Firstly I would create a folder with copies of all of the images to be
modified and use a file renaming program to add _rotated to the end of each file
name. Then you will still have the original images and can use the overwrite
option - which will cut down on the number of key strokes.

  Open an image
Make sure the path tool is selected (this should stay selected from image to
image during the GIMP session)
Click where the centre of rotation is to be to define the first point of the
path
  Click to define the angle (the second point of the path)
Run the script (for the first image you will have to activate the script and
press Enter - for subsequent
     images just press Ctrl-F)
  Save the image (File/Overwrite xxxxxx)

Let me know if you have problems writing a script.

The following is more complicated than you need but does show path handling:

http://www.programmer97.talktalk.net/Files/arrow.zip

Hope this helps.

Got deflected onto another task for a few days. I will try both these
approaches this week. What I am doing is comparing the hydrodynamic
centerline of dolphin fins.

"How do you determine the angle of rotation?"
Each fin has a unique centerline, but each photo has a rotational bias
imposed by the photographers' technique, environmental conditions and
such. Once I establish the root of the fin and centerline, I paste
that as new layer over a protractor image with a center-point of
53,672 (an artifact of the protractor image nothing more). Then I use
the rotate tool to move the centerline to 40 degrees. The angular
correction measured for the line becomes the correction for the fin
photo. With the fin photo rotated it can now be compared fin-to-fin
with other images corrected in a similar way.

-- 
programmer_ceds (via www.gimpusers.com/forums)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]