How to Capture frames from live streaming using camera? Each Time when the start button is clicked it should capture images after 5 seconds pause and save the images session-wise.
2 views (last 30 days)
Show older comments
I have tried the following code,
(1) I want to the camera to stop when the session ends and strat again when the start button is clicked.
(2) I want to save the captured frames session wise into the folder.
please help me , I am biggner to MATLAB
% --- Executes on button press in camerabutton.
function camerabutton_Callback(hObject, eventdata, handles)
Folder = 'CapImages\';
vid = handles.cam;
axes (handles.axes1)
hImage=image(zeros( 720,1280,3),'Parent',handles.axes1);
hImage = image(handles.axes1 ,zeros(720,1280,3));
preview (vid,hImage);
guidata (hObject, handles);
for iframe = 1:10;
frames = snapshot(vid);
pause(5);
imwrite(frames, fullfile(Folder, sprintf('%0d.jpg',iframe)));
end
f = msgbox({'Operation';'Completed'});
preview(vid)
0 Comments
Answers (0)
See Also
Categories
Find more on MATLAB Support Package for IP Cameras in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!