how can i feed the live video(from webcam) to the following code instead of pre-recorded one ?

R2012a > Documentation Center (Beta) > Computer Vision System Toolbox > Featured Examples in Computer Vision System Toolbox > Abandoned Object Detection
Here they are using this code to acquire video :
hVideoSrc = vision.VideoFileReader; hVideoSrc.Filename = 'viptrain.avi'; hVideoSrc.VideoOutputDataType = 'single';
i would like to replace that part with:
vid=videoinput('winvideo',1); start(vid); preview(vid);
how can i do that ? please help.

Answers (1)

Asked:

on 9 May 2012

Commented:

on 27 Mar 2025

Community Treasure Hunt

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

Start Hunting!