0% found this document useful (0 votes)
11 views

Automatic Number Plate Recognition By Using Matlab_Vignes Kumaran_E3_2018

This thesis by Vignes Kumaran presents an Automatic Number Plate Recognition (ANPR) system developed using MATLAB, aimed at enhancing vehicle identification through image processing techniques. The project utilizes a camera for image capture, processes the images via Raspberry Pi 3, and employs morphological operations and Sobel edge detection for character segmentation and recognition, achieving a 95% success rate. The work addresses the challenges of traditional vehicle monitoring and parking management systems, proposing an automated solution to improve efficiency and reduce human intervention.

Uploaded by

Dinh Vo
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)
11 views

Automatic Number Plate Recognition By Using Matlab_Vignes Kumaran_E3_2018

This thesis by Vignes Kumaran presents an Automatic Number Plate Recognition (ANPR) system developed using MATLAB, aimed at enhancing vehicle identification through image processing techniques. The project utilizes a camera for image capture, processes the images via Raspberry Pi 3, and employs morphological operations and Sobel edge detection for character segmentation and recognition, achieving a 95% success rate. The work addresses the challenges of traditional vehicle monitoring and parking management systems, proposing an automated solution to improve efficiency and reduce human intervention.

Uploaded by

Dinh Vo
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/ 37

AUTOMATIC NUMBER PLATE RECOGNITION

BY USING MATLAB

VIGNES KUMARAN

UNIVERSITI SAINS MALAYSIA


2018
AUTOMATIC NUMBER PLATE RECOGNITION BY USING
MATLAB

By

VIGNES KUMARAN

Thesis submitted in fulfillment of the requirement for the Bachelor


Degree of Engineering (Honors) (Electronic Engineering)

June 2018
Acknowledgment

Firstly, I would like to express my utmost gratitude to Dr. Mohd Ilyas bin Mohd

Sazali, my final year project supervisor, for his invaluable guidance and advice in

completing this project and seeing through this thesis. His guidance and patience

throughout the entire duration of this project is greatly appreciated. On top of that, his

incredible insights and support has culminated in the completion of this project.

Moreover, I would also like to thank to School of Electrical & Electronic Engineering for

providing funding which allowed me to carry out the work presented in this thesis. To my

friends and colleagues, special thanks for all the late night conversations when I was under

motivated to run the project. Finally, I would also extend my deepest gratitude to my

beloved family, who have consistently supported all my endeavors, including this project.

Throughout this project they have always been on my side, and supported me in every

aspect in the duration of this project.

i
Table of Content

Acknowledgements……………………………...…………………………..…………..i

Table of Content………………………………...…………………………..………….ii

List of Tables…………………………………………………...…………….………...vi

List of Figures……………………………………………...…...…………………..…vii

List of Abbreviation……………………………………………..……………………..ix

Abstract………………………………………………………….……………………...x

Abstrak………...………………………………………………..….…...………….......xi

Chapter 1 – Introduction

1.1 Background…………………………………………………………….……………1

1.2 Problem Statement……………………………………………………….………….3

1.3 Objectives………………………………………………………………….………. 4

1.4 Project Scope………………………………………………………………….…….5

1.5 Thesis Organization ………………………………………………………………...5

Chapter 2 – Literature Review

2.1 Introduction…………………………………………………………………………7

2.1.1 MATLAB…………………………………………………………………7

2.2 Plate Number Detection…………………………………………………………….8

2.2.1 Grayscaling Process………………………………………………………8

2.2.2 Image Binarization………………………………………………….…….8

ii
2.2.3 Edge Detection……………………………………………………………9

2.2.4 Morphology……………………………………………………………….9

2.2.5 Other methods…………………………………………………………….9

2.3 Character Segmentation……………………………………………………………10

2.3.1 Split and Merge methods…………………………………………………10

2.3.2 Other methods…………………………………………………………….10

2.4 Character Recognition…………………………………………………………...…11

2.4.1 Template Matching……………………………………………………….11

2.4.2 Other Methods……………………………………………………………12

2.5 Summary…………………………………………………………………..………..13

Chapter 3 – Methodology

3.1 Introduction……………………………………………………………….………...14

