我想使用GUIDE在用户界面中显示我选择的视频。为此,我有一个按钮来选择视频和一个轴来显示它。
根据Matlab的说法,我没有错误,我四处寻找解决方案但没有成功......
% --- Executes on button press in ouvrir.
function ouvrir_Callback(hObject, eventdata, handles)
% hObject handle to ouvrir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA
% Ask the user what video he wants to load
[filename, pathname] = uigetfile({'*.avi'},'File Selector');
fullPathname = strcat(pathname, filename);
disp(fullPathname);
set(handles.text2, 'String', filename);
%display the video in the axis
video = vision.VideoFileReader(fullPathname);
while ~isDone(video)
frame = step(video);
showFrameOnAxis(handles.axes1,frame);
end
当我启动我的程序时,我可以加载文件并显示它很好但是轴只是消失...
如果你能帮助我,那就太棒了! 真诚的。
编辑:你建议我创建自己的用户界面吗?
答案 0 :(得分:0)
你试试这个。它以轴的形式显示和播放视频。
videoFReader = vision.VideoFileReader(filename);
while ~isDone(videoFReader)
frame = step(videoFReader);
showFrameOnAxis(handles.axes,frame);
end