ISSN ONLINE(2320-9801) PRINT (2320-9798)

Traffic Light Control System Using Image Processing

Kavya P Walad, Jyothi Shetty
  1. M.Tech 3rdSemester, Department of Computer Science and Engineering, Srinivas School of Engineering, Mukka, India
  2. Head of the Department, Department of Computer Science and Engineering, Srinivas School of Engineering, Mukka India
Related article at Pubmed, Scholar Google

Visit for more related articles at International Journal of Innovative Research in Computer and Communication Engineering


Traffic is the major problem which country faces today this is because of the increase in number of vehicles. The increase in number of vehicles resulting to the need of a smart system that could efficiently handle traffic congestion based on the density of traffic. This paper discusses about some of the existing traffic light control system and their drawback and image processing technique i.e. edge detection techniques that helps in finding traffic density. Here also discussing Sobel, Prewitt, and Robert, Canny edge detection and their advantages and disadvantage


Sobel, Prewitt, Robert edge detection


As the population of the modern cities is increasing day by day due to which vehicular travel is increasing which lead to congestion problem. Traffic congestion has been causing many critical problems and challenges in the major and most populated cities. The increased traffic has lead to more waiting times and fuel wastages. Due to these congestion problems, people lose time, miss opportunities, and get frustrated.
Traffic load is highly dependent on parameters such as time, day, season, weather and unpredictable situations such as accidents, special events or constructional activities. If these parameters are not taken into account, the traffic control system will create delays. To solve congestion problem new roads are constructed. The only disadvantage of making new roads on facilities is that it makes the surroundings more congested. So for that reason there is a need to change the system rather than making new infrastructure twice. A traffic control system can solve these problems by continuously sensing and adjusting the timing of traffic lights according to the actual traffic load is called an Intelligent Traffic control System. The advantages of building Intelligent Traffic Control System which reduce congestion; reduce operational costs; provide alternate routes to travellers, increases capacity of infrastructure. One such traffic control system can be built by image processing technique like edge detection to find the traffic density, based on traffic density can regulate the traffic signal light.
Digital image processing is meant for processing digital computer. It is the use of computer algorithm to perform image processing on digital images. It is a technology widely used for digital image operations like feature extraction, pattern recognition, segmentation, image morphology etc. Edge detection is a well developed field on its own within image processing. Edge is the important characteristic of image. Edges characterize boundaries and are therefore a problem of fundamental importance in image processing. Edges typically occur on the boundary between two different regions in an image. Edge detection allows user to observe those features of an image where there is a more or less abrupt change in gray level or texture indicating the end of one region in the image and the beginning of another. It finds practical applications in medical imaging, computer guided surgery diagnosis, locate object in satellite images, face recognition, and finger print recognition ,automatic traffic controlling systems, study of anatomical structure etc. Many edge detection techniques have been developed for extracting edges from digital images. There are two different edge detection operators: Gradient based classical operators like Robert, Prewitt, Sobel operator and Laplacian based operators like canny detection. Edge detection technique specially addresses the problem of image enhancement, segmentation, recognition and registration. It is also important research issue in computer vision and pattern recognition.


