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.
LIVE video object detection
4 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!