Putting visual marker in an image

I'd like to be able to simply mark a point on an image using a crosshair or something similar. It's not a plot I'm using, I want to be able to overlay the marker on the actual image at a particular point.

2 件のコメント

Walter Roberson
Walter Roberson 2013 年 3 月 20 日
My interpretation is that the marker needs to be written into the image.
Image Analyst
Image Analyst 2013 年 3 月 20 日
Please clarify if you want the cross mark in the overlay (above the image) or if you want it actually written into the image pixels themselves.

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2013 年 3 月 20 日

3 投票

Try this:
grayImage = imread('moon.tif');
imshow(grayImage);
uiwait(msgbox('Locate the point'));
[x,y] = ginput(1);
hold on; % Prevent image from being blown away.
plot(x,y,'r+', 'MarkerSize', 50);

6 件のコメント

Youssef  Khmou
Youssef Khmou 2013 年 3 月 20 日
efficient !
khalid jackson
khalid jackson 2018 年 6 月 11 日
Is there any way to make sure the point doesn't get overlayed by filters that are added to the image?
Image Analyst
Image Analyst 2018 年 6 月 11 日
What do you mean by "filters that are added to the image"?
khalid jackson
khalid jackson 2018 年 6 月 12 日
Say, for instance, after placing the marker on 'grayimage' I did binaryimage = im2bw(grayimage);. If i do imshow(binaryimage) the image appears to be written over the marker; is there a way to always keep the marker above the image?
Image Analyst
Image Analyst 2018 年 6 月 12 日
No. If you show another image, it blows away whatever was in the axes. So you have to put "hold on" and then call plot() to place your points into the overlay above the image again.
You might look into imoverlay() - not sure if that will keep the overlay points since I haven't tried it.
khalid jackson
khalid jackson 2018 年 6 月 12 日
Okay, thank you very much.

サインインしてコメントする。

Youssef  Khmou
Youssef Khmou 2013 年 3 月 20 日
編集済み: Youssef Khmou 2013 年 3 月 20 日

0 投票

hi Con
You can use 'gtext', and put the dot in a position you want , example :
X=imread('circuit.tif');
imshow(X), gtext('*')
You can also make many text strings using the same function :
X=imread('circuit.tif');
figure,imshow(X), gtext({'My point1';'My mpoint2';'My point3'})

タグ

質問済み:

Con
2013 年 3 月 20 日

コメント済み:

2018 年 6 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by