0% found this document useful (0 votes)
14 views42 pages

B.tech It Batchno 44

G

Uploaded by

ashish garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views42 pages

B.tech It Batchno 44

G

Uploaded by

ashish garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

VEHICLE NUMBER PLATE DETECTION SYSTEM FOR

INDIAN VEHICLES USING OCR

Submitted in partial fulfillment of the requirements for the award


of Bachelor of Technology Degree in

Information Technology
By

DINESH KUMAR A (Reg. No. 37120087)


LOGESWARAN R (Reg. No. 37120042)

DEPARTMENT OF INFORMATION TECHNOLOGY


SCHOOL OF COMPUTING

SATHYABAMA
INSTITUTE OF SCIENCE AND TECHNOLOGY
(DEEMED TO BE UNIVERSITY)
Accredited with Grade “A” by NAAC

JEPPIAAR NAGAR, RAJIV GANDHI SALAI,


CHENNAI - 600 119

MARCH 2021

i
SATHYABAMA
INSTITUTE OF SCIENCE AND TECHNOLOGY

(DEEMED TO BE UNIVERSITY)
Accredited with “A” grade by NAAC
Jeppiaar Nagar, Rajiv Gandhi Salai,
Chennai – 600 119
www.sathyabama.ac.in

DEPARTMENTOF INFORMTATION TECHNOLOGY

BONAFIDE CERTIFICATE

This is to certify that this Project Report is the bonafide work of Dinesh Kumar A
(Reg.No 37120087) and Logeswaran R (37120042) who carried out the project
entitled “Vehicle Number Plate Detection System For Indian Vehicles using
OCR” under my supervision from November 2020 to March 2021.

Internal Guide
Dr.P.SARAVANAN M.E.,Ph.D.,

Head of the Department


Dr .R.SUBHASHINI. M.E., Ph.D.,

Submitted for Viva voce Examination held on

Internal Examiner External Examiner

ii
DECLARATION

We, Dinesh Kumar A (Reg.No 37120087) and Logeswaran R (37120042)

hereby declare that the Project Report entitled “Vehicle Number Plate

Detection System For Indian Vehicles using OCR” done by us under the

guidance of Dr.P.Saravanan M.E.,Ph.D., is submitted in partial fulfillment of the

requirements for the award of Bachelor of Technology degree in Information

Technology.

DATE:
PLACE: CHENNAI SIGNATURE OF THE CANDIDATE

iii
ACKNOWLEDGEMENT

I am pleased to acknowledge my sincere thanks to Board of Management of


SATHYABAMA INSTITUTE OF SCIENCE AND TECHNOLOGY for their kind
encouragement in doing this project and for completing it successfully. I am
grateful to them.

I convey my thanks to Dr. T.Sasikala M.E., Ph.D, Dean, School of Computing,


Dr.R.Subhashini M.E., Ph.D., Head of the Department of Information
Technology for providing me necessary support and details at the right time during
the progressive reviews.

I would like to express my sincere and deep sense of gratitude to my Project


Guide Dr.P.Saravanan M.E.,Ph.D., for his valuable guidance, suggestions and
constant encouragement paved way for the successful completion of my project
work.

I wish to express my thanks to all Teaching and Non-teaching staff members of


the Department of Information Technology who were helpful in many ways for
the completion of the project.

iv
ABSTRACT

Automatic Plate recognition is one of the techniques used for vehicle


identification purposes and it will provide all details about particular
vehicle owner. This process usually comprises of three steps. First step
is the vehicle plate localization, regardless of the vehicle-plate size and
orientation. The second step is the segmentation of the characters and
last step is the recognition of the characters from the vehicle plate.
Thus, this project uncovers the fundamental idea of various algorithms
required to accomplish character recognition from the vehicle plate.
This feature of the algorithm mentioned above helped in achieving
faster character recognition of the license plate. This process of
character recognition consists of steps like Image processing,
Defragmentation, Resizing and Character localization that are required
to be performed on the image.

v
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO

ABSTRACT
LIST OF FIGURES
LIST OF ABBREVIATIONS
1 INTRODUCTION 1
1.1 OVERVIEW 1
2 AIM AND SCOPE 2
2.1 AIM 2
2.2 SCOPE 2
2.2.1 FUNDAMENTAL STEPS IN OCR 3
3 LITERATURE REVIEW 3
3.1 REVIEW OF LITERATURE 3
4 METHODOLOGY 10
4.1 SYSTEM ANALYSIS 10
4.1.1 EXISTING SYSTEM 11
4.1.2 PROPOSED SYSTEM 12
4.1.3 LANGUAGES USED IN THE SYSTEM 12
4.1.3.1 ABOUT PYTHON LANGUAGE 13
4.2 SYSTEM REQUIRMENTS 14
4.2.1 HARDWARE REQUIREMENTS 15
4.2.2 SOFTWARE REQUIREMENTS 16
4.2.2.1 CODING LANGUAGES 16
4.3 METHODOLOGY 17
4.3.1 SYSTEM ARCHITECTURE 17
4.3.2 MODULES 18
4.3.2.1 DATA PRE-PROCESSING 18
4.3.2.2 FEATURE SELECTION 19
4.3.2.3 BUILDING AND TRAINING MODEL 20
4.3.2.4 NUMBER PLATE EXTRACTION 21
4.3.2.5 CHARACTER SEGMENTATION 23

vi
4.3.2.6 OPTICAL CHARACTER 24
RECOGNITION
4.3.2.7 TEMPLATE MATCHING 25
4.3.3 UML DIAGRAMS 25
4.3.3.1 USECASE DIAGRAM 26
4.3.3.2 SEQUENCE DIAGRAM 26
4.3.3.3 ACTIVITY DIAGRAM 27
4.4 TESTING 27
4.4.1 SOFTWARE TESTING 28
4.4.2 TEST CASE 28
4.4.3 TESTING TECHNIQUES 28
5 CONCLUSION 29
5.1 CONCLUSION 29
5.2 FUTURE WORK 30
REFERENCES 30
APPENDICES 31

