Didn't display the image in the axes

조회 수: 1 (최근 30일)
Hazel Sialongo
Hazel Sialongo 2016년 12월 28일
댓글: Hazel Sialongo 2016년 12월 28일
Whenever I tried to load the image by clicking the push button it didn't display the image that I clicked. It should be display in the axes. Please help me!
This is my code:
function pushbutton24_Callback(hObject, eventdata, handles)
[fname path]=uigetfile({'*.jpg;*.tif;*.png;*.gif','All Image Files';... '*.*','All Files' },'mytitle',... 'D:\EYEris\Eye Images');
fname=strcat(path,fname);
I=imread(fname);
I1 = rgb2gray(I);
axes(handles.axes19);
imshow(I1);title('Iris Image');
ss = ones(300,400);
axes(handles.axes19);
imshow(ss);
handles.ImgData1 = I1;
guidata(hObject,handles);

채택된 답변

Image Analyst
Image Analyst 2016년 12월 28일
Remove these lines which overwrite the image you selected and displayed in axes19:
ss = ones(300,400);
axes(handles.axes19);
imshow(ss);
All they do is to cover up the image that the user chose with one of all 1's.
  댓글 수: 1
Hazel Sialongo
Hazel Sialongo 2016년 12월 28일
Omg! This works! Thank you so much!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by