figure, imshow, saveas and getpts
10 views (last 30 days)
I save an image using saveas. Then I open it and display it using imshow in figure 1. When I use getpts to get pixel coordinates, the coordinates I get are that of figure 1 not that of the image. I.e, If I click on the axis of the image, I don't get (0,0), I get the coordinates of the image origin in figure 1. How do I get the image coordinates?
Image Analyst on 13 Oct 2016
Save images with imwrite(). Recall them with imread(). Display them with imshow(). Get pixel values with impixelinfo:
hp = impixelinfo();
This will let you mouse around and display the (x,y) and gray level in a status label on your figure. If you need the user to click on a point, then use ginput():
[x, y] = ginput();