Movatterモバイル変換


[0]ホーム

URL:


CN103116751B - A kind of Method of Automatic Recognition for Character of Lcecse Plate - Google Patents

A kind of Method of Automatic Recognition for Character of Lcecse Plate
Download PDF

Info

Publication number
CN103116751B
CN103116751BCN201310028106.8ACN201310028106ACN103116751BCN 103116751 BCN103116751 BCN 103116751BCN 201310028106 ACN201310028106 ACN 201310028106ACN 103116751 BCN103116751 BCN 103116751B
Authority
CN
China
Prior art keywords
license plate
color
character
image
characters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201310028106.8A
Other languages
Chinese (zh)
Other versions
CN103116751A (en
Inventor
王敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hohai University HHU
Original Assignee
Hohai University HHU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hohai University HHUfiledCriticalHohai University HHU
Priority to CN201310028106.8ApriorityCriticalpatent/CN103116751B/en
Publication of CN103116751ApublicationCriticalpatent/CN103116751A/en
Application grantedgrantedCritical
Publication of CN103116751BpublicationCriticalpatent/CN103116751B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

本发明公开了一种车牌字符自动识别方法,包括以下步骤:输入彩色车辆图像;对图像进行预处理;在不同光线条件下选择不同算法进行车牌定位;车牌进行水平倾斜矫正和垂直倾斜矫正;采用基于聚类连通和垂直投影的方法对步骤d得到的车牌进行字符分割;使用改进的模板匹配法对步骤e得到字符进行字符识别;输出步骤f的识别结果。本发明的车牌字符自动识别方法,显著地提高整个车牌字符自动识别系统的使用性能。在所述车牌定位步骤中,本发明能够利用车牌区域的特点,在不同光线条件下选择不同算法进行车牌定位,保证在出现干扰的情况下也能准确定位车牌区域位置。

The invention discloses a method for automatic identification of license plate characters, comprising the following steps: inputting a color vehicle image; preprocessing the image; selecting different algorithms under different light conditions to locate the license plate; correcting the horizontal inclination and vertical inclination of the license plate; Carry out character segmentation on the license plate obtained in step d based on the method of cluster connectivity and vertical projection; use the improved template matching method to perform character recognition on the characters obtained in step e; output the recognition result of step f. The method for automatic recognition of license plate characters of the present invention significantly improves the performance of the entire automatic recognition system for license plate characters. In the license plate locating step, the present invention can utilize the characteristics of the license plate area and select different algorithms to locate the license plate under different light conditions, so as to ensure that the license plate area can be accurately located even when interference occurs.

Description

Translated fromChinese
一种车牌字符自动识别方法A method for automatic recognition of license plate characters

技术领域technical field

本发明属于计算机视觉和模式识别领域,涉及模式识别、数字图像处理、人工智能、计算机科学等多门学科,具体涉及一种车牌字符自动识别方法。The invention belongs to the field of computer vision and pattern recognition, relates to pattern recognition, digital image processing, artificial intelligence, computer science and other disciplines, in particular to an automatic recognition method for license plate characters.

背景技术Background technique

随着城市规模的扩大,城市里面的机动车数量迅速增加,传统的人工管理交通已经不能适应这种变化。因此,智能交通系统被大规模应用于城市交通管理和调度中。其中车牌识别(VehicleLicensePlateRecognition,VLPR)是智能交通系统中的核心。With the expansion of the city scale, the number of motor vehicles in the city has increased rapidly, and the traditional manual management of traffic has been unable to adapt to this change. Therefore, intelligent transportation systems are widely used in urban traffic management and dispatching. Among them, Vehicle License Plate Recognition (VLPR) is the core of the intelligent transportation system.

车牌识别是现代智能交通系统中的重要组成部分,应用十分广泛。它以模式识别、计算机视觉、数字图像处理等技术为基础。通过对车牌数据的一系列处理可以实现交通流量控制指标测量、车辆定位、高速公路超速自动化监管、交通违章抓拍、公路收费站和停车场收费管理等功能。汽车牌照的自动识别对于维护交通安全和城市治安,防止交通堵塞,实现交通自动化管理有着重要的意义。License plate recognition is an important part of modern intelligent transportation systems and is widely used. It is based on techniques such as pattern recognition, computer vision, and digital image processing. Through a series of processing of license plate data, functions such as traffic flow control index measurement, vehicle positioning, expressway overspeed automatic supervision, traffic violation capture, highway toll station and parking lot toll management can be realized. Automatic recognition of vehicle license plates is of great significance for maintaining traffic safety and urban security, preventing traffic jams, and realizing traffic automation management.

因此,需要一种车牌字符自动识别方法。Therefore, need a kind of license plate character automatic recognition method.

发明内容Contents of the invention

发明目的:本发明针对现有技术在车牌识别方面存在的缺陷,提供一种车牌字符自动识别方法。Purpose of the invention: The present invention aims at the defects of the prior art in license plate recognition, and provides a method for automatic recognition of license plate characters.

技术方案:为解决上述技术问题,本发明的一种车牌字符自动识别方法采用如下技术方案:Technical solution: In order to solve the above technical problems, a method for automatic recognition of license plate characters of the present invention adopts the following technical solution:

一种车牌字符自动识别方法,包括以下步骤:A method for automatic recognition of license plate characters, comprising the following steps:

a、输入彩色车辆图像;a. Input color vehicle image;

b、对步骤a得到的彩色车辆图像进行预处理;B. Preprocessing the color vehicle image obtained in step a;

c、在白天光线比较好的情况下,采用基于颜色点对搜索和数学形态学的车牌定位算法对步骤b得到的彩色车辆图像进行车牌定位;在白天光线不佳或者夜晚情况下,采用基于灰度图像的车牌定位算法对步骤b得到的彩色车辆图像进行车牌定位;本发明以光照度8000lx为分界点,当光照度大于8000lx时,采用基于颜色点对搜索和数学形态学的车牌定位算法对步骤b得到的彩色车辆图像进行车牌定位;当光照度小于8000lx时,采用基于灰度图像的车牌定位算法对步骤b得到的彩色车辆图像进行车牌定位。c. When the daytime light is relatively good, use the license plate location algorithm based on color point pair search and mathematical morphology to locate the color vehicle image obtained in step b; The license plate location algorithm of the intensity image carries out the license plate location to the color vehicle image that step b obtains; The present invention takes illuminance 8000lx as dividing point, when illuminance is greater than 8000lx, adopts the license plate location algorithm based on color point pair search and mathematical morphology to step b The license plate location is performed on the obtained color vehicle image; when the illuminance is less than 8000lx, the license plate location algorithm based on the gray image is used to perform license plate location on the color vehicle image obtained in step b.

d、分别对步骤c定位得到的车牌进行水平倾斜矫正和垂直倾斜矫正;d. Carry out horizontal inclination correction and vertical inclination correction to the license plate obtained in step c positioning respectively;

e、采用基于聚类连通和垂直投影的方法对步骤d得到的车牌进行字符分割;E, adopt the method based on cluster connection and vertical projection to carry out character segmentation to the license plate that step d obtains;

f、使用改进的模板匹配法对步骤e得到字符进行字符识别;f, using the improved template matching method to carry out character recognition to the character obtained in step e;

g、输出步骤f的识别结果。g. Outputting the recognition result of step f.

有益效果:本发明的车牌字符自动识别方法,显著地提高整个车牌字符自动识别系统的使用性能。在所述车牌定位步骤中,本发明能够利用车牌区域的特点,在不同光线条件下选择不同算法进行车牌定位,保证在出现干扰的情况下也能准确定位车牌区域位置。Beneficial effects: the method for automatic recognition of license plate characters of the present invention significantly improves the performance of the entire automatic recognition system for license plate characters. In the license plate locating step, the present invention can utilize the characteristics of the license plate area and select different algorithms to locate the license plate under different light conditions, so as to ensure that the license plate area can be accurately located even when interference occurs.

更进一步的,步骤b中所述预处理包括图像平滑方法和/或滤波去噪方法。Furthermore, the preprocessing in step b includes image smoothing methods and/or filtering and denoising methods.

更进一步的,步骤c中所述基于搜索颜色点对与数学形态学的车牌定位算法利用车牌底色与车牌字符颜色在灰度上的差异找出车牌所在区域。Furthermore, the license plate location algorithm based on search color point pairs and mathematical morphology described in step c uses the difference in gray scale between the background color of the license plate and the color of the characters on the license plate to find out the area where the license plate is located.

更进一步的,假设车牌的字符颜色为A色,车牌的底色为B色,步骤c中所述所述基于搜索颜色点对与数学形态学的车牌定位算法包括以下步骤:Further, assuming that the character color of the license plate is A color, and the background color of the license plate is B color, the license plate location algorithm based on the search color point pair and mathematical morphology described in step c includes the following steps:

(1)对含有车辆的彩色图像进行灰度化和二值化处理,计算最大方差阈值,得到相应的二值图像;(1) Grayscale and binarize the color image containing the vehicle, calculate the maximum variance threshold, and obtain the corresponding binary image;

(2)在计算机内存中开辟一块内存区域,用于存储二值图像数据,二值图像的长宽与彩色图像的长宽相等,每个像素点的值初始化为255;(2) Open up a memory area in the computer memory for storing binary image data, the length and width of the binary image are equal to the length and width of the color image, and the value of each pixel is initialized to 255;

(3)扫描二值图像中的A色像素点,如果在彩色图像相应位置左侧找到B色像素点,则认为这个A色像素点是车牌字符与车牌底色的起始边界点,即车牌字符的起始像素点,标记这个点的位置;(3) Scan the A-color pixel in the binary image. If the B-color pixel is found on the left side of the corresponding position in the color image, then this A-color pixel is considered to be the starting boundary point between the license plate character and the license plate background color, that is, the license plate The starting pixel point of the character, marking the position of this point;

(4)继续扫描二值图像的A色像素点,如果在彩色图像相应位置的右侧找到B色像素点,则认为这个A色像素点是车牌字符与车牌底色的终止边界点,即车牌字符的终止像素点,并标记这个点的位置;(4) Continue to scan the A-color pixel of the binary image. If the B-color pixel is found on the right side of the corresponding position of the color image, then this A-color pixel is considered to be the termination boundary point between the license plate character and the license plate background color, that is, the license plate The ending pixel point of the character, and mark the position of this point;

(5)如果车牌字符的起始像素点与车牌字符的终止像素点相差值在50个像素之内,则认为这块区域为车牌字符像素点区域,并在步骤3的图像中用黑色像素点标记这些点;(5) If the difference between the starting pixel point of the license plate character and the ending pixel point of the license plate character is within 50 pixels, then this area is considered to be the pixel point area of the license plate character, and black pixels are used in the image in step 3 mark the points;

(6)完整扫描整幅图像,直到找出图像中的所有A色和B色颜色点对;(6) Completely scan the entire image until finding all color point pairs of A color and B color in the image;

(7)使用二值开运算处理对步骤(6)得到的颜色点进行处理;(7) process the color points that step (6) obtains by using the binary opening operation;

(8)使用腐蚀操作对二值开运算处理以后的颜色对进行处理,进一步扩大颜色点对的范围;(8) use the corrosion operation to process the color pair after the binary opening operation processing, and further expand the scope of the color point pair;

(9)使用膨胀操作对颜色点对进行处理,得到一片连续的像素点区域,这块区域就是车牌候选区。在光线比较充裕的情况下,采用基于颜色点对搜索和数学形态学的车牌定位算法,此算法在光线较佳的情况下具有很高的定位准确率;(9) Use the expansion operation to process the color point pairs to obtain a continuous pixel point area, which is the license plate candidate area. In the case of sufficient light, the license plate location algorithm based on color point pair search and mathematical morphology is adopted. This algorithm has a high positioning accuracy in the case of better light;

更进一步的,步骤c中所述基于灰度图像的车牌定位算法包括以下步骤:Furthermore, the license plate location algorithm based on the grayscale image described in step c includes the following steps:

a、首先对对含有车辆的彩色图像进行灰度化和二值化处理;a. First, grayscale and binarize the color image containing the vehicle;

b、采用每隔三行扫描一行的方法,标记黑白像素点变化次数最多的行号rm,并记下变化次数m;b. Use the method of scanning one line every three lines, mark the line number rm with the most number of changes in black and white pixels, and record the number of changes m;

c、以rm为基础,统计上下3行,判断其黑白像素点变化次数是否与rm接近,车牌区域的黑白像素点的变化次数的范围是从0.75m到1.25m,即车牌中黑白变化的次数是在一个稳定范围之内,而非车牌区域的黑白像素变化次数是不稳定的;c. Based on rm , count the upper and lower 3 lines, and judge whether the number of black and white pixel changes is close to rm . The range of black and white pixel changes in the license plate area is from 0.75m to 1.25m, that is, the black and white changes in the license plate The number of times is within a stable range, and the number of black and white pixel changes in the non-license plate area is unstable;

d、重复步骤b和步骤c,得到车牌的上下边界,从而确定车牌候选区。d. Repeat steps b and c to obtain the upper and lower boundaries of the license plate, thereby determining the license plate candidate area.

在光线不佳的情况下,采用改进的基于纹理特征的车牌定位算法,该算法每隔3行扫描一次,可以大大提高系统的实时性。In the case of poor light, the improved license plate location algorithm based on texture features can be used to scan every 3 lines, which can greatly improve the real-time performance of the system.

更进一步的,步骤d中车牌的水平倾斜矫正和垂直倾斜矫正分别采用基于车牌边缘点纵坐标方差最小的水平倾斜校正法和基于单个字符垂直倾斜角度的车牌整体垂直倾斜校正法进行。在车牌倾斜校正步骤中,先进行车牌二值化,再进行不同方向上的校正。Furthermore, the horizontal tilt correction and vertical tilt correction of the license plate in step d are respectively carried out by using the horizontal tilt correction method based on the minimum variance of the vertical coordinates of the edge points of the license plate and the overall vertical tilt correction method of the license plate based on the vertical tilt angle of a single character. In the license plate tilt correction step, the license plate is binarized first, and then corrected in different directions.

更进一步的,步骤e中所述基于聚类连通和垂直投影的方法先找出图像中的连通域,再通过车牌的先验知识对连通域进行筛选。该算法是一种既能提高字符分割的准确率,鲁棒性又高的算法。Furthermore, the method based on cluster connectivity and vertical projection described in step e first finds the connected domains in the image, and then screens the connected domains through the prior knowledge of the license plate. This algorithm is an algorithm that can not only improve the accuracy of character segmentation, but also has high robustness.

更进一步的,步骤e中所述基于聚类连通和垂直投影的方法包括以下步骤:Further, the method based on cluster connectivity and vertical projection described in step e includes the following steps:

(1)对车牌图像进行二值化处理。(1) Carry out binarization processing on the license plate image.

(2)将处理后的图像按行扫描,如两像素间距离d<=dconst,则认为这两个像素属于一类,也就是一个字符中的两个像素;(2) scan the processed image by row, if the distance d<=dconst between two pixels, then think that these two pixels belong to one category, that is, two pixels in a character;

(3)筛选得到的各类,去掉高度小于Height/2的类,经过筛选以后得到类为7个字符和左右边框;(3) For the various types obtained by screening, remove the class whose height is less than Height/2, and after screening, the class is 7 characters and left and right borders;

(4)把各类的起始位置按照从左到右的位置排序。车牌二值化采用改进型局部二值化法,实验证明该方法在光线不佳的情况下也能够很好的将车牌字符和背景去分离出来;(4) Sort the starting positions of each category in order from left to right. The license plate binarization adopts the improved local binarization method, and the experiment proves that this method can also separate the license plate characters from the background well in the case of poor light;

更进一步的,d定义为:Furthermore, d is defined as:

d(A,B)=|x1-x2|+|y1-y2|,d(A,B)=|x1 -x2 |+|y1 -y2 |,

汉字的dconst取值为2或者3,英文字符和数字的dconst取值为2。The dconst value of Chinese characters is 2 or 3, and the dconst value of English characters and numbers is 2.

更进一步的,步骤f中改进的模板匹配法包括以下步骤:Furthermore, the improved template matching method in step f includes the following steps:

(1)建立匹配模板库;(1) Establish a matching template library;

(2)对车牌字符进行细化运算,使得字符的笔画宽度为一个像素宽度;(2) Carry out refinement calculation to the license plate character, make the stroke width of character be one pixel width;

(3)对步骤(2)得到的车牌字符滤除离散噪声点;(3) filter the discrete noise point to the license plate character that step (2) obtains;

(4)将经过细化和滤除离散噪声点以后的车牌字符进行归一化处理,归一化处理以后进行图像反转处理,将车牌背景变成白色,字符变成黑色;(4) normalize the license plate characters after thinning and filtering out the discrete noise points, and perform image inversion processing after the normalization process, the license plate background becomes white, and the characters become black;

(5)将步骤(4)得到的车牌字符图像与匹配模板库进行对比,得到匹配模板;(5) the license plate character image obtained in step (4) is compared with the matching template library to obtain the matching template;

(6)扫描车牌字符图像,当遇到一个字符像素时,在匹配模板5×5的像素区域范围内寻找最近的字符像素点,并计算最近的字符像素点与匹配模板最近距离的大小,计算车牌字符像素与匹配模版的最小距离之和,找出车牌字符与匹配模板的最小距离之和;(6) Scan the license plate character image, when encountering a character pixel, search for the nearest character pixel within the 5×5 pixel area of the matching template, and calculate the size of the closest distance between the nearest character pixel and the matching template, calculate The sum of the minimum distance between the license plate character pixels and the matching template, find the sum of the minimum distance between the license plate character and the matching template;

(7)扫描匹配模版图像,当遇到一个字符像素时,在车牌字符5×5的像素区域范围内寻找最近的字符像素点,并计算最近的字符像素点与车牌字符最近距离的大小,计算匹配模版与车牌字符的最小距离之和,找出匹配模版与车牌字符的最小距离之和;(7) scan the matching template image, when encountering a character pixel, search for the nearest character pixel within the 5×5 pixel area of the license plate character, and calculate the size of the closest distance between the nearest character pixel and the license plate character, calculate Match the sum of the minimum distance between the template and the license plate characters, find out the sum of the minimum distance between the matching template and the license plate characters;

(8)比较(6)和(7)的最小距离之和,取小值对应模板作为车牌字符的匹配结果。(8) Compare the sum of the minimum distances of (6) and (7), and take the template corresponding to the small value as the matching result of the license plate characters.

(9)按照上述步骤将车牌字符一一进行匹配,最终得到车牌信息。在所述字符识别步骤中,对模板匹配法进行了改进,进一步对分割后得到的车牌字符进行细化处理,显著提高了匹配成功率。(9) Match the license plate characters one by one according to the above steps, and finally obtain the license plate information. In the character recognition step, the template matching method is improved, and the license plate characters obtained after segmentation are further refined, which significantly improves the matching success rate.

附图说明Description of drawings

图1本发明的车牌字符自动识别方法的流程图。Fig. 1 is the flowchart of the license plate character automatic recognition method of the present invention.

具体实施方式detailed description

下面结合附图和具体实施例,进一步阐明本发明,应理解这些实施例仅用于说明本发明而不用于限制本发明的范围,在阅读了本发明之后,本领域技术人员对本发明的各种等价形式的修改均落于本申请所附权利要求所限定的范围。Below in conjunction with accompanying drawing and specific embodiment, further illustrate the present invention, should be understood that these embodiments are only for illustrating the present invention and are not intended to limit the scope of the present invention, after having read the present invention, those skilled in the art will understand various aspects of the present invention Modifications in equivalent forms all fall within the scope defined by the appended claims of this application.

如图1所示,本发明的车牌字符自动识别方法首先通过摄像机拍摄的图像或者视频截图,转换成数字化图像输入计算机(步骤101),接着对输入图像进行预处理(步骤102),然后根据不同的光线条件,运用不同的方法定位出车牌所在位置(步骤103);接下来通过二值化、水平倾斜校正和垂直倾斜校正等数字图像处理方法实现对车牌图像的倾斜校正(步骤104);再将单独的字符从车牌图像中分割出来(步骤105);最后通过模式识别的技术实现对车牌字符的自动识别(步骤106)。As shown in Figure 1, the license plate character automatic recognition method of the present invention first converts the image taken by the camera or the video screenshot into a digitized image input computer (step 101), then the input image is preprocessed (step 102), and then according to different According to the light conditions, use different methods to locate the position of the license plate (step 103); then realize the tilt correction of the license plate image by digital image processing methods such as binarization, horizontal tilt correction and vertical tilt correction (step 104); Segment individual characters from the license plate image (step 105); finally realize automatic recognition of the license plate characters by pattern recognition technology (step 106).

我国车牌主要有蓝底白字、黄底黑字、黑底白字、白底黑红字这四种。下面以蓝底白字车牌为例对本发明的车牌字符自动识别方法加以详细说明。There are mainly four types of license plates in my country: white characters on a blue background, black characters on a yellow background, white characters on a black background, and black and red characters on a white background. The license plate character automatic recognition method of the present invention will be described in detail below by taking the license plate with white characters on a blue background as an example.

车牌定位一直是汽车牌照识别系统中的难点,车牌图像中大量的干扰和光线照射强弱、车牌反光等因素都会影响车牌定位的准确性。本发明提出了两种车牌定位算法相结合的车牌定位算法:在白天光线比较好的情况下,采用基于颜色点对搜索和数学形态学的车牌定位算法;在白天光线不佳或者夜晚情况下采用一种新型的基于灰度图像的车牌定位算法。本发明中的车牌定位算法需要光线感应器的支持,通过光线感应器接收到的外部环境光线的强度来决定使用哪种算法进行车牌定位。本发明以光照度8000lx为分界点,当光照度大于8000lx时,采用基于颜色点对搜索和数学形态学的车牌定位算法对得到的彩色车辆图像进行车牌定位;当光照度小于8000lx时,采用基于灰度图像的车牌定位算法对得到的彩色车辆图像进行车牌定位。License plate positioning has always been a difficult point in the license plate recognition system. A lot of interference in the license plate image, light intensity, license plate reflection and other factors will affect the accuracy of license plate positioning. The present invention proposes a license plate positioning algorithm combining two license plate positioning algorithms: when the light is relatively good during the day, the license plate positioning algorithm based on color point pair search and mathematical morphology is adopted; A new license plate location algorithm based on gray image. The license plate location algorithm in the present invention needs the support of the light sensor, and the intensity of the external ambient light received by the light sensor determines which algorithm to use for the license plate location. In the present invention, the illuminance is 8000lx as the dividing point. When the illuminance is greater than 8000lx, the license plate location algorithm based on color point pair search and mathematical morphology is used to locate the license plate of the obtained color vehicle image; when the illuminance is less than 8000lx, the grayscale image is used The license plate location algorithm is used to locate the license plate on the obtained color vehicle image.

由于车身上可能含有与车牌颜色相近的颜色,加上氧化导致车牌褪色等原因,这些干扰都可能降低车牌定位的精度。本发明提出的基于搜索颜色点对与数学形态学的车牌定位算法利用车牌底色与车牌字符颜色在灰度上的差异找出车牌所在区域,具有良好的抗干扰能力。具体步骤如下:Because the car body may contain colors similar to the color of the license plate, and oxidation causes the license plate to fade, etc., these interferences may reduce the accuracy of license plate positioning. The license plate positioning algorithm based on the search color point pair and mathematical morphology proposed by the invention utilizes the difference in gray scale between the background color of the license plate and the character color of the license plate to find out the area where the license plate is located, and has good anti-interference ability. Specific steps are as follows:

(1)对含有车辆的彩色图像进行灰度化和二值化处理,计算最大方差阈值,得到相应的二值图像;(1) Grayscale and binarize the color image containing the vehicle, calculate the maximum variance threshold, and obtain the corresponding binary image;

(2)在计算机内存中开辟一块内存区域,用于存储8位的图像数据,图像长宽与彩色图像相等,每个像素点的值初始化为255;(2) Open up a memory area in the computer memory for storing 8-bit image data, the image length and width are equal to the color image, and the value of each pixel is initialized to 255;

(3)扫描二值图像中的白色像素点,如果在彩色图像相应位置左侧找到蓝色像素点,则认为这个白色像素点是车牌字符与车牌底色的起始边界点,即车牌字符的起始像素点,标记这个点的位置;(3) Scan the white pixel in the binary image, if a blue pixel is found on the left side of the corresponding position in the color image, then this white pixel is considered to be the initial boundary point between the license plate character and the license plate background color, that is, the license plate character The starting pixel point, marking the position of this point;

(4)继续扫描二值图像的白色像素点,如果在彩色图像相应位置的右侧找到蓝色像素点,则认为这个白色像素点是车牌字符与车牌底色的终止边界点,即车牌字符的终止像素点,并标记这个点的位置;(4) Continue to scan the white pixels of the binary image. If a blue pixel is found on the right side of the corresponding position of the color image, then this white pixel is considered to be the termination boundary point between the license plate character and the license plate background color, that is, the license plate character Terminate the pixel point and mark the position of this point;

(5)如果车牌字符的起始像素点与车牌字符的终止像素点相差值在50个像素之内,则认为这块区域为车牌字符像素点区域,并在步骤3的图像中用黑色像素点标记这些点;(5) If the difference between the starting pixel point of the license plate character and the ending pixel point of the license plate character is within 50 pixels, then this area is considered to be the pixel point area of the license plate character, and black pixels are used in the image in step 3 mark the points;

(6)完整扫描整幅图像,直到找出图像中的所有蓝白颜色点对;(6) Completely scan the entire image until all blue-white color point pairs in the image are found;

(7)使用二值开操作运算处理对颜色点进行处理。(7) Process the color points by binary opening operation.

(8)使用腐蚀操作对开二值开操作以后的颜色对进行处理,连续进行十次,进一步扩大颜色点对的范围。(8) Use the corrosion operation to process the color pairs after the binary opening operation, and perform ten consecutive times to further expand the range of color point pairs.

(9)使用膨胀操作继续对颜色点对进行处理,得到一片基本连续的像素点区域,这块区域就是车牌候选区。(9) Use the expansion operation to continue to process the color point pairs to obtain a substantially continuous pixel point area, which is the license plate candidate area.

注意本发明中所使用的蓝色是一个模糊定义,实际车牌中的蓝色有深蓝色和浅蓝色,还要考虑到由于氧化等原因,车牌的底色会变浅,所以只能为蓝色定义一个大概的限定条件。这个条件是根据经验设定的,根据不同的光线情况这个条件会发生改变。只要彩色图像中的像素点满足这个条件,都可以认为这个像素点为蓝色像素点。具体的,如果这个像素点满足以下以下三个条件:(1)B>1.5*R;(2)B>1.5*G;(3)B>100就认为这个像素点为蓝色像素点。同样,白色也是一个模糊概念。如果一个像素点满足以下四个条件:(1)R<0.4*S;(2)G<0.4*S;(3)B<0.4*S;(4)S>200就认为这个像素点为白色像素点。其中S=R+G+B。Note that the blue used in the present invention is a fuzzy definition. The blue in the actual license plate has dark blue and light blue. It is also necessary to consider that the background color of the license plate will become lighter due to oxidation and other reasons, so it can only be blue. Color defines an approximate qualification. This condition is set based on experience and will change according to different light conditions. As long as the pixel in the color image satisfies this condition, it can be considered as a blue pixel. Specifically, if the pixel satisfies the following three conditions: (1) B>1.5*R; (2) B>1.5*G; (3) B>100, the pixel is considered to be a blue pixel. Similarly, white is also a fuzzy concept. If a pixel meets the following four conditions: (1) R<0.4*S; (2) G<0.4*S; (3) B<0.4*S; (4) S>200, the pixel is considered white pixel. where S=R+G+B.

此时得到的车牌候选区,可能是车牌所在区域,也可能是噪声或干扰区域。可以利用车牌的先验知识去除伪车牌区域,从而得到真正的车牌区域。通常车牌区域的长与宽都应该大于一定的像素值,而车牌的长高之比应该在2∶1到4∶1之间。The license plate candidate area obtained at this time may be the area where the license plate is located, or may be a noise or interference area. The prior knowledge of the license plate can be used to remove the fake license plate area, so as to obtain the real license plate area. Usually the length and width of the license plate area should be greater than a certain pixel value, and the ratio of the length to height of the license plate should be between 2:1 and 4:1.

在光线不佳或者夜晚情况下,车牌的颜色特征不明显,如果仍然采用基于颜色点对搜索算法可能找不到图像中的颜色点对,导致定位失败。本发明在光线不佳的情况下采用一种基于灰度图像的车牌定位新算法。首先对图像进行灰度化和二值化处理。因为汽车车牌一般悬挂在汽车底部,所以本发明采用从下往上的搜索方法,这样不仅能够提高搜索速度,也能提高搜索的成功率。采用每隔三行扫描一行的方法,标记黑白像素点变化次数最多的行号rm,并记下变化次数m。一般说来车牌高度在50个像素左右,在车牌区域的水平扫描过程中,每隔3行就会出现黑白像素点变化次数比较多的行,这样的行会连续出现17次左右,记下这些行号ri(i=1,2…),以ri为基础,统计上下3行,判断其黑白像素点变化次数是否与ri相似,根据经验可知车牌区域的黑白像素点的变化次数的范围是从0.75m到1.25m,所以车牌中黑白变化的次数是在一个稳定范围之内,而非车牌区域的黑白像素变化次数是不稳定的。通过上面算法定位出车牌的上下边界基本是车牌字符的高度,但是在实际处理中要将定位出来的上下边界范围扩大,这样做是为了给后续的车牌区域倾斜校正留有一定的处理空间,避免将车牌有用部分切除。In poor light or at night, the color features of the license plate are not obvious. If the color point pair search algorithm is still used, the color point pair in the image may not be found, resulting in positioning failure. The invention adopts a new license plate location algorithm based on grayscale images under the condition of poor light. Firstly, the image is grayscaled and binarized. Because the car license plate is generally hung on the bottom of the car, so the present invention adopts the search method from bottom to top, which not only can improve the search speed, but also can improve the success rate of search. Use the method of scanning one line every three lines, mark the line number rm of the black and white pixel point with the most change times, and record the change number m. Generally speaking, the height of the license plate is about 50 pixels. During the horizontal scanning of the license plate area, there will be lines with more black and white pixel changes every 3 lines. Such lines will appear about 17 times in a row. Write down these Line number ri (i=1,2...), based on ri , count the upper and lower three lines, and judge whether the number of black and white pixel changes is similar to that of ri . According to experience, the number of black and white pixel changes in the license plate area is The range is from 0.75m to 1.25m, so the number of black and white changes in the license plate is within a stable range, while the number of black and white pixel changes in the non-license plate area is unstable. The upper and lower boundaries of the license plate located by the above algorithm are basically the height of the license plate characters, but in the actual processing, the range of the upper and lower boundaries should be expanded. This is to leave a certain processing space for the subsequent tilt correction of the license plate area and avoid Cut off the useful part of the license plate.

由于照相机的位置固定导致了拍摄角度的不同,定位以后得到的车牌图像或多或少存在倾斜的情况。倾斜会影响后续车牌字符分割,造成分割错误,所以在字符分割前要对车牌图像进行倾斜校正,为后面的字符能够准确分割做好准备。车牌倾斜分为三种模式:水平方向倾斜、垂直方向倾斜、水平叠加垂直方向倾斜,因此车牌倾斜校正可以从水平和垂直两个方向进行,通常先进行水平倾斜校正,确定车牌字符的上下边界,最后进行垂直倾斜校正。本发明使用的是基于垂直边缘点投影方差最小的车牌水平倾斜校正算法和基于水平边缘点方差最小的车牌垂直倾斜校正算法。Because the position of the camera is fixed, the shooting angle is different, and the license plate image obtained after positioning is more or less inclined. Tilting will affect subsequent license plate character segmentation and cause segmentation errors. Therefore, the license plate image should be tilt-corrected before character segmentation to prepare for accurate segmentation of subsequent characters. License plate tilt is divided into three modes: horizontal tilt, vertical tilt, horizontal superimposed vertical tilt, so the license plate tilt correction can be done from both horizontal and vertical directions, usually the horizontal tilt correction is performed first to determine the upper and lower boundaries of the license plate characters, Finally, vertical tilt correction is performed. The invention uses a license plate horizontal inclination correction algorithm based on the minimum variance of the vertical edge point projection and a license plate vertical inclination correction algorithm based on the minimum horizontal edge point variance.

进行车牌倾斜校正前需要对灰度车牌图像进行二值化处理。本发明采用改进的局部二值化法,它在光照不均以及车牌有污损的情况下能够很好地将车牌字符和车牌背景分开。假设(x,y)是要二值化的像素点,其临近区域为一个w×w的窗口,灰度值为f(x,y),计算每个像素点的阈值:Before license plate tilt correction, the gray-scale license plate image needs to be binarized. The invention adopts an improved local binarization method, which can well separate the characters of the license plate from the background of the license plate when the illumination is uneven and the license plate is stained. Assuming (x, y) is the pixel to be binarized, its adjacent area is a w×w window, and the gray value is f(x, y), calculate the threshold of each pixel:

TT((xx,,ythe y))==&alpha;&alpha;((maxmax--ww<<ll<<ww--ww<<kk<<wwff((xx++kk,,ythe y++ll))++minmin--ww<<ll<<ww--ww<<kk<<wwff((xx++kk,,ythe y++ll))))

这里的α是一个经验值,取值范围介于0.40与0.65之间。Here α is an empirical value, and the value range is between 0.40 and 0.65.

通过统计得到字符像素点在整个车牌图像所占的比例在30%左右,如果考虑到噪声因素,这个比例会达到35%左右。因此可以设置一个全局阈值K。假设h(x,y)是车牌图像在某一灰度值的统计值,定义K为:According to statistics, the proportion of character pixels in the entire license plate image is about 30%, and if noise factors are considered, this proportion will reach about 35%. Therefore, a global threshold K can be set. Assuming that h(x, y) is the statistical value of the license plate image at a certain gray value, K is defined as:

kk=={{gg||maxmax00&le;&le;gg&le;&le;255255[[&Sigma;&Sigma;ii==gg255255hh((xx,,ythe y))&Sigma;&Sigma;ii==00255255hh((xx,,ythe y))]]&GreaterEqual;&Greater Equal;3535%%}}

如果我们仅用全局阈值K对车牌进行二值化,很难消除光照不均或者背景剧烈变化对二值化带来的负面影响。因此必须结合阈值K和二值化法对车牌图像进行二值化处理才能达到理想的效果,具体步骤如下:If we only use the global threshold K to binarize the license plate, it is difficult to eliminate the negative impact of uneven illumination or drastic changes in the background on the binarization. Therefore, the license plate image must be binarized in combination with the threshold K and the binarization method to achieve the desired effect. The specific steps are as follows:

(1)计算全局阈值K。(1) Calculate the global threshold K.

(2)通过Bernsen二值化法得到所有像素点的局部阈值。(2) Obtain the local threshold of all pixels by Bernsen binarization method.

(3)取全局阈值K和局部阈值之间值较大者作为像素点的阈值。(3) Take the larger value between the global threshold K and the local threshold as the threshold of the pixel point.

在二值化过程中图像可能出现一些离散的噪声,因此去除噪声是必不可少的过程。常用的滤波法如均值滤波和中值滤波不适合处理字符图像,因为在滤波的过程中可能会滤除字符像素。本发明使用如下算法:There may be some discrete noise in the image during the binarization process, so noise removal is an essential process. Commonly used filtering methods such as mean filtering and median filtering are not suitable for processing character images, because character pixels may be filtered out during the filtering process. The present invention uses the following algorithm:

(1)按行扫描图像,发现一个白色像素点时,在其3×3的邻域内寻找白色像素点的数量,考虑与白色像素相邻的8个像素点。(1) Scan the image by row, and when a white pixel is found, find the number of white pixels in its 3×3 neighborhood, and consider the 8 pixels adjacent to the white pixel.

(2)设定一个阈值,如果其周围白色像素点个数大于这个阈值,则认为这个点不是离散噪声点,否则将其当作噪声点去除。本发明中阈值取值为5。(2) Set a threshold, if the number of white pixels around it is greater than this threshold, it is considered that this point is not a discrete noise point, otherwise it will be removed as a noise point. In the present invention, the threshold value is 5.

(3)扫描整幅图像,将所有离散像素点去除。(3) Scan the entire image and remove all discrete pixels.

进行水平倾斜校正前,需要先对二值化的车牌图像进行边缘检测。边缘检测利用图像一阶导数或二阶导数的过零点信息来提供判断边缘点的基本依据。本发明使用的是Sobel算子。Before performing horizontal tilt correction, it is necessary to perform edge detection on the binarized license plate image. Edge detection uses the zero-crossing information of the first or second derivative of the image to provide the basic basis for judging the edge point. What the present invention uses is Sobel operator.

通过边缘检测后得到图像中所有边缘点,令这些边缘点的中心点为M(mx,my),可以由以下式求取:After edge detection, all edge points in the image are obtained, and the center point of these edge points is M(mx ,my ), which can be obtained by the following formula:

mmxx==11NN&Sigma;&Sigma;ii==11NNxxii,,mmythe y==11NN&Sigma;&Sigma;ii==11NNythe yii

式中xi与yi为车牌边缘点的横坐标和纵坐标。In the formula, xi and yi are the abscissa and ordinate of the edge point of the license plate.

将车牌边缘图像所在坐标系原点移到M点,这时车牌边缘点纵坐标均值坐标进行变换后,车牌边缘点的坐标发生了变化,其中:Move the origin of the coordinate system where the edge image of the license plate is located to point M, then the mean value of the ordinate of the edge point of the license plate is After the coordinates are transformed, the coordinates of the edge points of the license plate have changed, where:

ui=xi-mx,vi=yi-myui =xi -mx ,vi =yi -my

假设B(u,v)为二维直角坐标系中一点,这个点与x轴的夹角为β,其纵坐标为v。B点绕中心顺时针方向旋转α角至点B'(u',v′),点B'的纵坐标为v′,可以得到如下推导过程:Suppose B(u,v) is a point in the two-dimensional Cartesian coordinate system, the angle between this point and the x-axis is β, and its ordinate is v. Point B rotates clockwise around the center by an angle of α to point B'(u', v'), and the ordinate of point B' is v', the following derivation process can be obtained:

vv&prime;&prime;rrsinsin((&beta;&beta;--&alpha;&alpha;))==vvsinsin((&beta;&beta;--&alpha;&alpha;))sinsin&beta;&beta;==vvcoscos&alpha;&alpha;--uusinsin&alpha;&alpha;

经过坐标变换和边缘点旋转以后的方差如下:The variance after coordinate transformation and edge point rotation is as follows:

&sigma;&sigma;22==11NN&Sigma;&Sigma;ii==11NN((vviicoscos&alpha;&alpha;--uuiisinsin&alpha;&alpha;))22

根据上面推导可知当边缘点纵坐标方差取得最小值时的旋转角即为水平倾斜角度,这里就是对σ2求导,在导数为零时的α角就是水平倾斜角度。According to the above derivation, it can be seen that when the variance of the ordinate of the edge point reaches the minimum value, the rotation angle is the horizontal tilt angle, here is the derivative ofσ2 , and the α angle when the derivative is zero is the horizontal tilt angle.

d&sigma;d&sigma;22d&alpha;d&alpha;==22NN&Sigma;&Sigma;ii==11NN((vviicoscos&alpha;&alpha;--uuiisinsin&alpha;&alpha;))((--vviisinsin&alpha;&alpha;--uuiicoscos&alpha;&alpha;))==00

