how to display multiple images and view them one after another in one axes
7 ビュー (過去 30 日間)
古いコメントを表示
i have a sample gui in which i want to show multiple images in axes. and i want to view them like a slide show with two pushbuttons next and back heres my code for two buttons.this code makes an index of images.
function Backbutton_Callback(hObject, eventdata, handles)
% hObject handle to Backbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% handles.output = hObject;
handles.index = handles.index - 1;
guidata(hObject, handles);
Cek(hObject, eventdata, handles);
axes(handles.Axes2);
imshow({handles.index},[]);
guidata(hObject, handles);
function Nextbutton_Callback(hObject, eventdata, handles)
% hObject handle to Nextbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% handles.output = hObject;
handles.index = handles.index + 1;
guidata(hObject, handles);
Cek(hObject, eventdata, handles);
%handles.X(:,:,handles.index)=rgb2gray(imread('Illusion.jpg'));
axes(handles.Axes2);
imshow((handles.index),[]);
guidata(hObject, handles);
function cek(hObject, eventdata, handles)
% axes(handles.Axes2);
% handles.output = hObject;
n = 10;%length(handles.files);
if handles.index > 1, set(handles.Backbutton,'enable','on');
else set(handles.Backbutton,'enable','off'); end
if handles.index < n, set(handles.Nextbutton,'enable','on');
else set(handles.Nextbutton,'enable','off'); end
guidata(hObject, handles);
and this doesnt work when i press nexbutton, image on axes disappears.im really stuck. thanks
0 件のコメント
回答 (1 件)
Dr. Murtaza Ali Khan
2018 年 6 月 19 日
The attached code may help someone with the same need. It navigates though sequence of loaded images via Next and Previous push buttons. The code is build using "GUIDE", gui interface builder for MATLAB.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!