You are on page 1of 10

Ghulam Ishaq Institute of Engineering

Sciences and Technology


Number Plate Recognition and Matching
(EE452-L)
CEP Report

Muhammad Usman Ghani (2018348)


Muhammad Waseem (2018357)
Syed Aaraiz (2018447)
Faculty of Electrical Engineering (Electronics)
1|Page
TABLE OF CONTENTS

VISUALIZING THE METHODOLOGY THROUGH FLOWCHART

2|Page
Number Plate Recognition and Matching
(with MATLAB)
M Usman Ghani (2018348) Syed Aaraiz (2018447) M Waseem (2018357)
Faculty of Electrical Engineering (EEE) Faculty of Electrical Engineering (EEE) Faculty of Electrical Engineering (EEE)
GIKI, Topi, Swabi GIKI, Topi, Swabi GIKI, Topi, Swabi
u2018348@giki.edu.pk u2018447@giki.edu.pk u2018357@giki.edu.pk

Abstract--- The chosen project completes the task


of incorporating all the lessons learnt in the course
of Signal and Systems. The gist of the project is to
extract the text of the number plate from an III. Major Component Description
image, compare the number plate from the
Camera: The camera will be used to capture the
database given and then identify if the car is
image of the car, which will then be processed to
wanted or not, using MATLAB. Application of
crop the number plate. The number plate will be sent
this project can be vastly used by the security
in the program to retrieve the number of the car.
forces to apprehend criminal and wanted figures
Since our project is simulation-based, we will be
on run from the Law Enforcement Agencies
sending the pictures of the number plate to the
(LEAs).
program manually.
Keywords- MATLAB, Image processing,
MATLAB: Software used in this project will be
I. INTRODUCTION MATLAB. MATLAB is a proprietary multi-
paradigm programming language and numeric
MATLAB is one of the most important software computing environment developed by MathWorks. It
which an engineer should know of. It is a high-level provides us with efficient methods for completing the
language for computer visualization, computation, task of processing the image and extracting the actual
calculation and programming. Image processing is number of the number plate.
one of the tools which MATLAB allows us to use.
Database: Database is used later in the project; it
The project will establish a system that uses the will contain the numbers of all wanted cars. The
CCTV cameras installed under the Safe City project retrieved number of the desired car would then be
to continuously take snaps of vehicles on road. All compared to the database and the program will
the number plates will then be recognized through identify if the car is wanted or not.
our software and be compared with a database. If it
matches with a flagged number plate, authorities will
be alerted.
IV. METHODOLOGY

A. Capturing the image


II. Problem Statement (Objectives) In a real-life scenario, a high-def image will be
captured using the CCTV cameras installed under the
Our Problem statement is the detection of number Safe-City Project. However, our project is completely
plate that involves the following objectives, simulation-based, and therefore, we have asked the
user (LEAs) to individually upload the suspected
Take high-res image of a vehicle number plate so it can be processed and run through
Extract out the number plate region the existing national database.
Recognize the characters on the number plate
Match/compare with pre-existing numbers.
Sound alert when flagged vehicles recognized.

3|Page
B. Converting the image
Once the image has been uploaded, the image needs
to be converted. When a picture goes through
conversion, we change it from a true color, high-
definition image to a binary (series of 1s and 0s),
black and white image with unnecessary information
removed. We achieve this by first converting the
image from RGB to Grayscale.

Fig 3: Edge Detection using Prewitt Method

This whole process of conversion, although not the


major part of the project, was done so that the
software is able to process the image faster since it
will have less information to work with.

C. Extracting the plate region


For extraction we use the bounding box method.
Fig. 1: RGB to Grayscale With the help of the built-in command, we are able to
define the number plate area because the number
In the second stage we detect all the high gradient plate region has the smallest well-defined rectangular
edges in the image using ‘Prewitt Method’. Since the region. What a bounding box does is, it creates a box
number plate has well-defined edges, we are able to around all the parts/elements of the image. We also
save that region along with removing a bit of obtain the area of all the boxes created. Then we run
unnecessary information in the picture. During the a for loop to check which box area is the largest,
same stage we binarize the image. This removes all since the number plate, with a well-defined region,
color information and converts the image into a series will have the largest area. After the completion of the
of 1s and 0s. for loop, the index of the maximum area is taken and
its respective bounding box value is saved. This
bounding box value is used to crop the image leaving
behind that specific bounding box which contains the
complete number plate region.

