LIVE video object detection

4 次查看(过去 30 天)
vardhit
vardhit 2014-4-4
I found this example in matlab which is used on avi files. % EXAMPLE: Tracking cars hsrc = vision.VideoFileReader('viptraffic.avi', ... 'ImageColorSpace', 'Intensity', ... 'VideoOutputDataType', 'uint8'); hfg = vision.ForegroundDetector(... 'NumTrainingFrames', 5, ... % 5 because of short video 'InitialVariance', 30*30); % initial standard deviation of 30 hblob = vision.BlobAnalysis(... 'CentroidOutputPort', false, 'AreaOutputPort', false, ... 'BoundingBoxOutputPort', true, 'MinimumBlobArea', 250);
hsnk = vision.VideoPlayer();
while ~isDone(hsrc)
frame = step(hsrc);
fgMask = step(hfg, frame);
bbox = step(hblob, fgMask);
% draw bounding boxes around cars
out = insertShape(frame, 'Rectangle', bbox, 'Color', 'White');
step(hsnk, out); % view results in the video player
end
release(hsnk);
release(hsrc);
I want it to process this code on LIVE webcam video feed. please suggest a way to achieve this.

回答(1 个)

Dima Lisin
Dima Lisin 2014-7-1
You would either need to have the Image Acquisition Toolbox, or MATLAB version R2014a, which includes support for getting video from a webcam in base MATLAB.

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by