How to find landmarks of a rotated image?

6 visualizaciones (últimos 30 días)
Westin Messer
Westin Messer el 26 de En. de 2018
Respondida: Arun Mathamkode el 2 de Feb. de 2018
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')

Respuesta aceptada

Arun Mathamkode
Arun Mathamkode el 2 de Feb. de 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')';

Más respuestas (0)

Categorías

Más información sobre Biomedical Imaging en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by