CN110400259B - Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation - Google Patents

Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation Download PDF

Info

Publication number
CN110400259B
CN110400259B CN201910682586.7A CN201910682586A CN110400259B CN 110400259 B CN110400259 B CN 110400259B CN 201910682586 A CN201910682586 A CN 201910682586A CN 110400259 B CN110400259 B CN 110400259B
Authority
CN
China
Prior art keywords
motor vehicle
image
license plate
vehicle license
rotation
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.)
Active
Application number
CN201910682586.7A
Other languages
Chinese (zh)
Other versions
CN110400259A (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.)
Traffic Management Research Institute of Ministry of Public Security
Original Assignee
Traffic Management Research Institute of Ministry of Public Security
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 Traffic Management Research Institute of Ministry of Public Security filed Critical Traffic Management Research Institute of Ministry of Public Security
Priority to CN201910682586.7A priority Critical patent/CN110400259B/en
Publication of CN110400259A publication Critical patent/CN110400259A/en
Application granted granted Critical
Publication of CN110400259B publication Critical patent/CN110400259B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • G06T3/608Rotation of whole images or parts thereof by skew deformation, e.g. two-pass or three-pass rotation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention provides a motor vehicle license plate image inclination angle correction system based on a least square method and coordinate rotation, which comprises the following components: an edge calculation unit, an inclination calculation unit and a rotation calculation unit; the edge calculation unit is used for calculating edge pixel points of the motor vehicle license plate image; the inclination angle calculating unit is used for calculating the inclination angle of the image of the license plate of the motor vehicle; the rotation calculation unit is used for correcting the inclined motor vehicle license plate image to be straight. The edge calculation unit includes: detecting the edge of the image of the motor vehicle license plate and determining the detection area of the image of the motor vehicle license plate; the inclination calculation unit includes: selecting a sample for calculating the inclination angle of the motor vehicle license plate image and calculating the inclination angle of the motor vehicle license plate image; the rotation calculation unit includes: the motor vehicle license plate image rotates positively and the motor vehicle license plate image rotates reversely; the invention can improve the identification accuracy of the vehicle number plate and improve the functional performance of the traffic technology monitoring equipment.

Description

基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统 和方法System and method for inclination correction of motor vehicle license plate image based on least squares method and coordinate rotation

技术领域technical field

本发明涉及智能交通技术领域,尤其是一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统和方法。The invention relates to the technical field of intelligent transportation, in particular to a system and method for correcting the inclination angle of a motor vehicle license plate image based on the least squares method and coordinate rotation.

背景技术Background technique

在我国,机动车号牌是公安交管部门登记的准予机动车在中华人民共和国境内道路上行驶的法定标志。我国最早的机动车号牌出现在清光绪27年,新中国成立后经历了多次变革,变成如今在用的“92式”机动车号牌,其中行业技术标准是《中华人民共和国机动车号牌》(GA36),标准对机动车号牌的分类、规格、颜色、适用范围、式样、技术要求等内容作了明确规定。近几十年,随着智能交通技术的发展,我国在道路上安装许多交通技术监控摄像机捕获和识别机动车号牌,进而管理机动车驾驶人。但实际中,摄像机安装杆件常常由于风吹或车辆行驶对路基震动日积月累的影响,摄像机安装杆件常微量位移,致其所拍车辆号牌图像倾斜,对号牌字符识别结果产生不利影响。In my country, the number plate of a motor vehicle is a legal sign registered by the public security traffic control department to allow a motor vehicle to run on roads within the territory of the People's Republic of China. my country's earliest motor vehicle license plate appeared in the 27th year of Guangxu in the Qing Dynasty. After the founding of the People's Republic of China, it has undergone many changes and has become the "92-type" motor vehicle license plate in use today. Number Plate" (GA36), the standard clearly stipulates the classification, specification, color, scope of application, style and technical requirements of motor vehicle license plates. In recent decades, with the development of intelligent transportation technology, many traffic technology surveillance cameras have been installed on the road to capture and identify motor vehicle license plates, and then manage motor vehicle drivers. However, in practice, the camera mounting rod is often affected by wind or vehicle driving on the roadbed vibration, and the camera mounting rod is often displaced by a small amount, which causes the image of the vehicle license plate to be tilted, which has an adverse effect on the number plate character recognition results.

在此背景下,本发明提出一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统和方法,先矫正倾斜号牌图像再识别号牌字符,可避免上述风吹或路基震动对摄像机安装杆件的不利影响,提高摄像机对机动车号牌识别准确率。In this context, the present invention proposes a system and method for correcting the inclination angle of a motor vehicle license plate image based on the least squares method and coordinate rotation, which can first correct the inclined license plate image and then identify the characters of the license plate, which can avoid the above-mentioned adverse effects of wind or roadbed vibration. The adverse effect of the camera installation rod improves the recognition accuracy of the motor vehicle number plate by the camera.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于克服现有交通技术监视设备在拍摄机动车号牌倾斜影响,提出一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统和方法,提高车辆号牌的识别准确率,进一步提高交通技术监控设备的性能。本发明采用的技术方案是:The purpose of the present invention is to overcome the influence of the inclination of the existing traffic technology monitoring equipment in photographing the motor vehicle number plate, and to propose a system and method for correcting the inclination angle of the motor vehicle number plate image based on the least squares method and coordinate rotation, so as to improve the recognition accuracy of the vehicle number plate. rate and further improve the performance of traffic technology monitoring equipment. The technical scheme adopted in the present invention is:

一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统,包括:边缘计算单元、倾角计算单元及旋转计算单元;A vehicle license plate image inclination correction system based on least squares method and coordinate rotation, comprising: an edge calculation unit, an inclination calculation unit and a rotation calculation unit;

边缘计算单元用于计算机动车号牌图像的边缘像素点;The edge computing unit is used to calculate the edge pixels of the motor vehicle license plate image;

倾角计算单元用于计算机动车号牌图像倾斜角度;The inclination calculation unit is used to calculate the inclination angle of the motor vehicle license plate image;

旋转计算单元用于矫正倾斜的机动车号牌图像至平直。The rotation calculation unit is used to correct the slanted motor vehicle license plate image to be straight.

进一步地,further,

边缘计算单元包括:机动车号牌图像边缘检测、机动车号牌图像检测区域确定;The edge computing unit includes: edge detection of the motor vehicle license plate image, determination of the detection area of the motor vehicle license plate image;

机动车号牌图像边缘检测:先将机动车号牌图像从彩色空间转到灰度空间,再计算机动车号牌灰度图像的水平梯度得到机动车号牌边缘图像;Motor vehicle license plate image edge detection: firstly, the motor vehicle license plate image is transferred from the color space to the gray space, and then the horizontal gradient of the motor vehicle license plate gray image is calculated to obtain the motor vehicle license plate edge image;

机动车号牌图像检测区域确定:根据机动车号牌边缘图像的特征,从上、下、左、右四个方向确定机动车号牌检测区域;Determination of motor vehicle license plate image detection area: According to the characteristics of the edge image of the motor vehicle license plate, the motor vehicle license plate detection area is determined from four directions: up, down, left and right;

倾角计算单元包括:选取机动车号牌图像倾角计算的样本、机动车号牌图像倾角计算;The inclination calculation unit includes: selecting a sample for calculating the inclination of the motor vehicle license plate image, and calculating the inclination of the motor vehicle license plate image;