3.2 Hardware Development………………………………………………………….…17

3.3 Software Development………………………………………………………….….19

3.3.1 Image Acquisition………………………………………………………...21

3.3.2 Preprocessing………………………………………………………….….22

3.3.2.1 Resizing the Image………………………………………….….22

3.3.2.2 Convert Image to Grayscale…………………………………....22

3.3.3 License Plate Detection…………………….…………………………….24

iii
3.3.3.1 Edge Detection……………………………………..…………...24

3.3.3.2 Mathematical Morphology…………………………………..…25

3.3.3.3 Actual Number Plate Detection………………………………...27

3.3.3.4 Extracted Number Plate Region Enhancement…………..……..28

3.3.4 Character Segmentation……………………………………..……………29

3.3.5 Character Recognition………………………………………..…………..30

3.4 Experiment Setup……………………………………………………………...……31

3.5 Summary…………………………………………………………………...……….31

Chapter 4 – Results and Discussion

4.1 Introduction………………………………………………….……………………...32

4.2 The Prototype………….……………………………………………………………32

4.3 Image Acquisition Experiment …….……………………...………….33

4.4 Preprocessing………………………...…….……………………………………….34

4.4.1 Image Resize Experiment…………...……………………….34

4.4.2 Image Conversion to Grayscale Experiment ……………..….35

4.5 License Plate Detection.………………..….……………………………………….35

4.5.1 Edge Detection Experiment……………...………………….35

4.6 Character Segmentation.………………..…….....………………………………….36

4.6.1 Character segmentation Experiment……………...………....36

4.7 System Testing.………………..…………..….....………………………………….38


iv
4.7.1 Unit testing…………………………………………………………….....38

4.7.2 Regression testing ……………………………..........................................38

4.7.3 Integration testing………………………………………………………....41

4.7.4 Functional testing………………………...…………….………………....42

4.7.5 Compatibility testing…………………………...………………………....42

4.7.6 System testing……………………………………….…………………....43

Chapter 5 – Conclusion

5.1 Conclusion...…………………………….……………………………….…………46

5.2 Future Works……………………………………….…………………..….……….47

References……………………...……………………..………………………………..48

Appendices

Appendix A: MATLAB Coding……………………………….……………………..51

Appendix B: Template Character Images …………..………………..……………..60

Appendix C: Vehicle Number Plate Images ………….….……………...…………..62

v
List of Table

Table 3.1 Hardware Specification 18

Table 4.1 Result of Image Acquisition 34

Table 4.2 Result of Resizing Image 34

Table 4.3 Result of Grayscale Conversion 35

Table 4.4 Result of Edge Detection Methods 36

Table 4.5 Result of Bounding Box Size 36

Table 4.6 Result of Regression Test 38

Table 4.7 Result of Integration Test 41

Table 4.8 Result of Functionality Test 42

Table 4.9 Result of Image Format Tested in the System 42

Table 4.10 Result of System Testing 44

vi
List of Figures

Figure 2.1 ANPR Parking System 2

Figure 3.1 Build implementation flow chart 15

Figure 3.2 System Architecture 16

Figure 3.3 Pi NoIR Camera V2 17

Figure 3.4 Raspberry Pi 3 Model B 17

Figure 3.5 Flow chart 19

Figure 3.6 Input Image 21

Figure 3.7 Camera Configuration 22

Figure 3.8 Output of resize function 23

Figure 3.9 Gray Scale Image 23

Figure 3.10 Edge Detection by Sobel operator 25

Figure 3.11 Morphology Dilation Operation 26

Figure 3.12 Image after filling holes 26

Figure 3.13 Morphology Erosion Operation 27

Figure 3.14 Number plate area detection 27

Figure 3.15 Number plate from input vehicle image 28

Figure 3.16 Enhanced Number Plate 28

Figure 3.17 Extracted character from number plate 29

vii
Figure 3.18 Templates Used for Template Matching 30

Figure 4.1 The overall system prototype 33

Figure 4.2 Image captured through camera 43

viii
List of Abbreviations

ALPR Automatic License Plate Reader

ANN Artificial Neural Network