SAMPLE CODE 32

vii
LIST OF FIGURES

FIGURE NO FIGURE NAME PAGE NO


4.1 System Architecture 26

4.2 Use case diagram 32

4.3 Sequence diagram 33

4.4 Activity diagram 33

viii
LIST OF ABBREVIATIONS

OCR – Optical Character Recognition


UML – Unified Modeling Language

ix
CHAPTER 1
I

x
INTODUCTION
1.1 OVERVIEW
Number Plate recognition plays an important role in various applications such as
traffic monitoring on road, automatic toll payment, parking lots access control,
detection of stolen vehicles. To identify a car number plate is effective because of its
uniqueness of the car. Real time number plate recognition plays an important role in
automatic monitoring of traffic rules. The recognition of car number plate can be
used for automatic car parking because each car has its own identification number.
The camera is used to capture the image automatically and can be used for many
application such as automatic toll plaza and car parking.

1
CHAPTER 2
AIM AND SCOPE
2.1 AIM
For the standard number plates the automatic number plate recognition becomes
very easy to read and recognizes the character. In India the vehicle number plates
has no standard size and font so it become very difficult to read and recognize the
characters of the number plate. So we are using machine learning algorithm to solve
this problem.

2.2 SCOPE
This is based on various operation such as image enhancement,
morphological transformation, edge detection and extraction of number plate from
vehicle image. After this segmentation is applied to recognize the characters
present on number plate using template matching. This algorithm can recognize
number plate quickly and accurately from the vehicles image.

2.2.1 Fundamental steps in OCR


➢ Image division into small images

➢ detecting probable number plate area

➢ Recognizing number plate area

➢ Parsing number plate to extract characters

➢ Apply OCR to the parsed character

2
CHAPTER 3
LITERATURE REVIEW

3.1 REVIEW OF LITERATURE


1.A New Approach for Vehicle Number Plate Detection
Authors: Sarthak Babbar ; Saommya Kesarwani ; Navroz Dewan ; Kartik
Shangle ; Sanjeev Patel, 2018
Identification of cars and their owners is a tedious and error prone job. The advent
of automatic number plate detection can help tackle problems of parking and traffic
control. The system is designed using image processing and machine learning. A
new system is proposed to improve detection in low light and over exposure
conditions. The image of vehicle is captured, which is preprocessed using
techniques like grayscale, binarization. The resultant image is passed on for plate
localization, for extracting the number plate using CCA (Connected Component
Analysis) and ratio analysis. The characters of the number plate are segmented by
CCA and ratio analysis as well. Finally, the recognized characters are compared
using techniques such as SVC KNN, Extra Tree Classifier. The proposed
techniques help the system to detect well under dim light, over-exposed images
and those in which the vehicle is angled.

2.A hierarchical license plate recognition system using supervised


K-means and Support Vector Machine
Authors: Wei-Chen Liu ; Cheng-Hung Lin, 2017
License plate recognition technology has been widely used in parking lot
management systems which has fixed shooting angle and lighting environments.
The license plate recognition used in traffic monitor will encounter difficulties in
character recognition due to factors such as shooting angle, vehicle speed and
environment light and shadow. The supervised K-means is used to classify
characters into subgroups. The advantage of the proposed approach is to reduce
the classes of characters in each subgroup to further reduce the number of SVMs
and their complexity, and thus improve the accuracy of character recognition.
Experimental results show that our proposed hierarchical architecture achieves an
accuracy of 98.89% in character recognition. Compared with the license plate

3
recognition technology using SVM alone, we get a 3.6% improvement in
recognition rate.

3.Deep Learning System for Automatic License Plate Detection and


Recognition
Authors: Zied Selmi ; Mohamed Ben Halima ; Adel M. Alimi, 2017
The detection and recognition of a vehicle License Plate (LP) is a key technique in
most of the applications related to vehicle movement. Moreover, it is a quite
popular and active research topic in the field of image processing. Different
methods, techniques and algorithms have been developed to detect and recognize
LPs. Nevertheless, due to the LP characteristics that vary from one country to
another in terms of numbering system, colors, language of characters, fonts and
size. Further investigations are still needed in this field in order to make the
detection and recognition process very efficient. Although this domain has been
covered by a lot of researchers, various existing systems operate under
well-defined and controlled conditions.

4.Automatic number plate recognition for motorcyclists riding without


helmet
Authors: Yogiraj Kulkarni ; Amit Kamthe ; Shubhangi Bodkhe ; Archana
Patil, 2018
Motorcycles have always been the primary mode of transport in developing
countries. In recent years, there has been a rise in motorcycle accidents. One of
the major reasons for fatalities in accidents is the motorcyclist not wearing a
protective helmet. The most prevalent method for ensuring that motorcyclists wear
helmet is traffic police manually monitoring motorcyclists at road junctions or
through CCTV footage and penalizing those without helmet. But, it requires human
intervention and efforts. This paper proposes an automated system for detecting
motorcyclists not wearing helmet and retrieving their motorcycle number plates
from CCTV footage video. The proposed system first does background subtraction
from video to get moving objects. Then, moving objects are classified as
motorcyclist or non-motorcyclist.

