CN104318233A - Method for horizontal tilt correction of number plate image - Google Patents

Method for horizontal tilt correction of number plate image Download PDF

Info

Publication number
CN104318233A
CN104318233A CN201410561462.0A CN201410561462A CN104318233A CN 104318233 A CN104318233 A CN 104318233A CN 201410561462 A CN201410561462 A CN 201410561462A CN 104318233 A CN104318233 A CN 104318233A
Authority
CN
China
Prior art keywords
license plate
connected domain
character
connected domains
image
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.)
Granted
Application number
CN201410561462.0A
Other languages
Chinese (zh)
Other versions
CN104318233B (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.)
Wenzhou University
Original Assignee
Wenzhou University
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 Wenzhou University filed Critical Wenzhou University
Priority to CN201410561462.0A priority Critical patent/CN104318233B/en
Publication of CN104318233A publication Critical patent/CN104318233A/en
Application granted granted Critical
Publication of CN104318233B publication Critical patent/CN104318233B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/146Aligning or centring of the image pick-up or image-field
    • G06V30/1475Inclination or skew detection or correction of characters or of image to be recognised
    • G06V30/1478Inclination or skew detection or correction of characters or of image to be recognised of characters or characters lines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/158Segmentation of character regions using character size, text spacings or pitch estimation

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)

Abstract

本发明公开了一种车牌图像水平倾斜校正方法。车牌图像由于拍摄角度等原因,车牌会出现倾斜,不利于字符分割的进行,因此需要对车牌进行校正。经过一系列图像增强操作后,得到的车牌边缘图像质量较好,基于边缘图像,本发明是利用字符的规律,查找边缘图像的合法字符连通域,对连通域的上下端点进行线性拟合找到字符区域上下边界,求得斜率,进而计算倾斜校正的旋转角度,对车牌进行旋转。本发明改进了伪连通域的去处方法和连通域的查找方法,大大提高了倾斜校正算法的鲁棒性。The invention discloses a method for correcting the horizontal inclination of a license plate image. Due to the shooting angle and other reasons of the license plate image, the license plate will be tilted, which is not conducive to character segmentation, so the license plate needs to be corrected. After a series of image enhancement operations, the edge image quality of the obtained license plate is better. Based on the edge image, the present invention uses the rules of characters to find the legal character connected domain of the edge image, and performs linear fitting on the upper and lower endpoints of the connected domain to find the characters. The upper and lower boundaries of the area are calculated to obtain the slope, and then the rotation angle of the tilt correction is calculated to rotate the license plate. The invention improves the removal method of the pseudo-connected domain and the search method of the connected domain, and greatly improves the robustness of the tilt correction algorithm.

Description

车牌图像水平倾斜校正方法Horizontal tilt correction method for license plate image

技术领域technical field

本发明涉及一种基于车牌图像中字符连通域实现的方法,尤其涉及一种车牌图像水平倾斜校正方法。The invention relates to a method realized based on character connected domains in a license plate image, in particular to a method for correcting the horizontal inclination of the license plate image.

背景技术Background technique

在智能交通系统(ITS,Intelligent transportation system)中,自动车牌识别(LPR,LicensePlateRecognition)扮演着重要的角色。通常,LPR由以下几个步骤组成:图像获取、车牌定位、车牌字符分割以及识别。然而,由于拍摄角度等原因,图像中车牌会出现倾斜的问题,如图1。这会导致车牌字符之间的连接以及破坏等问题,不利于字符分割和识别。因此,车牌图像倾斜校正的重要性显而易见。In intelligent transportation system (ITS, Intelligent transportation system), automatic license plate recognition (LPR, License Plate Recognition) plays an important role. Generally, LPR consists of the following steps: image acquisition, license plate location, license plate character segmentation, and recognition. However, due to the shooting angle and other reasons, the license plate in the image will appear tilted, as shown in Figure 1. This will cause problems such as connection and destruction between license plate characters, which is not conducive to character segmentation and recognition. Therefore, the importance of license plate image tilt correction is obvious.

目前已有的一些校正方法一般通过求得车牌的边框直线,然后计算倾斜角。但是车牌有其复杂性,一方面可能有的车牌边框并非标准的直线,另一方面定位算法得到的图像并非都有边框。此外,还有一些校正算法,要么就是计算耗时且校正率低,要么就是受图像背景干扰大。鉴于此,本发明从字符本身的特性出发,即字符在车牌中排列整齐,上下端点分别在两条直线上。针对基于字符连通域的倾斜校正算法进行优化研究,主要改进了伪连通域的去除方法和连通域的查找方法,使倾斜校正算法的鲁棒性得到提高,并成功应用于美国多个州的车牌识别中。Some existing correction methods generally obtain the border line of the license plate, and then calculate the inclination angle. However, the license plate has its complexity. On the one hand, the frame of the license plate may not be a standard straight line. On the other hand, the image obtained by the positioning algorithm does not have a frame. In addition, there are some correction algorithms, either the calculation is time-consuming and the correction rate is low, or they are greatly disturbed by the image background. In view of this, the present invention starts from the characteristics of the characters themselves, that is, the characters are arranged neatly in the license plate, and the upper and lower endpoints are respectively on two straight lines. Optimizing the skew correction algorithm based on character connected domains, mainly improving the removal method of pseudo-connected domains and the search method of connected domains, so that the robustness of the skew correction algorithm is improved, and it has been successfully applied to license plates in many states in the United States Identifying.

发明内容Contents of the invention

鉴于以上问题,本发明提出了一种车牌图像水平倾斜校正方法。In view of the above problems, the present invention proposes a method for correcting the horizontal inclination of the license plate image.

本发明的具体方案为:Concrete scheme of the present invention is:

一种车牌图像水平倾斜校正方法包括如下步骤:A method for correcting the horizontal inclination of a license plate image comprises the following steps:

1)在车牌边缘图像上查找所有连通域,连通域包含位置信息,将连通域映射到原始车牌图像上;1) Find all connected domains on the edge image of the license plate, the connected domains contain position information, and map the connected domains to the original license plate image;

2)从字符本身特性出发,从步骤1)查得的连通域中查找可信的字符连通域,查找可信的字符连通域的方法为先基于边缘图像查找可信的字符连通域,当基于边缘图像查找到的可信字符连通域的数量大于等于3时,进行后续步骤;当基于边缘图像查找到的可信字符连通域的数量小于3时,转向基于二值图像查找可信的字符连通域;2) Starting from the characteristics of the character itself, search for credible character connected domains from the connected domains found in step 1). The method of searching for credible character connected domains is to first search for credible character connected domains based on the edge image. When based on When the number of trusted character-connected domains found in the edge image is greater than or equal to 3, proceed to the next step; when the number of trusted character-connected domains found based on the edge image is less than 3, turn to finding credible character-connected domains based on the binary image area;

3)利用最小二乘法分别将上下边界点拟合成直线,并选择字符区域准确的上下边界点;3) Fitting the upper and lower boundary points into a straight line using the least squares method, and selecting the accurate upper and lower boundary points of the character area;

4)分别求得字符区域上下边界直线的斜率,求出旋转角度,并根据旋转角度计算出旋转之后字符区域的上下边界的位置。4) Obtain the slopes of the straight lines at the upper and lower boundaries of the character area, obtain the rotation angle, and calculate the positions of the upper and lower boundaries of the character area after rotation according to the rotation angle.

所述的字符特性为字符在车牌中排列整齐,上下端点分别在两条直线上。The characteristic of the characters is that the characters are neatly arranged in the license plate, and the upper and lower endpoints are respectively on two straight lines.

所述的基于边缘图像查找可信的字符连通域具体为:The credible character connected domain based on the edge image search is specifically:

a)判断两个连通域的高度、水平位置以及间距是否小于设定阈值,对小于设定阈值的两个连通域进行合并;a) judging whether the height, horizontal position and spacing of two connected domains are less than a set threshold, and merging the two connected domains which are less than the set threshold;

b)判断连通域的字符面积、字符高宽比,删除字符面积、字符高宽比不属于设定范围的连通域;b) judging the character area and character aspect ratio of the connected domain, and deleting the connected domain whose character area and character height-width ratio do not belong to the set range;

c)根据车牌字符都集中分布在某个高度范围内这一特点,删除孤立连通域;c) According to the characteristic that the license plate characters are concentrated in a certain height range, delete the isolated connected domain;

d)根据车牌字符本身字符高度基本保持一致这一特性,通过聚类分析得到连通域高度平均值,如果某个连通域高度与该平均值的差值大于设定阈值,则删除该连通域,否则保留该连通域;d) According to the characteristic that the character height of the license plate itself is basically consistent, the average height of the connected domain is obtained through cluster analysis. If the difference between the height of a connected domain and the average value is greater than the set threshold, the connected domain is deleted. Otherwise, keep the connected domain;

