0% found this document useful (0 votes)
73 views

Density Based Traffic Control System Using Image Processing: November 2018

The document describes a density-based traffic control system using image processing. A webcam is used at each traffic light to capture images of the road. These images are processed using MATLAB to count the number of vehicles present. The vehicle count is then used to dynamically allocate timing for the traffic lights based on traffic density, displaying a green light for longer if there are more vehicles detected. The system represents green and red lights with LEDs and counts down the duration of the green light on a seven segment display. It provides an alternative to traditional timer-based systems that can waste time by showing a green light when no vehicles are present.

Uploaded by

kota naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Density Based Traffic Control System Using Image Processing: November 2018

The document describes a density-based traffic control system using image processing. A webcam is used at each traffic light to capture images of the road. These images are processed using MATLAB to count the number of vehicles present. The vehicle count is then used to dynamically allocate timing for the traffic lights based on traffic density, displaying a green light for longer if there are more vehicles detected. The system represents green and red lights with LEDs and counts down the duration of the green light on a seven segment display. It provides an alternative to traditional timer-based systems that can waste time by showing a green light when no vehicles are present.

Uploaded by

kota naik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/329235731

Density Based Traffic Control System Using Image Processing

Conference Paper · November 2018


DOI: 10.1109/ICETIETR.2018.8529111

CITATION READS
S
7,512
6

3 authors, including:

Arun A. Balakrishnan
Cochin University of Science and Technology
22 PUBLICATIONS 81 CITATIONS

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

machine learning, pattern recognition View project

NRB Underwater Imaging Project View project

All content following this page was uploaded by Arun A. Balakrishnan on 28 November 2018.

The user has requested enhancement of the downloaded file.


Density Based Traffic Control System Using
Image Processing
1 2 3 4
Uthara E. Prakash , Athira Thankappan , Vishnupriya K. T. , Arun A. Balakrishnan
Department of Electronics
Cochin University of Science and Technology, India
1 2 3
uthara21@gmail.com, athiraquest@gmail.com, vishnupriyavalsan@gmail.com,
4
arunab@cusat.ac.in

Abstract - In this paper, a novel real-time traffic control system using a timer (Seven Segment Display) and LEDs instead of
which can easily keep traffic in control using image processing real traffic lights.
techniques is presented. In this method, a webcam is used in each
stage of the traffic light in order to take pictures of the roads where II. EXISTING METHODS
traffic is bound to occur. Count of vehicles in these images is
calculated using image processing tools in Matlab and different
timings are allocated according to the count along with a green Many types of traffic control systems have been introduced in
signal for vehicles to pass. In the proposed prototype, the green and order to find the density of vehicles on road. A system in
red signals are represented using LEDs and the decrementing timer which the total size of the traffic can be calculated using
for the green signal is represented by a seven segment display.
image processing methods is discussed in [1]. Another similar
Keywords – Traffic light control, image processing, system proposed controls traffic lights using image processing
foreground detection, vehicle count, timer techniques which can be implemented in real time [2]. A web
camera is used at each stage of the traffic light to record
images of the traffic lane we have selected. These captured
I. INTRODUCTION
images are then compared to a reference image of the empty
With the uncontrolled population growth, travelling has turned road by image matching process. Canny edge detection
out to be a really hectic task in today’s world. The increase in method is used to determine the boundaries of the images.
travelling people has caused a drastic growth in traffic at Here, the traffic is controlled depending on the percentage of
every nook and corner of the city. This, in turn, is contributing match between the images. There are many papers based on
to the wastage of precious fuel and time which leads to edge detection methods [3]. Another system uses a video
impatience and frustration of the people. Traffic congestion is camera to capture images of the road and make use of that
a common problem that has arisen due to the increased
data to control traffic signals [4]. Instead of finding the total
number of vehicles on the road. In order to deal with this
problem, researchers have proposed many solutions. One of number of vehicles, they determine the traffic density
the currently used models is the timer model. Traffic can be corresponding to the total area occupied by vehicles on the
controlled to a great extent by using timers at each phase of road with respect to the total amount of pixels in one video
the traffic. Another model used is with the help of electronic frame. In [5], a similar approach for traffic control system is
sensors which detects the presence of vehicles, and produce also proposed.
appropriate signals. The cause of traffic is dependent on many
factors like peak time, special days, season, bad weather, or Manual controlling refers to controlling traffic with the help
unexpected events like accidents, special events or of manpower. Traffic police are allotted to a specified area to
constructional activities. Once we get stuck in traffic, we may control traffic. Controlling traffic signals using timers and
have to wait for hours to get out of it. We can solve this electrical sensors is known as automatic controlling. In this
problem to a great extent by implementing this density based method, a constant numerical value is uploaded into the timer
traffic control system using image processing which at each phase of the traffic light. According to the changes in
continuously manages the traffic lights based on traffic. This the timer value, the traffic lights automatically becomes ON or
system uses image processing techniques such as background OFF. The electrical sensors check for the presence of vehicles
subtraction in order to find the count of vehicles present on on the road and provide appropriate signals at each phase,
the road (traffic density) which can be used to control the which controls the automatic switching off lights. The manual
traffic signal light. The image processing tools which are controlling system requires tremendous manpower for
present in Matlab can be used to program the code for finding implementation. Since the number of traffic police is limited
the count of vehicles in a lane. This idea can be represented and making them do this sort of work in the hot tropical areas
is cruel. We need to find a better method to control traffic in Our proposed system controls traffic lights using image
the cities. In automatic traffic controlling system, the traffic processing techniques. Here, the vehicles are detected by
light is controlled by timers at every stage or by using considering the captured images instead of using timers or
electronic sensors to detect the presence of vehicles. But in electronic sensors which are placed on the pavement. A web
these methods, time could be wasted in showing a green camera is placed at the traffic light which captures images of
signal when there are no vehicles at all. We can get over these the road through which the vehicle count is estimated and
limitations by controlling traffic lights with the help of image traffic is controlled. Using image processing in traffic control
processing techniques. is found to be a better technique than the existing methods. It
helps decrease traffic congestion without any wastage of time
caused by showing green signal on an empty road without any represented using 256 levels varying from 0 to 255. The
vehicles. It is a better way to determine the presence of greyscale values are obtained as a weighted average of the
vehicles since it makes use of real-time images which makes it individual R, G and B components as in (2).
better than systems depending on the vehicle’s metal content
only. .0.3R + 0.59G + 0.11B (2)
III. PROPOSED SYSTEM