ANPR Automatic Number Plate Recognition

BLE Bluetooth Low Energy

CPR Car Plate Recognition

HIS Hue Intensity Saturation

HT Hough Transform

ITS Intelligent Transportation System

LPR License Plate Recognition

MLPR Mobile License Plate Reader

NPT Number Plate Tracking

RGB Red Green Blue

ROI Region of Interest

SCW Sliding Concentric Window

ix
AUTOMATIC NUMBER PLATE RECOGNITION BY USING MATLAB

ABSTRACT

Usually, surveillance system is used for security purposes and monitoring systems. This

surveillance system is also used for home security, traffic monitoring and at ATM

security. Human activity detection and tracking has increased in usage due to decreasing

cost of video surveillance camera. Moreover, automated systems had been designed for

numerous detection tasks, but the task of detecting illegally parked vehicles has been left

for human operators of surveillance system. Automatic Number Plate Recognition

(ANPR) system is an image processing technology that identifies the vehicle by tracking

its number plate without direct human involvement and it is widely used in Intelligent

Transportation System (ITS). In this project, extraction and recognition of vehicle number

plate from an image is done by using MATLAB. The image of the vehicle is captured by

using camera and the image is sent to MATLAB by using Raspberry Pi 3. Besides, this

project presents an approach based on morphological operation and Sobel edge detection

method. Then, the approach is simplified to segmentation of all the characters in the

number plate by using bounding box method. The segmented character on the plate has

been extracted and recognized by using template images of alphanumeric character.

Furthermore, new algorithm in MATLAB has been used to extract the vehicle number

plate in various luminance condition. The system able to detect vehicle number plate at

95% success rate.

x
PENGESAN NOMBOR KENDARAAN SECARA AUTOMATIK DENGAN

MENGGUNAKAN MATLAB

ABSTRAK

Lazimnya, sistem pengawasan digunakan untuk sistem pemantauan dan sistem

keselamatan. Sistem pengawasan ini digunakan untuk keselamatan rumah, pemantauan

lalu lintas dan keselamatan ATM. Pengesanan dan pengesanan aktiviti manusia

meningkat secara praktikal kerana penurunan dalam kos kamera pengawasan video.

Selain itu, sistem automatik telah direka untuk pelbagai tugas pengesanan, tetapi tugas

mengesan kenderaan yang diletak secara haram telah diserahkan untuk pengendali sistem

pengawasan yang menggunakan tenaga manusia. Sistem Pengesan Nombor Kenderaan

Secara Automatik (ANPR) adalah teknologi pemprosesan imej yang mengenal pasti

kenderaan dengan mengesan nombor pendaftaran kereta tanpa penglibatan manusia

secara langsung dan ia digunakan secara meluas dalam Sistem Pengangkutan Pintar

(ITS). Dalam projek ini, pengekstrakan dan pengesanan nombor kenderaan daripada

gambar dilakukan dengan menggunakan MATLAB. Gambar kenderaan diambil dengan

menggunakan kamera dan gambar tersebut dihantar ke MATLAB dengan menggunakan

Raspberry Pi 3. Selain itu, projek ini membentangkan pendekatan berdasarkan operasi

morfologi dan kaedah pengesanan Sobel. Kemudian, pendekatan itu dipermudahkan

dengan membahagikan semua aksara dalam plat nombor dengan menggunakan kaedah

kotak terikat. Watak bersegmen pada plat telah diekstrak dan dikesan dengan

menggunakan imej template watak abjad dan angka. Selain itu, algoritma baru dalam

MATLAB telah digunakan untuk mengesan nombor pendaftaran kenderaan dalam

pelbagai keadaan pencahayaan. Sistem ini dapat mengesan plat nombor kenderaan pada

kadar kejayaan 95%.

xi
CHAPTER 1

Introduction

1.1 Background

A number plates is attached to vehicle for identity purposes and it is a legal necessity

that applies to vehicles in most countries. It gives a unique identity to a vehicle, which

can be used to trace the vehicle owner through a database which is linked to the record of

information, such as owner details and vehicle details. All license plates must be

registered with the owner’s name, address, and registered number under the world’s first

license plate rule which is applied in France on 14 August 1983.

