Superimpose a plot on a picture
2 ビュー (過去 30 日間)
古いコメントを表示
Sara Macchiavello
2020 年 11 月 22 日
編集済み: Sara Macchiavello
2020 年 11 月 22 日
Hello,
I have a problem superimposing a plot on an image.
When I do the plot only, I obtain the correct one. But when I apply it on an image I obtain it upside down.
I need the correct version also superimposing it on a picture.
Can someone help me please?
I explain it with images. The first is the correct one and the second the wrong one.
This is the simple code I used:
% Only Scan path plot
plot(xCoord(:,53:73),yCoord(:,53:73), '-o')
hold on
% Start -> green
p2 = plot(xCoord(53),yCoord(53), 'go')
hold on
% Finish -> red
p3 = plot(xCoord(73),yCoord(73), 'ro')
title('Scan-path movimenti oculari')
legend([p2 p3],{'Start','Finish'})
% Image + scan path plot
Imm = imread('image_056_0067.jpg');
figure
imshow(Imm)
hold on
% Scan path plot
plot(xCoord(:,53:73),yCoord(:,53:73), '-o')
hold on
% Start -> green
p2 = plot(xCoord(53),yCoord(53), 'go')
hold on
% Finish -> red
p3 = plot(xCoord(73),yCoord(73), 'ro')
title('Scan-path movimenti oculari')
legend([p2 p3],{'Start','Finish'})
0 件のコメント
採用された回答
Image Analyst
2020 年 11 月 22 日
That's because the origin of images and matrices is at the top (line 1 is the top of the matrix) while with traditional x,y the origin is at the bottom. Try using
axis ij
or
axis xy
You should be able to get what you want by calling the proper axis call.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!