You are on page 1of 6

2011 International Conference on Computational Intelligence and Communication Systems

An implementation of Moving Object Detection, Tracking and Counting Objects for


Traffic Surveillance System

Yoginee B. Bramhe(Pethe) P.S. Kulkarni


Comp. Sci. and Engg Dept, Information Technology. Dept.
R.C.E.R.T., Chandrapur M.S. India. R.C.E.R.T. ,Chandrapur M.S. India .
nutanbramhe@rediffmail.com, kulkarnips1811@gmail.com

Abstract— Moving vehicle detection in digital image sequences know, traffic control is a complex issue, it requires
is one of the key technologies of Intelligent Transportation monitoring, but on the other hand the data processed by the
Systems (ITS). Traffic Surveillance System is being more and monitoring system are huge causing high throughput
important with the enlarging of urban scale and increasing computation. Recently, with the development of computer,
number of vehicles. This Paper presents an intelligent vehicle network, image processing, transmission technology, and
counting method based on blob analysis in traffic surveillance. hardware, video monitoring systems are widely used in
The algorithm is composed of moving object segmentation, different domains and areas. But most of them rely on high
blob analysis, and tracking. By analyzing the blob of vehicles, Performance of hardware, limiting effectiveness and
the meaningful features are extracted. In addition, the speed of
efficiency, especially in accuracy and response. Hence we
each vehicle and the vehicle flow through a predefined area can
will focus on optimization of the video based traffic
be calculated by analyzing blobs of vehicles. The experimental
results show that the proposed system can provide useful congestion monitoring system, mainly in image processing
information for traffic surveillance. We analyze the procedure and moving target detection. There are many ways to track
of video-based traffic congestion system and divide it into the moving object. Most of them use the frame differences
graying, binarization, denosing and moving target detection. to analysis the moving object and obtain object boundary,
The system first reads video and converts them into grayscale which may be quite time consuming. In order to reduce the
images. We also put forward a Boundary block detection computation cost, a more efficient way is expected. From
algorithm with noise reduction to identify the moving objects. this point of view, a new moving object detection algorithm
is forwarded called Boundary Block detection algorithm .
Keywords— Binarization; Background Substraction; Boundary Overall works are software development of a system that
Detection; Detection Of Moving Vehicles(Object Detection); requires a video stream or single image. They consist of the
Finding Speed; Counting Vehicles; following components: background without any moving
objects and the scene with moving objects. The system is
I. INTRODUCTION designed that finds the boundary of the moving objects and
The large increase of the vehicles is making the roads full find the number of moving objects from the video scene.
results in lot of traffic jam and it becoming more critical The object detection and counting system consists of six
day by day. So, the detection to vehicles is of great major components: 1) Image Acquisition 2) Image
importance. Video tracking system is the most popular way Enhancement 3) Image Segmentation 4) Image Analysis 5)
of detection due to its enormous advantage. It uses the fixed Object Counting, and 6) Reports.
and still camera for continuous surveillance, deals and The remainder of the paper is organized as follows: Section
analyses the picked serial pictures and frame, in order to II gives the overview of the related work., Section III
identify and track the moving object correctly. Automated describes the background subtraction of vehicle object,
visual surveillance is currently a hot topic in computer Section IV describes the vehicle detection and segmentation
vision research. A common approach is to perform , Section V gives idea of vehicle counting and vehicle
background subtraction, which identifies moving objects tracking, Section VI is the architecture and modeling of
from the sequence of video frames that differs significantly developed methodology, Section VII shows implementation ,
from a background model. As a basic, the background image Section VIII contains experimental results and Section IX
must be a representation of the scene with no moving contains the concluding remarks.
objects and must be kept regularly updated. There are many
challenges in developing a good background subtraction II. OVERVIEW OF THE RELATED WORK
algorithm. Moving object detection techniques have been At present, there are lots of applications in the field of
studied extensively for such purposes as video content traffic surveillance and video monitoring. They are mainly
analysis as well as remote surveillance. Traffic congestion about how to use systems in certain areas to save labor and
monitoring is being more and important with the enlarging improve efficiency and security, e.g. video-based
of urban scale and increasing number of vehicles. Video- monitoring system for mine area management. Optimization
based traffic congestion monitoring systems are widely used for monitoring system usually aims at improving system
now but it relies on the high performance of hardware.The efficiency and seeks for better performance with fewer
urbanization impels the increasing of traffic flow. As we

978-0-7695-4587-5/11 $26.00 © 2011 IEEE 149