e)根据两两连通域中心点构成的直线的斜率,计算这些斜率之间差值的绝对值,根据差值绝对值大小,删除两端不满足条件的连通域;e) Calculate the absolute value of the difference between these slopes according to the slope of the straight line formed by the central points of the two connected domains, and delete the connected domains that do not meet the conditions at both ends according to the absolute value of the difference;

f)根据连通域的间距,大于3倍连通域平均宽度的连通域视为离群的连通域,删除离群的连通域。f) According to the distance between the connected domains, the connected domains greater than 3 times the average width of the connected domains are regarded as outlier connected domains, and the outlier connected domains are deleted.

所述的步骤c)具体为:设定一条直线L,从上往下扫描车牌边缘图像,找到直线L’,使其穿过连通域的个数最多,删除上边界在L’以下或者下边界在L’以上的连通域。The step c) is specifically as follows: set a straight line L, scan the edge image of the license plate from top to bottom, find the straight line L', make it pass through the largest number of connected domains, and delete the upper boundary below L' or the lower boundary Connected domains above L'.

所述的步骤e)具体为:第一个和倒数第二个连通域的中心构成的直线斜率为a,第二个和倒数第一个连通域中心点构成的直线斜率为b,计算abs(a-b)如果小于设定阈值,则视为满足条件;如果大于设定阈值,就认为两端有一个连通域需要删除,接着计算第一个和最后一个连通域中心点构成的直线斜率c,比较abs(a-c)和abs(b-c)的大小,如果abs(a-c)>abs(b-c),则删掉倒数第一个连通域,否则,删除第一个连通域;对剩余的连通域重复步骤e)的判断,直到满足条件为止。Described step e) is specifically: the slope of the straight line formed by the center of the first and the penultimate connected domain is a, the slope of the straight line formed by the second and the center point of the penultimate connected domain is b, and the calculation of abs( a-b) If it is less than the set threshold, it is considered to meet the condition; if it is greater than the set threshold, it is considered that there is a connected domain at both ends that needs to be deleted, and then calculate the slope c of the straight line formed by the center point of the first and last connected domain, and compare The size of abs(a-c) and abs(b-c), if abs(a-c)>abs(b-c), delete the penultimate connected domain, otherwise, delete the first connected domain; repeat step e for the remaining connected domains ) until the conditions are met.

所述的基于二值图像查找可信的字符连通域方法具体为:The method for finding credible character connected domains based on binary images is specifically:

A)在二值图像中查找所有连通域;A) Find all connected domains in the binary image;

B)判断两个连通域的高度、水平位置以及间距是否小于设定阈值,对小于设定阈值的两个连通域进行合并;B) judging whether the height, horizontal position and spacing of two connected domains are less than a set threshold, and merging the two connected domains smaller than the set threshold;

C)判断连通域的字符面积、字符高宽比,删除字符面积、字符高宽比不属于设定范围的连通域;C) judging the character area and character aspect ratio of the connected domain, and deleting the connected domain whose character area and character height-width ratio do not belong to the set range;

D)根据车牌字符都集中分布在某个高度范围内这一特点,设定一条直线H,从上往下扫描车牌二值图像,找到直线H’,使其穿过连通域的个数最多,删除上边界在H’以下或者下边界在H’以上的连通域;D) According to the feature that the characters of the license plate are concentrated in a certain height range, set a straight line H, scan the binary image of the license plate from top to bottom, find the straight line H', and make it pass through the largest number of connected domains. Delete the connected domain whose upper boundary is below H' or whose lower boundary is above H';

E)根据车牌字符本身字符高度基本保持一致这一特性,通过聚类分析得到连通域高度平均值,如果连通域高度与该平均值的差值大于设定阈值,则删除该连通域,否则保留该连通域;E) According to the characteristic that the character height of the license plate itself is basically consistent, the average height of the connected domain is obtained through cluster analysis. If the difference between the height of the connected domain and the average value is greater than the set threshold, the connected domain is deleted, otherwise it is retained. the connected domain;

F)根据两两连通域中心点构成的直线的斜率,计算这些斜率之间差值的绝对值,根据差值绝对值大小,删除两端不满足条件的连通域;F) Calculate the absolute value of the difference between these slopes according to the slope of the straight line formed by the central points of the connected domains, and delete the connected domains at both ends that do not meet the conditions according to the absolute value of the difference;

G)根据连通域的间距,大于3倍连通域平均宽度的连通域视为离群的连通域,删除离群的连通域。G) According to the distance between the connected domains, the connected domains greater than 3 times the average width of the connected domains are regarded as outlier connected domains, and the outlier connected domains are deleted.

H)如果在二值图像中找到的可信字符连通域数量满足条件,继续执行后续步骤;否则判断为车牌图像中不含车牌信息,并结束校正方法。H) If the number of credible connected domains of characters found in the binary image satisfies the condition, proceed to the subsequent steps; otherwise, it is judged that the license plate image does not contain license plate information, and the correction method is ended.

所述的步骤F)具体为:第一个和倒数第二个连通域的中心构成的直线斜率a,第二个和倒数第一个连通域中心点构成的直线斜率b,计算abs(a-b)如果小于设定阈值,则视为满足条件;如果大于设定阈值,就认为两端有一个连通域需要删除,接着计算第一个和最后一个连通域中心点构成的直线斜率c,比较abs(a-c)和abs(b-c)的大小,如果abs(a-c)>abs(b-c),则删掉最后一个连通域,否则,删除第一个连通域;对剩余的连通域重复步骤F)的判断,直到满足条件为止。The step F) is specifically: the slope a of the straight line formed by the center of the first and the penultimate connected domain, the slope b of the straight line formed by the second and the center point of the penultimate connected domain, and calculate abs(a-b) If it is less than the set threshold, it is considered to meet the condition; if it is greater than the set threshold, it is considered that there is a connected domain at both ends that needs to be deleted, and then calculate the slope c of the straight line formed by the center points of the first and last connected domains, and compare abs( The size of a-c) and abs(b-c), if abs(a-c)>abs(b-c), then delete the last connected domain, otherwise, delete the first connected domain; repeat the judgment of step F) for the remaining connected domains, until the conditions are met.

所述的步骤3)具体为:找到每个连通域的最高点和最低点,这些点视为连通域的上下边界点,对所有上下边界点分别用最小二乘法进行线性拟合,判断上下边界点中距离各自拟合直线最远的点离拟合直线的距离是否小于等于阈值,若小于等于阈值,则继续后续步骤,若大于阈值,则删除该最远的点,并对余下的点再次进行最小二乘法线性拟合,直到拟合后的最远的点距拟合直线的距离小于等于阈值,最终得到上下边界直线。Described step 3) specifically is: find the highest point and the lowest point of each connected domain, these points are regarded as the upper and lower boundary points of the connected domain, carry out linear fitting to all upper and lower boundary points respectively with the least squares method, judge the upper and lower boundaries Among the points, whether the distance between the point farthest from the respective fitting straight line and the fitting straight line is less than or equal to the threshold value, if it is less than or equal to the threshold value, continue to the next step, if it is greater than the threshold value, delete the farthest point, and repeat the remaining points Carry out linear fitting by the least squares method until the distance between the farthest point after fitting and the fitting line is less than or equal to the threshold, and finally obtain the upper and lower boundary lines.

所述的步骤4)中求出旋转角度具体为:如果上下边界直线的斜率的差值的绝对值小于设定阈值,那么将上下边界直线的斜率相加取平均值,得到车牌的旋转角度;否则选择保留边界点的个数最多的拟合直线的斜率来计算车牌的旋转角度。Finding the angle of rotation in the described step 4) is specifically: if the absolute value of the difference of the slope of the upper and lower boundary straight lines is less than the set threshold, then the slopes of the upper and lower boundary straight lines are added and averaged to obtain the rotation angle of the license plate; Otherwise, select the slope of the fitting line with the largest number of reserved boundary points to calculate the rotation angle of the license plate.

所述的根据旋转角度计算出旋转之后字符区域的上下边界的位置具体为:The position of the upper and lower boundaries of the character area after the rotation is calculated according to the rotation angle is specifically:

上边界位置的计算方法是选取位于上边界直线上端且距离拟合直线最近的点,根据得到的旋转角度,算出这个点在旋转后图像中的位置;The calculation method of the upper boundary position is to select the point located at the upper end of the upper boundary line and the closest to the fitting line, and calculate the position of this point in the rotated image according to the obtained rotation angle;

下边界位置计算方法是选取位于下边界直线下端且距离拟合直线最近的点,根据得到的旋转角度,算出这个点在旋转后图像中的位置;The calculation method of the lower boundary position is to select the point located at the lower end of the lower boundary line and the closest to the fitting line, and calculate the position of this point in the rotated image according to the obtained rotation angle;

