Anda di halaman 1dari 41

NUMBER PLATE RECOGNITION USING MATLAB

CHAPTER-1
INTRODUCTION

Real time segmentation of dynamic regions or objects in video or image are often
referred to as background subtraction or foreground segmentation and is a basic step in
several computer vision applications. With emerge of new developments in communications
technologies the requirement for up Intelligent Surveillance Systems (ISS) technologies is
changing into additional important. The importance often leads to its role in capturing traffic
information, accidents and in safety management in general. It’s been demonstrated that
vision based information can end in improved operational efficiency. The terribly beginning
in visual process is the segmentation of moving objects in image sequences, supported the
recorded image sequences a background are often estimated. Automatic number plate
recognition (ANPR) is a method that uses character recognition on pictures to obtain vehicle
registrationplates with the use of existing CCTVs or traffic cameras, or task specific
equipment.
The ANPR is used by various police department in various areas round the globe,
used for various toll tax collections as a technique referred to as electronic toll collection, for
management of traffic on busy highways and for implementation of traffic rules on them.
Storage of the pictures of the plates acquired by the equipment and verification of the text on
the license plates can also be done by ANPR system. As a result of the plate variation from
region to region the ANPR is developed as a vicinity specific technology. So the violation of
privacy act i.e., chase the movement of the fellow citizens, high error rates, misidentifications
and increase payment of tax money dealer cash are the centre of concerns for this recognition
technology Commonplace computer hardware will even implement the facet of this
technology and therefore the link to different applications and information can also be
utilized. It starts with a series of image manipulation techniques to find the plate location,
normalize and enhance the image of the amount plate, then the character recognition to
extract the alphanumerical and numerals of the registration code. ANPR systems are typically
deployed in one of 2 basic approaches: one allows for the complete process to be performed
by transferring the information to an overseas computer and where any operations are
performed or at the roads only were real time operations are performed. The information
captured from the plate like characters, date, time, road identification and the other relevant
information needed, must be completed in roughly milliseconds, once ANPR is enforced on
the lanes. Transmission of data from roads to an overseas computer can be completed for any
process if necessary and keep at the lane for later retrievals. Large number of PCs which acts
as a server is employed to process the information received from the roads and all required
process are completed accordingly. Typically in such systems, great amount of information
measure needed to send processed information to remote servers.

1
NUMBER PLATE RECOGNITION USING MATLAB

II. LITERATURE REVIEW


Lots of research has been done in this field. By referring various transactions, books,
conference papers a lot of information can be obtained from previous works, latest and the
advancement that need to applied. To detectthe region of car license plate, many techniques
have been used. A fast method is proposed [1] for car license plate detection (CLPD) and
presents three main contributions. The first contribution is that we propose a fast vertical
edge detection algorithm (VEDA) based on the contrast between the grayscale values, which
enhances the speed of the CLPD method. After binarizing the input image using adaptive
thresholding (AT), an unwanted line elimination algorithm (ULEA) is proposed to enhance
the image, and then, the VEDA is applied.
The second contribution is that our proposed CLPD method processes very-low-resolution
images taken by a web camera. After the vertical edges have been detected by the VEDA, the
desired plate details based on colour information are highlighted. Then, the candidate region
based on statistical and logical operations will be extracted. Finally, an LP is detected. The
third contribution is that we compare the VEDA to the Sobel operator in terms of accuracy,
algorithm complexity, and processing time. The results show accurate edge detection
performance and faster processing than Sobel by five to nine times. In [2] and [3]
combination of edge statistics and mathematical morphology showed very good results, but it
is time consuming and because of this problem, [4] uses blockbase algorithm. In [5] a novel
method called N row distance is implemented. This method scans an image with N row
distance and counts the existent edges. If the number of the edges is greater than a threshold
then the license plate is recognized, if not threshold have to be reduced and algorithm will be
repeated.
This method is fast and has good results for simple images. Disadvantage of this
paper is that the edge based algorithms are sensitive to unwanted edges such as noise edges,
and they fail when they are applied to complex images. In [6] first of all, edges are detected
and then Hough transform is applied to detect the location of license plate. This method
requires too much computation and has difficulty in extracting license plate region when the
boundary of the license plate is not clear or distorted or the images contain lots of vertical and
horizontal edges. A wavelet transform-based algorithm is used in [7] for extraction of the
important features to be used for license plate location.
This method can locate more than one license plate in an image. Methods which are
symmetry based are mentioned in [8]. Kim Chien used symmetric regions to locate the
license plate. This method is a little time consuming and does not work for rotated or
distorted plates. Park et al. proposed neural networks to locate license plate [9]. Neural
networks can be used as filters to analyze small windows of an image and to decide whether
each window contains a license plate or not. Their inputs are HSI values and colours are
changed under different illuminations and it makes some troubles. Fuzzy logic has been
applied to the problem of locating license plate by Zimic et al. [10].

2
NUMBER PLATE RECOGNITION USING MATLAB

The authors made some intuitive rules to describe the license plate, and gave some
membership functions for the fuzzy sets bright, dark and bright and dark sequence to get the
horizontal and vertical plate positions. From authors’ point of view, by extending or changing
the rules, the system can easily be adapted to locate other patterns . Hinde Anoual et al [11]
proposed Texture Based VLPL Algorithm (TVLPLA) by assorting set vehicles images
acquired, thenceforth fed to the computer code where they're initial regenerate in to grayscale
images. Contrast, brightness and gamma changes are created to optimum values to enhance
the quantity plate and its characters.
Then the region with highest likelihood of number plate is disguised and extracted so
that it can use for further processing. Now the resulting region of interest is further scanned
for characters and numerals by ceaselessly changing the coordinates of bounding box. The
output is saved in a computerised program and then for each iteration the result is checked if
it qualifies to contain all the digits in number plate.
Whenever the results match with the conditions specific, the computer code displays
the quantity and terminates the execution of program so that next image will be processed.
Matas et al. [15] proposed based on the detection of connected components and followed by a
machine learning method to select the characters of license plate regions.

3
NUMBER PLATE RECOGNITION USING MATLAB

DIGITAL IMAGE PROCESSING


