Data cursor: Let Y coordinate increase instead of decrease (moving from bottom to top)
显示 更早的评论
Dear all,
I have a screenshot of Google maps and I want to obtain the coordinates of the stars on the image.
I used Tools > Data Cursor and what I got was this:

Now the problem is, when you go more to right in the image, the X coordinate increases. But when you go up in the images, the Y coordinate decreases (instead of increasing).
How can I change this? At the end I need a list of all the coordinates.
Thank you!
Regards,
回答(1 个)
Flip your image in the vertical dimension before plotting it, e.g.
figure; hAxes = gca; imagesc( hAxes, flip( myImage, 1 ) );
then use
set( hAxes, 'YDir', 'normal' )
where hAxes is your axes handle.
4 个评论
corneel
2017-6-16
Adam
2017-6-16
You can't change the data cursor points once they are picked. I can't remember off-hand if you can get data cursor points afterwards either, I only ever use a couple at any time.
You would have to put my command before plotting so yes you would lose all the picks.
Is it that important that they increase in that direction?
If you are able to get hold of them then you can just subtract all the y values from the maximum to flip them round.
corneel
2017-6-18
Adam
2017-6-19
The maximum should just be the number of rows in your image if you didn't plot it with any specific y values.
类别
在 帮助中心 和 File Exchange 中查找有关 Image Arithmetic 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!