A New Algorithm for Character Segmentation of License Plate Yungang Zhang
Changshui Zhang
Dept. of Automation, Tsinghua University The Institute of Information Processing Beijing 100084, China
[email protected]
Dept. of Automation, Tsinghua University The Institute of Information Processing Beijing 100084,China
[email protected]
Abstract
Character segmentation is an important step in License Plate Recognition (LPR) system. There are many difficulties 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 segmentation, using Hough transformation and the prior knowledge in horizontal and vertical segmentation respectively. Furthermore, a new object enhancement technique is used for image preprocessing. The experiment results show a good performance of this new segmentation algorithm.
1 Introduction
There are many useful applications for a LPR (License Plate Recognition) system. The LPR algorithm consists 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 segmentation task difficult, such as image noise, plate frame, rivet, space mark, plate rotation and illumination variance. Our algorithm uses Hough transformation and the prior knowledge in horizontal and vertical segmentation respectively and overcomes the difficulties 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 robust than the simple projection method[1][5].
2 Algorithm The algorithm has three steps: preprocessing, horizontal segmentation and vertical segmentation. 2.1 Preprocessing Preprocessing is very important for the good performance 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 characters on a yellow background, white characters on a blue background and white characters on a black background. The gray scale images are of two kinds: black characters on a white background and white characters 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 determined 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 conditions. Illumination variance and noise make it difficult for character segmentation. Then some image enhancement should be adopted to improve the quality of images. 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
should be weakened at the same time. In fact, a license plate image contains about 20% character pixels[3]. So these 20% character pixels need to be enhanced and the rest pixels need to be weakened. It is called object enhancement. The object enhancement algorithm consists of two steps. Firstly, gray level of all pixels is scaled into the range of 0 to 100 and compared with the original range 0 to 255, the character pixels and the background pixels are both weakened. Secondly, sorting all pixels by gray level in descending order and multiply the gray level of the top 20% pixels by 2.55. Then most characters pixels are enhanced while background pixels keep weakened. Fig. 1 shows the result of object enhancement. It can be seen from Fig. 1 that after object enhancement the contrast of peaks and valleys of the projection is more significant than the original.
space, we obtain n curves in the parameter space. If these curves cross the same point (θ0 , r0 ), then the n points in the image space are on a line. So we can find lines in the image space by searching the cross points in the parameter space. 2.2.2 Horizontal segmentation using Hough transformation: For plate images with large rotation, it is difficult to obtain horizontal segment lines by horizontal projection analysis. However, for a single character, rotation has little effect on its horizontal projection. It is easier to analyze the horizontal projection of a single character and find the horizontal segment lines. So the horizontal segmentation algorithm is as follows: 1) Find valleys of the vertical projection and then vertically divide the plate image into many blocks. The division will not be very accurate because of the influence of frame and rivet. 2) Find the horizontal segmentation line for each block by analyzing the horizontal projection of the block. We call the horizontal segmentation line for a single block a subsection line. 3) Use Hough transformation on the midpoints of all subsection lines to eliminate the incorrect subsection lines and combine the correct subsection lines into a whole line.
Figure 1: Object enhancement
2.2 Horizontal segmentation 2.2.1 Hough transformation: The Hough transformation can be used to detect lines in an image[6]. For each pixel in image space (x0 , y0 ), using transformation,
This method has a number of advantages. First, Hough transformation utilizing a vote strategy [6] and the incorrect subsection lines are the minority, so the incorrect subsection lines can be eliminated. For example, the horizontal segment lines of the block with rivet are often incorrect and can be eliminated by Hough transformation. On the contrary, the linear fitting method is more sensitive to the incorrect subsection lines. Second, it is a local projection method, which can weaken the influence of background, illumination variance and the rotation of plate. Third, it avoids the rotation correction of images. In fact, rotation correction can cause distortion of image and make the character recognition more difficult. Fig. 2 shows some results of horizontal segmentation. The white lines denote the horizontal segmentation positions. There are images with rotation, background noise, illumination variance, rivet and plate frame influence in the figure. The results show that the horizontal segmentation algorithm has a good performance.
r = x · cos θ + y · sin θ We get a curve r = x0 · cos θ + y0 · sin θ in the parameter space (θ, r). Suppose that there are n points in the image space. After translating them to the parameter
2.3 Vertical segmentation The vertical segmentation algorithm is based on projection analysis, constrained by the prior knowledge. As
(a) Images with rotaiotn
(b) Images with noise
Figure 3: Vertical segmentation
(c) Images with illumination variance
3) Estimate the position of the left and right borders of the big interval, using the prior knowledge of character size. The variance of the pixels’ gray level along a segmentation line should be small, because a segmentation line should be located in the interval of the plate and the pixels it crosses are background pixels with similar gray level. On the contrary, when it crosses a character, the gray level variance will be much larger. Based on this fact, the vertical segmentation lines (the left and right borders) for the big interval can be retrieved by searching around the estimated positions and finding the best segmentation lines with the minimum variance from the candidates.
(d) Images with rivet and plate frame
4) The other vertical segmentation lines can be located in the same way. Figure 2: Horizontal segmentation
we know, the size of license plate is 440*140(mm), each character is 45*90(mm), and the interval between characters is 12(mm). And there is a big interval (34mm) between the first two characters and the last five characters. This information is used as prior knowledge. And by using the prior knowledge, the segmentation becomes more accurate. The vertical segmentation algorithm consists of four steps, as follows: 1) Find candidates for vertical segmentation lines. We assigned a candidate for each valley of the vertical projection. 2) Estimate the size of the plate and each character by using the position information of the horizontal segmentation lines and the candidates.
Fig. 3 shows some results of vertical segmentation. It can be seen that the vertical segmentation algorithm can exclude the influence of the space mark and the plate frame satisfactorily.
3 Experiment results
A database containing 697 license plate images is used to test the algorithm. Experiments show that the algorithm has good performance on character segmentation, and can deal with images with disturb of noise, plate frame, rivet, space mark, rotation and illumination variance. Fig. 4 shows some results.
4 Conclusion and future work The algorithm presented in this paper can segment the characters in license plate images accurately. The preprocessing can improve the accuracy of the segmentation. The algorithm for horizontal segmentation, using Hough Transformation, can solve the problem of rivet, rotation, and illumination variance. The prior knowledge constrained vertical segmentation algorithm can restrain the influence of plate frame and space mark.
(a) Normal images
There are still some further researches to do. For example, it can’t work with some other kind of license plate, such as two-rows plate. This problem will be solved in the further work.
References [1] J. Barroso, A. Rafael, E. L. Dagless and J. BulasCruz. Number plate reading using computer vision. IEEE - International Symposium on Industrial Electronics ISIE’97, Universidade do Minho, Guimar˜aes, Portugal, Julho, 1997. (b) Images with noise
[2] CAO Diming, XUAN Guorong. Abruption and mergence in character area segmentation. Computer Engineering, Oct., 2000. [3] J.A. Hegt , R.J. Haye , N.A De la & Khan. A high performance license plate recognition system. Proc. IEEE International Conference on Systems, Man and Cybernetics, pp. 4357-4362, 1998.
(c) Images with illumination variance
[4] R.A. Lotufo, A.D. Morgan and A.S. Johnson. Automatic Number Plate Recognition. IEE Colloquium on Image Analysis for Transport Applications, London, February 1990. [5] Niu Xin, Shen Lansun. Research on license plate recognition technology. Measurement & Control Technology, Dec., 1999. [6] Yuan Jie, Hu Zhengyi, Wang Yanping. Finding corners by using Hough transform. Wuhan University Journal of Natural Science, Jan., 1998.
(d) Images with rotation
(e) Plate images of black characters on a white background
Figure 4: Results of experiments