4
5.Automatic car number plate recognition
Authors: Anumol Sasi ; Swapnil Sharma ; Alice N. Cheeran, 2017
A traffic surveillance system includes detection of vehicles which involves the
detection and identification of license plate numbers. This paper proposes an
intelligent approach of detecting vehicular number plates automatically using three
efficient algorithms namely Ant colony optimization (ACO) used in plate localization
for identifying the edges, a character segmentation and extraction algorithm and a
hierarchical combined classification method based on inductive learning and SVM
for individual character recognition. Initially the performance of the Ant Colony
Optimization algorithm is compared with the existing algorithms for edge detection
namely Canny, Prewitt, Roberts, Mexican Hat and Sobel operators. The Ant Colony
Optimization used in communication systems has certain limitations when used in
edge detection like random initial ant position in the image and the heuristic
information being highly dictated by transition probabilities. In this paper,
modifications like assigning a well-defined initial ant position and making use of
weights to calculate heuristic value which will provide additional information about
transition probabilities are used to overcome the limitations.

6.License Plate Detection with Machine Learning Without Using Number


Recognition
Authors: Kazuo Ohzeki ; Max Geigis ; Stefan Alexander Schneider, 2019
In autonomous driving, detecting vehicles together with their parts, such as a
license plate is important. Many methods with using deep learning detect the
license plate based on number recognition. However, there is an idea that the
method using deep learning is difficult to use for autonomous driving because of
the complexity in realizing deterministic verification. Therefore, development of a
method that does not use deep learning(DL) has become important again.
Although the authors have made the world's best performance in 2018 for Caltech
data with using DL, this concept has now turned to another research without using
DL. The CT5L method is the latest type, that includes techniques of the continuity
of vertical and horizontal black-and-white pixel values inside the plate, unique
Hough transform, only vertical and horizontal lines are detected, the top five in the
order of the number of votes to ensure good performance. In this paper, a method
to determine the threshold value for binarizing input by machine learning is

5
proposed, and good results are obtained. The detection rate is improved by about
20 points in percent as compared to the fixed case. It achieves the best
performance among the conventional fixed threshold method, Otsu's method, and
the conventional method of JavaANPR.

7.A New Convolutional Architecture for Vietnamese Car Plate Recognition


Authors: Thanh-Nga Nguyen ; Duc-Dung Nguyen, 2018
License plate recognition is a form of an intelligent transportation system. Although,
there have been many studies on plate detection, character segmentation, and
character recognition, many challenges have still remained. Convolutional Neural
Network (CNN) has proven to be a powerful classification tool to achieve
state-of-the-art results on various recognition tasks. In the problem of number plate
recognition, CNN based methods are being used to solve problems such as plate
detection, character segmentation, and character recognition. Quality of
identification depends on the quality of each task. Viet Nam does not have a
recognition system that combines the three tasks together. So, our key idea is to
combine detection, segmentation, and recognition of multi-character number plates
using CNN. Our purpose is to recognize the full sequence of the number plate
without pre-segmentation. This paper presents a CNN-based method for high
accuracy car license plate recognition. The presented methods are evaluated
1,000 plate images of US car plates and 1,000 plate images for Vietnamese car
plate recognition. The experimental results show that our network achieves better
performance than many standard plate detection and recognition algorithms. This
dataset and the investigation results could be used as a baseline for future
research in the field.
8.Bangladeshi License Plate Recognition Using Adaboost Classifier
Authors: Prashengit Dhar ; Md. Zainal Abedin ; Razuan Karim ;
Fatema-Tuj-Johora ; Mohammad Shahadat Hossain, 2019
License plate recognition (LPR) is a technology for the authentication of a vehicle
by locating and recognizing the license plate number in an image through computer
vision techniques and machine learning models. To develop intelligent traffic
management such as vehicle monitoring, LPR is a key component. However, due
to the diversity of layouts and characters of plates, universal solution is not
possible. So, this research focuses on development of an algorithm for the

6
recognition of license plate of Bangladesh by using image processing's and
machine learning model. This algorithm executes in three steps: detection of the
plate with shape verification, tilt correction and recognition of the number. For
detection, RGB color space, median filtering, binarization, morphological analysis,
region properties for filtering are applied. To discard noisy object, shape verification
is done through robust distances to borders vectors. Before character
segmentation, horizontal tilt correction is applied.

9.Long distance Automatic Number Plate Recognition under perspective


distortion using zonal density and Support Vector Machine
Authors: Noprianto ; Sunu Wibirama ; Hanung Adi Nugroho, 2017 3rd
International Conference on Science and Technology - Computer (ICST)
Automatic Number Plate Recognition (ANPR) is one of computer vision
applications to extract information in vehicles plate number. Nevertheless,
perspective distortion is unavoidable when taking pictures of the plate number.
Another factor that causes inaccuracy is the distance of the camera from the plate
number. To solve these problems, we propose a new method to automatically
detect and recognize vehicle plate number with regards to perspective distortion
and distance of capturing plate number. We used zonal density with Support Vector
Machine (SVM) as a classifier. We tested our algorithm on 21 vehicles plate
number with 1, 3, and 5 meter of capturing distance. Our method yields an
accuracy of 89.77%, 82.86%, and 65.22% for 1, 3, and 5 meters capturing
distance, respectively. Compared with previous work, our method is able to
preserve high accuracy when segmenting characters of plate number taken from 5
meter distance.

10.Extraction of number plate images based on image category


classification using deep learning
Author: Yoshihiro Shima, 2016
Automated Number Plate Recognition is a technique involving image processing
which is used to identify a vehicle by reading its number plate. A proposed method
is capable of extracting the number plate region in the image captured from its rear
end at various car distances. The system analyzes the input image and identifies
the location of the number plate. The plate candidate region is extracted by using

7
dilation morphology and scoring based on the height-width ratio and the number of
connected components in the region. The candidate region images are classified in
two classes, namely number plate and outlier images. As image feature extractor,
pre-trained CNN (convolutional neural network) is used and as classifier, SVM
(support vector machine) is used. The algorithm was implemented by programming
language C++ in morphological image processing and MATLAB in pre-trained CNN
and SVM parts. The paper shows experimental verification of the algorithm and test
results for 126 car images.

