about mouse button click

3 Ansichten (letzte 30 Tage)
UTA
UTA am 17 Mai 2013
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 Kommentar
UTA
UTA am 17 Mai 2013
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 17 Mai 2013
I did that in my imcensor() function.
Look at the getpts nested function.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by