选取机动车号牌图像倾角计算的样本:在机动车号牌边缘图像中选取典型边缘像素点作为倾角计算的样本;Select the sample for calculating the inclination angle of the motor vehicle license plate image: select typical edge pixels in the edge image of the motor vehicle license plate as the sample for calculating the inclination angle;

机动车号牌图像倾角计算:根据所选样本,通过最小二乘法求取机动车号牌图像倾角;Calculation of the inclination angle of the motor vehicle license plate image: According to the selected sample, the inclination angle of the motor vehicle license plate image is obtained by the least square method;

旋转计算单元包括:机动车号牌图像正旋转、机动车号牌图像反旋转;The rotation calculation unit includes: forward rotation of the motor vehicle number plate image and reverse rotation of the motor vehicle number plate image;

机动车号牌图像正旋转:根据所述倾角旋转机动车号牌图像坐标,建立旋转前和旋转后的坐标映射关系,旋转后图像坐标像素值根据映射关系由图像旋转前对应的坐标像素值赋值;The motor vehicle license plate image is rotating: rotate the coordinates of the motor vehicle license plate image according to the inclination angle to establish the coordinate mapping relationship between before and after rotation, and the image coordinate pixel value after rotation is assigned by the corresponding coordinate pixel value before the image rotation according to the mapping relationship. ;

机动车号牌图像反旋转:对于旋转后图像中的空点,将空点的坐标反方向旋转至原图,建立旋转后和旋转前的坐标映射关系,并按照映射对机动车号牌图像双线性插值修正。Motor vehicle license plate image reverse rotation: For the empty point in the rotated image, rotate the coordinates of the empty point in the reverse direction to the original image, establish the coordinate mapping relationship between the rotated and before rotation, and double-click the motor vehicle license plate image according to the mapping. Linear interpolation correction.

一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,包括以下步骤:A method for correcting the inclination angle of a motor vehicle license plate image based on the least squares method and coordinate rotation, comprising the following steps:

步骤1,将机动车号牌彩色图像变换为机动车号牌灰度图像;Step 1, transform the color image of the motor vehicle number plate into a grayscale image of the motor vehicle number plate;

步骤2,计算机动车号牌灰度图像的水平梯度得到机动车号牌边缘图像;Step 2, calculating the horizontal gradient of the grayscale image of the motor vehicle number plate to obtain the edge image of the motor vehicle number plate;

步骤3,根据机动车号牌边缘图像的特征,从上、下、左、右四个方向确定机动车号牌检测区域;Step 3, according to the characteristics of the edge image of the motor vehicle license plate, determine the motor vehicle license plate detection area from four directions: up, down, left and right;

步骤4,在机动车号牌边缘图像中选取典型边缘像素点作为倾角计算的样本;Step 4, select typical edge pixels in the edge image of the motor vehicle number plate as a sample for inclination calculation;

步骤5,根据所选样本,通过最小二乘法求取机动车号牌图像倾角;Step 5, according to the selected sample, obtain the inclination of the image of the motor vehicle license plate by the least square method;

步骤6,根据所述倾角旋转机动车号牌图像坐标,建立旋转前和旋转后的坐标映射关系,旋转后图像坐标像素值根据映射关系由图像旋转前对应的坐标像素值赋值;Step 6, rotate the image coordinates of the motor vehicle number plate according to the inclination angle, establish the coordinate mapping relationship before and after the rotation, and assign the pixel value of the image coordinate after the rotation by the corresponding coordinate pixel value before the image rotation according to the mapping relationship;

步骤7,对于旋转后图像中的空点,将空点的坐标反方向旋转至原图,建立旋转后和旋转前的坐标映射关系,并按照映射对机动车号牌图像双线性插值修正。Step 7: For the empty points in the rotated image, rotate the coordinates of the empty points in the opposite direction to the original image, establish a coordinate mapping relationship between the rotated and before rotation, and correct the motor vehicle license plate image by bilinear interpolation according to the mapping.

本发明的优点在于:The advantages of the present invention are:

(1)通过水平梯度识别机动车号牌边缘像素点,运算量低,准确率高。(1) The edge pixels of the motor vehicle license plate are identified by the horizontal gradient, which has low computational complexity and high accuracy.

(2)通过精准识别车辆号牌区域,重点关注号牌像素点,降低了其他非机动车号牌图像像素点的干扰,提高了抗干扰性。(2) By accurately identifying the vehicle number plate area, focusing on the number plate pixels, the interference of other non-motor vehicle number plate image pixels is reduced, and the anti-interference is improved.

(3)通过选取机动车号牌边缘图像的典型边缘像素点作为最小二乘法样本计算机动车号牌图像倾角,降低了运算的复杂度和运算量。(3) The inclination angle of the motor vehicle license plate image is calculated by selecting the typical edge pixels of the edge image of the motor vehicle license plate as the sample of the least square method, which reduces the complexity and amount of calculation.

(4)通过坐标变换旋转机动车号牌图像达到矫正机动车号牌的目的,并借助插值处理方法平滑因旋转带来的空缺影响,提高了机动车号牌图像矫正校正的效果。(4) The purpose of correcting the motor vehicle number plate is achieved by rotating the motor vehicle number plate image through coordinate transformation, and the vacancy effect caused by the rotation is smoothed by means of the interpolation processing method, which improves the correction effect of the motor vehicle number plate image.

附图说明Description of drawings

图1为本发明的系统组成示意图。FIG. 1 is a schematic diagram of the system composition of the present invention.

图2为本发明的机动车号牌彩色图像示意图。FIG. 2 is a schematic diagram of a color image of a motor vehicle number plate according to the present invention.

图3为本发明的机动车号牌灰度图像示意图。FIG. 3 is a schematic diagram of a grayscale image of a motor vehicle number plate according to the present invention.

图4为本发明的机动车号牌边缘图像示意图。FIG. 4 is a schematic diagram of an edge image of a motor vehicle number plate according to the present invention.

图5为本发明的机动车号牌上下左右最小检测区域图FIG. 5 is a diagram of the minimum detection area of the vehicle license plate of the present invention.

图6为本发明的机动车号牌典型边缘像素点示意图。FIG. 6 is a schematic diagram of typical edge pixels of a motor vehicle license plate of the present invention.

图7为本发明的机动车号牌图像坐标正旋转效果图。FIG. 7 is an effect diagram of the positive rotation of the image coordinates of the motor vehicle number plate according to the present invention.

图8为对图7图像坐标反旋转后插值效果图。FIG. 8 is a diagram showing the effect of interpolation after inverse rotation of the coordinates of the image in FIG. 7 .

具体实施方式Detailed ways

下面结合具体附图和实施例对本发明作进一步说明。The present invention will be further described below with reference to the specific drawings and embodiments.

如图1所示,一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统,包括:边缘计算单元10、倾角计算单元20及旋转计算单元30;As shown in FIG. 1 , a system for correcting the inclination angle of a motor vehicle license plate image based on the least squares method and coordinate rotation includes: an edge calculation unit 10 , an inclination angle calculation unit 20 and a rotation calculation unit 30 ;

边缘计算单元10用于计算机动车号牌图像的边缘像素点;The edge computing unit 10 is used to calculate the edge pixels of the motor vehicle license plate image;

倾角计算单元20用于计算机动车号牌图像倾斜角度;The inclination angle calculation unit 20 is used to calculate the inclination angle of the image of the motor vehicle license plate;

旋转计算单元30用于矫正倾斜的机动车号牌图像至平直。The rotation calculation unit 30 is used to correct the tilted vehicle license plate image to be straight.

