Car Plate Detection Program
Car Plate Detection Program
Car Plate Detection Program
Faculty of Engineering
Department of Information Technology
Prepared By
Nadhem Mahyoop Mohammed Reg. No: 197624
Mohammed Yousef Omer Reg. No: 197632
Saeed Mohammed Thabet Reg. No: 197634
November - 2023
Acknowledgment
First of all, We would to thank our Supervisor: Dr. Hashem for
providing us with useful instructions and guidance through the
process of developing our project and supporting us with some
new techniques in our project to make it a complete, professional
project. We would like also to offer our thanks to the Head of
Information Technology Department Dr. Gamal Bafagas. We
would like to offer our thanks to Mr. Muni hubaisi who helps and
support us in preparing this work and presenting it in this form and
as a matter of which e is obliged in presenting this.
I
Abstract
Car plate detection is identifying the part of the car that is predicted
to be the number plate. Recognition is identifying the values that
make up the license plate.
Car plate detection and recognition is the technology that uses
computer vision to detect and recognize a license plate from an
input image of a car.
This technology applies in many areas. On roads, it is used to
identify the cars that are breaking the traffic rules. In security, it is
used to capture the license plates of the vehicles getting into and
out of certain premises. In parking lots, it is used to capture the
license plates of the cars being parked. The list of its applications
goes on and on.
II
TABLE OF CONTENTS
CONTENTS PAGE
Acknowledgment I
Abstract II
Table of Contents III
List of Figures III
CHAPTER 1: INTRODUCTION 1
1.1 Overview 1
1.2 Problem statements 1
1.3 Software Requirements Specification 2
1.4 UML Diagrams 4
1.5 Project Objectives 5
CHAPTER 2: project file structure 6
2.1 Project prerequisites 6
2.2 Importing libraries 8
CHAPTER 3: implementation 9
3.1 Creating a car plate detection and recognition program 9
3.2 General structure of project 9
3.3 project output 13
3.4 conclusion 14
3.5 References 15
List of Figures
IV
CHAPTER 1: INTRODUCTION
1.1 Overview
Python gives us the ability to create our license plate detection and
recognition program. We achieve this by using three of its libraries;
Easyocr, OpenCV.
In this project, we are going to learn the processes software passes
to detect and recognize a number plate, how to use the three
libraries we did mention above to create our program, and finally
how to create a program that is capable of detecting and
recognizing a license plate. We will use the PyCharm community
edition as our IDE since it is freely available on the internet. A
person using Windows or Linux can follow through.
1
1.3 Software Requirements Specification “SRS”
1) Functional Requirements:
1. The system should be able to detect cars in images or video frames.
2. The system should be able to locate the license plates within the
detected car regions.
3. The system should perform optical character recognition (OCR) on the
license plate regions to extract the alphanumeric characters.
4. The system should provide the recognized license plate characters as
output.
2) Input Requirements:
1. The system should accept images or video frames as input for car plate
detection.
2. The input images or frames should be in a supported format (e.g., JPEG,
PNG, or video formats like MP4).
3) Output Requirements:
1. The system should provide the detected car regions as output, marked
with bounding boxes.
2. The system should provide the recognized license plate characters as
output.
1) Performance Requirements:
1. The system should be capable of processing input images or video
frames in real-time or near real-time, depending on the specific
application requirements.
2. The system should aim to achieve high accuracy in car detection and
license plate recognition.
2
2) User Interface Requirements:
1. If applicable, the system may include a user interface to allow users to
interact with the application, provide inputs, and view the results.
2. The user interface should be intuitive and easy to use.
3) Dependencies:
1. The system may depend on external libraries or frameworks such as
OpenCV for image processing, Pytesseract for OCR, and any other
necessary dependencies.
2. The specific versions and installation instructions for these
dependencies should be documented.
4) Platform Compatibility:
1. The system should be compatible with the target platform(s) where it
will be deployed (e.g., Windows, Linux, macOS).
2. Any platform-specific considerations or requirements should be
documented.
5) Error Handling:
1. The system should handle and report errors gracefully, providing
meaningful error messages or logs when unexpected issues occur.
2. The system should handle scenarios where car detection or license
plate recognition fails or produces inaccurate results.
3
1.4 UML Diagram:
UML Diagram: Design modeling uses a combination of text and
diagrammatic forms to depict the requirements for data, function and
behavior in a way that is relatively easy to understand and more important,
straightforward to review for correctness, completeness and consistency. A
diagram is the graphical presentation of a set of elements most often
rendered as a connected graph of vertices (things) and arcs (relationship).
These diagrams are drawn to visualize a system from different perspectives
so a diagram into a system. Behavioral Modeling
Use case Diagram: It shows a set of use cases and actors (a special kind of
class and their relationships). Use case diagrams address the static use case
view of system. These diagrams are especially important in organizing and
modeling the behavior of a system. In below diagram a user can be anyone
using the system.
Fig 12-1
4
Sequence Diagram: A Sequence diagram is a structured representation of
behavior as a series of sequential steps over time. It is used to depict
workflow, message passing and how element in general cooperate over time
to achieve a result. It is primarily used to show the interaction between
objects in the sequential order that those interaction occurs.
Fig 12-2
5
CHAPTER 2: PROJECT FILE STRUCTURE
2.1 Project prerequisites:
To perform this project, we shall need to:
- Be familiar with the python programming language.
- Have PyCharm installed on their computer.
installing libraries: we now need to install the python libraries we will
need to create our program. To achieve this, open the terminal and type
the following command then hit enter:
Fig 12-3
Wait for a few seconds till it is installed successfully. We also refer to this
library as cv2. We will use it to preprocess our image and also display the
images that have undergone processing.
The screenshot below shows how to install cv2 from the terminal.
6
Fig 12-4
We will follow the same steps to install the last libraries, we will only
change the command part.
Fig 12-5
7
2.2 Importing libraries:
3. Start the project by importing libraries.
- Import easyocr
- Import reader
- Import cv2
Fig 12-6
8
CHAPTER 3: IMPLEMENTATION
3.1 Creating a license plate detection and recognition program:
First things first, let’s prepare our workspace. Open PyCharm and click on
create a new project as shown in the following screenshot
Fig 12-7
Fig 12-8
9
• cv2.imread(): function responsible for reading image from file
• cv2.rezise(): function responsible for resizing an image.
• cv2.cvtColor(): function responsible for colors change to convert car
color to gray.
• cv2.GaussianBlue (): function responsible for making image misty.
• cv2.Canny(): function responsible for Selecting edges of images.
• cv2.findContours(): a function responsible to find group of edges on a
car plate.
• Count = sorted (): function used for sorting the plate edges on a car.
Fig 12-9
10
For c in count: Define c for each count in loop.
Reader (): calling reader library for reading Letters from a cars plate.
Fig 12-10
11
If Len (detection)== 0: if that closed points not makes four arcs of
plate that mean the plate is not find.
print: If not finding plate print impossible to read text from a license
plate.
12
3.3 Project output:
Fig 12-11
Fig 12-12
13
3.4 Conclusion
You now have all the skills required to create a program that
detects and recognizes license plates.
Capture more images of vehicles and input them into the program
then sit back and watch as the program does its magic.
Happy coding!
14
3.5 References
[1] Digital image processing by Rafacl C.Gonzalez and Richard E. Woods
published by pearson education.
[2] R.Radha1 and C.P.Sumathi2, “A Novel approach to extract text from
license plate of vehicle”, Signal & Image Processing: An International
Journal (SIPIJ) Vol.3, No.4, August 2012
[3] Kumar Parasuraman and P.Vasantha Kumar, “An Efficient Method for
Indian Vehicle License Plate Extraction and Character Segmentation”, IEEE
International Conference on Computational Intelligence and Computing
Research,2010.
15