Info

この質問は閉じられています。 編集または回答するには再度開いてください。

display img from function in gui

1 回表示 (過去 30 日間)
Lukasz Jarod
Lukasz Jarod 2015 年 1 月 9 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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????

回答 (1 件)

Geoff Hayes
Geoff Hayes 2015 年 1 月 11 日
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!

Translated by