边缘计算单元10包括:机动车号牌图像边缘检测、机动车号牌图像检测区域确定;The edge computing unit 10 includes: edge detection of the motor vehicle license plate image, determination of the detection area of the motor vehicle license plate image;

机动车号牌图像边缘检测:先将机动车号牌图像从彩色空间转到灰度空间,再计算机动车号牌灰度图像的水平梯度得到机动车号牌边缘图像;Motor vehicle license plate image edge detection: firstly, the motor vehicle license plate image is transferred from the color space to the gray space, and then the horizontal gradient of the motor vehicle license plate gray image is calculated to obtain the motor vehicle license plate edge image;

机动车号牌图像检测区域确定:根据机动车号牌边缘图像的特征,从上、下、左、右四个方向确定机动车号牌检测区域;Determination of motor vehicle license plate image detection area: According to the characteristics of the edge image of the motor vehicle license plate, the motor vehicle license plate detection area is determined from four directions: up, down, left and right;

倾角计算单元20包括:选取机动车号牌图像倾角计算的样本、机动车号牌图像倾角计算;The inclination calculation unit 20 includes: selecting a sample for calculating the inclination of the motor vehicle license plate image, and calculating the inclination of the motor vehicle license plate image;

选取机动车号牌图像倾角计算的样本:在机动车号牌边缘图像中选取典型边缘像素点作为倾角计算的样本;Select the sample for calculating the inclination angle of the motor vehicle license plate image: select typical edge pixels in the edge image of the motor vehicle license plate as the sample for calculating the inclination angle;

机动车号牌图像倾角计算:根据所选样本,通过最小二乘法求取机动车号牌图像倾角;Calculation of the inclination angle of the motor vehicle license plate image: According to the selected sample, the inclination angle of the motor vehicle license plate image is obtained by the least square method;

旋转计算单元30包括:机动车号牌图像正旋转、机动车号牌图像反旋转;The rotation calculation unit 30 includes: forward rotation of the motor vehicle number plate image and reverse rotation of the motor vehicle number plate image;

机动车号牌图像正旋转:根据所述倾角旋转机动车号牌图像坐标,建立旋转前和旋转后的坐标映射关系,旋转后图像坐标像素值根据映射关系由图像旋转前对应的坐标像素值赋值;The motor vehicle license plate image is rotating: rotate the coordinates of the motor vehicle license plate image according to the inclination angle to establish the coordinate mapping relationship between before and after rotation, and the image coordinate pixel value after rotation is assigned by the corresponding coordinate pixel value before the image rotation according to the mapping relationship. ;

机动车号牌图像反旋转:对于旋转后图像中的空点,建立旋转后和旋转前的坐标映射关系,并按照映射对机动车号牌图像双线性插值修正。Motor vehicle license plate image inverse rotation: For the empty points in the rotated image, establish the coordinate mapping relationship between after rotation and before rotation, and correct the motor vehicle license plate image by bilinear interpolation according to the mapping.

基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,包括以下步骤:The method for correcting the inclination angle of a motor vehicle license plate image based on the least squares method and coordinate rotation includes the following steps:

步骤1,图像灰度变换:将机动车号牌彩色图像变换为机动车号牌灰度图像;Step 1, image grayscale transformation: transform the color image of the motor vehicle number plate into a grayscale image of the motor vehicle number plate;

假设坐标(i,j)处,机动车号牌彩色图像像素

Figure RE-GDA0002198349430000031
的R、G、B分量分别为
Figure RE-GDA0002198349430000032
Figure RE-GDA0002198349430000033
同位置灰度图像像素值
Figure RE-GDA0002198349430000034
变换如下:Assuming that at coordinates (i, j), the color image pixel of the motor vehicle number plate
Figure RE-GDA0002198349430000031
The R, G, and B components of , respectively, are
Figure RE-GDA0002198349430000032
and
Figure RE-GDA0002198349430000033
Grayscale image pixel value at the same location
Figure RE-GDA0002198349430000034
The transformation is as follows:

Figure RE-GDA0002198349430000035
Figure RE-GDA0002198349430000035

例如:图2为机动车号牌彩色图像I1,图3为机动车号牌灰度图像I2;For example: Figure 2 is a color image I1 of a motor vehicle number plate, and Figure 3 is a grayscale image I2 of a motor vehicle number plate;

步骤2,边缘检测:计算机动车号牌灰度图像的水平梯度得到机动车号牌边缘图像;Step 2, edge detection: calculate the horizontal gradient of the grayscale image of the motor vehicle number plate to obtain the edge image of the motor vehicle number plate;

由于机动车号牌水平方向特征比垂直方向特征明显,根据机动车号牌灰度图像I2的水平梯度,计算机动车号牌边缘图像I3,公式如下:Since the horizontal feature of the motor vehicle number plate is more obvious than the vertical feature, according to the horizontal gradient of the gray image I2 of the motor vehicle number plate, the edge image I3 of the motor vehicle number plate is calculated, and the formula is as follows:

Figure RE-GDA0002198349430000041
Figure RE-GDA0002198349430000041

其中th1为阈值:如果机动车号牌某像素点水平梯度不低于th1,则为边缘像素点;Among them, th1 is the threshold: if the horizontal gradient of a certain pixel of the motor vehicle license plate is not lower than th1, it is an edge pixel;

例如:图4为机动车号牌边缘图像,白色像素点为机动车号牌边缘像素点;For example: Figure 4 is the edge image of the motor vehicle number plate, and the white pixels are the edge pixels of the motor vehicle number plate;

步骤3,区域检测:根据机动车号牌边缘图像的特征,从上、下、左、右四个方向确定机动车号牌检测区域;Step 3, area detection: According to the characteristics of the edge image of the motor vehicle license plate, the motor vehicle license plate detection area is determined from four directions: up, down, left and right;

(1)上下边界:假设W1和H1分别为I3行列大小,行扫描I3,从最顶端逐行往下扫描检测上边界up,从最低端逐行往上扫描检测下边界down;(1) Upper and lower boundaries: Assuming that W 1 and H 1 are the size of I3 row and column respectively, scan I3 row by row, scan down from the top to detect the upper boundary up row by row, and scan up from the lowest end row by row to detect the lower boundary down;

Figure RE-GDA0002198349430000042
Figure RE-GDA0002198349430000042

其中th2为阈值:从最顶端往下逐行扫描,当某行有th2个以上白点,则该行的行数为up;从最低端往上逐行扫描,当某行有th2个以上白点,则该行的行数为down;Among them, th2 is the threshold: scan from the top down line by line, when a line has more than th2 white dots, the number of lines in the line is up; scan line by line from the lowest end to the top, when a line has more than th2 white dots point, the line number of the line is down;

(2)左右边界:列扫描I3,从最左侧逐列往右扫描检测左边界left,从最右端逐列往左扫描检测右边界right;(2) Left and right boundaries: column scan I3, scan from the leftmost column to the right to detect the left boundary left, and scan from the rightmost column to the left to detect the right boundary right;

Figure RE-GDA0002198349430000043
Figure RE-GDA0002198349430000043

其中th3为阈值:从最左端往右逐列扫描,当某列有th3个以上白点,则该列的列数为left;从最右端往左逐列扫描,当某列有th3个以上白点,则该列的列数为right;Among them, th3 is the threshold value: scan from the left end to the right column by column, when a column has more than th3 white dots, the number of columns in the column is left; scan from the right end to the left column by column, when a column has more than th3 white dots point, the number of columns in this column is right;

