Study of Object Detection Implementation Using Matlab: L.S.Alandkar, S.R.Gengaje
Study of Object Detection Implementation Using Matlab: L.S.Alandkar, S.R.Gengaje
L.S.Alandkar1, S.R.Gengaje2
1
Student, Department of Electronics Engineering, Walchand Institute of Technology, MH, India
2
Professor, Department of Electronics Engineering, Walchand Institute of Technology, MH, India
Abstract
Object detection is most prevalent step of video analytics. Performance at higher level is greatly depends on accurate
performance of object detection. Various platforms are being used for designing and implementation of object detection
algorithm. It includes C programming, MATLAB and Simulink, open cv etc. Among these, MATLAB programming is most popular
in students and researchers due to its extensive features. These features include data processing using matrix, set of toolboxes and
Simulink blocks covering all technology field, easy programming, and Help topics with numerous examples. This paper presents
the implementation of object detection and tracking using MATLAB. It demonstrates the basic block diagram of object detection
and explains various predefined functions and object from different toolboxes that can be useful at each level in object detection.
Useful toolboxes include image acquisition, image processing, and computer vision. This study helps new researcher in object
detection field to design and implement algorithms using MATLAB.
_______________________________________________________________________________________________
Volume: 05 Issue: 08 | Aug-2016, Available @ http://ijret.esatjournals.org 111
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308
Table5 Useful function/object for object detection on image on the screen and
Too Functi Name Use allow user to define the
lbo on/obj region to fill in interactive
x ect way by selection of point.
CV Object vision.Ca This function extract CV Object vision.M This object works same as
scadeObj various feature of face orpholog imopen but uses only flat
ectDetect like nose , eye, mouth, icalOpen structuring elements.
or upper body using Viola- CV Object vision.M This object works same as
Jones algorithm. orpholog imclose but uses only flat
CV Object vision.O This function can be used icalClose structuring elements.
pticalFlo for the estimation of CV Object vision.M This object dilates an
w object velocities using the orpholog intensity or binary image.
Horn-Schunck or the icalDilat
Lucas-Kanade method. e
CV Object vision.Pe It detects un- CV Object vision.M This object erode an
opleDete occludedpeople inupright orpholog intensity or binary image.
ctor positionusing the icalErode
Histogram of Oriented CV Object vision.Bl This object computes
Gradient (HOG) features obAnalys statistics for connected
and a trained Support is regions in a binary image.
Vector Machine (SVM) It may involve centroid,
classifier. minor axis, major axis,
CV Object vision.Te It is used to perform eccentricity, orientation,
mplateM object detection based on perimeter etc.
atcher template match. CV Object vision.Co This object labels and
nnectedC counts the connected
3.4 Post Processing omponen regions in a binary image.
tLabeler In this labeling, 0
Post processing is required to remove unwanted portion in represents background
the foreground mask. It may arise due to false detection other numbered pixels
caused by dynamic background condition. This False represents corresponding
detection may include speckle noise, small holes in the numbered object.
scene etc. Along with this task, detected object can be
CV Object vision.M Draw markers on output
annotated for proper display. Useful function and object are
arkerInse image
listed in Table 6.
rter
CV Object vision.Sh Draw rectangles, lines,
Table 6 Useful function/object for post processing
apeInsert polygons, or circles on an
Too Functi Name Use
er image
lbo on/Obj
CV Object vision.Te Draw text on image or
x ect
xtInserter video stream
IP Functi imclose This function performs
CV Functi insertObj Annotate RGB color or
on morphological closing on
on ectAnnot grayscale image or video
the binary or grayscale
ation stream
image. It is very
important for removing
small holes/ pepper noise 4. SAMPLE MATLAB CODE FOR OBJECT
in an image. DETECTION
IP Functi imopen This function performs
on morphological opening on Simple example is presented in this section about object
the grayscale or binary detection and object tracking.
image IM with specified
structuring element. Salt 4.1 Object Detection using MATLAB
noise can be removed by Object detection is carried out on canonical sequence Time
this function. of Day in Wallflower Dataset
IP Functi imdilate It performs dilation of
Video input: stored video
on grayscale or binary,
Preprocessing: RGB to Gray conversion and Gaussian
image.
noise removal using median filter
IP Functi imerode It performs erosion of
Object Detection: Adaptive GMM based Background
on grayscale or binary image.
Subtraction method with number of component=3,
IP Functi imfill It displays the binary
Learning Rate=0.05,thresold=0.7
_______________________________________________________________________________________________
Volume: 05 Issue: 08 | Aug-2016, Available @ http://ijret.esatjournals.org 112
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308
videoFReader = vision.VideoFileReader('TDVideo.avi');
H = vision.ColorSpaceConverter('Conversion', 'RGB to
intensity');
e. f
medianFilter1 = vision.MedianFilter([3 3]);
Fig.2 Output at various level (a) input sequence (b) Ground
hclosing = vision.MorphologicalClose; truth (c) Gray-scale conversion (d) Median filtering
hclosing.Neighborhood = strel('square',3); (e)Foreground mask after Object Detection (f) Post-
processed output
hclosing = vision.MorphologicalClose;
hclosing.Neighborhood = strel('square',3); 5. DISCUSSION AND CONCLUSION
hfdet = This paper presents the basic object detection system.
vision.ForegroundDetector('NumTrainingFrames',200,'Nu MATLAB platform(MATLAB 2012) is used to carry
mGaussians',3,'LearningRate',0.05,'MinimumBackground implementation of the system. Different Toolboxes has been
Ratio',0.7); explored and useful MATLAB functions and objects are
collected which can be useful at various stages. Toolboxes
while ~isDone(videoFReader) mainly includes image acquisition, image processing and
frame = step(videoFReader); computer vision. Sample MATLAB coding is presented for
frame1=step(H,frame); object detection. Each stage in the system has been
frame2=step(medianFilter1,frame1); implemented by available functions/objects in toolbox. It
fgMask = step(hfdet,frame2); shows that implementation is easy and code is being short
Det1=step(hclosing,fgMask); due to use of predefined objects/functions in MATLAB.
Det2=step(hclosing,Det1); This study may help new student and research in this field to
end study, implement and experiment established research.
release(H); REFERENCES
release(hfdet);
[1] Video Analytics:
release(medianFilter1); http://www.dspdesignline.com/videoanalytics.html
release(hclosing); [2] Jun-Wei Hsieh, Shih-Hao Yu, Yung-Sheng Chen, An
release(videoFReader); Automatic Traffic Surveillance System for Vehicle
Tracking and Classification, IEEE Transactions on
In this sample code, „frame‟ is input frame. „frame1‟ Intelligent Transportation Systems, Vol. 7
grayscale conversion of input frame. „ frame2‟ is median [3] Shireen Y. Elhabian, Khaled M. El-Sayed, Moving
filtered output. „fgMask‟ is foreground mask generated by Object Detection in Spatial Domain using
GMM based object detection method. „Det2‟ is post Background Removal Techniques - State-of-Art ,
processed output. Sample code output is shown in Fig. 2 Recent Patents on Computer Science 2008, 1, 32-54
[4] K. Toyama, J. Krumm, B. Brumiit, and B. Meyers.
Wallflower: Principles and practice of background
maintenance. International Conference on Computer
Vision, pages 255–261, September 1999.
[5] N. Goyette, P. Jodoin, F. Porikli, J. Konrad, and P.
Ishwar. changedetection.net: A new change detection
benchmark dataset. IEEE Workshop on Change
Detection, CDW 2012 at CVPR 2012, June 2012.
[6] A. Vacavant, T. Chateau, A. Wilhelm, and L.
a. b
Lequievre. A benchmark dataset for
foreground/background extraction. International
Workshop on Background Models Challenge, ACCV
2012, November 2012.
[7] I. Kavasidis, S. Palazzo, and C. Spampinato. An
innovative web-based collaborative platform for
video annotation. Multimedia Tools and
Applications, pages 1–20, 2013.
c. d
_______________________________________________________________________________________________
Volume: 05 Issue: 08 | Aug-2016, Available @ http://ijret.esatjournals.org 113
IJRET: International Journal of Research in Engineering and Technology eISSN: 2319-1163 | pISSN: 2321-7308
BIOGRAPHIES
Lajari S. Alandkar –Ph.D. student
(Electronics) at Walchand Institute of
Technology, Solapur, MH, India. Her
areas of interest include Image
Processing, and Computer Vision.
_______________________________________________________________________________________________
Volume: 05 Issue: 08 | Aug-2016, Available @ http://ijret.esatjournals.org 114