Currently, a license plate can be used to avoid traffic violations such as car theft,

running the red light and over speed. However, due to the increasing number of vehicle

from year to year, it is not possible to manually keep record of entire vehicle and traffic

violations are appearing more frequently. Although, many of surveillance cameras are

installed at places such as parking booths, toll booths, gated and guarded community areas

and traffic lights, they require man-power to check their images and note down the vehicle

registration number so that it can be sent to appropriate department to take rule violators

action. To overcome this problem, the Automatic Number Plate Recognition (ANPR) was

invented. This ANPR is also known as License Plate Recognition (LPR), Car Plate

Recognition (CPR), Mobile License Plate Reader (MLPR), Automatic License Plate

Reader (ALPR) and Number Plate Tracking (NPT) [1, 2].

Automatic Number Plate Recognition (ANPR) is a system which aids human to detect

car number plate. Besides, ANPR is an image processing technology that able to

automatically identify the vehicle by extracting car number plate characters from an

1
image without direct human involvement. This system is able to extract and recognize the

car number plate characters from stationary camera monitoring system and mobile

monitoring system. It is an easier method for vehicle identification. Mechanically, ANPR

is beneficial for many businesses and organizations for a wide variety of applications

including vehicle parking lot management, highway ticketing, electronic toll collection

and security applications such as access control to restricted areas and tracking of wanted

vehicles [3].

Besides, ANPR can be used as a form of security at campus and gated communities

through automatic opening of the gate only to authorized vehicles. ANPR will recognize

the car number plate automatically and compare the number with the numbers in the

database. If that specific plate number is in the database, then the gate lifts up and the car

will be allowed to enter the property. This can help save man power as the security guards

do not have to open and close the gate manually.

Moreover, ANPR can also be used as parking management system at parking garages

and parking lots [4] as shown in Figure 2.1. It can improve traffic flow during peak

periods and manage information about car park usage. ANPR also can help user to

relocate their vehicle in a large parking lot by detecting the location of the vehicle after

the car plate number is inserted by users.

Figure 2.1: ANPR Parking System


2
ANPR had been developed for many years and its accuracy had been improved with

the implementation of new hardware and software. However, the current accuracy is not

able to satisfy all the requirements in various fields. Successful implementations of ANPR

system will make the vehicle identification process becomes faster and easier.

1.2 Problem Statement

Many years ago, private car was a deluxe device and it will only be used by a few

people. Time consciousness in the modern day has made the car a basic need in human

life. Therefore, the number of car owners is increasing every day because every person

expects the freedom to travel and comfort while travelling. They travel from one place to

another for a great variety of reasons. Most family in developed countries own at least a

car and this situation is not much different in developing countries either. However,

owning a car has some disadvantages as well. The main disadvantage of owning a car is

difficulties to find a parking spot.

In Malaysia, most of the parking management at parking lots are using conventional

car park ticketing system which requires human effort to keep the parking ticket safely

and pay at autopay station. However, the problem will arise in this conventional car park

system when the user had misplaced or accidently lost the parking ticket. The user will

be charged a higher rate as they could not verify the duration they used the car park.

Besides, the low quality of the parking ticket will cause difficulties to autopay machine

system to calculate the amount of fee for the parking service. This conventional car park

ticketing system also might cause damage to the car as the user has to drive their car close

to the parking ticket kiosk for them to reach out their hand to the kiosk and take the

parking ticket.

3
Furthermore, the gated community usually use membership sticker which will be

attached on the windscreen of the vehicle to enable the car driver to get access to the

place. Thus, the security guard must be hired for them to check each vehicle one by one

and confirm the membership details by checking the membership sticker on the

windscreen of the vehicle or by checking the driver’s identification card before giving

permission to enter the gated area. The security guard must record the vehicle details such

as vehicle number plate onto an occurrence book which might cause in loss of data

because the data is stored in hardcopy and difficult to backup.

By employing automatic number plate recognition system in car park management

and gated community security control, conventional car park ticketing system and human

control security can be replaced. However, current ANPR system has its own

disadvantages as the vehicle image must be captured from a fixed distance [5]. The