143
DOI 10.1109/CICN.2011.28
resources. Image process in monitoring systems leads to binarization on this subtraction result and get moving
study on image processing methods. Researchers improve vehicle objects. For each pixels in the frame, we judge the
algorithms to achieve better performance. However, most of value difference with the corresponding value in background
them merely aim at image processing and separating from image. If the difference is higher than a threshold, we regard
concrete monitoring application. When working, video- it as foreground and output 1,otherwise as background and
based traffic congestion monitoring system will get video output 0. Finally, each 1 or 0 construct a binarization image
data, transmit data, conduct processing and return result. We and finish object extraction of Vehicle processing.
will mainly discuss on the steps involving in data processing Threshold segmentation method is mainly used in this
and complex computing which influence system object extraction stage, after obtaining background image,
performance immensely, consisting of graying, binarization, we use background subtraction to obtain the object. In this
denoising and moving object detection. processing, a proper threshold will have a important impact
M.Sankari and C. Meena [1] have proposed a on object extraction. All the gray pixels is greater than the
methodology to perform background subtraction from threshold were set to 255 (white), and all the less than the
moving vehicles in traffic video sequences that combines threshold were set to 0 (black). As the constantly changing
statistical assumptions of moving objects using the previous of forward image and background image, it can not use a
frames. It is necessary to update the background image fixed threshold to split each frame image, so for different
frequently in order to guarantee reliability of the motion images in each frame we must select a most appropriate
detection. For that, a binary moving objects hypothesis mask threshold for segmentation.
is constructed to classify any group of lattices as being from
a moving object based on the optimal threshold. Then, the IV. VEHICLE DETECTION AND SEGMENTATION
new incoming information is integrated into the current The processing of vehicle object detection is that devising
background image using a Kalman filter. H.S. Mohana, foreground object (vehicle) from background real time from
Aswatha Kumar and Shiva kumar [2] focus on a tracking video sequence, i.e. the subtraction of foreground and
strategy that can robustly track and classify the objects background. Such object detection is the main part of digital
within a fixed environment. They have defined a robust image processing technique, and form the basis of follow up
model-based tracker and classifier using kalman filtering high level processing tasks such as recognition and tracking
combined with pixel scanner. Vibha L, Chetana Hegde, P system. There exist two stages to realize object detection:
Deepa Shenoy, Venugopal K R, L M Patnaik[3] describe a background subtraction, object extraction. In this system,
technique for identifying a moving object in a video clip of the input signals are color video sequences.The useful
stationary background for content based multimedia message is moveable vehicle object. Firstly, we extract
communication systems. They presented a framework for background in each fame, then using subtraction with still
detecting some important but unknown knowledge like
frame and binarization, we can get movable object image,
vehicle identification and traffic flow count.
and this result is object extraction.
M. Vargas,S. L. Toral, F. Barrero, J.M. Milla,[4] focused
on background subtraction, which is a very common Generally, the traffic–camera is usually set at a certain
technique for detecting moving objects from image site and hence the background is stationary. For this reason,
sequences using a static camera. the background subtraction is suitable to be employed to
For foreground analysis [19] [20], a method for foreground detect the moving vehicles in the process of change
analysis was proposed for moving object, shadow, and ghost detection. Initially, a static background is derived to be a
by combining the motion information. The computation cost reference frame and then frame-difference technique is used
is relatively expensive for real-time video surveillance for change detection.
systems because of the computation of optical flow. V. VEHICLE COUNTING AND VEHICLE TRACKING
III. BACKGROUND SUBTRACTION OF VEHICLE In order to achieve the vehicle-flow counting, the
OBJECT proposed method will track each moving vehicle within
successive image frames. However, after segmenting
Background extraction is an important part of moving
moving objects, these objects with their bounding boxes and
object detection algorithms that are very useful in
centroids are extracted from each frame. Intuitively, two
surveillance systems. Moving object detection algorithm is
objects that are spatially closest in the adjacent frames are
simple when a clean background image is available. Method
connected. Besides, the area of a vehicle is also considered
of background extraction during training sequence and
for enhancing the vehicle tracking. For each object in the
updating it during input frame sequence is called
current frame, an object with the minimum distance and
background modeling. The detection and tracking of color
similar size between two consecutive frames needs to be
moving target maybe use gray-scale image sequences
searched in the previous frame.
converted from the original color image sequence. This is
determined by the purpose of motion detection. Based on VI ARCHITECTURE AND MODELING OF
the results of background subtraction, we can then realize DEVELOPED METHODOLOGY
object extraction: Firstly getting background image from
previous processing, then subtracting it from full image Developed work is an efficient moving object detection,
getting from original video sequence’s frame. We apply tracking & counting objects using boundary block detection

