With the increasing modernization of traffic management systems, the automatic license plate recognition system has become an important part of the intelligent transportation system. Through the research on the basic principle and main methods of current license plate recognition, the advantages and disadvantages of various identification methods are analyzed and compared. For the license plate location, character segmentation and character recognition, this paper proposes a practical and reliable algorithm.
This article refers to the address: http://
The license plate location is the first step of the whole algorithm step. The positioning error will directly lead to the final recognition error, and the inaccurate positioning will increase the difficulty of segmentation. In practice, different license plate images are different in shooting distance and angle, shooting technique, illumination intensity, etc. Sometimes they are even different, which makes some traditional methods have low positioning accuracy under the large span of image group quality. Missing universality. Among them, the step-by-step method of using the horizontal gray-scale hopping feature, that is, the coarse positioning and the precise positioning are relatively stable methods, but the disadvantages are also obvious, that is, the precise positioning is not precise. In order to improve this situation, this paper tentatively proposes a method of using Hough transform multi-line detection to achieve precise positioning. At the same time, combined with prior knowledge, the horizontal search method is improved, and the accuracy of license plate location is effectively improved. The algorithm has strong adaptability, fast speed and good robustness.
In the character segmentation, thanks to the good effect of positioning, an improved projection method is proposed by reasonable binarization and filtering. The algorithm overcomes the large variation of the illumination of the license plate group and the interference of common factors such as the frame and the rivet, so that the accuracy of the segmentation of the projection method has been improved.
License plate character recognition is the core part of the license plate recognition system. This paper constructs BP neural network for license plate recognition. By repeatedly correcting various parameters, the recognition algorithm is fast and accurate, and has good stability, which can meet the requirements of real-time license plate recognition.
1 license plate positioning
1.1 Image Preprocessing
(1) Size normalization: The size of the license plate image has a large influence on the selection of the relevant threshold in the algorithm. The license plate image size in this system has been normalized to 400 × 300 pixels.
(2) Image smoothing: In order to better extract horizontal grayscale hopping features (related to the algorithm), it is necessary to horizontally smooth the image first. Experiments have shown that using a mask such as [1/2 1/2] works best.
1.2 Algorithm
(1) Feature extraction [1]: Extract horizontal grayscale hopping features. For the smoothed grayscale image, select the appropriate threshold T, compare each pixel of each row with its previous pixel, and if the absolute value of the grayscale difference exceeds T, it is recorded as 1, otherwise it is recorded as 0, thus completing the grayscale The image is extracted from the horizontal grayscale jump feature. Experiments show that compared with traditional edge detection, this method has more significant feature extraction and less noise. The horizontal direction is the object because the license plate is more prominent in the horizontal direction than the vertical direction.
(2) Horizontal positioning in the horizontal direction: Combine the prior knowledge with the binary image generated by (1), that is, the part below the license plate position in the image is much less disturbing than the part above the license plate, and the bottom-up line is taken. Search method. When the ratio of the value of one row to the whole row of pixels is greater than a certain threshold, the downlink position x1 is recorded, and the search is continued up-by-row. When the ratio is smaller than the threshold, the downlink position x2 is recorded, and x1 and x2 form a coordinate pair. If the distance between x1 and x2 exceeds a small height (400 x 300 for example, the license plate height should be greater than 10, so choose 10), it is determined to be the horizontal cutting position of the license plate (to prevent less cut, respectively for x1 and X2 performs an appropriate extension of the downward and upward directions; otherwise, this x1 and x2 are excluded, and the search is continued upward to find the x1, x2 coordinate pairs until x1, x2 are determined, and the binary image is cut. To enhance stability, a two-line ratio can be used instead of a single-row ratio, and the decision threshold should be reduced.
(3) Vertical positioning in the vertical direction [2]: Let the image cut by (2) be A. After denoising the A, first use a rectangular frame B with the same height, width and height as A. A traverses the search from left to right [3]. If the ratio of the sum of the 1 value pixel in B to all the pixels in B is greater than a certain threshold, the column position is recorded as y1 at this time, and then searched from the right left in the same manner to obtain Column position y2. Cut A with y1 and y2 to complete the coarse positioning in the vertical direction.
(4) Precise positioning: In the past license plate recognition method, Hough transform line detection is generally only used for license plate correction. In fact, Hough transform line detection can be used for license plate location. This article will use this to make the final precise positioning of the license plate.
The principle of Hough transform to extract straight lines [4]:
For any point (x0, y0) in the image space, transform it into one curve r=x0 cos θ+y0 sinθ in the parameter space (θ, r), and perform n points on the same line l one by one. In the above transformation, n curves are obtained correspondingly in the parameter space (θ, r). It can be known from the transformation formula that the n curves must pass through the same point (θ0, r0). Finding this point in the parameter space knows the corresponding line l in the image space, so the Hough transform can be used to detect a line in a binary image.
Let the image obtained by rough cutting by the algorithm (3) be C, and perform multiple line detection (at least 10 or more) on C by Hough transform. The minimum and maximum values ​​of the endpoint line coordinates in the straight line are respectively the fine positioning values ​​of the upper and lower boundaries of the license plate, and the average or median value of the left end point of the straight line is taken as the fine positioning value of the left boundary of the license plate, and the average or median value of the right end column of the straight line is taken. The fine positioning value for the right border of the license plate (after repeated experimentation, the stability is better than the median value when using the average value). The license plate positioning result thus determined is the final positioning result.
Figure 1 to Figure 7 show the detailed positioning process of three license plate images with different azimuth angles. It can be seen from Fig. 2 that the information interference below the license plate position in the image is obviously weaker than the interference of the above part, because the lower part of the license plate is mainly the road surface background, while the upper part of the license plate contains sensitive information such as the headlights and the medium net. The bottom-up search method makes full use of this feature. At the same time, because the license plate is mostly in the lower half of the image, the search time is also reduced. Multi-line detection, high precision and good robustness.
2 character segmentation
It is necessary to correct the tilted license plate before character segmentation. The use of Hough transform for tilt angle detection is a commonly used effective way.
Since the license plate location is realized, the global threshold method can be used to re-binarize the positioning result image to obtain a more ideal binary image. Fig. 8 is a binary diagram obtained by the Otsu method [5].
The most common method of character cutting is the projection method. If the sticking and breaking of the characters in the license plate image after binarization is not so serious, only the vertical projection is required to complete the task of character cutting. However, horizontal borders and rivets sometimes fill in some "valleys", making it difficult to accurately determine the point of separation. Still, vertical projection is still a very important method in character segmentation. This article improves the vertical projection method and basically overcomes the effects of the frame and rivets.
The horizontal border interference that may exist after binarization is shown in Figure 8(a) (the vertical border has no effect on the vertical projection method). According to the prior knowledge: the width of a single character will not exceed the entire size regardless of the overall size of the license plate. 1/8 of the image width. Thus, white line pixels having a width exceeding 1/8 or more can be set to zero. This removes most of the interference and loss of character information.
The correction will be made below. The lowermost 1-value pixel shown in FIG. 10 is selected in each column of FIG. 9. After the Hough transform, the edge line can be detected as shown in FIG. 11, and the line inclination angle (ie, the license plate inclination angle θ) is according to the formula:
The coordinate conversion of Fig. 9 realizes the license plate tilt correction, as shown in Fig. 12. Where x0 and y0 are the original coordinates, and x and y are the converted coordinates.
The vertical projection method is used for character segmentation on the corrected license plate, and the result is shown in FIG.
In Figure 13(a), two consecutive "0" characters are stuck together and cannot be separated because the rivets are just in the middle of them. It is very difficult to eliminate the rivets by image processing without affecting the character information. In this case, the targeted solution is to directly cut the splits of the two-character partition. The width of 1 character will not exceed 1/5 of the width of the whole license plate. The width of 2 consecutive characters must exceed 1/5 of the width of the whole license plate. According to this prior knowledge, the width is greater than 1/5 of the license plate and smaller than the license plate. With 2/5 as a condition, it is convenient to determine whether or not there is a blocking block. Fig. 13(b) and Fig. 13(c) are not interfered by the rivet, so that the division can be successful once. Figure 14 is the result of cutting the bonded panels in a peer-to-peer manner.
3 character recognition
In the selection of the classifier, it is required to have good fault tolerance and to have good adaptive ability. The neural network has similar high parallelism, good fault tolerance and associative memory function, self-adaptive, self-learning ability and fault tolerance, especially the neural network represented by the improved BP network has good self-learning ability. Strong classification, fault tolerance or robustness enables non-linear mapping of input to output. Therefore, this paper chooses BP neural network as the main method for classification and recognition of characters.
3.1 character preprocessing
It is necessary to pre-process the cut license plate characters. The pre-processing includes:
(1) Size normalization
In order to facilitate training and recognition, character images need to be normalized to make them into uniform size images. In this paper, character segments are normalized to 24×14 size.
(2) Feature extraction
That is, the character obtained by normalization determines the network input vector. This article converts a 24×14 grid into a single vector input.
3.2 Design of BP neural network
Most actual neural networks require only 2 to 3 layers of neurons [6]. The BP neural network designed in this paper contains 2 hidden layers. There is no fixed rule to follow for determining the number of hidden layer nodes in a neural network. In this paper, the number of nodes in the hidden layer is determined by finding a network that is trained by the sample and whose network output is closest to the actual result. This is a search process. Referring to the criteria defined by the relevant hidden layer [7], the number of nodes in the first hidden layer is 15 and the number of nodes in the second hidden layer is 10, and the learning speed is 0.01.
In the experiment, 300 actual license plates were selected. The size of these license plate images is different from the angle of shooting. Some license plate images are clear and some are defective. The network is then trained in the Matlab 7.0 environment, and the training sample consists of 1 400 characters of 200 license plates. The remaining 100 license plate images were used to identify the test. Test results: 91 images were correctly identified, 6 were misunderstood, 3 were not recognized, and the average recognition rate was 0.94 s/frame. In the course of the experiment, the digital recognition rate is the highest, the letter is second, and the Chinese character recognition rate is the lowest.
This paper systematically studies a license plate recognition algorithm, which includes three parts: license plate location, character segmentation and character recognition. It has close connection before and after, good complementarity, high overall accuracy, good stability and strong practicability. However, there are still some problems that need further improvement. For example, when the license plate is positioned, the distance is not sufficient, the character tilt correction has some distortion, and the character feature extraction needs a more effective method.
Pin Header Connector,Pin Header Female,Male Header Pins,Right Angle Pin Header
Cixi Xinke Electronic Technology Co., Ltd. , https://www.cxxinke.com