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

10 vues (au cours des 30 derniers jours)
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.

Réponses (1)

Image Analyst
Image Analyst le 18 Août 2018
See my attached zooming demo.
  3 commentaires
Image Analyst
Image Analyst le 19 Août 2018
Maybe try ginput() instead of getpts().
Elena Casiraghi
Elena Casiraghi le 20 Août 2018
Modifié(e) : Elena Casiraghi le 20 Août 2018
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?

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by