current ANPR system also faces major problem when detecting vehicle license plate with

different length of license plate [6].

1.3 Objectives

1. To develop an automatic number plate recognition system by using MATLAB.

2. To develop a system that able to recognise vehicle license plate with different

distance of vehicle licence plate from camera and identify the unregistered

vehicle.

3. To create a device hardware capable of capturing pictures and sending the data

via a Wi-Fi network to a server.

4
1.4 Project Scope

For this project, the proposed system serves as an improvement and alternative to the

car identification and current car park management system. The scope of the project is to

develop an algorithm to identify the characters from vehicle license plates by using

MATLAB software. The mechanisms of this project consist of personal computer to

integrate all the software and Raspberry Pi Noir camera board v2 to capture the real time

image into personal computer for license plate recognition process. In practice, the system

must be able to reduce human effort in managing the increasing number of car.

1.5 Thesis Organization

This thesis is split into five chapters, each of which containing important descriptions

of this project. Various progressions and parts of this project are described in these

chapters, and in reading this thesis, a more in-depth understanding of image processing

for car plate number recognition will be acquired. This thesis is structured as follows:

Chapter 1: An introduction to the build of this project, which includes the Background,

Problem Statement, Objectives and Project Scope.

Chapter 2: An exhaustive literature review of this study is presented, where it summarizes

the recent researches and scholarly sources relevant on the particular issues

and theories in this project.

5
Chapter 3: This chapter is dedicated to the Methodology of this build, where the process

flow in developing this system is thoroughly described. The architecture of

the system, both hardware and software in its entirety is illustrated and

explained in this chapter.

Chapter 4: Here the various experiments and tests that are conducted throughout the

development of this system are presented and discussed. In addition, the

obtained results or performance are presented and discussed in detail.

Chapter 5: The conclusion and the highlight in the development of the system is put forth

in this chapter, following which a couple of interesting directions to be

undertaken and pursued are detailed here as well as future implementation.

6
CHAPTER 2

Literature Review

2.1 Introduction

In general, ANPR systems are divided into four steps, namely input image capture,

number plate detection, character segmentation and character recognition. The accuracy

of number plate recognition mainly depends on the quality of input image capture. The

input image which has low quality and does not have component of vehicle number plate

might cause the system to detect the number plate wrongly and this will be one of the

major issues that will lead to an inaccurate result. This chapter will focus more on the

literature survey on vehicle number plate detection. This chapter starts off with the

introduction about the MATLAB software in section 2.1. Section 2.2 investigates the

image segmentation techniques to detect vehicle number plate, while Section 2.3 goes

into the character segmentation method. The character recognition methods which is used

to detect vehicle plate number are explained in Section 2.4. The final portion of this

literature review which is Section 2.5 concludes this chapter.

2.1.1 MATLAB

MATLAB is a data analysis and visualization tool which has been designed with

powerful support for matrices and matrix operations that has excellent graphics

capabilities and powerful programming language. MATLAB programs which are known

as toolboxes are designed to support a task such as investigating images and their

properties which will be supported by image processing toolbox and image acquisition

toolbox. A MATLAB function such as sin, imread, and imclose is a keyword which

accepts various parameters and produces output in the form of a graph, a string, a matrix

or a figure. MATLAB’s standard data type is the matrix and all the data are matrices. For

example, images are matrices whose elements are the grey values or RGB values of

7
pixels. Single values are considered by MATLAB to be 1 x 1 matrix, while a string is

merely a 1 x n matrix of characters where n is the string’s length.

2.2 Number Plate Detection

Number plate detection is a process to locate the vehicle number plate which will help

the ANPR system for faster character identification over a smaller region. To detect the

vehicle number plate, factors such as number plate size and number plate location must

be considered as the vehicle number plate can be of different sizes in different input

images and the number plate can be located anywhere in the vehicle. The vehicle number

plate can be detected by using image segmentation method and there are various image

segmentation methods that can be applied. In the following sections, common vehicle

number plate detection methods are explained, and it is followed by detailed discussion

of image segmentation techniques implemented in various literatures.

2.2.1 Grayscaling Process

Grayscaling is a process of converting a multicolor image to a gray scale image

