I have two face images and need to make sure that their eyes are aligned, so I wrote a script that allows me to get the coordinates of the eyes in the two pictures.
From there I was able to derive the rotation matrix R and translation vector T which represent the rigid planar transformation to apply to one image in order to align it to the second one.
However I don't know how can I apply the rotation and translation to the images brightness intensities and save the new version of the image.
I'm aware of these functions but can't really figure out how to use them given R and T.
- http://www.mathworks.com/help/images/ref/projective2dclass.html
- http://www.mathworks.com/help/images/ref/affine2dclass.html
- http://www.mathworks.com/help/images/ref/imwarp.html
I guess it should be something like this:
tform = <--- how to build this from R and T??
B = imwarp(A,tform)