Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

display img from function in gui

조회 수: 2 (최근 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