The following are the existing system used to control the traffic and there drawbacks are discussed below: AMicrocontroller is a devicethat control most things around us. The control of traffic lights is wellknown area where this type of control system is incorporated,which controls the four sets of traffic lights at the traffic crossing.But, the control is not flexible, based on the condition of trafficat the crossing. Rather, the on and off time periods are fixed forthe red, green and orange lights. These timing durations arevaried as per the day, the day of the week etc.
The traditional Vehicle-Actuated Control of isolated intersections attempts continuously to adjust green times. The main disadvantage is that the control algorithm looks only at the vehicles on green while not taking into account the number of vehicles waiting at red. The simplest type ofvehicle-actuated installation has a detector located at a distance A ahead of the stop line at an intersection approach, and a controller sensitive to signals sent by the detector. Simple traffic-actuated signals suffer from some of the same weakness as those of fixed-timed signals. They will work well if the actual traffic flow matches the flow assumed when the unit extension of green was selected.
Manual Controlling the name indicates it require man power to control the traffic. Traffic polices are allotted depending on the countries and states to control a required area or city traffic. The traffic polices will have things like sign board, sign light and whistle to control the traffic. They will be instructed to wear specific uniforms in order to control the traffic. In the manual controlling system more man power is needed. Since the strength of traffic police is poor it is not possible control traffic manually in all area of a city or town. The problems in the case of human traffic control are as follow:
• Only skilled operators can make suitable judgments and decision, because the situation is very complicated and many factors should be considered at control;
• The work load of skilled operators is very high, because they always make decisions according to traffic condition at very short time intervals;
• It is very difficult to improve the process of traffic control, because the actual process of the operators’ judgment is not described clearly.
Automatic Traffic Light is controlled by timers and electrical sensors. The lights are automatically getting ON and OFF depending on the timer value changes. While using electrical sensors it will capture the availability of the vehicle and signals on each phase, depending on the signal the lights automatically switch ON and OFF. In automatic traffic controlling, a traffic light uses timer for each phase. Another way is to use electronic sensors in order to detect vehicles, and produce signal that to this method the time is being wasted by a green light on an empty road. Traffic congestion also occurred while using the electronic sensors for controlling the traffic


Rather than using existing non-flexible traffic light controller can build flexible traffic light controller based on traffic density, traffic density can be find by using edge detection techniques. The criteria for edge detection and different edge detection techniques are discussed below:

Edge detection:

If consider gray scale image three types of discontinuities can be observed i.e. points, lines, edge. The easiest way is to use spatial masks which have properties to detect these discontinuities. More than isolated points and lines, the detection of edges that form an important part of image segmentation. An edge can be defined as a set of connected pixels that form a boundary between two disjoint regions. Edges come in an image because of variation of the discontinuities of the scene features, usually brightness, and give rise to edges. In other words, edges are representation of the discontinuities of the scene intensity function. There could be various reasons such as type of materials, surface texture, lighting conditions, etc., which play important role in forming these discontinuities. Edge can be described based on edge strength, edge direction and edge position. And different types of edges are step edge, ramp edge, roof edge, ridge edge.

A. Criteria for edge detection:

There are number of edge detection operators available, each designed to be sensitive to certain type of edges. The quality of edge detection can be measured from several criteria objectively. Some criteria are proposed in terms of mathematical measurement, some of them are based on application and implementation requirements .In all five cases a quantitative evaluation of performance requires use of images where the true edges are known.
 Good detection: There should be minimum number of false edges. Usually, edges are detected after a threshold operation. The high threshold will lead to less false edges, but it also reduces the number of true edges detected.
 Noise sensitivity: The algorithm can detect edges in certain acceptable noise environments.
 Good localization: The edge location must be reported as close as possible to the correct possible position, i.e. edge localization accuracy.
 Orientation Sensitivity: The operator not only detects edge magnitude, but it also detects edge orientation correctly. Orientation can be used in post processing to connect edge segments , reject noise and suppress nonmaximum edge magnitude
 Speed and efficiency: The algorithm should be fast enough to be usable in an image processing system. An algorithm that allows recursive implementation or separately processing can greatly improve efficiency.

B. Techniques for edge detection:

There are many ways to perform edge detection. However, the majority of different methods may be grouped into two categories (fig 1):

1. First order edge detection:

The first order or gradient method detects the edges by looking for the maximum and minimum in the first derivative of the image. The most well known conventional methods like Sobel, Prewitt, Robert operators are belong to gradient based edge detection technique.

Robert operator:

It is the gradient operator. The simple 2*2 Roberts operators were one of the earliest methods employed to detect edges. The Roberts cross calculates a simple, efficient, 2-D spatial gradient measurement on an image highlighting regions correspondingto edges. The Roberts operator is implemented using two convolution masks/kernels,each designed to respond maximally to edges running at ±45º to the pixel grid, which return the image x-derivative and y derivative, Gx and Gy respectively. The plus factor of Roberts cross operator is its simplicity but having small kernel it is highly sensitive to noise and not much compatible with today’s technology.

