I have been looking at the Motion-Based Multiple Object Tracking and was wondering if there was any way a live webcam feed could be used as the video file?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
John Wallace
am 2 Feb. 2016
Beantwortet: chanaka prasad
am 30 Mär. 2020
I have been working with the object tracking that is an example on the support page and I can get it to work while reading a video file, but since it uses the step() function in places i haven't found any way to use a live feed. Thanks in advance for any help offered.
1 Kommentar
William Dennehy
am 7 Dez. 2016
Hi John, Did you get this working? I've been trying for a while now but the different nested functions keep conflicting with each other. I'm new to Matlab so its trick for me. Thanks.
Akzeptierte Antwort
Dima Lisin
am 2 Feb. 2016
Bearbeitet: Dima Lisin
am 2 Feb. 2016
You can certainly get the video from a webcam instead of a file. Please see the Face Detection and Tracking Using Live Video Acquisition example to learn how to use the Webcam Support Package.
In the Motion-Based Multiple Object Tracking code, you would need to replace vision.VideoFileReader with a webcam object, and the calls to the VideoFileReader's step method with the calls to snapshot .
Alternatively, the Image Acquisition Toolbox has more advanced functionality for configuring cameras and capturing video.
By the way, the step() function you are talking about, is actually a method of the vision.VideoFileReader class. You can find this methods in many classes, and it essentially tells the object to "do its thing", whatever that may be. So to find out what the step method actually does in any particular instance you should check the class of the its first argument, and see its documentation.
2 Kommentare
Dima Lisin
am 3 Feb. 2016
In setupSystemObjects replace
cam = webcam();
% Create a video file reader.
obj.reader = snapshot(cam);
with
obj.reader = webcam();
In readFrame replace
frame = obj.reader();
with
frame = snapshot(obj.reader);
webcam() creates the webcam object. snapshot() captures a video frame.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Image Acquisition Toolbox Supported Hardware 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!