The project explains various algorithms that are exercised to recognize the characters present on the California Car License Plate. One of them is Template Matching algorithm that has an ability to store the information of a particular size template in th

Authors Avatar

CAR LICENSE PLATE RECOGNITION USING TEMPLATE MATCHING ALGORITHM

Pramod S. Kapadia

B.E., Pune University, India, 2006

PROJECT

Submitted in partial satisfaction of

the requirements for the degree of

MASTER OF SCIENCE

in

ELECTRICAL AND ELECTRONIC ENGINEERING

at

CALIFORNIA STATE UNIVERSITY, SACRAMENTO

FALL

2010


CAR LICENSE PLATE RECOGNITION USING TEMPLATE MATCHING ALGORITHM

A Project

by

Pramod S. Kapadia

Approved by:

__________________________________, Committee Chair

Jing Pang, Ph.D.

__________________________________, Second Reader

Preetham B. Kumar, Ph.D.

____________________________

Date


Student:  Pramod S. Kapadia

I certify that this student has met the requirements for format contained in the University format manual, and that this project is suitable for shelving in the Library and credit is to be awarded for the Project.

__________________________, Graduate Coordinator        ___________________

Preetham B. Kumar, Ph.D.                                           Date

Department of Electrical and Electronic Engineering


Abstract

of

CAR LICENSE PLATE RECOGNITION USING TEMPLATE MATCHING ALGORITHM

by

Pramod S. Kapadia

License Plate Recognition or LPR is an image-processing technology used to identify vehicles by their license plates. This technology is used in various applications involving security, traffic, law enforcement, public safety and transportation sectors. It mainly uses software code that enables computer systems to read automatically the registration number (license number) of vehicles from digital pictures.

The project explains various algorithms that are exercised to recognize the characters present on the California Car License Plate. One of them is Template Matching algorithm that has an ability to store the information of a particular size template in the form of four 16-bit vectors and apply it for recognizing the characters. 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 in order for Template Matching to be done.

The final goal of the project was to simulate these algorithms initially on Microsoft Visual Studio using Open CV libraries. Once this was established, the design was transferred on the TI’s video development platform DM6437 DVDP for testing and performance analysis. The earlier mentioned algorithmic steps were written in C programming language and demonstration of the project was successfully presented on the TI’s DSP board EVM320DM6437.

_______________________, Committee Chair

Jing Pang, Ph.D.

_______________________

Date


ACKNOWLEDGMENTS

I would sincerely like to thank Dr. Jing Pang for providing me a wonderful opportunity to work on this project, which provided a great exposure to the field of image and video processing. I am grateful that she provided all the necessary resources, help and guidance needed to complete the project successfully. Her knowledge and expertise in the DSP field was very beneficial to me in order to understand the project and finish it successfully. Without her key practical inputs, this project would not have completed successfully on the Texas Instrument DAVINCI EVM320DM6437 board, which is currently an industry-recognized platform.

I would like to express my brief appreciation towards the engineering community at Texas Instruments for providing vital information about video processing steps and methodologies on the above-mentioned board.

I would also like to thank Dr. Preetham B. Kumar for reviewing my report and providing valuable suggestions that helped me to improve my project report. I would like to show my gratitude towards all the faculty member of Department of Electrical and Electronics Engineering at California State University, Sacramento for the help and support to complete my graduation successfully. Last but not the least; I would like to heartily thank my family members and all my friends for providing me strength and inspiration during difficult times in the past 1 year.


TABLE OF CONTENTS

                                                                                        Page

Acknowledgments         vi

List of Tables         ix

List of Figures         x

