syncing map image with coordinates
4 次查看(过去 30 天)
显示 更早的评论
I have an array of coordinates that I want to display on top of a map of the area. I have all the images I am discussing here attached. I displayed the coordinates with a scatter plot
scatter(x,y)
and that worked fine (image : coordinate points) I displayed the map images with
imshow(pic)
and that worked fine (image : map) I tried to display them one on top of the other
imshow()
hold on
scatter
hold off
and everything goes wrong. the coordinates are twisted and mirror imaged, and the map is twisted as well. (image : xmap) I should add that I tweaked my coordinates so that since the left bottom corner of my map is pixel (1,1) then the coordinate for that spot will be (1,1) as well. my attempt at syncing.
Any idea what went wrong? How to fix it? Or how to do a better job of it?
Thanks!
0 个评论
采纳的回答
Guillaume
2018-5-1
The convention for images is that the top left corner is the origin with the y-axis pointing down. However, you're using a different coordinate system for your x and y. You're going to have to change one of the inputs so that it uses the coordinate system of the other.
Probably the easiest is to flip the image upside-down then display it using the scatter coordinate system:
figure;
imshow(flipud(pic));
axis xy;
scatter(x, y);
2 个评论
Guillaume
2018-5-2
I'm not sure what you're asking. In any case, this is way outside my field of expertise.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!