It looks like you're new here. If you want to get involved, click one of these buttons!
Hello Matthias-
This question is more of a geometric question but I'm sure you will have a very short and simple code that can help a lot:
Say I want to align an image to a layout. Both the image and the layout have a set of 3 matching respective landmarks.
So the image landmarks set is: (Im1x,Im1y) (Im2x,Im2y) (Im3x,Im3y) and the layout landmark set is (La1x,La1y) (La2x,La2y) (La3x,La3y)
Can you suggest a code that will transpose the image to the layout using above landmarks coordinates?
Thanks for your time and effort! Itamar
Comments
Hi Itamar,
The method which achieves this is "Matrix3d.adjust". Here is a sample:
The output is (beautified):
which is a displacement of 100, 20 plus a scaling by 0.05 plus a small shear I have induced because I used a y value of 101 for the third image point instead of 100.
This matrix you can then put into the "matrix" property of your pya.Image object to place it according to the landmark mapping.
Matthias
Thank you so much for it Matthias