Design and Implementation of the Automatic License Plate Location Algorithm under Complex Backgrounds

The automatic license plate recognition system is the important part of the modern intelligent transportation system (ITS), and the first key step of the license plate recognition is to find and separate the license plate area from the image of license plate. In this article, the quality of the license plate image is improved though a series of digital image processing in the image pretreatment, and the quick and exact license plate location is realized based on the gray projection algorithm. Large numerous of plate license images are acquired and tested by the development platform of VC++6.0, and the result shows that the technology adopted in the article has good adaptability, especially it can quickly and reliably locate the license plate images shot under complex backgrounds.


Introduction
The vehicle license plate recognition (VLPR) is one important research task of the computer vision and mode recognition technology in the intelligent transportation system (ITS), and it has been widely applied in many aspects such as intelligent traffic control, traffic accident automatic measurement, electric charge, vehicle checking and tracing (Zhou, 2008).It is the important utilization of the image processing technology, the mode recognition, the artificial intelligent technology and the automatic control technology in the modern traffic management, and it utilizes the character that each legal vehicle has unique license plate to pick up the information of license plate to manage vehicles.And it needs not to install bar code and wireless receiving equipment, which can avoid large change of the existing traffic system.As the first approach of the license plate recognition, the vehicle license plate location plays a very important function in the license plate recognition system and is the most difficult problem in the license plate recognition system.The license plate location system is based on the digital image processing technology, and can finally confirm and separate the position of the license plate from the image through a series of processing of the license plate image shot by the camera, and then prepare for subsequent license plate recognition.Chinese vehicle license plates are made according to the Motor Vehicle Plate Standard GA36-92 of China of 1992, and the plate includes 7 characters, and the background colors and character colors are different for different vehicle types, so the color information can not be used directly for the initial location of license plate.In addition, the license plate not only contains characters and numbers, but also Chinese character (the first character of the license plate), and the hanging positions of the license plate are different, and the motors with dirty license plates can run on the road, and the images of autos usually have complex backgrounds such as billboards, trees, buildings, other running vehicles and foot passengers, and zebra crossings, which bring certain difficulty for the exact location of auto license plates.

Pretreatment of license plate image
The target of the image pretreatment is to give prominence to the information of object, and weaken unnecessary information and interference noises.The pretreatment process mainly includes the steps from the step (2) to the step (7) in Figure 1.After acquire the image of vehicle, for the unification and convenience of subsequent processing, translate the image format into the 24 bit true color bitmap of 640×480.

Grey scale
By analyzing the color distribution and characters of familiar license plate in China, following conclusions can be obtained (Liu, 2008).
(1) There are five colors together in China, i.e. yellow, black, blue, white, and red.
(2) There are five sorts of color combination of front ground and background, such as the blue-bottom white-character white-frame line of small automobile license plate, and the yellow-bottom black-character black-frame line of teacher-automobile.
(3) Except for the license plates of large automobiles and the automobiles of temporary entry, the size of the license plate is 440mm×140mm.
Based on above characters, many researchers use the information of color to locate the area of license plate, such as the color edge algorithm, and the distance and similarity algorithm (Zhang, 2001, P.374-377), but these position methods can not effectively eliminate the interference of the background colors such as the advertisements on the auto, and the lines of the automobiles, and in addition, these methods are too sensitive for the illumination, so the application is limited.This article uses the grey image to locate the license plate, which can reduce the subsequent computation and quicken the speed of location.The grey image still can reflect the distribution and character of the chroma and brightness class of total image.There are many methods of grey scale of the image, such as the averaging method, the weighted averaging method, and the maximization method (He, 2002).The weighted averaging method is fit for the visual character of human eyes, and the effect is relatively better.For the convenience of implementation, the weighted averaging method is adopted in the article.Use g to denote the grey value of pixel point after grey scale, and R, G and B respectively denote the red component, the green component, and the blue component in the original true color image, so 0.322 0.588 0.11 .

Contrast enhancement
The images of license plate images shot under different illumination conditions are largely different, and the contrast of some automobile images is deficient, which makes the characters of license plate can not be distinguished and positioned, so the effective method must be adopted to enhance the contrast of image.There are many feasible methods such as the grey degree conversion, the linear filter, and the column diagram modification.Though many experiments, a grey conversion algorithm enhancing the self-adaptive contrast is designed in the article according to the characters of the license plate image.
Suppose that the original grey degree value of certain one point ( , ) x y in the image is ( , ) f x y , and after the self-adaptive grey degree conversion, the green degree value is ( , ) g x y , h f and l f are two threshold values in the grey degree conversion, so The cause that sets up two extreme grey degree values in the class of grey degree as 0 and 255 in the grey degree conversion is that two extremes of the license plate image are either the white-bottom black-character or the black-bottom white-character.Suppose that the area of the image is S , and [ ] hd i denotes the amount of the pixel point which grey degree value is i in the original image, and the values of h f and l f can be confirmed by following formulas.

License plate image noise processing
To restrain the noises introduced in the shoot and pretreatment process of the license plate image, the filtering processing is necessary.When the low-pass filtering eliminates the noise, it makes the edge of the license plate thickened, which makes against the subsequent processing, and the high-pass filtering can strengthen not only the edge of the license plate, but also the noises, so the method of mean-value filtering is adopted to eliminate the noises.The approaches to compute the mean-value of window pixel taking the point (x, y) as the center can be described as follows.
(1) Rank the pixel points in the window according to the grey degree values.
(2) Select the mean-value in the ranking pixel set as the new value of the point (x, y).

Edge detection
The vehicle image has obvious edge information, so the Sobel operator can be utilized to test the edge of the vehicle before the binaryzation.The representative edge test operators include Laplace operator and the Sobel operator.The Laplace operator is the second-order differential operator with large computation quantity, which is very sensitive to the noise, and it is not fit to detect the edge of the license plate image under variable illumination conditions.Comparing with other two operators, the Sobel operator has two prominent advantages, (1) because of the introduction of average factor, it possesses certain smoothing function for the random noise in the image, (2) because it is the difference being at a distance of two rows or two columns, so the elements at both sides of the edge are strengthened, which makes the edge to look coarse and bright.By the test, the Sobel vertical edge operator could better restrain other edge information of vehicles and give prominence to the character edge information in the area of license plate, so the vertical Sobel operator is used in the article to test the vertical edges of the license plate image.

Binaryztion and mathematical morphology processing
The binaryzation can largely eliminate interferences of road surfaces and vehicle body to the license plate location and the quality of the license plate binaryzation directly influences the effect of the license plate location (He, 2009).The improved binaryzation algorithm of complete threshold value is adopted to implement the binaryzation processing for the license plate image, and this algorithm has good self-adaptive ability under complex background.If the grey degree class range of one image ) . ( , suppose T is one number between 1 Z and K Z , the optimal threshold value can be solved by the iterative method, i.e. the threshold value T. The concrete approaches of this algorithm can be described as follows. (1) Determine the minimum grey degree value 1 Z and the maximum grey degree value 2 Z in the image, and suppose the initial value of the threshold value is (2) Divide the image into two parts including target and background according to the threshold value T K , and determine the average grey values Z A and Z B of two parts.
Where, Z (i, j) is the grey value of the point (i, j) in the image, and N (i, j) is the amount of the pixel point which grey degree value is Z (i, j) in the image.
(3) Determine the new threshold value.
If the rupture of license plate character occurs after binaryzation, the expansion operation in the mathematical morphology can be adopted to integrate every one character in the license plate for the subsequent character recognition processing (He, 2002).

Horizontal location of license plate
The license plate is generally located at or near the bumper of the automobile, and it is located at the bottom part of the whole license plate image, and the character and the grey degree of the background change largely, and the grey degrees one the horizontal level present alternatively changeable character, and the binary image shows the black-white alternative character.So the vehicle image can be projected horizontally on the horizontal direction, and the image has been processed by binarization, and the wave crest and the wave trough of the projection are clear.The corresponding horizontal position of the top wave crest value in the projection image can be used as the crossing line of the license plate area, and if the extent of the projection image near the wave crest is higher continually, and two wave troughs should be distributed approximately at two sides, and the area between two wave troughs can be confirmed as the candidate area of the license plate.And if the scanning image has the hypo-high wave crest near the highest wave crest, and both wave troughs of the wave crest are approximately distributed symmetrically, and the area between these two wave troughs can be confirmed as the candidate area of the license plate (may be the interference information such as the bumper and the advertisement of the vehicle, and the example has been showed in Figure 7).Then, according to the approximate position, height, continual projection alternations and other apriori knowledge of the license plate, the area of the license plate can be located from the horizontal direction, which can be subsequently processed after it is divided in the vehicle image.To ensure the integer of the license plate, in the division, the height of the license plate (it generally is 140mm, and only the height of the license plate of large automobiles is 220mm, and the height of the license plate of temporary entry automobiles is 165mm) and be as the reference of the boundary of the division area, to make the division height higher 10% than the height of the license plate.

Vertical location of license plate
The vertical location algorithm of the vehicle license plate is similar with the horizontal location algorithm of the license plate.Project the vehicle area image from the vertical direction, and if the extent of the projection image is larger in certain region, and presents the character of multiple wave crests, i.e. the wave crests alternate with wave troughs, and the wave crests in this area are much higher than the wave crests in other areas, and the sustainable width of the wave crest is bigger than the width of the wave trough, so the area covered by the wave crests can be confirmed as the area of license plate.In the vertical projection, according to above information and the width of license plate (440mm), the interference information which have not been eliminated in horizontal projection can be eliminated obviously to conform the area of the license place, and 70% of the maximum wave crest value can be set up as the threshold value, and the crests which are higher than this threshold value firstly and finally can be confirmed as the edge peak of the license plate, and the left wave trough point of the first edge peak can be the left edge of the license plate, and the right wave trough point of the last edge peak can be the right edge of the license plate, and the license plate can be partitioned according to above location information.

Conclusions
Aiming at the characters of the license plate and the image, the vehicle license plate pretreatment and the vehicle license plate location algorithm is designed and realized based on VC++6.0 in this article.104 shot vehicle license plate images are used to test the algorithm, and the result show that there are 98 license plates can be correctly located, and the location precision achieves 94%, and the location veracity and the location quality of the license plate under complex backgrounds and illumination conditions are better than other algorithms.