Sobel operator:

The Sobel operator performs a 2-D spatial gradient measurement on an image. It uses a pair of 3×3 convolution masks, one estimating the gradient in the x-direction (columns) and the other estimating the gradient in the y-direction (rows). These kernels are designed to respond maximally to edges running vertically and horizontally relative to the pixel grid, one kernel for each of the two perpendicular orientations. The kernels can be applied separately to the input image, to produce separate measurements of the gradient component in each orientation (Gx and Gy). These can then be combined together to find the absolute magnitude of the gradient at each point and the orientation of that gradient.
As compared to Robert operator have slow computation ability but as it has large kernel so it is less sensitive to noise as compared to Robert operator. As having larger mask, errors due to effects of noise are reduced by local averaging within the neighbourhood of the mask.

Prewitt operator:

The Prewitt filter is very similar to Sobel operator. The 3x3 total convolution masks is used to detect gradient in the X, Y directions .Prewitt filter is a fast method for edge detection The Prewitt/Sobel kernels are generally preferred to the Roberts approach because the gradient is not shifted by half a pixel in both directions and extension to larger sizes (for filter neighbourhoods greater than 3*3) is not readily possible with the Roberts operators. The key difference between the Sobel and Prewitt operators is that the Sobel kernel implements differentiation in one direction and (approximate) Gaussian averaging in the other. . It is only suitable for well-contrasted noiseless images. The advantage of this is that it smoothes the edge region, reducing the likelihood that noisy or isolated pixels will dominate the filter response.
Fig 2: Convolution mask used in Robert, Prewitt, Sobel operator to detect gradient in X and Y direction

2. Second order edge detection:

The second order or laplacian method searches for zero crossing in the second derivative of the image to find edges. In general, first-order edge filters are not commonly used as a means of image enhancement. Rather, their main use is in the process of edge detection as a step in image segmentation procedures. A much more common means of image enhancement is through the use of a second-order derivative operator: - the Laplacian. The second-order derivative property that allows the Laplacian to produce a fine edge response corresponding to a change in gradient, rather than the less isolated response of the first-order edge filters, makes it suitable as the first stage of digital edge enhancement. The most well known conventional methods like Laplacian edge detection and canny operators are belong to second order based edge detection.

Laplacian edge detection:

A very popular second-order derivative operator is the Laplacian. This can easily be implemented in a 3*3 kernel filter. The Laplacian is a 2-D isotropic measure of the 2nd spatial derivative of an image. The Laplacian of an image highlights regions of rapid intensity change and is therefore often used for edge detection. The Laplacian is often applied to an image that has first been smoothed with something approximating a Gaussian Smoothing filter in order to reduce its sensitivity to noise. Three commonly used small kernels are shown in below Figure.

Canny edge detection:

Canny described a widely used edge detecting algorithm which is optimal to step edges corrupted by noise. The canny edge detection algorithm was proposed to enhance the edge detection process. Three important criteria were taken into consideration for this purpose. The first and most important criterion was to detect all the important edges in the source image. This means the goal was to lower the error rate. The second criterion was that the edge points to be detected as close as possible to the true edge, also called as localization. A third criterion was not to have more than one response to a single edge. The Canny edge detector was thus implemented on these criteria. It first smooths the image to eliminate noise. Then the image gradients are calculated to point out those regions where the gradient difference is maximum, which have high spatial differences. Finally, it then tracks along these regions and discards any pixel that weakly defines an edge (non- maxima suppression) in order to make the edges thinner. To further reduce the gradient array, it performs hysteresis which tracks along the remaining pixels that have minimum gray level values but have not been suppressed. The Smoothing concept has been applied in this Gaussian operation, so the finding of errors is effective by using the probability. The next advantage is improving the signal with respect to the noise ratio and this is established by Nonmaxima suppression method as it results in one pixel wide ridges as the output. The third advantage is Better detection of edges especially in noise state with the help of thresholding method. The problem with Cranny’s edge detection is that his algorithm marks a point as an edge if its amplitude is larger than that of its neighbours without checking that the differences between this point and its neighbours are higher than what is expected for random noise. This technique causes the algorithm to be slightly more sensitive to weak edges, but it also makes it more susceptible to spurious and unstable boundaries wherever there is an insignificant change in intensity (e.g., on smoothly shaded objects and on blurred boundaries) . The major disadvantage is the computation of Gradient calculation for generating the angle of suppression. The main disadvantage is Time consumption because of complex computation.


