Density Based Smart Traffic Control System Using Canny Edge Detection
Density Based Smart Traffic Control System Using Canny Edge Detection
https://doi.org/10.22214/ijraset.2023.50271
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
Abstract: As the problem of traffic congestion intensifies, there is a pressing need for the introduction of advanced technology
and equipment to improve state-of-the-art of traffic control. The current methods used such as timers or human control are
proven to be inferior to alleviate this crisis. In this paper, a system to control the traffic by measuring the real-time vehicle
density using canny edge detection with digital image processing is proposed. This imposing traffic control system offers
significant improvement in response time, vehicle management, automation, reliability and overall efficiency over the existing
systems. The ambulances are detected using YOLO where the minimal waiting time is allotted to the lane. Besides that, the
complete technique from image acquisition to edge detection and finally green signal allotment.
Keywords: Traffic Control, Canny Edge Detection, YOLO
I. INTRODUCTION
The major cause leading to traffic jam is the high no of vehicles which was caused by the population and the development of
economy Recently a look at of global wide financial institutions has said that the car's common velocity has reduced from
21km to 7km in line with hour with inside the remaining 10years [1]. As more and more vehicles are commissioning in an already
congested traffic system, there is an urgent need for a whole new traffic control system using advanced technologies to utilize the
already existent infrastructures to its full extent. Since building new roads, flyovers, elevated expressway etc. needs extensive
planning, huge capital and lots of time; focus should be directed upon availing existing infrastructures more efficiently and
diligently. The traffic lights that are in widespread use today do not do much complex reasoning when deciding when to change the
lights for the various road users waiting in different lanes. How long the signal stays green in one lane and red in another is most
often determined by simple timing that is calculated when the crossing is designed. Even though today’s methods are robust and
work well when the traffic load is distributed evenly across the lanes in the intersection, the systems are very inefficient because
they are unable to handle various simple situations that arise throughout the day. Unnecessary waiting time in the signal can be
avoided by determining in which side the green signal should be large during traffic. Many methods had been followed over the
years such as Manual controlling, as the name says it require man power to control the traffic. Depending on the countries and states
the traffic polices are allotted for a required area or city to control traffic. The traffic polices will carry sign board, sign light,
particular uniform and whistle to control the traffic. Automatic traffic light is controlled by timers and electrical sensors. In traffic
light each phase a constant numerical value loaded in the timer. 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. the traffic light by image processing. The vehicles are detected
by the system through images rather than electronic sensors. A camera will be placed alongside the traffic light. It will capture
images in sequence [2].
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1024
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
S. Lee's research on the system uses a camera-based density measurement method to estimate traffic flow and detect traffic
congestion. The density measurement method uses the number of vehicles passing through a certain area over a period of time to
estimate traffic flow. The system also uses Canny edge detection to detect the presence of vehicles at intersections and estimate their
speed and direction of movement [4].
P. Ramya research on The system consists of three main modules: image processing, fuzzy logic control, and signal control. The
image processing module uses Canny edge detection to detect the edges of vehicles in real-time video footage captured by cameras
installed at intersections. The fuzzy logic control module then uses the edge density information to determine the appropriate signal
timings based on the traffic volume and congestion level [5].
H. Jahanbakhsh research on The Canny edge detection algorithm is used to extract the edges of vehicles in the video input, which
are then passed to an ANN to estimate the number of vehicles in each lane and their speeds. This information is then used to
dynamically adjust the signal timings to optimize traffic flow [6].
V. Rajkumar proposes a smart traffic control system that uses Canny edge detection and image processing techniques to detect and
classify vehicles, estimate traffic flow, and optimize traffic signal timings. The system is designed to improve traffic flow and
reduce congestion on urban roads. The proposed system includes a camera-based vehicle detection module that uses Canny edge
detection and morphological operations to extract vehicle features and classify them using machine learning algorithms [7].
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1025
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
Here, in figure 1, the block diagram for proposed traffic control technique is illustrated Each lane will have a minimum amount of
green signal duration allocated. According to the percentage of matching allocated traffic light duration can be controlled. The
matching is achieved by comparing the number of white points between two images. Before that the image is detected using YOLO
technique. The entire image processing before edge detection i.e., image acquisition, RGB to gray conversion, Image Enhancement
and canny edge detection operation and white point count are depicted. Canny edge detector operator is selected because of its
greater overall performance. Percentage matching for different sample images and traffic time allocation.
The Canny edge detection technique is an image processing algorithm used to detect edges in digital images. The Canny edge
detection algorithm involves the following steps:
1) Gaussian Blur: The image is first blurred using a Gaussian filter to reduce noise and remove small details.
2) Gradient Calculation: The gradient magnitude and direction are calculated using Sobel, Scharr or Prewitt operators.
3) Non-maximum Suppression: The gradient magnitude is then thinned to a single pixel wide edge by suppressing non-maximum
values in the gradient direction.
4) Double Thresholding: Two thresholds, a low and high threshold, are used to determine which edges are strong and which are
weak. Pixels with gradient magnitudes above the high threshold are considered strong edges, while those between the low and
high threshold are considered weak edges.
5) Edge Tracking by Hysteresis: Weak edges are only considered part of an edge if they are connected to a strong edge. This is
done by tracing the edge in both directions from the strong edge.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1026
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
The output of the Canny edge detection algorithm is a binary image where the edges are represented by white pixels and the rest of
the image is black.
IV. IMPLEMENTATION
The block diagram of the project was discussed in previous chapter. The algorithm behind the block diagram consists of following
steps.
The gradient magnitude and direction of each pixel are computed by calculating the partial derivatives of the image in the x and
y directions using filters. This step helps identify areas with a high rate of change in intensity, which correspond to edges of the
image.
A high and low threshold value are set so that Pixels with gradient magnitudes above the high threshold are marked as strong
edges, while pixels with gradient magnitudes below the low threshold are discarded as non-edges. Pixels with gradient
magnitudes between the low and high thresholds are marked as weak edges, which are retained only if they are connected to
strong edges. This step helps distinguish between noise and actual edges.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1027
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
As in Table 1, Time allocated to green signal is governed by the percentage of matching of consecutive lanes. The proposed time
allocation is based on assumption.
As shown in Figure 4, We should upload the traffic image by clicking on the upload traffic image button. It uploads the image.
As shown in Figure 5, by Clicking detect image the vehicles are detected by YOLO with image popped up.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1028
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
As shown in Figure 6, Then clicking on the Image preprocessing using canny edge detection Then the image will be preprocessed
and the image gets changed and we will get the canny edged image.
As shown in Figure 7, Clicking on the White pixel count to get the count of white pixels of sample and reference image to
comparison.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1029
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
As shown in Figure 8, Click on the calculate green signal time allocation to get the time period which is displayed according to the
vehicle density count. According to the image that we have uploaded the time period is calculated with respective to white pixel
count.
As shown in Figure 10, If the ambulance is detected then irrespective of the white pixel count the waiting time for the ambulance
will be 10 sec
VI. CONCLUSION
In this paper, a smart traffic control system availing image processing as an instrument for measuring density has been proposed.
Besides explaining the limitations of the current near-obsolete traffic control system, the advantages of the proposed traffic control
system have been done. For this purpose, four sample images of different traffic scenarios have been attained. Upon completion of
edge detection, the similarity between the sample images with the reference image has been calculated. The ambulance when
detected gives less waiting time. Using this similarity, time allocation has been carried out for each individual image in accordance
with the time allocation algorithm. In addition, similarity in percentage and time allocation has been illustrated for each of the four
sample images using Python programming language.
VII. ACKNOWLEDGEMENT
We thank CMR Technical Campus for supporting this paper titled “Density Based Smart Traffic Control System Using Canny Edge
Detection”, which provided good facilities and support to accomplish our work. Sincerely thank our Chairman, Director, Deans,
Head of the Department, Department of Computer Science and Engineering, Guide and Teaching and Non- Teaching faculty
members for giving valuable suggestions and guidance in every aspect of our work
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1030
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 11 Issue IV Apr 2023- Available at www.ijraset.com
REFERENCES
[1] A Anjani, "Density Based Smart Traffic Control Using Canny Edge Detection Algorithm", JOURNAL OF ALGEBRAIC STATISTICS Volume 13, No. 3,
2022
[2] A.J. Shakadwipi, "Smart Traffic Control System by Using Image Processing", IOSR Journal of Computer Engineering Volume 22, Issue 6, 2020
[3] Taqi Tahmid, "Density Based Smart Traffic Control System Using Canny Edge Detection Algorithm for Congregating Traffic Information", EICT, 2017
[4] S. Lee, "Density Based Smart Traffic Control System Using Canny Edge Detection Algorithm", 2021
[5] P. Ramya, "Smart Traffic Control System Based on Canny Edge Detection and Fuzzy Logic",2017
[6] H. Jahanbakhsh, "Real-Time Traffic Control Using Canny Edge Detection and Artificial Neural Networks", 2017
[7] V. Rajkumar, "Smart Traffic Control System Based on Canny Edge Detection and Image Processing", 2019.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 1031