Traffic Signal Violation Detection System

Published Sep 14, 2021
 15 hours to build
 Beginner

This system can detect traffic light violation in real-time. A user friendly graphical interface is associated with the system to make it simple for the user to operate the system, monitor traffic and take action against the violations of traffic rules.

display image

Components Used

Anaconda Navigator
Controller path
1
Python
for backend scripting
1
Description

System Overview

Figure-1: Flow diagram of traffic signal violation detection system.

 The System consists of two main components - 

  • Vehicle detection model
  • A graphical user interface (GUI)

First the video footage from the road side is sent to the system. Vehicles are detected from the footage. Tracking the activity of vehicles, system determines if there is any violation or not. Figure 1 shows how the system works. 

The Graphical User Interface (GUI) makes the system interactive for the user to use. User can monitor the traffic footage and get the alert of violation with the detected bounding box of vehicle. User can take further action using the GUI.

Implementation

  1. Computer Vision - OpenCV is an open source computer vision and machine learning software library which is used in this project for image processing purpose. Tensorflow is used for implementing the vehicle classifier with darknet-53.
  2. Graphical User Interface (GUI) - After opening a video footage from storage, the system will get a preview of the footage. The preview contains a frame from the given video footage. The preview is used to identify roads and draw a traffic line over the road. The traffic line drawn by administrator will act as a traffic signal line.
  3. Selecting the region of interest will start violation detection system. The coordinates of the line drawn will be shown on console (Figure-2). The violation detection system will start immediately after the line is drawn. At first the weights will be loaded. Then the system will detect objects and check for violations. The output will be shown frame by frame from the GUI (Figure-3).
Figure-2: Line Coordinates
Figure-3: Final Output

       4 .The system will show output until the last frame of the footage. In background a ‘output.mp4’ will be generated. The file will be in ‘output’ folder of ‘Resources’. The process will be immediately terminated by clicking ‘q’. After processing a video footage, the administrator can add another video footage from the initial file manager. If the work is complete the administrator can quit using ‘Exit’ item from File option.

The overall flow of the software:

Figure-4: Overall flow of the software

 

Result and Conclusion

The designed algorithm was effectively able to detect the type of violation specified on this project which are denying traffic signal. The convergence of detection for the traffic violation mentioned is dissimilar, since it has a different threshold condition. The system provides detection for traffic signal violation. Further, the system is able to process one data at a time.

 

Codes

Downloads

Capture Download
Comments
Ad