Edge detection finds practical applications in medical imaging, computer guided surgery diagnosis, locate object in satellite images, face recognition, and finger print recognition ,automatic traffic controlling systems, study of anatomical structure etc. Many edge detection techniques have been developed for extracting edges from digital images. Each edge detection techniques have their own advantages and disadvantages in different areas of application.


In this paper discussed about existing traffic control system and their drawback, to overcome from those drawbacks can build a flexible traffic light control system based on traffic density. To find traffic density edge detection techniques can be used. The edge detection is a well known technique in image processing in identifying an image object, image segmentation, image enhancement. Each edge detection techniques have its own advantages and disadvantages in various fields. Gradient- based or first order edge detection and laplacian based or second-order edge detection operators are discussed in this paper can be implemented in MATLAB. There are so many drawbacks with Gaussian–based edge detection is sensitive to noise. This is because of using static dimension of kernel filer and its coefficients. The canny edge detection gives best performance even in noise condition compare to other first order edge detection. This canny edge detection algorithm is more costly in comparing to Sobel, Prewitt and Robert’s operator. The main disadvantage with canny edge detection is high computation time and responsible to weak edges.A best edge detection algorithm is necessary to provide an errorless solution. In future rather than using existing edge detection techniques can use fuzzy logic and morphological based edge detection technique for regulating traffic light control system based on traffic density to save the time and to reduce operating cost.


1. Arvind B.K And Dinesh S, Arun Karthik S And Ganga Ambrish ”Traffic Gridlock Control Using Canny Algorithm Aided By Fuzzy Logic” 3rd International Conference On Advanced In Computing And Emerging Elearning Technologies ( ICAC2ET 2013 ) – Singapore On November 6 – 7, 2013

2. Madhvi Arora, V.K Banga,”Real time traffic light control system using morphological edge detection and fuzzy logic”, 2nd International Conference on Electrical, Electronics and Civil Engineering, April, 2012.

3. Wei zhi Wang, Bing-han Liu, “The Vehicle Edge Detection Based On Homomorphism Filtering And Fuzzy Enhancement In Night Time Environments”, IEEE International Conference, 2010.

4. G.T. Shrivakshan and Dr.C. Chandrasekar “ A Comparison of various Edge Detection Techniques used in Image Processing”IJCSI International Journal of Computer Science Issues, Vol. 9, Issue 5, No 1, September 2012

5. Chris Solomon and Toby Breckon “ Fundamentals of digital image processing : a practical approach with examples in MATLAB”2011 by John Wiley & Sons, Ltd

6. R .Gonzalez and R. Woods, Digital Image Processing2002 by Prentice-Hall, Inc Upper Saddle River, New Jersey 07458.

7. P.Srinivas,Y.L. Malathilatha,Dr. M.V.N.K Prasad“Image Processing Edge Detection Technique UsedFor Traffic Control Problem”(IJCSIT) International Journal of Computer Science and Information Technologies, Vol. 4 (1) , 2013, 17 - 20

8. Sharma, B., Katiyar, V.K., Gupta, A.K. and Singh, A. (2014) The Automated Vehicle Detection ofHighway Traffic Images by Differential Morphological Profile. Journal of Transportation Technologies, 4, 150-156.