Professional Documents
Culture Documents
CHAPTER 1
Introduction
The problem of vehicle license plate recognition is an interesting one and over the
years has attracted a plethora of researchers and computer vision experts. The
applications of such a system are vast and can range from parking lot security to traffic
management. There are various approaches to the solution of this problem, such as
texture-based, morphology-based and boundary line-based. This dissertation, presents
a morphology-based approach for the identification of a license plate in the image of a
vehicle. The recognition process deviates from the conventional approach of using
Optical Character Recognition (OCR) systems and utilizes the concept of color
coherence vectors. Researchers have been proposed a variety of solutions for the
problem of license plate identification and recognition in images.
1
ANPDRS
Massive integration of information technologies into all aspects of modern life caused
demand for processing vehicles as conceptual resources in information systems.
Because a standalone information system without any data has no sense, there was
also a need to transform information about vehicles between the reality and
information systems.
This can be achieved by a human agent, or by special intelligent equipment which is
be able to recognize vehicles by their number plates in a real environment and reflect
it into conceptual resources. Because of this, various recognition techniques have been
developed. Already in 1976, the Police Scientific Development Branch in the UK
started developing a system that was up and running in 1979. In 1981 the first arrest
due to a stolen car being detected by this system was made. However, since most
previous work has been done by private corporations, much of the underlying theory is
kept secret. But from the publically available articles it can be deduced that the
different solutions for automatic license plate recognition generally consist of two
parts:
1. Finding license plates in images
2. Reading text from license plates
The second part of the problem, reading text, is really just a subset of the vast field of
optical character recognition (OCR).
Number plate recognition systems are today used in various traffic and security
applications, such as parking, access and border control, or tracking of stolen cars. In
parking, number plates are used to calculate duration of the parking. When a vehicle
enters an input gate, number plate is automatically recognized and stored in database.
When a vehicle later exits the parking area through an output gate, number plate is
2
ANPDRS
recognized again and paired with the first-one stored in the database. The difference in
time is used to calculate the parking fee.
Automatic number plate recognition systems can be used in access control. For
example, this technology is used in many companies to grant access only to vehicles
of authorized personnel.
In some countries, ANPR systems installed on country borders automatically detect
and monitor border crossings. Each vehicle can be registered in a central database and
compared to a black list of stolen vehicles. In traffic control, vehicles can be directed
to different lanes for a better congestion control in busy urban communications during
the rush hours.
The problem is to detect a rectangular area of the number plate and to recognize the
vehicle’s identification number from the number plate area in an original image.
Humans define a number plate in a natural language as a “small plastic or metal plate
attached to a vehicle for official identification purposes”, but machines do not
understand this definition as well as they do not understand what “vehicle”,” road”, or
whatever else is. Because of this, there is a need to find an alternative definition of a
number plate based on descriptors that will be comprehensible for machines.
Let us define the number plate as a “rectangular area with increased occurrence of
horizontal and vertical edges”. The high density of horizontal and vertical edges on a
small area is in many cases caused by contrast characters of a number plate, but not in
every case. This process can sometimes detect a wrong area that does not correspond
to a number plate. Because of this, we often detect several candidates for the plate by
this algorithm, and then we choose the best one by a further heuristic analysis and then
the recognition algorithm is applied on the chosen candidate to the number form the
number plate.
3
ANPDRS
As a scope of a project, we have to detach or extract the number plate and recognize
the number from the snapshot acquired by the sensor or the camera or any hardware
specified for the purpose. This will be performed by first applying certain convolution
operation over the buffered image i.e. Rank Filtering and Sobel Operator (edge
detection). Projection of an image is further be taken for clipping the band, again
projection of the band is taken for clipping the plate.
In the case, of the skewed image we have applied Hough Transformation for
deskewing the. By the help of transformation we acquired an angle of tilt of an image
by which it is skewed. This angle is used for the deskewing the image.
The next step after the detection of the number plate area is a segmentation of the
plate. The segmentation is one of the most important processes in the automatic
number plate recognition, because all further steps rely on it. If the segmentation fails,
a character can be improperly divided into two pieces, or two characters can be
improperly merged together. We used a horizontal projection of a number plate for the
segmentation in the first phase. The second phase of the segmentation is an
enhancement of segments. The segment of a plate contains besides the character also
undesirable elements such as dots and stretches as well as redundant space on the sides
of character. We eliminate these elements and extract only the character
4
ANPDRS
The optical character recognition technique has been frequently used for identifying
characters in the extracted image of a license plate. However, the processing time and
accuracy of this technique are questionable. This algorithm presented in this
dissertation presents an extremely fast and accurate method of recognizing license
plates. The algorithm can be termed as an illiterate one, in the sense that it does not
extract the characters within the image but it recognizes the image as a whole. To
build the initial database, images of the required license plates are preprocessed and
their parameters are stored. During the recognition process these parameters are
simply compared with those of the input image in constant time and the best match is
retrieved. Due to its static complexity it is an extremely fast technique for image
recognition.
5
ANPDRS
CHAPTER 2
Exhaustive Literature Survey
2.1 Introduction
6
ANPDRS
It is the process in which the number plate area is detected in a given snapshot. The
number plate can not be recognized by the computer system directly from the image
so we need a method to detect the number plate in the form that an be understood by
computer.
7
ANPDRS
to 100%, etc.), the resultant number is the desired linear luminance value; it typically
needs to be gamma compressed to get back to a conventional grayscale representation.
Convolution matrix
Rank filter is an image processing term. Horizontally and vertically oriented rank
filters are often used to detect clusters of high density of bright edges in the area of the
number plate. The width of the horizontally oriented rank filter matrix is much larger
than the height of the matrix and vice versa for the vertical rank filter. Typically, in
digital filtering, pixels within a window are ranked by intensity values, and the center
pixel is replaced with a new value. The new value is calculated as a function of the
ranked pixels. Only the original pixel values are used in the ranking when determining
the new pixel value. Typical functions used in ranking are the median, mean and mode
filter.
Image Projection
The vertical projection is simply the sum (or possibly the mean value) of all of the
rows, and the horizontal projection is the same operation applied to the columns. It is
often used to identify spatially restricted objects within an image.
8
ANPDRS
The band clipping is an operation, which is used to detect and clip the vertical area of
the number plate (so-called band) by analysis of the vertical projection of the
snapshot. The plate clipping is a consequent operation, which is used to detect and clip
the plate from the band (not from the whole snapshot) by a horizontal analysis of such
band.
Plate segmentation
The segmentation is one of the most important processes in the automatic numberplate
recognition.Segmentation refers to the process of partitioning a digital image into
multiple segments (sets of pixels). The goal of segmentation is to simplify and/or
change the representation of an image into something that is more meaningful and
easier to analyze. Image segmentation is typically used to locate objects and
boundaries (lines, curves, etc.) in images. More precisely, image segmentation is the
process of assigning a label to every pixel in an image such that pixels with the same
label share certain visual characteristics.
Feature Extraction
When the input data to an algorithm is too large to be processed and it is suspected to
be notoriously redundant (much data, but not much information) then the input data
will be transformed into a reduced representation set of features (also named features
vector). Transforming the input data into the set of features is called features
extraction. Feature extraction involves simplifying the amount of resources required to
describe a large set of data accurately. When performing analysis of complex data one
of the major problems stems from the number of variables involved. Analysis with a
large number of variables generally requires a large amount of memory and
computation power or a classification algorithm which overfits the training sample and
9
ANPDRS
generalizes poorly to new samples. Feature extraction is a general term for methods of
constructing combinations of the variables to get around these problems while still
describing the data with sufficient accuracy.
Character recognition
2.3 Conclusion
The Anpdr system includes two parts number plate area detection and character
recognition. First part deals with the detection of plate area and second part with the
recognition of characters on the identified number plate. Plate area detection includes
series of operations which are applied on the image to detect the number plate.
10
ANPDRS
Chapter 3
Methods and Approaches
11
ANPDRS
12
ANPDRS
Figure 2.1
Horizontally and vertically oriented rank filters are often used to detect clusters of
high density of bright edges in the area of the number plate. The width of the
horizontally oriented rank filter matrix is much larger than the height of the matrix (
w>> h ), and vice versa for the vertical rank filter ( w<< h ).
To preserve the global intensity of an image, it is necessary to each pixel be replaced
with an average pixel intensity in the area covered by the rank filter matrix. In general,
the convolution matrix should meet the following condition:
13
ANPDRS
The Sobel edge detector uses a pair of 3x3 convolution matrices. The first is
dedicated for evaluation of vertical edges, and the second for evaluation of horizontal
edges.
The magnitude of the affected pixel is then calculated using the formula
G(x y) =sqrt(G2 (x) .G2 (y)) . In praxis, it is faster to calculate only an approximate
magnitude as x y |G| =G(x)| +|G(y)|.
After the series of convolution operations, we can detect an area of the number
plate according to a statistics of the snapshot. There are various methods of statistical
analysis. One of them is a horizontal and vertical projection of an image into the axes
x and y .
Let an input image be defined by a discrete function f (x, y). Then, a vertical
projection y p of the function f at a point y is a summary of all pixel magnitudes in the
14
ANPDRS
yth row of the input image. Similarly, a horizontal projection at a point x of that
function is a summary of all magnitudes in the xth column.
There is a strong analogy in a principle between the band and plate clipping.
The plate clipping is based on a horizontal projection of band. At first, the band must
be processed by a vertical detection filter. If w is a width of the band (or a width of the
analyzed image), the corresponding horizontal projection
15
ANPDRS
coordinate system, such as [0,0] represents the upper left corner and [w-1,h -1] the
bottom right, where w and h are dimensions of the area
In general, the captured snapshot can contain several number plate candidates.
Because of this, the detection algorithm always clips several bands, and several plates
from each band. There is a predefined value of maximum number of candidates, which
are detected by analysis of projections. By default, this value is equals to nine.
There are several heuristics, which are used to determine the cost of selected
candidates according to their properties. These heuristics have been chosen ad hoc
during the practical experimentations. The recognition logic sorts candidates
according to their cost from the most suitable to the least suitable. Then, the most
suitable candidate is examined by a deeper heuristic analysis. The deeper analysis
definitely accepts, or rejects the candidate. As there is a need to analyze individual
characters, this type of analysis consumes big amount of processor time
The basic analysis is used to evaluate the cost of candidates, and to sort them
according to this cost. There are several independent heuristics, which can be used to
evaluate the cost I . The heuristics can be used separately, or they can be combined
together to compute an overall cost of candidate by a weighted sum:
α = 0 .15α 1 + 0.25α 2+ 0.4α 3
16
ANPDRS
Table 2.1
The captured rectangular plate can be rotated and skewed in many ways due to
the positioning of vehicle towards the camera. Since the skew significantly degrades
the recognition abilities, it is important to implement additional mechanisms, which
are able to detect and correct skewed plates. The fundamental problem of this
mechanism is to determine an angle, under which the plate is skewed. Then,
deskewing of so evaluated plate can be realized by a trivial affine transformation.
It is important to understand the difference between the “sheared” and
“rotated” rectangular plate. The number plate is an object in three-dimensional space,
17
ANPDRS
which is projected into the two dimensional snapshot during the capture. The
positioning of the object can sometimes cause the skew of angles and proportions.
If the vertical line of plate v p is not identical to the vertical line of camera
objective v c, the plate may be sheared. If the vertical lines v p and v c are identical,
but the axis a p of plate is not parallel to the axis of camera a c, the plate may be
rotated
Figure 2.2
18
ANPDRS
coordinate system, there is a line in an “AB” coordinate system (so called “Hough
space”)
where Sx and Sy are shear factors. The Sx is always zero, because we shear the plate
only in a direction of the Y-axis
Let P be a vector representing the certain point, such as P [x, y,1]where x and y
are coordinates of that point. The new coordinates [ x s , y s ,1]of that point after the
shearing can be computed as:
P s =P .A
19
ANPDRS
.
2.2 Segmentation of plate using a horizontal projection
20
ANPDRS
The segment of plate contains besides the character also redundant space and
other undesirable elements. We understand under the term “segment” the part of a
number plate determined by a horizontal segmentation algorithm. Since the segment
has been processed by an adaptive thresholding filter, it contains only black and white
pixels. The neighboring pixels are grouped together into larger pieces, and one of them
is a character. Our goal is to divide the segment into the several pieces, and keep only
one piece representing the regular character
21
ANPDRS
Let v be an original value of the pixel, such as vÎ 0,1 . The new value v¢ is
computed as:
22
ANPDRS
Since the threshold t is global for a whole image, the global thresholding can
sometimes fail. So for over coming the drawback we use Adaptive Thresholding
23
ANPDRS
We will assume that mxn are dimensions of the original image, and m’xn’are
dimensions of the image after resampling. The horizontal and vertical aspect ratio is
defined as r x =m’/m and r y=n’/n , respectively.
24
ANPDRS
If the aspect ratio is lower than one, then each pixel in the resampled
(destination) image corresponds to a group of pixels in the original image, but only
one value from the group of source pixels affects the value of the pixel in the
resampled image. Although the nearest neighbor downsamping significantly reduces
information contained in the original image by ignoring a big amount of pixels, it
preserves sharp edges and the strong bipolarity of black and white pixels. Because of
this, the nearest neighbor downsamping is suitable in combination with the “edge
detection” feature extraction method
2.3.7 Feature extraction
Information contained in a bitmap representation of an image is not suitable for
processing by computers. Because of this, there is need to describe a character in
another way. The description of the character should be invariant towards the used
font type, or deformations caused by a skew. In addition, all instances of the same
character should have a similar description. A description of the character is a vector
of numeral values, so-called “descriptors”, or “patterns”:
x =x0 ,…, xn1
Generally, the description of an image region is based on its internal and
external representation. The internal representation of an image is based on its
regional properties, such as color or texture. The external representation is chosen
when the primary focus is on shape characteristics. The description of normalized
characters is based on its external characteristics because we deal only with properties
such as character shape. Then, the vector of descriptors includes characteristics such
as number of lines, bays, lakes, the amount of horizontal, vertical and diagonal or
diagonal edges, and etc. The feature extraction is a process of transformation of data
from a bitmap representation into a form of descriptors, which are more suitable for
computers.
If we associate similar instances of the same character into the classes, then the
descriptors of characters from the same class should be geometrically closed to each
other in the vector space. This is a basic assumption for successfulness of the pattern
25
ANPDRS
recognition process. This section deals with various methods of feature extraction, and
explains which method is the most suitable for a specific type of character bitmap. For
example, the “edge detection” method should not be used in combination with a
blurred bitmap.
The feature extraction techniques discussed in the previous two chapters are
based on the statistical image processing. These methods do not consider structural
aspects of analyzed images. The small difference in bitmaps sometimes means a big
difference in the structure of contained characters. For example, digits ‘6’ and ‘8’ have
very similar bitmaps, but there is a substantial difference in their structures.
The structural analysis is based on higher concepts than the edge detection
method. It does not deal with terms such as “pixels” or “edges”, but it considers more
complex structures (like junctions, line ends or loops). To analyze these structures, we
must involve the thinning algorithm to get a skeleton of the character. This chapter
deals with the principle of skeletonization as well as with the principle of structural
analysis of skeletonized image
26
ANPDRS
neighborhood:
The inner region I of character is a set of black pixels, which are not boundary
pixels:
For the recognition of the characters from the segmented number plate area OCR
techniques are applied on the plate area. OCR process are applied with the use of ORC
API in java which includes various classes that performs the OCR process on a given
input image.
The different classes used are:
1. OCR()
2. a()
3. b()
27
ANPDRS
28
ANPDRS
29
ANPDRS
Sub Processes
Sub Processes
30
ANPDRS
Sub Processes
Sub Processes
Sub Processes
Sub Processes
31
ANPDRS
Sub Processes
Sub Processes
3.3 Methods
java.awt.Color;
java.awt.image.BufferedImage;
java.io.File;
java.io.IOException;
javax.imageio.ImageIO;
java.awt.image.ConvolveOp;
32
ANPDRS
java.awt.image.Kernel;
java.awt.image.Raster;
java.awt.image.WritableRaster;
java.lang.String.*;
java.awt.event.*;
javax.swing.*;
java.awt.*;
Method Descriptions:
CLASS: Photo (user defined class)
33
ANPDRS
vpProjection(BufferedImage ims): method uses the buffered image and add ups the
brightness value accross the verticle vertex
main():
OCR()
34
ANPDRS
Chapter 4
Prototyping
35
ANPDRS
Figure 4.1
A java swing interface having Button “load image” which will be used for the
purpose of loading image. As soon as the button is pressed the console will ask for the
snapshot present in the local disk.
36
ANPDRS
Figure 4.2
37
ANPDRS
As soon as the vehicle snapshot is loaded into the console. The “grayscale”
button will convert the original image into gray scale image.
After the image is converted into grayscale the “rank filter” buttom will apply
various rank filters on the image obtained from previous task
The image is then processed further and its horizontal projection is obtained by
the “horizontal projection” button.
38
ANPDRS
Now the required number plate area is displayed on the console and OCR
operation is performed on the image obtained by the “display number” button and the
number will be displayed on the small console on the right side of the entire console.
CHAPTER 5
Implementation Results
EXPERIMENTAL RESULTS
Extensive testing has been conducted with more than 25 indian vehicles.
Images have been captured from various distances and viewing angles.
Image size has varied from 64K to 1M pixels. JPEG and PNG image
compression was tried along with a raw uncompressed gray level imagery.
Different daylight conditions were examined, from bright sunlight illumination
to half-darkness. Very frequently the plate zone has been in a shadow and the
contrast of characters has been poor with regard to the plate’s background.
Situations of mixed illumination, where certain portions of the plate were
shadowed, while the others were brightly illuminated, caused problems and
sometimes led to rejection of the whole plate.
The true license plate zone was correctly located and approved on
more than 85% of the images. The rest of the cases were rejected by one of
the consistency tests. It is important to stress that there have been zero false
39
ANPDRS
positive errors, which explain the relatively high share of rejected plates due to
the conservative tests while approving plate “candidates”.
CHAPTER 6
Comparison with existing State of Art Technologies
Vertical seg
40
ANPDRS
Rotated plate
Noisy image
Vertical segmentation of the number plate is better than the existing technology.
As applied theshold before projection which help in eliminating the unwanted pixels
which adds a pusedo brightness.
Noise removal is optimal as the increased rank of filter drastically make changes and
reduce the heavy noise fom the snapshot .
41
ANPDRS
CHAPTER
Conclusions
42
ANPDRS
The project utilizes the algorithmic and mathematical aspects of the automatic
number plate recognition systems, such as problematic of machine vision, pattern
recognition, OCR and neural networks. The problematic has been divided into several
steps, according to a logical sequence of the individual recognition steps. Even though
there is a strong succession of algorithms applied during the recognition process.
References
43
ANPDRS
http://www.virtualventures.ca/~neil/neural/neuron.html
[3] Gonzalez R., Woods R.: Digital Image Processing, Prentice Hall, Upper Saddle
River, New Jersey, 2002
[6] Kvasnicka V., Benuskova L., Pospichal J., Farkas I., Tino P., Kral A.:
Introduction to Neural Networks, Technical University, Kosice, Slovak Republic
[8] Shapiro V., Dimov D., Bonchev S., Velichkov V., Gluhchev G.: Adaptive License
Plate Image Extraction, International Conference Computer Systems and
Technologies, Rousse, Bulgaria, 2004
[9] Smagt P.: Comparative study of neural network algorithms applied to optical
character recognition, International conference on Industrial and engineering
applications of artificial intelligence and expert systems, Charleston, South Carolina,
USA, 1990
[11] Wang J., Jean J.: Segmentation of merged characters by neural networks and
shortest-path, Symposium on Applied Computing, Indianapolis, Indiana, USA, 1993
44
ANPDRS
[12] Zhang Y., Zhang C.: New Algorithm for Character Segmentation of License
Plate, Intelligent Vehicles Symposium, IEEE, 2003
45