How to find landmarks of a rotated image?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Westin Messer
il 26 Gen 2018
Risposto: Arun Mathamkode
il 2 Feb 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')
0 Commenti
Risposta accettata
Arun Mathamkode
il 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')';
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!