by calculating the threshold value of the image. A correct threshold value is important to

provide sufficient contrast to differentiate foreground and background in an image [2].

2.2.2 Image Binarization

Binarization is a process of converting a pixel image to a binary image and it will

produce black and white image from a grayscale image. In this method, threshold must

be set to classify black pixels and white pixels. The threshold can either be set fixed or

adaptive using a clustering algorithm which is called Iso Data Algorithm [5]. This

8
algorithm will first count the appearance of each tone in the image and tries to find a good

center.

2.2.3 Edge detection

Edge detection technique is a mathematical method that identifies the boundaries

of objects in an image. It is a basic method for image segmentation and data extraction.

Different edge detection algorithms such as Sobel, Canny, Prewitt, Canny-Deriche,

Differential, and Roberts Cross can be used for edge detection [7].

2.2.4 Morphology

Morphology is a set of image processing operations that are useful in the shape

representation and extraction of geometrical structure. Morphology is well suited for

binary image processing that is used to detect boundaries of object. The most basic

morphological operations are dilation and erosion. Dilation will cause object to grow as

it adds pixels to the boundaries of object in an image while erosion will cause the size of

object to decrease as it removes pixels on object boundaries [5].

2.2.5 Other methods

Image binarization, edge detection and morphology are basic methods for plate

identification. Aside from these techniques, various researches discussed about various

techniques for plate detection. Anagnostopoulos et al. [7] proposed sliding concentric

window (SCW) technique that consists of two steps method containing two concentric

windows moving from upper left corner of image which calculate the statistical

measurement in both windows based on segmentation rule that says the central pixel of

the windows is considered belong to region of interest (ROI) if the ratio of the median or

9
mean in the two windows exceeds a threshold that had been set based on try and error

basis. Chen et al. [8] proposed a feature silent method to extract vehicle number plate by

using features such as texture, shape, and colour. Hough transform (HT) was used to

detect horizontal and vertical line from vehicle number plate. Then, red, green, blue

(RGB) is converted to hue-intensity-saturation (HIS) before number plate is segmented.

Lakshmi et al. [9] proposed a novel approach for Indian License Recognition System

which is based on wavelets and texture characteristics. Morphology operation was also

used for better performance.

2.3 Character Segmentation

Character segmentation is the step that acts as a bridge between the number plate

detection and character recognition. In this phase, the area that contains characters are

extracted one by one from the number plate [10].

2.3.1 Split and merge methods

Split and merge is also known as quadtree segmentation where it is based on

quadtree partition and the data structure used is called quadtree. It divides regions that do

not pass the homogeneity test and combine regions that pass the homogeneity test [5].

2.3.2 Other methods

In some algorithms, character segmentation is done by using region-based image

segmentation technique to classify a particular image into several regions according to

the ordinary characteristic of the image [8]. In this technique, the regions are grouped to

ensure the pixels in the region have the similar value of the properties such as pattern and

texture, spectral profile of the image, and the intensity values. Pan et al. [10] proposed an

10
improved projection method by mentioning three-step procedures for character

segmentation which start with correction of vertical, horizontal and compound tilts. Then,

to detect connected boundaries, lines are drawn in between first and last characters before

the characters are segmented after removing noise. Ozturk and Ozen [11] used vertical

and horizontal histogram method to determine the boundaries of character by using

column sum vectors. Two adjacent characters are separated in two based on the algorithm.

2.4 Character recognition

Character recognition is the last stage in ANPR that identifies and converts segmented

character from an image into editable text. Character recognition has been a complication

in the field of image processing, as there is high probability that the character produced

from the normalization step varies from the database in terms of shape, size and style that

could result in inaccuracy in character recognition and affect the usefulness of the whole

system. Character recognition is the most important task in recognizing the number

plate and the system must be able to differentiate the character correctly as sometimes the

system may be complicated due to the similarities in the form of shape as the characters

consist of numbers and letters. In this section, each method that is used to identify

character using the features extraction is explained.

2.4.1 Template matching

Template matching has been used widely in face detection, medical image

processing and ANPR. The recognition of the segmented character in ANPR is done by

calculating the correlation coefficient where the template character that scores the highest