其计算公式如下:Its calculation formula is as follows:

x=Xcosα-Ysinαx=Xcosα-Ysinα

y=Xsinα+Ycosαy=Xsinα+Ycosα

其中(X,Y)为距离拟合直线最近的点旋转之前的坐标,(x,y)为距离拟合直线最近的点旋转之后的坐标,α为旋转角度。Where (X, Y) is the coordinates of the point closest to the fitting line before rotation, (x, y) is the coordinates of the point closest to the fitting line after rotation, and α is the rotation angle.

本发明创新点在于从字符本身的特性出发,即字符在车牌中排列整齐,上下端点分别在两条直线上。通过查找每个字符连通域的上下边界点,利用最小二乘法分别将上下边界点拟合成两条直线,直线的斜率能反映出车牌倾斜的角度。此外,本发明改进了伪连通域的去处方法和连通域的查找方法,大大提高了倾斜校正算法的鲁棒性,并成功应用于美国多个州的车牌识别中。The innovation point of the present invention lies in starting from the characteristics of the characters themselves, that is, the characters are neatly arranged in the license plate, and the upper and lower endpoints are respectively on two straight lines. By finding the upper and lower boundary points of the connected domain of each character, the upper and lower boundary points are fitted into two straight lines using the least square method, and the slope of the straight line can reflect the angle of the license plate tilt. In addition, the invention improves the removal method of the pseudo-connected domain and the search method of the connected domain, greatly improves the robustness of the tilt correction algorithm, and is successfully applied to the license plate recognition of many states in the United States.

附图说明Description of drawings

图1(a)为车牌图像水平方向倾斜角α>0时的模型;Figure 1(a) is the model when the horizontal inclination angle of the license plate image is α>0;

图1(b)为车牌图像水平方向倾斜角α<0时的模型;Figure 1(b) is the model when the horizontal inclination angle of the license plate image is α<0;

图2(a)为车牌图像垂直方向倾斜角θ>0时的模型;Figure 2(a) is the model when the license plate image has a vertical tilt angle θ>0;

图2(b)为车牌图像垂直方向倾斜角θ<0时的模型;Figure 2(b) is the model when the license plate image is tilted vertically at an angle θ<0;

图3所示为车牌中字符区域的顶部边界点和底部边界点;Figure 3 shows the top boundary point and the bottom boundary point of the character area in the license plate;

图4所示为运用最小二乘法分别对车牌中字符顶部和底部边界点进行直线拟合;Figure 4 shows that the least squares method is used to carry out straight line fitting to the top and bottom boundary points of the characters in the license plate;

图5(a)为车牌灰度图像G1;Figure 5(a) is the license plate grayscale image G1;

图5(b)为直方图均衡化后的车牌图像;Figure 5(b) is the license plate image after histogram equalization;

图5(c)为高斯滤波平滑后的车牌图像;Fig. 5 (c) is the license plate image after Gaussian filter smoothing;

图5(d)为拉普拉斯锐化后的车牌图像G2;Figure 5(d) is the license plate image G2 sharpened by Laplace;

图5(e)车牌二值化图像B1;Figure 5(e) license plate binarized image B1;

图5(f)为车牌Canny边缘检测图像C1;Figure 5(f) is the Canny edge detection image C1 of the license plate;

图6(a)为连通域映射到原始图像;Figure 6(a) maps the connected domain to the original image;

图6(b)字符“X”内的连通域被合并;Figure 6(b) The connected domains within the character "X" are merged;

图6(c)不合法连通域被删除;Figure 6(c) The illegal connected domain is deleted;

图6(d)为字符“8”内的连通域被删除;Figure 6(d) shows that the connected domain in the character "8" is deleted;

图6(e)为字符“H”、“2”内的连通域被删除;Figure 6(e) shows that the connected domains in the characters "H" and "2" are deleted;

图6(f)删除最后一个连通域前的车牌图像;Figure 6(f) deletes the license plate image before the last connected domain;

图6(g)删除最后一个连通域后的车牌图像;Figure 6(g) The license plate image after deleting the last connected domain;

图6(h)删除最右边离群连通域前的车牌图像;Figure 6(h) deletes the license plate image before the rightmost outlier connected domain;

图6(i)删除最右边离群连通域后的车牌图像;Figure 6(i) License plate image after removing the rightmost outlier connected domain;

图7(a)为车牌边缘图像;图7(b)为基于边缘图像检测到的连通域映射到原始图像;Figure 7(a) is the license plate edge image; Figure 7(b) is the connected domain detected based on the edge image mapped to the original image;

图7(c)为检测到的两个合法连通域映射在原始图像上;Figure 7(c) maps the detected two legitimate connected domains on the original image;

图7(d)车牌二值图像;Figure 7(d) binary image of the license plate;

图7(e)为基于二值图像检测到的连通域映射到原始图像;Figure 7(e) is the mapping of the connected domain detected based on the binary image to the original image;

图7(f)为检测到的合法连通域映射到原始图像上;Figure 7(f) maps the detected legal connected domains to the original image;

图8(a)为对每个连通域的最高点和最低点分别用最小二乘法进行线性拟合后的车牌图像;Figure 8(a) is the license plate image after linear fitting of the highest point and the lowest point of each connected domain with the least square method;

图8(b)为删除字符“6”上端和下端的点后的车牌图像;Figure 8(b) is the license plate image after deleting the upper and lower points of the character "6";

图9(a)为对剩余上下边界点分别用最小二乘法进行线性拟合后的车牌图像;Fig. 9 (a) is the license plate image after linear fitting is carried out to the remaining upper and lower boundary points respectively with the least squares method;

图9(b)为车牌水平倾斜校正后的图像;Figure 9(b) is the image after horizontal tilt correction of the license plate;

图10所示为图像水平倾斜校正算法流程图。Figure 10 is a flow chart of the image horizontal tilt correction algorithm.

具体实施方式Detailed ways

车牌区域倾斜的方向有两种情况:水平倾斜,如图1;垂直倾斜,如图2。图1中,只有倾斜区域轴线X’与水平轴线X之间的夹角α是未知的,一旦求得夹角α,整个车牌图像只需旋转-α,就能校正。图2中,只有垂直方向上的夹角θ未知。在实际应用中,大部分车牌中同时存在着两种方向上的倾斜。因此,首先校正水平方向上的倾斜,再校正垂直方向上的倾斜。本发明中的算法只涉及到水平方向上的校正。There are two situations for the tilt direction of the license plate area: horizontal tilt, as shown in Figure 1; vertical tilt, as shown in Figure 2. In Figure 1, only the angle α between the axis X' of the inclined area and the horizontal axis X is unknown. Once the angle α is obtained, the entire license plate image can be corrected by only rotating -α. In Figure 2, only the angle θ in the vertical direction is unknown. In practical applications, there are two kinds of inclinations in most license plates at the same time. Therefore, the inclination in the horizontal direction is corrected first, and then the inclination in the vertical direction is corrected. The algorithm in the present invention only involves corrections in the horizontal direction.

车牌中字符的颜色是一样或是接近的,所以在车牌的二值图像中,一个完整独立的字符将成为一个连通域。另一方面,由于字符颜色与背景颜色之间存在着相对较高的对比,字符的边缘可以通过边缘提取算法得到,如Canny算法。完整的字符边缘也是一个连通域。可以利用一些策略,仅保留字符的连通域。前文提到,在车牌图像中,字符区域的顶部边界点和底部边界点(称作特征点)可以反映出字符区域的倾斜趋势,如图3。获取这些字符区域的顶部边界点和底部边界点后,用最小二乘法分别对顶部边界点和底部边界点进行直线拟合,从而可以求得牌照水平方向上的倾斜角,如图4。因此,从这些点分布的趋势可以得到车牌倾斜角度信息。The colors of the characters in the license plate are the same or close, so in the binary image of the license plate, a complete independent character will become a connected domain. On the other hand, due to the relatively high contrast between the character color and the background color, the edge of the character can be obtained by an edge extraction algorithm, such as the Canny algorithm. A complete character edge is also a connected domain. Some strategies can be exploited to keep only the connected domains of characters. As mentioned above, in the license plate image, the top boundary points and bottom boundary points (called feature points) of the character area can reflect the inclination trend of the character area, as shown in Figure 3. After obtaining the top boundary points and bottom boundary points of these character areas, the least squares method is used to fit the top boundary points and bottom boundary points respectively, so that the inclination angle in the horizontal direction of the license plate can be obtained, as shown in Figure 4. Therefore, license plate tilt angle information can be obtained from the distribution trend of these points.

