How to find landmarks of a rotated image?

1 view (last 30 days)
I have an image that I placed five landmarks on and I rotated that image 30 degrees. How do I now find those five landmarks and note their position?
I = imread('peppers.png');
RGB = insertMarker(I,[147 279]);
pos = [120 248;195 246;195 312;120 312];
color = {'red','white','green','magenta'};
RGB = insertMarker(RGB,pos,'x','color',color,'size',10);
figure (1)
imshow(RGB);
title('5 Landmarks')
J = imrotate(I,30,'bilinear','crop');
figure (2)
imshow(J)
title('Rotated Image')

Accepted Answer

Arun Mathamkode
Arun Mathamkode on 2 Feb 2018
You can create a rotation matrix T and multiply the location vector of landmark points with T to find the locations of landmark points in the rotated image.
theta = 30;
T=[cosd(theta) sind(theta) ; ...
-sind(theta) cosd(theta)];
new_pos=(T*pos')';

More Answers (0)

Categories

Find more on Biomedical Imaging in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!