Filter löschen
Filter löschen

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

8 Ansichten (letzte 30 Tage)
The coordinate of the encircled corner.
  3 Kommentare
binbin cui
binbin cui am 27 Jul. 2016
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 am 27 Jul. 2016
Bearbeitet: Adam am 27 Jul. 2016
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 27 Jul. 2016
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

Weitere Antworten (1)

Image Analyst
Image Analyst am 27 Jul. 2016
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 Kommentar
binbin cui
binbin cui am 27 Jul. 2016
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.

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by