Info

This question is closed. Reopen it to edit or answer.

display img from function in gui

2 views (last 30 days)
Lukasz Jarod
Lukasz Jarod on 9 Jan 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
i have main code with gui hendles and i display img somehow like that:
axes(handles.axes18);
imshow(ObrazSzary);
but now i have a separate function that i use in my main program
function [ o_str ] = ocr1( img )
pre procesing img
ocr
o_str=word
end
now i want do display pre procesinf of img in specifinc axes , but there is no hendles for axes how i can do that????

Answers (1)

Geoff Hayes
Geoff Hayes on 11 Jan 2015
Lukasz - if you want the image from the pre-processing part of the ocr1 function to appear in a specific axes, then pass the axes handle into the function. Just change your function signature to
function [ o_str ] = ocr1(img, preProcImgAxesHandle)
and then when you have the pre-processed image to display, just do
imshow(preProcImg,'Parent', preProcImgAxesHandle);
and the pre-processed image, preProcImg, will be shown on the axes that is represented by the preProcImgAxesHandle handle.
In your GUI, you would call this function as (for example)
ocr1(img,handles.axes18)
Try making the above change and see what happens!

Community Treasure Hunt

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

Start Hunting!