Information carrying function of time is called signal. Real time signals can be
audio or video(image) signals. Still video is called an image. Moving image is called a video.
Difference between digital image processing and signals and systems is that time graph is not
there in DIP. X and Y coordinates in DIP are spatial coordinates.Time graph is not there
because photo doesn’t change with time.

IMAGE : An image is defined as a two dimensional function f(x, y) where x and y are
spatial coordinates and the amplitude ‘f’ at any point (x, y) is known as the intensity of image
at that point.

PIXEL: A pixel (short for picture element) is a single point in a graphic image. Each such
information element is not really a dot, nor a square but an abstract sample. Each element of
the above matrix is known as a pixel where dark = 0 and light = 1. A pixel with only 1 bit
will represent a black and white image. If the numbers of bits are increased then the number
of gray levels will increase and a better picture quality is achieved.

All naturally occurring images are analog in nature. If the number of pixels is more then the
clarity is more. An image is represented as a matrix in DIP. In DSP we use only row
matrices. Naturally occurring images should be sampled and quantized to get a digital image.
A good image should have 1024*1024 pixels which is known as

1k * 1k = 1M pixel.

4
NUMBER PLATE RECOGNITION USING MATLAB

FUNDAMENTAL STEPS IN DIP:

1. IMAGE ACQUISITION: Digital image acquisition is the creation of digital


images typically from a physical object. A digital image may be created directly from
a physical scene by a camera or similar device. Alternatively it can be obtained from
another image in an analog medium such as photographs, photographic film, or
printed paper by a scanner or similar device. Many technical images acquired with
tomographic equipment, side-looking radar, or radio telescopes are actually obtained
by complex processing of non-image data.

2. IMAGE ENHANCEMENT: The process of image acquisition frequently leads


to image degradation due to mechanical problems, out-of-focus blur, motion,
inappropriate illumination and noise. The goal of image enhancement is to start from
a recorded image and to produce the most visually pleasing image.

3.IMAGE RESTORATION : The goal of image restoration is to start from a


recorded image and to produce the most visually pleasing image. The goal of enhancement
is beauty. The goal of restoration is truth. The measure of success in restoration is usually
an error measure between the original and the estimate image. No mathematical error
function is known that corresponds to human perceptual assessment of error.

3. COLOUR IMAGE PROCESSING: Colour image processing is based on that


any colour can be obtained by mixing 3 basic colours red, green and blue. Hence 3
matrices are necessary each one representing each colour.

4. WAVELET AND MULTIRESOLUTION PROCESSING:


Many times a particular spectral component occurring at any instant can be of particular
interest. In these cases it may be very beneficial to know the time intervals these particular
spectral components occur. For example, in EEGs the latency of an event-related potential is
of particular interest. Wavelet transform is capable of providing the time and frequency
information simultaneously, hence giving a time-frequency representation of the signal.

5
NUMBER PLATE RECOGNITION USING MATLAB

Although the time and frequency resolution problems are results of a physical phenomenon (
the Heisenberg uncertainty principle ) and exist regardless of the transform used, it is possible
to any signal by using an alternative approach called the multiresolution analysis (MRA).
MRA analyzes the signal at different frequencies with different resolutions. MRA is designed
to give good time resolution and poor frequency resolution at high frequencies and good
frequency resolution and poor time resolution at low frequencies.

5. COMPRESSION: Image compression is the application of data compression on


digital images. Its objective is to reduce redundancy of the image data in order to be
able to store or transmit data in an efficient form.

6. MORPHOLOGICAL PROCESSING: Morphological processing is a


collection of techniques for DIP based on mathematical morphology. Since these
techniques rely only on the relative ordering of pixel values not on their numerical
values they are especially suited to the processing of binary images and grayscale
images.

7. SEGMENTATION: In the analysis of the objects in images it is essential that we

can distinguish between the objects of interest and “the rest”. This latter group is also
referred to as the background. The techniques that are used to find the objects of
interest are usually referred to as segmentation techniques.

8. OBJECT RECOGNITION: The visual perception of familiar objects. In


Computer vision ,it is the task of finding a given object in an image or video
sequence. Humans recognize a multitude of objects in images with little effort, despite
the fact that the image of the objects may vary somewhat in different viewpoints, in
many different sizes / scale or even when they are translated or rotated. Objects can
even be recognized when they are partially obstructed from view. This task is still a
challenge for computer vision systems in general.

6
NUMBER PLATE RECOGNITION USING MATLAB

The main parts of image sensing are :

1. Sensor( converts optical to electrical energy)


2. Digitizer(It converts analog signal to digital signal by sampling and quantization)

Interesting phenomena : Our eye is capable of differentiating between various


levels of intensity. The range of human eye is from scotopic threshold to glare limit
which is about 10^10 lambards. It accomplishes this variation by changes in overall
sensitivity and this phenomenon is called “brightness adaptation”. Subjective brightness(
intensity as perceived by human eye) is a log function of light intensity incident on the
eye. A visual system cannot operate over such a large range simultaneously. Hence our
eye cannot see very bright and very dim images simultaneously.

Light and electromagnetic spectrum : Light is a part of electromagnetic spectrum


that can be seen and sensed with the human eye. Light travels at a speed of 3*10^8 m/s.
If any one can cross this speed they can go into past or future. The visible light can be
split up into VIBGYOR from range of violet (0.43micrometres) to red( 0.79micrometres).
A substance which absorbs all the colours appears as black, no colour as white. A
substance which reflects blue will appear as blue. Colour is the part of light spectrum
which is not absorbed by human eye. Light that is void of colour is called monochromatic
or achromatic light. The only property of this light is intensity or graylevel.

Properties of light :

1. Radiance : The total energy that flows from a light source is called radiance. Units are
watts. Example of sources are sun, bulb etc.
2. Luminance : The amount of energy that an observer perceives from the source is
called luminance. Units are lumens. Example is seeing the sun with black glasses.
3. Brigthness : Brightness is an attribute of visual perception in which a source appears
to emit a given amount of light. It has no units as it is practically impossible to
measure.

IMAGE SENSING AND ACQUISITION :

7
NUMBER PLATE RECOGNITION USING MATLAB

In image sensing light energy is converted into voltage. Image acquisition can be
done using 3 principle sensor arrangements :

1. Single sensor
2. Line sensor/strip sensor
3. Array sensor
If something is changing more than 17 times per second or if the frequency is greater
than 17 then we cannot differentiate it.

