MATLAB: How to get image after displaying it in matlab GUI made from appdesigner

app designer

I have picked an image file and displayed it on UIAxes using the follwing code (in App Designer)
imshow(img,'parent',app.UIAxes);
Now, can I know how to get the image shown in the app.UIAxes component(without always opening the file from path)?
I want to store it in a variable to perform image processing.

Best Answer

If you have the Image Processing Toolbox then
imhandles(app.UIAxes)
will return the handles of all images under app.UIAxes.
Alternately you can use
findobj(app.UIAxes, 'type', 'image')
If there is a possibility that their handle visibility is set off then
findall(app.UIAxes, 'type', 'image')