Q:

Matlab - How to transform points with warped image

I have two images that are the same but one has been translated. My code needs to find the transform between these but I have already achieved that.
I now have an issue visualizing this, I want to transform both images such that they are at the same angle, plot both images and then plot the same set of points on both, but I cannot work out how to work out the relative coordinates of the points on the corrected second image.
My code is below:
% tform is an Affine2D Transform between img1 and img2
% img1 and img2 are rgb images
% points is a 10x2 matrix containing a set of points on img1
figure();
subplot(1, 2, 1);
hold on;
imshow(img1);
plot(points(:, 1), points(:, 2), '.r')
hold off;
transformedPoints = [Don't Know what goes here...]
img2t = iwarp(img2, invert(tform))
subplot(1, 2, 2);
hold on;
imshow(img2t);
plot(transformedPoints(:, 1), transformedPoints(:, 2), '.r')
hold off;

A:

Solved it, imwarp can return an im2dref object which you can use with worldToIntrinsic
[img2t, ref] = imwarp(img2, invert(tform));
[transformedPointsX, transformedPointsY] = worldToIntrinsic(ref, points(:, 1), points(:, 2));