144
150
for traffic surveillance system. Based on the analysis of At first, we have detected the blocks containing moving
projection of the 2D motion of objects, the information of object boundaries by using the information of the motion
motion field is exploited to make moving object detection vector field generated by video compression. The motion
more efficient. Fig 1 shows the Vehicle Detection and Counting vector derived by motion estimation is the common motion
system Architecture.
vector for all pixels in one block. However, we can assume
it is the motion vector of the critical points locating in the
centroid of each block. As mentioned above, pixels in the
same object should satisfy the condition of linear
interpolation. Hence the critical points in one moving
objects should satisfy this condition. When this condition is
violated, the discontinuity of motion vector field exist and
imply the existence of the boundary in associated block.
Then the algorithm detecting blocks containing moving
object boundaries is as follows:
B. Moving object block detection Algorithm
1) Scan along horizontal direction, for three consecutive
critical points P1, P2, P3, which are central points of each
block and satisfying
Fig. 1. Vehicle detection and counting system architecture 2P2 = P1 + P3, if 2vP2 ≠ vP1 + vP3 , then P2 might be a
boundary block.
The discontinuities of motion vector field on the
2) Scan along vertical direction, for three consecutive
boundaries of moving objects enable us to detect the moving
critical points P1, P2, P3, which are central points of each
objects blocks in which the potential boundaries of the
moving objects locate. block and satisfying 2P2 = P1 + P3, if 2vP2 ≠ vP1 + vP3 ,
The Paper consists of a video clip which is a sequence of then P2 might be a boundary block. Now the possible
traffic images in AVI format, the objectives are: boundary blocks are selected, for further verification,
Steps: another condition is provided.
1. A video clip in the format of AVI for traffic surveillance 3) For six consecutive critical points P1, P2, P3, P4, P5, P6,
is taken. which are in a same line, and P3, P4, P5 are possible
2. Detectection of a moving object using the concept of boundary blocks, while P1, P2, P6 are not.
boundary block detection algorithm. The central block P4 is the boundary block. Then we
3. Improve the clarity of the moving object and compare it describe the boundary blocks by chain code. 8-neighboring
with the already existing algorithms. connectivity is used here. The number 0 to 7 denotes
4. Develop a vision based surveillance system capable of neighboring blocks. Initial search starts from block 0, then
identifying vehicles in the scene. round the target block, from block 1 to block 7. During the
(b) To track the vehicles as they progress along the image search, once a neighboring block is found as a boundary
sequence. block, then the search will stop and the neighboring block
(c) To count the number of vehicles in the image. will be regarded as current target block to start 8
Assumptions: The background of a video sequence is neighboring blocks search iteratively. Implementation
stationary. procedure for moving object detection, tracking and
VII. IMPLEMENTATION AND EXPECTED counting of object for traffic surveillance system is given
RESULTS below :
We have implemented this steps one by one and for that we
MOVING OBJECT DETECTION ALGORITHMS have taken different frames to work properly. We
In this section, we are developing object detection formulated the problem in a sequential manner .We planned
algorithms which are introduced step by step as detecting our work according to the following steps. We planned
boundary blocks, writing chain codes, and detecting different step with different set of operation will take place
boundaries in the boundary blocks, where the boundary at each step and the output of that step will be used as the
block is defined as a block containing boundary of a certain input to the other step. Each step is in incharge of specific
moving object.To simplify the moving object boundary function which it will perform on each frame of the video
detection, some assumptions are drawn: sequence and the final result of that step will be used in the
1. At most two objects’ boundaries in one block; another step and each step will follow the same things..The
2. The boundary of moving object is a simple closed curve. formulation of steps are defined as follows in fig2-
A. Boundary Block Detection

145
151
In this step we will do preprocessing for the background
reference image and also for the subsequent frame of the
given video. This is done to remove the change of intensity
in any frame. Converting an RGB image into normalized
RGB removes the effect of any intensity variations
C. Graying
Grayscale image has no color information. It only
contains brightness data of the image. By graying, the
system converts colorful image which contains brightness
and color information to the one which has only brightness
data. Graying is an important step in image processing,
whose output is the foundation of subsequent processing. As
most images captured by monitoring devices are 24-bit
bitmap,
we suppose the images discussed in the paper are 24-bit
ones. We conduct graying by equation 1.

Y=0.30 ×R+0.59×G+ 0.11×B (1)