SIMPLE IMAGE FORMATION MODEL : Images are represented as 2-D


functions f(x,y). The value of f(x,y) at any point (x,y) at any point (x,y) is a positive
quantity.

0 < f(x,y) < infinity

f(x,y) depends on two parameters :

1. Amount of light incident on the scene = i(x,y)


2. Amount of light reflected from the scene = r(x,y)
f(x,y) = i(x,y) * r(x,y)

0 < i(x,y) < infinity

0 < r(x,y) < 1

In the last inequality 0 represents total absorption and no reflection (black) and 1
represents total reflection and no absorption(white).

0 < f(x,y) < infinity

imin < i(x,y) < imax

rmin < r(x,y) < rmax

imin * rmin < f(x,y) < imax * rmax

Lmin < l < Lmax

If you consider monochromatic light L = number of gray levels

8
NUMBER PLATE RECOGNITION USING MATLAB

If L = 30 then n = 5 (2^5 > 30)

The interval (Lmin – Lmax) is called grayscale which is shifted to (0,L-1) where

l = 0 (black) & l = L-1 (is white)

All intermediate stages are shades of gray.

All real time signals are analog in nature. But we need a digital image. But we acquire an
analog image and digitize it. For this we need an A/D converter. To convert naturally
occurring images into digital form we must digitize both coordinates and amplitudes.
Digitizing coordinate values is called sampling and digitizing amplitude values is called
quantization. Hence the quality of digital image will depend on the number of
samples(sampling) & the number of gray levels(quantization). More the samples better will
be the quality.

REPRESENTING DIGITAL IMAGES:

The result of sampling and quantization of an image is an array of numbers according


to x and y coordinates which is nothing but a matrix of m rows and n columns. Columns and
rows depend on number of samples. Brightness depends on number of bits used to represent
each pixel. For an image of size m rows and n columns total number of pixels = m*n

If each pixel is represented using k bits then total amount of memory(in bits) required to store
the image = m*n*k

A 1M pixel size image requires 1024 rows and 1024 columns. If each pixel is represented
using 8 bits then total amount of memory required to store the image = 1k*1k*1 bytes

RESOLUTION : Resolution is classified into 2 types :

1. spatial
2. graylevel

9
NUMBER PLATE RECOGNITION USING MATLAB

1.SPATIAL RESOLUTION :

It is the smallest discernable detail in the image. Consider vertical lines of width ‘w’
with spaces between also having width ‘w’. A line pair consists of one such line & its
adjacent space. Hence width of line pair = 2w and there are 1/(2*w) line pairs per unit
distance. Thus spatial resolution is the number of discernable line pairs per unit distance.

Example : 100 line pairs/unit distance.

GRAYLEVEL RESOLUTION :
It is the smallest discernable change in graylevel. The number of graylevels should be
a power of 2. The commonly used number of graylevels is 256.

L = 256

2^k = 256

k = 8 (8 bits per pixel)

10
NUMBER PLATE RECOGNITION USING MATLAB

CHAPTER-2

PROPOSED METHOD

The first step in a process of automatic plate recognition is a detection of a number


plate area. This problematic procedure includes algorithms that are capable to detect a
rectangular area of the number plate in an original image. The detection of a number plate
area includes of a series of convolve operations.
The images of assorted set vehicles are acquired, thenceforth fed to the computer code
where they're initial regenerate in to grayscale images. Contrast, brightness and gamma
changes are created to optimum values to enhance the quantity plate and its characters. Then
the region with highest likelihood of number plate is disguised and extracted so that it can use
for further processing. Now the resulting region of interest is further scanned for characters
and numerals by ceaselessly changing the coordinates of bounding box. The output is saved
in a computerised program and then for each iterations the result is checked if it qualifies to
contain all the digits in number plate. Whenever the results matches with the conditions
specific, the computer code displays the quantity and terminates the execution of program so
that next image will be processed. The steps followed to develop the system are shown in Fig.
3.1.

11
NUMBER PLATE RECOGNITION USING MATLAB

A.Preprocessing
The input image consists of many colours and therefore the image is processed
initially to enhance the standard and prepares it to next phases. Since the image has different
colours the system will convert the RGB pictures to gray scale pictures exploitation NTSC
standard technique.

Gray=0.299*Red+0.587*Green+0.114*Blue……. (3.1)

12
NUMBER PLATE RECOGNITION USING MATLAB

Within the next section the gray image is filtered using median filter in order to get rid of the
noise, but conserving the sharpness of the image. Here the filter used is a nonlinear filter
which replaces every pixel with a worth obtained by computing the median of values of
pixels. Image can be divided into multigroups by

Total number of groups = Height / Candidate region Extraction ………….. (3.2)

It's significantly useful once the patterns one is searching for area unit sparsely digitized hove
“holes” and therefore the photos are strident especially in detected straight line within the
licenses plate. The fundamental idea of this technique is to search out curves that can be
parameterized into straight lines in a suitable parameter area. Exploitation Hough transform
vehicle plate area is detected.

B. Morphological image processing is a collection of non-linear operations related to the


shape or morphology of features in an image. morphological operations rely only on the
relative ordering of pixel values, not on their numerical values, and therefore are especially
suited to the processing of binary images. Morphological operations can also be applied to
greyscale images such that their light transfer functions are unknown and therefore their
absolute pixel values are of no or minor interest.

Morphological techniques probe an image with a small shape or template called


a structuring element. The structuring element is positioned at all possible locations in the
image and it is compared with the corresponding neighbourhood of pixels. Some operations
test whether the element "fits" within the neighbourhood, while others test whether it "hits" or
intersects the neighbourhood:

13
NUMBER PLATE RECOGNITION USING MATLAB

A morphological operation on a binary image creates a new binary image in which the pixel
has a non-zero value only if the test is successful at that location in the input image.

The structuring element is a small binary image, i.e. a small matrix of pixels, each with a
value of zero or one:

 The matrix dimensions specify the size of the structuring element.


 The pattern of ones and zeros specifies the shape of the structuring element.
 An origin of the structuring element is usually one of its pixels, although generally the
origin can be outside the structuring element.

Square matrix 5x5

14
NUMBER PLATE RECOGNITION USING MATLAB