correlation is selected as the character of the segmented character from an image. The

size of the segmented character image and the template character must be the same [12].

Recently, Puranic et al. [13] proposed the development of automatic vehicle plate

11
detection system by utilising template matching concept which calculates the correlation

coefficient and the template character that scored the highest correlation will be selected

as the character of the input segmented character.

2.4.2 Other methods

In some algorithms, character recognition is done by using k-nearest neighbour

(KNN) which the technique recognised the character based on least difference between

the segmented character and the template character. Soon et al. [14] used KNN to classify

the characters for recognition purpose. In this approach, every character class must train

the KNN classifier by using training samples which will be extracted as feature vectors

for the classifier. However, character similarities such as “5” and “6”, “1” and “7” might

cause inaccuracy in recognition. Bedruz et al.[15] used Fuzzy Image Processing for text

detection and character recognition. This system has a short processing time and high

accuracy but it is sensitive to distortion and noise. More recently, Maghsoudi et al. [16]

proposed Artificial Neural Network(ANN) technique in automatic car plate detection and

recognition system. ANN provides good accuracy in recognition, but it requires periodic

training for better accuracy and it has longer processing time.

12
2.5 Summary

In summary, the current and basic knowledge on vehicle number plate detection and

its approaches were studied in this chapter. The general understanding on MATLAB

software were explored as well. The proposed project aims to develop an ANPR using

the knowledge obtained in this literature review. Moreover, the limitation of the current

ANPR system were identified which the vehicle image must be captured from a fixed

angle and fixed distance.

13
Chapter 3

Methodology

3.1 Introduction

As mentioned in the previous chapter, the idea is to build a device capable of

detecting vehicle number plate automatically. Attached to this project are two major

components, that are hardware development and software development. The device is

made up of Raspberry Pi 3 Model B which captures image using Pi Noir Camera V2.

This image is then sent over via a Wi-Fi network to MATLAB software. The MATLAB

software will detect car number plate automatically by using image processing toolbox.

Figure 3.1 shows the build flowchart with a detailed breakdown of the development of

individual components such as the software development and hardware development

whereas Figure 3.2 illustrates a basic breakdown of the entire system architecture for

ANPR. The hardware development will be detailed in Section 3.2, while the system

architecture development will be explained in Section 3.3.

14
Start

Research and Literature Review

Hardware Development

Raspberry Pi 3 Model B

Pi NoIR Camera V2

Software Development

MATLAB Version 9.3.0.713579

No
System Testing and
Troubleshooting

Yes

Results and Discussion

End

Figure 3.1: Build implementation flow chart

15
Pi NoIR Camera Raspberry Pi 3
V2 Data Model B
captured

Wireless local area


MATLAB
network
software

View Data

Security guard

Figure 3.2: System Architecture

16
3.2 Hardware development

Automatic Number Plate Recognition system consists of hardware such as camera,

controller board and a computer. In this project, Pi NoIR Camera V2 is used in the image

acquisition stage. It is primarily used to capture the image of vehicles. Figure 3.3 shows

the camera used in this build.

Figure 3.3: Pi NoIR Camera V2

Besides that, Raspberry Pi 3 Model B is used as the controller board for this project as

shown in Figure 3.4. This controller board is used to send the captured image via Wi-Fi

network to the computer that had been installed with MATLAB software. Table 3.1 shows

the hardware specifications used in this ANPR system.

Figure 3.4: Raspberry Pi 3 Model B

17
Table 3.1: Hardware specification

Hardware Specification

Pi NoIR Camera V2 Weight: 3g

Still resolution: 8 Megapixels

Video Modes: 1080p30, 720p60 and 640 x 480p60/90

Sensor: Sony IMX219

Sensor resolution: 3280 x 2464 pixels

Sensor image area: 3.68 x 2.76mm

Pixel size: 1.12µm x 1.12µm

Raspberry Pi 3 Model B Quad Core 1.2GHz Broadcom BCM2837 64bit CPU

1GB RAM

BCM43438 wireless LAN and Bluetooth Low Energy

(BLE) on board

Asus Laptop Processor: Intel Core i7-3610QM CPU @ 2.30GHz

