Auto License Plate Recognition Based on Opencv

Today, with the rapid development of China's automobile industry, the number of car ownership has increased significantly year by year, facing enormous pressure and challenges for traditional vehicle management and traffic operation methods. In order to solve the above problems, the Automatic License Plate Recognition Technology (AVI) came into being and developed into an important part of the modern intelligent transportation system. Based on computer vision processing, digital image processing, pattern recognition and other technologies, it processes and analyzes the vehicle image or video image captured by the camera to obtain the license plate number of each vehicle, thereby completing the identification process. Through some subsequent processing technologies, it can realize the functions of parking lot entrance and exit charge management, robbery vehicle management, highway speeding automatic management, red light electronic police, road toll management and so on. It is of practical significance to maintain traffic safety and urban security, prevent traffic jams, and realize fully automated traffic management. 1 framework process
Auto License Plate Recognition Based on Opencv
2, smoothing
Auto License Plate Recognition Based on Opencv
The first step in license plate location is image preprocessing. To facilitate calculations, the system typically grayscales the acquired image. The process of converting a color image into a grayscale image is called grayscale processing of the image. The values ​​of the three components R, G, and B in the color image determine the specific pixel points. A pixel can have tens of millions of colors. The grayscale image is a color image, but its characteristic is that the specific values ​​of the three components R, G, and B are consistent. The variation interval of each pixel in the grayscale image is 0 to 255. Since the calculation is convenient, the images of various formats are first converted into grayscale images in actual engineering processing. Based on the preserved image outlines and features, the grayscale image still reflects the entire image outline and texture. There is an interface in Opencv that implements image grayscale. Call the cvSmooth function in OpenCV for median filtering to remove small glitch.
3. Binarization Local adaptive binarization is a point-by-point threshold calculation for each pixel in a grayscale image. Its threshold is determined by the local grayscale characteristics of the points around the pixel and the grayscale values ​​of the pixels. The local threshold method is to calculate the gray level of each pixel of the image one by one, and save the detailed information of the image. Although the condition of non-uniform illumination affects the gray distribution of the whole image, it does not affect the local image properties, but it also has disadvantages and problems. Compared to the global threshold method, it takes a long time to calculate, but it is suitable for a changing environment.
Let the gray value of the image at the pixel point (x, y) be f(x, y), consider the (2w+1)*(2w+1) window centered on the pixel point (x, y) (w is The window width), the local adaptive binarization algorithm can be described as follows:
a. Calculate the threshold w(x, y) of each point (x, y) in the image
W(x,y)=0.5*(max f(x+m,y+n)+min f(x+m,y+n))
b. If f(x, y) > w(x, y), the binarization result is 1, representing the target point of the character region; otherwise the binarization result is 0, representing the target point of the background region.
4 , license plate positioning
Auto License Plate Recognition Based on Opencv


The directional property of the Canny edge detection operator guarantees a good edge strength estimation, and can simultaneously generate two directions of edge gradient direction and intensity, that is, it can resist noise and maintain weak edges to a certain extent, so the canny operator is adopted. Do edge detection. Canny algorithm steps: (1) Denoising <br> Any edge detection algorithm can't be processed well on unprocessed raw data, so the first step is to convolve the original data with the Gaussian mask. Some slight blur compared to the original image. Thus, a single pixel noise becomes almost unaffected by Gaussian smoothed images.
(2) Calculate the magnitude and direction of the gradient using the finite difference of the first-order partial derivative.
(3) Non-maximum suppression of the gradient amplitude.

Simply obtaining a global gradient is not sufficient to determine the edge, so to determine the edge, the point with the largest local gradient must be preserved while the non-maximum value is suppressed.
The potential points of the binary gray matrix generated by the non-maximum suppression are searched for edges according to the high threshold, and the points satisfying the low threshold in the neighborhood are searched for the found points to form a closed contour. Then delete the point that does not satisfy the condition.

Line scan positioning

The purpose of the fine positioning of the license plate is to divide the next character, that is, to further remove the redundant part of the license plate. In an image that contains a license plate with appropriate binarization, the license plate area has three basic characteristics:
1. Intensively containing multiple characters in a small area;
2. The license plate characters form a strong contrast with the license plate background color;
3. The size of the license plate area is relatively fixed, and the length and width of the area are fixed.

According to the above characteristics, the change of 0 to 1 and 1 to 0 between adjacent pixels in the row of the license plate area will be frequent, and the total number of changes will be greater than a critical value, which can be used as a basis for finding the license plate area. Therefore, based on the number of hops compared with the set threshold, the horizontal area of ​​the license plate can be determined.
Since the license plate is generally suspended in the lower part of the vehicle, the image is scanned from top to bottom and left to right. The character part of the license plate consists of 7 characters and two vertical borders, and the number of jumps in any row in the license plate area is at least (7+2)*2=18 times. Scanning from the bottom of the image to the top, the first set of consecutive rows and the number of hops per row are greater than the hop threshold, while satisfying the number of consecutive rows is greater than a certain threshold.
In the horizontal area of ​​the license plate, the difference between the highest line and the lowest line is the height of the license plate in the image. China's license plate area is rectangular, the aspect ratio is about 3.14, taking 3.14*H as the width of the license plate. Select any row in the horizontal area, move from left to right with the L long window, and count the number of transitions of the adjacent pixels 0, 1 in the window and store them in the array. If the window moves to the vertical area of ​​the license plate, the number of hops in the window should be the largest. Therefore, the maximum value is found in the array, and the corresponding area is the vertical area of ​​the license plate. 5, template matching Auto License Plate Recognition Based on Opencv

3.2v105Ah Lithium Ion Battery

3.2V105Ah Lithium Ion Battery,105Ah 3.2V Phosphate Battery Cell,3.2V105Ah Deep Cycle Solar Battery,3.2V 105Ah Lifepo4 Forklift Battery

Jiangsu Zhitai New Energy Technology Co.,Ltd , https://www.jszhitaienergy.com

Posted on