例如:图5中的白色框为机动车号牌的up、down、left和right确定的检测区域;For example: the white box in Figure 5 is the detection area determined by the up, down, left and right of the motor vehicle license plate;

步骤4,选取倾角计算样本:在机动车号牌边缘图像中选取典型边缘像素点作为倾角计算的样本;Step 4, select the inclination angle calculation sample: select typical edge pixels in the edge image of the motor vehicle number plate as the inclination angle calculation sample;

在机动车号牌边缘图像I3左边界left、右边界right、上边界up、下边界down 范围内,同时满足公式(5)原则1、原则2和原则3的边缘像素点,为倾角计算样本;Within the range of the left boundary left, right boundary right, upper boundary up, and lower boundary down of the edge image I3 of the motor vehicle license plate, the edge pixels that satisfy the principle 1, principle 2 and principle 3 of formula (5) at the same time are calculated samples for the inclination angle;

Figure RE-GDA0002198349430000051
Figure RE-GDA0002198349430000051

例如:图6中白色点为根据公式(5)选取的倾角计算样本;For example: the white point in Figure 6 is the sample of inclination calculation selected according to formula (5);

步骤5,倾角计算:根据所选样本,通过最小二乘法求取机动车号牌图像倾角;Step 5, inclination angle calculation: according to the selected sample, obtain the inclination angle of the motor vehicle license plate image by the least square method;

假设公式(5)倾角样本点有m个,行坐标xk:k=1,2,…m,列坐标yk:k=1,2,…m,分布在直线y=ax+b两侧,,为斜率,b为截距,根据最小二乘法原理,建立目标函数如下:Assuming that there are m sample points of inclination in formula (5), the row coordinates x k : k=1, 2,...m, and the column coordinates y k : k=1, 2,...m are distributed on both sides of the straight line y=ax+b , is the slope, and b is the intercept. According to the principle of least squares, the objective function is established as follows:

Figure RE-GDA0002198349430000052
Figure RE-GDA0002198349430000052

对a和b分别求偏导数为零:The partial derivatives for a and b, respectively, are zero:

Figure RE-GDA0002198349430000053
Figure RE-GDA0002198349430000053

Figure RE-GDA0002198349430000054
Figure RE-GDA0002198349430000054

机动车号牌图像倾角θ=(a/π)*180;Motor vehicle license plate image inclination θ=(a/π)*180;

步骤6,图像正旋转:根据所述倾角旋转机动车号牌图像坐标,建立旋转前和旋转后的坐标映射关系,旋转后图像坐标像素值根据映射关系由图像旋转前对应的坐标像素值赋值;Step 6, the image is rotated forward: rotate the image coordinates of the motor vehicle number plate according to the inclination angle, establish the coordinate mapping relationship before and after the rotation, and the image coordinate pixel value after the rotation is assigned by the corresponding coordinate pixel value before the image rotation according to the mapping relationship;

(1)图-数坐标变换:首先建立旋转前机动车号牌图像坐标与旋转时数学坐标之间映射关系,定义为图-数坐标变换;假设机动车号牌图像旋转前坐标系为图像坐标系,旋转时坐标系为数学坐标系,图像坐标系点(0.5W1,0.5H1)为数学坐标系原点(0,0),图像坐标系点(i,j)与数学坐标系点

Figure RE-GDA0002198349430000055
映射关系如下:(1) Figure-number coordinate transformation: First, establish the mapping relationship between the image coordinates of the motor vehicle license plate before rotation and the mathematical coordinates during rotation, which is defined as the map-number coordinate transformation; it is assumed that the coordinate system of the motor vehicle number plate image before rotation is the image coordinates When rotating, the coordinate system is the mathematical coordinate system, the image coordinate system point (0.5W 1 ,0.5H 1 ) is the mathematical coordinate system origin (0,0), the image coordinate system point (i,j) and the mathematical coordinate system point
Figure RE-GDA0002198349430000055
The mapping relationship is as follows:

Figure RE-GDA0002198349430000056
Figure RE-GDA0002198349430000056

(2)坐标旋转;其次在数学坐标系中旋转机动车号牌图像;假设点

Figure RE-GDA0002198349430000057
围绕原点(0,0)逆时针旋转θ,旋转后坐标为
Figure RE-GDA0002198349430000058
建立
Figure RE-GDA0002198349430000059
Figure RE-GDA00021983494300000510
映射关系如下:(2) Coordinate rotation; secondly, the motor vehicle license plate image is rotated in the mathematical coordinate system; hypothetical point
Figure RE-GDA0002198349430000057
Rotate θ counterclockwise around the origin (0,0), and the coordinates after rotation are
Figure RE-GDA0002198349430000058
Establish
Figure RE-GDA0002198349430000059
and
Figure RE-GDA00021983494300000510
The mapping relationship is as follows:

Figure RE-GDA0002198349430000061
Figure RE-GDA0002198349430000061

(3)数-图坐标变换:再次建立旋转时数学坐标与旋转后机动车号牌图像坐标之间映射关系,定义为数-图坐标变换;假设旋转后图像所在坐标系为新图像坐标系,W2和H2为新图像高度和宽度,旋转时数学坐标系原点(0,0)为旋转后新图像坐标系中点(0.5W2,0.5H2),新图像坐标系点

Figure RE-GDA0002198349430000062
与数学坐标系点
Figure RE-GDA0002198349430000063
映射关系如下:(3) Number-map coordinate transformation: re-establish the mapping relationship between the mathematical coordinates during rotation and the image coordinates of the motor vehicle license plate after rotation, which is defined as number-map coordinate transformation; assuming that the coordinate system of the rotated image is the new image coordinate system, W 2 and H 2 are the height and width of the new image. When rotating, the origin of the mathematical coordinate system (0,0) is the midpoint of the new image coordinate system after rotation (0.5W 2 ,0.5H 2 ), and the new image coordinate system point
Figure RE-GDA0002198349430000062
Points with Mathematical Coordinate System
Figure RE-GDA0002198349430000063
The mapping relationship is as follows:

Figure RE-GDA0002198349430000064
Figure RE-GDA0002198349430000064

(4)像素赋值:经过上述图-数坐标变换、坐标旋转及数-图坐标变换后,旋转后机动车号牌图像的坐标

Figure RE-GDA0002198349430000065
与旋转前坐标(i,j)映射关系如下:(4) Pixel assignment: After the above picture-number coordinate transformation, coordinate rotation and number-picture coordinate transformation, the coordinates of the rotated motor vehicle license plate image
Figure RE-GDA0002198349430000065
The mapping relationship with the coordinates (i, j) before rotation is as follows:

Figure RE-GDA0002198349430000066
Figure RE-GDA0002198349430000066

假设机动车号牌图像旋转后图像为I4,当公式(12)的

Figure RE-GDA0002198349430000067
Figure RE-GDA0002198349430000068
同时为整数时,像素赋值如下:Assuming that the image of the motor vehicle number plate after rotation is I4, when the formula (12)
Figure RE-GDA0002198349430000067
and
Figure RE-GDA0002198349430000068
When both are integers, the pixel assignments are as follows:

Figure RE-GDA0002198349430000069
Figure RE-GDA0002198349430000069

当公式(12)的

