Object detecton and tracking
Transcript of Object detecton and tracking
OBJECT DETECTION&
TRACKING
A mini project report submitted in partial fulfillment of the requirement for the award of the Degree of Batch
By V.S.Harsha Chowdary M.Subramanyam (083E1A0453) (083E1A0419) T.RamLaxman M.Prabakar (083E1A0404) (083E1A0422) J.Avanthi (083E1A0449)
Under the guidance of K.Sravani Kumari
Assistant professor.
Department of Electronics and Communication EngineeringJAGAN’S COLLEGE OF ENGINEERING AND
TECHNOLOGY::NELLORE(Affiliated to JNTU, Anantapur)
2011-12
I
OBJECT TRACKING &
DETECTION A mini project report submitted in partial fulfillment of the requirement
for the award of the Degree of B.Tech
By
V.S.Harsha Chowdary M.Subramanyam (083E1A0453) (083E1A0419) T.RamLaxmaiah M.Prabakar (083E1A0404) (083E1A0422) J.Avanthi (083E1A0449)
Under the guidance of K.Sravani Kumari
Assistant professor.
Department of Electronics and Communication EngineeringJAGAN’S COLLEGE OF ENGINEERING AND
TECHNOLOGY::NELLORE(Affiliated to JNTU, Anantapur)
2011-12
II
Department of Electronics and Communication EngineeringJAGAN’S COLLEGE OF ENGINEERING AND
TECHNOLOGY::NELLORE(Affiliated to JNTU, Anantapur)
a) CERTIFICATE
This is to certify that the project report entitled ‘OBJECT DETECTION &
TRACKING’ being submitted by Mr.V.S.Harsha Chowdary in partial fulfillment for
the award of the Degree of Bachelor of technology in Electronics and
Communication Engineering to the Jawaharlal Nehru Technological University
Anantapur , is a record of bonafide work carried out by him under my guidance and
supervision.
Signature of Project supervisor Head of Department
Internal External
III
DECLARATION
I hereby declare that the mini project/ dissertation entitled, ‘OBJECT
DETECTION & TRACKING’ completed and written by me/ us has not been
previously formed the basis for the award of any degree or diploma or certificate.
Place: Name
Date: (Under signed)
IV
ACKNOWLEDGEMENT
It is a pleasure for us to add heartfelt words for the people who were the part of this
project in numerous ways who gave us the right support from the stage the idea was
conceived.
We are thankful to our honorable principal Prof.T.Krishnaiah,Ph.D for encouraging
us to do this project. We express our deep gratitude to all teaching and non teaching
staff members of college for help throughout provoking discussions, valuable
suggestions extended to us with immense care, willing and cooperation throughout
our work.
We are very much thankful to Prof.Ms.SV.Padmajarani,Ph.D Head of the
Department, Electronics and Communication Engineering. It is a pleasure to
acknowledge the research support of Venemsol Company .We are indebted to our
external guide Vinayagam Project Engineer for his undertaking and co-ordination
in this project through all its phases. We would like to express our gratitude to
other staff members for their valuable guidance and highly interactive attitude
without which the completion of the project would have been a difficult task.
It is great opportunity to render our sincere thanks to our internal guide
MS.K.Sravani Kumari,(M.tech) for his continued and valuable support during the
project. Our apologies for any oversights or shortcomings in the details provided in
this report. Last but not least we thank our family members and friends for being a
constant source of encouragement throughout this period.
V.S.Harsha Chowdary [email protected]
T.RamaLaxmaiah [email protected]
J.Avanthi [email protected]
M.Subramanyam [email protected]
M.Prabakar [email protected]
V
ABSTRACT
Object detection & tracking in general, is a challenging problem. Easily we can
detect the object but difficulties in tracking objects can arise due to abrupt object
motion, changing appearance patterns of both the object and the scene, non rigid
object structures, object-to-object and object-to-scene occlusions, and camera
motion.
Tracking is usually performed in the context of higher-level applications that
require the location and/or shape of the object in every frame. A tracker assigns
consistent labels to the tracked objects in objects in different frames of a video.
This project is to detect, track and recognize objects from the video through
Matlab simulation.
The proposed system is able to distinguish transitory and stopped foreground
objects from static background objects in dynamic scenes; detect and distinguish
left and removed objects; classify detected objects into different groups such as
human, human group and vehicle; track objects and generate trajectory
information even in multi-occlusion cases
We propose a fast and robust approach to the detection and tracking of moving
objects by using blob algorithm. Objects are detected based on motion,using
background subtraction method. Tracking is then done using the Morphological
filter approach. So, we can avoid maximum noise in the video. Object detection
and tracking has several important applications such as security and surveillance.
VI
CONTENTS
BONAFIDE CERTIFICATE………………………...………………… ……………….III
DECLARATION BY THE CANDIDATE……………………………………………...IV
ACKNOWLEDGEMENT……………………………………………………………… V
ABSTRACT……………………………………………………………………………. VI
1. INTRODUCTION……………………………………………………………………...1
1.1 Introduction……………………………………………………………………1
1.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . …………………………...2
1.3 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ………………………….....3
1.4 Literature Survey………………………………………………………...……4
1.5 Organization of the Thesis . . . . . . . . . . . . . . . . . . . ………………………. . . 4
2. IMAGE PROCESSING TOOLBOX ….……………………………………………... 5
2.1 Introduction………………….……………………………………………..….5
2.1.1 Array in Image Processing Toolbox………………………………...5
2.1.2 Data Types…………………………………………………………..6
2.1.3 Read and Write Images………………………………………...…..10
2.2 Moving Object Detection . . . . . . . . . . . . . . . . . . . . . ……………………… . 11
2.2.1 Background Subtraction . . . . . . . . . ………………….. . . . . . . . . . 11
2.2.2 Statistical Methods . . . . . . . . . . ………………….... . . . . . . . . . . . 12
2.2.3 Temporal Differencing . . . . . ………………………………. . . …12
2.2.4 Optical Flow . . . . . . . . . . . . . . . . . . . . . . . . ……………………….13
2.1.5 Shadow and Light Change Detection.……..………………………13
2.3 Object Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . ………………………..14
3. OBJECT DETECTION AND TRACKING ………………………………………….15
3.1 Introduction…………………………………………………………………..15
3.2 Object Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . ………………………...16
VII
3.2.1 Background Subtraction . . . . . . . . . . . . . . . . . . . . . ………………18
3.2.2 Pixel Level Post-Processing . . . . . . . . . . . . . . . . . ………………..19
3.2.3 Detecting Connected Regions . . . . . . . . . . . . . . . . ………………..26
3.2.4 Region Level Post-Processing . . . . . . . . . . . . . . . . ……………….26
3.3 Object Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . ………………………..26
3.3.1 Correspondence-based Object Matching . . . . . . . . . . …………….27
3.3.2 Occlusion Handling . . . . . . . . . . . . . . . . . . . . . …………………...32
3.3.3 Morphological Filters………………………………………………33
3.3.4 Detecting Left and Removed Objects . . . . . . . . . . . . ...…………...37
4. SOFTWARE DESCRIPTION………….…...……….………………………………..39
4.1 Introduction…………………………………………………………………..39
4.2 Data Manipulations………………………………………………………......41
4.3 Using Help…………………………………………………………………...43
4.4 How to Save………………...………………………………………………..45
5. EXPERIMENTAL RESULTS……………….
……………………………………….48
5.1 Test Application and System . . . . . . . . . . . . . . . . . . . . . ……………………48
5.2 Object Detection and Tracking . . . . . . . . . . . . . . . . . . …………………….. 48
5.3 Object Classification . . . . . . . . . . . . . . . . . . . . . . . . . ……………………….49
6. CONCLUSION AND FUTURE SCOPE……………………………………………..52
Bibliography …………………………………………………………………………….53
Appendix………………………………………………………………………………....54
List of Figures2.1 Indexed Image………………………………………………………………………...7
2.2 Intensity Image………………………………………………………………………...8
2.3 Binary Image………………………………………………………………………..…9
2.4 RGB Image…………………………………………………………………………..10
2.5 A generic framework for smart video processing algorithms. . . . …………………. 11
3.1 The system block diagram. . . . . . . . . . . . . . . . . . . . . . . …………………………….15
VIII
3.2 The object detection system diagram. . . . . . . . . . . . . . . . . ………………………….17
3.3 Adaptive Background Subtraction sample. (a) Estimated background
(b) Current image (c) Detected region . . . . . . . . . . . ………………………………..19
3.4 Pixel level noise removal sample. (a) Estimated background image
(b) Current image (c) Detected foreground regions before noise
Removal (d) Foreground regions after noise removal . . . .. . . …………………… 21
3.5 Shadow removal sample. (a) Estimated background (b) Current
image (c) Detected foreground pixels (shown as red) and shadow
pixels (shown as green) (d) Foreground pixels after shadow pixels
are removed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ………………………………....23
3.6 Sudden light change sample. (a) The scene before sudden light
change (b) The same scene after sudden light change . . . . …………………………23
3.7 Detecting true light change. (a) Estimated reference background
(b) Background’s gradient (c) Current image (d) Current image’s
gradient (e) The gradient difference . . . . . .. . . . . . . . ……………………………...25
3.8 Connected component labeling sample. (a) Estimated background
(b) Current image (c) Filtered foreground pixels and connected
and labeled regions with bounding boxes . . . . . . . . . . . …………………………….25
3.9 The object tracking system diagram. . . . . . . . . . . . . . . . . …………………………..27
3.10 The correspondence-based object matching method. . . . . . . . . …………………...28
3.11 Sample object matching graph. . . . . . . . . . . . . . . . . . . …………………………… 28
3.12 Occlusion detection sample case. . . . . . . . . . . . . . . . . . . ……………………….... 31
3.13 Shadow removal sample. (a) Estimated background (b) Current image
(c) Detected foreground pixels (shown as red) and
shadow pixels (shown as green)(d) Noise are removed due to
Morphological Filter………………………………………………………...…….36
3.14 Distinguishing left and removed objects. (a) Scene background (b)
Regions R and S (c) Left object sample (d) Removed object sample ……………..38
5.1 Sample video frames before and after occlusions……………………………...…....50
IX
List of Tables5.1 Performance of object detection algorithms . . . . . . . . . . . ………………………… 48
5.2 Occlusion handling results for sample clips . . . . . . . . . ……………………….. . . . 49
5.3 Number of object types in the sample object template database . ……………….….50
5.4 Confusion matrix for object classification . . . . . . . . . . . . . . ………………………..51
X