Fig.2 Flowchart of the implemented moving object detection for traffic
surveillance system. Here R, G and B represent values of red, green and blue
components of a point respectively. After being grayed,
A. Reading of frame from a video sequence color image merely loses color information that is useless to
Firstly we have taken a video and then read all the frame in monitoring system, which will not influence final result.
the video by the matlab function Aviread.The process of this
is explained below. D. Binarization
Movie= aviread(videoFile,Frameno); Binarization divides images into two parts: foreground
The function aviread is used to extract a frame from the one and background one. The key of binarization is the
video, where movieFile is the path of the movie file and selection of threshold. Now, global threshold method and
frameNo is the number of frame to be extracted. The local threshold method are in common use. Global threshold
function will extract the entire frame and will store it into method uses a unique value as threshold for binarization.
the Movie. Local threshold method uses thresholds of each sub-image
separated from grayscale. Global threshold method is simple
B. Getting Number Of Frames but easy to be interfered , local threshold method has better
To get number of frame from a video I use the following effect but is slow due to more computing.
function. For monitoring system, local threshold method will slow
numFrames = get(videoFile, 'numberOfFrames'); down overall response. Experiments show that factors such
as brightness which interfere in selection of global threshold
C. Background Reference Image method do not have prominent impact on monitoring.
Taking all factors into consideration, we choose global
A background reference image is required for background threshold method.
substraction. It will be used to as reference to every new
frame which will result in the outline of objects and their
shadows. I used the first frame of every video as the VIII. EXPERIMENTAL RESULTS
background reference image. The Background reference We have evaluated the proposed approach using
need not necessary that it will be first frame of the video continuous images in traffic scenes. Since the data are
sequence but it can be other frames also. The background collected from different environmental conditions by fixed
reference image is stored in a variable matrics which will be cameras, the backgrounds can be considered approximately
used in further processing of the image. static, even though not completely stationary due to waving
D. Normalizing the RGB factor in each frame tree phenomena and something else. An experiment carried
First extract the background reference image which is out in daytime demonstrates how to convert image into
generally the first frame of the sequence. grayscal along with ,boundary detection, counting, finding
For Normalization we will do the following things: distance between vehicles and estimating speed as shown in
fig. 3,fig 4 , fig 5 ,fig 6 and fig 7 respectively.
N=R+G+B
N= Summation of Each color in a frame
R=R/N ,G=G/N , B=B/N;
R= Red Color ,G=Gray color, B=Blue

146
152
Fig. 5 Result Of Finding Distance Between The vehicles (a) Input Image.
(b) Binarization of Image (c) Watershed Connected Components
(d) Distance In Meters

a) Input Image(Image Acquisition b) Background Image

Fig. 6 Result of main screen shots finding distance between the vehicles

c) Binarization of Image d) Gray Image

Fig.7. Main screenshot for speed estimation

e) Detecting Boundary f) Color based segmentation) IX. CONCLUSION


The Traffic surveillance system aims at developing the
Fig. 3 Result vehicle segmentation. a)Input Image b) Background Image
c)Binarization of Image d) Gray Image e) Detecting Boundary f) Color system which can provide an overview and analysis of the
based segmentation methods commonly used to define detail boundaries in each
boundary block. The system also implements to determine
the limitations of the methods which are discussed, when
considering their use in finding object, finding object using
Background suppression, counting the number of vehicles
and finding the distance between two moving objects. In this
paper, an efficient moving object detection algorithm is
developed. A background reference image technique is used
to construct reliable background information from the video
sequence. Then, each incoming frame is compared with the
background image. If the luminance value of a pixel differ
significantly from the background image, the pixel is
Fig. 4 Result of Vehicle counting Count is 2 (Two vehicles found) marked as moving object, otherwise, the pixel is regarded as
background. Finally, a post-processing step is used to
remove noise regions and produce a more smooth shape
boundary. In this way, many situations which may cause
trouble in conventional approaches can be handled properly
without using complicated operations. After enhancement,
the various methods like conversion from RGB to gray
image, binarization algorithms, thresholding and watershed
algorithm are used for the segmentation of the image. It can
a) Input Image(Image Acquisition b) Binarization be seen in the final output that it is working very good and
accurately. It is detecting the moving object according to its
boundary fulfilling the paper objectives and requirements.
The above algorithms can be used in different applications
like moving object tracking, vehicle counter and traffic
controlling.

c)Watershed connected components d) Distance In Meters X. FUTURE WORK