8
CHAPTER 4
METHODOLOGY
4.1 SYSTEM ANALYSIS
4.1.1 Existing System
In previous we used that project in matlab with hardware connection.but now we
use no hardware only software.we use only python code & some libraries. The
drowsiness detection system is built using MATLAB and Viola Jones Algorithm.

Limitations
1. It is cost of License. Its very costly user has to buy each and every module and
pay for it.

2. Disadvantage is during cross compiling or converting Matlab to other language


code is very difficult.

3. Its very difficult or requires deep devel Matlab knowledge to deal with all errors.

4.1.2 Proposed System


Minimum image angle: 90 degree (looking straight at the license plate). Image
should be captured in daylight. The efficiency of the proposed system can be
measured only in terms of number plates successfully and correctly recognized
which can only be measured upon implementation. In proposed system it can able
to find owner details from captured image. Efficiency and Performance of new
system may decline due to discard of OCR library but the memory requirements will
decrease and also the effort for installing, configuring and running the system
would decrease.

Advantages of OCR
1. Higher Productivity
OCR software helps businesses to achieve higher productivity by facilitating
quicker data retrieval when required.

2. Cost Reduction
Opting for OCR will help businesses on cutting down on hiring professionals to

9
carry out data extraction, which is one of the most important benefits of OCR data
entry methods.

3. High Accuracy
One of the major challenges of data entry is inaccuracy. Automated data entry tools
such as OCR data entry result in reduced errors and inaccuracies, resulting in
efficient data entry.

4. Increased Storage Space


OCR can scan, document, and catalogue information from enterprise-wide paper
documents.

FEASIBILITY STUDY
The feasibility of the project is analyzed in this phase and business proposal is
put forth with a very general plan for the project and some cost estimates. During
system analysis the feasibility study of the proposed system is to be carried out.
This is to ensure that the proposed system is not a burden to the company. For
feasibility analysis, some understanding of the major requirements for the system is
essential.Three key considerations involved in the feasibility analysis are
1. Economic feasibility

2. Technical feasibility

3. Social feasibility

ECONOMICAL FEASIBILITY
This study is carried out to check the economic impact that the system will have
on the organization. The amount of fund that the company can pour into the
research and development of the system is limited. The expenditures must be
justified. Thus the developed system as well within the budget and this was
achieved because most of the technologies used are freely available. Only the
customized products had to be purchased.
TECHNICAL FEASIBILITY
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand

10
on the available technical resources. This will lead to high demands being placed
on the client. A feasibility study evaluates the project’s potential for success.
SOCIAL FEASIBILITY
The aspect of study is to check the level of acceptance of the system by the
user. This includes the process of training the user to use the system efficiently.
The user must not feel threatened by the system, instead must accept it as a
necessity. The level of acceptance by the users solely depends on the methods
that are employed to educate the user about the system and to make him familiar
with it. His level of confidence must be raised so that he is also able to make some
constructive criticism, which is welcomed, as he is the final user of the system.

4.1.3 LANGUAGES USED IN THE SYSTEM


A language is a formal constructed symbol designed to communicate
instructions to a machine, particularly a computer. Languages can be used to
create programs and control the behavior of the machines or for expressing the
algorithms. This work uses python language.

4.1.3.1 About Python Language


Python is an object-oriented programming language created by Guido Rossum
in 1989. It is ideally designed for rapid prototyping of complex applications. It has
interfaces to many OS system calls and libraries and is extensible to C or C++.
Many large companies use the Python programming language include NASA,
Google, YouTube, BitTorrent, etc. Python programming is widely used in Artificial
Intelligence, Natural Language Generation, Neural Networks and other advanced
fields of Computer Science. Python had deep focus on code readability & this class
will teach you python from basics.

Python Programming Characteristics


➢ It provides rich data types and easier to read syntax than any other
programming languages

➢ It is a platform independent scripted language with full access to operating


system API's

➢ Compared to other programming languages, it allows more run-time flexibility

11
➢ It includes the basic text manipulation facilities of Perl and Awk

➢ A module in Python may have one or more classes and free functions

➢ Libraries in Pythons are cross-platform compatible with Linux, Macintosh, and


Windows

➢ For building large applications, Python can be compiled to byte-code

➢ Python supports functional and structured programming as well as OOP

➢ It supports interactive mode that allows interacting Testing and debugging of


snippets of code

➢ In Python, since there is no compilation step, editing, debugging and testing is


fast.

Applications of Python Programming


Web Applications
You can create scalable Web Apps using frameworks and CMS (Content
Management System) that are built on Python. Some of the popular platforms for
creating Web Apps are: Django, Flask, Pyramid, Plone, Django CMS. Sites like
Mozilla, Reddit, Instagram and PBS are written in Python.

Scientific and Numeric Computing


There are numerous libraries available in Python for scientific and numeric
computing. There are libraries like: SciPy and NumPy that are used in general
purpose computing. And, there are specific libraries like: EarthPy for earth science,
AstroPy for Astronomy and so on. Also, the language is heavily used in machine
learning, data mining and deep learning.

Creating software Prototypes


Python is slow compared to compiled languages like C++ and Java. It might not
be a good choice if resources are limited and efficiency is a must. However, Python
is a great language for creating prototypes. For example: You can use Pygame
(library for creating games) to create your game's prototype first. If you like the
prototype, you can use language like C++ to create the actual game.

12
Good Language to Teach Programming
Python is used by many companies to teach programming to kids and newbies.
It is a good language with a lot of features and capabilities. Yet, it's one of the
easiest language to learn because of its simple easy-to-use syntax.

Python GUI Tkinter


