How to find landmarks of a rotated image?

2 次查看(过去 30 天)
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')

采纳的回答

Arun Mathamkode
Arun Mathamkode 2018-2-2
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 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by