about mouse button click

Hi guys: I'm using ginput(1) function to select the pixels position in a few images, however, the number of clicks are different for each image, so I hope to stop selecting pixels by clicking the right key on the mouse and count how many clicks I made for each image. How can I do that? thank you very much.

1 个评论

button = 1;
n = 0;
while (button == 1)
[x,y,button] = ginput(1);
if (button == 1)
n = n + 1;
X = [X ,x];
Y = [Y ,y];
hold on
plot(x,y,'+r');
end
end

请先登录,再进行评论。

 采纳的回答

Sean de Wolski
Sean de Wolski 2013-5-17

0 个投票

I did that in my imcensor() function.
Look at the getpts nested function.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Data Exploration 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by