Figure RE-GDA00021983494300000610
Figure RE-GDA00021983494300000611
不为整数时,由于图像坐标为整数,
Figure RE-GDA00021983494300000612
则为非图像坐标,旋转前坐标(i,j)处像素值
Figure RE-GDA00021983494300000613
不能映射为旋转后像素值
Figure RE-GDA00021983494300000614
When formula (12) is
Figure RE-GDA00021983494300000610
or
Figure RE-GDA00021983494300000611
When not an integer, since the image coordinates are integers,
Figure RE-GDA00021983494300000612
Then it is a non-image coordinate, and the pixel value at the coordinate (i, j) before rotation
Figure RE-GDA00021983494300000613
cannot be mapped to rotated pixel values
Figure RE-GDA00021983494300000614

当旋转后图像I4每个坐标

Figure RE-GDA00021983494300000615
都能与原图像I1坐标(i,j)建立映射时,
Figure RE-GDA00021983494300000616
When rotated image I4 each coordinate
Figure RE-GDA00021983494300000615
When the mapping can be established with the original image I1 coordinates (i, j),
Figure RE-GDA00021983494300000616

当旋转后图像I4某坐标

Figure RE-GDA00021983494300000617
无法和原图像I1坐标(i,j)建立映射时,该坐标处像素值为空点;When rotated, a coordinate of image I4
Figure RE-GDA00021983494300000617
When the mapping cannot be established with the original image I1 coordinate (i, j), the pixel value at this coordinate is empty;

例如:图7为图像正旋转后的效果图,其中黑色点为空点。For example: Figure 7 is the rendering of the image after the image is rotated, in which the black points are empty points.

步骤7,图像反旋转:对于旋转后图像中的空点,将空点的坐标反方向旋转至原图,建立旋转后和旋转前的坐标映射关系,并按照映射对机动车号牌图像双线性插值修正;Step 7, image reverse rotation: for the empty point in the rotated image, rotate the coordinates of the empty point in the reverse direction to the original image, establish the coordinate mapping relationship between the rotated and before rotation, and map the double line of the motor vehicle license plate image according to the mapping. Sex interpolation correction;

(1)图-数学坐标变换:与步骤6(3)相反,建立

Figure RE-GDA00021983494300000618
Figure RE-GDA00021983494300000619
映射关系:(1) Graph-mathematical coordinate transformation: Contrary to step 6(3), establish
Figure RE-GDA00021983494300000618
and
Figure RE-GDA00021983494300000619
Mapping relations:

Figure RE-GDA00021983494300000620
Figure RE-GDA00021983494300000620

(2)坐标旋转:与步骤6(2)相反,

Figure RE-GDA00021983494300000621
围绕原点(0,0)顺时针旋转θ,旋转后坐标为
Figure RE-GDA0002198349430000071
建立
Figure RE-GDA0002198349430000072
Figure RE-GDA0002198349430000073
映射关系如下:(2) Coordinate rotation: Contrary to step 6(2),
Figure RE-GDA00021983494300000621
Rotate θ clockwise around the origin (0,0), and the coordinates after rotation are
Figure RE-GDA0002198349430000071
Establish
Figure RE-GDA0002198349430000072
and
Figure RE-GDA0002198349430000073
The mapping relationship is as follows:

Figure RE-GDA0002198349430000074
Figure RE-GDA0002198349430000074

(3)数-图坐标变换:与步骤6(1)相反,建立

Figure RE-GDA0002198349430000075
与(i,j)映射关系:(3) Number-graph coordinate transformation: Contrary to step 6(1), establish
Figure RE-GDA0002198349430000075
Mapping relationship with (i,j):

Figure RE-GDA0002198349430000076
Figure RE-GDA0002198349430000076

(4)像素插值:经过上述图-数坐标变换、坐标旋转及数-图坐标变换后,旋转后机动车号牌图像的旋转前坐标(i,j)与旋转后坐标

Figure RE-GDA0002198349430000077
与映射关系如下:(4) Pixel interpolation: After the above-mentioned figure-number coordinate transformation, coordinate rotation and number-figure coordinate transformation, the pre-rotation coordinates (i, j) and the post-rotation coordinates of the rotated motor vehicle license plate image
Figure RE-GDA0002198349430000077
The mapping relationship is as follows:

Figure RE-GDA0002198349430000078
Figure RE-GDA0002198349430000078

与步骤6中类似,当公式(17)的i或j不为整数时,(i,j)则为非图像坐标,假设

Figure RE-GDA0002198349430000079
为与(i,j)最近的左上、右上、左下、右下4个像素点,
Figure RE-GDA00021983494300000710
Figure RE-GDA00021983494300000711
的行距离为c、列距离为d,用双线性插值方法估计
Figure RE-GDA00021983494300000712
值如下:Similar to step 6, when i or j in formula (17) is not an integer, (i, j) is a non-image coordinate, assuming
Figure RE-GDA0002198349430000079
is the 4 pixels of the upper left, upper right, lower left and lower right closest to (i, j),
Figure RE-GDA00021983494300000710
and
Figure RE-GDA00021983494300000711
The row distance is c and the column distance is d, which is estimated by bilinear interpolation
Figure RE-GDA00021983494300000712
The values are as follows:

Figure RE-GDA00021983494300000713
Figure RE-GDA00021983494300000713

例如:图8为对图7图像坐标反旋转后插值效果图。For example, FIG. 8 is an interpolation effect diagram after the reverse rotation of the coordinates of the image in FIG. 7 .

综上所述,本发明提出的一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,通过缩小车辆号牌检测区域精准识别车辆号牌区域;通过选取机动车号牌边缘图像的典型边缘像素点作为最小二乘法样本计算机动车号牌图像倾角,降低了运算的复杂度和运算量;通过坐标变换旋转机动车号牌图像达到矫正机动车号牌的目的,并借助插值处理方法平滑因旋转带来的空缺影响。该方法克服了因天气或道路情况而发生车辆号牌倾斜的影响,提高了车辆号牌的识别准确率,也提高了交通技术监控设备的功能性能。To sum up, the present invention proposes a method for correcting the inclination angle of a motor vehicle license plate image based on the least squares method and coordinate rotation, which can accurately identify the vehicle license plate area by reducing the vehicle license plate detection area; The typical edge pixels are used as the least squares method to calculate the inclination angle of the motor vehicle license plate image, which reduces the complexity and amount of calculation; the motor vehicle license plate image is rotated by coordinate transformation to achieve the purpose of correcting the motor vehicle license plate, and the interpolation processing method is used to correct the motor vehicle license plate image. Smooth out the effects of vacancies caused by rotation. The method overcomes the influence of the inclination of the vehicle number plate due to weather or road conditions, improves the recognition accuracy of the vehicle number plate, and also improves the functional performance of the traffic technology monitoring equipment.

最后应说明的是,以上具体实施方式仅用以说明本发明的技术方案而非限制,尽管参照实例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,其均应涵盖在本发明的权利要求范围当中。Finally, it should be noted that the above specific embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to examples, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified. Or equivalent replacements, without departing from the spirit and scope of the technical solutions of the present invention, should be included in the scope of the claims of the present invention.

Claims (8)

