How can I show a big image to the user, and let him zoom on it to click on specified points?

1 次查看(过去 30 天)
Hello I'm showing images (with a huge size) to the user, and he must selct pixels from it. However, selection must be precise and I would allow him to zoom on the shown images to selct the pixels with precision. However, the "zoom on" instruction doesn't work for me. This my code:
fig=figure('Name', 'select Cell pixels', ... 'Position',[1 scrsz(4) scrsz(3) scrsz(4)]); hold on; imshow(IRGB); zoom on; [X,Y]=getpts(fig); close(fig);
Can you help me?? just a note: when I show the image (with imshow()) the user can zoom. After executing the getpts ... the zoom is automatically turned off.

回答(1 个)

Image Analyst
Image Analyst 2018-8-18
See my attached zooming demo.
  3 个评论
Elena Casiraghi
Elena Casiraghi 2018-8-20
编辑:Elena Casiraghi 2018-8-20
Thanks again for your quick answer, but I already tried and it behaves exactly as getpts. Precisely, when called, ginput() sets the zoom off. Basically, what I need, is the behaviour of the DataCursor that I find in the menu bar of the figure:
Indeed, afetr zooming in and/or out, with the dataCursor I can move in the image and see the position and rgb value of pixels. However, the observed pixels are not recorded. I believe the behaviour of the DataCursor is implemented in the figure class, but I can't find its implementation. How can I modify the dataCursor behaviour do that it returns the coordinates of the pixels observed by the user? Or ... how can I add a further selection tool to the figure menu bar? Do you have any clue?

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by