CN110400259A - System and method for inclination correction of motor vehicle license plate image based on least squares method and coordinate rotation - Google Patents

System and method for inclination correction of motor vehicle license plate image based on least squares method and coordinate rotation Download PDF

Info

Publication number
CN110400259A
CN110400259A CN201910682586.7A CN201910682586A CN110400259A CN 110400259 A CN110400259 A CN 110400259A CN 201910682586 A CN201910682586 A CN 201910682586A CN 110400259 A CN110400259 A CN 110400259A
Authority
CN
China
Prior art keywords
image
coordinate
number plate
rotation
automotive number
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
CN201910682586.7A
Other languages
Chinese (zh)
Other versions
CN110400259B (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

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 Analysis (AREA)
  • Image Processing (AREA)
  • Traffic Control Systems (AREA)

Abstract

本发明提供一种基于最小二乘法和坐标旋转的机动车号牌图像倾角矫正系统,包括:边缘计算单元、倾角计算单元及旋转计算单元;边缘计算单元用于计算机动车号牌图像的边缘像素点;倾角计算单元用于计算机动车号牌图像倾斜角度;旋转计算单元用于矫正倾斜的机动车号牌图像至平直。边缘计算单元包括:机动车号牌图像边缘检测、机动车号牌图像检测区域确定;倾角计算单元包括:选取机动车号牌图像倾角计算的样本、机动车号牌图像倾角计算;旋转计算单元包括:机动车号牌图像正旋转、机动车号牌图像反旋转;本发明能够提高车辆号牌的识别准确率,进步提高交通技术监控设备的功能性能。

The invention provides a vehicle number 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 calculation unit is used to calculate the edge pixels of the motor vehicle number 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 inclined motor vehicle license plate image to be straight. The edge calculation unit includes: edge detection of the motor vehicle license plate image, determination of the detection area of the motor vehicle license plate image; the inclination calculation unit includes: selecting samples 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 image of the motor vehicle number plate is rotated forward, and the image of the motor vehicle number plate is reversely rotated; the invention can improve the recognition accuracy of the vehicle number plate and improve the functional performance of the traffic technology monitoring equipment.

Description

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

技术领域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 when 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)处,机动车号牌彩色图像像素的R、G、B分量分别为同位置灰度图像像素值变换如下:Assuming that at coordinates (i, j), the color image pixel of the motor vehicle number plate The R, G, and B components of , respectively, are and Grayscale image pixel value at the same location The transformation is as follows:

例如:图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:

其中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 the upper boundary up row by row from the top end, and scan the lower boundary down row by row from the lowest end;

其中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;

其中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;

例如:图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:

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

