Traffic Light Controller using Image Processing

Traffic congestion at junctions is a serious issue on a daily basis. The prevailing traffic light controllers are unable to manage the different traffic flows. Most of the current systems operate on a timing mechanism that changes the signal after a particular interval of time. This may cause frustration and result in motorist's time waste. Traffic congestion is a major problem in the currently existing systems. Delays, safety, parking, and environmental problems are the main issues of current traffic systems that emit smoke and contribute to increasing Global Warming. Sensor-based systems reduce the waiting time and maximize the total number of vehicles that can cross an intersection. Our proposed system can control the traffic lights based on image processing without the need for traffic police. This can reduce congestion, delay, road accidents, need for manpower. Under image processing, we use sub techniques like RGB to Gray conversion, Image resizing, Image Enhancement, Edge detection, Image matching, and Timing allocation. A real-time image is captured for every 1 second. After edge detection procedure for both reference and real-time images, these images are compared using SURF Algorithm. Then the amount of traffic is detected and the details are stored in the server. Arduino is used for a traffic signal in the hardware part. It consists of a Wi-Fi module. The micro-controller used in the system Arduino. Four cameras are placed on respective roads and these cameras are used to capture images to analyze traffic density. Then the traffic signals are decided according to the density of traffic. Our technique can be effective to combat traffic on Indian Roads. A lot of time can be saved by deploying this system and also it conserves a lot of resources as well as the economy


Introduction
Traffic congestion leads to a progressive reduction in traffic speeds, resulting in an increase in journey times, fuel consumption, other operating costs, and environmental pollution contributing to global warming. Traffic congestion has become a serious problem in recent days due to the increased number of vehicles and the need for people to travel more for work and vacation. It may bring stress to people, and makes them get stuck in traffic. It also makes people take longer to reach their destination. These problems of congestion are suffered not only by the motorists but also by the users of public transport, generally lower-income persons who have to pay higher fares on account of congestion.
Another major consequence of traffic congestion is that an ambulance or a fire truck is unable to respond in an awaited time. People may encounter trouble with their important work due to traffic jams. This may lead to personal as well as professional drawbacks. Traffic congestion can also cause an impact on the mind of a person because of the constant blowing of horns and frustration. Various measures have has been proposed by the government to overcome the traffic jam problem by imposing parking restrictions and adopting traffic signal rules. The existing traffic light control approaches are time-dependent instead of the vehicle density on the road. It postulates manual handling which causes congestion and longer waiting time. This hesitation in waiting time produces traffic jams and creates more smoke emission. Thus, a traffic light control system based on image processing is the optimal solution for traffic congestion.

Traffic Light Control
Traffic lights are signals that are used to control the movement of vehicles on the road. This traffic signal when effectively monitored can control the traffic on the road and avoid congestion. The traffic light on the road comprises of 3 signals-red, yellow and green. People are made to hold back for the green signal to further proceed. Delay in the red signal cause longer waiting time because of congestion. CCTV cameras are installed at almost all junctions on the urban cities and accident-prone and traffic-prone areas. This would enhance traffic maintenance and help police book violators. With the help of these CCTV cameras, we can calculate the density of vehicles on the road. Image processing is the use of computer algorithms to perform image processing on digital images. This technique controls the traffic light signals on the road in order to avoid unnecessary traffic congestion.

Methodology A. Existing Methods
There are numerous procedures proposed already for traffic monitoring to avoid the traffic jam on the road. The previously practiced traffic control system in most of the cities is based on fixed time control or manual control. However, the new implementations in a few cities focus on the implementation of the 'Adaptive Traffic Control System' (ATCS). In this system, with the help of traffic detectors, the traffic density is obtained from all approaches of 1 intersection of the road. The traffic light control time-dependent system has a fixed period to switch traffic between different directions. The traffic lights turn ON and OFF by itself based on the timer value. Consequently, the vehicles are made to wait for a longer period even on the empty road, or if the traffic density is very less. Using sensors is another way to control traffic by detecting the number of vehicles. Another most common strategy to control traffic is manual controlling. Manual controlling involves the need for traffic police. The traffic signals can be changed by the police manually based on the vehicles and traffic flow on the road by himself.

B. Issues in Existing Methods
A time-based traffic control system is one of the common methodologies or techniques to control traffic. But this methodology is contingent on time rather than on density. On account of this, the vehicles have to encounter an erratic delay in waiting time. The vehicles are made to wait even on the empty road in a time-based traffic control system which can again contribute congestion or traffic jam. Sensors can be used to detect vehicles and control traffic accordingly. But even in this method, the time is wasted by the green light on an empty road. Manual controlling engages the need for traffic police to change the traffic signals accordingly. This method also requires manpower. Although abundant methods are present already to control traffic, these methods can still bring on congestion due to disparate reasons. A traffic light control system based on the image processing technique can handle the problem of traffic congestion more effectively.

C. Proposed method
a. CCTV Camera The proposed system adopts the traffic light signal according to the real-time traffic density using image processing techniques. This model uses CCTV cameras to sense the changing traffic patterns around the traffic signal and manipulates the traffic signals accordingly by triggering the signals to the traffic control system. The modifications in traffic jams directly rely on the control of traffic flow, and hence on the traffic signal. In view of the fact that CCTV cameras are operational at almost every junction these days, it can be used to control traffic and keep clear of unwanted congestion.
b. Arduino UNO Arduino Uno is used for exchanging information with a computer, another Arduino board, or other microcontrollers. It consists of 14 digital input/output pins.
c. WIFI Module The Arduino Uno WIFI is an Arduino Uno with an ESP8266 WIFI module.
A. System Architecture The system that we put forward consists of a CCTV camera that is used to capture the reference image and the actual image. These images are stored in a database. It is later retrieved from database and Image process techniques are applied and are feed into Aurdino.IR signals are passed via the Wi-Fi module to Arduino. Arduino changes the traffic lights accordingly.
B. Functional Architecture In our proposed system, the reference image of an empty road is taken and the real-time traffic on a road is captured as an actual image. They are stored in the database and the data is extracted using data extraction tools. Image processing techniques like RGB to Grayscale conversion, Image resizing, Image enhancement, Edge detection are used and applied to both the images. Image matching for both the images is done and the percentage of matching is done using the SURF algorithm. The IR signals are sent to the Wi-Fi Module, connected to Arduino. Arduino navigates and controls the LED and shifting of lights, using a timing mechanism.
List of Modules:

Navigation and Control of Signals
Using time allocation, 1) If the matching lies between 0 to 30% -green light is turned on for 90 seconds.
2) If the matching lies between 30 to 50% -green light is turned on for 60 seconds.
C. Image matching and final output

Conclusion
This paper develops a framework that uses the image processing technique to avoid traffic congestion and delays effectively. The system could primarily focus on the image captured using a CCTV camera. This proposed system attempted to identify traffic density and control the signals. The implementation of the SURF algorithm helped us to obtain higher accuracy. Installation of this system is simple and eliminates human and complex machinery, therefore it is cost-effective. Overall, this system gives higher accuracy.
Various upgrades on the system are predicted with more customization that could be adapted for many applications. The system can be enhanced with ambulance notification and accident detection.