How i can display image from MATLAB code file?

1 visualizzazione (ultimi 30 giorni)
Gytis Raudonius
Gytis Raudonius il 18 Ago 2016
Risposto: Walter Roberson il 18 Ago 2016
Hey, have problem and hope someone help me. So problem is i cant find info about how i can display image from mat file to GUI. Explain i've crated gui which have two axes, one is upload image from disk and then i upload this image automaticly start my code in mat file. In this file works image processing, and i want display one of image processing images display on axes2.
  2 Commenti
Adam
Adam il 18 Ago 2016
What have you done so far? It should just be a case of loading from the mat file using the full file path and calling imshow, imagesc or image, giving whichever function you choose the axes handle for axes2 - i.e. handles.axes2 if your GUI is created using GUIDE
Gytis Raudonius
Gytis Raudonius il 18 Ago 2016
i tried this code but, in axes2 i just got black image
function pushbutton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile({'*.jpg','*.bmp'},'File Selector');
image1 = imread(strcat(pathname, filename));
axes(handles.axes1);
imshow(image1);
filtravimas(image1);
axes(handles.axes2);
imshow(i);

Accedi per commentare.

Risposte (1)

Walter Roberson
Walter Roberson il 18 Ago 2016
imshow(i);
i is equivalent to sqrt(-1)
You did not initialize i, so it is going to have its default value of sqrt(-1) -- unless, that is, filtravimas(image1) does an assignin('caller', 'i', some_value) and you are using R2015a or earlier.

Community Treasure Hunt

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

Start Hunting!

Translated by