Python offers multiple options for developing GUI (Graphical User Interface).
Out of all the GUI methods, tkinter is the most commonly used method. It is a
standard Python interface to the Tk GUI toolkit shipped with Python. Python with
tkinter is the fastest and easiest way to create the GUI applications. Creating a GUI
using tkinter is an easy task.

To create a tkinter app:


➢ Importing the module – tkinter

➢ Create the main window (container)

➢ Add any number of widgets to the main window

➢ Apply the event Trigger on the widgets.

Importing tkinter is same as importing any other module in the Python code. Note
that the name of the module in Python 2.x is ‘Tkinter’ and in Python 3.x it is ‘tkinter’.
tkinter also offers access to the geometric configuration of the widgets which can
organize the widgets in the parent windows. There are mainly three geometry
manager classes class.

✓ pack() method:It organizes the widgets in blocks before placing in the parent
widget.

✓ grid() method:It organizes the widgets in grid (table-like structure) before


placing in the parent widget.

✓ place() method:It organizes the widgets by placing them on specific positions


directed by the programmer.

13
About Opencv Package

Python is a general purpose programming language started by Guido van


Rossum, which became very popular in short time mainly because of its simplicity
and code readability. It enables the programmer to express his ideas in fewer lines
of code without reducing any readability.

Compared to other languages like C/C++, Python is slower. But another


important feature of Python is that it can be easily extended with C/C++. This
feature helps us to write computationally intensive codes in C/C++ and create a
Python wrapper for it so that we can use these wrappers as Python modules. This
gives us two advantages: first, our code is as fast as original C/C++ code (since it is
the actual C++ code working in background) and second, it is very easy to code in
Python. This is how OpenCV-Python works, it is a Python wrapper around original
C++ implementation.

And the support of Numpy makes the task more easier. Numpy is a highly
optimized library for numerical operations. It gives a MATLAB-style syntax. All the
OpenCV array structures are converted to-and-from Numpy arrays. So whatever
operations you can do in Numpy, you can combine it with OpenCV, which
increases number of weapons in your arsenal. Besides that, several other libraries
like SciPy, Matplotlib which supports Numpy can be used with this.
So OpenCV-Python is an appropriate tool for fast prototyping of computer vision
problems.

4.2 SYSTEM REQUIREMENTS

4.2.1 HARDWARE REQUIREMENTS


Hardware requirement are the principles used for the implementation of the
system which shows what the system does and not how it should be implemented.
Software requirements deal with defining software resource requirement and
prerequisites that need to be installed on a computer to provide optimal functioning
of an application. Such as,

14
System : Pentium IV 2.4 GHz
Hard Disk : 1TB
Floppy Drive : 1.44 Mb
Monitor : 15 VGA Colour
Mouse : Logitech
Ram : 8Gb

4.2.2 SOFTWARE REQUIREMENTS


Software is the term for the various kinds of programs used to operate
computers and related devices
Operating system: Windows 10
IDE : Anaconda
Coding Language: Python

4.2.2.1 CODING LANGUAGES


a) Python
Python is a high-level, interpreted, interactive and object-oriented scripting
language. Python is designed to be highly readable. It uses English keywords
frequently where as other languages use punctuation, and it has fewer syntactical
constructions than other languages.

Python is Interpreted − Python is processed at runtime by the interpreter.

Do not need to compile program before executing it. This is similar to PERL
and PHP.

Python is Interactive − Can actually sit at a Python prompt and interact


with the interpreter directly to write programs.

Python is Object-Oriented − Python supports Object-Oriented style or


technique of programming that encapsulates code within objects.

Python is a Beginner's Language − Python is a great language for the


beginner-level programmers and supports the development of a wide range
of applications from simple text processing to WWW browsers to games.

15
Features
➢ Easy-to-learn − Python has few keywords, simple structure, and a clearly
defined syntax. This allows the student to pick up the language quickly.

➢ Easy-to-read − Python code is more clearly defined and visible to the eyes.

➢ Easy-to-maintain − Python's source code is fairly easy-to-maintain.

➢ A broad standard library − Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.

➢ Interactive Mode − Python has support for an interactive mode which


allows interactive testing and debugging of snippets of code.

➢ Portable − Python can run on a wide variety of hardware platforms and has
the same interface on all platforms.

➢ Extendable − Add low-level modules to the Python interpreter. These


modules enable programmers to add to or customize their tools to be more
efficient.

➢ Databases − Python provides interfaces to all major commercial


databases.

➢ GUI Programming − Python supports GUI applications that can be created


and ported to many system calls, libraries and windows systems, such as
Windows MFC, Macintosh, and the X Window system of Unix.

➢ Scalable − Python provides a better structure and support for large


programs than shell scripting.

16
4.3 METHODOLOGY
4.3.1 SYSTEM ARCHITECTURE

Fig 4.1 System Architecture

The projected system is to observe every character from range plate one by one.
This could be done by morphological operation. It includes a way to section all the
characters employed in the quantity plate. Range plate extraction is that stage
wherever vehicle range plate is detected. The detected range plate is
pre-processed to get rid of the noise then the results passed to the section half to

17
segment the one by one character from the extracted range plate. The divided
characters normalized associate degreed passed to an OCR formula. Ultimately
the optical character info is going to be regenerate into encoded text. The
characters recognized exploitation template matching. The ultimate output should
be within the type of string of characters.

4.3.2 MODULES
4.3.2.1 Data Pre-Processing
The entries are present in the dataset. The null values are removed using df =
df.dropna() where df is the data frame. The categorical attributes
(Date,High,Low,Close,Adj value) are converted into numeric using Label Encoder.
The date attribute is splitted into new attributes like total which can be used as
feature for the model.
1.DataCleaning:
The data can have many irrelevant and missing parts. To handle this part, data
cleaning is done. It involves handling of missing data, noisy data etc.
2.DataTransformation:
This step is taken in order to transform the data in appropriate forms suitable for
mining process.
3.DataReduction:
Since data mining is a technique that is used to handle huge amount of
data.While working with huge volume of data, analysis became harder in such
cases.In order to get rid of this, we uses data reduction technique. It aims to
increase the storage efficiency and reduce data storage and analysis costs.