RAM: 8.00GB

System Type: 64-bit operating system

Operating System: Windows 10

18
3.3 Software Development

Automatic Number Plate Recognition system uses MATLAB software Version

9.3.0.713579 or R2017b to recognize vehicle plate number automatically. This MATLAB

software is installed in Windows 10 operating system. Figure 3.5 shows the flowchart

diagram of the steps done by the MATLAB software to recognize vehicle plate number

automatically. The details of each step are to follow in the following sections. The

MATLAB code is provided in Appendix A.

Start

Image Acquisition

Resizing the Image

Convert Image to Grayscale

Edge Detection

Mathematical Morphology

Actual Number Plate Detection

Character Segmentation

19
Character Segmentation

Bounding box height > h/3


&& width < h

YES

Resizing the Character

YES NO
Templates Loading and Reading

Character Recognition

Bounding Box ?

NO

Detected Number Plate == Display “detected number plate


NO
Registered number not registered”

YES

Display “registered number plate


Display Input Image
detected”

End

Figure 3.5: Flow chart

20
3.3.1 Image Acquisition

Image Acquisition is the process of obtaining an image from the digital camera. Images

are taken at various distances in different backgrounds and illuminations. Different types

of images such as bright image, dark image and blurred image can be acquired during

camera capturing. Figure 3.6 shows the input image of a vehicle image. This vehicle

image can be captured by using image acquisition toolbox which can help MATLAB to

get image and video directly from the camera. Besides that, MATLAB can detect the

hardware and configure the hardware properties automatically. Figure 3.7 shows the

screenshot of the camera configuration that has been detected by MATLAB automatically

and this camera properties can be altered easily.

Figure 3.6: Input Image

21
Figure 3.7: Camera Configuration

3.3.2 Preprocessing

The preprocessing is used to improve the input image and make it suitable for vehicle

number plate recognition. Preprocessing will enhance the image by removing the

background noise, removing image reflection, image debluring and normalizing the

intensity of individual image particles. The preprocessing for vehicle license plate number

is done in several methods.

3.3.2.1 Resizing the Image

After the image is acquired, the image is resized to 480 x NaN resolution. In this

resolution, the RGB image will resize to have 480 rows and the number of columns is

calculated automatically. The resizing is used to resize an image and make the input

images size become more constant which will allow the system to perform operation in a

more effective manner by decreasing its computational time. imresize function is used to

resize an image in MATLAB. Figure 3.8 shows the input and output image that is resized

using resized function in MATLAB.

22
Input Image Output image

Figure 3.8: Output of resize function

3.3.2.2 Convert Image to Grayscale

The captured input image is converted from RGB image to gray scale image. This

conversion is done by using rgb2gray function in MATLAB. Figure 3.9 shows the gray

scale image. The RGB image is converted to gray scale by eliminating the saturation

information while retaining the luminance. This is done by converting RGB values to

gray scale value by forming a weighted sum of the R, G and B components.

Figure 3.9: Gray Scale Image

23
3.3.3 License Plate Detection

License plate detection identifies specific features that contain the vehicle number plate

in an input image. The vehicle number plate can be found anywhere within an image and

it is impractical to check all the pixels of the image in order to locate the vehicle number

plate. Therefore, the license plate detection can help ANPR system to only focus on those

pixels that have number plate. License plate detection can be categorized into four

subsections which are edge detection, mathematical morphology, actual number plate

detection and extracted number plate region enhancement. A brief explanation of these

subparts is as following subsections.

3.3.3.1 Edge detection

Edge detection using Sobel method is done on binary image in order to identify the

boundaries of character that are not broken as the edges. This edge detection is a set of

mathematical methods that identify points in digital image at which the brightness

changes sharply and has discontinuities. The point at which image brightness changes

sharply are typically organized into a set of curved line segments termed edges. Figure

3.10 shows the results of applying Sobel operator to binarized image. Edge detection is

used to distinguish the edge in picture to localize the position of vehicle number plate.

After experimenting with different types of edge detection method which consist of Sobel,

Prewitt and Canny; Sobel edge detection method was chosen as it provides the fastest

processing time.

24

You might also like