A New Algorithm for Character Segmentation of License Plate

4
A New Algorithm for Character Segmentation of License Plate Yungang Zhang Changshui Zhang Dept. of Automation, Tsinghua University Dept. of Automation, Tsinghua University The Institute of Information Processing The Institute of Information Processing Beijing 100084, China Beijing 100084,China [email protected] [email protected] Abstract Character segmentation is an important step in License Plate Recognition (LPR) system. There are many dif- ficulties in this step, such as the influence of image noise, plate frame, rivet, the space mark, and so on. This paper presents a new algorithm for character seg- mentation, using Hough transformation and the prior knowledge in horizontal and vertical segmentation re- spectively. Furthermore, a new object enhancement technique is used for image preprocessing. The experi- ment results show a good performance of this new seg- mentation algorithm. 1 Introduction There are many useful applications for a LPR (License Plate Recognition) system. The LPR algorithm con- sists of three steps: license plate locating, character segmentation and character recognition. This paper presents a new algorithm for character segmentation. There are many factors that cause the character seg- mentation task difficult, such as image noise, plate frame, rivet, space mark, plate rotation and illumina- tion variance. Our algorithm uses Hough transforma- tion and the prior knowledge in horizontal and vertical segmentation respectively and overcomes the difficul- ties mentioned above. Compared with the method of image binarization [2], this algorithm uses the information of intensity and avoids the abruption and conglutination of characters that are the drawbacks of image binarization. And because of using Hough transformation and the prior knowledge, the segmentation is more accurate and ro- bust than the simple projection method[1][5]. 2 Algorithm The algorithm has three steps: preprocessing, horizon- tal segmentation and vertical segmentation. 2.1 Preprocessing Preprocessing is very important for the good perfor- mance of character segmentation. Our preprocessing consists of size normalization, determination of plate kind and object enhancement: 2.1.1 Size normalization: The size of the plate images is an important factor for the accuracy of character segmentation. All the license plate images are normalized to 160*40 in pixel. The experiments show that this scale is fit for character segmentation. 2.1.2 Determination of plate kind: There are three kinds of Chinese license plates: black char- acters on a yellow background, white characters on a blue background and white characters on a black back- ground. The gray scale images are of two kinds: black characters on a white background and white charac- ters on a black background. The ratios of number of white pixels to that of black pixels are quite different in these two kinds of gray scale images. So the kind of a plate image can be determined by histogram analysis. Our posterior segmentation algorithm deals with plate images of white characters on a black background. So in preprocessing the kind of the plate image is deter- mined and if a plate image is white characters on a black background its color will be reversed. 2.1.3 Object enhancement: The quality of plate images varies much in different capture condi- tions. Illumination variance and noise make it difficult for character segmentation. Then some image enhance- ment should be adopted to improve the quality of im- ages. As we all know, the image enhancement methods of histogram equalization and gray level scaling have some side effects. They may have the noise enhanced as well. For character segmentation, only the character pixels need to be enhanced and the background pixels

Transcript of A New Algorithm for Character Segmentation of License Plate

A New Algorithm for Character Segmentation of License

Plate

Yungang Zhang Changshui ZhangDept. of Automation, Tsinghua University Dept. of Automation, Tsinghua UniversityThe Institute of Information Processing The Institute of Information Processing

Beijing 100084, China Beijing 100084,[email protected] [email protected]

Abstract

Character segmentation is an important step in LicensePlate Recognition (LPR) system. There are many dif-ficulties in this step, such as the influence of imagenoise, plate frame, rivet, the space mark, and so on.This paper presents a new algorithm for character seg-mentation, using Hough transformation and the priorknowledge in horizontal and vertical segmentation re-spectively. Furthermore, a new object enhancementtechnique is used for image preprocessing. The experi-ment results show a good performance of this new seg-mentation algorithm.

1 Introduction

There are many useful applications for a LPR (LicensePlate Recognition) system. The LPR algorithm con-sists of three steps: license plate locating, charactersegmentation and character recognition. This paperpresents a new algorithm for character segmentation.

There are many factors that cause the character seg-mentation task difficult, such as image noise, plateframe, rivet, space mark, plate rotation and illumina-tion variance. Our algorithm uses Hough transforma-tion and the prior knowledge in horizontal and verticalsegmentation respectively and overcomes the difficul-ties mentioned above.

Compared with the method of image binarization [2],this algorithm uses the information of intensity andavoids the abruption and conglutination of charactersthat are the drawbacks of image binarization. Andbecause of using Hough transformation and the priorknowledge, the segmentation is more accurate and ro-bust than the simple projection method[1][5].

2 Algorithm

The algorithm has three steps: preprocessing, horizon-tal segmentation and vertical segmentation.

2.1 PreprocessingPreprocessing is very important for the good perfor-mance of character segmentation. Our preprocessingconsists of size normalization, determination of platekind and object enhancement:

2.1.1 Size normalization: The size of theplate images is an important factor for the accuracyof character segmentation. All the license plate imagesare normalized to 160*40 in pixel. The experimentsshow that this scale is fit for character segmentation.

2.1.2 Determination of plate kind: Thereare three kinds of Chinese license plates: black char-acters on a yellow background, white characters on ablue background and white characters on a black back-ground. The gray scale images are of two kinds: blackcharacters on a white background and white charac-ters on a black background. The ratios of number ofwhite pixels to that of black pixels are quite different inthese two kinds of gray scale images. So the kind of aplate image can be determined by histogram analysis.Our posterior segmentation algorithm deals with plateimages of white characters on a black background. Soin preprocessing the kind of the plate image is deter-mined and if a plate image is white characters on ablack background its color will be reversed.

2.1.3 Object enhancement: The quality ofplate images varies much in different capture condi-tions. Illumination variance and noise make it difficultfor character segmentation. Then some image enhance-ment should be adopted to improve the quality of im-ages. As we all know, the image enhancement methodsof histogram equalization and gray level scaling havesome side effects. They may have the noise enhancedas well. For character segmentation, only the characterpixels need to be enhanced and the background pixels

should be weakened at the same time. In fact, a licenseplate image contains about 20% character pixels[3]. Sothese 20% character pixels need to be enhanced andthe rest pixels need to be weakened. It is called ob-ject enhancement. The object enhancement algorithmconsists of two steps. Firstly, gray level of all pixels isscaled into the range of 0 to 100 and compared withthe original range 0 to 255, the character pixels andthe background pixels are both weakened. Secondly,sorting all pixels by gray level in descending order andmultiply the gray level of the top 20% pixels by 2.55.Then most characters pixels are enhanced while back-ground pixels keep weakened. Fig. 1 shows the resultof object enhancement. It can be seen from Fig. 1that after object enhancement the contrast of peaksand valleys of the projection is more significant thanthe original.

Figure 1: Object enhancement

2.2 Horizontal segmentation2.2.1 Hough transformation: The Hough

transformation can be used to detect lines in animage[6]. For each pixel in image space (x0, y0), us-ing transformation,

r = x · cos θ + y · sin θ

We get a curve r = x0 ·cos θ+y0 ·sin θ in the parameterspace (θ, r). Suppose that there are n points in theimage space. After translating them to the parameter

space, we obtain n curves in the parameter space. Ifthese curves cross the same point (θ0, r0), then the npoints in the image space are on a line. So we can findlines in the image space by searching the cross pointsin the parameter space.

2.2.2 Horizontal segmentation usingHough transformation: For plate images withlarge rotation, it is difficult to obtain horizontalsegment lines by horizontal projection analysis. How-ever, for a single character, rotation has little effecton its horizontal projection. It is easier to analyzethe horizontal projection of a single character andfind the horizontal segment lines. So the horizontalsegmentation algorithm is as follows:

1) Find valleys of the vertical projection and then ver-tically divide the plate image into many blocks. Thedivision will not be very accurate because of the influ-ence of frame and rivet.

2) Find the horizontal segmentation line for each blockby analyzing the horizontal projection of the block. Wecall the horizontal segmentation line for a single blocka subsection line.

3) Use Hough transformation on the midpoints of allsubsection lines to eliminate the incorrect subsectionlines and combine the correct subsection lines into awhole line.

This method has a number of advantages. First, Houghtransformation utilizing a vote strategy [6] and the in-correct subsection lines are the minority, so the incor-rect subsection lines can be eliminated. For example,the horizontal segment lines of the block with rivet areoften incorrect and can be eliminated by Hough trans-formation. On the contrary, the linear fitting methodis more sensitive to the incorrect subsection lines. Sec-ond, it is a local projection method, which can weakenthe influence of background, illumination variance andthe rotation of plate. Third, it avoids the rotation cor-rection of images. In fact, rotation correction can causedistortion of image and make the character recognitionmore difficult.

Fig. 2 shows some results of horizontal segmentation.The white lines denote the horizontal segmentation po-sitions. There are images with rotation, backgroundnoise, illumination variance, rivet and plate frame influ-ence in the figure. The results show that the horizontalsegmentation algorithm has a good performance.

2.3 Vertical segmentationThe vertical segmentation algorithm is based on projec-tion analysis, constrained by the prior knowledge. As

(a) Images with rotaiotn

(b) Images with noise

(c) Images with illumination variance

(d) Images with rivet and plate frame

Figure 2: Horizontal segmentation

we know, the size of license plate is 440*140(mm), eachcharacter is 45*90(mm), and the interval between char-acters is 12(mm). And there is a big interval (34mm)between the first two characters and the last five char-acters. This information is used as prior knowledge.And by using the prior knowledge, the segmentationbecomes more accurate. The vertical segmentation al-gorithm consists of four steps, as follows:

1) Find candidates for vertical segmentation lines. Weassigned a candidate for each valley of the vertical pro-jection.

2) Estimate the size of the plate and each characterby using the position information of the horizontal seg-mentation lines and the candidates.

Figure 3: Vertical segmentation

3) Estimate the position of the left and right borders ofthe big interval, using the prior knowledge of charactersize. The variance of the pixels’ gray level along a seg-mentation line should be small, because a segmentationline should be located in the interval of the plate andthe pixels it crosses are background pixels with similargray level. On the contrary, when it crosses a character,the gray level variance will be much larger. Based onthis fact, the vertical segmentation lines (the left andright borders) for the big interval can be retrieved bysearching around the estimated positions and findingthe best segmentation lines with the minimum variancefrom the candidates.

4) The other vertical segmentation lines can be locatedin the same way.

Fig. 3 shows some results of vertical segmentation. Itcan be seen that the vertical segmentation algorithmcan exclude the influence of the space mark and theplate frame satisfactorily.

3 Experiment results

A database containing 697 license plate images is usedto test the algorithm. Experiments show that the al-gorithm has good performance on character segmenta-tion, and can deal with images with disturb of noise,plate frame, rivet, space mark, rotation and illumina-tion variance. Fig. 4 shows some results.

(a) Normal images

(b) Images with noise

(c) Images with illumination variance

(d) Images with rotation

(e) Plate images of black characters on a white background

Figure 4: Results of experiments

4 Conclusion and future work

The algorithm presented in this paper can segment thecharacters in license plate images accurately. The pre-processing can improve the accuracy of the segmenta-tion. The algorithm for horizontal segmentation, usingHough Transformation, can solve the problem of rivet,rotation, and illumination variance. The prior knowl-edge constrained vertical segmentation algorithm canrestrain the influence of plate frame and space mark.

There are still some further researches to do. For ex-ample, it can’t work with some other kind of licenseplate, such as two-rows plate. This problem will besolved in the further work.

References[1] J. Barroso, A. Rafael, E. L. Dagless and J. Bulas-Cruz. Number plate reading using computer vision.IEEE - International Symposium on Industrial Elec-tronics ISIE’97, Universidade do Minho, Guimaraes,Portugal, Julho, 1997.

[2] CAO Diming, XUAN Guorong. Abruption andmergence in character area segmentation. ComputerEngineering, Oct., 2000.

[3] J.A. Hegt , R.J. Haye , N.A De la & Khan. A highperformance license plate recognition system. Proc.IEEE International Conference on Systems, Man andCybernetics, pp. 4357-4362, 1998.

[4] R.A. Lotufo, A.D. Morgan and A.S. Johnson.Automatic Number Plate Recognition. IEE Colloquiumon Image Analysis for Transport Applications, London,February 1990.

[5] Niu Xin, Shen Lansun. Research on license platerecognition technology. Measurement & Control Tech-nology, Dec., 1999.

[6] Yuan Jie, Hu Zhengyi, Wang Yanping. Findingcorners by using Hough transform. Wuhan UniversityJournal of Natural Science, Jan., 1998.