以处理车牌灰度图像G1(见图5(a))为实例,阐述具体实施方案。在倾斜校正之前,需要对车牌灰度图像进行一些预处理操作。预处理操作包括直方图均衡化(见图5(b)),用高斯平滑滤波器(大小5x5,δ=1.1)滤波(见图5(c)),接着进行基于二阶微分的拉普拉斯锐化操作(见图5(d))。三步预处理操作之后,得到一副车牌灰度图像G2。观察发现,灰度图像G2或多或少抵抗了噪声,其中的边缘信息也得到了增强。最后,得到二值化图像B1(见图5(e))以及Canny边缘检测图像C1(见图5(f))。在B1中,字符为白色,背景为黑色。同样,在C1中,边缘为白色,背景为黑色。Taking the processing of the license plate grayscale image G1 (see Figure 5(a)) as an example, the specific implementation is described. Before tilt correction, some preprocessing operations are required on the license plate grayscale image. Preprocessing operations include histogram equalization (see Fig. 5(b)), filtering with a Gaussian smoothing filter (size 5x5, δ = 1.1) (see Fig. 5(c)), followed by second-order differential-based Laplac Adams sharpening operation (see Figure 5(d)). After the three-step preprocessing operation, a license plate grayscale image G2 is obtained. It is observed that the grayscale image G2 is more or less resistant to noise, and the edge information in it has also been enhanced. Finally, a binarized image B1 (see Figure 5(e)) and a Canny edge detection image C1 (see Figure 5(f)) are obtained. In B1, the characters are white and the background is black. Also, in C1, the edges are white and the background is black.

车牌图像水平倾斜校正具体步骤如下:The specific steps of license plate image horizontal tilt correction are as follows:

(1)在车牌边缘图像上查找所有连通域,连通域包含了位置信息,将连通域映射到原始图像上,如图6(a)所示。(1) Find all connected domains on the edge image of the license plate. The connected domains contain position information, and map the connected domains to the original image, as shown in Figure 6(a).

(2)基于边缘图像查找可信的字符连通域,主要有以下几个步骤:(2) Searching for credible character-connected domains based on edge images mainly includes the following steps:

1)合并分离的字符连通域,因为有些字符如“M”、“X”、“H”可能出现中1) Merge separated connected domains of characters, because some characters such as "M", "X", and "H" may appear in the middle

间断裂被分割成两部分,为了尽可能多地保留连通域,需要对这些可能分离的字符连通域进行合并,合并原则是判断两个连通域是否满足高度相近、上边界在同一水平位置及间距小于某个阈值。如图6(b)所示,字符“X”内的连通域被合并。The inter-connected domain is divided into two parts. In order to retain as many connected domains as possible, it is necessary to merge these possibly separated character connected domains. The principle of merging is to judge whether the two connected domains meet the requirements of similar height, upper boundary at the same horizontal position and spacing less than a certain threshold. As shown in Figure 6(b), the connected domains within the character “X” are merged.

2)删除不合法连通域,通过一些先验知识,比如字符面积、字符宽高比来删除不满足条件的连通域,得到图6(c),可以看出大部分不合法连通域被删除。2) Delete the illegal connected domains, delete the connected domains that do not meet the conditions through some prior knowledge, such as character area and character width-to-height ratio, and get Figure 6(c), it can be seen that most of the illegal connected domains have been deleted.

3)删除孤立连通域,车牌字符的分布有一定特点,那就是车牌字符都集中分布在某个高度范围内,因此如图6(c)所示,设定一条红线L,从上往下扫描图像找到穿过L连通域个数最多的那个位置,删除那些上边界在L以下或者下边界在L以上的连通域,如图6(d),字符“8”内的连通域被删除。3) Delete the isolated connected domain, the distribution of license plate characters has certain characteristics, that is, the license plate characters are concentrated in a certain height range, so as shown in Figure 6(c), set a red line L and scan from top to bottom The image finds the position with the largest number of connected domains passing through L, and deletes those connected domains whose upper boundary is below L or whose lower boundary is above L. As shown in Figure 6(d), the connected domains in the character "8" are deleted.

4)删除高度不合法的连通域,车牌字符的高度基本保持一致,通过聚类分析得到连通域高度平均值avgHeight,删除和avgHeight相差较大的连通域,如图6(e)所示,字符“H”、“2”内的连通域被删除。4) Delete the connected domains with illegal heights, the height of the license plate characters is basically consistent, and obtain the average height avgHeight of the connected domains through cluster analysis, delete the connected domains with a large difference from avgHeight, as shown in Figure 6(e), the character Connected domains within "H", "2" are deleted.

5)删除两端不满足条件的连通域,条件是第一个和倒数第二个连通域的中心构成的直线斜率a,第二个和倒数第一个连通域中心点构成的直线斜率b,计算abs(a-b)如果大于某一个阈值,就认为两端有一个连通域需要删除,接着计算第一个和最后一个连通域中心点构成的直线斜率c,比较abs(a-c)和abs(b-c)的大小,如果abs(a-c)>abs(b-c),则删掉最后一个连通域;否则,删除第一个连通域。如图6(f)最后一个连通域被删除,得到图6(g)。5) Delete the connected domains that do not meet the conditions at both ends, the condition is the slope a of the straight line formed by the center of the first and the penultimate connected domain, the slope b of the straight line formed by the second and the center point of the penultimate connected domain, If the calculation abs(a-b) is greater than a certain threshold, it is considered that there is a connected domain at both ends that needs to be deleted, and then calculate the slope c of the straight line formed by the center points of the first and last connected domains, and compare abs(a-c) and abs(b-c) The size of , if abs(a-c)>abs(b-c), delete the last connected domain; otherwise, delete the first connected domain. As shown in Figure 6(f), the last connected domain is deleted, and Figure 6(g) is obtained.

6)删除离群的连通域,通过判断连通域的间距,如果大于3倍的连通域平均宽度avgWidth说明是离群点,如图6(h)所示存在最右边的离群连通域,删除得到图6(i)。6) Delete the connected domain of the outlier. By judging the distance of the connected domain, if the average width avgWidth of the connected domain is greater than 3 times, it means that it is an outlier point. As shown in Figure 6(h), there is an outlier connected domain on the far right, delete Figure 6(i) is obtained.

(3)基于二值图像查找可信的字符连通域。某些情况下,Canny边缘检测的效果并不好,如图7(a)、(b)所示,可能导致查找到的合法的连通域个数很少,甚至没有,如图7(c)所示,只有两个合法的连通域,无法进行倾斜校正,这时我们可以转向查找二值图像的连通域。因此,当Canny边缘图像的合法的连通域个数小于3时,直接转向用步骤(2)中所述查找可信的字符连通域的方法在二值图像中查找可信连通域,而且自适应调节二值化阈值,使其在设置阈值的倍数分别为{0.3,0.5,0.6,0.8,1.5,1.7,1.9,2.1}这一范围内变换,直到在二值图像中找到的合法连通域数量满足条件,继续执行后续步骤;否则判断为图像中不含车牌信息,并结束校正算法。如图7(d)是二值图像,所有的连通域如图7(e)所示,最后剩下的合法的连通域有3个,满足条件,如图7(f)所示。(3) Find credible character-connected domains based on binary images. In some cases, the effect of Canny edge detection is not good, as shown in Figure 7(a), (b), which may result in the finding of a small number of legitimate connected domains, or even no, as shown in Figure 7(c) As shown, there are only two legal connected domains, and skew correction cannot be performed. At this time, we can turn to find the connected domain of the binary image. Therefore, when the number of legal connected domains of the Canny edge image is less than 3, directly turn to the method of finding trusted connected domains of characters described in step (2) to find trusted connected domains in the binary image, and adaptive Adjust the binarization threshold so that the multiples of the threshold are {0.3, 0.5, 0.6, 0.8, 1.5, 1.7, 1.9, 2.1}, until the number of legitimate connected domains found in the binary image If the conditions are met, proceed to the subsequent steps; otherwise, it is judged that the image does not contain license plate information, and the correction algorithm is ended. Figure 7(d) is a binary image, all connected domains are shown in Figure 7(e), and there are 3 remaining legal connected domains, which meet the conditions, as shown in Figure 7(f).

(4)计算倾斜校正的旋转角度,寻找字符区域的上下边界。如图8(a)所示,找到每个连通域的最高点和最低点,对所有上端和下端的点分别用最小二乘法进行线性拟合,并删除掉离拟合直线最远的点,直到这个最远距离小于某一个阈值,停止删除。如图8(b)所示,删除字符“6”的上端和下端的点。其中连通域上下边界点的查找方法如下:(4) Calculate the rotation angle of the tilt correction, and find the upper and lower boundaries of the character area. As shown in Figure 8(a), find the highest point and the lowest point of each connected domain, use the least square method to perform linear fitting on all the upper and lower points, and delete the point farthest from the fitting line, Until the farthest distance is less than a certain threshold, stop deleting. As shown in FIG. 8(b), the dots at the upper and lower ends of the character "6" are deleted. The search method of the upper and lower boundary points of the connected domain is as follows:

