Professional Documents
Culture Documents
MATLAB CODE:
%19BCE0520 SATYANSH TEWARI
clc
close all
clear all
videoSource =VideoReader('metmovie.mp4');
detector=vision.ForegroundDetector('NumTrainingFrames',5,'Initia
lVariance',...
30*30);
blob =
vision.BlobAnalysis('CentroidOutputPort',false,'AreaOutputPort',
...
false,'BoundingBoxOutputPort',true,'MinimumBlobAreaSource',...
'Property','MinimumBlobArea',250);
shapeInserter=vision.ShapeInserter('BorderColor','White');
videoPlayer=vision.VideoPlayer();
while hasFrame(videoSource)
frame=readFrame(videoSource);
fgMask=detector(frame);
bbox=blob(fgMask);
out=shapeInserter(fgMask,bbox);
videoPlayer(out);
pause(0.1);
end
CODE SCREEN:
WORKSPACE:
INPUT VIDEO LINK:
https://youtu.be/K-YOt-boj8g
SOME INSTANCES OF INPUT VIDEO:
OUTPUT VIDEO LINK:
https://youtu.be/YdhJWGz4UZA
SOME INSTANCES OF OUTPUT VIDEO :