Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

display img from function in gui

1 Ansicht (letzte 30 Tage)
Lukasz Jarod
Lukasz Jarod am 9 Jan. 2015
Geschlossen: MATLAB Answer Bot am 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????

Antworten (1)

Geoff Hayes
Geoff Hayes am 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!

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by