Traffic Violation Detection and Control

: The purpose of this paper is to understand the role & requirement of automation in the traffic management domain. With number of vehicles increasing daily & India being the nation with largest number of 2-wheelers, its Important to track vehicles at an increasing pace than the convention systems in place. We aim to use a system using CV (Computer Vision) & YOLOv5 object detection for classifying vehicles in different categories, considering the vast amount of travel modes used in the Indian Peninsula like Autos & 2-wheelers.


I. INTRODUCTION
Traffic violation detection systems are being developed as the number of vehicles on the road is increasing at a large rate.This increase in number makes it difficult for trigger base traffic violation detection system to keep up with the high volume of traffic and it is not designed to detect multiple traffic violation at the same time for a given vehicle as a result for an increase in traffic rule violation due to the lack of advance detection.The traffic rule violation leads to various road accidents, traffic administration poses numerous basic difficulties in most present-day urban areas.Manual checking of vehicles is troublesome, and mistake-inclined due to feeble and problematic human memory.Consequently, a need arises for a traffic violation detection system to deal with this errand, which can identify criminal traffic offenses, for example, signal jump, over speeding and vehicle count.The first traffic monitoring began with human traffic cops assigned at every junction to monitor traffic, which required human resources and presence at all times.This consequently became difficult with the increase in vehicles.This gave way to trigger based traffic detection s ystems, which were specialized systems meant for detecting one type of violation -speed.These were costly, could only be placed at one point on the road, and were easy to avoid.A new system was required that could be operational 24x7, with least or no human resource requirement and which could identify multiple violations with high accuracy.This is how traffic violation detection using computer vision came into being.traffic violation detection using computer vision is mainly based on computer vision technologies, which are related to image processing, artificial intelligence, and deep learning.This detects objects with instances of semantic objects and class in digital images and videos [6].The video captured from the camera is reused for various other domains and hence the operation cost is significantly reduced.Monitoring infrastructure can be scaled outside the city to rural & highways without additional cost.Since video captured from moving vehicles, the whole city is covered instead of a few signals and junctions.This also enables traffic police to capture traffic violations happening in small lanes to highways.This does not have the one-time infrastructure cost involved in other monitoring systems like Cameras.It saves time and relieves traffic police personnel to focus on other productive work.Computer vision-based detection is based on the principle of vehicle classification, environment awareness, and traffic violation detection.
Figure 1 shows the basic block diagram of the traffic violation detection system, the proposed architecture of surveillance system with intelligent detection and tracking of multiple vehicles from the surveillance input video using YOLOv5 as an object detection algorithm.This is done through a neural network and an object detection model which are used in the classification of the moving objects into different respective classes, thus achieving vehicle classification.Next, from the same given video footage, traffic lights, zebra crossing, different lanes, and traffic signs are classified this comes under environment awareness.Combining these two, now violations are detected based on violations are then detected these can occur on the road which are signal jump, speed detection, and vehicle count.The main objective is to detect multiple vehicle violation detections and it gives a more detailed picture of concepts and technology involved in creating a traffic violation detection system using computer vision.It also aims to throw light on some of the applications and the latest developments being made in the said field.
II. LITERATURE SURVEY In the existing system, a police officer regulates traffic and captures a photo, which is then used to submit images of vehicles that break traffic regulations to an official website based on the licence number.This process takes more time and also some of the vehicles may escape while capturing photos because it is difficult to control traffic and capture the photos of vehicle that violates traffic rule simultaneously.

III. PROPOSED SYSTEM
The proposed model necessitates two things in particular - Vehicle detection process  Traffic Light & Speeding

Violation Detection Process
Our project mainly focuses on one violation that is signal violation.Signal violation: On road we have some predefined lines, so we draw those predefined lines on the screen wherever required, whenever the vehicles cross those lines at wrong time or while the traffic signal is red, then the vehicles are violating traffic rules.
Those vehicles pictures are captured and license number can be extracted.The CCTV camera footage that was recorded from different areas will be sent to the system.Vehicles will be detected from the footage.Whenever the proposed software tests the footage, the violation will be detected.The proposed software supports signal violation by involving the algorithm called R-CNN algorithm.A system flowchart 1 shows how the software works.We use tkinter for Graphical user interface and tkinter is very interactive for the user.Police officer can take care and track the traffic footage and get the details of violation with the captured vehicle image.User can take further action like manually noting license numbers which violates traffic rules and send to nearby police stations to take further actions.

Speed Estimation
The speed of a vehicle can be estimated when a tracked vehicle covers a segment of road.Time difference between the position of a vehicle is calculated and the speed is estimated based on a formula.The timer starts when the vehicle crosses the first line, and the timer ends when the vehicle crosses the second line.The speed is displayed on top of the bounding box only when the vehicle crosses both the lines.

Background Subtraction
To subtract from the reference frame by the current frame, background subtraction has been used and as a result, the required object's area will be obtained.Equation ( 1

Object Classification
After preprocessing method, the moving objects are obtained from the image.A vehicle classification model classifies the moving objects into four categories -4-wheeler, 2-wheeler, 3-wheeler non-vehicle.This is built on neural network model.
V. RESULT When the signal violation detection system was executed on the input video which is gathered from CCTV footage, the input is preprocessed and after drawing predefined lines the output of the system is: wherever the violation of traffic rule occurs system takes a photograph from the CCTV camera, then subtract unnecessary image from it, which provides the features of the vehicles in the image that is required by the RCNN.The RCNN is used to detect whether the vehicle in the picture violates the traffic rule or not.Output: ) shows the method.dist(I) = saturate(|frame1(I) − frame2(I)|)Binary ThresholdTo remove the noise and other disturbances from the input video, the binarization method has been used.Holes and noises are removed in this process.equation (2) shows how binary threshold process.dist(x,y)= MaxVal if frame(x, y) > thresh elseDilation and Find the Contour When the we get the threshold image, to fill the holes we need to do dilation, according to the image the contour is calculated reform the better image.4.1.Object DetectionRegions with CNN features.Three-stage approach: -By using support vendor machine (SVM), we can extract the objects from images.

Figure 2 :
Figure 2: Algorithm used By using convolutional neural network (CNN) we can extract the features from each region of image.Classify and categorize each region using SVMs.