Chapter

        1.   INTRODUCTION          1

                        1.1 Introduction to License Plate Recognition System          1

                        1.2 Purpose of the Project          1

                        1.3 Significance of the Project         2

            1.4 Organization of Report         2

        2.   BASIC INTRODUCTION TO DIGITAL IMAGING         4

                        2.1 Digital Imaging         4

                        2.2 The RGB Color Space         4

            2.3 YUV Color Space         5

                        2.4 YCrCb (or YCbCr) Color Space         5        

        3.   LICENSE PLATE CHARACTER RECOGNITION ALGORITHMS…………...6

                        3.1 Design Approach         6

            3.2 Design Overview         6

                        3.3 Algorithm Description         8

                              3.3.1 Image Processing         8  

         3.3.2 Defragmentation         9

                              3.3.3 Resizing         9

                              3.3.4 Four Quadrant Algorithm         12  

                                 3.3.5 Template Matching         14  

4.   TMS320DM6437 DVDP PLATFORM OVERVIEW         18

                        4.1 Introduction         18

                        4.2 Video Interfaces on TMS320DM6437 DVDP         19

                        4.3 DM6437 Functional Overview         19

                        4.4 TMS 320C64X+ DSP Cache         22

        4.5 Design Implementation         22

        5.   SIMULATION AND IMPLEMENTATION RESULTS         25

                        5.1 Results and Performance Analysis         25

                        5.2 Simulation Results         26

                                 5.2.1 Case 1: Clear Image and High Resolution         26

                                 5.2.2 Case 2: Low Quality Image and Poor Lighting Condition         28

                              5.2.3 Case 3: Blurry Image         29

                              5.2.4 Case Analysis         30

                        5.3 Implementation Results         31

                                 5.3.1 Case 1: High Quality Image         31

                                 5.3.2 Case 2: Low Quality Image (Plate Detection + Recognition)         32

                              5.3.3 Case 3: Bright Image (Plate Detection + Recognition)         33

                              5.3.4 Case Analysis         34

                        5.4 Performance Analysis         35

                        5.5 Optimization Techniques         37

                                 5.5.1 Code Optimization         37

                                 5.5.2 Cache Optimization         39

                              5.5.3 Compiler Optimization         40

                                 5.5.4 Optimization Results and Summary         41

        6.        CONCLUSION        43

        Appendix Simulation and Implementation Code         44

        References         72


        

LIST OF TABLES

        Page

1.        Table 3.1 Vectors for 36 Templates (Characters + Numbers)………………...…17

2.        Table 5.1 Simulation and Implementation Results…..……………….……...…..25

3.            Table 5.2 Case 1 Simulation Results for Character Recognition……….………..27

4.        Table 5.3 Case 2 Simulation Results for Character Recognition………………...29

5.        Table 5.4 Case 3 Simulation Results for Character Recognition………………...30

6.            Table 5.5 Performance Profile Summary…………….…………………...……...36

7.        Table 5.6 Performance Profile Summary After Cache Optimization…..………..40

8.            Table 5.7 Performance Profile Summary Before and After Optimization

               with CPU of 600 Mhz…………………………………………………………....42


LIST OF FIGURES

             Page

 1.        Figure 3.1 California License Plate ...…..………….……………….…..………...7

 2.        Figure 3.2 Template for Database……….….…………..……….....…………...…8

 3.        Figure 3.3 Resizing Algorithm Basic Concept..…….……..……..…………...…10

 4.        Figure 3.4 Resizing Algorithm Requirement….………..……..……………..…..11

 5.        Figure 3.5 Resizing Algorithm Graphical Representation……..….….……….....12

 6.        Figure 3.6 Four Quadrant Generation Basic Flow……………..………...…........13

 7.              Figure 3.7 16 Bit Vector Generation using Four Quadrant Algorithm….....…….13

 8.        Figure 3.8 Template Matching Vector Comparison……….….……………..…..15

 9.        Figure 4.1 Block Diagram of EVM DM6437...……………….……………...….18

10.        Figure 4.2 Functional Block Diagram of DM6437....…….……….………….....20

11.        Figure 5.1 Simulation Results for Case 1……………………………..…....…....27

12.        Figure 5.2 Simulation Results for Case 2…….………..…………………...........28

13.        Figure 5.3 Simulation Results for Case 3….………….….…………………...…30

14.        Figure 5.4 Implementation Results for Case 1…………….…………………......32

15.        Figure 5.5 Implementation Results for Case 2…………………..…………..…...33

16.        Figure 5.6 Implementation Results for Case 3….…………………………..........34

                


Chapter 1

INTRODUCTION

1.1. Introduction to License Plate Recognition System

The License Plate Recognition (LPR) system is an integrated hardware and software device, which has the ability to detect and read the characters from the license plate and convert it into electronic text like ASCII characters. Research has shown that majority of crimes in United States are related to vehicles. Thus, the ability of LPR system to automate the process of identifying vehicles of interest has revolutionized law enforcement and has improved public security [1]. The input to the LPR system is a digital image of the front or the rear end of the vehicle's license plate, taken by the sophisticated cameras. Further processing on this image is carried out for the purpose of license plate detection. After the plate information is extracted from the image, it is further segmented to locate individual characters. There are several methods available in the market used for recognizing the characters on the plate i.e., Character recognition using Feed Forward Neural Network, Template Matching, etc. Each segmented characters are  identified using one of these algorithms and converted into electronic data. This data can be used in various safety and traffic applications like tolling, law enforcement, and thus useful in fighting crime and fraud thereby improving public safety.

1.2. Purpose of the Project

Automatic License Plate recognition is one of the techniques used for vehicle identification purposes. The sole intention of this project is to find the most efficient way to recognize the registration information from the digital image (obtained from the camera). This process usually comprises of three steps. First step is the license plate localization, regardless of the license-plate size and orientation. The second step is the segmentation of the characters and last step is the recognition of the characters from the license plate. Thus, this project uncovers the fundamental idea of various algorithms required to accomplish character recognition from the license plate during Template Matching.

1.3. Significance of the Project

The main importance of the project lies in the way the various algorithms are implemented to create an automated system for License Plate Recognition. This project focuses on the new way of storing the fixed size template in the database using four 16-bit vectors that help in reducing the computation time required to find the characters on the plate during template matching. On the hardware side, it helps understanding TI’s DAVINCI EVM320DM6437 platform used for developing a complete model for LPR system. Algorithms like Defragmentation, Resizing, Character Localization and Template matching were tested both in Visual studio and on TI’s DAVINCI EVM320DM6437 platform and are written in the advance C and C++ programming language.

1.4. Organization of Report

Chapter 2 contains basic concepts of the smallest image (Pixel) elements and color space that are important in understanding the whole field of image and video processing.

Chapter 3 gives information about various algorithms used in the design and are described briefly in this chapter.

Chapter 4 contains information about the Texas instruments image and video development platform TMS320DM6437. It discusses various capabilities and features of the board. Moreover, this chapter also discusses about various functions that are required for the implementation of license plate recognition

Chapter 5 presents the design results including simulation and DM6437 hardware implementation. It also discusses about various optimization techniques that are taken to improve the performance of the design.

Chapter 6 presents the challenges, limitations and conclusions derived from this project along with the future work perspective. References are provided in Reference section. The program code for simulation and hardware implementation are given in Appendix section.


Chapter 2

BASIC INTRODUCTION TO DIGITAL IMAGING

2.1 Digital Imaging

In digital imaging, pixel is a smallest addressable screen element that is normally arranged in a two-dimensional grid, and is often represented using dot or a square. The intensity of each pixel varies to represent a particular type of color shade. In color image systems, either three-component intensities such as red, green, and blue or four component intensities such as cyan, magenta, yellow, and black typically represent a color. The number of distinct colors that represents a pixel depends on the number of bits per pixel (bpp). A 1 bpp image uses 1-bit for each pixel, so each pixel can be either on or off. Each additional bit doubles the number of colors available, for example, a 2 bpp image can have 4 colors, and a 3 bpp image can have 8 colors.

The color depth is normally the sum of the bits allocated to each of the red, green, and blue components. High color usually consists of 16 bpp and normally has five bits for red and blue, and six bits for green, as human eye is more sensitive to errors in green than in the other two primary colors. A 24-bit depth allows 8 bits per component. A color space is a mathematical representation of a set of colors. The three most popular color models are RGB used in computer graphics, YUV and YCrCb used in video systems, CMYK used in color printing [2].

2.2 The RGB Color Space

The red, green and blue (RGB) color space is widely used throughout computer graphics. These are three primary additive colors and each individual components are added together to form a desired color. All three components need equal bandwidth to generate arbitrary colors within the RGB color cube.

2.3 YUV Color Space

The YUV color space is use by the analog PAL, NTSC and SECAM color video/TV standards. The Y component determines the brightness of the color while U and V component determines the color itself. As human eye is more responsive to brightness than color of the image, its encoding provides low bandwidth to the chrominance component.

2.4 YCrCb (or YCbCr) Color Space

          The YCrCb or YCbCr color space was develop as part of the ITU-R BT.601 [11] during the development of a worldwide digital component video standard. YCbCr is an encoded nonlinear RGB signal that is widely used in MPEG and JPEG compression standard. Y has a nominal range of 16–235; Cb and Cr have a nominal range of 16–240. To accommodate storage and bandwidth limitation, the two color components (Cb and Cr) are compressed by sampling them at lower rate than the brightness component. This is known as Chroma sub sampling.

        The TI Board uses YCrCb format in the interleaved fashion called 4:2:2 YCrCb sub sampled format. It is also known as packed YCrCb format. In this format Cb and Cr are sampled at half the sample rate of Y. Thus the horizontal chroma resolution is halved while the full resolution is retained in the vertical direction with respect to luminance.  


Chapter 3

LICENSE PLATE CHARACTER RECOGNITION ALGORITHMS

3.1 Design Approach

There are a number of techniques used to recognize the characters on the license plate. After skimming through several IEEE papers, the most common technique brought to light for character recognition is the use of Template Matching algorithm. Based on several concepts available for implementing this algorithm that are currently available in the market, the most common drawback is its execution time and memory usage for storing the template. Hence, in order to overcome this drawback a complete new methodology is used which not only makes this matching algorithm work faster but also requires less memory space to store all 36 templates into the database. This method is termed as “Four Quadrant Algorithm”. The basic concept behind this optimization technique is to convert 64 × 128 pixel image data (which consumes 8 kB of memory storage) into four 16-bit vectors and uses these vector values during character Recognition. However, to implement this algorithm successfully, each character on the plate should be of 64 × 128 pixel. Thus to make each character of 64 × 128 pixel there is a need of a resizing algorithm which is also designed and tested successfully.

3.2 Design Overview

Based on various standards used in different countries, the vehicle license plates are usually different in form, shape and material. Therefore, the LPR systems designed are country specific and are adapted to the country specification. In US, every state has its own laws and rules governing the license plates. Hence, the first step in implementing the LPR System is to decide in which state the design has to be implemented. In this project, California License plate is selected for designing the License Plate recognition model and hence all the specifications of the design are based on the standard set by the state of California. The basic diagram of a California License plate is as shown in Figure 3.1 below. Thus each license plate has following details on it viz., Registration Number, Registration Valid Info and State Information.

Join now!

Figure 3.1 California License Plate

This design includes five primary algorithms used for identifying the license plate characters:

  1. Image Processing – Simple Algorithm, which converts the pixel value to either 0 or 255, based on the set threshold. Basically, this step extracts the intensity information from the image and converts it to either black (0) or white (255) similar to the intensity defined by a 1-bit per pixel where 0 represents black and 1 represents white. This technique is most commonly known as Image Binarization.
  2. Defragmentation – This algorithm finds the registration number from the California license ...

This is a preview of the whole essay