机动车号牌图像倾角θ=(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)与数学坐标系点映射关系如下:(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 The mapping relationship is as follows:

(2)坐标旋转;其次在数学坐标系中旋转机动车号牌图像;假设点围绕原点(0,0)逆时针旋转θ,旋转后坐标为建立映射关系如下:(2) Coordinate rotation; secondly, the motor vehicle license plate image is rotated in the mathematical coordinate system; hypothetical point Rotate θ counterclockwise around the origin (0,0), and the coordinates after rotation are Establish and The mapping relationship is as follows:

(3)数-图坐标变换:再次建立旋转时数学坐标与旋转后机动车号牌图像坐标之间映射关系,定义为数-图坐标变换;假设旋转后图像所在坐标系为新图像坐标系,W2和H2为新图像高度和宽度,旋转时数学坐标系原点(0,0)为旋转后新图像坐标系中点(0.5W2,0.5H2),新图像坐标系点与数学坐标系点映射关系如下:(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 Points with Mathematical Coordinate System The mapping relationship is as follows:

(4)像素赋值:经过上述图-数坐标变换、坐标旋转及数-图坐标变换后,旋转后机动车号牌图像的坐标与旋转前坐标(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 The mapping relationship with the coordinates (i, j) before rotation is as follows:

假设机动车号牌图像旋转后图像为I4,当公式(12)的同时为整数时,像素赋值如下:Assuming that the image of the motor vehicle number plate after rotation is I4, when the formula (12) and When both are integers, the pixel assignments are as follows:

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

当旋转后图像I4每个坐标都能与原图像I1坐标(i,j)建立映射时, When rotated image I4 each coordinate When the mapping can be established with the original image I1 coordinates (i, j),

当旋转后图像I4某坐标无法和原图像I1坐标(i,j)建立映射时,该坐标处像素值为空点;When rotated, a coordinate of image I4 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)相反,建立映射关系:(1) Graph-mathematical coordinate transformation: Contrary to step 6(3), establish and Mapping relations:

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

(3)数-图坐标变换:与步骤6(1)相反,建立与(i,j)映射关系:(3) Number-graph coordinate transformation: Contrary to step 6(1), establish Mapping relationship with (i,j):

(4)像素插值:经过上述图-数坐标变换、坐标旋转及数-图坐标变换后,旋转后机动车号牌图像的旋转前坐标(i,j)与旋转后坐标与映射关系如下:(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 The mapping relationship is as follows:

与步骤6中类似,当公式(17)的i或j不为整数时,(i,j)则为非图像坐标,假设为与(i,j)最近的左上、右上、左下、右下4个像素点,的行距离为c、列距离为d,用双线性插值方法估计值如下:Similar to step 6, when i or j in formula (17) is not an integer, (i, j) is a non-image coordinate, assuming is the 4 pixels of the upper left, upper right, lower left and lower right closest to (i, j), and The row distance is c and the column distance is d, which is estimated by bilinear interpolation The values are as follows:

例如:图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 (9)

1. a kind of automotive number plate image inclination angle correction system rotated based on least square method and coordinate, which is characterized in that packet It includes: edge calculations unit, Dip countion unit and rotation computing unit;
Edge calculations unit is used to calculate the edge pixel point of automotive number plate image;
Dip countion unit is for calculating automotive number plate image inclination angle;
Rotation computing unit is for correcting inclined automotive number plate image to straight.
2. the automotive number plate image inclination angle correction system rotated as described in claim 1 based on least square method and coordinate, It is characterized in that,
Edge calculations unit includes: automotive number plate Image Edge-Detection, the determination of automotive number plate image detection region;
Automotive number plate Image Edge-Detection: automotive number plate image is first gone into gray space, then computer from color space The horizontal gradient of motor-car number plate gray level image obtains automotive number plate edge image;
Automotive number plate image detection region determines: according to the feature of automotive number plate edge image, from upper and lower, left and right four Direction determines automotive number plate detection zone;
Dip countion unit includes: sample, the automotive number plate image Dip countion for choosing automotive number plate image Dip countion;
It chooses the sample of automotive number plate image Dip countion: choosing representative edge pixel in automotive number plate edge image Sample as Dip countion;
Automotive number plate image Dip countion: according to selected sample, automotive number plate image inclination angle is sought by least square method;
Rotating computing unit includes: automotive number plate image positive rotation, automotive number plate image reverse rotation;
Automotive number plate image positive rotation: rotating automotive number plate image coordinate according to the inclination angle, establishes before rotation and rotates Coordinate mapping relations afterwards, rotated image coordinate pixel value is according to mapping relations by coordinate pixel value corresponding before image rotation Assignment;
Automotive number plate image reverse rotation: for the null point in rotated image, the coordinate opposite direction of null point being rotated to original image, The coordinate mapping relations after rotation and before rotation are established, and automotive number plate image bilinear interpolation is corrected according to mapping.
3. a kind of automotive number plate image inclination angle antidote rotated based on least square method and coordinate, which is characterized in that packet Include following steps:
Step 1, automotive number plate color image is transformed to automotive number plate gray level image;
Step 2, the horizontal gradient for calculating automotive number plate gray level image obtains automotive number plate edge image;
Step 3, according to the feature of automotive number plate edge image, from upper and lower, left and right, four direction determines that automotive number plate is examined Survey region;
Step 4, sample of the representative edge pixel as Dip countion is chosen in automotive number plate edge image;
Step 5, according to selected sample, automotive number plate image inclination angle is sought by least square method;
Step 6, automotive number plate image coordinate is rotated according to the inclination angle, establishes before rotation and the mapping of postrotational coordinate is closed System, rotated image coordinate pixel value is according to mapping relations by coordinate pixel value assignment corresponding before image rotation;
Step 7, for the null point in rotated image, the coordinate opposite direction of null point is rotated to original image, establishes after rotation and revolves Coordinate mapping relations before turning, and automotive number plate image bilinear interpolation is corrected according to mapping.
4. the automotive number plate image inclination angle antidote rotated as claimed in claim 3 based on least square method and coordinate, It is characterized in that,
In step 2, according to the horizontal gradient of automotive number plate gray level image I2, automotive number plate edge image I3 is calculated, formula is such as Under:
Wherein th1 is threshold value: if automotive number plate pixel horizontal gradient is not less than th1, for edge pixel point.
5. the automotive number plate image inclination angle antidote rotated as claimed in claim 4 based on least square method and coordinate, It is characterized in that,
Step 3 specifically includes:
(1) up-and-down boundary: assuming that W1And H1Respectively I3 ranks size, row scanning I3, from top line by line down on Scanning Detction Boundary up, from least significant end up Scanning Detction lower boundary down line by line;
Wherein th2 is threshold value: being progressively scanned down from top, when certain row has th2 or more white point, then the line number of the row is up;It is up progressively scanned from least significant end, when certain row has th2 or more white point, then the line number of the row is down;
(2) right boundary: column scan I3, turn right Scanning Detction left margin left by column from the leftmost side, turns left by column from right end Scanning Detction right margin right;
Wherein th3 is threshold value: turning right and scans by column from left end, when certain shows th3 or more white point, then the columns of the column is left;It turns left and scans by column from right end, when certain shows th3 or more white point, then the columns of the column is right.
6. the automotive number plate image inclination angle antidote rotated as claimed in claim 5 based on least square method and coordinate, It is characterized in that,
Step 4 specifically includes: in automotive number plate edge image I3 left margin left, right margin right, coboundary up, following Within the scope of boundary down, while meeting the edge pixel point of formula (5) principle 1, principle 2 and principle 3, is Dip countion sample;
7. the automotive number plate image inclination angle antidote rotated as claimed in claim 6 based on least square method and coordinate, It is characterized in that,
Step 5 specifically includes:
Assuming that inclination angle sample point has m, row coordinate xk: k=1,2 ... m, column coordinate yk: k=1,2 ... m are distributed in straight line y= The two sides ax+b, it is slope, b is intercept, according to principle of least square method, it is as follows to establish objective function:
Seeking partial derivative respectively to a and b is zero:
Automotive number plate image inclination angle theta=(a/ π) * 180.
8. the automotive number plate image inclination angle antidote rotated as claimed in claim 7 based on least square method and coordinate, It is characterized in that,
Step 6 specifically includes:
(1) it figure-number coordinate transform: is mapped between mathematical coordinates when initially setting up the preceding automotive number plate image coordinate of rotation and rotation Relationship is defined as figure-number coordinate transform;Assuming that coordinate system is image coordinate system before automotive number plate image rotation, when rotation, is sat Mark system is mathematical coordinates system, image coordinate mooring points (0.5W1,0.5H1) it is mathematical coordinates system origin (0,0), image coordinate mooring points (i, j) and mathematical coordinates mooring pointsMapping relations are as follows:
(2) coordinate rotates;Secondly automotive number plate image is rotated in mathematical coordinates system;Postulated pointAround origin (0,0) Rotation θ counterclockwise, rotation recoil are designated asIt establishesWithMapping relations are as follows:
(3) it number-figure coordinate transform: is mapped between automotive number plate image coordinate after establishing mathematical coordinates when rotating again and rotating Relationship is defined as the coordinate transform of number-figure;Assuming that coordinate system where rotated image is new images coordinate system, W2And H2For new images Height and width, mathematical coordinates system origin (0,0) is new images coordinate system midpoint (0.5W after rotation when rotation2,0.5H2), it is new to scheme As coordinate mooring pointsWith mathematical coordinates mooring pointsMapping relations are as follows:
(4) pixel assignment: after above-mentioned figure-number coordinate transform, coordinate rotation and the coordinate transform of number-figure, motor vehicle after rotation The coordinate of number plate imagePreceding coordinate (i, j) mapping relations are as follows with rotating:
Assuming that image is I4 after automotive number plate image rotation, when formula (12)WithWhen being simultaneously integer, pixel assignment is such as Under:
When formula (12)OrWhen not being integer, since image coordinate is integer,It is then non-image coordinate, before rotation Pixel value at coordinate (i, j)It cannot be mapped as pixel value after rotating
When each coordinate of rotated image I4When mapping can be established with original image I1 coordinate (i, j),
When rotated image I4 coordinateWhen mapping can not be established with original image I1 coordinate (i, j), pixel value at the coordinate For null point.
9. the automotive number plate image inclination angle antidote rotated as claimed in claim 8 based on least square method and coordinate, It is characterized in that,
Step 7 specifically includes:
(1) figure-mathematical coordinates transformation: with step 6 (3) on the contrary, establishingWithMapping relations:
(2) coordinate rotate: with step 6 (2) on the contrary,θ is rotated clockwise around origin (0,0), rotation recoil is designated asIt establishesWithMapping relations are as follows:
(3) number-figure coordinate transform: with step 6 (1) on the contrary, establishingWith (i, j) mapping relations:
(4) picture element interpolation: after above-mentioned figure-number coordinate transform, coordinate rotation and the coordinate transform of number-figure, motor vehicle after rotation Coordinate (i, j) and coordinate after rotation before the rotation of number plate imageIt is as follows with mapping relations:
Similar with step 6, when the i or j of formula (17) are not integer, (i, j) is then non-image coordinate, it is assumed thatFor the upper left nearest with (i, j), upper right, lower-left, the pixel of bottom right 4,WithRow distance For c, column distance d, estimated with bilinear interpolation methodIt is worth as follows:
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 true CN110400259A (en) 2019-11-01
CN110400259B 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
CN110400259B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
CN107045629B (en) A multi-lane line detection method
CN109034047B (en) Lane line detection method and device
CN109785291B (en) Lane line self-adaptive detection method
CN107229908B (en) A kind of method for detecting lane lines
CN107862290B (en) Lane line detection method and system
CN105488501A (en) Method for correcting license plate slant based on rotating projection
JP3868876B2 (en) Obstacle detection apparatus and method
CN111444778B (en) A lane line detection method
JP4416039B2 (en) Striped pattern detection system, striped pattern detection method, and striped pattern detection program
CN108280450A (en) A kind of express highway pavement detection method based on lane line
EP2237988A2 (en) Object detection and recognition system
CN109635737A (en) Automobile navigation localization method is assisted based on pavement marker line visual identity
CN107284455A (en) A kind of ADAS systems based on image procossing
CN103440785B (en) One is traffic lane offset warning method fast
CN108256445A (en) Method for detecting lane lines and system
WO2020238073A1 (en) Method for determining orientation of target object, intelligent driving control method and apparatus, and device
CN110515092A (en) Planar touch method based on laser radar
CN108230356A (en) A kind of motor vehicles tracking based on perspective correction
CN106951896A (en) A kind of license plate image sloped correcting method
CN108846363A (en) A kind of subregion vehicle bottom shadow detection method based on divergence expression scanning
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
CN110400259B (en) Motor vehicle license plate image inclination angle correction system and method based on least square method and coordinate rotation
CN106780541B (en) An Improved Background Subtraction Method
CN105740796B (en) A Binarization Method of Lane Line Image after Perspective Transformation Based on Gray Histogram

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