I am transforming my images using a protective transformation matrix. I get my transformation by doing the following, where a are 4 fixed points, and b are 4 moving points.
my_tform = fitgeotrans(a,b,'projective');
I then transform my images using imwarp
and my transformation matrix my_tform
as follows:
newImage = imwarp(Im,my_tform,'cubic','OutputView', imref2d( size(Im) ));
This works really well. The problem I have is that I want to know the new pixel location given a pixel location before the transformation. I need some fast code, since I would be doing this for each pixel in the image. Basically, given a location such as (256,256) in the original image, what is the new location in the transformed image?
Please see the following example image below. On the right is the original image, and on the left is the transformed image. The data tip is the same pixel in both images, but at different locations. I want to know how I can go between the two.