Automatic Arabic Number Plate Recognition
Automatic Arabic Number Plate Recognition
net/publication/271548759
CITATIONS READS
5 2,077
3 authors:
1 PUBLICATION 5 CITATIONS
Helwan University
60 PUBLICATIONS 163 CITATIONS
SEE PROFILE
SEE PROFILE
Faten S. A. Zaki
National Research Center, Egypt
54 PUBLICATIONS 1,043 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Alaa Hamdy on 09 September 2015.
Abstract---This paper presents a license plate recognition operations and strongly avoids float point calculations which
system for the Egyptian plates introduced in 2008.The proposed adds speed enhancement.
system is composed of three main stages; localization & skew
correction stage, segmentation stage, and recognition stage. The In the segmentation stage, connected component analysis is
localization stage uses the main feature of the plate where high applied to find objects in the localized plate. Objects widths
contrast text-background is tagged with colored or gray area, to summing is used instead of horizontal binary projection of the
find the plate candidates in the image and to measure the skew binarised plate to find the main line crossing all the digits and
angle. In segmentation stage, connected component analysis is letters and to establish the upper and lower boundaries of the
applied to find objects belong to license number. The objects will plate text. This technique yields only one strong maximum
be analyzed to attach diacritic and over segmented objects to each
other to form a group of recognizable objects. The final objects value, which in turn results in speed enhancement. The plate
will be split to digits and letter groups. In recognition stage, an text boundaries are used to form recognizable objects that are
adapted template match technique is introduced to recognize the composed of digits, letters, and their diacritic, or parts of over
digits and letter groups separately after normalizing them. The segmented digits and letters. The final recognizable object is
system is tested against a real video of two hours and the accuracy split to digits and letter groups. In the recognition stage,
was 81% and average time per frame was 24 msec/frame. template matching technique has been adapted to find the best
match to the recognizable objects. A separate image for each
Keywords: Egyptian license plate recognition; connected
digit and letter is extracted from the real scene images. Such
component; template matching. image is normalized either to 30x60 (TA) or 40x50 (TB).
Digits and letter objects are normalized to TA or TB based on
I. INTRODUCTION their geometries. Each object is compared against its
corresponding templates and the best match is chosen. The
License Plate Recognition (LPR) is an image overall performance is measured using real outdoor video (two
processing technology used to identify vehicles by their license hours video containing about 203000 frames), from four
plates [1]. LPR plays an important role in numerous different locations. To measure the algorithm accuracy, the
applications such as unattended parking lots, security control of plates noticed in the video are manually recorded. The
restricted areas, traffic law enforcement, congestion pricing, algorithm applied to each frame of the video and each result is
and automatic toll collection [2]. LPR is a very interesting but compared to the manually recorded plates to compute the error
difficult one. It requires some complex tasks, detection, using nearest hamming distance. The system accuracy was
segmentation and recognition. These tasks become more 81% accuracy. The algorithm average time per frame was 24
sophisticated when dealing with plate images taken in various msec/frame.
inclined angles or plate images with noise. Because this
problem is usually used in real-time systems, it requires not Fig. 1 shows typical scene images of the target plates. Fig.
only accuracy but also fast computation [3]. 2 shows typical plate dimensions.
Most previous works have in some way restricted their
working conditions, such as limiting them to indoor scenes,
stationary backgrounds, and fixed illumination [2].
Due to the different types of license plates being used, the
requirement of an automatic license plate recognition system is
rather different for each country [4].
This paper presents a license plate recognition system for
the Egyptian plates introduced in 2008.The proposed system is
composed of three main stages; localization& skew correction,
segmentation, and recognition.
In the localization stage, the main feature of plate of high
contrast text-background, tagged with colored or gray area, was
used to find the plate candidates in the image and to measure
Figure 1. Sample of the Egyptian new plates
the skew angle. Such technique depends mainly on integer
978-1-4799-3160-6/13/$31.00 2013
c IEEE 23
C. Color feature (CLF)
Strips located totally in colored area will have all pixels
with high chroma values, whereas strips located in white or
black, or generally in gray areas, will have all pixels with low
chroma values. Some strips will have colored areas and others
will have gray-level areas. It is important feature that strips
within plate rectangle will have all pixels with low chroma
Figure 2. Typical plate dimension value. Low or high chroma values depend on the exact colors
used in the plate design and in the capture device used. So, if a
suitable chroma threshold is selected (cThr), one could expect
II. THE PROPOSED ALGORITHM strips within the plate to have no colored pixels, or to be below
The proposed algorithm is composed of three stages; specific value (nCo). Such feature will be referred to by CLF.
localization, segmentation, and recognition. For the purpose of this study, nCo will be 0.25 of the total pixel
contained in one strip.
A. Plate Localization
The new Egyptian plate design is featuring black digits
over white background area directly under colored or gray tag. D. Plate Tag feature (PTF)
This feature is used to find plate candidates in the input image. The plate will have upper colored/Gray tag on top of the
Before presenting the details of the proposed algorithm, three number area. Such tag will form a feature that distinguishes
main concepts will be introduced, the local intensity change plate candidates from other objects in the input image.
feature, the color feature and tag feature.
E. Plate localization technique using LIF, CLF and PTF
B. Local intensity change (LIF)
After introducing LIF, CLF, PTF, nCh, and cThr, the
Consider the given image shown in Fig. 3 (a) , with localization algorithm could be as follows:
dimensions W*H. The image divided, virtually by the red
lines, to M by N strips. Also, consider the strip bounded by the 1) Given input image with W*H, it will be divided to
green rectangle which coincides within the plate rectangle. The M by N strips, each with width w and height h.
strip will have w*h, where w = W/M and h = H/N. If each
2) nCh will be selected based on the maximum target
vertical scan line pixels' intensity of such strip is added
plate width and cThr will be selected based on the
together, the intensity change across this strip will be as
capturing device. For the purpose of the study nCh
illustrated in Fig. 3 (b). Strip that has a constant color is
was 4 and cThr 39.
illustrated in the graph in Fig. 3 (c). What differentiates
between the two graphs is the high number of changes in the 3) For each strip, calculate LIF and CLF.
intensity due to the variation from text to background. Such
feature will be referred to by LIF. If by design minimum target 4) Ignore strips with LIF<nCh or CLF>nCo.
plate width is selected, and w is selected accordingly to be half 5) For each other strips, search vertically up to find the
of the plate width, one could expect strips located within plate first colored strip, i.e CLF>nCo.
rectangle to have at most six changes corresponding to three
digits across one strip. Similarly, if by design maximum plate 6) If colored strip is not found, search up to find gray
width is set to be equal W, minimum LIF would be 12/M. strip with intensity less than the current strip with
Such minimum level will be referred to by nCh. It should be specific value. Such value depends on gray level
noted that nCh will be an integer value. used in the plate design and on the capturing device.
For the purpose of the study, this value is selected to
be 30.
7) If strips in steps 5 and 6 are not found the strip will
be ignored.
8) If colored strip is found, one will creep left and right
as long as the pixel is colored (>cThr) to find the
upper left and right corner of the plate rectangle.
This step will end by reaching the plate edge of
black pixel at left or right.
9) If gray strip is found, one will creep left and right as
(a) (b) (c) long as the difference between gray level of pixels
and the average strip gray level is 30, as explained
Figure 3. (a) Typical image divided to 5 by 30 or M by N strips. (b) in step 6, to find the upper left and right corner of
Histogram shows the intensity variations over the strip width for the strip the plate rectangle. This step will end by reaching
framed by the green box. (c) Histogram shows the intensity variations over the the plate edge of black pixel at left or right.
strip width for strips located in the constant luminance areas.
24 2013 Second International Japan-Egypt Conference on Electronics, Communications and Computers (JEC-ECC)
10) Calculate the plate inclination angle using the The image in such rectangles will be normalized before passing
corners points in steps 8 or 9. it to the recognition stage.
11) Calculate the plate height based on the ratio of plate A. Connected component analysis
width to height which is 3.2. Connected component analysis (CCA) will be applied on
12) Verify that the current strip is located within the the candidate plate which is prepared in the localization stage.
final plate rectangle boundary, otherwise ignore this The target of this analysis is to spot objects in the CP. In Fig. 6,
strip. typical CP is analyzed by CCA. Objects discovered are framed
with pink (RO). Typical objects are digits, letters, top edge,
right edge, middle edge, and bottom edge. Objects belonging to
For images with 320x240, typical values for w, h, nCh are digits and letters (DLO) should be identified and others (NO)
32, 4,4, respectively, and nCo is 0.25*32*4=32. should be ignored. Since the exact design specification plate is
Fig.4 shows one image processed twice with different not available, analysis is done to estimate the digits and letters
parameters. The white strips satisfy the initial criteria of nCh dimensions. Around 30000 samples of the extracted digits and
and nCo. For both of the two images in Fig. 4, the strip letters are analyzed. Width, height, and the relative ratio of
bounded with green box is the strip which is used to localize height to DLO height (RH) are calculated. RH will be
plate. The localized plate is bounded with violet box. Once the explained in section III.B. It was found that:
plate candidate found, all the strips within such candidate will
be skipped in order to reduce the computations. This will 1) Digit (except ‘˾’ and ‘˺’ ) has average W/H of 0.45
enhance the overall performance. and H/RH is approximately 1
2) Letters could be divided into two groups relative to
RH
a) For ‘’, ‘Ν’,‘ρ’,‘ω’,‘ϕ’,‘ϝ’, and ‘ϡ’, H/RH >0.82
b) For ‘Ώ’,‘Ω’,‘έ’,‘α’,‘ι’,‘ϑ’,‘ϥ’,‘ϫ’,‘ϭ’,and ‘ϱ’,
0.6 < H/RH < 0.75
This information will be used in the recognition process.
Objects that will not fall in these boundaries will be ignored. It
Figure 4. A 320x240 image processed twice with different parameters (w, h, should be noted that objects in the RO is hierarchically
nCh, nCo, cThr). The left image is processed with (32, 4, 4,32,39) and the arranged from left to right and from top to bottom.
right image is processed with (64, 8, 8,128, 39). Shaded white area is the
strips that meet criteria. Strip bounded with green box is the seed to localize
the plate bounded with the violet box.
Figure 6. Typical localized plate after applying CCA. The object found is
bounded with the pink.
B. Filtering RO
The RO will be filtered based on three roles MOW, MOH,
and MOS.
1) Maximum Object Width (MOW)
Figure 5. The left image shows localized plate, bounded by yellow box. The Given an input image with width W, then the
inclination angle is 2.3 degrees and the final plate candidate after skew maximum object width that could fit in plate number is
correction and thresholding is shown in the right. MOW = W/6. This is because in such image the
maximum plate width would be W and it can contain
maximum three digits and three letters only. It should be
III. PLATE SEGMENTATION noted that plates with two letters are only distributed over
In the segmentation stage, rectangles that confine the digits 2/3 of half the plate. For W=320, MOW= (320/2)/3 = 53.
and the letters and its diacritics dot or dots will be constructed.
2013 Second International Japan-Egypt Conference on Electronics, Communications and Computers (JEC-ECC) 25
Appling MOW will remove the background objects and scratches in the plate. So, the DLO contains other objects due
most of the large objects belong to edges. to OSO. OSO should be attached to each other before passing it
to the recognition stage. In most of the cases, both OSO and
2) Maximum Object Height (MOH) diacritic overlap horizontally. This feature is used to attach
Given an input image with width W, then the overlapped objects together. Fig. 8 top shows samples of the
maximum object height is MOH = 0.6 * (W/3.2). This over segmented digits and letters. Also, Fig. 8 bottom-left
because the maximum plate height would be (W/3.2) and shows typical over segmented letters and how they have been
digits and letters only consume 0.6 of such height. For recovered as illustrated in Fig.8 bottom-right. The final
W=320, MOH = 0.6 * (320/3.2) = 60. Appling MOH will rectangles of the DLO are referred to by RR .
remove some of the vertical edges. In some cases,
localization algorithm will produce false large candidate
plates. Appling MOH will also reject such candidates.
3) Maximum Objects widths Sum(MOS)
Consider the top image in Fig. 7 with (x,y)
coordinates centered on the top left corner. Starting from
the top left corner, a horizontal line is drawn. The widths
of all the objects intersecting with such line are added
together. The sum of all widths is designated by OS(y).
Plotting OS(y) against y will produce the segmented red
Figure 8. The upper image shows the over segmented digits and letters. The
curve. The maximum point of such curve is pointed to by lower left image shows typical plate candidate after filtering by applying
MOS. The bottom image shows horizontal sum of black MOW, MOH, and MOS. The remaining objects result in two objects for 'ϭ'
pixels, plotted in pink. By comparing the two plots in and three objects for 'ϕ'. Attaching the related objects is shown in lower right
Fig. 7, the MOS will give strong and unique maximum image.
value against multiple maximum values in the second
D. Vertical Edges removal
method. Using MOS to search up and down for two
points where OS decreases by 0.8 of MOS will give Vertical edges object will still interface with DLO. The last
upper bound (UB) and the lower bound (LB) of the DLO. role applied depends on the distribution of digits and letters
The distance between UB and LB will typically be used through the plate. In the plates with four digits (4N_?L) plate
as RH. All the objects totally confined between UB&LP configuration, left and middles edges are very close to the
or partially confined with 50% inside will be included. digits objects. Also, in the plates with three letters (?N_3L),
Also, long objects that span UB and LB but less than middle and right edges are close to letters objects. This
1.2RH, will be included. This filter will remove objects arrangement is used to remove vertical edges in such
belonging to the upper and lower edges and Latin configurations.
characters that may appear on some plate versions. Also,
this role will remove vertical edges if they are longer
than 1.2RH. The final object group after applying MOW,
MOH, and MOS rules will be referred to by DLO.
Figure 9. The first image shows the left edge candidate that is removed by
comparing it against RH. The right image shows middle edge that is removed
by comparing its arrangement relative to other objects in the plate.
26 2013 Second International Japan-Egypt Conference on Electronics, Communications and Computers (JEC-ECC)
IV. PLATE RECOGNITION
In the plate recognition stage a modified template match
algorithm was used. The algorithm is used to find the best
match of each digit in RR to one of nine digits image set or to
find the best match of one letters in RR to one of seventeen
letters image set.
A. Template matching Figure 11. Images used in the recognition process. Upper images represent
digits and letters which have W/H <0.5 ( TA) . Lower images represent
Template match is a mathematical technique to find the images which have H/RH <0.8 (TB)
most similar part in large image (I) to a given smaller image
(T). This is done by sliding T over each pixel in I and compare
each pixel in T with pixel blow it in I. The result R of such V. EVALUATION AND RESULTS
comparison is a set of values each of corresponding similarity The overall performance was measured using real outdoor
measure at specific coordinate in I. If dimensions of I is W*H video (2 hours video containing about 203000 frames), from
and of T is w*h, R will contains (W-w+1)*(H-h+1) values. four different locations. To achieve this goal, a statistical
One could find the best match by searching for the maximum approach was considered. First, all the plates numbers noticed
value in this set. in the video were manually recorded in plate numbers database.
The resulting database included 875 plate numbers with the
different plate configurations (i.e. 3L_3N , 3L_4N …). The
next step was to apply the algorithm on each frame in the video
and the result plate number was checked if it was one of the
valid plate configurations otherwise it was ignored. Next, the
minimum hamming distance between each result and all plate
numbers with the same configuration in the database was
calculated. The hamming distance here represents the count of
mismatches or error (E). On the other hand, the sum of digits
and letters minus E represent the number of matches (M). The
accuracy would be calculated by M/(M+E). The system yields
81% accuracy. The average time per frame was 24 msec/frame
on machine of 3 GHz Intel i3 processor.
I T R
VI. CONCLUSION
Figure 10. Template image match technique. I is the input image, T is the
template image, R is the resulted image where the result is framed by red. This paper presents a license plate recognition system for
the new Egyptian license plate introduced after 2008. The
system uses the main feature of plate of high contrast plate area
B. The modified template match with color or gray tag on top to find the plate inside the image.
The modified template technique would use separate image The CCA is used as main tool for segmentation and splitting
for each digit and letter. RR would then be normalized to the digits and letters. A modified template matching is used to
size of this set and compared separately. Such comparison recognize the plate digits and letters. The system accuracy was
would yield only one value, since W=w and H = h and (W- 81 % and average time per frame was 24 msec/frame.
w+1) (H-h+1) =1. Selecting the best match would only require
finding the maximum value in set of nine values for digits and
in set of seventeen values for letters. REFERENCES
If the original technique is used and a template of size [1] C. Nelson Kennedy and N.Krishnan, "An efficient geometric feature
40*50 is used, the width of the image containing the letters based license plate localization and recognition," International Journal of
imaging scince and engineering(IJISE), GA,USA, ISSN:1934-9955, vol.
group is 17*40=680 and the height is 50. Each image 2, no. 2, April 2008.
comparison requires (680-40)*40*50 = 1280000 operations.
[2] Shyang-Lih Chang, Li-Shien Chen, Yun-Chung Chung, and Sei-Wan
However, with the modified technique, the operation would be Chen, "Automatic license plate recognition," IEEE transactions on
40*50*17=34000 operations only. intelligent transportation systems, vol. 5, no. 1, March 2004.
Preparing the master images is by extracting them from the [3] Tran DucDuan, Tran Le Hong Du, Tran VinhPhuoc and Nguyen Viet
Hoang, "Building an automatic vehicle license-plate recognition
real data and normalizing them to TA or TB , as shown in Fig. system," Intl. Conf. in Computer Science-RIVF’05, Can Tho, Vietnam,
11. With referring to section III.A, the images on the top show February 2005.
the digits and letters where W/H <0.5 and the bottom shows the [4] SitiNorul Huda Sheikh Abdullah,Marzuki Khalid, RubiyahYusof and
images of H/RH <0.8. Khairuddin Omar, "License plate recognition using multi-cluster and
multilayer neural networks," Information and Communication
Technologies, ICTTA '06. 2nd, vol. 1, pp. 1818-1823, April 2006.
2013 Second International Japan-Egypt Conference on Electronics, Communications and Computers (JEC-ECC) 27
[5] A. Shawky, A. Hamdy, H.Keshk, and M. EL_Adawy, “License plate
recognition of moving vehicle,” Journal of Engineering Sciences, Assiut
University, vol. 37, no. 6, pp. 1489-1498, November 2009.
[6] M. Haragi, M. Adawi and H. Keshk, "Automatic license plate
recognition," Master thesis, Faculty of Engineering, Helwan University,
2005.
[7] Harish D.Kendre,Gaurav V. Talokar, Mohan Girhe, TejasPidkalwar and
D.P. Rathod, "The automatic number plate recognition system (anpr),"
International Journal of mathematics and computer research, ISSN
:2320-7167, vol. 1, issue 3, pp. 99-102, April 2013.
28 2013 Second International Japan-Egypt Conference on Electronics, Communications and Computers (JEC-ECC)