The proposed system is implemented in Matlab with an


objective to reduce the traffic based on density. Four main
steps are considered for the system: a) image acquisition b)
RGB to grayscale transformation c) image enhancement and
d) morphological operations. A camera is installed and used to
capture video of the highway. The video is recorded
continuously in consecutive frames and each frame is
compared to the initial captured image. The total number of
cars present in the video is found out using image processing
algorithms. If the total number of cars exceeds a predefined
threshold, heavy traffic status is displayed as a message. The
block diagram of our proposed model is shown in Fig. 1.

A. Image Acquisition
The first step in the process of image processing is the
acquisition of the image. Generally, an image is considered to
be a two-dimensional function ��(��, ��) where a
and b are spatial coordinates [6]. The value of the function
at any point is known as the intensity, also known as the Fig. 1 Block Diagram of Density Based Traffic Control System Using Image
grey level of the image at that point. These a and b values Processing
must be converted to finite discrete values in order to form a
digital image which is necessary to process through a digital C. Image Enhancement: Image enhancement is the process of
computer. Each digital image is composed of pixels which adjusting the pixel values of an image either in the spatial
are finite elements. A webcam is used for capturing video domain or in the frequency domain to improve the visual
and frames are extracted to obtain images. The intensity perception of the captured image. Image enhancement tools in
values are proportional to the radiated energy by a physical Matlab are used to obtain the grayscale version of the captured
source. Hence pixel values must be nonzero and finite. image with proper contrast and better quality. Image
0 < ��(��, ��) < ∞ enhancement techniques used in the proposed method include
(1) noise removal using Wiener filter, Blob analysis and dilation.
D. Thresholding
B. RGB to Gray Conversion Image thresholding is a simple and effective method to
The colour images are in RGB format. In grayscale images, differentiate an image into foreground and background. It’s a
each pixel is represented using 8 bits and pixel values are segmentation process used to isolate objects from the
background. If the histogram of the image is bimodal [7], a
single global threshold can be used for segmentation.
Automatic determination of the threshold value for each
captured traffic image is done using Otsu’s algorithm as
discussed below.

1. Select an initial estimate for the global threshold


