"nathJonathan L.S" on  wrote...
| Dear Anthony Thyssen,
| 
| My name is Jonathan and I am a young researcher at FEI (www.fei.edu.br), Sao 
| Bernardo do Campo, Sao Paulo, Brazil. I am investigating the possibility of 
| using the ImageMagick software to align 2D images (-affine option). As far 
| as I could understand, I need to provide the sx,rx,ry,sy,tx,ty to transform 
| a source image to one specific target image. Is it possible to spatially 
| normalise several images using one specific target? If so, how can I 
| calculate those parameters (sx,rx,ry,xy,tx,ty) for the -affine option 
| automatically (possibly using landmarks)?
| 
| I would appreciate very much any help on this issue.
| 
At the botom of the section where I discuss affin transformations
  http://www.cit.gu.edu.au/~anthony/graphics/imagick6/distorts/#affine_compound

I reference a script called  "affine_mapping"

This takes two sets of 3 coordinates (comma or space separated)
and figurs out the affine matrix needed to map the first three points 
to the second set of three coordinates.

See scripts..
  http://www.cit.gu.edu.au/~anthony/graphics/imagick6/scripts/
files..
  affine_mapping.pl
  affine_mapping.pl.v2

The first uses a general linear equantions solver,
The second is just the solution for the specific case involved.

If you find three landmarks on an image as your first set of coordines
then give where those landmarks should be as the second set, then it
will provide you with the affine mapping you need.

NOTE: you will need to 'flatten' the result afterward to remove ('clip')
any offset the transformation generates.

Or you can just view-port crop the transformed area you are interested
in.

WARNING:  Affine transformations are linear, only three coords are
needed.  For a four point mapping (a non-linear trapeziodal or
prespective distortion), a different technique using distortion maps
will be needed, and this has not been figured out as yet.

PS: this aspect has not been fully tested, so I can't gurantee it will
be bug free at this point.  This is the next stage of the example
development and is awaiting bug fixes in the last set of Affine examples
shown on the page.

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
         The universe is run by the complex interweaving of 3
         elements; energy, matter, and,  enlightened self interest.
                                         --  Ambassador G'Kar - Bablyon 5
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to