1.一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统,其特征在于,包括:边缘计算单元、倾角计算单元及旋转计算单元;1. a motor vehicle license plate image inclination correction system based on least squares method and coordinate rotation, is characterized in that, comprises: edge calculation unit, inclination angle calculation unit and rotation calculation unit; 边缘计算单元用于计算机动车号牌图像的边缘像素点;The edge computing unit is used to calculate the edge pixels of the motor vehicle license plate image; 倾角计算单元用于计算机动车号牌图像倾斜角度;The inclination calculation unit is used to calculate the inclination angle of the motor vehicle license plate image; 旋转计算单元用于矫正倾斜的机动车号牌图像至平直;The rotation calculation unit is used to correct the tilted motor vehicle license plate image to be straight; 边缘计算单元包括:机动车号牌图像边缘检测、机动车号牌图像检测区域确定;The edge computing unit includes: edge detection of the motor vehicle license plate image, determination of the detection area of the motor vehicle license plate image; 机动车号牌图像边缘检测:先将机动车号牌图像从彩色空间转到灰度空间,再计算机动车号牌灰度图像的水平梯度得到机动车号牌边缘图像;Motor vehicle license plate image edge detection: firstly, the motor vehicle license plate image is transferred from the color space to the gray space, and then the horizontal gradient of the motor vehicle license plate gray image is calculated to obtain the motor vehicle license plate edge image; 机动车号牌图像检测区域确定:根据机动车号牌边缘图像的特征,从上、下、左、右四个方向确定机动车号牌检测区域;Determination of motor vehicle license plate image detection area: According to the characteristics of the edge image of the motor vehicle license plate, the motor vehicle license plate detection area is determined from four directions: up, down, left and right; 倾角计算单元包括:选取机动车号牌图像倾角计算的样本、机动车号牌图像倾角计算;The inclination calculation unit includes: selecting a sample for calculating the inclination of the motor vehicle license plate image, and calculating the inclination of the motor vehicle license plate image; 选取机动车号牌图像倾角计算的样本:在机动车号牌边缘图像中选取典型边缘像素点作为倾角计算的样本;Select the sample for calculating the inclination angle of the motor vehicle license plate image: select typical edge pixels in the edge image of the motor vehicle license plate as the sample for calculating the inclination angle; 机动车号牌图像倾角计算:根据所选样本,通过最小二乘法求取机动车号牌图像倾角;Calculation of the inclination angle of the motor vehicle license plate image: According to the selected sample, the inclination angle of the motor vehicle license plate image is obtained by the least square method; 旋转计算单元包括:机动车号牌图像正旋转、机动车号牌图像反旋转;The rotation calculation unit includes: forward rotation of the motor vehicle number plate image and reverse rotation of the motor vehicle number plate image; 机动车号牌图像正旋转:根据所述倾角旋转机动车号牌图像坐标,建立旋转前和旋转后的坐标映射关系,旋转后图像坐标像素值根据映射关系由图像旋转前对应的坐标像素值赋值;The motor vehicle license plate image is rotating: rotate the coordinates of the motor vehicle license plate image according to the inclination angle to establish the coordinate mapping relationship between before and after rotation, and the image coordinate pixel value after rotation is assigned by the corresponding coordinate pixel value before the image rotation according to the mapping relationship. ; 机动车号牌图像反旋转:对于旋转后图像中的空点,将空点的坐标反方向旋转至原图,建立旋转后和旋转前的坐标映射关系,并按照映射对机动车号牌图像双线性插值修正。Motor vehicle license plate image reverse rotation: For the empty point in the rotated image, rotate the coordinates of the empty point in the reverse direction to the original image, establish the coordinate mapping relationship between the rotated and before rotation, and double-click the motor vehicle license plate image according to the mapping. Linear interpolation correction. 2.一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,包括以下步骤:2. a method for correcting the inclination angle of a motor vehicle license plate image based on least squares method and coordinate rotation, is characterized in that, comprises the following steps: 步骤1,将机动车号牌彩色图像变换为机动车号牌灰度图像;Step 1, transform the color image of the motor vehicle number plate into a grayscale image of the motor vehicle number plate; 步骤2,计算机动车号牌灰度图像的水平梯度得到机动车号牌边缘图像;Step 2, calculating the horizontal gradient of the grayscale image of the motor vehicle number plate to obtain the edge image of the motor vehicle number plate; 步骤3,根据机动车号牌边缘图像的特征,从上、下、左、右四个方向确定机动车号牌检测区域;Step 3, according to the characteristics of the edge image of the motor vehicle license plate, determine the motor vehicle license plate detection area from four directions: up, down, left and right; 步骤4,在机动车号牌边缘图像中选取典型边缘像素点作为倾角计算的样本;Step 4, select typical edge pixels in the edge image of the motor vehicle number plate as a sample for inclination calculation; 步骤5,根据所选样本,通过最小二乘法求取机动车号牌图像倾角;Step 5, according to the selected sample, obtain the inclination of the image of the motor vehicle license plate by the least square method; 步骤6,根据所述倾角旋转机动车号牌图像坐标,建立旋转前和旋转后的坐标映射关系,旋转后图像坐标像素值根据映射关系由图像旋转前对应的坐标像素值赋值;Step 6, rotate the image coordinates of the motor vehicle number plate according to the inclination angle, establish the coordinate mapping relationship before and after the rotation, and assign the pixel value of the image coordinate after the rotation by the corresponding coordinate pixel value before the image rotation according to the mapping relationship; 步骤7,对于旋转后图像中的空点,将空点的坐标反方向旋转至原图,建立旋转后和旋转前的坐标映射关系,并按照映射对机动车号牌图像双线性插值修正。Step 7: For the empty points in the rotated image, rotate the coordinates of the empty points in the opposite direction to the original image, establish a coordinate mapping relationship between the rotated and before rotation, and correct the motor vehicle license plate image by bilinear interpolation according to the mapping. 3.如权利要求2所述的基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,3. the motor vehicle license plate image inclination correction method based on least squares method and coordinate rotation as claimed in claim 2, is characterized in that, 步骤2中,据机动车号牌灰度图像I2的水平梯度,计算机动车号牌边缘图像I3,公式如下:In step 2, according to the horizontal gradient of the grayscale image I2 of the motor vehicle license plate, the edge image I3 of the motor vehicle license plate is calculated, and the formula is as follows:
Figure FDA0003574229110000021
Figure FDA0003574229110000021
其中th1为阈值:如果机动车号牌某像素点水平梯度不低于th1,则为边缘像素点。Among them, th1 is the threshold: if the horizontal gradient of a certain pixel of the motor vehicle license plate is not lower than th1, it is an edge pixel.
4.如权利要求3所述的基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,4. the motor vehicle license plate image inclination correction method based on least squares method and coordinate rotation as claimed in claim 3, is characterized in that, 步骤3具体包括:Step 3 specifically includes: (1)上下边界:假设W1和H1分别为I3行列大小,行扫描I3,从最顶端逐行往下扫描检测上边界up,从最低端逐行往上扫描检测下边界down;(1) Upper and lower boundaries: Assuming that W 1 and H 1 are the size of I3 row and column respectively, scan I3 row by row, scan down from the top to detect the upper boundary up row by row, and scan up from the lowest end row by row to detect the lower boundary down;
Figure FDA0003574229110000022
Figure FDA0003574229110000022
其中th2为阈值:从最顶端往下逐行扫描,当某行有th2个以上白点,则该行的行数为up;从最低端往上逐行扫描,当某行有th2个以上白点,则该行的行数为down;Among them, th2 is the threshold: scan from the top down line by line, when a line has more than th2 white dots, the number of lines in the line is up; scan line by line from the lowest end to the top, when a line has more than th2 white dots point, the line number of the line is down; (2)左右边界:列扫描I3,从最左侧逐列往右扫描检测左边界left,从最右端逐列往左扫描检测右边界right;(2) Left and right boundaries: column scan I3, scan from the leftmost column to the right to detect the left boundary left, and scan from the rightmost column to the left to detect the right boundary right;
Figure FDA0003574229110000023
Figure FDA0003574229110000023
其中th3为阈值:从最左端往右逐列扫描,当某列有th3个以上白点,则该列的列数为left;从最右端往左逐列扫描,当某列有th3个以上白点,则该列的列数为right。Among them, th3 is the threshold value: scan from the left end to the right column by column, when a column has more than th3 white dots, the number of columns in the column is left; scan from the right end to the left column by column, when a column has more than th3 white dots point, the number of columns in this column is right.
5.如权利要求4所述的基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,5. the method for correcting the inclination angle of the motor vehicle license plate image based on least squares method and coordinate rotation as claimed in claim 4, is characterized in that, 步骤4具体包括:在机动车号牌边缘图像I3左边界left、右边界right、上边界up、下边界down范围内,同时满足公式(5)原则1、原则2和原则3的边缘像素点,为倾角计算样本;Step 4 specifically includes: within the range of the left boundary left, right boundary right, upper boundary up, and lower boundary down of the motor vehicle license plate edge image I3, and simultaneously satisfy the edge pixels of formula (5) principle 1, principle 2 and principle 3, Calculate samples for inclination;
Figure FDA0003574229110000031
Figure FDA0003574229110000031
6.如权利要求5所述的基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,6. the method for correcting the inclination angle of the motor vehicle license plate image based on least squares method and coordinate rotation as claimed in claim 5, is characterized in that, 步骤5具体包括:Step 5 specifically includes: 假设倾角样本点有m个,行坐标xk:k=1,2,…m,列坐标yk:k=1,2,…m,分布在直线y=ax+b两侧,a为斜率,b为截距,根据最小二乘法原理,建立目标函数如下:Suppose there are m sample points of inclination angle, row coordinates x k : k=1, 2,...m, column coordinates y k : k=1,2,...m, distributed on both sides of the straight line y=ax+b, a is the slope , b is the intercept, according to the principle of least squares, the objective function is established as follows:
Figure FDA0003574229110000032
Figure FDA0003574229110000032
对a和b分别求偏导数为零:The partial derivatives for a and b, respectively, are zero:
Figure FDA0003574229110000033
Figure FDA0003574229110000033
Figure FDA0003574229110000034
Figure FDA0003574229110000034
机动车号牌图像倾角θ=(a/π)*180。The inclination angle of the motor vehicle license plate image θ=(a/π)*180.
7.如权利要求6所述的基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,7. the method for correcting the inclination angle of the motor vehicle license plate image based on least squares method and coordinate rotation as claimed in claim 6, is characterized in that, 步骤6具体包括:Step 6 specifically includes: (1)图-数坐标变换:首先建立旋转前机动车号牌图像坐标与旋转时数学坐标之间映射关系,定义为图-数坐标变换;假设机动车号牌图像旋转前坐标系为图像坐标系,旋转时坐标系为数学坐标系,图像坐标系点(0.5W1,0.5H1)为数学坐标系原点(0,0),图像坐标系点(i,j)与数学坐标系点
Figure FDA0003574229110000035
映射关系如下:
(1) Figure-number coordinate transformation: First, establish the mapping relationship between the image coordinates of the motor vehicle license plate before rotation and the mathematical coordinates during rotation, which is defined as the map-number coordinate transformation; it is assumed that the coordinate system of the motor vehicle number plate image before rotation is the image coordinates When rotating, the coordinate system is the mathematical coordinate system, the image coordinate system point (0.5W 1 ,0.5H 1 ) is the mathematical coordinate system origin (0,0), the image coordinate system point (i,j) and the mathematical coordinate system point
Figure FDA0003574229110000035
The mapping relationship is as follows:
Figure FDA0003574229110000036
Figure FDA0003574229110000036
(2)坐标旋转;其次在数学坐标系中旋转机动车号牌图像;假设点
Figure FDA0003574229110000037
围绕原点(0,0)逆时针旋转θ,旋转后坐标为
Figure FDA0003574229110000038
建立
Figure FDA0003574229110000039
Figure FDA00035742291100000310
映射关系如下:
(2) Coordinate rotation; secondly, the motor vehicle license plate image is rotated in the mathematical coordinate system; hypothetical point
Figure FDA0003574229110000037
Rotate θ counterclockwise around the origin (0,0), and the coordinates after rotation are
Figure FDA0003574229110000038
Establish
Figure FDA0003574229110000039
and
Figure FDA00035742291100000310
The mapping relationship is as follows:
Figure FDA0003574229110000041
Figure FDA0003574229110000041
(3)数-图坐标变换:再次建立旋转时数学坐标与旋转后机动车号牌图像坐标之间映射关系,定义为数-图坐标变换;假设旋转后图像所在坐标系为新图像坐标系,W2和H2为新图像高度和宽度,旋转时数学坐标系原点(0,0)为旋转后新图像坐标系中点(0.5W2,0.5H2),新图像坐标系点
Figure FDA0003574229110000042
与数学坐标系点
Figure FDA0003574229110000043
映射关系如下:
(3) Number-map coordinate transformation: re-establish the mapping relationship between the mathematical coordinates during rotation and the image coordinates of the motor vehicle license plate after rotation, which is defined as number-map coordinate transformation; assuming that the coordinate system of the rotated image is the new image coordinate system, W 2 and H 2 are the height and width of the new image. When rotating, the origin of the mathematical coordinate system (0,0) is the midpoint of the new image coordinate system after rotation (0.5W 2 ,0.5H 2 ), and the new image coordinate system point
Figure FDA0003574229110000042
Points with Mathematical Coordinate System
Figure FDA0003574229110000043
The mapping relationship is as follows:
Figure FDA0003574229110000044
Figure FDA0003574229110000044
(4)像素赋值:经过上述图-数坐标变换、坐标旋转及数-图坐标变换后,旋转后机动车号牌图像的坐标
Figure FDA0003574229110000045
与旋转前坐标(i,j)映射关系如下:
(4) Pixel assignment: After the above picture-number coordinate transformation, coordinate rotation and number-picture coordinate transformation, the coordinates of the rotated motor vehicle license plate image
Figure FDA0003574229110000045
The mapping relationship with the coordinates (i, j) before rotation is as follows:
Figure FDA0003574229110000046
Figure FDA0003574229110000046
假设机动车号牌图像旋转后图像为I4,当公式(12)的
Figure FDA0003574229110000047
Figure FDA0003574229110000048
同时为整数时,像素赋值如下:
Assuming that the image of the motor vehicle number plate after rotation is I4, when the formula (12)
Figure FDA0003574229110000047
and
Figure FDA0003574229110000048
When both are integers, the pixel assignments are as follows:
Figure FDA0003574229110000049
Figure FDA0003574229110000049
当公式(12)的
Figure FDA00035742291100000410
Figure FDA00035742291100000411
不为整数时,由于图像坐标为整数,
Figure FDA00035742291100000412
则为非图像坐标,旋转前坐标(i,j)处像素值
Figure FDA00035742291100000413
不能映射为旋转后像素值
Figure FDA00035742291100000414
When formula (12) is
Figure FDA00035742291100000410
or
Figure FDA00035742291100000411
When not an integer, since the image coordinates are integers,
Figure FDA00035742291100000412
Then it is a non-image coordinate, and the pixel value at the coordinate (i, j) before rotation
Figure FDA00035742291100000413
cannot be mapped to rotated pixel values
Figure FDA00035742291100000414
当旋转后图像I4每个坐标
Figure FDA00035742291100000415
都能与原图像I1坐标(i,j)建立映射时,
Figure FDA00035742291100000416
When rotated image I4 each coordinate
Figure FDA00035742291100000415
When the mapping can be established with the original image I1 coordinates (i, j),
Figure FDA00035742291100000416
当旋转后图像I4某坐标
Figure FDA00035742291100000417
无法和原图像I1坐标(i,j)建立映射时,该坐标处像素值为空点。
When rotated, a coordinate of image I4
Figure FDA00035742291100000417
When the mapping cannot be established with the original image I1 coordinate (i, j), the pixel value at this coordinate is empty.
8.如权利要求7所述的基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正方法,其特征在于,8. The method for correcting the inclination angle of a motor vehicle license plate image based on least squares method and coordinate rotation as claimed in claim 7, characterized in that, 步骤7具体包括:Step 7 specifically includes: (1)图-数学坐标变换:与步骤6(3)相反,建立
Figure FDA00035742291100000418
Figure FDA00035742291100000419
映射关系:
(1) Graph-mathematical coordinate transformation: Contrary to step 6(3), establish
Figure FDA00035742291100000418
and
Figure FDA00035742291100000419
Mapping relations:
Figure FDA00035742291100000420
Figure FDA00035742291100000420
(2)坐标旋转:与步骤6(2)相反,
Figure FDA00035742291100000421
围绕原点(0,0)顺时针旋转θ,旋转后坐标为
Figure FDA00035742291100000422
建立
Figure FDA00035742291100000423
Figure FDA00035742291100000424
映射关系如下:
(2) Coordinate rotation: Contrary to step 6(2),
Figure FDA00035742291100000421
Rotate θ clockwise around the origin (0,0), and the coordinates after rotation are
Figure FDA00035742291100000422
Establish
Figure FDA00035742291100000423
and
Figure FDA00035742291100000424
The mapping relationship is as follows:
Figure FDA0003574229110000051
Figure FDA0003574229110000051
(3)数-图坐标变换:与步骤6(1)相反,建立
Figure FDA0003574229110000052
与(i,j)映射关系:
(3) Number-graph coordinate transformation: Contrary to step 6(1), establish
Figure FDA0003574229110000052
Mapping relationship with (i,j):
Figure FDA0003574229110000053
Figure FDA0003574229110000053
(4)像素插值:经过上述图-数坐标变换、坐标旋转及数-图坐标变换后,旋转后机动车号牌图像的旋转前坐标(i,j)与旋转后坐标
Figure FDA0003574229110000054
与映射关系如下:
(4) Pixel interpolation: After the above-mentioned figure-number coordinate transformation, coordinate rotation and number-figure coordinate transformation, the pre-rotation coordinates (i, j) and the post-rotation coordinates of the rotated motor vehicle license plate image
Figure FDA0003574229110000054
The mapping relationship is as follows:
Figure FDA0003574229110000055
Figure FDA0003574229110000055
与步骤6中类似,当公式(17)的i或j不为整数时,(i,j)则为非图像坐标,假设
Figure FDA0003574229110000056
为与(i,j)最近的左上、右上、左下、右下4个像素点,
Figure FDA0003574229110000057
Figure FDA0003574229110000058
的行距离为c、列距离为d,用双线性插值方法估计
Figure FDA0003574229110000059
值如下:
Similar to step 6, when i or j in formula (17) is not an integer, (i, j) is a non-image coordinate, assuming
Figure FDA0003574229110000056
is the 4 pixels of the upper left, upper right, lower left and lower right closest to (i, j),
Figure FDA0003574229110000057
and
Figure FDA0003574229110000058
The row distance is c and the column distance is d, which is estimated by bilinear interpolation
Figure FDA0003574229110000059
The values are as follows:
Figure FDA00035742291100000510
Figure FDA00035742291100000510
CN201910682586.7A 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation Active CN110400259B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910682586.7A CN110400259B (en) 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910682586.7A CN110400259B (en) 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation

Publications (2)

Publication Number Publication Date
CN110400259A CN110400259A (en) 2019-11-01
CN110400259B true CN110400259B (en) 2022-07-05

Family

ID=68326184

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910682586.7A Active CN110400259B (en) 2019-07-26 2019-07-26 Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation

Country Status (1)

Country Link
CN (1) CN110400259B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318233A (en) * 2014-10-19 2015-01-28 温州大学 Method for horizontal tilt correction of number plate image
CN104408451A (en) * 2014-10-30 2015-03-11 安徽清新互联信息科技有限公司 Least-square-method-based license plate correction method
CN106874904A (en) * 2017-01-09 2017-06-20 北京大学深圳研究生院 A kind of car plate picture antidote and device
CN109145915A (en) * 2018-07-27 2019-01-04 武汉科技大学 License plate rapid distortion antidote under a kind of complex scene

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318233A (en) * 2014-10-19 2015-01-28 温州大学 Method for horizontal tilt correction of number plate image
CN104408451A (en) * 2014-10-30 2015-03-11 安徽清新互联信息科技有限公司 Least-square-method-based license plate correction method
CN106874904A (en) * 2017-01-09 2017-06-20 北京大学深圳研究生院 A kind of car plate picture antidote and device
CN109145915A (en) * 2018-07-27 2019-01-04 武汉科技大学 License plate rapid distortion antidote under a kind of complex scene