Diamond-shaped 5x5 element

Cross-shaped 5x5 element

Square 3x3 matrix

Fundamental operations
More formal descriptions and examples of how basic morphological operations work are
given in the Hypermedia Image Processing Reference (HIPR) developed by Dr. R. Fisher et
al. at the Department of Artificial Intelligence in the University of Edinburgh, Scotland, UK.
Erosion and dilation

The erosion of a binary image f by a structuring element s (denoted f s) produces a new


binary image g = f s with ones in all locations (x,y) of a structuring element's origin at
which that structuring element s fits the input image f, i.e. g(x,y) = 1 is s fits f and 0
otherwise, repeating for all pixel coordinates (x,y).

15
NUMBER PLATE RECOGNITION USING MATLAB

Gray Image

Binary Image with Threshold

The hit and miss transform allows to derive information on how objects in a binary image
are related to their surroundings. The operation requires a matched pair of structuring
elements, {s1, s2}, that probe the inside and outside, respectively, of objects in the image:

Hit_-miss transform
A pixel belonging to an object is preserved by the hit and miss transform if and only
if s1 translated to that pixel fits inside the object AND s2 translated to that pixel fits outside
the object. It is assumed that s1 and s2 do not intersect, otherwise it would be impossible for
both fits to occur simultaneously.

16
NUMBER PLATE RECOGNITION USING MATLAB

It is easier to describe it by considering s1 and s2 as a single structuring element with 1s for


pixels of s1 and 0s for pixels of s2; in this case the hit-and-miss transform assigns 1 to an
output pixel only if the object (with the value of 1) and background (with the value of 0)
pixels in the structuring element exactly match object (1) and background (0) pixels in the
input image. Oterwise that pixel is set to the background value (0).

The hit and miss transform can be used for detecting specific shapes (spatial arrangements of
object and background pixel values) if the two structuring elements present the desired shape,
as well as for thinning or thickening of object linear elements.

Morphological filteringof a binary image is conducted by considering compound operations


like opening and closing as filters. They may act as filters of shape. For example, opening
with a disc structuring element smooths corners from the inside, and closing with a disc
smooths corners from the outside. But also these operations can filter out from an image any
details that are smaller in size than the structuring element, e.g. opening is filtering the binary
image at a scale defined by the size of the structuring element. Only those portions of the
image that fit the structuring element are passed by the filter; smaller structures are blocked
and excluded from the output image. The size of the structuring element is most important to
eliminate noisy details but not to damage objects of interest.

Opening and closing


Combinations of morphological operations can be very useful and help remove many artifacts
present in images. This will become very useful after segmenting an image.The first
operation we will see is opening, which is an erosion followed by dilation. Opening smoothes
object contours, breaks thin connections and removes thin protrusions. After opening, all
objects smaller than the structuring element will disappear.

Closing is a dilation followed by erosion. Closing smoothes object contours, joins narrow
breaks, fills long thin gulfs and fills holes smaller than the structuring element.

Additional useful image processing tools

A very useful morphological transformation to subtract the background from an image is the
so called tophat. Tophat is the subtraction of an opened image from the original. One can do
opening in gray images, removing all features smaller than the structuring element.
Filling holes
Frequently, after some morphological operation we need to fill the holes in a binary image.
For example, we detect the boundary of a cell and want to obtain an object which is filled and
covers the cell. In this example we will see its effect in text.
Clearing border objects

After segmenting an image there are usually objects touching the border of the image. Since
we can not obtain complete information about them it is usually the best to remove them.
imclearborder is the matlab function to remove objects touching the border.

17
NUMBER PLATE RECOGNITION USING MATLAB

Image Segmentation
Segmentation refers to the process in which an image is subdivided into constituent regions
or objects. These objects can be further processed or analyzed for the extraction of
quantitative information. Biological image data is usually messy and noisy, and as a result
difficult to segment properly. Multiple image processing steps are often required in the
process of segmentation. We often combine segmentation with various morphological
processing and filtering techniques described above to achieve accurate and robust
segmentation of an image.
We looked at a basic segmentation technique earlier – thresholding. In this section, we look
at other complementary segmentation techniques that may be useful in different situations.

Edge detection
One way to find boundaries of objects is to detect discontinuities in intensity values at the
edge of a region. These discontinuities can be found by calculating the first and/or second
order derivatives of an image. The first derivative of choice in image processing is the
gradient, defined as the vector:

grad f= [GxGy]

where Gx= df/dx and Gy= df/dy are the partial derivatives in the horizontal and vertical
directions of the image. The magnitude of this vector is

|grad f| = (Gx2 + Gy2)1/2

The gradient vector points in the direction of steepest ascent. The angle of steepest ascent is
given by:

a(x,y) = tan-1(Gy/Gx)

We can estimate the derivatives Gxand Gydigitally by linearly filtering the image with the
following 3 by 3 kernels:

18
NUMBER PLATE RECOGNITION USING MATLAB

Image neighbourhood

Sobel

perwit
The Prewitt and Sobel operators are among the most used in practice for computing digital
gradients. The Prewitt masks are simpler to implement than the Sobel masks, but the latter
have slightly superior noise-suppression characteristics.

Morphological Watersheds
In the previous sections, we discussed segmentation based on 1) detection of discontinuities
in an image, and 2) thresholding. Morphological watersheds provide a complementary
approach to the segmentation of objects. It is especially useful for segmenting objects that
are touching one another.

To understand the watershed transform – we view a grayscale image as a topological surface,


where the values of f(x,y) correspond to heights:

19
NUMBER PLATE RECOGNITION USING MATLAB

Consider the topographic surface on the right. Water would collect in one of the two
catchment basins. Water falling on the watershed ridge line separating the two basins would
be equally likely to collect into either of the two catchment basins. Watershed algorithms
then find the catchment basins and the ridge lines in an image.

The algorithm works as follows: Suppose a hole is punched at each regional local minimum
and the entire topography is flooded from below by letting the water rise through the holes at
a uniform rate. Pixels below the water level at a given time are marked as flooded. When we
raise the water level incrementally, the flooded regions will grow in size. Eventually, the
water will rise to a level where two flooded regions from separate catchment basins will
merge. When this occurs, the algorithm constructs a one-pixel thick dam that separates the
two regions. The flooding continues until the entire image is segmented into separate
catchment basins divided by watershed ridge lines.