2)假设第一个字符连通域表示为Rs(x0,y0,w0,h0),其中(x0,y0)表示连通域Rs左上方点的坐标,(w0,h0)表示连通域Rs的宽和高;假设最后一个连通域表示为Re(x1,y1,w1,h1),其中(x1,y1)表示连通域Re左上方点的坐标,(w1,h1)表示连通域Re的宽和高。在连通域Rs左边界选择一个点P0(x,y),其中x=x0,y=y0+h0*0.1,并且在连通域Re左边界选择一个点P1(x’,y’),其中x’=x1,y’=y1+h1*0.1。因此可以由这两点得到一条上边界搜索线Lu,如图8(a)所示。相类似地,在连通域Rs左边界选择一点P2(x2,y2),其中x2=x0,y2=y0+h1*0,9;并且在连通域Re左边界选择一个点P3(x2’,y2’),其中x2’=x0,y2’=y0+h1*0.9。因此可以由这两点得到一条下边界搜索先Lb,如图8(a)所示。2) Assume that the first character connected domain is expressed as Rs(x0, y0, w0, h0), where (x0, y0) represents the coordinates of the upper left point of the connected domain Rs, and (w0, h0) represents the width and sum of the connected domain Rs High; suppose the last connected domain is expressed as Re(x1, y1, w1, h1), where (x1, y1) indicates the coordinates of the upper left point of the connected domain Re, and (w1, h1) indicates the width and height of the connected domain Re. Select a point P0(x,y) on the left boundary of the connected domain Rs, where x=x0, y=y0+h0*0.1, and select a point P1(x',y') on the left boundary of the connected domain Re, where x '=x1,y'=y1+h1*0.1. Therefore, an upper boundary search line Lu can be obtained from these two points, as shown in Figure 8(a). Similarly, select a point P2(x2,y2) on the left boundary of the connected domain Rs, where x2=x0,y2=y0+h1*0,9; and select a point P3(x2',y2 on the left boundary of the connected domain Re '), where x2'=x0, y2'=y0+h1*0.9. Therefore, a lower boundary search Lb can be obtained from these two points, as shown in Figure 8(a).

2)分别跟踪在Lu和Lb上的每一个白色点。假设点p是Lu上的一个白色点,向上搜索可以得到一个和点p同一连通域的最高点ph。因此,每一个连通域的最高点可以由Lu搜索得到。所有这些点可以组成一个上边界点集,表示为Sup,如图8(b)所示。同样地,每个连通域的最低点可以由Lb向下搜索获得,所有这些点构成为下边界点集,表示为Sbtm,见图8(b)。2) Track each white point on Lu and Lb separately. Assuming point p is a white point on Lu, searching upwards can get the highest point ph in the same connected domain as point p. Therefore, the highest point of each connected domain can be obtained by Lu search. All these points can form an upper boundary point set, denoted as Sup, as shown in Fig. 8(b). Similarly, the lowest point of each connected domain can be obtained by searching downward through Lb, and all these points form the lower boundary point set, denoted as Sbtm, see Figure 8(b).

3)删除点集Sup和Sbtm中不满足条件的点。如图8(b)所示,一些点不属于任意字符连通域,但满足了上述边界点的条件。此外,字符的断裂也会影响到边界点的查找。为保证边界线斜率能精确反映出车牌的倾斜角信息,这些不属于任意字符连通域的点必须被删除。删除这些点的具体步骤如下:i)根据最小二乘法,用直线L1拟合这些点;ii)计算出这些点到直线L1距离的平均值和方差;iii)当距离的平均值大于某一阈值时,删除那些到L1距离最大的点;iv)返回执行步骤i),直到平均值小于某一阈值。因此,剩下的点是符合条件的上下边界点。3) Delete the points that do not meet the conditions in the point sets Sup and Sbtm. As shown in Fig. 8(b), some points do not belong to the connected domain of arbitrary characters, but satisfy the above conditions of boundary points. In addition, character breaks will also affect the search for boundary points. In order to ensure that the slope of the boundary line can accurately reflect the slope angle information of the license plate, these points that do not belong to the connected domain of any characters must be deleted. The specific steps to delete these points are as follows: i) According to the least square method, use the straight line L1 to fit these points; ii) Calculate the average and variance of the distance from these points to the straight line L1; iii) When the average value of the distance is greater than a certain threshold , delete those points with the largest distance to L1; iv) return to step i), until the average value is less than a certain threshold. Therefore, the remaining points are eligible upper and lower boundary points.

4)利用最小二乘法将Sup和Sbtm中剩余的点拟合成直线,并选择字符区域准确的上下边界点。将上下边界点分别拟合成直线L1和L2,如图9(a)所示。可以计算得到L1和L2的直线斜率,表示为ku和kb。如果上下两个斜率的差值的绝对值小于某一个阈值,那么将上下两个斜率相加取平均值,得到车牌的旋转角度,否则通过比较保留点的个数、斜率大小等条件选择较优的斜率以计算车牌的旋转角度。得到旋转角度的同时,还要得到车牌字符区域的上下边界,上边界的得到方法是选取位于拟合直线上端且距离拟合直线最近的点,然后根据得到的旋转角度,算出这个点在旋转后图像中的坐标,这个值就是上边界的值,同样下边界的得到方法是选取位于拟合直线下端且距离拟合直线最近的点,然后根据得到的旋转角度,算出这个点在旋转后图像中的坐标,这个值就是下边界的值。其计算公式如下:4) Use the least square method to fit the remaining points in Sup and Sbtm into a straight line, and select the accurate upper and lower boundary points of the character area. Fit the upper and lower boundary points into straight lines L1 and L2, respectively, as shown in Figure 9(a). The slopes of the straight lines of L1 and L2 can be calculated, expressed as ku and kb. If the absolute value of the difference between the upper and lower slopes is less than a certain threshold, then add the upper and lower slopes and take the average value to obtain the rotation angle of the license plate. to calculate the rotation angle of the license plate. While obtaining the rotation angle, it is also necessary to obtain the upper and lower boundaries of the license plate character area. The method of obtaining the upper boundary is to select the point that is located at the upper end of the fitting line and the point closest to the fitting line, and then calculate the rotation angle of this point according to the obtained rotation angle. The coordinates in the image, this value is the value of the upper boundary, and the method of obtaining the lower boundary is to select the point at the lower end of the fitting line and the closest point to the fitting line, and then calculate the position of this point in the rotated image according to the obtained rotation angle The coordinates of , this value is the value of the lower boundary. Its calculation formula is as follows:

x=Xcosα-Ysinαx=Xcosα-Ysinα

y=Xsinα+Ycosαy=Xsinα+Ycosα

其中(X,Y)为边界点旋转之前的坐标,(x,y)为边界点旋转之后的坐标,α为旋转角度。Where (X, Y) is the coordinates before the boundary point rotation, (x, y) is the coordinates after the boundary point rotation, and α is the rotation angle.

(5)求出旋转角度后,根据这个角度对车牌进行旋转,同时也得到字符区域的上下边界,如图9(b)所示。(5) After obtaining the rotation angle, the license plate is rotated according to this angle, and the upper and lower boundaries of the character area are also obtained, as shown in Figure 9(b).

Claims (10)