147
153
The above algorithms work on videos with a normal Detection,”IEEE Transactions on Image Proc., vol. 13, no. 11, pp. 1459-
1472, Nov 2004.
background and stable videos from fixed camera. This
algorithm can be modified to work on the video having [15]Amol A. Ambardekar , Dr. Mircea Nicolescu, “Efficient Vehicle Tracking
complex background as well as videos that are not stable. and Classification for an Automated Traffic Surveillance System”
December, 2007.
Traffic congestion can be minimized to much greater extent
by implementing an intelligent traffic system based on [16] Fei Zhu, "A Video-Based Traffic Congestion Monitoring System Using
Adaptive Background Subtraction," isecs, vol. 2, pp.73-77, 2009 Second
artificial intelligence network having the ability to change International Symposium on Electronic Commerce and Security, 2009
the duration of traffic light according to the circumstances
[17] Guanglun Li, Yanling Wang, Weiqun Shu, "Real-Time Moving Object
leading to fuel reduction and pollution control. Performance Detection for Video Monitoring Systems," iita, vol. 3, pp.163-166, 2008
of the system can also be improved by using more advance Second International Symposium on Intelligent Information Technology
optimizing algorithm such as fuzzy logic and neural network Application, 2008
and this can be used for traffic surveillance system in metro [18] Weihua Wang, "The Approach of Real-time Monitoring Based on
cities. Background Subtraction," iuce, pp.46-49, 2009 International Symposium
on Intelligent Ubiquitous Computing and Education, 2009
REFERENCES [19]Yueli Hu, Huijie Ji, "Research on Image Median Filtering Algorithm and
[1] M.Sankari and C. Meena ,“Adaptive Background Estimation and object Its FPGA Implementation," gcis, vol. 3, pp.226- 230, 2009 WRI Global
detection applying in Automated visual surveillance” (IJCSIS) International Congress on Intelligent Systems, 2009
Journal of Computer Science and Information Security, Vol. 8, No. 4, July
[20]R. C. Gonzalez and R. E. Woods. Digital Image Processing. Pearson
2010
Education, 2002.
[2] H.S. Mohana, Aswatha Kumar and Shiva kumar Malnad College of
Engineering, Hassan, Karnataka,” Vehicle Counting And Classification
Using Kalman Filter And Pixel Scanner Technique And Its Verification
With Optical Flow Estimation”, Global Journal of Computer Science and
Technology 46 Vol. 10 Issue 8 Ver. 1.0 September 2010
[3] Vibha L, Chetana Hegde, P Deepa Shenoy, Venugopal K R, L M Patnaik,”
Dynamic Object Detection, Tracking and Counting in Video Streams for
Multimedia Mining”, IAENG International Journal of Computer
Science35:3 IJCS_35_3_16, august 2008.
[4] M. Vargas, Member, IEEE, S. L. Toral, Senior Member, IEEE ; F. Barrero,
Senior Member, IEEE;J.M. Milla, “An Enhanced Background Estimation
Algorithmfor Vehicle Detection in Urban Traffic Video”, Proceedings of
the 11th International IEEE Conference on Intelligent Transportation
Systems Beijing, China, October 12-15, 2008.
[5] S. Cheung and C. Kamath, Robust Techniques for Background Subtraction
in Urban Traffic Video, Video Communications and Image Processing,
SPIE Electronic Imaging, San Jose, January 2004.
[6] N. Kanhere, S. Pundlik, S. Birchfield, Vehicle Segmentation and Tracking
from a Low-Angle Off-Axis Camera, IEEE Conference on Computer
Vision and Pattern Recognition, San Diego, June 2005.
[7] M. Cristani, M. Bicegi, and V. Murino, “Integrated Region- and Pixel
based Approach to Background Modeling”, Proceedings of the
MOTION, 2002.
[8] H. Eng, J. Wang, A. Kam, and W. Yau, “Novel Regionbased Modeling
for Human Detection within High Dynamic Aquatic Environment,”
Proceedings on CVPR, 2004.
[9] M. Harville, G. Gordon, and J. Woodfill, “Foreground Segmentation
Using Adaptive Mixture Models in Color and Depth,” Proc. ICCV
Workshop Detection and Recognition of Events in Video, July 2001.
[10] R. Cucchiara, C. Grana, M. Piccardi, and A. Prati, “Detecting Moving
Objects, Ghosts, and Shadows in Video Streams,” IEEE Trans. on PAMI,
25: (10), October 2003.
[11] Connell, J., “Detection and Tracking in the IBM PeopleVision System,”
IEEE ICME, June 2004.
[12]Dongxiang Zhou, Hong Zhang and Nilanjan Ray, “Texture Based
Background subtraction,” Proc. IEEE Int. Conf. on Information and
Automation, Zhangjiajie, China, pp. 601-605, 2008.
[13]A. McIvor, “Background subtraction techniques,” in Proc. Image Video
Computing, pp. 147-153, 2000.
[14]Liyuan Li, Weimin Huang, Irene Yu-Hua Gu and Qi Tian, “Statistical
Modeling of Complex Backgrounds for Foreground Object

148
154

You might also like