将上式经过变换可得下式:After transforming the above formula, the following formula can be obtained:

tanthe tan22&alpha;&alpha;==22&Sigma;&Sigma;ii==11NNuuiivvii&Sigma;&Sigma;ii==11NN((uuii22--vvii22))

所以车牌在水平方向上倾斜角度为:Therefore, the tilt angle of the license plate in the horizontal direction is:

&alpha;&alpha;==1122arctanarctan[[22&Sigma;&Sigma;ii==11NNuuiivvii&Sigma;&Sigma;ii==11NN((uuii22--vvii22))

将车牌沿着水平方向顺时针旋转α完成车牌的水平倾斜校正。Rotate the license plate clockwise along the horizontal direction by α to complete the horizontal tilt correction of the license plate.

在经过水平倾斜校正以后的车牌图像中,车牌上下边框和左右边框、汽车保险杠等对车牌字符垂直倾斜校正产生干扰,影响垂直倾斜校正的准确性。因此必须准确确定字符的上下边界,字符的上下边界确定以后,既为垂直倾斜校正减少了干扰,又为字符分割减少了干扰。In the license plate image after horizontal tilt correction, the upper and lower borders and left and right borders of the license plate, car bumpers, etc. interfere with the vertical tilt correction of the license plate characters, affecting the accuracy of vertical tilt correction. Therefore, the upper and lower boundaries of characters must be accurately determined. After the upper and lower boundaries of characters are determined, both the interference for vertical tilt correction and the interference for character segmentation are reduced.

使用Sobel垂直算子求取二值图像的垂直边缘,然后对垂直边缘进行水平方向上的投影,统计每行的白色像素点数目,如果大于设定的阈值,就认为是车牌字符区域,如果找到第一个白色像素点数量统计值小于阈值的行,则认为这行可能是字符区域的上边界或者下边界。在实际应用过程中,往往把字符的上下边界扩大2~3个像素,这样做是为了避免水平倾斜校正不完全带来字符像素损失。Use the Sobel vertical operator to obtain the vertical edge of the binary image, then project the vertical edge in the horizontal direction, and count the number of white pixels in each line. If it is greater than the set threshold, it will be considered as the license plate character area. If found The first row whose statistical value of the number of white pixels is less than the threshold value is considered to be the upper boundary or lower boundary of the character area. In the actual application process, the upper and lower boundaries of characters are often enlarged by 2 to 3 pixels. This is done to avoid the loss of character pixels caused by incomplete horizontal tilt correction.

单个字符的垂直倾斜角度和整个车牌的垂直倾斜角度是一致的,因此可以通过计算出单个车牌字符的垂直倾斜角度从而得到整个车牌在垂直方向上的倾斜角度。对于单个字符来说,当字符在垂直方向没有倾斜时,二值化后字符像素点在垂直方向上投影分布最密集,范围最小,相应投影点横坐标方差最小;当字符存在倾斜时,字符像素点在垂直方向上投影范围比较宽,相应投影点横坐标方差较大。字符在垂直方向上倾斜的越厉害,投影点的横坐标方差越大。所以可以对单个字符进行剪切变换后做垂直投影,横坐标方差取得最小值时对应的剪切角度就是单个字符的倾斜角度。The vertical inclination angle of a single character is consistent with the vertical inclination angle of the entire license plate, so the vertical inclination angle of the entire license plate can be obtained by calculating the vertical inclination angle of a single license plate character. For a single character, when the character is not inclined in the vertical direction, the pixel points of the character after binarization have the densest projection distribution in the vertical direction, the smallest range, and the smallest variance in the abscissa of the corresponding projection point; when the character is inclined, the character pixel The projection range of the point in the vertical direction is relatively wide, and the variance of the abscissa of the corresponding projected point is relatively large. The more strongly the character is tilted in the vertical direction, the larger the variance of the abscissa of the projected point. Therefore, a single character can be sheared and transformed and then vertically projected. When the variance of the abscissa reaches the minimum value, the corresponding shearing angle is the inclination angle of the single character.

设字符点个数为M,字符像素点坐标为(xi,yi),i=1,2…M,经过剪切变换后坐标变换为(x′i,yi),投影点横坐标的方差定义为:Let the number of character points be M, the coordinates of character pixel points be (xi , yi ), i=1, 2...M, after shear transformation, the coordinates are transformed into (x′i , yi ), and the abscissa coordinates of projected points The variance of is defined as:

&sigma;&sigma;22==11NN&Sigma;&Sigma;ii==11NN((xxii&prime;&prime;--11NN&Sigma;&Sigma;kk==11NNxxkk&prime;&prime;))22

这样可以得到:This gives:

&sigma;&sigma;22==11NN&Sigma;&Sigma;ii==11NN[[((xixi--yiyi&CenterDot;&Center Dot;tanthe tan&theta;&theta;))--11NN&Sigma;&Sigma;kk==11NN((xxkk--ythe ykk&CenterDot;&Center Dot;tanthe tan&theta;&theta;))]]22

==11NN&Sigma;&Sigma;ii==11NN[[((xxii--11NN&Sigma;&Sigma;kk==11NNxxkk))--((ythe yii--11NN&Sigma;&Sigma;kk==11NNythe ykk))&CenterDot;&Center Dot;tanthe tan&theta;&theta;]]22

==11NN&Sigma;&Sigma;ii==11NN[[uuii--vvii&CenterDot;&Center Dot;tanthe tan&theta;&theta;]]22

其中,ui=xi-1N&Sigma;k=1Nxk,vi=yi-1N&Sigma;k=1Nyk.in, u i = x i - 1 N &Sigma; k = 1 N x k , v i = the y i - 1 N &Sigma; k = 1 N the y k .

要使字符像素点在垂直方向上的投影的横坐标方差σ2取得最小值,则需使σ2对θ的导数为0,求得θ'即为单个字符在垂直方向上的倾斜角度。公式推导如下:To make the abscissa variance σ2 of the projection of character pixels in the vertical direction obtain the minimum value, it is necessary to make the derivative of σ2 to θ be 0, and the obtained θ' is the inclination angle of a single character in the vertical direction. The formula is derived as follows:

d&sigma;d&sigma;22d&theta;d&theta;==--22secsec22&theta;&theta;00NN&Sigma;&Sigma;ii==11NN[[uuii--vviitanthe tan&theta;&theta;00]]&CenterDot;&CenterDot;vvii==00

因为sec2θ0≠0,所以有可以得到字符和车牌在垂直方向上的倾斜角α为Since sec2 θ0 ≠0, we have The inclination angle α of the characters and the license plate in the vertical direction can be obtained as

&alpha;&alpha;==&theta;&theta;00==arctanarctan&Sigma;&Sigma;ii==11NNuuiivvii&Sigma;&Sigma;ii==11NNvvii22

车牌图像经过倾斜校正已经基本满足车牌字符分割的要求,接下来只需将车牌区域中的字符单独切分出来。本发明提出了一种基于聚类连通和垂直投影的分割算法完成此步操作。The license plate image has basically met the requirements of license plate character segmentation after tilt correction, and then only needs to segment the characters in the license plate area separately. The present invention proposes a segmentation algorithm based on cluster connectivity and vertical projection to complete this step.

基于聚类分析的车牌字符分割算法先找出图像中的连通域,再通过车牌的先验知识对连通域进行筛选,此算法能够很好解决复杂背景条件下字符切分问题。具体算法描述如下:The license plate character segmentation algorithm based on cluster analysis first finds the connected domains in the image, and then filters the connected domains through the prior knowledge of the license plate. This algorithm can well solve the problem of character segmentation under complex background conditions. The specific algorithm is described as follows:

(1)对车牌图像进行二值化处理。(1) Carry out binarization processing on the license plate image.

(2)将处理后的图像按行扫描,如两像素间距离d<=dconst,则认为这两个像素属于一类,也就是一个字符中的两个像素。其中d定义为:(2) Scan the processed image by row, if the distance between two pixels is d<=dconst , then it is considered that these two pixels belong to one class, that is, two pixels in one character. where d is defined as:

d(A,B)=|x1-x2|+|y1-y2|d(A,B)=|x1 -x2 |+|y1 -y2 |

汉字的dconst取值和英文字符、数字的dconst取值不同。对于图像前(nWidth)/7部分dconst取3,这样做能够解决汉字不连通的问题;对图像后(nWidth*6)/7部分dconst取2。The dconst value of Chinese characters is different from the dconst value of English characters and numbers. For the front (nWidth)/7 part of the image, the dconst is 3, which can solve the problem of disconnected Chinese characters; for the image (nWidth*6)/7 part, the dconst is 2.

(3)筛选得到的各类,去掉高度小于Height/2的类,经过筛选以后得到类为7个字符和左右边框。(3) For the various types obtained by screening, remove the classes whose height is less than Height/2. After screening, the obtained classes are 7 characters and left and right borders.

(4)如果字符出现粘连问题,则类的数目小于7或者是某类宽度远大于类的平均宽度。此时用垂直投影法对这些类进行分裂处理,在类的中间附近区域寻找垂直投影局部极小值点从而找出两个字符的边界点。(4) If there is a sticking problem of characters, the number of classes is less than 7 or the width of a certain class is much larger than the average width of a class. At this time, the vertical projection method is used to split these classes, and the local minimum value point of the vertical projection is found in the area near the middle of the class to find the boundary point of the two characters.

(5)把各类的起始位置按照从左到右的位置排序。(5) Sort the starting positions of each category in order from left to right.

(6)如果类的数目为7,则转到(7)。否则认为在分割时出现错误。(6) If the number of classes is 7, go to (7). Otherwise, it is considered that an error occurred during segmentation.

(7)如果某类的高度远远大于其余6个类,可能是车牌上下铆钉与车牌字符粘连的缘故,这时按照其余6个类高度的平均值进行修正;如果某类的宽度远远大于其余6个类,可能是车牌的最左边字符或者最右边字符与车牌的左右边框粘连的缘故,这时按照其余6个类宽度的平均值进行修正。(7) If the height of a certain category is much larger than the other 6 categories, it may be due to the adhesion of the upper and lower rivets of the license plate to the characters of the license plate. At this time, it is corrected according to the average height of the remaining 6 categories; if the width of a certain category is much larger than The remaining 6 classes may be due to the adhesion of the leftmost or rightmost characters of the license plate to the left and right borders of the license plate. At this time, the average value of the width of the remaining 6 classes is corrected.

车牌字符识别是字符识别的一种,但是和其他字符识别(如印刷字符识别)不同,车牌字符有其自身特点:字符种类有限;车牌字符质量不如印刷字符;车牌字符有一定规律,即第一个字符为汉字字符,第二个字符为英文字符,第三、四个字符为英文字符或者数字字符,其余的字符为数字字符。根据这些特点,本发明提出了结合字符细化和最小距离模板匹配的方法。其基本思想就是将分割后的车牌字符进行二值化形态学中的细化运算,这样可以解决因为字体风格差异带来识别率不高的缺点,而且可以减少噪声的干扰,在一定程度上提高模板匹配法的识别率。具体步骤如下:License plate character recognition is a kind of character recognition, but different from other character recognition (such as printed character recognition), license plate characters have their own characteristics: the types of characters are limited; the quality of license plate characters is not as good as printed characters; license plate characters have certain rules, namely the first The first character is a Chinese character, the second character is an English character, the third and fourth characters are English characters or numeric characters, and the rest are numeric characters. According to these characteristics, the present invention proposes a method combining character refinement and minimum distance template matching. The basic idea is to carry out the refinement operation in the binarized morphology of the segmented license plate characters, which can solve the shortcomings of low recognition rate caused by differences in font styles, and can reduce noise interference and improve to a certain extent. The recognition rate of the template matching method. Specific steps are as follows:

(1)建立匹配模板库,模板库包含我国各个省市的简称、26个大写英文字母、10个阿拉伯数字,模版库每张图片的宽度为20像素,高度为40像素(需要说明的是本发明中识别的车牌仅是普通民用车牌,不包括警用和军用车牌)。(1) Establish a matching template library. The template library contains the abbreviations of various provinces and cities in my country, 26 uppercase English letters, and 10 Arabic numerals. The width of each picture in the template library is 20 pixels, and the height is 40 pixels (it needs to be explained that this The license plates identified in the invention are only common civilian license plates, excluding police and military license plates).

(2)对车牌字符进行细化运算,使得字符的笔画宽度变为一个像素宽度。(2) Thinning operation is performed on the characters of the license plate, so that the stroke width of the characters becomes one pixel width.

(3)由于细化以后可能会出现孤立的噪声点,这些噪声点会对最终的匹配结果产生影响,因此必须加以滤除。本发明中去除这些离散噪声点的思想是扫描图像中的黑色像素点,在其3×3临近区域内搜索黑色像素点,如果找到的黑色像素点少于2个,则认为这个点是离散噪声点并予以滤除。(3) Since isolated noise points may appear after refinement, these noise points will affect the final matching result, so they must be filtered out. The idea of removing these discrete noise points in the present invention is to scan the black pixels in the image, and search for black pixels in its 3×3 adjacent area. If there are less than 2 black pixels found, this point is considered to be discrete noise. Click and filter out.

(4)将经过细化和噪声去除以后的车牌字符进行归一化处理,即通过图像缩放将车牌字符图像变成20像素宽,40像素高的标准图片。归一化以后进行图像反转处理,将车牌背景变成白色,字符变成黑色,(4) Normalize the license plate characters after thinning and noise removal, that is, the license plate character image is converted into a standard picture with a width of 20 pixels and a height of 40 pixels through image scaling. After normalization, image inversion processing is performed, the background of the license plate becomes white, and the characters become black.

(5)将车牌字符图像与模版库进行对比。设定第一个车牌字符只和32个省市简称进行匹配计算,第二个车牌字符只和26个大写英文字母进行匹配计算,第三个和第四个车牌字符与10个阿拉伯数字还有26个大写英文之母进行匹配计算,最后两个车牌字符只和10个阿拉伯数字进行匹配计算,这样做不仅提高算法的效率,还能提高识别的准确率。(5) Compare the license plate character image with the template library. It is set that the first license plate character is only matched with 32 province and city abbreviations, the second license plate character is only matched with 26 uppercase English letters, and the third and fourth license plate characters are matched with 10 Arabic numerals. 26 capital letters are used for matching calculation, and the last two license plate characters are only matched with 10 Arabic numerals. This not only improves the efficiency of the algorithm, but also improves the accuracy of recognition.

(6)扫描车牌字符图像,当遇到一个字符像素时,在模板的相应位置一个设定范围内寻找最近的字符像素点,并计算最近距离的大小,在本发明中的范围设定为5×5的像素区域。计算车牌字符像素与所匹配模版的最小距离之和,找出车牌与匹配模版的最小距离之和。(6) scan the license plate character image, when running into a character pixel, search for the nearest character pixel point in a setting range of the corresponding position of the template, and calculate the size of the shortest distance, the scope in the present invention is set to 5 ×5 pixel area. Calculate the sum of the minimum distances between the license plate character pixels and the matching template, and find the sum of the minimum distances between the license plate and the matching template.

(7)扫描匹配模版图像,当遇到一个字符像素时,在车牌字符的相应位置一个范围内寻找最近的字符像素点,并计算这个最近距离的大小,在本发明中的范围设定为5×5的像素区域。计算匹配模版与车牌字符的最小距离之和,找出匹配模版与车牌字符的最小距离之和。(7) scan the matching template image, when running into a character pixel, search for the nearest character pixel point within a range of the corresponding position of the license plate character, and calculate the size of this shortest distance, the scope in the present invention is set to 5 ×5 pixel area. Calculate the sum of the minimum distances between the matching template and the license plate characters, and find the sum of the minimum distances between the matching template and the license plate characters.

(8)比较(6)和(7)的最小距离之和,取小值对应模板作为车牌字符的匹配结果。(8) Compare the sum of the minimum distances of (6) and (7), and take the template corresponding to the small value as the matching result of the license plate characters.

(9)按照上述步骤将7个车牌字符一一进行匹配,最终得到车牌信息。(9) Match the 7 license plate characters one by one according to the above steps, and finally obtain the license plate information.

本发明的车牌字符自动识别方法,显著地提高整个车牌字符自动识别系统的使用性能。在所述车牌定位步骤中,本发明能够利用车牌区域的特点,在不同光线条件下选择不同算法进行车牌定位,保证在出现干扰的情况下也能准确定位车牌区域位置。The method for automatic recognition of license plate characters of the present invention significantly improves the performance of the entire automatic recognition system for license plate characters. In the license plate locating step, the present invention can utilize the characteristics of the license plate area and select different algorithms to locate the license plate under different light conditions, so as to ensure that the license plate area can be accurately located even when interference occurs.

Claims (4)

CN201310028106.8A2013-01-242013-01-24A kind of Method of Automatic Recognition for Character of Lcecse PlateExpired - Fee RelatedCN103116751B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201310028106.8ACN103116751B (en)2013-01-242013-01-24A kind of Method of Automatic Recognition for Character of Lcecse Plate

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201310028106.8ACN103116751B (en)2013-01-242013-01-24A kind of Method of Automatic Recognition for Character of Lcecse Plate

Publications (2)

Publication NumberPublication Date
CN103116751A CN103116751A (en)2013-05-22
CN103116751Btrue CN103116751B (en)2016-07-06

Family

ID=48415123

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201310028106.8AExpired - Fee RelatedCN103116751B (en)2013-01-242013-01-24A kind of Method of Automatic Recognition for Character of Lcecse Plate

Country Status (1)

CountryLink
CN (1)CN103116751B (en)

Families Citing this family (38)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103886320A (en)*2014-01-102014-06-25北京环境特性研究所Label automatic recognition method based on parallel support vector machine weighting
CN103824078B (en)*2014-03-182017-10-10厦门翼歌软件科技有限公司The many license plate locating methods of complex scene
CN104102909B (en)*2014-07-232017-03-15中科联合自动化科技无锡有限公司Vehicle characteristics positioning and matching process based on lenticular information
CN104399674A (en)*2014-09-112015-03-11上海大学Smoke box brand visual inspection sorting system
CN105631445A (en)*2014-11-062016-06-01通号通信信息集团有限公司Character recognition method and system for license plate with Chinese characters
CN104463195B (en)*2014-11-082018-08-07沈阳工业大学Printing digit recognizing method based on template matches
CN105719488B (en)*2014-12-022019-04-12杭州海康威视数字技术股份有限公司The recognition methods of license plate, device and the video camera for Car license recognition, system
CN104463134B (en)*2014-12-192019-02-12深圳市捷顺科技实业股份有限公司License plate detection method and system
CN104636309B (en)*2015-02-062018-01-05南京理工大学Matrix recognition methods based on machine vision
CN105989345A (en)*2015-02-282016-10-05华为技术有限公司Method and device for discovering friends by image matching
CN104866849A (en)*2015-04-302015-08-26天津大学Food nutrition label identification method based on mobile terminal
CN105279512B (en)*2015-10-222018-07-10东方网力科技股份有限公司A kind of inclination licence plate recognition method and device
CN105447831B (en)*2015-12-142019-02-15浙江宇视科技有限公司 License plate image processing method and device
CN106127206B (en)*2016-06-282019-04-05北京智芯原动科技有限公司A kind of vertical angles detection method and device of license plate
CN106485234A (en)*2016-10-212017-03-08合肥哦走信息技术有限公司One kind is based on vehicle identification method in intelligent transportation system
CN106650732B (en)*2016-12-272020-04-28深圳市捷顺科技实业股份有限公司License plate recognition method and device
CN106951896B (en)*2017-02-222020-01-03武汉黄丫智能科技发展有限公司License plate image tilt correction method
CN108985137B (en)*2017-06-022021-08-27杭州海康威视数字技术股份有限公司License plate recognition method, device and system
CN108596172A (en)*2018-04-112018-09-28航天科技控股集团股份有限公司A kind of the vehicle binding device and method of car networking client
CN108830274A (en)*2018-05-032018-11-16南京邮电大学Characters on license plate detects positioning and recognition methods automatically under a kind of complex background environment
CN108968991B (en)*2018-05-082022-10-11平安科技(深圳)有限公司Hand bone X-ray film bone age assessment method, device, computer equipment and storage medium
CN108830314B (en)*2018-06-062020-12-15西安纸贵互联网科技有限公司 Semi-quantitative identification method and device for in vitro diagnostic reagents
CN109100370A (en)*2018-06-262018-12-28武汉科技大学A kind of pcb board defect inspection method based on sciagraphy and connected domain analysis
CN109145915B (en)*2018-07-272021-08-06武汉科技大学 A Fast Distortion Correction Method for License Plates in Complex Scenes
CN109241973B (en)*2018-08-212022-02-08南京工程学院 A fully automatic soft segmentation method of characters under texture background
CN109460701B (en)*2018-09-102020-09-25昆明理工大学Font identification method based on longitudinal and transverse histograms
CN110020655B (en)*2019-04-192021-08-20厦门商集网络科技有限责任公司 A Binarization-Based Character Denoising Method and Terminal
CN110443244B (en)*2019-08-122023-12-05深圳市捷顺科技实业股份有限公司Graphics processing method and related device
CN110826569B (en)*2019-11-052022-07-19泰康保险集团股份有限公司Bill image preprocessing method, device, medium and electronic equipment
CN111046872B (en)*2019-12-122023-10-24深圳市杰恩世智能科技有限公司Optical character recognition method
CN111401364B (en)*2020-03-182023-07-25深圳市市政设计研究院有限公司License plate positioning algorithm based on combination of color features and template matching
CN111553317B (en)*2020-05-142023-08-08北京惠朗时代科技有限公司Anti-fake code acquisition method and device, computer equipment and storage medium
CN112016565B (en)*2020-10-272021-06-04恒银金融科技股份有限公司Segmentation method for fuzzy numbers at account number of financial bill
CN112488105A (en)*2020-12-022021-03-12深圳市芊熠智能硬件有限公司License plate angle correction method, device, equipment and medium
CN114973255B (en)*2022-05-142024-09-10云知声智能科技股份有限公司Single-point character recognition method and device
CN115311037A (en)*2022-06-302022-11-08东软睿驰汽车技术(大连)有限公司Method, system, electronic device and storage medium for assisting car returning
CN116740951A (en)*2023-05-112023-09-12江西云眼视界科技股份有限公司License plate recognition processing method, system, computer and readable storage medium
CN120071318B (en)*2025-02-062025-08-15北京北科信达科技有限公司Vehicle license plate recognition enhancement method for intelligent city unmanned charging system

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007011654A (en)*2005-06-302007-01-18Seiko Epson Corp Embossed character reading method
CN101398894A (en)*2008-06-172009-04-01浙江师范大学Automobile license plate automatic recognition method and implementing device thereof
CN101833859A (en)*2010-05-142010-09-15山东大学 Self-triggering license plate recognition method based on virtual coil
CN102254152A (en)*2011-06-172011-11-23东南大学License plate location method based on color change points and color density
CN102385753A (en)*2011-11-172012-03-21江苏大学Illumination-classification-based adaptive image segmentation method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007011654A (en)*2005-06-302007-01-18Seiko Epson Corp Embossed character reading method
CN101398894A (en)*2008-06-172009-04-01浙江师范大学Automobile license plate automatic recognition method and implementing device thereof
CN101833859A (en)*2010-05-142010-09-15山东大学 Self-triggering license plate recognition method based on virtual coil
CN102254152A (en)*2011-06-172011-11-23东南大学License plate location method based on color change points and color density
CN102385753A (en)*2011-11-172012-03-21江苏大学Illumination-classification-based adaptive image segmentation method

Also Published As

Publication numberPublication date
CN103116751A (en)2013-05-22

Similar Documents

PublicationPublication DateTitle
CN103116751B (en)A kind of Method of Automatic Recognition for Character of Lcecse Plate
AU2020102039A4 (en)A high-precision multi-targets visual detection method in automatic driving scene
CN103324930B (en) A license plate character segmentation method based on gray histogram binarization
CN107545239B (en)Fake plate detection method based on license plate recognition and vehicle characteristic matching
CN105373794B (en)A kind of licence plate recognition method
CN105160309B (en)Three lanes detection method based on morphological image segmentation and region growing
CN107798335B (en) A Vehicle Logo Recognition Method Fusion Sliding Window and Faster R-CNN Convolutional Neural Network
CN103235938B (en)The method and system of car plate detection and indentification
CN104392205B (en)A kind of recognition methods and system of improper license plate
CN109726717B (en) A vehicle comprehensive information detection system
CN103824081B (en)Method for detecting rapid robustness traffic signs on outdoor bad illumination condition
CN103077384A (en)Method and system for positioning and recognizing vehicle logo
CN104050450A (en)Vehicle license plate recognition method based on video
CN101872416A (en) Method and system for license plate recognition on road images
CN105469046B (en)Based on the cascade vehicle model recognizing method of PCA and SURF features
CN102375982A (en)Multi-character characteristic fused license plate positioning method
WO2020000253A1 (en)Traffic sign recognizing method in rain and snow
CN107895492A (en)A kind of express highway intelligent analysis method based on conventional video
CN106886987A (en)A kind of train license plate binary image interfusion method
CN106156768A (en)The vehicle registration certificate detection method of view-based access control model
CN104598912A (en)Traffic light detection and recognition method based CPU and GPU cooperative computing
CN100414561C (en) A License Plate Extraction Method Based on Projection and Mathematical Morphology
CN104715252A (en)License plate character segmentation method with combination of dynamic template and pixel points
CN103530608A (en)Vehicle type judgment method and vehicle type judgment device
CN103902981A (en)Method and system for identifying license plate characters based on character fusion features

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20160706

Termination date:20190124


[8]ページ先頭

©2009-2025 Movatter.jp