Also Published As

Publication number Publication date
CN110400259A (en) 2019-11-01

Similar Documents

Publication Publication Date Title
CN107045629B (en) A multi-lane line detection method
CN107229908B (en) A kind of method for detecting lane lines
CN105488501B (en) The method of license plate sloped correction based on rotation projection
CN108280450B (en) A method for detecting highway pavement based on lane lines
CN111444778B (en) A lane line detection method
KR20210013216A (en) Multi-level target classification and traffic sign detection method and apparatus, equipment, and media
CN104899554A (en) Vehicle ranging method based on monocular vision
CN102867414A (en) Vehicle queue length measurement method based on PTZ (Pan/Tilt/Zoom) camera fast calibration
CN109635737A (en) Automobile navigation localization method is assisted based on pavement marker line visual identity
CN108876831A (en) A kind of building three-dimensional point cloud method for registering based on deep learning
CN109190621A (en) Greasy weather automatic license plate recognition method
CN107610506A (en) The detection method and system of parking position state
CN108765475A (en) A kind of building three-dimensional point cloud method for registering based on deep learning
CN112857252B (en) Tunnel image boundary line detection method based on reflectivity intensity
CN103440785B (en) One is traffic lane offset warning method fast
CN110210316A (en) Traffic lights digit recognition method based on gray level image
CN108256445A (en) Method for detecting lane lines and system
CN110515092A (en) Planar touch method based on laser radar
CN112101205A (en) Training method and device based on multi-task network
CN114662600A (en) Lane line detection method and device and storage medium
CN111091077A (en) A vehicle speed detection method based on image correlation and template matching
Arulmozhi et al. Image refinement using skew angle detection and correction for Indian license plates
CN114719873B (en) A low-cost fine map automatic generation method, device and readable medium
CN118129756A (en) Trajectory prediction method, vehicle, device and storage medium
CN108846363A (en) A kind of subregion vehicle bottom shadow detection method based on divergence expression scanning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant