LIVE video object detection

5 Ansichten (letzte 30 Tage)
vardhit
vardhit am 4 Apr. 2014
Beantwortet: Dima Lisin am 1 Jul. 2014
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.

Antworten (1)

Dima Lisin
Dima Lisin am 1 Jul. 2014
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.

Kategorien

Mehr zu Computer Vision Toolbox 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!

Translated by