1.一种车牌图像水平倾斜校正方法,其特征在于,包括如下步骤:1. a license plate image horizontal tilt correction method, is characterized in that, comprises the steps: 1)在车牌边缘图像上查找所有连通域,连通域包含位置信息,将连通域映射到原始车牌图像上;1) Find all connected domains on the edge image of the license plate, the connected domains contain position information, and map the connected domains to the original license plate image; 2)从字符本身特性出发,从步骤1)查得的连通域中查找可信的字符连通域,查找可信的字符连通域的方法为先基于边缘图像查找可信的字符连通域,当基于边缘图像查找到的可信字符连通域的数量大于等于3时,进行后续步骤;当基于边缘图像查找到的可信字符连通域的数量小于3时,转向基于二值图像查找可信的字符连通域;2) Starting from the characteristics of the character itself, search for credible character connected domains from the connected domains found in step 1). The method of searching for credible character connected domains is to first search for credible character connected domains based on the edge image. When based on When the number of trusted character-connected domains found in the edge image is greater than or equal to 3, proceed to the next step; when the number of trusted character-connected domains found based on the edge image is less than 3, turn to finding credible character-connected domains based on the binary image area; 3)利用最小二乘法分别将上下边界点拟合成直线,并选择字符区域准确的上下边界点;3) Fitting the upper and lower boundary points into a straight line using the least squares method, and selecting the accurate upper and lower boundary points of the character area; 4)分别求得字符区域上下边界直线的斜率,求出旋转角度,并根据旋转角度计算出旋转之后字符区域的上下边界的位置。4) Obtain the slopes of the straight lines at the upper and lower boundaries of the character area, obtain the rotation angle, and calculate the positions of the upper and lower boundaries of the character area after rotation according to the rotation angle. 2.如权利要求1所述的车牌图像水平倾斜校正方法,其特征在于所述的字符特性为字符在车牌中排列整齐,上下端点分别在两条直线上。2. The method for correcting the horizontal inclination of the license plate image as claimed in claim 1, wherein the character characteristic is that the characters are arranged neatly in the license plate, and the upper and lower endpoints are respectively on two straight lines. 3.如权利要求1所述的车牌图像水平倾斜校正方法,其特征在于所述的基于边缘图像查找可信的字符连通域具体为:3. The license plate image horizontal inclination correction method as claimed in claim 1, is characterized in that described based on edge image search credible character connected domain is specifically: a)判断两个连通域的高度、水平位置以及间距是否小于设定阈值,对小于设定阈值的两个连通域进行合并;a) judging whether the height, horizontal position and spacing of two connected domains are less than a set threshold, and merging the two connected domains which are less than the set threshold; b)判断连通域的字符面积、字符高宽比,删除字符面积、字符高宽比不属于设定范围的连通域;b) judging the character area and character aspect ratio of the connected domain, and deleting the connected domain whose character area and character height-width ratio do not belong to the set range; c)根据车牌字符都集中分布在某个高度范围内这一特点,删除孤立连通域;c) According to the characteristic that the license plate characters are concentrated in a certain height range, delete the isolated connected domain; d)根据车牌字符本身字符高度基本保持一致这一特性,通过聚类分析得到连通域高度平均值,如果某个连通域高度与该平均值的差值大于设定阈值,则删除该连通域,否则保留该连通域;d) According to the characteristic that the character height of the license plate itself is basically consistent, the average height of the connected domain is obtained through cluster analysis. If the difference between the height of a connected domain and the average value is greater than the set threshold, the connected domain is deleted. Otherwise, keep the connected domain; e)根据两两连通域中心点构成的直线的斜率,计算这些斜率之间差值的绝对值,根据差值绝对值大小,删除两端不满足条件的连通域;e) Calculate the absolute value of the difference between these slopes according to the slope of the straight line formed by the central points of the two connected domains, and delete the connected domains that do not meet the conditions at both ends according to the absolute value of the difference; f)根据连通域的间距,大于3倍连通域平均宽度的连通域视为离群的连通域,删除离群的连通域。f) According to the distance between the connected domains, the connected domains greater than 3 times the average width of the connected domains are regarded as outlier connected domains, and the outlier connected domains are deleted. 4.如权利要求3所述的车牌图像水平倾斜校正方法,其特征在于所述的步骤c)具体为:设定一条直线L,从上往下扫描车牌边缘图像,找到直线L’,使其穿过连通域的个数最多,删除上边界在L’以下或者下边界在L’以上的连通域。4. The method for correcting the horizontal inclination of the license plate image as claimed in claim 3, wherein said step c) is specifically: setting a straight line L, scanning the edge image of the license plate from top to bottom, finding the straight line L', making it The number of connected domains passing through is the largest, and the connected domains whose upper boundary is below L' or whose lower boundary is above L' are deleted. 5.如权利要求3所述的车牌图像水平倾斜校正方法,其特征在于所述的步骤e)具体为:第一个和倒数第二个连通域的中心构成的直线斜率为a,第二个和倒数第一个连通域中心点构成的直线斜率为b,计算abs(a-b)如果小于设定阈值,则视为满足条件;如果大于设定阈值,就认为两端有一个连通域需要删除,接着计算第一个和最后一个连通域中心点构成的直线斜率c,比较abs(a-c)和abs(b-c)的大小,如果abs(a-c)>abs(b-c),则删掉倒数第一个连通域,否则,删除第一个连通域;对剩余的连通域重复步骤e)的判断,直到满足条件为止。5. The horizontal inclination correction method of license plate image as claimed in claim 3, characterized in that said step e) is specifically: the slope of the straight line formed by the center of the first and the penultimate connected domain is a, and the slope of the second one is a. The slope of the straight line formed with the center point of the penultimate connected domain is b. If the calculated abs(a-b) is less than the set threshold, the condition is considered satisfied; if it is greater than the set threshold, it is considered that there is a connected domain at both ends that needs to be deleted. Then calculate the slope c of the straight line formed by the center points of the first and last connected domains, compare the size of abs(a-c) and abs(b-c), if abs(a-c)>abs(b-c), delete the last one connected Otherwise, delete the first connected domain; repeat the judgment of step e) for the remaining connected domains until the condition is met. 6.如权利要求2所述的车牌图像水平倾斜校正方法,其特征在于所述的基于二值图像查找可信的字符连通域方法具体为:6. The license plate image horizontal inclination correction method as claimed in claim 2, characterized in that the method for finding credible character connected domains based on binary images is specifically: A)在二值图像中查找所有连通域;A) Find all connected domains in the binary image; B)判断两个连通域的高度、水平位置以及间距是否小于设定阈值,对小于设定阈值的两个连通域进行合并;B) judging whether the height, horizontal position and spacing of two connected domains are less than a set threshold, and merging the two connected domains smaller than the set threshold; C)判断连通域的字符面积、字符高宽比,删除字符面积、字符高宽比不属于设定范围的连通域;C) judging the character area and character aspect ratio of the connected domain, and deleting the connected domain whose character area and character height-width ratio do not belong to the set range; D)根据车牌字符都集中分布在某个高度范围内这一特点,设定一条直线H,从上往下扫描车牌二值图像,找到直线H’,使其穿过连通域的个数最多,删除上边界在H’以下或者下边界在H’以上的连通域;D) According to the feature that the characters of the license plate are concentrated in a certain height range, set a straight line H, scan the binary image of the license plate from top to bottom, find the straight line H', and make it pass through the largest number of connected domains. Delete the connected domain whose upper boundary is below H' or whose lower boundary is above H'; E)根据车牌字符本身字符高度基本保持一致这一特性,通过聚类分析得到连通域高度平均值,如果连通域高度与该平均值的差值大于设定阈值,则删除该连通域,否则保留该连通域;E) According to the characteristic that the character height of the license plate itself is basically consistent, the average height of the connected domain is obtained through cluster analysis. If the difference between the height of the connected domain and the average value is greater than the set threshold, the connected domain is deleted, otherwise it is retained. the connected domain; F)根据两两连通域中心点构成的直线的斜率,计算这些斜率之间差值的绝对值,根据差值绝对值大小,删除两端不满足条件的连通域;F) Calculate the absolute value of the difference between these slopes according to the slope of the straight line formed by the central points of the connected domains, and delete the connected domains at both ends that do not meet the conditions according to the absolute value of the difference; G)根据连通域的间距,大于3倍连通域平均宽度的连通域视为离群的连通域,删除离群的连通域;G) According to the distance of the connected domain, the connected domain greater than 3 times the average width of the connected domain is regarded as the connected domain of the outlier, and the connected domain of the outlier is deleted; H)如果在二值图像中找到的可信字符连通域数量满足条件,继续执行后续步骤;否则判断为车牌图像中不含车牌信息,并结束校正方法。H) If the number of credible connected domains of characters found in the binary image satisfies the condition, proceed to the subsequent steps; otherwise, it is judged that the license plate image does not contain license plate information, and the correction method is ended. 7.如权利要求6所述的车牌图像水平倾斜校正方法,其特征在于所述的步骤F)具体为:第一个和倒数第二个连通域的中心构成的直线斜率a,第二个和倒数第一个连通域中心点构成的直线斜率b,计算abs(a-b)如果小于设定阈值,则视为满足条件;如果大于设定阈值,就认为两端有一个连通域需要删除,接着计算第一个和最后一个连通域中心点构成的直线斜率c,比较abs(a-c)和abs(b-c)的大小,如果abs(a-c)>abs(b-c),则删掉最后一个连通域,否则,删除第一个连通域;对剩余的连通域重复步骤F)的判断,直到满足条件为止。7. The license plate image horizontal inclination correction method as claimed in claim 6, characterized in that said step F) is specifically: the slope a of the straight line formed by the center of the first and the penultimate connected domain, the second and The slope b of the straight line formed by the center point of the penultimate connected domain, if the calculated abs(a-b) is less than the set threshold, it is considered to meet the condition; if it is greater than the set threshold, it is considered that there is a connected domain at both ends that needs to be deleted, and then calculate The slope c of the straight line formed by the center points of the first and last connected domain, compare the size of abs(a-c) and abs(b-c), if abs(a-c)>abs(b-c), delete the last connected domain, otherwise, Delete the first connected domain; repeat the judgment of step F) for the remaining connected domains until the condition is met. 8.如权利要求1所述的车牌图像水平倾斜校正方法,其特征在于所述的步骤3)具体为:找到每个连通域的最高点和最低点,这些点视为连通域的上下边界点,对所有上下边界点分别用最小二乘法进行线性拟合,判断上下边界点中距离各自拟合直线最远的点离拟合直线的距离是否小于等于阈值,若小于等于阈值,则继续后续步骤,若大于阈值,则删除该最远的点,并对余下的点再次进行最小二乘法线性拟合,直到拟合后的最远的点距拟合直线的距离小于等于阈值,最终得到上下边界直线。8. The license plate image horizontal tilt correction method as claimed in claim 1, characterized in that said step 3) is specifically: find the highest point and the lowest point of each connected domain, these points are regarded as the upper and lower boundary points of the connected domain , use the least squares method to linearly fit all the upper and lower boundary points, and judge whether the distance between the upper and lower boundary points and the farthest point from the respective fitting straight line is less than or equal to the threshold value, if it is less than or equal to the threshold value, continue to the next step , if it is greater than the threshold, delete the farthest point, and perform least squares linear fitting on the remaining points again until the distance between the farthest point after fitting and the fitting line is less than or equal to the threshold, and finally get the upper and lower boundaries straight line. 9.如权利要求1所述的车牌图像水平倾斜校正方法,其特征在于所述的步骤4)中求出旋转角度具体为:如果上下边界直线的斜率的差值的绝对值小于设定阈值,那么将上下边界直线的斜率相加取平均值,得到车牌的旋转角度;否则选择保留边界点的个数最多的拟合直线的斜率来计算车牌的旋转角度。9. The license plate image horizontal inclination correction method as claimed in claim 1, is characterized in that in the described step 4), finding the angle of rotation is specifically: if the absolute value of the difference of the slope of the upper and lower boundary straight lines is less than the set threshold, Then add the slopes of the upper and lower boundary lines and take the average value to obtain the rotation angle of the license plate; otherwise, select the slope of the fitting line with the largest number of boundary points to calculate the rotation angle of the license plate. 10.如权利要求1所述的车牌图像水平倾斜校正方法,其特征在于所述的根据旋转角度计算出旋转之后字符区域的上下边界的位置具体为:10. The method for correcting the horizontal inclination of the license plate image as claimed in claim 1, wherein the position of the upper and lower boundaries of the character area after the rotation is calculated according to the rotation angle is specifically: 上边界位置的计算方法是选取位于上边界直线上端且距离拟合直线最近的点,根据得到的旋转角度,算出这个点在旋转后图像中的位置;The calculation method of the upper boundary position is to select the point located at the upper end of the upper boundary line and the closest to the fitting line, and calculate the position of this point in the rotated image according to the obtained rotation angle; 下边界位置计算方法是选取位于下边界直线下端且距离拟合直线最近的点,根据得到的旋转角度,算出这个点在旋转后图像中的位置;The calculation method of the lower boundary position is to select the point located at the lower end of the lower boundary line and the closest to the fitting line, and calculate the position of this point in the rotated image according to the obtained rotation angle; 其计算公式如下:Its calculation formula is as follows: x=Xcosα-Ysinαx=Xcosα-Ysinα y=Xsinα+Ycosαy=Xsinα+Ycosα 其中(X,Y)为距离拟合直线最近的点旋转之前的坐标,(x,y)为距离拟合直线最近的点旋转之后的坐标,α为旋转角度。Where (X, Y) is the coordinates of the point closest to the fitting line before rotation, (x, y) is the coordinates of the point closest to the fitting line after rotation, and α is the rotation angle.
CN201410561462.0A 2014-10-19 2014-10-19 Horizontal tilt correction method for license plate image Expired - Fee Related CN104318233B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410561462.0A CN104318233B (en) 2014-10-19 2014-10-19 Horizontal tilt correction method for license plate image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410561462.0A CN104318233B (en) 2014-10-19 2014-10-19 Horizontal tilt correction method for license plate image

