how to get the coordinate information of the left bottom corner of an image in the figure window.

8 次查看(过去 30 天)
The coordinate of the encircled corner.
  3 个评论
binbin cui
binbin cui 2016-7-27
sorry, The uploaded image disappeared itself. I mean, when u show an image by imshow(im), the image takes up some space in the figure window. there are margins between the image content and the edge of the figure window. so how do I get the coordinates of the corners of the image
Adam
Adam 2016-7-27
编辑:Adam 2016-7-27
The coordinates of the corners of the image are just the coordinates of the corners of the axes on which it is plotted so you can get these from the axes directly. I don't know what coordinate space you would want the answer in though.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2016-7-27
Unfortunately the annotation() function to draw arrows works only for figures, not axes. So you can use this: http://blogs.mathworks.com/pick/2009/05/29/arrows-of-all-kinds/?s_tid=srchtitle

更多回答(1 个)

Image Analyst
Image Analyst 2016-7-27
Whatever image you displayed (let's call it yourImage), the "coordinate information" of the left bottom of the image can be determined by the numbner of rows in the image:
[rows, columns, numberOfColorChannels] = size(yourImage);
fprintf('The bottom left coordinate of the image is at row %d, column 1.\n', rows);
fprintf('The gray level at the bottom left coordinate of the gray scale image is %d.\n', grayImage(end, 1)); % For a grayscale image
fprintf('The RGB image value at the bottom left coordinate of the color image is (%d, %d, %d).\n', rgbImage(end, 1), rgbImage(end, 2), rgbImage(end, 3)); % For a COLOR image
  1 个评论
binbin cui
binbin cui 2016-7-27
In fact, I just wanna put some arrows on the image by the annotation. however, the position(or the end) of the arrow is represented by its coordinates relative to the left bottom corner. so if I wanna put an arrow at specific position in the image based on the column and row number, I need to know the coordinates of the image corner relative to the left bottom corner of the figure window.

请先登录,再进行评论。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by