The watershed algorithm is implemented in the MATLAB image processing toolbox as:

L = watershed(f)

where f is the input image and L is a labeled matrix image having positive integer values at
different regions and 0 at the watershed ridge lines.

The key behind using the watershed transform for segmentation is this:
Change your image into another image whose catchment basins are the objects you want
to identify. In the following examples, we consider different ways to pre-process images to
make them amenable to watershed segmentation.
Segmentation
The next step after doing the detection of the number plate area is segmentation of the plate.
It is evidently clear that the segmentation is one in every of the foremost important processes
within the automatic number plate recognition, as a result of all more steps consider it. If the
segmentation fails, then a character may be improperly divided into two items or two
characters may be improperly unified along. If we tend to assume only one-row plates, the
segmentation could be a process of finding horizontal boundaries between characters. The
second section of the segmentation is an enhancement of segments obtained. The segment
phase of a plate contains besides the character also undesirable parts like dots and stretches
20
NUMBER PLATE RECOGNITION USING MATLAB

further as redundant space on the edges of character. There's a necessity to eliminate these
parts and extract only the character. Since the segmented plate is deskewed, we could
segment it by detecting spaces in its horizontal projection. We regularly apply the adaptive
thresholding filter to reinforce a vicinity of the plate before segmentation phase. The adaptive
thresholding is used to differentiate dark foreground from lightweight background with non-
uniform illumination.

21
NUMBER PLATE RECOGNITION USING MATLAB

CHAPTER-3

MATLAB

3.1INTRODUCTION TO MATLAB

What Is MATLAB?

MATLAB® is a high-performance language for technical computing. It integrates


computation, visualization, and programming in an easy-to-use environment where problems
and solutions are expressed in familiar mathematical notation. Typical uses include

 Math and computation


 Algorithm development
 Data acquisition
 Modeling, simulation, and prototyping
 Data analysis, exploration, and visualization
 Scientific and engineering graphics
 Application development, including graphical user interface building.

MATLAB is an interactive system whose basic data element is an array that does not
require dimensioning. This allows you to solve many technical computing problems,
especially those with matrix and vector formulations, in a fraction of the time it would take to
write a program in a scalar non interactive language such as C or FORTRAN.

The name MATLAB stands for matrix laboratory. MATLAB was originally written to
provide easy access to matrix software developed by the LINPACK and EISPACK projects.
Today, MATLAB engines incorporate the LAPACK and BLAS libraries, embedding the
state of the art in software for matrix computation.

22
NUMBER PLATE RECOGNITION USING MATLAB

MATLAB has evolved over a period of years with input from many users. In university
environments, it is the standard instructional tool for introductory and advanced courses in
mathematics, engineering, and science. In industry, MATLAB is the tool of choice for high-
productivity research, development, and analysis.

MATLAB features a family of add-on application-specific solutions called toolboxes.


Very important to most users of MATLAB, toolboxes allow you to learnand apply
specialized technology. Toolboxes are comprehensive collections of MATLAB functions (M-
files) that extend the MATLAB environment to solve particular classes of problems. Areas in
which toolboxes are available include signal processing, control systems, neural networks,
fuzzy logic, wavelets, simulation, and many others.

The MATLAB System:

The MATLAB system consists of five main parts:

3.2 Development Environment:

This is the set of tools and facilities that help you use MATLAB functions and files.
Many of these tools are graphical user interfaces. It includes the MATLAB desktop and
Command Window, a command history, an editor and debugger, and browsers for viewing
help, the workspace, files, and the search path.

The MATLAB Mathematical Function:

This is a vast collection of computational algorithms ranging from elementary functions like
sum, sine, cosine, and complex arithmetic, to more sophisticated functions like matrix
inverse, matrix Eigen values, Bessel functions, and fast Fourier transforms.

3.3 The MATLAB Language:

23
NUMBER PLATE RECOGNITION USING MATLAB

This is a high-level matrix/array language with control flow statements, functions, data
structures, input/output, and object-oriented programming features. It allows both
"programming in the small" to rapidly create quick and dirty throw-away programs, and
"programming in the large" to create complete large and complex application programs.

3.4 Graphics:

MATLAB has extensive facilities for displaying vectors and matrices as graphs, as
well as annotating and printing these graphs. It includes high-level functions for two-
dimensional and three-dimensional data visualization, image processing, animation, and
presentation graphics. It also includes low-level functions that allow you to fully customize
the appearance of graphics as well as to build complete graphical user interfaces on your
MATLAB applications.

3.5 The MATLAB Application Program Interface (API):

This is a library that allows you to write C and FORTRAN programs that interact with
MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking),
calling MATLAB as a computational engine, and for reading and writing MAT-files.

3.6 MATLAB WORKING ENVIRONMENT:

24
NUMBER PLATE RECOGNITION USING MATLAB

MATLAB DESKTOP:-

Mat lab Desktop is the main Mat lab application window. The desktop contains five
sub windows, the command window, the workspace browser, the current directory window,
the command history window, and one or more figure windows, which are shown only when
the user displays a graphic.

The command window is where the user types MATLAB commands and expressions
at the prompt (>>) and where the output of those commands is displayed. MATLAB defines
the workspace as the set of variables that the user creates in a work session. The workspace
browser shows these variables and some information about them. Double clicking on a
variable in the workspace browser launches the Array Editor, which can be used to obtain
information and income instances edit certain properties of the variable.

The current Directory tab above the workspace tab shows the contents of the current
directory, whose path is shown in the current directory window. For example, in the windows
operating system the path might be as follows: C:\MATLAB\Work, indicating that directory
“work” is a subdirectory of the main directory “MATLAB”; WHICH IS INSTALLED IN
DRIVE C. clicking on the arrow in the current directory window shows a list of recently used
paths. Clicking on the button to the right of the window allows the user to change the current
directory.

MATLAB uses a search path to find M-files and other MATLAB related files, which
are organize in directories in the computer file system. Any file run in MATLAB must reside
in the current directory or in a directory that is on search path. By default, the files supplied
with MATLAB and math works toolboxes are included in the search path. The easiest way to
see which directories are on the search path.

