How do I extract individual frames while taking video input from a webcam?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Deepak Purti
am 19 Jun. 2020
Beantwortet: Saurabh Kumar
am 19 Jun. 2020
Here's a snippet of the program for Fall Detection which analyses a video clip frame-by-frame :
while ~isDone(vid) % vid = vision.VideoFileReader(vidname); where vidname is the filename of the video clip
pause(0.0001);
frame = step(vid);
frameNo = frameNo+1;
How do I edit it so that instead of a video clip the input is taken from my webcam?
0 Kommentare
Akzeptierte Antwort
Saurabh Kumar
am 19 Jun. 2020
You just need to create a VideoDevice System object (say vidobj) and replace vid with vidobj :
% Construct a VideoDevice System object associated with the Winvideo adaptor with device ID of 1.
vidobj = imaq.VideoDevice('winvideo', 1);
while true % The program will run as long as the webcam is on.
pause(0.0001);
frame = step(vidobj);
frameNo = frameNo+1;
You can read more about acquiring frames through VideoDevice System object here :
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu National Instruments Frame Grabbers finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!