DEPARTMENT OF ELECTRONICS AND
COMMUNICATION ENGINEERING
CONTROL SYSTEM LAB PROJECT REPORT
Group Members:
Aitijhya Sarkar (Roll No : 106)
Rishav Dutta (Roll No : 107)
Suddhasatta Biswas (Roll No : 112)
Dia Sarkar (Roll No : 103)
Mohona Sanyal (Roll No:127)
Abandoned Object Detection :
This demo tracks object at a train station and determines
which ones remain stationary. Abandoned Objects in public
areas concern authorities since they might pose a security
risk. The algorithm used in this project an be used to assist
security officers monitoring live surveillance by directing their
attention towards a potential area of interest.
In this project we are using BlobAnalysis component to
identify objects and track them.
Here are the following steps :
• Eliminate video areas that are unlikely to contain abandoned
objects
• Perform video segmentation using background subtraction.
• Track objects based on their area and centroid statistics.
• Visualise the result.
Code :
roi = [100 80 360 240];
maxNumObj = 200;
alarmCount = 45;
maxConsequtiveMiss = 4;
areaChangeFraction = 13;
centroidChangeFraction = 18;
minPersistenceRatio = 0.7;
PtsOffset = int32(repmat([roi(1), roi(2), 0, 0],[maxNumObj 1]));
hVideoSrc = [Link];
[Link] = '[Link]';
[Link] = 'single';
hColorConv = [Link]('Conversion', 'RGB to YCbCr');
hAutothreshold = [Link]('ThresholdScaleFactor', 1.3);
hClosing = [Link]('Neighborhood', strel('square',5));
hBlob =
[Link]('MaximumCount',maxNumObj,'ExcludeBorderBlobs',true);
[Link] = 100;
[Link] = 2500;
pos = [10 300 roi(3)+25 roi(4)+25];
hAbandonedObjects = [Link]('Name','Detected
Object','Position',pos);
pos(1) = 46+roi(3);
hAllObjects = [Link]('Name','All Objects','Position',pos);
pos = [80+2*roi(3) 300 roi(3)-roi(1)+25 roi(4)-roi(2)+25];
hThresholdDisplay = [Link]('Name','Threshold','Position',pos);
firsttime = true;
while ~isDone(hVideoSrc)
Im = step(hVideoSrc);
OutIm = Im(roi(2):end, roi(1):end, :);
YCbCr = step(hColorConv, OutIm);
CbCr = complex(YCbCr(:,:,2), YCbCr(:,:,3));
if firsttime
firsttime = false;
BkgY = YCbCr(:,:,1);
BkgCbCr = CbCr;
end
SegY = step(hAutothreshold, abs(YCbCr(:,:,1)-BkgY));
SegCbCr = abs(CbCr-BkgCbCr) > 0.05;
Segmented = step(hClosing, SegY | SegCbCr);
[Area,Centroid,BBox] = step(hBlob,Segmented);
[OutCount,OutBBox] = videoobjtracker(Area,Centroid,BBox,maxNumObj,...
areaChangeFraction,centroidChangeFraction,maxConsequtiveMiss,....
minPersistenceRatio,alarmCount);
Imr =
insertShape(Im,'FilledRectangle',OutBBox+PtsOffset,'Color','red','Opacity',0.5);
Imr = insertText(Imr, [1,1], OutCount);
step(hAbandonedObjects, Imr);
BlobCount = size(BBox,1);
BBoxOffset = BBox + int32(repmat([roi(1) roi(2) 0 0],[BlobCount 1]));
Imr = insertShape(Im,'Rectangle',BBoxOffset,'Color','green');
Imr = insertText(Imr, [1,1],OutCount);
Imr = insertShape(Imr,'Rectangle',roi);
step(hAllObjects, Imr);
SegBBox = PtsOffset;
SegBBox(1:BlobCount,:) = BBox;
SegIm = insertShape(double(repmat(Segmented,[1 1
3])),'Rectangle',SegBBox,'Color','green');
step(hThresholdDisplay, SegIm);
end
release(hVideoSrc);
Output