# Traffic Signal Violation Detection System using Computer Vision
![Violation_Detection_Frame](Images/Violation_Detection_Frame_Red.jpg)
## Quick starting the project
1. Download the project.
2. Change the directories in "Project-GUI.py" & "object_detection.py"
3. If the `yolov3.weights` is not accessible, download the file from this <a href="https://pjreddie.com/media/files/yolov3.weights" target="_blank">link</a>.
4. Install required python dependencies into your python virtual environment.
5. `python Project-GUI.py`
## System Overview
![System Overview](Images/System_Flowchart.jpg)
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.
## Methodology
### Vehicle Classification
From the given video footage, moving objects are detected. An object detection model YOLOv3 is used to classify those moving objects into respective classes. YOLOv3 is the third object detection algorithm in YOLO (You Only Look Once) family. It improved the accuracy with many tricks and is more capable of detecting objects. The classifier model is built with Darknet-53 architecture. Table-1 shows how the neural network architecture is designed.
![Darknet Architecture](Images/Darknet-53.png)
### Violation detection
The vehicles are detected using YOLOv3 model. After detecting the vehicles, violation cases are checked. A traffic line is drawn over the road in the preview of the given video footage by the user. The line specifies that the traffic light is red. Violation happens if any vehicle crosses the traffic line in red state.
The detected objects have a green bounding box. If any vehicle passes the traffic light in red state, violation happens. After detecting violation, the bounding box around the vehicle becomes red.
## Implementation
### 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.
### Graphical User Interface (GUI)
The graphical user interface has all the options needed for the software. The software serves administration and other debugging purposes. We don’t need to edit code for any management. For example, if we need to open any video footage, we can do it with the Open item (Figure-2).
![Figure 2](Images/Initial_View.jpg)
Figure-2: Initial user interface view.
Primarily, for the start of the project usage, the administrator needs to open a video footage using ‘Open’ item that can be found under ‘File’ (Figure-2). The administrator can open any video footage from the storage files (Figure-3).
![Figure 3](Images/Open_Video.JPG)
Figure-3: Opening a video footage from storage.
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. To enable the line drawing feature, we need to select ‘Region of interest’ item from the ‘Analyze’ option (Figure-4). After that administrator will need to select two points to draw a line that specifies traffic signal.
![Figure 4](Images/Select_Region_of_Interest.jpg)
Figure-4: Region of Interest (Drawing signal line)
Selecting the region of interest will start violation detection system. The coordinates of the line drawn will be shown on console (Figure-5). 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-6).
![Figure 5](Images/Line_Coordinates.JPG)
Figure-5: Line Coordinates (from console)
![Figure 6](Images/Violation_Detection_Frame.jpg)
Figure-6: Final Output (on each frame)
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 (Figure-2). If the work is complete the administrator can quit using ‘Exit’ item from File option.
Libraries used for graphical user interface:
* Tkinter
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
智慧交通_基于计算机视觉的交通信号违规检测系统_基于YOLOv3+Tkinter实现_优质项目实战.zip (71个子文件)
智慧交通_基于计算机视觉的交通信号违规检测系统_基于YOLOv3+Tkinter实现_优质项目实战
Project-GUI.py 8KB
Project Slide.pptx 1.48MB
Video Demonstration Guidelines.txt 906B
Detected Images
violation_13.jpg 17KB
violation_24.jpg 18KB
violation_18.jpg 17KB
violation_32.jpg 19KB
violation_20.jpg 18KB
violation_19.jpg 17KB
violation_12.jpg 17KB
violation_15.jpg 16KB
violation_28.jpg 19KB
violation_30.jpg 20KB
violation_1.jpg 16KB
violation_23.jpg 18KB
violation_26.jpg 20KB
violation_14.jpg 17KB
violation_22.jpg 17KB
violation_17.jpg 18KB
violation_27.jpg 18KB
violation_5.jpg 17KB
violation_31.jpg 19KB
violation_16.jpg 17KB
violation_6.jpg 17KB
violation_3.jpg 17KB
violation_7.jpg 16KB
violation_4.jpg 17KB
violation_11.jpg 17KB
violation_8.jpg 17KB
violation_10.jpg 16KB
violation_21.jpg 17KB
violation_29.jpg 20KB
violation_25.jpg 19KB
violation_2.jpg 16KB
violation_9.jpg 16KB
yolov3.weights 134B
Project Report.pdf 867KB
Resources
input
test.mp4 784KB
test2.mp4 165KB
test1.mp4 3.82MB
input2.mp4 4.89MB
input.mp4 6.96MB
input1.mp4 18.82MB
CCTV Footage.mp4 22.62MB
output
test.mp4 457KB
test2.mp4 143KB
test1.mp4 2.79MB
output.mp4 591KB
Traffic IP Camera video.mp4 4.89MB
Highway-2.mp4 37.63MB
Roads.mp4 6.96MB
object_detection.py 19KB
Images
Preview_Loaded.JPG 183KB
preview.jpg 276KB
Violation_Detection_Frame.jpg 319KB
System_Flowchart.jpg 31KB
Workflow Diagram.jpg 39KB
Initial_View.jpg 86KB
Violation_Detection_Frame_Red.jpg 453KB
Select_Region_of_Interest.jpg 285KB
Open_Video.JPG 59KB
Darknet-53.png 50KB
copy.jpg 279KB
KUET_logo.png 164KB
YOLOv3-tiny-network-structure.jpg 71KB
home.jpg 39KB
System_Flowchart_Light.jpg 29KB
Line_Coordinates.JPG 15KB
__pycache__
object_detection.cpython-35.pyc 14KB
object_detection.cpython-37.pyc 11KB
README.md 5KB
共 71 条
- 1
资源评论
极智视界
- 粉丝: 2w+
- 资源: 1504
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于Typescript和PHP的编程知识储备库设计源码 - study-php
- Screenshot_2024-05-28-11-40-58-177_com.tencent.mm.jpg
- 基于Dart的Flutter小提琴调音器APP设计源码 - violinhelper
- 基于JavaScript和CSS的随寻订购网页设计源码 - web-order
- 基于MATLAB的声纹识别系统设计源码 - VoiceprintRecognition
- 基于Java的微服务插件集合设计源码 - wsy-plugins
- 基于Vue和微信小程序的监理日志系统设计源码 - supervisionLog
- 基于Java和LCN分布式事务框架的设计源码 - tx-lcn
- 基于Java和JavaScript的茶叶评级管理系统设计源码 - tea
- IMG_5680.JPG
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功