How do i play a movie in a GUI axes?
2 ビュー (過去 30 日間)
古いコメントを表示
i have imported an .avi file into the GUI however am unable to make it play.
This is the code I have at the moment:
% --- Outputs from this function are returned to the command line.
function varargout = GUI_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
A = imread ('track.jpg');
axes(handles.axes3);
imshow(A);
% --- Executes on button press in pushbutton6.import video
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[nm,pth]=uigetfile({'*.avi'},'Load Matlab File');
mmObj=mmreader([pth,nm]);
handles.pth=pth;
handles.nm=nm;
handles.Video=mmObj;
image1=read(mmObj,1);
axes(handles.axes1);
imshow(image1);
guidata(hObject,handles);
% --- Executes on button press in pushbutton5. select finish line
function pushbutton5_Callback(hObject, eventdata, handles)
%[nm,pth]=uigetfile({'
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%figure(5)
%imshow();%show image finish line
[x,y]=ginput(1)
%x=data(1){:,1}
%y=data(1){:,2}
% --- Executes on button press in pushbutton1. finish frame
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
fline(:,a:b)=image1(:,st:st+w);
imagesc(fline.^0.5);
colormap('gray')
% --- Executes on button press in pushbutton3.print frame
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton7. Play/pause
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
movie(handles.axes2, mov01);
the movie(m) doesn't seem to be working to play the movie in the GUI, how would i do this?
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!