about mouse button click

조회 수: 2 (최근 30일)
UTA
UTA 2013년 5월 17일
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
UTA
UTA 2013년 5월 17일
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일
I did that in my imcensor() function.
Look at the getpts nested function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Image Processing Toolbox에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by