How to use mouse wheel to zoom in/out while running "impixel" function simultaneously?

6 ビュー (過去 30 日間)
M.B
M.B 2021 年 8 月 6 日
回答済み: Githin George 2023 年 10 月 9 日
I am trying to select pixels in a large image. To get accurate selection, I need to zoom in and out in different locations.
I start with:
fig = figure(123);
image(mylargeimage);
zoom(fig, 'on');
then call:
[pixx, pixy, P] = impixel;
The function call desactivates the zoom. I need to click on the zoom buttons in the figure action dialogue to reactivate it then click on it again to continue my impixel selection. Sometimes, the clicks are recorded as "NaN" in impixel which causes issues. Also, when the zoom is activated, clicking on the image zooms in it and a selection is made in impixel.
Is there a way to desactiate zoom by clicking and having mouse wheel zoom always on?

回答 (1 件)

Githin George
Githin George 2023 年 10 月 9 日
Hello M.B,
I understand you are facing issues with the ‘impixel’ function as it is not enabling zoom after the function call, and also it produces ‘NaN’ pixels which clicking on the ‘zoom’ icon.
I came across the function ‘impixel_figtools’ in this file exchange link https://www.mathworks.com/matlabcentral/fileexchange/38992-impixel-with-figure-tools?s_tid=answers_rc2-2_p5_BOTH
The function provides a clear solution which avoids the inclusion of ‘NaN’ pixels and allows the ‘zoom’ functionality using mouse as well. You can click the ‘zoom’ icon in the toolbar to avail the functionality.
I hope this helps resolve the issue.

カテゴリ

Help Center および File ExchangeData Exploration についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by