Publications (2)

Publication Number Publication Date
CN104318233A true CN104318233A (en) 2015-01-28
CN104318233B CN104318233B (en) 2018-01-26

Family

ID=52373462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410561462.0A Expired - Fee Related CN104318233B (en) 2014-10-19 2014-10-19 Horizontal tilt correction method for license plate image

Country Status (1)

Country Link
CN (1) CN104318233B (en)

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488501A (en) * 2015-11-26 2016-04-13 南京富士通南大软件技术有限公司 Method for correcting license plate slant based on rotating projection
CN105608455A (en) * 2015-12-18 2016-05-25 浙江宇视科技有限公司 License plate tilt correction method and apparatus
CN105678296A (en) * 2015-12-30 2016-06-15 小米科技有限责任公司 Method and apparatus for determining angle of inclination of characters
CN106022334A (en) * 2016-05-04 2016-10-12 安凯 Stereoscopic-vision-system-based precise correction method for tilted license plate image
CN106022333A (en) * 2016-04-26 2016-10-12 安凯 Vehicle license plate tilt image correcting method
CN106127206A (en) * 2016-06-28 2016-11-16 北京智芯原动科技有限公司 The vertical angles detection method of a kind of car plate and device
CN106874904A (en) * 2017-01-09 2017-06-20 北京大学深圳研究生院 A kind of car plate picture antidote and device
CN107085834A (en) * 2017-04-25 2017-08-22 西安工程大学 An Image Denoising Method Based on Image Rotation and Block Singular Value Decomposition
CN107292305A (en) * 2017-06-20 2017-10-24 北京小米移动软件有限公司 Character rotation method and device
CN107506765A (en) * 2017-10-13 2017-12-22 厦门大学 A kind of method of the license plate sloped correction based on neutral net
CN107563330A (en) * 2017-09-04 2018-01-09 南京邮电大学 A kind of horizontal tilt car plate antidote in monitor video
CN107622245A (en) * 2017-09-26 2018-01-23 武汉中旗生物医疗电子有限公司 Papery Wave shape extracting method and device
CN108171229A (en) * 2017-12-27 2018-06-15 广州多益网络股份有限公司 A kind of recognition methods of hollow adhesion identifying code and system
CN108241859A (en) * 2016-12-26 2018-07-03 浙江宇视科技有限公司 The bearing calibration of car plate and device
WO2018219054A1 (en) * 2017-06-02 2018-12-06 杭州海康威视数字技术股份有限公司 Method, device, and system for license plate recognition
CN110020655A (en) * 2019-04-19 2019-07-16 厦门商集网络科技有限责任公司 A kind of character denoising method and terminal based on binaryzation
CN110390334A (en) * 2018-04-19 2019-10-29 富士施乐株式会社 Information processing unit and storage medium
CN110400259A (en) * 2019-07-26 2019-11-01 公安部交通管理科学研究所 System and method for inclination correction of motor vehicle license plate image based on least squares method and coordinate rotation
CN110427937A (en) * 2019-07-18 2019-11-08 浙江大学 A kind of correction of inclination license plate and random length licence plate recognition method based on deep learning
WO2020133464A1 (en) * 2018-12-29 2020-07-02 Zhejiang Dahua Technology Co., Ltd. Systems and methods for license plate recognition
CN111639642A (en) * 2020-05-07 2020-09-08 浙江大华技术股份有限公司 Image processing method, device and apparatus
CN111652230A (en) * 2020-05-25 2020-09-11 浙江大华技术股份有限公司 License plate recognition method, electronic device and storage medium
CN112183255A (en) * 2020-09-15 2021-01-05 西北工业大学 A Deep Learning-Based Visual Recognition and Pose Estimation Method for Underwater Targets
CN113436080A (en) * 2021-06-30 2021-09-24 平安科技(深圳)有限公司 Seal image processing method, device, equipment and storage medium
CN114719822A (en) * 2022-02-24 2022-07-08 江苏省送变电有限公司 GIS equipment fault detection method based on geometric method
CN114972824A (en) * 2022-06-24 2022-08-30 小米汽车科技有限公司 Rod detection method and device, vehicle and storage medium
CN116385315A (en) * 2023-05-31 2023-07-04 日照天一生物医疗科技有限公司 Image enhancement method and system for simulated ablation of tumor therapeutic instrument

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130163822A1 (en) * 2006-04-04 2013-06-27 Cyclops Technologies, Inc. Airborne Image Capture and Recognition System

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130163822A1 (en) * 2006-04-04 2013-06-27 Cyclops Technologies, Inc. Airborne Image Capture and Recognition System

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王宗跃等: "基于字符上下边缘的车牌矫正方法", 《武汉理工大学学报》 *
闫兵: "基于灰度信息的车牌识别方法的研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (43)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488501A (en) * 2015-11-26 2016-04-13 南京富士通南大软件技术有限公司 Method for correcting license plate slant based on rotating projection
CN105488501B (en) * 2015-11-26 2018-11-16 南京富士通南大软件技术有限公司 The method of license plate sloped correction based on rotation projection
CN105608455A (en) * 2015-12-18 2016-05-25 浙江宇视科技有限公司 License plate tilt correction method and apparatus
CN105608455B (en) * 2015-12-18 2019-06-11 浙江宇视科技有限公司 A kind of license plate sloped correcting method and device
CN105678296A (en) * 2015-12-30 2016-06-15 小米科技有限责任公司 Method and apparatus for determining angle of inclination of characters
CN105678296B (en) * 2015-12-30 2019-12-06 小米科技有限责任公司 Method and device for determining character inclination angle
CN106022333A (en) * 2016-04-26 2016-10-12 安凯 Vehicle license plate tilt image correcting method
CN106022334A (en) * 2016-05-04 2016-10-12 安凯 Stereoscopic-vision-system-based precise correction method for tilted license plate image
CN106127206A (en) * 2016-06-28 2016-11-16 北京智芯原动科技有限公司 The vertical angles detection method of a kind of car plate and device
CN106127206B (en) * 2016-06-28 2019-04-05 北京智芯原动科技有限公司 A kind of vertical angles detection method and device of license plate
CN108241859A (en) * 2016-12-26 2018-07-03 浙江宇视科技有限公司 The bearing calibration of car plate and device
CN106874904A (en) * 2017-01-09 2017-06-20 北京大学深圳研究生院 A kind of car plate picture antidote and device
CN107085834A (en) * 2017-04-25 2017-08-22 西安工程大学 An Image Denoising Method Based on Image Rotation and Block Singular Value Decomposition
WO2018219054A1 (en) * 2017-06-02 2018-12-06 杭州海康威视数字技术股份有限公司 Method, device, and system for license plate recognition
CN108985137A (en) * 2017-06-02 2018-12-11 杭州海康威视数字技术股份有限公司 A kind of licence plate recognition method, apparatus and system
CN107292305A (en) * 2017-06-20 2017-10-24 北京小米移动软件有限公司 Character rotation method and device
CN107563330A (en) * 2017-09-04 2018-01-09 南京邮电大学 A kind of horizontal tilt car plate antidote in monitor video
CN107563330B (en) * 2017-09-04 2020-10-16 南京邮电大学 A method for correcting horizontally tilted license plates in surveillance video
CN107622245A (en) * 2017-09-26 2018-01-23 武汉中旗生物医疗电子有限公司 Papery Wave shape extracting method and device
CN107622245B (en) * 2017-09-26 2020-02-07 武汉中旗生物医疗电子有限公司 Paper waveform extraction method and device
CN107506765A (en) * 2017-10-13 2017-12-22 厦门大学 A kind of method of the license plate sloped correction based on neutral net
CN107506765B (en) * 2017-10-13 2020-09-01 厦门大学 License plate inclination correction method based on neural network
CN108171229A (en) * 2017-12-27 2018-06-15 广州多益网络股份有限公司 A kind of recognition methods of hollow adhesion identifying code and system
CN108171229B (en) * 2017-12-27 2021-11-16 广州多益网络股份有限公司 Method and system for identifying hollow adhesion verification code
CN110390334A (en) * 2018-04-19 2019-10-29 富士施乐株式会社 Information processing unit and storage medium
CN113228033A (en) * 2018-12-29 2021-08-06 浙江大华技术股份有限公司 License plate recognition system and method
US11842535B2 (en) 2018-12-29 2023-12-12 Zhejiang Dahua Technology Co., Ltd. Systems and methods for license plate recognition
WO2020133464A1 (en) * 2018-12-29 2020-07-02 Zhejiang Dahua Technology Co., Ltd. Systems and methods for license plate recognition
CN110020655A (en) * 2019-04-19 2019-07-16 厦门商集网络科技有限责任公司 A kind of character denoising method and terminal based on binaryzation
CN110427937A (en) * 2019-07-18 2019-11-08 浙江大学 A kind of correction of inclination license plate and random length licence plate recognition method based on deep learning
CN110427937B (en) * 2019-07-18 2022-03-22 浙江大学 Inclined license plate correction and indefinite-length license plate identification method based on deep learning
CN110400259A (en) * 2019-07-26 2019-11-01 公安部交通管理科学研究所 System and method for inclination correction of motor vehicle license plate image based on least squares method and coordinate rotation
CN110400259B (en) * 2019-07-26 2022-07-05 公安部交通管理科学研究所 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation
CN111639642A (en) * 2020-05-07 2020-09-08 浙江大华技术股份有限公司 Image processing method, device and apparatus
CN111652230A (en) * 2020-05-25 2020-09-11 浙江大华技术股份有限公司 License plate recognition method, electronic device and storage medium
CN111652230B (en) * 2020-05-25 2023-05-12 浙江大华技术股份有限公司 License plate recognition method, electronic device and storage medium
CN112183255A (en) * 2020-09-15 2021-01-05 西北工业大学 A Deep Learning-Based Visual Recognition and Pose Estimation Method for Underwater Targets
CN113436080A (en) * 2021-06-30 2021-09-24 平安科技(深圳)有限公司 Seal image processing method, device, equipment and storage medium
CN114719822A (en) * 2022-02-24 2022-07-08 江苏省送变电有限公司 GIS equipment fault detection method based on geometric method
CN114972824A (en) * 2022-06-24 2022-08-30 小米汽车科技有限公司 Rod detection method and device, vehicle and storage medium
CN114972824B (en) * 2022-06-24 2023-07-14 小米汽车科技有限公司 Rod detection method, device, vehicle and storage medium
CN116385315A (en) * 2023-05-31 2023-07-04 日照天一生物医疗科技有限公司 Image enhancement method and system for simulated ablation of tumor therapeutic instrument
CN116385315B (en) * 2023-05-31 2023-09-08 日照天一生物医疗科技有限公司 Image enhancement method and system for simulated ablation of tumor therapeutic instrument