Fig 4: Cropping out the number plate region

D. Recognizing the characters in the number plate


Fig 2: Grayscale to Binary Image
After we obtain the number plate region, we remove
any character in the region that differs too much from
the set value. This removes any extra information
present in the number plate.

4|Page
file so you can edit it separately. The retrieved
number plate of the desired car from step 4 is then
further compared to the database. The program, after
comparing, identifies the car as wanted if it exists in
Fig 5: Removing unnecessary information the database, otherwise it will identify as a safe car.

Then we again use bounding box method to separate


all the letters/characters. We count all the boxes that
have been made and run a for loop that many times.
Then find the height and width of each box and
compare that to a set condition of width and height
calculation from the whole number plate image
which was extracted. Once the condition for a Fig 7: Dialog box. Match not found. A ‘good’ msg is generated
particular box is true, a function of letter detection is
called. This function first resizes the file as to make it
into the same size of the template to which we will
compare it. Then the correlation of the template and
extracted bounded letter is checked and returns a
value of between 1 to 0 compared to each letter and
produces an array. Then the maximum correlation
value is found. The index of the maximum
correlation value is utilized to find the respective
letter or number it corresponds to. This letter or
number is then returned from the function and stored
into the array of number plates. One by one each
letter is stored via a ‘for’ loop and the array is
appended. The array contains the complete number
plate.

Fig 8: The pre-saved database

F. Running the whole software through GUI


The last part is to ensure that the whole program is
user friendly and a layman can use it. A GUI,
graphical user interface, will be made using
MATLAB which will consist of directions and
labeled buttons to make the program accessible to the
common people. It will have a button, ‘Insert the
picture’, which will allow the user to input the
desired picture and then the GUI will display the
Fig 6: Recognized plate is saved in ‘noPlate’ variable number plate for confirming that the right picture has
been selected. Upon recognition, the number plate is
displayed in text form. If the plate number matches
E. Comparison with a pre-saved database with the one in the database, a warning/alert dialog
Premade database is made which will contain the box is generated. If the car is safe, i.e., it does not
number of all wanted cars. The database is an excel

5|Page
match with any number in the database, an “okay”
dialog box is generated.

Fig 9: Graphical User Interface (GUI) setup

V. VISUALIZING THE METHODOLOGY


THROUGH FLOWCHART

Fig.10. When a wanted number plate is recognized and matches in


the database.

Segmentation
(Bounding Box)

Number Plate
Recognized Database Match

Alert
(if necessary) Fig.11: When a safe number plate is recognized and does not
matche in the database.

VI. RESULTS As can be seen from the image, the image selected is
displayed in the software from confirmation, the
recognized number plate is displayed in text form. If
the plate number matches with the one in the
database, a warning/alert dialog box is generated. If
the car is safe, i.e., it does not match with any number
in the database, an “okay” dialog box is generated.

6|Page
VII. CODE

A) GUI CODE

B) Plate Detection

7|Page
C) Letter Detection

8|Page
D) Template Creation

VIII. CONCLUSION

The system is a success as it passes all the required


objectives which were needed to perform. The
system integrates a camera setup on which the user
can input the suspected number plate. Upon matching
with the database, if a hit is generated, LEAs are
alerted. This will help security forces to keep the
city/country safe.

IX. CONTRIBUTION

Muhammad Waseem : Proposal + Code

9|Page
Syed Aaraiz : Report + Code

Muhammad Usman Ghani : Report + Code

X. REFERENCES

Ragini Bhat & Bijender Mehandia, “RECOGNITION


OF VEHICLE NUMBER PLATE USING
MATLAB”, International Journal of Innovative
Research in Electrical, Electronics, Instrumentation
and Control Engineering, Vol. 2, Issue 8, August
2014

MathWorks Help Center Documentation for


MATLAB’s built-in commands

10 | P a g e

You might also like