value T.
2. Segment the image using threshold T. This will
produce two groups of pixels, P1 consisting of all
pixels with intensity values > T, and P2 consisting of
all pixels with values ≤ T.
3. Compute the average (mean) intensity values a1 and
a2 for the pixels in P1 and P2 respectively.
4. Compute a new threshold value:
1
Tnew = 2 (𝑎1 + 𝑎2) (3)
5. Repeat steps 2 to 4 until the difference between the and detecting changes which occur in the other images with
two values of threshold in successive iterations is respect to the reference image. Defining the background
smaller than a predefined parameter ∆T. becomes challenging when the image contains shapes,
shadows, and moving objects. A good foreground detection
E. Foreground Detection: The aim of foreground detection is system must be able to develop a good background model and
to detect changes occurring in the image sequences. be robust to changes in lighting, repetitive movements (leaves,
Foreground detection is done to separate these changes taking waves, shadows), and long-term changes. Here the foreground
place in the foreground from the background. All detection is detected using the automatically generated threshold value
techniques are based on setting a reference background image found out using Otsu’s principle.
Software Module: MATLAB version R2016a is used as the
I. Vehicle Counting: There are many methods presently in use image processing software which comprises specialized
to detect vehicles on road such as motion detectors, modules that perform specific tasks. Matlab coding is
installation of lasers on both sides of the road, etc., which completed using the reference and captured images.
increases the hardware requirements. Our proposed system
makes use of Otsu’s Principle with image processing Interfacing: A webcam is interfaced to the system and
techniques to count the number of vehicles on road and hence Arduino is interfaced to Matlab using serial communication.
estimate the density. The count of vehicles found can be used
for controlling the traffic signal. To count the numbers of The algorithm behind the block diagram consists of the
vehicles, two input images are given, one of the blank road following steps.
and the other with the vehicles on the road. The input image is
then converted from RGB to greyscale. Now the two images 1. Start program
are compared and the difference is taken using background 2. Capture image of the blank road by the connected
subtraction and the difference image is converted into binary camera module for reference
3. Capture image with vehicles
form. The blobs in the binary image are opened only when the
4. The images are converted from RGB to grey
blob area is greater than 2000. Using Matlab, the exact
5. A threshold value is found using Otsu’s principle
number of vehicles, are determined and the count is displayed
6. Find the difference between frames using threshold
using a seven segment display.
7. Add Gaussian noise to the difference output
J. Time Allocation: Once the number of vehicles is found out, 8. Apply Weiner filter to it to filter the blobs
9. Convert to binary image
then time allocation is done based on the count. Time
10. Fill holes to the blobs
allocation is indicated using LEDs which are connected to our
11. Open all blobs having an area greater than 2000
circuit. Also, a Seven Segment Display screen is attached to
12. Determine the number of cars
display the time allotted. When the count of cars is greater
13. Display the output image
than 1 and less than 5, the timer shows 5 seconds and LED
14. The count of vehicles is found and displayed.
blinks for 5 seconds. When the count of cars is greater than 5
15. According to the number of vehicles, green light is
and less than 10, then the timer shows 10 seconds and LED
allotted for different timings for each count displayed
blinks for 10 seconds.
by a seven segment
IV. IMPLEMENTATION
V. EXPERIMENTAL RESULTS
The main parts required for this system are hardware,
interfacing and software module [8].

Hardware Module: A USB based web camera to capture


images of the traffic on road. The hardware module consists
of an Arduino board used to control LEDs representing the red
and green lights. A timer module is used to display the
remaining time.

Fig. 2. Implementation Results (a) Captured image (b)


Background image used as a reference (c) Foreground image (d)
Foreground image after enhancement techniques
Simulation results of the proposed system are shown in Fig. 2. The weather conditions are not taken into account which may
Fig. 2(a) shows the captured image of the road with two cars, affect the image quality when it becomes foggy or in heavy
Fig. 2(b) indicates the road without vehicles, Fig. 2(c) rains. More advancements can be made to the proposed
represents the segmented image and output image after system to check identification of vehicles that pass through
enhancement is shown in Fig. 2(d). the system circle which could help in traffic surveillance.

VII. CONCLUSION
VI. FUTURE WORKS
An efficient density based traffic control system is simulated
and implemented which provides a good traffic control
mechanism without time wastage. It is also a much better way REFERENCES
of detecting the presence of vehicles on the road since it
makes use of image data. So it surely operates much better [1] Pezhman Niksaz, Science &Research Branch, Azad University of Yazd,
than systems which rely on the metal content of the vehicles Iran, "Automatic Traffic Estimation Using Image Processing ",2012
to detect their presence. Image processing techniques International Conference on Image, Vision and Computing.
overcome the limitations of the all the traditional methods of [2] Chandrasekhar. M, Saikrishna. C, Chakradhar. B, Phaneendra Kumar. P
traffic control. It eliminates the need for extra hardware and & Sasanka. C. “Traffic Control Using Digital Image Processing”, IJAEEE,
sensors. The use of multiple cameras will help to analyze and ISSN (Print): 2278-8948, Vol-2, Issue-5, 2013.
control traffic in a particular region. The proposed system
[3] Gundeep Kaur, Sonia Sharma,” Traffic Management Using Digital
outperforms the existing system in terms of accuracy and Image Processing”, IJCST Vol. 8, ISSue 2, AprIl - June 2017.
simplicity.
[4] Md. Munir Hasan, Aminul Hoque, Gobinda Saha, and Md. Badruddoja
Majumder. “Smart Traffic Control System with Application of Image
Processing Techniques”, 3rd International Conference on Informatics,
Electronics & Vision 2014.

[5] Anil Vishwasrao, Omkar Ramdas Gaikwad, Prof. Kanchan Pujari, Tejas
Talathi, “Image Processing Based Traffic Light Control”, International
Journal of Science, Engineering and Technology Research (IJSETR) Vol 3,
Issue 4, April 2014.

[6] K.M.M. Rao, “Overview of Image Processing”, Proceedings of a


workshop on image processing and pattern recognition, IETE, Hyderabad,25-
26 September 2004.
rd
[7] Rafael C. Gonzalez, Richard E. Woods, Digital Image Processing, 3 ed.
2008.

[8] Vismay Pandit, Jinesh Doshi, Dhruv Mehta, Ashay Mhatre and Abhilash
Janardhan, “Smart Traffic Control System Using Image Processing”,
International Journal of Emerging Trends & Technology in Computer Science
(IJETTCS), Vol 3, Issue 1, January – February 2014.

View publication stats

You might also like