Also Published As

Publication number Publication date
CN104318233B (en) 2018-01-26

Similar Documents

Publication Publication Date Title
CN104318233B (en) Horizontal tilt correction method for license plate image
CN109784344B (en) Image non-target filtering method for ground plane identification recognition
CN105893949B (en) A kind of method for detecting lane lines under complex road condition scene
CN109188459B (en) Ramp small obstacle identification method based on multi-line laser radar
CN108985305B (en) A laser etching industrial detonator code image positioning and correction method
CN109886896A (en) A blue license plate segmentation and correction method
CN106203433A (en) In a kind of vehicle monitoring image, car plate position automatically extracts and the method for perspective correction
CN105117727B (en) A kind of Location Method of Vehicle License Plate
CN108280450A (en) A kind of express highway pavement detection method based on lane line
TW201740316A (en) Image text identification method and apparatus
CN103336961B (en) A kind of interactively natural scene Method for text detection
CN107704801A (en) Curved lanes line detecting method based on segmented linear bonus point section Bezier
CN103927526A (en) Vehicle detecting method based on Gauss difference multi-scale edge fusion
CN111353961B (en) Document curved surface correction method and device
CN104200496B (en) High-precision detecting and locating method for rectangular identifiers on basis of least square vertical fitting of adjacent sides
CN107423735B (en) License plate positioning method utilizing horizontal gradient and saturation
CN106446894A (en) Method for recognizing position of spherical object based on contour
CN105488492A (en) Color image preprocessing method, road identification method and related device
CN102799882A (en) License plate positioning method based on visual saliency
CN109583365A (en) Method for detecting lane lines is fitted based on imaging model constraint non-uniform B-spline curve
CN107895151A (en) Method for detecting lane lines based on machine vision under a kind of high light conditions
CN105844655A (en) Laser line stripe edge extraction method
CN102496018A (en) Document skew detection method and system
CN105809149A (en) Lane line detection method based on straight lines with maximum length
JP6890427B2 (en) Car number recognition device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Ye Xiuzi

Inventor after: Hong Zhenjie

Inventor after: Sheng Jia

Inventor after: Xiang Xubin

Inventor after: Zhang Sanyuan

Inventor before: Sheng Jia

Inventor before: Xiang Xubin

Inventor before: Ye Xiuzi

Inventor before: Hong Zhenjie

Inventor before: Zhang Sanyuan

GR01 Patent grant
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20150128

Assignee: Big data and Information Technology Research Institute of Wenzhou University

Assignor: Wenzhou University

Contract record no.: X2020330000098

Denomination of invention: Horizontal tilt correction method of license plate image

Granted publication date: 20180126

License type: Common License

Record date: 20201115

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180126