Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

I get error when I closed the window before selected the stop button for live video

1 visualización (últimos 30 días)
I have the following code for live video:
function track_OpeningFcn(hObject, eventdata, handles, varargin)
movegui(hObject,'center')
imaqreset
vid = videoinput('winvideo',1);
handles.video = vid;
set(handles.video,'TimerPeriod', 0.05, ...
'TimerFcn',['if(~isempty(gco)),'...
'handles=guidata(gcf);'...
'image(getsnapshot(handles.video));'...
'set(handles.axes2,''ytick'',[],''xtick'',[]),'...
'else '...
'delete(imaqfind);'... % Clean up - delete any image acquisition objects
'end']);
triggerconfig(handles.video,'manual');
handles.video.FramesPerTrigger = Inf;
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
uiwait
function StartVideo_Callback(hObject, eventdata, handles)
vid = handles.video;
start (vid);
guidata(hObject, handles)
function StopVideo_Callback(hObject, eventdata, handles)
vid = handles.video;
stop (vid);
guidata(hObject, handles)
function track_CloseRequestFcn(hObject, eventdata, handles)
uiresume
delete(hObject)
delete (handles.video)
imaqreset
I get this error when I closed the window before selected the stop button:
Error using imaqdevice/getsnapshot (line 65)
Image acquisition object OBJ has been deleted. OBJ is now an invalid object.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by