Convert color to grayscale


Three algorithms for converting color to grayscale
The lightness method averages the most prominent and least prominent colors:
(max(R, G, B) + min(R, G, B)) / 2. The average method simply averages the values:
(R + G + B) / 3. The luminosity method is a more sophisticated version of the
average method

Gaussian filter
A Gaussian filter is a linear filter. It's usually used to blur the image or to reduce

18
noise.The Gaussian filter alone will blur edges and reduce contrast. The
Median filter is a non-linear filter that is most commonly used as a simple way to
reduce noise in an image.
Edge Detection
Each image (video frame) has three significant features to achieve detection
goals. These features include: edges, contours and points. Among mentioned
features, an appropriate option is to use edge pixels. Processing of image pixels
enables us to find edge pixels, which are the main features of passing vehicles in a
roadway video frame.
Edge detection process is demonstrated in a binary image (threshold) with the
detected edge pixels.
The next step is to extract moving edges from sequential video frames and process
the resulting edge information to obtain quantitative geometric measurements of
passing vehicles.

Contour
Contour map uses contours or color-coded regions helps us to visualize 3D
data in two dimensions. Contour maps are also used to visualize the error surfaces
in deep learning/machine learning optimization techniques
Masking
The idea behind masking is to have two additional arrays that record whether
an input or output is actually present for a given time step and example, or whether
the input/output is just padding.

Model Creation ;
CNN Algorithm
A convolutional neural network (CNN) is a specific type of artificial neural
network that uses perceptrons, a machine learning unit algorithm, for supervised
learning, to analyze data. CNNs apply to image processing, natural language
processing and other kinds of cognitive tasks.
CNN image classifications takes an input image, process it and classify it under
certain categories.

We have 4 steps for convolution:

19
➢ Line up the feature and the image

➢ Multiply each image pixel by corresponding feature pixel

➢ Add the values and find the sum

➢ Divide the sum by the total number of pixels in the feature

Training
The training data set in Machine Learning is the actual dataset used to train the
model for performing various actions. This is the actual data the ongoing
development process models learn with various API and algorithm to train the
machine to work automatically.

Testing
It uses patterns identified by your machine learning algorithms to predict. the
machine recognizes patterns in the data, the cross-validation data is used to
ensure better accuracy and efficiency of the algorithm used to train the machine,
and the test data is used to see how well the machine can predict based on its
training.

4.3.2.2 Feature selection:


Features selection is done which can be used to build the model. The attributes
used for feature selection are Date,Price,Adj close, Forecast X coordinate , Y
coordinate, Latitude , Longitude, Hour and month.

4.3.2.3 Building and Training Model:


After feature selection location and month attribute are used for training. The
dataset is divided into pair of xtrain ,ytrain and xtest, y test. The algorithms model is
imported form skleran. Building model is done using model. Fit (xtrain, ytrain). This
phase would involve supervised classification methods like linear regression,
Ensemble classifiers (like Adaboost, Random Forest Classifiers), etc.

4.3.2.4 Number Plate Extraction


The captured image is in capital RGB format. It is converted into grayscale

20
image and into binary image.

4.3.2.5 Character Segmentation


The character segmentation part further segments the character individually
from the extracted number plate. From input image the first process will be to crop
out the number plate characters from starting to the ending point leaving all the
extra wide spaces from top to below and from right to left as it is. Characters are
equally fit in the plate region. For easy comparison of the input character with the
character in the data base the result is normalized into the character set as the size
of the images in the database.

4.3.2.6 Optical Character Recognition


The optical character recognition is a recognition method in which the input is
an image and the output is string of character. OCR is a process which separates
the different characters from each other taken from an image. Template matching
is one of the approaches of OCR. The cropped image is compared with the
template data stored in database. OCR automatically identifies and recognizes the
characters without any indirect input. The characters on the number plate have
uniform fonts then the OCR for number plate recognition is less complex as
compared to other methods.

4.3.2.7 Template Matching


Template matching affects the accuracy of Automatic number plate recognition

4.3.3 UML DIAGRAMS


UML is simply another graphical representation of a common semantic
model.UML provides a comprehensive notation for the full life cycle of object
oriented development. Unified Modeling Language is a general purpose
developmental, modeling language in the field of software engineering that is
intended to provide a standard way to visualize the design of the system.
UML is a standard language for specifying, visualizing, and documenting of
software systems and created by Object Management Group (OMG) in 1997.There
are three important type of UML modeling are Structural model, Behavioral model,

21
and Architecture model. To model a system the most important aspect is to capture
the dynamic behavior which has some internal or external factors for making the
interaction. These internal or external agents are known as actors. It consists of
actors, use cases and their relationships. In this fig we represent the Use Case
diagram for our project.

The Unified Modeling Language is a standard language for specifying,


Visualization, Constructing and documenting the artifacts of software system, as
well as for business modeling and other non-software systems.

The UML represents a collection of best engineering practices that have


proven successful in the modeling of large and complex systems.

The UML is a very important part of developing objects oriented software and
the software development process. The UML uses mostly graphical notations to
express the design of software projects.

GOALS:
The Primary goals in the design of the UML are as follows:
1. Provide users a ready-to-use, expressive visual modeling Language so that
they can develop and exchange meaningful models.
2. Provide extendibility and specialization mechanisms to extend the core
concepts.
3. Be independent of particular programming languages and development
process.
4. Provide a formal basis for understanding the modeling language.
5. Encourage the growth of OO tools market.
6. Support higher level development concepts such as collaborations,
frameworks, patterns and components.

