Using impixelinfo with appDesigner
Ältere Kommentare anzeigen
I am running into the following error with appDesigner, when trying to retrieve the pixel info an an image component :

This is the app interface :

All I want to achieve, at this stage, is to get some information about the pixels at the mouse position.
I thought of using impixelinfo but it needs some argument? I tried :
impixelinfo(app.myImage);
But that's when I get the above error message. I read somewhere that impixelinfo does not work with appDesigner?
Eventually, I would like to capture the mouseover and mouseclick events so that I can display not only the image RGB values but also, and more importantly, the CIE Lab values. Ultimately, I would like to turn mouseclicks into a selected 3D points in the scatter3 plot on th right... Tall order for a Matlab and appDesigner newbie like me -- I know.
Any help is appreciated.
1 Kommentar
Roger Breton
am 29 Dez. 2021
Antworten (1)
Rishabh Singh
am 12 Jan. 2022
0 Stimmen
Hey,
A possible workaround for your problem could be using a figure window outside your app.
function ButtonPushed(app, event)
img = app.cam.snapshot();
imshow(img);
hp = impixelinfo();
set(hp, 'Position', [5 1 300 20]);
end
Here I have used a "ButtonPushed" callback to trigger the figure window, and there you can use "impixelinfo". You can also explore "datacursormode" and "getCursorInfo" for picking up data points using cursor.
Hope this helps.
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!