FACULTY OF TECHNOLOGY
DEPARTMENT OF INFORMATION TECHNOLOGY /SOFTWARE
ENGINEERING
ZRP TRAFFIC RULES VIOLATION DETECTION SYSTEM WITH
COMPUTER VISION
BY
TAFADZWA T MUKWINDIDZA
PIN MUMBER: P1942932Y
SUPERVISOR: MR TAVIRIMIRWA
A RESEARCH PROJECT SUBMITTED IN PARTIAL FULFILLMENT OF BACHELOR OF
SOFTWARE / INFORMATION TECHNONOLOGY HONOURS DEGREE
APRIL 2025
i
APPROVAL FORM
The undersigned certify that they have supervised the student P1942932Y dissertation entitled ZRP TRAFFIC
RULES VIOLATION DETECTION SYSTEM WITH COMPUTER VISION submitted in Partial fulfilment of
the requirements for the Bachelor of Information
Technology / Software Engineering Honour’s Degree of Zimbabwe Open University.
TAFADZWA T MUKWINDIDZA
……………………………………………. ……………………………
STUDENT NAME DATE
MR TAVIRIMIRWA
……………………………………………. ……………………………
SUPERVISOR DATE
MR MBIZA
……………………………………………. ……………………………
CHAIRPERSON DATE
ii
DEDICATIONS
Dedicated to my family for the love and support.
iii
ABSTRACT
iv
ACKNOWLEDGEMENTS
I would like to thank my supervisor Mr Tavirimirwa for his constant guidance and help throughout the project
Finally, I would like to thank my family and my friends for all the support and encouragement.
v
TABLE OF CONTENTS
FACULTY OF TECHNOLOGY ............................................................................................................................... i
Approval form ............................................................................................................................................................ ii
Dedications ................................................................................................................................................................ iii
Abstract ..................................................................................................................................................................... iv
Acknowledgements .................................................................................................................................................... v
Table of Figures ......................................................................................................................................................... ix
CHAPTER 1: PROBLEM IDENTIFICATION ..................................................................................................... 1
1.0 Introduction ........................................................................................................................................................ 1
1.2 Background ........................................................................................................................................................ 1
1.3 Problem Statement ............................................................................................................................................. 1
1.4 Project aim ......................................................................................................................................................... 2
1.5 Research Objectives ........................................................................................................................................... 2
1.6 Research Questions ............................................................................................................................................ 2
1.7 Research Hypothesis .......................................................................................................................................... 2
1.8 Significance of the Study ................................................................................................................................... 3
1.9 Scope .................................................................................................................................................................. 4
1.9.1 Admin ............................................................................................................ Error! Bookmark not defined.
1.9.2 Client ............................................................................................................. Error! Bookmark not defined.
1.9.3 Customer ....................................................................................................... Error! Bookmark not defined.
1.10 Assumptions of the research ............................................................................................................................ 4
1.11 Limitations ....................................................................................................................................................... 5
1.12 Definition of terms ......................................................................................... Error! Bookmark not defined.
CHAPTER 2: Literature Review ............................................................................... Error! Bookmark not defined.
2.0 General Overview ............................................................................................ Error! Bookmark not defined.
vi
2.6 Benefits of Proposed System ........................................................................... Error! Bookmark not defined.
2.7 The Proposed System ....................................................................................... Error! Bookmark not defined.
CHAPTER 3: METHODOLOGY ............................................................................. Error! Bookmark not defined.
3.0 Introduction ...................................................................................................... Error! Bookmark not defined.
3.1 System Development Model ............................................................................ Error! Bookmark not defined.
3.1.1 ITERATIVE MODEL ................................................................................... Error! Bookmark not defined.
3.1.2 PLANNING .................................................................................................. Error! Bookmark not defined.
3.1.3 ANALYSIS & DESIGN ................................................................................ Error! Bookmark not defined.
3.1.4 IMPLEMENTATION.................................................................................... Error! Bookmark not defined.
3.1.5 TESTING ...................................................................................................... Error! Bookmark not defined.
3.1.6 DEPLOYMENT ........................................................................................... Error! Bookmark not defined.
3.1.7 EVALUATION.............................................................................................. Error! Bookmark not defined.
3.2 Research Design ............................................................................................... Error! Bookmark not defined.
3.3 Design methods ................................................................................................ Error! Bookmark not defined.
3.3.1 System Architecture ...................................................................................... Error! Bookmark not defined.
3.3.2 Software Description .................................................................................... Error! Bookmark not defined.
3.4 Functional Requirements ................................................................................. Error! Bookmark not defined.
3.4.1 SOFTWARE ................................................................................................. Error! Bookmark not defined.
3.4.2 HARDWARE ................................................................................................ Error! Bookmark not defined.
3.5 Non-functional Requirements ......................................................................... Error! Bookmark not defined.
3.6 Use Case Diagrams .......................................................................................... Error! Bookmark not defined.
3.7 Sequence Diagram ........................................................................................... Error! Bookmark not defined.
3.8 Flow Chart ....................................................................................................... Error! Bookmark not defined.
3.9 Conclusion ....................................................................................................... Error! Bookmark not defined.
CHAPTER 4 ................................................................................................................. Error! Bookmark not defined.
vii
4.1 Discussion of results ........................................................................................ Error! Bookmark not defined.
4.2 IMPLEMENTATION....................................................................................... Error! Bookmark not defined.
4.2.1 INTERFACES ........................................................................................... Error! Bookmark not defined.
4.3 TESTING ......................................................................................................... Error! Bookmark not defined.
4.3.1 WHITE-BOX TESTING ........................................................................... Error! Bookmark not defined.
4.3.2 BLACK-BOX TESTING .............................................................................. Error! Bookmark not defined.
4.4 SUMMARY ..................................................................................................... Error! Bookmark not defined.
CHAPTER 5: Recommendations and conclusions ................................................... Error! Bookmark not defined.
5.0 Introduction ...................................................................................................... Error! Bookmark not defined.
5.1 Aims and Objectives Realization ..................................................................... Error! Bookmark not defined.
5.2 Challenges Faced ............................................................................................. Error! Bookmark not defined.
5.3 PROJECT CONTRIBUTION .......................................................................... Error! Bookmark not defined.
5.4 Recommendations for future work .................................................................. Error! Bookmark not defined.
5.5 CONCLUSION ................................................................................................ Error! Bookmark not defined.
References ..................................................................................................................... Error! Bookmark not defined.
viii
TABLE OF FIGURES
Figure 1 Overview of use of the system. .............................................................................. 12
Figure 2 Concept of the system.............................................................................. 2.8 Chapter Summary
.................................................... 13
Figure 3 Iterative Waterfall Model ............................................................................................................... 14
Figure 4 Overall architecture of the system description ............................................................. 17
Figure 5 System Architecture ........................................................................................................................ 18
Figure 6 XAMPP ........................................................................................................................................... 20
Figure 7 Non-functional requirements.......................................................................................................... 22
Figure 8 Use case General overview of the system ....................................................................................... 24
Figure 9 User Control Panel Use Case .......................................................................................................... 25
Figure 10 Admin Control Panel Use Case .................................................................................................... 26
Figure 11 Sequence diagram ......................................................................................................................... 27
Figure 12 Activity Diagram ........................................................................................................................... 28
Figure 13 Database ........................................................................................................................................ 29
Figure 14 Client ............................................................................................................................................. 31
Figure 15 Customer ....................................................................................................................................... 34
Figure 16 Admin ............................................................................................................................................ 36
ix
CHAPTER 1: PROBLEM IDENTIFICATION
1.0 INTRODUCTION
Due to ever-increasing traffic volume, it is evident that, it is becoming tough to monitor every individual under
these conditions and also it is difficult to maintain the road traffic under control as it is demanding more
manpower. This problem can also lead to accidents, traffic rules violation and other dangerous situations. Hence,
this research work proposes an automated system for maintaining these violations under control by developing a
system with the help of computer vision, which detects the violations caused by vehicles and identifies the
registration number of violated vehicles in order to send an alert to the host. In general, Computer Vision is
concerned on how a system can obtain high-level capabilities from the input images or videos. This project
entails the process of locating and identifying a certain car's registration number. Further, it uses Convoluted
Neural Networks (CNN‟s), which is a class of Deep learning that comes under deep neural networking are used
for analyzing visual imagery. This project is built on TensorFlow, and it relies on various libraries to perform the
required actions. This system can detect three types of traffic violations.
1.2 BACKGROUND
As urban areas continue to experience significant growth, the volume of traffic has surged, leading to increased
congestion and a heightened risk of accidents. Monitoring individual vehicles under these challenging conditions
presents a formidable task for traffic authorities, demanding extensive manpower and resources. This scenario
not only complicates traffic management but also escalates the potential for traffic rule violations and dangerous
incidents. In response to these pressing issues, this research proposes an automated system designed to enhance
traffic monitoring and enforcement through advanced computer vision techniques. The system aims to detect
traffic violations in real-time, identifying vehicles that breach regulations and capturing their registration
numbers for accurate reporting. By leveraging the capabilities of computer vision, the system can analyze input
images and videos to achieve high-level recognition of traffic violations. Central to the operation of this
automated system is the use of Convolutional Neural Networks (CNNs), a class of deep learning algorithms
specifically adept at processing visual imagery. Through the TensorFlow framework, the system utilizes various
libraries to facilitate the detection and classification of traffic violations, ensuring reliability and efficiency. This
project is particularly relevant for the Zimbabwe Republic Police (ZRP), as it seeks to improve road safety and
compliance through technology. By automating the monitoring process, the ZRP can allocate resources more
effectively and respond promptly to violations, ultimately contributing to safer roadways and improved traffic
management. The system's ability to detect three specific types of traffic violations highlights its targeted
approach in addressing the multifaceted challenges faced in contemporary traffic scenarios.
1.3 PROBLEM STATEMENT
The rapid increase in traffic volume in urban areas has led to significant challenges in managing road safety and
compliance with traffic regulations. Traditional methods of monitoring traffic violations are resource-intensive
and often inadequate, resulting in a higher incidence of accidents and rule violations. The manual enforcement of
traffic laws is not only inefficient but also prone to human error, which can exacerbate dangerous situations on
the roads.
1
As the number of vehicles on the road continues to rise, the limitations of current monitoring systems become
more apparent. Traffic authorities often struggle to keep up with the demands of effective enforcement, resulting
in a lack of oversight and increased risks for both drivers and pedestrians. This inefficiency can lead to serious
consequences, including collisions, injuries, and fatalities, highlighting the urgent need for a more effective
solution.
1.4 PROJECT AIM
To develop a ZRP traffic rules violation detection system with computer vision
1.5 RESEARCH OBJECTIVES
To gather and curate a diverse and extensive dataset from the internet with 500 images per each set.
To clean and preprocess images gathered from the internet on google coolab.
To implement and train a pretrained MobileNet V1 neural network to accurately identify traffic rules violation
using transfer learning approach
To evaluate model accuracy and performance by testing it before deployment.
To detect traffic rule violations in the footage, providing immediate alerts and actionable insights for
enforcement agencies.
1.6 RESEARCH QUESTIONS
1.How is the dataset going to be gathered?
2.How are images going to be cleaned and preprocessed with grayscaling and blurring be the major activities
3.How is the pretrained MobileNet V1 neural network going to be used to our advantage and going to trained
4.How is the accuracy and performance going to be measured.
5.How is the MobileNet V1 model going to be used to detect traffic rule violations in the footage.
1.7 RESEARCH HYPOTHESIS
Ho. The pretrained MobileNet V1 is going to be used to detect traffic rule violations from the footage of the
vehicles taken by the camera from different locations
Ho. The pretrained MobileNet V1 is not going to be used to detect traffic rule violations from the footage of the
vehicles taken by the camera from different locations
2
1.8 SIGNIFICANCE OF THE STUDY
The significance of this study extends beyond technological advancement; it represents a transformative
approach to traffic management and enforcement for the Zimbabwe Republic Police (ZRP). In the face of
increasing traffic congestion and safety challenges in urban areas, the implementation of an automated traffic
violation detection system utilizing advanced computer vision technologies offers crucial benefits that can
enhance public safety and streamline law enforcement operations. One of the primary advantages of this
automated system is its ability to significantly improve public safety. By accurately detecting traffic violations in
real-time, the ZRP can reduce the likelihood of accidents and enhance overall road safety. The swift
identification of offenders enables timely interventions, protecting both drivers and pedestrians in a landscape
where road safety is a growing concern. The implementation of such technology can serve as a deterrent to
potential violators, fostering a culture of compliance with traffic regulations. Additionally, the automation of
traffic monitoring promotes resource efficiency within the ZRP. Traditional traffic enforcement often relies
heavily on manpower, which can be both resource-intensive and costly. By adopting an automated system, the
ZRP can optimize the deployment of personnel, allowing officers to focus on more strategic initiatives, such as
community engagement and crime prevention. This efficiency not only streamlines operations but also enhances
the effectiveness of law enforcement, enabling the ZRP to respond proactively to traffic-related issues.
Furthermore, the data-driven decision-making capabilities of the automated detection system are significant. This
system generates comprehensive data on traffic violations, which can be analyzed to identify patterns and trends.
Such insights empower the ZRP to make informed decisions regarding policy changes, road design
improvements, and targeted enforcement strategies. By harnessing this information, the ZRP can tailor its
approach to meet the specific needs of urban areas, thereby improving overall traffic management. The inclusion
of a user-friendly graphical interface (GUI) enhances the accessibility of the system for ZRP personnel. This
intuitive interface allows officers to monitor violations in real-time, access historical data, and take necessary
actions with minimal training. By simplifying the enforcement process, the system enables officers to respond
more effectively to violations, promoting accountability among drivers. Moreover, the study's focus on multiple
types of violations—including signal, parking, and direction violations—ensures comprehensive traffic
monitoring. This holistic approach addresses various aspects of road safety, allowing the ZRP to enforce
regulations more effectively and consistently. The ability to track different types of violations in real-time
enhances the overall efficacy of traffic enforcement efforts.
3
1.9 SCOPE
The scope of this study focuses on the development and implementation of an automated traffic violation
detection system specifically designed for the Zimbabwe Republic Police (ZRP). In light of increasing traffic
congestion and safety challenges in urban areas, this study aims to leverage advanced computer vision
technologies to address these pressing issues effectively.
At the core of the study is the objective of real-time monitoring of traffic conditions. The proposed system is
designed to continuously observe traffic through CCTV footage, facilitating the immediate detection of traffic
violations as they occur. This capability is essential for enhancing road safety and ensuring compliance with
traffic regulations.
Moreover, the study specifically targets three primary types of traffic rule violations: signal violations, parking
violations, and direction violations. Each category of violation is addressed with tailored algorithms, ensuring
that the system can accurately identify and respond to these infractions. By concentrating on these specific
violations, the study seeks to provide a comprehensive solution that improves traffic management practices.
The technological framework of the study utilizes advanced computer vision techniques, particularly employing
the MobileNet V1 neural network for vehicle classification and the OpenCV library for image processing. This
combination allows for efficient and accurate detection of vehicles and their behaviors, which is critical for the
system's overall effectiveness.
Additionally, the study incorporates the development of a user-friendly graphical interface (GUI). This interface
is designed to facilitate interaction with the system, enabling ZRP personnel to monitor traffic footage in real-
time, receive alerts for detected violations, and efficiently manage violation records. By streamlining these
processes, the system aims to enhance the operational capabilities of traffic enforcement.
Furthermore, the implementation involves a structured database that stores critical information about vehicles,
detected violations, and relevant traffic rules. This organized data management ensures seamless retrieval and
handling of information, further supporting the enforcement efforts of the ZRP.
1.10 ASSUMPTIONS OF THE RESEARCH
the research is grounded in several key assumptions that are critical for the successful implementation of the
automated traffic violation detection system. First, it assumes that sufficient and representative datasets will be
4
available for training the vehicle classification model. The quality and diversity of this data are essential for
ensuring the model’s effectiveness in accurately detecting and classifying vehicles.
Additionally, the study assumes that the CCTV cameras used for monitoring traffic will function correctly and be
positioned to provide clear, unobstructed views of the road. Proper camera positioning is crucial for the accurate
detection of vehicles and violations. The reliability of the computer vision algorithms, including image
processing techniques and the MobileNet V1 architecture, is also assumed to be high, ensuring consistent
performance in real-time detection scenarios. Another assumption is that traffic enforcement personnel will
receive adequate training to effectively use the GUI and interpret the system's outputs. Proper training is vital for
ensuring that officers can utilize the system to its full potential and respond appropriately to detected violations.
Lastly, the research assumes that there exists a supportive legal framework that allows for the use of automated
systems in traffic enforcement. This includes regulations governing data privacy, video surveillance, and the
issuance of fines based on automated detections. A robust legal foundation is essential for the successful
integration of this technology into existing traffic management practices.
1.11 LIMITATIONS
While the study aims to deliver significant advancements in traffic monitoring and enforcement, several
limitations must be acknowledged that may impact the effectiveness of the automated traffic violation detection
system.
First and foremost, the accuracy of the model is heavily dependent on the quality and representativeness of the
training data used. If the datasets are limited or biased, the system's ability to accurately classify vehicles and
detect violations may be compromised, leading to suboptimal performance.
Additionally, the success of the system relies on the proper functioning and strategic placement of CCTV
cameras. Poorly positioned or malfunctioning cameras can significantly hinder the system's capability to
accurately detect violations, potentially resulting in missed offenses. This reliance on hardware quality
underscores the need for careful planning and installation.
Environmental conditions also pose a challenge to the system's effectiveness. Factors such as lighting variations,
adverse weather conditions, and road obstructions can affect the performance of the computer vision algorithms,
leading to false positives or negatives in violation detection. Such external variables must be considered during
the system's design and implementation phases.
Another critical limitation is the necessity for adequate training of ZRP personnel in using the graphical interface
and interpreting the system's outputs. Insufficient training may limit the effectiveness of the system, undermining
its potential benefits. Therefore, investing in comprehensive training programs is essential for maximizing the
system's utility.
5
Furthermore, the implementation of automated traffic monitoring systems may encounter legal and regulatory
constraints. Issues related to data privacy, public acceptance of automated enforcement, and the legal framework
governing traffic violations can pose significant challenges to the deployment and integration of the system
within existing traffic management practices.
Lastly, while the system is designed for urban traffic monitoring, scalability presents its own set of challenges.
Expanding the system to cover larger areas or integrating additional features may introduce technical and
logistical hurdles that require thorough planning and resources to overcome.