4.3.3.1 USECASE DIAGRAM


A use case is a set of scenarios that describing an interaction between a user
and a system. A use case diagram displays the relationship among actors and use

22
cases. The two main components a user or another system that will interact with
the system modeled. A use case is an external view of the system that represents
some action the user might perform in order to complete a task.

Fig 4.2 Use case diagram

4.3.3.2 SEQUENCE DIAGRAM

A sequence diagram in Unified Modeling Language (UML) is a kind of


interaction diagram that shows how processes operate with one another and in
what order. It is a construct of a Message Sequence Chart. Sequence diagrams are
sometimes called event diagrams, event scenarios, and timing diagrams.

23
Fig 4.3 Sequence diagram
4.3.3.3 Activity Diagram
Activity diagrams are graphical representations of workflows of stepwise
activities and actions with support for choice, iteration and concurrency. In the
Unified Modeling Language, activity diagrams can be used to describe the
business and operational step-by-step workflows of components in a system. An
activity diagram shows the overall flow of control.

Fig 4.4 Activity diagram

24
4.4 TESTING

4.4.1 Software Testing

General
In a generalized way, we can say that the system testing is a type of testing in
which the main aim is to make sure that system performs efficiently and
seamlessly. The process of testing is applied to a program with the main aim to
discover an unprecedented error, an error which otherwise could have damaged
the future of the software. Test cases which brings up a high possibility of
discovering and error is considered successful. This successful test helps to
answer the still unknown errors.

4.4.2 TEST CASE


Testing, as already explained earlier, is the process of discovering all possible
weak-points in the finalized software product. Testing helps to counter the working
of sub-assemblies, components, assembly and the complete result. The software is
taken through different exercises with the main aim of making sure that software
meets the business requirement and user-expectations and doesn’t fails abruptly.
Several types of tests are used today. Each test type addresses a specific testing
requirement.

4.4.3 Testing Techniques


A test plan is a document which describes approach, its scope, its resources and
the schedule of aimed testing exercises. It helps to identify almost other test item,
the features which are to be tested, its tasks, how will everyone do each task, how
much the tester is independent, the environment in which the test is taking place,
its technique of design plus the both the end criteria which is used, also rational of
choice of theirs, and whatever kind of risk which requires emergency planning. It
can be also referred to as the record of the process of test planning. Test plans are
usually prepared with signification input from test
engineers.

(I) UNIT TESTING


In unit testing, the design of the test cases is involved that helps in the validation of

25
the internal program logic. The validation of all the decision branches and internal
code takes place. After the individual unit is completed it takes place. Plus it is
taken into account after the individual united is completed before integration. The
unit test thus performs the basic level test at its component stage and test the
particular business process, system configurations etc. The unit test ensures that
the particular unique path of the process gets performed precisely to the
documented specifications and contains clearly defined inputs with the results
which are expected.

(II) INTEGRATION TESTING


These tests are designed to test the integrated software items to
determine whether if they really execute as a single program or application. The
testing is event driven and thus is concerned with the basic outcome of field. The
Integration tests demonstrate that the components were individually satisfaction, as
already represented by successful unit testing, the components are apt and fine.
This type of testing is specially aimed to expose the issues that come-up by the
components combination.

(III) FUNCTIONAL TESTING


The functional tests help in providing the systematic representation that functions
tested are available and specified by technical requirement, documentation of the
system and the user manual.

(IV) SYSTEM TESTING


System testing, as the name suggests, is the type of testing in which ensure that
the software system meet the business requirements and aim. Testing of the
configuration is taken place here to ensure predictable result and thus analysis of
it.System testing is relied on the description of process and its flow, stressing on
pre driven process and the points of integration.

(V) WHITE BOX TESTING


The white box testing is the type of testing in which the internal components of the
system software is open and can be processed by the tester. It is therefore a
complex type of testing process. All the data structure, components etc. are tested

26
by the tester himself to find out a possible bug or error. It is used in situation in
which the black box is incapable of finding out a bug. It is a complex type of testing
which takes more time to get applied.

(VI) BLACK BOX TESTING


The black box testing is the type of testing in which the internal components of the
software is hidden and only the input and output of the system is the key for the
tester to find out a bug. It is therefore a simple type of testing. A programmer with
basic knowledge can also process this type of testing. It is less time consuming as
compared to the white box testing. It is very successful for software which are less
complex are straight-forward in nature. It is also less costly than white box testing.

(V) ACCEPTANCE TESTING


User Acceptance Testing is a critical phase of any project and requires significant
participation by the end user. It also ensures that the system meets the functional
requirements.

27
CHAPTER 5
CONCLUSION

5.1 CONCLUSION

In this work, we have presented technique to recognize number plate of vehicles.


For this, we introduced Image capture, preprocessing, edge detection,
segmentation, character resizing, feature extraction and finally recognized
character of number plate using machine learning algorithms. Dataset creation
consisted number of images which are collected real times, parking and etc.

5.2 FUTURE WORK


Future work lies in producing more accurate results with lesser response time
according to the prescribed specifications of vehicle number plates and automated
system software is to be developed in future work.