The easiest way to see which directories are soon the search paths, or to add or
modify a search path, is to select set path from the File menu the desktop, and then use the set
path dialog box. It is good practice to add any commonly used directories to the search path
to avoid repeatedly having the change the current directory.

The Command History Window contains a record of the commands a user has entered
in the command window, including both current and previous MATLAB sessions. Previously

25
NUMBER PLATE RECOGNITION USING MATLAB

entered MATLAB commands can be selected and re-executed from the command history
window by right clicking on a command or sequence of commands. This action launches a
menu from which to select various options in addition to executing the commands. This is
useful to select various options in addition to executing the commands. This is a useful
feature when experimenting with various commands in a work session.

Using the MATLAB Editor to create M-Files:

The MATLAB editor is both a text editor specialized for creating M-files and a
graphical MATLAB debugger. The editor can appear in a window by itself, or it can be a sub
window in the desktop. M-files are denoted by the extension .m, as in pixel up .m. The
MATLAB editor window has numerous pull-down menus for tasks such as saving, viewing,
and debugging files. Because it performs some simple checks and also uses color to
differentiate between various elements of code, this text editor is recommended as the tool of
choice for writing and editing M-functions. To open the editor , type edit at the prompt opens
the M-file file name .m in an editor window, ready for editing. As noted earlier, the file must
be in the current directory, or in a directory in the search path.

Getting Help:

The principal way to get help online is to use the MATLAB help browser, opened as a
separate window either by clicking on the question mark symbol (?) on the desktop toolbar,
or by typing help browser at the prompt in the command window. The help Browser is a web
browser integrated into the MATLAB desktop that displays a Hypertext
MarkupLanguage(HTML) documents. The Help Browser consists of two panes, the help
navigator pane, used to find information, and the display pane, used to view the information.
Self-explanatory tabs other than navigator pane are used to perform a search.

26
NUMBER PLATE RECOGNITION USING MATLAB

CHAPTER-4

DIGITAL IMAGE PROCESSING

BACKGROUND:
Digital image processing is an area characterized by the need for extensive
experimental work to establish the viability of proposed solutions to a given problem. An
important characteristic underlying the design of image processing systems is the significant
level of testing & experimentation that normally is required before arriving at an acceptable
solution. This characteristic implies that the ability to formulate approaches &quickly
prototype candidate solutions generally plays a major role in reducing the cost & time
required to arrive at a viable system implementation.

4.1 What is DIP


An image may be defined as a two-dimensional function f(x, y), where x & y are
spatial coordinates, & the amplitude of f at any pair of coordinates (x, y) is called the
intensity or gray level of the image at that point. When x, y & the amplitude values of f are
all finite discrete quantities, we call the image a digital image. The field of DIP refers to
processing digital image by means of digital computer. Digital image is composed of a finite
number of elements, each of which has a particular location & value. The elements are called
pixels.

Vision is the most advanced of our sensor, so it is not surprising that image play the
single most important role in human perception. However, unlike humans, who are limited to
the visual band of the EM spectrum imaging machines cover almost the entire EM spectrum,
ranging from gamma to radio waves. They can operate also on images generated by sources
that humans are not accustomed to associating with image.

There is no general agreement among authors regarding where image processing stops &
other related areas such as image analysis& computer vision start. Sometimes a distinction is
made by defining image processing as a discipline in which both the input & output at a
process are images. This is limiting & somewhat artificial boundary. The area of image
analysis (image understanding) is in between image processing & computer vision.

27
NUMBER PLATE RECOGNITION USING MATLAB

There are no clear-cut boundaries in the continuum from image processing at one end
to complete vision at the other. However, one useful paradigm is to consider three types of
computerized processes in this continuum: low-, mid-, & high-level processes. Low-level
process involves primitive operations such as image processing to reduce noise, contrast
enhancement & image sharpening. A low- level process is characterized by the fact that both
its inputs & outputs are images.

Mid-level process on images involves tasks such as segmentation, description of that


object to reduce them to a form suitable for computer processing & classification of
individual objects. A mid-level process is characterized by the fact that its inputs generally
are images but its outputs are attributes extracted from those images. Finally higher- level
processing involves “Making sense” of an ensemble of recognized objects, as in image
analysis & at the far end of the continuum performing the cognitive functions normally
associated with human vision.

Digital image processing, as already defined is used successfully in a broad range of


areas of exceptional social & economic value.

What is an image?

An image is represented as a two dimensional function f(x, y) where x and y are


spatial co-ordinates and the amplitude of ‘f’ at any pair of coordinates (x, y) is called the
intensity of the image at that point.

Gray scale image:

A grayscale image is a function I(xylem) of the two spatial coordinates of the image
plane.

I(x, y) is the intensity of the image at the point (x, y) on the image plane.

I (xylem)takes non-negative values assume the image is bounded by arectangle[0, a] [0, b]I:
[0, a]  [0, b]  [0, info)

28
NUMBER PLATE RECOGNITION USING MATLAB

Color image:

It can be represented by three functions, R (xylem)for red,G (xylem)for green andB


(xylem)for blue.

An image may be continuous with respect to the x and y coordinates and also in
amplitude. Converting such an image to digital form requires that the coordinates as well as
the amplitude to be digitized. Digitizing the coordinate’s values is calledsampling. Digitizing
the amplitude values is called quantization.

Coordinate convention:

The result of sampling and quantization is a matrix of real numbers. We use two
principal ways to represent digital images. Assume that an image f(x, y) is sampled so that
the resulting image has M rows and N columns. We say that the image is of size M X N. The
values of the coordinates (xylem) are discrete quantities. For notational clarity and
convenience, we use integer values for these discrete coordinates. In many image processing
books, the image origin is defined to be at (xylem)=(0,0).The next coordinate values along
the first row of the image are (xylem)=(0,1).It is important to keep in mind that the notation
(0,1) is used to signify the second sample along the first row. It does not mean that these are
the actual values of physical coordinates when the image was sampled. Following figure

29
NUMBER PLATE RECOGNITION USING MATLAB

shows the coordinate convention. Note that x ranges from 0 to M-1 and y from 0 to N-1 in
integer increments.

The coordinate convention used in the toolbox to denote arrays is different from the
preceding paragraph in two minor ways. First, instead of using (xylem) the toolbox uses the
notation (race) to indicate rows and columns. Note, however, that the order of coordinates is
the same as the order discussed in the previous paragraph, in the sense that the first element
of a coordinate topples, (alb), refers to a row and the second to a column. The other
difference is that the origin of the coordinate system is at (r, c) = (1, 1); thus, r ranges from 1
to M and c from 1 to N in integer increments. IPT documentation refers to the coordinates.
Less frequently the toolbox also employs another coordinate convention called spatial
coordinates which uses x to refer to columns and y to refers to rows. This is the opposite of
our use of variables x and y.

Image as Matrices:

The preceding discussion leads to the following representation for a digitized image
function:

f (0,0) f(0,1) ……….. f(0,N-1)

f (1,0) f(1,1) ………… f(1,N-1)

f (xylem)= . . .

. . .

f (M-1,0) f(M-1,1) ………… f(M-1,N-1)

The right side of this equation is a digital image by definition. Each element of this
array is called an image element, picture element, pixel or pel. The terms image and pixel are
used throughout the rest of our discussions to denote a digital image and its elements.

A digital image can be represented naturally as a MATLAB matrix:

f (1,1) f(1,2) ……. f(1,N)

f (2,1) f(2,2) …….. f (2,N)

. . .

30
NUMBER PLATE RECOGNITION USING MATLAB

f= . . .

f (M,1) f(M,2) …….f(M,N)

Where f (1,1) = f(0,0) (note the use of a moonscape font to denote MATLAB
quantities). Clearly the two representations are identical, except for the shift in origin. The
notation f(p ,q) denotes the element located in row p and the column q. For example f(6,2) is
the element in the sixth row and second column of the matrix f. Typically we use the letters
M and N respectively to denote the number of rows and columns in a matrix. A 1xN matrix
is called a row vector whereas an Mx1 matrix is called a column vector. A 1x1 matrix is a
scalar.

Matrices in MATLAB are stored in variables with names such as A, a, RGB, real
array and so on. Variables must begin with a letter and contain only letters, numerals and
underscores. As noted in the previous paragraph, all MATLAB quantities are written using
mono-scope characters. We use conventional Roman, italic notation such as f(x ,y), for
mathematical expressions

Reading Images:

Images are read into the MATLAB environment using function imread whose syntax
is

Imread (‘filename’)

Format name Description recognized extension

TIFF Tagged Image File Format .tif, .tiff

JPEG Joint Photograph Experts Group .jpg, .jpeg

GIF Graphics Interchange Format .gif

BMP Windows Bitmap .bmp

PNG Portable Network Graphics .png

XWD X Window Dump .xwd

31
NUMBER PLATE RECOGNITION USING MATLAB

Here filename is a spring containing the complete of the image file(including any
applicable extension).For example the command line

>> f = imread (‘8. jpg’);

Reads the JPEG (above table) image chest ray into image array f. Note the use of
single quotes (‘) to delimit the string filename. The semicolon at the end of a command line is
used by MATLAB for suppressing output If a semicolon is not included. MATLAB displays
the results of the operation(s) specified in that line. The prompt symbol (>>) designates the
beginning of a command line, as it appears in the MATLAB command window.

Data Classes:

Although we work with integers coordinates the values of pixels themselves are not
restricted to be integers in MATLAB. Table above list various data classes supported by
MATLAB and IPT are representing pixels values. The first eight entries in the table are refers
to as numeric data classes. The ninth entry is the char class and, as shown, the last entry is
referred to as logical data class.

All numeric computations in MATLAB are done in double quantities, so this is also a
frequent data class encounter in image processing applications. Class unit 8 also is
encountered frequently, especially when reading data from storages devices, as 8 bit images
are most common representations found in practice. These two data classes, classes logical,
and, to a lesser degree, class unit 16 constitute the primary data classes on which we focus.
Many ipt functions however support all the data classes listed in table. Data class double
requires 8 bytes to represent a number uint8 and into 8 require one byte each, uint16 and
int16 requires 2bytes and unit 32.

Name Description

Double precision, floating point numbers the Approximate.

Uint8 unsigned 8_bit integers in the range [0,255] (1byte per


Element).

Uint16 unsigned 16_bit integers in the range [0, 65535] (2byte per element).

Unit 32 unsigned 32_bit integers in the range [0, 4294967295](4 bytes per
element). Int8 signed 8_bit integers in the range [-128,127] 1 byte per element)

32
NUMBER PLATE RECOGNITION USING MATLAB

Int 16 signed 16_byte integers in the range [32768, 32767] (2 bytes per
element).

Int 32 Signed 32_byte integers in the range [-2147483648, 21474833647] (4 byte


per element).

Single _precision floating _point numbers with values

In the approximate range (4 bytes per elements)

Char characters (2 bytes per elements).

Logical values are 0 to 1 (1byte per element).

Int 32 and single required 4 bytes each. The char data class holds characters in
Unicode representation. A character string is merely a 1*n array of characters logical array
contains only the values 0 to 1,with each element being stored in memory using function
logical or by using relational operators.

5.2 Image Types:

The toolbox supports four types of images:

1 .Intensity images;

2. Binary images;

3. Indexed images;

4. R G B images.

Most monochrome image processing operations are carried out using binary or
intensity images, so our initial focus is on these two image types. Indexed and RGB colour
images.

Intensity Images:
An intensity image is a data matrix whose values have been scaled to represent
intentions. When the elements of an intensity image are of class unit8, or class unit 16, they

33
NUMBER PLATE RECOGNITION USING MATLAB

have integer values in the range [0,255] and [0, 65535], respectively. If the image is of class
double, the values are floating point numbers. Values of scaled, double intensity images are
in the range [0, 1] by convention.

Binary Images:

Binary images have a very specific meaning in MATLAB.A binary image is a logical
array 0s and1s.Thus, an array of 0s and 1s whose values are of data class, say unit8, is not
considered as a binary image in MATLAB .A numeric array is converted to binary using
function logical. Thus, if A is a numeric array consisting of 0s and 1s, we create an array B
using the statement.

B=logical (A)

If A contains elements other than 0s and 1s.Use of the logical function converts all
nonzero quantities to logical 1s and all entries with value 0 to logical 0s.

Using relational and logical operators also creates logical arrays.

To test if an array is logical we use the I logical function: is logical (c).

If c is a logical array, this function returns a 1.Otherwise returns a 0. Logical array can
be converted to numeric arrays using the data class conversion functions.

34
NUMBER PLATE RECOGNITION USING MATLAB

Indexed Images:

An indexed image has two components:

A data matrix integer, x

A color map matrix, map

Matrix map is an m*3 arrays of class double containing floating point values in the
range [0, 1].The length m of the map are equal to the number of colors it defines. Each row of
map specifies the red, green and blue components of a single color. An indexed images uses
“direct mapping” of pixel intensity values color map values. The color of each pixel is
determined by using the corresponding value the integer matrix x as a pointer in to map. If x
is of class double ,then all of its components with values less than or equal to 1 point to the
first row in map, all components with value 2 point to the second row and so on. If x is of
class units or unit 16, then all components value 0 point to the first row in map, all
components with value 1 point to the second and so on.

RGB Image:

An RGB color image is an M*N*3 array of color pixels where each color pixel is triplet
corresponding to the red, green and blue components of an RGB image, at a specific spatial
location. An RGB image may be viewed as “stack” of three gray scale images that when fed
in to the red, green and blue inputs of a color monitor

Produce a color image on the screen. Convention the three images forming an RGB
color image are referred to as the red, green and blue components images. The data class of

35
NUMBER PLATE RECOGNITION USING MATLAB

the components images determines their range of values. If an RGB image is of class double
the range of values is [0, 1].

Similarly the range of values is [0,255] or [0, 65535].For RGB images of class units
or unit 16 respectively. The number of bits use to represents the pixel values of the
component images determines the bit depth of an RGB image. For example, if each
component image is an 8bit image, the corresponding RGB image is said to be 24 bits deep.

Generally, the number of bits in all component images is the same. In this case the
number of possible color in an RGB image is (2^b) ^3, where b is a number of bits in each
component image. For the 8bit case the number is 16,777,216 colors.

36
NUMBER PLATE RECOGNITION USING MATLAB

CHAPTHER 4
RESULT

37
NUMBER PLATE RECOGNITION USING MATLAB

38
NUMBER PLATE RECOGNITION USING MATLAB

CHAPTHER 5
Conclusion

Thus a completely unique methodology of car registration number plate extraction has
been projected and check results are shown The method proposed above uses Hough
transform and horizontal projection profile each of that have economical and fast hardware
implementation, to not solely extract the number plate however additionally at the same time
segment out the characters. Thus reducing computation overhead further as introducing
parallelism into the design makes it longer economical and time efficient. Further work in
this direction is very much necessary to include all the possible complex cases and also
consider minor rotation and skew. Thus a robust real time system can be developed at low
cost.

39
NUMBER PLATE RECOGNITION USING MATLAB

REFERENCES:

[1] Abbas M. Al-Ghaili, SyamsiahMashohor, Abdul Rahman Ramli, and


AlyaniIsmail,“Vertical-Edge-Based Car-License-Plate Detection Method.”, IEEE
Transactions on Vehicular Technology vol. 62, no. 1,Jan 2013 .
[2] B. Hongliang and L. Changping,“A hybrid license plate extraction method based on edge
statistics and morphology,”, IEEE Proc. ICPR, pp. 831-834, 2004.
[3] D. Zheng, Y. Zhao, and J. Wang, “An efficient method of license plate location ,” Pattern
Recognition. Lett., vol. 26, no.15, pp, Nov 2005.
[4] H.J. Lee, S.Y. Chen, and S.Z. Wang, “Extraction and recognition of license plates of
motorcycles and vehicles on highways,”, in Proc. ICPR, pp. 356-359, 2004.
[5] A. Broumandnia and M. Fathy,“Application of pattern recognition for Farsi license plate
recognition,”, presented at the ICGST Int. Conf Graphics, Vision and Image Processing
(GVIP),[Online]. Available: http://www.icgst.com/gvip/v2/P1150439001.pdf, Dec. 2005.
[6] T. D. Duan, T. L. Hong Du, T. V. Phuoc and N. V. Hoang, “Building an automatic
vehicle license plate recognition system ,”, Iin Proc. Int. Conf. Comput.Sci. RIVF, pp. 59-63,
2005.
[7] C.T. Hsieh, Y.S Juan, and K.M. Hung, “Multiple license plate detection for complex
background,”, in Proc. Int. Conf. AINA, vol. 2, pp. 389-392, 2005.

40
NUMBER PLATE RECOGNITION USING MATLAB

[8] D.S. Kim and S.I. Chien, “Automatic car license plate extraction using modified
generalized symmetry transform and image warping,”, in Proc. ISIE, pp.2022-2027, 2001.
[9] S.H. Park, K.I. Kim, and H.J. Kim, “Locating car license plate using neural networks,”,
Electron. Let, vol. 35, no.17, pp. 1475-1477, 2005.
[10] N.Zimic, J. Ficzko, M. Mraz and J. Virant, “The fuzzy logic approach to car number
plate locating problem,”, in Proc. Intelligent Information Systems, pp. 227-230, 1997.
[11] Hinde Anoual, Sanaa El Fkihi, Abdeilah Jilbab and DrissAboutajdine, “A Novel
Texture-Based Algorithm for Localizing Vehicle License Plates ,”, in Journal of Theoretical
and Applied Information Technology 15th November 2012. Vol. 45 No.1.
[12] J. Matas and K. Zimmermann, “Unconstrained license plate and text localization and
recognition”, Proceedings of the 8th International IEEE Conference on Intelligent
Transportation Systems , pages 572– 577, Wien, Austria, 2005.
[13] Abdollah Amirkhani Shahraki, Amir Ebrahimi Ghahnavieh and
SeyyedAbdollahMirmahdavi, “License Plate Extraction From Still
Images,”, 4th International Conference on Intelligent Systems, Modelling and Simulation,
2013.
[14] Muhammad H Dashtban, Zahra Dashtban and Hassan Bevrani, “A Novel Approach for
Vehicle License Plate Localization and Recognition,”, International Journal of Computer
Applications (0975 ˝U 8887)Volume 26˝U No.11,July 2011.

41

Anda mungkin juga menyukai