Introduction and practice of license plate recognition algorithm

Source: Internet
Author: User

Auto license plate self-identification the whole process is divided into pretreatment, edge extraction, license plate location, character cutting, character recognition five modules, the character recognition process mainly consists of the following 3 part of the composition :

① correctly cut the text image area;

② the correct separation of individual text;

③ identify individual characters correctly.

With MATLAB software programming to achieve each part, and finally identify the car license plate.

System Design Overview

because the vehicle license plate is the only management sign symbol of the motor vehicle, it has irreplaceable function in traffic management, so the vehicle license plate recognition system should have very high recognition correct rate, and the influence of factors such as environment illumination condition, shooting location and vehicle speed should have a large tolerance threshold, and the requirement to meet the real-time requirement .

This system is the application of computer image processing and character recognition technology in intelligent traffic management system, which mainly consists of the collection and pretreatment of license plate image, the location and extraction of license area, the cutting and recognition of license plate character.

The basic work steps are as follows:

( 1 when the driving vehicle passes, the sensor embedded in the fixed position is triggered, and the system is awakened in the working state;

once the photoelectric sensor connected to the camera light shutter is triggered, it is set in the front, rear and side of the vehicle Camera at the same time shooting the image of the vehicle;

( 2 ) by the camera or CCD The camera captures the image of the vehicle's license plate, which is processed by the video card input computer,

Image preprocessing includes image conversion, image enhancement, filtering and horizontal positive.

( 3 The search module is searched and tested, and the rectangular area including the symbol Code of the license plate is located and cut out.

( 4 the license plate character is binary and a single character is cut, and the input character recognition system is recognized after normalization.

Overall Design Solution:

the whole system of vehicle license plate identification is composed of license plate location and character recognition, and the license plate location can be divided into image preprocessing and edge extraction module and positioning and cutting of license plates Character recognition can be divided into character cutting and feature extraction and single character recognition of two modules.

In order to be used for the identification of the cutting and license plate characters of the license plate, the original image should have the appropriate brightness, a larger control degree and a clearly identifiable license plate image. However, because the camera part of the system works in an open outdoor environment, in addition to the cleanliness of the vehicle license plate, natural lighting conditions, camera and license plate moment and angle of the shooting, as well as the vehicle speed and other factors, the license plate image may appear blurred, skew and defects and other serious defects, so need to pre-recognition of the original image.

The locating and cutting of license plate is one of the key technologies of license plate recognition system, and its main purpose is to determine the detailed position of the license plate in the original gray image after image preprocessing, and to cut out the whole image of a sub-image including the license plate character, which can be used for recognition of character recognition subsystem. The accuracy of the cutting is directly related to the recognition rate of the whole license plate character recognition system.

Because of the lighting conditions at the time of shooting, the effect of the cleanliness of the license plate, and the focal length adjustment of the camera, the noise produced by the optical distortion of the lens will result in varying degrees of blurring of the boundary of the license plate character, unclear details, broken strokes or uneven thickness, and defects such as stain on the license plate, In turn, the accuracy of character recognition is affected. Therefore, it is necessary to do a specific processing before the character is identified.

The goal of license plate recognition is to identify the characters on the license plate.

Each part of the implementation process:

First, image collection and conversion

Considering that the characters of the existing license plate and the background color collocation generally have blue bottom white text, yellow black word, the red word on the bottom, the green bottom and the black, and so on, using different color channels can distinguish the area and the background clearly, for example, the most common license on blue Bottom white, adopt blue B The license plate area is a bright rectangle while the license plate character is not present in the zone. Due to the blue (255,0,0) with white (255,255 ,255) is not differentiated in channel B, but in G,R There is no such convenience in channel or grayscale images. In the same way, the license plate of black lettering can be used R Channel, and the license plate area can be clearly shown on the green bottom by using the G channel. , which is easy to handle.

Second, Edge extraction

Edge refers to the part of image local brightness change, which is the important foundation of image analysis such as wind, texture feature extraction and shape feature extraction. So here we're going to edge-check the image. Image enhancement processing is necessary to improve the recognition of image licences and to simplify the difficulty of locating and cutting license plate characters. The methods to enhance the contrast degree of image are as follows: Gray linear transformation, image smoothing processing and so on.

2.1 Grayscale Correction

because the license plate image is restricted and disturbed by various conditions during shooting, the gray value of the image often does not match the actual scene completely, which will directly affect the image processing. It is assumed that the cause of this effect is mainly due to the distance of the subject, so that the image of the central region and the edge of the gray imbalance, or because the camera in the scanning of the sensitivity of the different points to produce image gray distortion, or because of insufficient exposure to make the image gray range is very narrow. At this point, we can adopt the method of gray-scale correction, enhance the range of gray scale, enrich the level of gray, in order to achieve the contrast and resolution of enhanced image. We found that the gray value range of the vehicle license plate image is mostly confined to r= (50,200) , and the gray level is low and the image is darker than the whole. Depending on the conditions of the image processing system, it is advisable to expand the grayscale range to s= (0,255) .

2.2 Image Smoothing

for images that are severely disturbed by noise, because noise points are more frequently mapped to high-frequency components in the frequency domain, they are able to pass low can also be used to calculate the neighborhood mean in the airspace directly Filter to remove noise, but in practice to simplify the algorithm, The effect of weakening the noise, such a method is called image smoothing processing.

However, the smoothing of the neighborhood mean results in a blurring of areas where the gray scale of the image changes dramatically, especially in the edges of objects and in the contour of characters. In order to overcome the image ambiguity caused by this averaging, we set a fixed threshold for the difference between the pixel value of the center point and its neighborhood mean, and only the point talent that is greater than the threshold value is replaced by the neighborhood mean, and the difference is not greater than the threshold value, the original value is retained, thus reducing the image blur caused by averaging.

The Vehicle license plate in the image is a piece of image area with a relatively significant feature, which is now: an approximate horizontal rectangular region in which the strings are arranged horizontally, and the positions in the overall image are fixed. It is precisely because of these characteristics of the license plate image that, after proper image transformation, it can obviously show its edge in the whole frame. Edge extraction is a more classical algorithm, where the edge extraction is based on the Roberts operator.

Analysis of the causes of such situations, summed up mainly in the following areas:

1 , original image resolution is relatively high, thus simplifying the preprocessing

2 , image smoothing can cause the image edge information to be lost, the image becomes blurred

3 , the sharpening of the image enhances the edge contour of the object in the image, but at the same time, some noises are enhanced.

Third, the positioning and cutting of the license plate

The locating and cutting of license plate is one of the key technologies of license plate recognition system, and its main purpose is to determine the detailed position of the license plate in the original gray image after image preprocessing, and to cut out the whole image of a sub-image including the license plate character, which can be used for recognition of character recognition subsystem. The accuracy of the cutting is directly related to the recognition rate of the whole license plate character recognition system. Because the license plate image in the original image is very characteristic of a sub-region, is a higher level of horizontal approximation of the rectangle, its relative position in the original image is relatively concentrated, and its gray value and the surrounding area is significantly different, so at the edge of the formation of a gray mutation boundary, This makes it easy to cut the image by edge detection.

3.1 License plate area positioning

After the above treatment, the licence area has been clearly marked and its edge has been outlined and strengthened. The exact position of the license plate in the whole image can be further determined at this time. Here is the mathematical morphology of the method, the basic idea is to use a certain form of mechanism elements to measure and extract the corresponding shape in the image to achieve the purpose of image analysis and recognition. The application of mathematical morphology can simplify the image data, maintain their main morphological features, and remove extraneous structures.

3.2 Plate Area cutting     ?

There are many ways to cut the license plate, this procedure is a color cutting method using the color information of the license plate. Based on the license plate background and other relevant prior knowledge, using color pixel point statistics to cut out a reasonable license plate area, determine the license plate background blue RGB corresponding gray range, and then the direction of the number of pixels in this color range, set a reasonable threshold, determine the license plate in the direction of the reasonable region. Then, within the cut-off line area, the number of blue pixels in the column direction is counted, finally determining the complete license plate area.

3.3 Unified Processing     ?

the number of plates cut out by the above method there are objects in the image, background and noise, in order to extract the object from the image directly, the most frequently used method is to set a threshold T, using t to divide the image data into two parts: a group of pixels greater than T and a group of pixels less than t, that is, the image is binary. Mean filter is a typical linear filtering algorithm, which refers to a template for the target pixel on the image, which contains the neighboring pixels around it. Replace the original pixel value with the average of all the pixels in the template.

Four, character cutting and comparison

4.1-Character Cutting

in the process of auto-identification, character cutting has an important role. It cuts the character on the basis of the pre-license plate positioning, and then uses the result of the cutting to character recognition. Character recognition algorithm is very many, because the license plate characters between the large interval, there will be no character adhesion, so the method used here to find a continuous text block, if the length is greater than a certain threshold, it is felt that the block has two characters, need to cut.

Normalization of 4.2 characters

The commonly-cut characters are further processed to meet the need for next character recognition. But the recognition of the license plate, does not need too much processing has been able to achieve the correct recognition. Only normalization is done here, and then post-processing is done.

4.3 Character recognition

Character recognition the algorithms used in license plate character recognition (OCR) include the OCR algorithm based on template matching and the OCR algorithm based on artificial neural network. The basic process of OCR based on template matching is to first treat the recognition character to be binary and scale its size to the size of the template in the character database, then match with all the templates, and finally select the best match as the result. There are two main methods of character recognition using artificial neural network: One is to take character extraction first, and then train the neural network classifier with the acquired features. The recognition effect is related to the extraction of character features, while character extraction is often time-consuming. Therefore, the extraction of character features becomes the key to research. There is also a way to take full advantage of the characteristics of the neural network, directly to the processing of the image input network, the network itself to implement feature extraction until recognition.

The main feature of template matching is simple implementation, when the characters are more regular The defect and smear disturbance of character image is adaptable and the recognition rate is very high. These advantages of the composite template matching are used as the main method for the recognition of license plate characters.

template matching is one of the most representative basic methods in image recognition, which is the image or image area to be recognized. f (i,j) some characteristic quantities and templates extracted from the T (i,j) the corresponding characteristic quantity is compared each by one, the calculation of normalized cross-correlation between them, among which the largest of the cross-correlation is the highest degree of similarity, the image can be attributed to the corresponding class. It is also able to calculate the distance between the image and the template feature, and determine the owning class by the minimum distance method. However, there are usually different imaging conditions for matching images, resulting in large noise disturbances, or when the image is pre-processed and normalized, the position of the image's grayscale or pixel points changes. In the actual design of the template, it is based on the characteristics inherent in each region, highlighting the differences between the similar regions, and easy by the processing process caused by the noise and displacement factors are taken into account, according to some characteristics based on the image invariant characteristics of the design of the template, can avoid the above problems.

used here subtract the method to find that the character is most similar to which character in the template, and then finds the output with the most similarity. There are generally seven characters in the license plate, most of which are Chinese characters, usually representing the province of the vehicle, or the special meaning of the branch, police, etc., followed by letters and numbers. License plate character recognition and general text recognition is its limited number of characters, a total of about 50 Chinese characters, capital letters 26, the number 10. Therefore, it is also very convenient to build a character template library. In order to facilitate the experiment, combined with the design of the selected car license plate characteristics, only the establishment of 4 numbers 26 letters and 10 numbers of the template. Other template design methods are the same.

first, the character template is taken, then the recognition character is matched with the template, and the typeface is reduced with the template word, resulting 0 the more it is, the more matches. Save the number of 0 values for each of the subtracted graphs , and then find the maximum value, which is the result of the recognition.

This blog's companion program can be downloaded in the resources:
http://download.csdn.net/detail/liuguiyangnwpu/7420855
I hope you have a lot of communication!

Introduction and practice of license plate recognition algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.