28
REFERENCES
1.A New Approach for Vehicle Number Plate Detection, Sarthak Babbar
; Saommya Kesarwani ; Navroz Dewan ; Kartik Shangle ; Sanjeev Patel, 2018
Eleventh International Conference on Contemporary Computing (IC3)
2.A hierarchical license plate recognition system using supervised K-means and
Support Vector Machine, Wei-Chen Liu ; Cheng-Hung Lin, 2017 International
Conference on Applied System Innovation (ICASI)
3.Deep Learning System for Automatic License Plate Detection and Recognition,
Zied Selmi ; Mohamed Ben Halima ; Adel M. Alimi, 2017 14th IAPR International
Conference on Document Analysis and Recognition (ICDAR)
4.Automatic number plate recognition for motorcyclists riding without helmet,
Yogiraj Kulkarni ; Amit Kamthe ; Shubhangi Bodkhe ; Archana Patil, 2018
International Conference on Current Trends towards Converging Technologies.
5.Automatic car number plate recognition, Anumol Sasi ; Swapnil Sharma
; Alice N. Cheeran, 2017 International Conference on Innovations in Information,
Embedded and Communication Systems (ICIIECS)
6.License Plate Detection with Machine Learning Without Using Number
Recognition, Kazuo Ohzeki ; Max Geigis ; Stefan Alexander Schneider, 2019
Federated Conference on Computer Science and Information Systems (FedCSIS)
7.A New Convolutional Architecture for Vietnamese Car Plate Recognition,
Thanh-Nga Nguyen ; Duc-Dung Nguyen, 2018 10th International Conference on
Knowledge and Systems Engineering (KSE)
8.Bangladeshi License Plate Recognition Using Adaboost Classifier, Prashengit
Dhar ; Md. Zainal Abedin ; Razuan Karim ; Fatema-Tuj-Johora ; Mohammad
Shahadat Hossain, 2019 Joint 8th International Conference on Informatics,
Electronics & Vision (ICIEV) and 2019 3rd International Conference on Imaging,
Vision & Pattern Recognition (icIVPR)
9.Long distance Automatic Number Plate Recognition under perspective
distortion using zonal density and Support Vector Machine, Noprianto ; Sunu
Wibirama ; Hanung Adi Nugroho, 2017 3rd International Conference on Science
and Technology - Computer (ICST)
10.Extraction of number plate images based on image category classification
using deep learning, Yoshihiro Shima, 2016 IEEE International Symposium on
Robotics and Intelligent Sensors (IRIS)

29
APPENDICES
A) SAMPLE CODE
from flask import Flask,url_for,request,render_template,redirect,session
import sqlite3
from werkzeug.utils import secure_filename
import os
import pytesseract
from PIL import ImageFilter
from PIL import Image

import datetime

app=Flask(__name__)
app.config['UPLOAD_FOLDER'] = './media'

app.secret_key="Rudy"

vnumlist=[]
parkingslot=[]
slotname=None
slotnamelist=[]
pytesseract.pytesseract.tesseract_cmd=r"C:\Program
Files\Tesseract-OCR\tesseract.exe"
@app.route('/',methods=["GET","POST"])
def login():
username=None
password=None
err="Invalid username and password"
if request.method=='POST':
session['username']=request.form['uname']
session['vid']=request.form['pwd']
username=request.form['uname']
password=request.form['pwd']
conn = sqlite3.connect("carparking.db")
r=conn.cursor()
r.execute("select name,pwd from userregister where name=? and
pwd=?",(username,password))
rows=r.fetchall()
if username=='Admin' and password=='Admin':
return redirect(url_for('Admin'))
else:
if len(rows)!=0:
for i in rows:
if i[0]==username and i[1]==password:
return redirect(url_for('userpage'))
#return render_template('user.html',username=username)
else:
return render_template('login.html',err=err)

30
else:
return render_template('login.html',err=err)
return render_template('login.html')

@app.route('/reg',methods=["GET","POST"])
def reg():
uname=None
pwd=None
phn=None
ema=None
vtype=None
vnum=None

msg="Register successfully"
if request.method=='POST':
uname=request.form['txt']
pwd=request.form['passw']
phn=request.form['phn']
ema=request.form['ema']
vtype=request.form['vtype']
vnum=request.form['vnum']
try:
import sqlite3
table_name = 'userregister'
conn = sqlite3.connect("carparking.db")
c = conn.cursor()
c.execute('create table if not exists ' + table_name + ' (name
varchar(50),pwd varchar(50) primary key,phn varchar(50),ema varchar(50),vtype
varchar(50),vnum varchar(50))')
c.execute('insert into '+table_name+' values
(?,?,?,?,?,?)',(uname,pwd,phn,ema,vtype,vnum))
conn.commit()
conn.close()
flash("Register successfully")
except:
return render_template('registration.html',msg=msg)
# return render_template('registration.html')
else:
return render_template('registration.html')
return render_template("registration.html")

@app.route('/userpage',methods=["POST","GET"])
def userpage():
err="Your not authorized to park here."
sloterr="Parking slot was full"
if request.method=='POST':
image = request.files['ocrImage']
text = ''
filename = secure_filename(image.filename)
image.save(os.path.join(app.config['UPLOAD_FOLDER'], filename))

31
img = Image.open(os.path.join(app.config['UPLOAD_FOLDER'],
filename))
text = pytesseract.image_to_string(img)
print(text)
session["vnumm"]=text.strip()
conn=sqlite3.connect("carparking.db")
r=conn.cursor()
r.execute("select name,phn,vtype,vnum from userregister where
vnum=?",(session["vnumm"],))
rows=r.fetchall()
li=[]
if len(rows)!=0:
if rows[0][3]==session["vnumm"]:
ss=conn.cursor()
ss.execute("select slot from parkingslot where
status=?",("available",))
slotrow=ss.fetchall()
if len(slotrow)!=0:
for i in slotrow:
li.append(i)
session["slot"]=li[0]
return
render_template("user.html",rows=rows,slotrow=session["slot"])
else:
return render_template("user.html",rows=rows,err=sloterr)
else:
print("noo")
else:
return render_template("user.html",err=err)

return render_template('user.html',text=session["vnumm"])
else:
return render_template("user.html")
return render_template('user.html')

if __name__=='__main__':
app.run(debug=True)

32

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy