Movatterモバイル変換


[0]ホーム

URL:


CN112488105A - License plate angle correction method, device, equipment and medium - Google Patents

License plate angle correction method, device, equipment and medium
Download PDF

Info

Publication number
CN112488105A
CN112488105ACN202011387171.6ACN202011387171ACN112488105ACN 112488105 ACN112488105 ACN 112488105ACN 202011387171 ACN202011387171 ACN 202011387171ACN 112488105 ACN112488105 ACN 112488105A
Authority
CN
China
Prior art keywords
license plate
image
target
connected domain
angle
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.)
Pending
Application number
CN202011387171.6A
Other languages
Chinese (zh)
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.)
Shenzhen Brilliants Smart Hardware Co ltd
Original Assignee
Shenzhen Brilliants Smart Hardware Co ltd
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 Shenzhen Brilliants Smart Hardware Co ltdfiledCriticalShenzhen Brilliants Smart Hardware Co ltd
Priority to CN202011387171.6ApriorityCriticalpatent/CN112488105A/en
Publication of CN112488105ApublicationCriticalpatent/CN112488105A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明实施例公开了一种车牌角度校正方法,该方法包括:对车牌类型进行预先分类,基于车牌类型确定合适的车牌标准模板,简化了后续步骤及提高校正的准确性。然后确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像。再对水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。本发明能对车牌角度进行校正,可解决车牌角度较大导致的车牌识别错误问题。此外,还提出了车牌角度校正装置、计算机设备和存储介质。

Figure 202011387171

The embodiment of the invention discloses a license plate angle correction method, the method includes: pre-classifying the license plate types, and determining a suitable license plate standard template based on the license plate types, which simplifies subsequent steps and improves the accuracy of correction. Then, the horizontal inclination angle of the target binarized image is determined, and the target binary image is rotated according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image. Then, project the horizontally corrected image to generate a projected waveform at each projection angle, determine the vertical tilt angle of the horizontally corrected image according to the projected waveform, and perform vertical correction on the horizontally corrected image according to the vertical tilted angle to obtain the license plate image. Correct the image. The invention can correct the angle of the license plate, and can solve the problem of incorrect license plate recognition caused by the large angle of the license plate. In addition, a license plate angle correction device, computer equipment and storage medium are also proposed.

Figure 202011387171

Description

Translated fromChinese
车牌角度校正方法、装置、设备和介质License plate angle correction method, device, equipment and medium

技术领域technical field

本发明涉及车牌校正技术领域,尤其是涉及车牌角度校正方法、装置、设备和介质。The present invention relates to the technical field of license plate correction, and in particular, to a method, device, equipment and medium for correcting license plate angle.

背景技术Background technique

车牌是对各车辆的编号与信息登记,其主要作用是通过车牌可以知道该车辆的所属地区,也可根据车牌查到该车辆的主人以及该车辆的登记信息。The license plate is the number and information registration of each vehicle. Its main function is to know the region of the vehicle through the license plate, and also to find the owner of the vehicle and the registration information of the vehicle according to the license plate.

在对停车场、道路收费路口等位置的车辆进行远程管理时,需要拍摄车辆的车牌号,从而了解到车辆及车主信息。但由于受摄像机的拍摄角度、车辆行驶方向等因素的干扰,常常拍摄到的车牌号是倾斜的,而这就增加了无论是人为识别车牌号还是人工智能自动识别车牌号的难度,甚至也可能导致识别错误,因此在识别车牌号之前对车牌号的倾斜角度进行校正就显得十分重要。When remotely managing vehicles in parking lots, road toll crossings, etc., it is necessary to photograph the license plate number of the vehicle, so as to know the information of the vehicle and the owner. However, due to the interference of the shooting angle of the camera, the driving direction of the vehicle and other factors, the number of the license plate that is often photographed is inclined, which increases the difficulty of recognizing the license plate number manually or automatically by artificial intelligence, or even possible. It leads to recognition errors, so it is very important to correct the inclination angle of the license plate number before recognizing the license plate number.

发明内容SUMMARY OF THE INVENTION

基于此,有必要针对上述问题,提供解决车牌图像存在倾斜的车牌角度校正方法、装置、设备和介质。Based on this, it is necessary to provide a license plate angle correction method, device, device and medium for solving the problem that the license plate image is tilted.

一种车牌角度校正方法,所述方法包括:A license plate angle correction method, the method comprising:

获取车牌图像,将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像;Obtain a license plate image, input the license plate image into a deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the target binarized image of the license plate image according to the license plate type ;

对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,根据所述水平倾斜角度对所述目标二值化图像进行旋转,得到所述车牌图像的水平校正图像;Extracting a connected domain from the target binarized image, and performing clustering processing on the extracted connected domain to obtain several target character connected domains in the target binary image, and determining the connected domain according to the target character connected domain. the horizontal inclination angle of the target binarized image, and rotating the target binarized image according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image;

将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像。Projecting the horizontally corrected image to generate a projection waveform at each projection angle, determining a vertical tilt angle of the horizontally corrected image according to the projected waveform, and applying the horizontally corrected image to the horizontally corrected image according to the vertical tilt angle Perform vertical correction to obtain the corrected image of the license plate image.

在其中一个实施例中,所述将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,包括:In one embodiment, inputting the license plate image into a deep learning model to determine the license plate type of the license plate image includes:

调整所述车牌图像的大小至目标尺寸,将大小调整后的车牌图像输入深度学习模型,提取所述车牌图像的背景颜色、字体颜色及单双层类型;Adjust the size of the license plate image to the target size, input the resized license plate image into the deep learning model, and extract the background color, font color and single-deck type of the license plate image;

根据所述背景颜色、所述字体颜色及所述单双层类型确定所述车牌图像的车牌类型。The license plate type of the license plate image is determined according to the background color, the font color, and the single-deck type.

在其中一个实施例中,所述对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像,包括:In one embodiment, the performing binarization processing on the license plate image, and determining the target binarized image of the license plate image according to the license plate type, includes:

对所述车牌图像进行局部阈值二值化处理,得到所述车牌图像对应的第一二值化图像;performing local threshold binarization processing on the license plate image to obtain a first binarized image corresponding to the license plate image;

对所述车牌图像进行全局阈值二值化处理,得到所述车牌图像对应的第二二值化图像;performing a global threshold binarization process on the license plate image to obtain a second binarized image corresponding to the license plate image;

获取所述车牌类型对应的标准二值化图像,将所述第一二值化图像及所述第二二值化图像提取连通域后,与车牌标准模板进行位置匹配,得到所述第一二值化图像的第一匹配度及所述第二二值化图像的第二匹配度;其中,所述车牌标准模板为根据国家车牌标准构建的与所述车牌类型匹配的位置模板;Obtain the standard binarized image corresponding to the license plate type, extract the connected domain from the first binarized image and the second binarized image, and perform position matching with the license plate standard template to obtain the first and second binarized images. The first matching degree of the valued image and the second matching degree of the second binarized image; wherein, the license plate standard template is a position template constructed according to the national license plate standard and matching the license plate type;

将所述第一匹配度与所述第二匹配度中匹配度较大的作为所述目标二值化图像。A larger matching degree of the first matching degree and the second matching degree is used as the target binarized image.

在其中一个实施例中,所述对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,包括:In one embodiment, the extraction of connected domains is performed on the target binarized image, and the extracted connected domains are clustered to obtain several connected domains of target characters in the target binary image, including :

根据所述目标二值化图像中每一像素点的灰度值对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到若干个疑似字符连通域;Extracting a connected domain from the target binarized image according to the gray value of each pixel in the target binarized image, and performing clustering processing on the extracted connected domain to obtain several suspected character connected domains;

获取字符连通域标准,根据所述字符连通域标准对所述疑似字符连通域进行筛选,将所述疑似字符连通域中满足所述字符连通域标准的作为所述目标字符连通域;其中,所述字符连通域标准包括与所述车牌类型匹配的高度差标准、宽高比标准、中心点垂直方向差值标准。Obtaining a character connected domain standard, screening the suspected character connected domain according to the character connected domain standard, and using the suspected character connected domain that satisfies the character connected domain standard as the target character connected domain; The character connected domain standard includes a height difference standard matching the license plate type, an aspect ratio standard, and a center point vertical direction difference standard.

在其中一个实施例中,所述根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,包括:In one embodiment, the determining the horizontal inclination angle of the target binarized image according to the target character connected domain includes:

获取每个所述目标字符连通域的中心位置,对每个所述目标字符连通域的中心位置进行线性拟合,得到所述目标字符连通域之间的中心连线;Obtain the center position of each said target character connected domain, perform linear fitting on the center position of each said target character connected domain, and obtain the center connection line between the said target character connected domain;

将所述中心连线与水平线相交,得到互余的两个夹角,将所述夹角中夹角角度较小的作为所述水平倾斜角度。Intersecting the center line and the horizontal line to obtain two mutually complementary included angles, and taking the smaller included angle among the included angles as the horizontal inclination angle.

在其中一个实施例中,所述将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,包括:In one embodiment, the projecting the horizontally corrected image to generate a projection waveform at each projection angle, and determining the vertical tilt angle of the horizontally corrected image according to the projected waveform, includes:

将所述水平校正图像中的每个像素点在至少一个投影角度上进行投影,生成在每个投影角度上的投影波形图;Projecting each pixel in the horizontally corrected image on at least one projection angle to generate a projection waveform at each projection angle;

获取在每个所述投影波形图内的波峰值及波谷值,根据所述波峰值及所述波谷值计算每个所述投影波形图的波峰波谷差值;acquiring the peak value and the trough value in each of the projected waveforms, and calculating the peak-to-valley difference of each of the projected waveforms according to the peak value and the trough value;

将所述投影波形图中波峰波谷差值最大的作为目标投影波形图,确定所述目标投影波形图对应的投影角度为垂直倾斜角度。The largest difference between peaks and valleys in the projected waveform is used as the target projected waveform, and the projection angle corresponding to the target projected waveform is determined as a vertical tilt angle.

在其中一个实施例中,所述根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像,包括:In one embodiment, performing vertical correction on the horizontally corrected image according to the vertical tilt angle to obtain a corrected image of the license plate image includes:

获取单位行高,根据所述垂直倾斜角度及所述单位行高计算所述水平校正图像中每个字符在每一单位行的水平移动像素;obtaining a unit line height, and calculating the horizontally shifted pixels of each character in each unit line in the horizontally corrected image according to the vertical tilt angle and the unit line height;

根据所述每一单位行的水平移动像素对所述水平校正图像中每个字符进行逐行水平移动,直至得到所述车牌图像的校正图像。Each character in the horizontally corrected image is horizontally moved line by line according to the horizontally shifted pixels of each unit line, until a corrected image of the license plate image is obtained.

一种车牌角度校正装置,所述装置包括:A license plate angle correction device, the device comprises:

二值化图像获取模块,用于获取车牌图像,将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像;A binarized image acquisition module is used to acquire a license plate image, input the license plate image into a deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the license plate type according to the license plate type. The target binarized image of the license plate image;

水平校正模块,用于对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,根据所述水平倾斜角度对所述目标二值化图像进行旋转,得到所述车牌图像的水平校正图像;The horizontal correction module is used to extract the connected domain of the target binarized image, and perform clustering processing on the extracted connected domain to obtain several target character connected domains in the target binary image. According to the target The character connected domain determines the horizontal inclination angle of the target binarized image, and rotates the target binary image according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image;

垂直校正模块,用于将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像。a vertical correction module, configured to project the horizontally corrected image, generate a projection waveform diagram at each projection angle, determine the vertical tilt angle of the horizontally corrected image according to the projection waveform diagram, and determine the vertical tilt angle of the horizontally corrected image according to the vertical tilt angle The horizontal correction image is corrected in the vertical direction to obtain the corrected image of the license plate image.

一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:A computer-readable storage medium storing a computer program, when the computer program is executed by a processor, the processor causes the processor to perform the following steps:

获取车牌图像,将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像;Obtain a license plate image, input the license plate image into a deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the target binarized image of the license plate image according to the license plate type ;

对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,根据所述水平倾斜角度对所述目标二值化图像进行旋转,得到所述车牌图像的水平校正图像;Extracting a connected domain from the target binarized image, and performing clustering processing on the extracted connected domain to obtain several target character connected domains in the target binary image, and determining the connected domain according to the target character connected domain. the horizontal inclination angle of the target binarized image, and rotating the target binarized image according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image;

将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像。Projecting the horizontally corrected image to generate a projection waveform at each projection angle, determining a vertical tilt angle of the horizontally corrected image according to the projected waveform, and applying the horizontally corrected image to the horizontally corrected image according to the vertical tilt angle Perform vertical correction to obtain the corrected image of the license plate image.

一种车牌角度校正设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:A license plate angle correction device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the following steps:

获取车牌图像,将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像;Obtain a license plate image, input the license plate image into a deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the target binarized image of the license plate image according to the license plate type ;

对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,根据所述水平倾斜角度对所述目标二值化图像进行旋转,得到所述车牌图像的水平校正图像;Extracting a connected domain from the target binarized image, and performing clustering processing on the extracted connected domain to obtain several target character connected domains in the target binary image, and determining the connected domain according to the target character connected domain. the horizontal inclination angle of the target binarized image, and rotating the target binarized image according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image;

将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像。Projecting the horizontally corrected image to generate a projection waveform at each projection angle, determining a vertical tilt angle of the horizontally corrected image according to the projected waveform, and applying the horizontally corrected image to the horizontally corrected image according to the vertical tilt angle Perform vertical correction to obtain the corrected image of the license plate image.

本发明提供了车牌角度校正方法、装置、设备和介质,对车牌类型进行预先分类,基于车牌类型确定合适的车牌标准模板,简化了后续步骤及提高校正的准确性。然后确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像。再对水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。本发明能对车牌角度进行校正,可解决车牌角度较大导致的车牌识别错误问题。The invention provides a license plate angle correction method, device, equipment and medium, which pre-classifies the license plate types, determines a suitable license plate standard template based on the license plate types, simplifies subsequent steps and improves the accuracy of correction. Then, the horizontal inclination angle of the target binarized image is determined, and the target binarized image is rotated according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image. Then, the horizontal correction image is projected to generate a projection waveform at each projection angle, the vertical tilt angle of the horizontal correction image is determined according to the projection waveform, and the horizontal correction image is corrected vertically according to the vertical tilt angle to obtain the license plate image. Correct the image. The invention can correct the angle of the license plate, and can solve the problem of incorrect license plate recognition caused by the large angle of the license plate.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.

其中:in:

图1为一个实施例中车牌角度校正方法的流程示意图;1 is a schematic flowchart of a method for correcting a license plate angle in one embodiment;

图2为一个实施例中两张车牌图像的示意图;2 is a schematic diagram of two license plate images in one embodiment;

图3为一个实施例中目标字符连通域的外接矩形框的示意图;Fig. 3 is the schematic diagram of the circumscribed rectangle frame of target character connected domain in one embodiment;

图4为一个实施例中车牌图像的水平校正图像的示意图;4 is a schematic diagram of a horizontally corrected image of a license plate image in one embodiment;

图5为一个实施例中投影波形图的示意图;5 is a schematic diagram of a projected waveform diagram in one embodiment;

图6为一个实施例中确定bc单位行的水平移动像素的示意图;6 is a schematic diagram of determining horizontally shifted pixels of a bc unit row in one embodiment;

图7为一个实施例中车牌图像的校正图像的示意图;7 is a schematic diagram of a corrected image of a license plate image in one embodiment;

图8为一个实施例中车牌角度校正装置的结构示意图;8 is a schematic structural diagram of a license plate angle correction device in one embodiment;

图9为一个实施例中车牌角度校正设备的结构框图。FIG. 9 is a structural block diagram of a license plate angle correction device in one embodiment.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

如图1所示,图1为一个实施例中车牌角度校正方法的流程示意图,本实施例中车牌角度校正方法提供的步骤包括:As shown in FIG. 1, FIG. 1 is a schematic flowchart of a license plate angle correction method in one embodiment. The steps provided by the license plate angle correction method in this embodiment include:

步骤102,获取车牌图像,将车牌图像输入深度学习模型以确定车牌图像的车牌类型,对车牌图像进行二值化处理,根据车牌类型确定车牌图像的目标二值化图像。Step 102: Obtain a license plate image, input the license plate image into the deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the target binarized image of the license plate image according to the license plate type.

根据《中华人民共和国机动车号牌》的规定,不同车牌类型的车牌在外廓尺寸、颜色等方面都有着各自统一的标准。而正确的确定拍摄的车牌图像的标准能简化后续二值化图像的选择步骤,且提高车牌字符分割及识别校正的准确性,相反则会增加后续不必要的运算步骤,对角度校正造成干扰,因此预先确定车牌类型就十分重要。二值化使图像中数据量大为减少,从而能凸显出图像中字符的轮廓,便于后续确定字符在垂直方向及水平方向的倾斜角度。According to the provisions of the "Motor Vehicle License Plates of the People's Republic of China", the license plates of different license plate types have their own unified standards in terms of outline size and color. Correctly determining the standard of the captured license plate image can simplify the selection steps of subsequent binarized images, and improve the accuracy of license plate character segmentation and recognition and correction. On the contrary, it will increase the subsequent unnecessary operation steps and cause interference to the angle correction. Therefore, it is very important to determine the license plate type in advance. Binarization greatly reduces the amount of data in the image, so that the outline of the characters in the image can be highlighted, which is convenient for subsequent determination of the inclination angles of the characters in the vertical and horizontal directions.

在一个具体实施例中,为获取车牌图像的车牌类型,将摄像头拍摄得到的BGR三通道彩色图像缩小至336*208大小,并输入训练好的CNN(Convolutional Neural Networks,卷积神经网络)深度学习检测模型来提取车牌图像的主要特征,包括背景颜色、字体颜色及单双层类型等特征。因为车牌种类较多,基于《中华人民共和国机动车号牌》,我们按背景颜色、字体颜色及单双层类型(单,双层)将所有的车牌分为7大类,分别为:1、单层蓝牌,单层黑牌(白字)2、单层黄牌(黑字)3、单层白牌(黑字)4、单层绿牌(黑字)5、单层绿牌(白字)6、双层黄牌(黑字)7、双层白牌(黑字)。示例性的,参见图2,图2为两张车牌图像的示意图,其中A实际为单层蓝牌(白字),B实际为单层白牌(黑字),这两类车牌在字符间隔、字符宽度、字符高度、字符颜色等方面存在着差异,这对后续的计算会造成一定影响,因此进行区分。In a specific embodiment, in order to obtain the license plate type of the license plate image, the BGR three-channel color image captured by the camera is reduced to a size of 336*208, and the trained CNN (Convolutional Neural Networks, convolutional neural network) deep learning is input. The detection model is used to extract the main features of the license plate image, including features such as background color, font color, and single-deck type. Because there are many types of license plates, based on the "Motor Vehicle License Plates of the People's Republic of China", we divide all license plates into 7 categories according to the background color, font color and single-layer type (single, double-layer), namely: 1. Single-layer blue card, single-layer black card (white characters) 2, single-layer yellow card (black characters) 3, single-layer white card (black characters) 4, single-layer green card (black characters) 5, single-layer green card (white characters) 6. Double-layer yellow card (black characters) 7. Double-layer white card (black characters). Exemplarily, see FIG. 2, which is a schematic diagram of two license plate images, wherein A is actually a single-layer blue license plate (white characters), and B is actually a single-layer white license plate (black characters). There are differences in character width, character height, character color, etc., which will have a certain impact on subsequent calculations, so they are distinguished.

由于车牌采集的场景或设备不同,采集的车牌图像会存在着清晰度的差异。而针对清楚车牌和模糊车牌需要采取不同的二值化方式,否则确定字符轮廓的效果就会不佳。二值化处理的方式包括局部阈值二值化处理及全局阈值二值化处理,在车牌图像出现反光或比较模糊时,采用前一种方法能完整的提取出字符轮廓,但采用后一种方法效果就会很差。而在车牌图像比较清楚的时候,采用后一种方法干扰很少,轮廓提取效果明显优于前一种方法。Due to the different scenes or devices used to collect license plates, there will be differences in the clarity of the collected license plate images. For the clear license plate and the fuzzy license plate, different binarization methods need to be adopted, otherwise the effect of determining the character outline will be poor. The binarization processing methods include local threshold binarization processing and global threshold binarization processing. When the license plate image is reflective or relatively blurred, the former method can completely extract the character outline, but the latter method is used. The effect will be poor. When the license plate image is relatively clear, the latter method has little interference, and the contour extraction effect is obviously better than the former method.

在一个具体实施例中,为了提高算法鲁棒性,同时对车牌图像进行局部阈值二值化处理和全局阈值二值化处理,选取效果较好的二值化处理方法为最终结果。具体的,局部阈值二值化处理的方式为,对于车牌图像中的某一个目标像素点,根据周围范围内像素的灰度均值及经验阈值来确定该目标像素点的灰度值,即:In a specific embodiment, in order to improve the robustness of the algorithm, local threshold binarization processing and global threshold binarization processing are simultaneously performed on the license plate image, and the binarization processing method with better effect is selected as the final result. Specifically, the method of local threshold binarization is that, for a certain target pixel in the license plate image, the gray value of the target pixel is determined according to the average gray value of the pixels in the surrounding range and the empirical threshold, that is:

if(x>Aver+Thr)if(x>Aver+Thr)

y=1;y=1;

elseelse

y=0;y = 0;

其中,x是灰度图像中的一个目标像素点,Aver是目标像素点x周围15*7范围内像素的均值,Thr是一个经验阈值,我们实际应用中根据图像的清晰度来浮动设置Thr的取值。全局阈值二值化处理的方式为,按图像的灰度特性,将图像分成背景和前景两部分,因方差是灰度分布均匀性的一种度量,背景和前景之间的类间方差越大,说明构成图像的两部分的差别越大,调整全局阈值,使类间方差最大。经过上述处理,可得到局部阈值二值化处理后的第一二值化图像,及全局阈值二值化处理后的第二二值化图像。Among them, x is a target pixel in the grayscale image, Aver is the average value of pixels in the range of 15*7 around the target pixel x, and Thr is an empirical threshold. In practical applications, we set the Thr value to float according to the clarity of the image. value. The method of global threshold binarization is to divide the image into two parts: background and foreground according to the grayscale characteristics of the image. Because variance is a measure of the uniformity of grayscale distribution, the greater the inter-class variance between background and foreground , indicating that the greater the difference between the two parts of the image, the global threshold is adjusted to maximize the variance between classes. After the above process, a first binarized image after local threshold binarization and a second binarized image after global threshold binarization can be obtained.

然后,获取车牌类型对应的车牌标准模板,该车牌标准模板为根据《中华人民共和国机动车号牌》构建的与车牌类型匹配的字符位置模板,将第一二值化图像及第二二值化图像提取的字符连通域与车牌标准模板进行位置匹配,根据两者的位置重合度来评价匹配度,分别得到第一二值化图像的第一匹配度及第二二值化图像的第二匹配度,将第一匹配度与第二匹配度中匹配度较大的作为目标二值化图像。Then, the license plate standard template corresponding to the license plate type is obtained. The license plate standard template is a character position template matching the license plate type constructed according to the "Motor Vehicle License Plate of the People's Republic of China", and the first binarized image and the second binarized image are The character connected domain extracted from the image is subjected to position matching with the license plate standard template, and the matching degree is evaluated according to the positional coincidence of the two, and the first matching degree of the first binarized image and the second matching of the second binarized image are obtained respectively. The first matching degree and the second matching degree have the larger matching degree as the target binarized image.

步骤104,对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到目标二值化图像中的若干个目标字符连通域,根据目标字符连通域确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像。Step 104: Extract the connected domain of the target binarized image, perform clustering processing on the extracted connected domain, obtain several target character connected domains in the target binary image, and determine the target binary image according to the target character connected domain Rotate the target binarized image according to the horizontal inclination angle to obtain the horizontally corrected image of the license plate image.

具体的,根据目标二值化图像中每一像素点的灰度值对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到若干个疑似字符连通域,即将局部区域内灰度值为1且连通的像素点作为疑似字符连通域。同时考虑到干扰因素的存在,对这些疑似字符连通域进行筛选。获取字符连通域标准,该字符连通域标准包括车牌字符之间的高度差标准、宽高比标准、中心点垂直方向差值标准,根据字符连通域标准对疑似字符连通域进行筛选,即要求目标字符连通域字符需在高度差,宽高比,中心点垂直方向差值满足如下三个条件:Specifically, according to the gray value of each pixel in the target binarized image, the connected domain is extracted from the target binarized image, and the extracted connected domain is clustered to obtain several suspected character connected domains, that is, the local area. The pixels whose inner gray value is 1 and are connected are regarded as the connected domain of suspected characters. At the same time, considering the existence of interference factors, the connected domains of these suspected characters are screened. Obtain the character connected domain standard, which includes the height difference standard between license plate characters, the aspect ratio standard, and the center point vertical difference standard, and filter the suspected character connected domain according to the character connected domain standard, that is, the target is required. Character connected domain characters must satisfy the following three conditions in height difference, aspect ratio, and vertical difference of center point:

abs(H1–H2)<Thr1abs(H1–H2)<Thr1

Thr2<W/H<Thr3Thr2<W/H<Thr3

abs(Y1–Y2)<Thr4abs(Y1–Y2)<Thr4

其中,H为连通域高度(H1,H2表示相邻的两个连通域的高度),W为连通域宽度,Y为连通域中心点的垂直高度(Y1,Y2表示相邻的两个连通域中心点的垂直高度),Thr1,Thr2,Thr3,Thr4是总结的先验条件值。将疑似字符连通域中满足字符连通域标准的作为目标字符连通域。Among them, H is the height of the connected domain (H1, H2 represent the height of two adjacent connected domains), W is the width of the connected domain, and Y is the vertical height of the center point of the connected domain (Y1, Y2 represent the two adjacent connected domains). vertical height of the center point), Thr1, Thr2, Thr3, Thr4 are the summed priori condition values. The target character connected domain that satisfies the character connected domain standard in the suspected character connected domain is taken.

参见图3,图3为目标字符连通域的外接矩形框的示意图,根据外接矩形框的位置确定每个目标字符连通域的中心位置,得到一组点,利用最小二乘法对这些点进行线性拟合,拟合出一条中心连线。其中,最小二乘法是解决曲线拟合问题最常用的方法,其基本思路是令直线f(x)满足如下条件:Referring to Fig. 3, Fig. 3 is a schematic diagram of the circumscribed rectangular frame of the connected domain of the target character. According to the position of the circumscribed rectangular frame, the central position of the connected domain of each target character is determined to obtain a set of points, and the least squares method is used to perform linear simulation on these points. to fit a center line. Among them, the least squares method is the most commonly used method to solve the curve fitting problem. The basic idea is to make the straight line f(x) satisfy the following conditions:

Figure BDA0002811290470000091
Figure BDA0002811290470000091

其中,

Figure BDA0002811290470000092
是事先选定的一组线性无关的函数,ak是待定系数,(k=1,2,…,m,m<n)。拟合准则是使yi(i=1,2,…,n)与f(x)的距离的平方和最小。将拟合得到的中心连线与水平线相交,得到互余的两个夹角,再将夹角中夹角角度较小的作为水平倾斜角度,实际就是目标字符连通域一侧的中心连线水平线的夹角。此时中心连线与水平线相交会形成一个交点,以该交点为旋转原点对目标二值化图像中的每个目标字符连通域进行旋转,直至所有目标字符连通在水平线上保持齐平,参见图4,得到图4所示的车牌图像的水平校正图像。in,
Figure BDA0002811290470000092
is a set of linearly independent functions selected in advance, ak is an undetermined coefficient, (k=1, 2, ..., m, m<n). The fitting criterion is to minimize the sum of squares of the distances of yi (i=1,2,...,n) and f(x). Intersect the fitted center line and the horizontal line to obtain two complementary angles, and then take the smaller angle as the horizontal inclination angle, which is actually the horizontal line of the center line on the connected domain side of the target character. angle. At this time, the intersection of the center line and the horizontal line will form an intersection, and the connected domain of each target character in the target binarized image is rotated with the intersection as the rotation origin, until all target characters are connected on the horizontal line and remain flush, see Fig. 4. Obtain the horizontally corrected image of the license plate image shown in FIG. 4 .

步骤106,将水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。Step 106: Project the horizontally corrected image to generate a projected waveform at each projection angle, determine the vertical tilt angle of the horizontally corrected image according to the projected waveform, and perform vertical correction on the horizontally corrected image according to the vertical tilted angle to obtain a license plate Corrected image of the image.

具体的,将水平校正图像中的每个像素点在至少一个投影角度上进行投影,生成在每个投影角度上的投影波形图。示例性的,参见图4,将水平校正图像中的每个像素点按照箭头所示的角度进行投影,即根据箭头的角度对每一列的黑点、白点从上到下从新确定排列位置,并将黑点的位置排列在下、白点的位置排列在上,最终得到如图5所示的在该箭头的投影角度上的投影波形图。然后获取在每个投影波形图内的波峰值及波谷值,即统计图5中每一列的黑点个数,根据波峰值及波谷值计算在该投影波形图的波峰波谷差值。按各个角度对水平校正图像进行投影,并计算在每个投影波形图的波峰波谷差值。将投影波形图中波峰波谷差值最大的作为目标投影波形图,确定目标投影波形图对应的投影角度为垂直倾斜角度。Specifically, each pixel in the horizontally corrected image is projected on at least one projection angle to generate a projection waveform at each projection angle. Exemplarily, referring to FIG. 4, each pixel in the horizontal correction image is projected according to the angle shown by the arrow, that is, the arrangement position of the black and white points of each column is re-determined from top to bottom according to the angle of the arrow, The positions of the black dots are arranged at the bottom and the positions of the white dots are arranged at the top, and finally the projected waveform diagram on the projection angle of the arrow as shown in FIG. 5 is obtained. Then obtain the peak value and trough value in each projected waveform, that is, count the number of black dots in each column in Figure 5, and calculate the peak-to-valley difference in the projected waveform according to the peak and trough values. The horizontally corrected images are projected at various angles, and the difference between the peaks and valleys of each projected waveform is calculated. The largest difference between peaks and valleys in the projected waveform is taken as the target projected waveform, and the projection angle corresponding to the target projected waveform is determined as the vertical tilt angle.

参见图6,图6为确定bc单位行的水平移动像素的示意图。在图6中,ab所在直线为垂直方向校准的基准线,其中a点为该基准线的起点,b点表示目标单位所在的垂直位置,ab的长度则表示目标单位的单位行高,而c位于目标单位行内,bc表示所代表的目标单位行。首先获取bc单位行的单位行高ab,再基于单位行高ab和水平移动像素在bc单位行存在垂直倾斜角度的正切关系,因此可求得在bc单位行的水平移动像素。同理基于其他单位行的单位行高可求得其他单位行的水平移动像素。再根据每一单位行的水平移动像素对水平校正图像中每个字符进行逐行水平移动,直至得到如图7所示的车牌图像的校正图像。Referring to FIG. 6, FIG. 6 is a schematic diagram of determining the horizontally shifted pixels of the bc unit row. In Figure 6, the line where ab is located is the reference line for vertical calibration, where point a is the starting point of the reference line, point b represents the vertical position of the target unit, the length of ab represents the unit row height of the target unit, and c Within the target unit row, bc represents the target unit row represented. First, the unit row height ab of the bc unit row is obtained, and then based on the unit row height ab and the horizontally shifted pixel, there is a tangent relationship of the vertical inclination angle in the bc unit row, so the horizontally shifted pixel in the bc unit row can be obtained. Similarly, based on the unit row heights of other unit rows, the horizontally shifted pixels of other unit rows can be obtained. Then, each character in the horizontally corrected image is moved horizontally line by line according to the horizontally shifted pixels of each unit line, until the corrected image of the license plate image as shown in FIG. 7 is obtained.

上述车牌角度校正方法,对车牌类型进行预先分类,基于车牌类型确定合适的车牌标准模板,简化了后续步骤及提高校正的准确性。然后确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像。再对水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。本发明能对车牌角度进行校正,可解决车牌角度较大导致的车牌识别错误问题。The above license plate angle correction method pre-classifies the license plate types, and determines an appropriate license plate standard template based on the license plate type, which simplifies the subsequent steps and improves the accuracy of the correction. Then, the horizontal inclination angle of the target binarized image is determined, and the target binarized image is rotated according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image. Then, the horizontal correction image is projected to generate a projection waveform at each projection angle, the vertical tilt angle of the horizontal correction image is determined according to the projection waveform, and the horizontal correction image is corrected vertically according to the vertical tilt angle to obtain the license plate image. Correct the image. The invention can correct the angle of the license plate, and can solve the problem of incorrect license plate recognition caused by the large angle of the license plate.

在一个实施例中,如图8所示,提出了一种车牌角度校正装置,该装置包括:In one embodiment, as shown in FIG. 8, a license plate angle correction device is proposed, which includes:

二值化图像获取模块802,用于获取车牌图像,将车牌图像输入深度学习模型以确定车牌图像的车牌类型,对车牌图像进行二值化处理,根据车牌类型确定车牌图像的目标二值化图像;The binarizedimage acquisition module 802 is configured to acquire the license plate image, input the license plate image into the deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the target binarized image of the license plate image according to the license plate type ;

水平校正模块804,用于对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到目标二值化图像中的若干个目标字符连通域,根据目标字符连通域确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像;Thehorizontal correction module 804 is used to extract the connected domain of the target binary image, perform clustering processing on the extracted connected domain, obtain several target character connected domains in the target binary image, and determine the target according to the target character connected domain The horizontal inclination angle of the binarized image, rotate the target binarized image according to the horizontal inclination angle, and obtain the horizontal correction image of the license plate image;

垂直校正模块806,用于将水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。Thevertical correction module 806 is used for projecting the horizontally corrected image, generating a projection waveform diagram at each projection angle, determining the vertical tilt angle of the horizontally corrected image according to the projection waveform diagram, and performing the vertical direction on the horizontally corrected image according to the vertical tilt angle. Correction to obtain the corrected image of the license plate image.

上述车牌角度校正装置,对车牌类型进行预先分类,基于车牌类型确定合适的车牌标准模板,简化了后续步骤及提高校正的准确性。然后确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像。再对水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。本发明能对车牌角度进行校正,可解决车牌角度较大导致的车牌识别错误问题。The above-mentioned license plate angle correction device pre-classifies the license plate types, and determines an appropriate license plate standard template based on the license plate types, which simplifies the subsequent steps and improves the accuracy of correction. Then, the horizontal inclination angle of the target binarized image is determined, and the target binarized image is rotated according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image. Then, the horizontal correction image is projected to generate a projection waveform at each projection angle, the vertical tilt angle of the horizontal correction image is determined according to the projection waveform, and the horizontal correction image is corrected vertically according to the vertical tilt angle to obtain the license plate image. Correct the image. The invention can correct the angle of the license plate, and can solve the problem of incorrect license plate recognition caused by the large angle of the license plate.

在一个实施例中,二值化图像获取模块802,还具体用于:调整车牌图像的大小至目标尺寸,将大小调整后的车牌图像输入深度学习模型,提取车牌图像的背景颜色、字体颜色及单双层类型;根据背景颜色、字体颜色及单双层类型确定车牌图像的车牌类型。In one embodiment, the binarizedimage acquisition module 802 is further specifically configured to: adjust the size of the license plate image to the target size, input the resized license plate image into the deep learning model, and extract the background color, font color and Single-deck type; determine the license plate type of the license plate image according to the background color, font color and single-deck type.

在一个实施例中,二值化图像获取模块802,还具体用于:对车牌图像进行局部阈值二值化处理,得到车牌图像对应的第一二值化图像;对车牌图像进行全局阈值二值化处理,得到车牌图像对应的第二二值化图像;获取车牌类型对应的标准二值化图像,将第一二值化图像及第二二值化图像提取的字符连通域,与标准车牌模板进行位置匹配,选择位置重合度高的。In one embodiment, the binarizedimage acquisition module 802 is further specifically configured to: perform local threshold binarization processing on the license plate image to obtain a first binarized image corresponding to the license plate image; perform global threshold binarization on the license plate image Obtain the second binarized image corresponding to the license plate image; obtain the standard binarized image corresponding to the license plate type, and combine the character connected domain extracted from the first binarized image and the second binarized image with the standard license plate template For position matching, select the one with a high degree of position coincidence.

在一个实施例中,水平校正模块804,还具体用于:根据目标二值化图像中每一像素点的灰度值对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到若干个疑似字符连通域;获取字符连通域标准,根据字符连通域标准对疑似字符连通域进行筛选,将疑似字符连通域中满足字符连通域标准的作为目标字符连通域。In one embodiment, thehorizontal correction module 804 is further specifically configured to: extract the connected domain of the target binarized image according to the gray value of each pixel in the target binarized image, and perform clustering on the extracted connected domain Process to obtain several suspected character connected domains; obtain the character connected domain standard, filter the suspected character connected domain according to the character connected domain standard, and use the suspected character connected domain that satisfies the character connected domain standard as the target character connected domain.

在一个实施例中,水平校正模块804,还具体用于:获取每个目标字符连通域的中心位置,对每个目标字符连通域的中心位置进行线性拟合,得到目标字符连通域之间的中心连线;将中心连线与水平线相交,得到互余的两个夹角,将夹角中夹角角度较小的作为水平倾斜角度。In one embodiment, thelevel correction module 804 is further specifically configured to: obtain the center position of each target character connected domain, perform linear fitting on the center position of each target character connected domain, and obtain the difference between the target character connected domains. Center connection line; intersect the center connection line with the horizontal line to obtain two complementary angles, and take the smaller angle as the horizontal inclination angle.

在一个实施例中,垂直校正模块806,还具体用于:将水平校正图像中的每个像素点在至少一个投影角度上进行投影,生成在每个投影角度上的投影波形图;获取在每个投影波形图内的波峰值及波谷值,根据波峰值及波谷值计算每个投影波形图的波峰波谷差值;将投影波形图中波峰波谷差值最大的作为目标投影波形图,确定目标投影波形图对应的投影角度为垂直倾斜角度。In one embodiment, thevertical correction module 806 is further specifically configured to: project each pixel in the horizontally corrected image on at least one projection angle to generate a projection waveform at each projection angle; The peak and trough values in each projected waveform graph are calculated according to the peak value and trough value of each projected waveform graph; The projection angle corresponding to the waveform graph is the vertical tilt angle.

在一个实施例中,垂直校正模块806,还具体用于:获取单位行高,根据垂直倾斜角度及单位行高计算水平校正图像中每个字符在每一单位行的水平移动像素;根据每一单位行的水平移动像素对水平校正图像中每个字符进行逐行水平移动,直至得到车牌图像的校正图像。In one embodiment, thevertical correction module 806 is further specifically configured to: obtain the unit line height, and calculate the horizontally shifted pixels of each character in each unit line in the horizontally corrected image according to the vertical tilt angle and the unit line height; Each character in the horizontally corrected image is horizontally moved line by line by the horizontally moving pixels of the unit line until the corrected image of the license plate image is obtained.

图9示出了一个实施例中车牌角度校正设备的内部结构图。如图9所示,该车牌角度校正设备包括通过系统总线连接的处理器、存储器和网络接口。其中,存储器包括非易失性存储介质和内存储器。该车牌角度校正设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现车牌角度校正方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行车牌角度校正方法。本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的车牌角度校正设备的限定,具体的车牌角度校正设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。FIG. 9 shows the internal structure diagram of the license plate angle correction device in one embodiment. As shown in FIG. 9 , the license plate angle correction device includes a processor, a memory and a network interface connected through a system bus. Wherein, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the license plate angle correction device stores an operating system, and also stores a computer program. When the computer program is executed by the processor, the processor can realize the license plate angle correction method. A computer program may also be stored in the internal memory, and when the computer program is executed by the processor, the processor may execute the license plate angle correction method. Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the license plate angle correction device to which the solution of the present application is applied. The angle correction device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.

一种车牌角度校正设备,包括存储器、处理器以及存储在该存储器中并可在该处理器上执行的计算机程序,该处理器执行该计算机程序时实现如下步骤:获取车牌图像,将车牌图像输入深度学习模型以确定车牌图像的车牌类型,对车牌图像进行二值化处理,根据车牌类型确定车牌图像的目标二值化图像;对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到目标二值化图像中的若干个目标字符连通域,根据目标字符连通域确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像;将水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。A license plate angle correction device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implements the following steps when executing the computer program: acquiring a license plate image, inputting the license plate image The deep learning model determines the license plate type of the license plate image, performs binarization processing on the license plate image, and determines the target binarized image of the license plate image according to the license plate type; Clustering process to obtain several target character connected domains in the target binary image, determine the horizontal inclination angle of the target binary image according to the target character connected domain, rotate the target binary image according to the horizontal inclination angle, and obtain the license plate The horizontally corrected image of the image; the horizontally corrected image is projected to generate a projection waveform at each projection angle, the vertical tilt angle of the horizontally corrected image is determined according to the projected waveform, and the horizontally corrected image is corrected vertically according to the vertical tilt angle. , to get the corrected image of the license plate image.

在一个实施例中,将车牌图像输入深度学习模型以确定车牌图像的车牌类型,包括:调整车牌图像的大小至目标尺寸,将大小调整后的车牌图像输入深度学习模型,提取车牌图像的背景颜色、字体颜色及单双层类型;根据背景颜色、字体颜色及单双层类型确定车牌图像的车牌类型。In one embodiment, inputting the license plate image into the deep learning model to determine the license plate type of the license plate image includes: adjusting the size of the license plate image to a target size, inputting the resized license plate image into the deep learning model, and extracting the background color of the license plate image , font color and single-deck type; determine the license plate type of the license plate image according to the background color, font color and single-deck type.

在一个实施例中,对车牌图像进行二值化处理,根据车牌类型确定车牌图像的目标二值化图像,包括:对车牌图像进行局部阈值二值化处理,得到车牌图像对应的第一二值化图像;对车牌图像进行全局阈值二值化处理,得到车牌图像对应的第二二值化图像;获取车牌类型对应的车牌标准模板,将第一二值化图像及第二二值化图像提取的字符连通域后,与车牌标准模板进行位置匹配,得到第一二值化图像的第一匹配度及第二二值化图像的第二匹配度;将第一匹配度与第二匹配度中匹配度较大的作为目标二值化图像。In one embodiment, performing binarization processing on the license plate image, and determining the target binarized image of the license plate image according to the license plate type, includes: performing local threshold binarization processing on the license plate image to obtain a first binary value corresponding to the license plate image. image; perform global threshold binarization processing on the license plate image to obtain the second binarized image corresponding to the license plate image; obtain the license plate standard template corresponding to the license plate type, and extract the first binarized image and the second binarized image After the character connected domain of , the position matching is performed with the license plate standard template to obtain the first matching degree of the first binarized image and the second matching degree of the second binarized image; the first matching degree and the second matching degree are The larger matching degree is used as the target binarized image.

在一个实施例中,对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到目标二值化图像中的若干个目标字符连通域,包括:根据目标二值化图像中每一像素点的灰度值对目标二值化图像进行聚类处理,得到若干个疑似字符连通域;获取字符连通域标准,根据字符连通域标准对疑似字符连通域进行筛选,将疑似字符连通域中满足字符连通域标准的作为目标字符连通域。In one embodiment, a connected domain is extracted from the target binarized image, and the extracted connected domain is clustered to obtain several target character connected domains in the target binarized image, including: according to the target binarized image The gray value of each pixel in the target binarized image is clustered, and several suspected character connected domains are obtained; the character connected domain standard is obtained, and the suspected character connected domain is screened according to the character connected domain standard, and the suspected character In the connected domain, the character connected domain that satisfies the character connected domain standard is regarded as the target character connected domain.

在一个实施例中,根据目标字符连通域确定目标二值化图像的水平倾斜角度,包括:获取每个目标字符连通域的中心位置,对每个目标字符连通域的中心位置进行线性拟合,得到目标字符连通域之间的中心连线;将中心连线与水平线相交,得到互余的两个夹角,将夹角中夹角角度较小的作为水平倾斜角度。In one embodiment, determining the horizontal inclination angle of the target binarized image according to the target character connected domain includes: acquiring the center position of each target character connected domain, and performing linear fitting on the central position of each target character connected domain, Obtain the center line between the connected domains of the target characters; intersect the center line with the horizontal line to obtain two complementary angles, and take the smaller angle as the horizontal inclination angle.

在一个实施例中,将水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,包括:将水平校正图像中的每个像素点在至少一个投影角度上进行投影,生成在每个投影角度上的投影波形图;获取在每个投影波形图内的波峰值及波谷值,根据波峰值及波谷值计算每个投影波形图的波峰波谷差值;将投影波形图中波峰波谷差值最大的作为目标投影波形图,确定目标投影波形图对应的投影角度为垂直倾斜角度。In one embodiment, projecting the horizontally corrected image to generate a projection waveform diagram at each projection angle, and determining the vertical tilt angle of the horizontally corrected image according to the projected waveform diagram, includes: converting each pixel in the horizontally corrected image Perform projection on at least one projection angle to generate a projected waveform at each projection angle; obtain the peak and trough values in each projected waveform, and calculate the peak of each projected waveform according to the peak and trough values The difference between the trough and the wave; take the largest difference between the peak and trough in the projection waveform as the target projection waveform, and determine the projection angle corresponding to the target projection waveform as the vertical inclination angle.

在一个实施例中,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像,包括:获取单位行高,根据垂直倾斜角度及单位行高计算水平校正图像中每个字符在每一单位行的水平移动像素;根据每一单位行的水平移动像素对水平校正图像中每个字符进行逐行水平移动,直至得到车牌图像的校正图像。In one embodiment, vertically correcting the horizontally corrected image according to the vertical inclination angle to obtain the corrected image of the license plate image includes: acquiring a unit row height, and calculating, according to the vertical inclination angle and the unit row height, that each character in the horizontally corrected image is in The horizontally shifted pixels of each unit line; each character in the horizontally corrected image is horizontally shifted line by line according to the horizontally shifted pixels of each unit line, until the corrected image of the license plate image is obtained.

一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现如下步骤:获取车牌图像,将车牌图像输入深度学习模型以确定车牌图像的车牌类型,对车牌图像进行二值化处理,根据车牌类型确定车牌图像的目标二值化图像;对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到目标二值化图像中的若干个目标字符连通域,根据目标字符连通域确定目标二值化图像的水平倾斜角度,根据水平倾斜角度对目标二值化图像进行旋转,得到车牌图像的水平校正图像;将水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像。A computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, realizes the following steps: acquiring a license plate image, inputting the license plate image into a deep learning model to determine the license plate type of the license plate image, The license plate image is binarized, and the target binarized image of the license plate image is determined according to the license plate type; the connected domain is extracted from the target binarized image, and the extracted connected domain is clustered to obtain the target binarized image. Several target character connected domains, determine the horizontal inclination angle of the target binary image according to the target character connected domain, rotate the target binary image according to the horizontal inclination angle, and obtain the horizontal correction image of the license plate image; Projection, generate a projection waveform at each projection angle, determine the vertical tilt angle of the horizontally corrected image according to the projected waveform, and perform vertical correction on the horizontally corrected image according to the vertical tilt angle to obtain a corrected image of the license plate image.

在一个实施例中,将车牌图像输入深度学习模型以确定车牌图像的车牌类型,包括:调整车牌图像的大小至目标尺寸,将大小调整后的车牌图像输入深度学习模型,提取车牌图像的背景颜色、字体颜色及单双层类型;根据背景颜色、字体颜色及单双层类型确定车牌图像的车牌类型。In one embodiment, inputting the license plate image into the deep learning model to determine the license plate type of the license plate image includes: adjusting the size of the license plate image to a target size, inputting the resized license plate image into the deep learning model, and extracting the background color of the license plate image , font color and single-deck type; determine the license plate type of the license plate image according to the background color, font color and single-deck type.

在一个实施例中,对车牌图像进行二值化处理,根据车牌类型确定车牌图像的目标二值化图像,包括:对车牌图像进行局部阈值二值化处理,得到车牌图像对应的第一二值化图像;对车牌图像进行全局阈值二值化处理,得到车牌图像对应的第二二值化图像;获取车牌类型对应的标准二值化图像,将第一二值化图像及第二二值化图像提取字符连通域后,与车牌标准模板进行位置匹配,得到第一二值化图像的第一匹配度及第二二值化图像的第二匹配度;将第一匹配度与第二匹配度中匹配度较大的作为目标二值化图像。In one embodiment, performing binarization processing on the license plate image, and determining the target binarized image of the license plate image according to the license plate type, includes: performing local threshold binarization processing on the license plate image to obtain a first binary value corresponding to the license plate image. image; perform global threshold binarization on the license plate image to obtain the second binarized image corresponding to the license plate image; obtain the standard binarized image corresponding to the license plate type, and convert the first binarized image and the second binarized image After the character connected domain is extracted from the image, position matching is performed with the license plate standard template to obtain the first matching degree of the first binarized image and the second matching degree of the second binarized image; the first matching degree and the second matching degree are obtained. The larger matching degree is used as the target binarized image.

在一个实施例中,对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到目标二值化图像中的若干个目标字符连通域,包括:根据目标二值化图像中每一像素点的灰度值对目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到若干个疑似字符连通域;获取字符连通域标准,根据字符连通域标准对疑似字符连通域进行筛选,将疑似字符连通域中满足字符连通域标准的作为目标字符连通域。In one embodiment, a connected domain is extracted from the target binarized image, and the extracted connected domain is clustered to obtain several target character connected domains in the target binarized image, including: according to the target binarized image The gray value of each pixel in the target binary image is extracted from the connected domain, and the extracted connected domain is clustered to obtain several suspected character connected domains; The suspected character connected domain is screened, and the target character connected domain that satisfies the character connected domain standard in the suspected character connected domain is selected.

在一个实施例中,根据目标字符连通域确定目标二值化图像的水平倾斜角度,包括:获取每个目标字符连通域的中心位置,对每个目标字符连通域的中心位置进行线性拟合,得到目标字符连通域之间的中心连线;将中心连线与水平线相交,得到互余的两个夹角,将夹角中夹角角度较小的作为水平倾斜角度。In one embodiment, determining the horizontal inclination angle of the target binarized image according to the target character connected domain includes: acquiring the center position of each target character connected domain, and performing linear fitting on the central position of each target character connected domain, Obtain the center line between the connected domains of the target characters; intersect the center line with the horizontal line to obtain two complementary angles, and take the smaller angle as the horizontal inclination angle.

在一个实施例中,将水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据投影波形图确定水平校正图像的垂直倾斜角度,包括:将水平校正图像中的每个像素点在至少一个投影角度上进行投影,生成在每个投影角度上的投影波形图;获取在每个投影波形图内的波峰值及波谷值,根据波峰值及波谷值计算每个投影波形图的波峰波谷差值;将投影波形图中波峰波谷差值最大的作为目标投影波形图,确定目标投影波形图对应的投影角度为垂直倾斜角度。In one embodiment, projecting the horizontally corrected image to generate a projection waveform diagram at each projection angle, and determining the vertical tilt angle of the horizontally corrected image according to the projected waveform diagram, includes: converting each pixel in the horizontally corrected image Perform projection on at least one projection angle to generate a projected waveform at each projection angle; obtain the peak and trough values in each projected waveform, and calculate the peak of each projected waveform according to the peak and trough values The difference between the trough and the wave; take the largest difference between the peak and trough in the projection waveform as the target projection waveform, and determine the projection angle corresponding to the target projection waveform as the vertical inclination angle.

在一个实施例中,根据垂直倾斜角度对水平校正图像进行垂直方向校正,得到车牌图像的校正图像,包括:获取单位行高,根据垂直倾斜角度及单位行高计算水平校正图像中每个字符在每一单位行的水平移动像素;根据每一单位行的水平移动像素对水平校正图像中每个字符进行逐行水平移动,直至得到车牌图像的校正图像。In one embodiment, vertically correcting the horizontally corrected image according to the vertical inclination angle to obtain the corrected image of the license plate image includes: acquiring a unit row height, and calculating, according to the vertical inclination angle and the unit row height, that each character in the horizontally corrected image is in The horizontally shifted pixels of each unit line; each character in the horizontally corrected image is horizontally shifted line by line according to the horizontally shifted pixels of each unit line, until the corrected image of the license plate image is obtained.

需要说明的是,上述车牌角度校正方法、装置、设备及计算机可读存储介质属于一个总的发明构思,车牌角度校正方法、装置、设备及计算机可读存储介质实施例中的内容可相互适用。It should be noted that the above license plate angle correction method, device, device and computer-readable storage medium belong to a general inventive concept, and the contents in the embodiments of the license plate angle correction method, device, device and computer-readable storage medium are applicable to each other.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium, When the program is executed, it may include the flow of the embodiments of the above-mentioned methods. Wherein, any reference to memory, storage, database or other medium used in the various embodiments provided in this application may include non-volatile and/or volatile memory. Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.

以上实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above examples only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent of the present application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (10)

Translated fromChinese
1.一种车牌角度校正方法,其特征在于,所述方法包括:1. a license plate angle correction method, is characterized in that, described method comprises:获取车牌图像,将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像;Obtain a license plate image, input the license plate image into a deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the target binarized image of the license plate image according to the license plate type ;对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,根据所述水平倾斜角度对所述目标二值化图像进行旋转,得到所述车牌图像的水平校正图像;Extracting a connected domain from the target binarized image, and performing clustering processing on the extracted connected domain to obtain several target character connected domains in the target binary image, and determining the connected domain according to the target character connected domain. the horizontal inclination angle of the target binarized image, and rotating the target binarized image according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image;将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像。Projecting the horizontally corrected image to generate a projection waveform at each projection angle, determining a vertical tilt angle of the horizontally corrected image according to the projected waveform, and applying the horizontally corrected image to the horizontally corrected image according to the vertical tilt angle Perform vertical correction to obtain the corrected image of the license plate image.2.根据权利要求1所述的方法,其特征在于,所述将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,包括:2. The method according to claim 1, wherein the inputting the license plate image into a deep learning model to determine the license plate type of the license plate image comprises:调整所述车牌图像的大小至目标尺寸,将大小调整后的车牌图像输入深度学习模型,提取所述车牌图像的背景颜色、字体颜色及单双层类型;Adjust the size of the license plate image to the target size, input the resized license plate image into the deep learning model, and extract the background color, font color and single-deck type of the license plate image;根据所述背景颜色、所述字体颜色及所述单双层类型确定所述车牌图像的车牌类型。The license plate type of the license plate image is determined according to the background color, the font color, and the single-deck type.3.根据权利要求1所述的方法,其特征在于,所述对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像,包括:3. The method according to claim 1, wherein the performing binarization processing on the license plate image, and determining the target binarized image of the license plate image according to the license plate type, comprises:对所述车牌图像进行局部阈值二值化处理,得到所述车牌图像对应的第一二值化图像;performing local threshold binarization processing on the license plate image to obtain a first binarized image corresponding to the license plate image;对所述车牌图像进行全局阈值二值化处理,得到所述车牌图像对应的第二二值化图像;performing a global threshold binarization process on the license plate image to obtain a second binarized image corresponding to the license plate image;获取所述车牌类型对应的标准二值化图像,将所述第一二值化图像及所述第二二值化图像提取字符连通域后,与车牌标准模板进行位置匹配,得到所述第一二值化图像的第一匹配度及所述第二二值化图像的第二匹配度;其中,所述车牌标准模板为根据国家车牌标准构建的与所述车牌类型匹配的位置模板;Obtain the standard binarized image corresponding to the license plate type, extract the character connected domain from the first binarized image and the second binarized image, and perform position matching with the license plate standard template to obtain the first binarized image. The first matching degree of the binarized image and the second matching degree of the second binarized image; wherein, the license plate standard template is a position template constructed according to the national license plate standard and matching the license plate type;将所述第一匹配度与所述第二匹配度中匹配度较大的作为所述目标二值化图像。A larger matching degree of the first matching degree and the second matching degree is used as the target binarized image.4.根据权利要求1所述的方法,其特征在于,所述对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,包括:4 . The method according to claim 1 , characterized in that, performing a connected domain extraction on the target binarized image, and performing clustering processing on the extracted connected domain to obtain the target binarized image. 5 . Several target character connected domains, including:根据所述目标二值化图像中每一像素点的灰度值对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到若干个疑似字符连通域;Extracting a connected domain from the target binarized image according to the gray value of each pixel in the target binarized image, and performing clustering processing on the extracted connected domain to obtain several suspected character connected domains;获取字符连通域标准,根据所述字符连通域标准对所述疑似字符连通域进行筛选,将所述疑似字符连通域中满足所述字符连通域标准的作为所述目标字符连通域;其中,所述字符连通域标准包括与所述车牌类型匹配的高度差标准、宽高比标准、中心点垂直方向差值标准。Obtaining a character connected domain standard, screening the suspected character connected domain according to the character connected domain standard, and using the suspected character connected domain that satisfies the character connected domain standard as the target character connected domain; The character connected domain standard includes a height difference standard matching the license plate type, an aspect ratio standard, and a center point vertical direction difference standard.5.根据权利要求1所述的方法,其特征在于,所述根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,包括:5. The method according to claim 1, wherein the determining the horizontal inclination angle of the target binarized image according to the target character connected domain comprises:获取每个所述目标字符连通域的中心位置,对每个所述目标字符连通域的中心位置进行线性拟合,得到所述目标字符连通域之间的中心连线;Obtain the center position of each connected domain of the target character, perform linear fitting on the central position of the connected domain of each target character, and obtain the central connection line between the connected domains of the target character;将所述中心连线与水平线相交,得到互余的两个夹角,将所述夹角中夹角角度较小的作为所述水平倾斜角度。Intersecting the center line and the horizontal line to obtain two complementary angles, and taking the smaller angle among the included angles as the horizontal inclination angle.6.根据权利要求1所述的方法,其特征在于,所述将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,包括:6 . The method according to claim 1 , wherein the horizontally corrected image is projected to generate a projection waveform at each projection angle, and the horizontally corrected image is determined according to the projected waveform. 7 . vertical tilt angle, including:将所述水平校正图像中的每个像素点在至少一个投影角度上进行投影,生成在每个投影角度上的投影波形图;Projecting each pixel in the horizontal correction image on at least one projection angle to generate a projection waveform at each projection angle;获取在每个所述投影波形图内的波峰值及波谷值,根据所述波峰值及所述波谷值计算每个所述投影波形图的波峰波谷差值;obtaining the peak value and the trough value in each of the projected waveforms, and calculating the peak-to-valley difference of each of the projected waveforms according to the peak value and the trough value;将所述投影波形图中波峰波谷差值最大的作为目标投影波形图,确定所述目标投影波形图对应的投影角度为垂直倾斜角度。The largest difference between peaks and valleys in the projected waveform is used as the target projected waveform, and the projection angle corresponding to the target projected waveform is determined as a vertical tilt angle.7.根据权利要求6所述的方法,其特征在于,所述根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像,包括:7 . The method according to claim 6 , wherein, performing vertical direction correction on the horizontally corrected image according to the vertical tilt angle to obtain a corrected image of the license plate image, comprising: 8 .获取单位行高,根据所述垂直倾斜角度及所述单位行高计算所述水平校正图像中每个字符在每一单位行的水平移动像素;obtaining a unit line height, and calculating the horizontally shifted pixels of each character in each unit line in the horizontally corrected image according to the vertical tilt angle and the unit line height;根据所述每一单位行的水平移动像素对所述水平校正图像中每个字符进行逐行水平移动,直至得到所述车牌图像的校正图像。Each character in the horizontally corrected image is horizontally moved line by line according to the horizontally shifted pixels of each unit line, until a corrected image of the license plate image is obtained.8.一种车牌角度校正装置,其特征在于,所述装置包括:8. A license plate angle correction device, wherein the device comprises:二值化图像获取模块,用于获取车牌图像,将所述车牌图像输入深度学习模型以确定所述车牌图像的车牌类型,对所述车牌图像进行二值化处理,根据所述车牌类型确定所述车牌图像的目标二值化图像;A binarized image acquisition module is used to acquire a license plate image, input the license plate image into a deep learning model to determine the license plate type of the license plate image, perform binarization processing on the license plate image, and determine the license plate type according to the license plate type. The target binarized image of the license plate image;水平校正模块,用于对所述目标二值化图像进行连通域提取,对提取的连通域进行聚类处理,得到所述目标二值化图像中的若干个目标字符连通域,根据所述目标字符连通域确定所述目标二值化图像的水平倾斜角度,根据所述水平倾斜角度对所述目标二值化图像进行旋转,得到所述车牌图像的水平校正图像;The horizontal correction module is used to extract the connected domain of the target binarized image, and perform clustering processing on the extracted connected domain to obtain several target character connected domains in the target binary image. According to the target The character connected domain determines the horizontal inclination angle of the target binarized image, and rotates the target binary image according to the horizontal inclination angle to obtain a horizontally corrected image of the license plate image;垂直校正模块,用于将所述水平校正图像进行投影,生成在每个投影角度上的投影波形图,根据所述投影波形图确定所述水平校正图像的垂直倾斜角度,根据所述垂直倾斜角度对所述水平校正图像进行垂直方向校正,得到所述车牌图像的校正图像。a vertical correction module, configured to project the horizontally corrected image, generate a projection waveform diagram at each projection angle, determine the vertical tilt angle of the horizontally corrected image according to the projection waveform diagram, and determine the vertical tilt angle of the horizontally corrected image according to the vertical tilt angle Perform vertical correction on the horizontally corrected image to obtain a corrected image of the license plate image.9.一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如权利要求1至7中任一项所述方法的步骤。9. A computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the steps of the method according to any one of claims 1 to 7.10.一种车牌角度校正设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如权利要求1至7中任一项所述方法的步骤。10. A license plate angle correction device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is made to perform any one of claims 1 to 7 the steps of the method described in item.
CN202011387171.6A2020-12-022020-12-02License plate angle correction method, device, equipment and mediumPendingCN112488105A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011387171.6ACN112488105A (en)2020-12-022020-12-02License plate angle correction method, device, equipment and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011387171.6ACN112488105A (en)2020-12-022020-12-02License plate angle correction method, device, equipment and medium

Publications (1)

Publication NumberPublication Date
CN112488105Atrue CN112488105A (en)2021-03-12

Family

ID=74938749

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011387171.6APendingCN112488105A (en)2020-12-022020-12-02License plate angle correction method, device, equipment and medium

Country Status (1)

CountryLink
CN (1)CN112488105A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102306282A (en)*2011-07-192012-01-04北京博康智能信息技术有限公司License plate positioning method and license plate positioning device
CN103116751A (en)*2013-01-242013-05-22河海大学Automatic license plate character recognition method
CN103984949A (en)*2014-06-112014-08-13四川九洲电器集团有限责任公司License plate positioning method and system based on high and low cap transformation and connected domain
CN104573692A (en)*2014-12-182015-04-29厦门翼歌软件科技有限公司Vehicle license plate binarizing method based on fuzzy degradation model
CN105447491A (en)*2014-07-252016-03-30北京大学深圳研究生院Signboard image binaryzation method and device
CN106295638A (en)*2016-07-292017-01-04北京小米移动软件有限公司Certificate image sloped correcting method and device
KR101719549B1 (en)*2016-01-072017-03-24(주)아이엠시티Image preprocessing method for license plate recognition and license plate recognition device using thereof
CN109325487A (en)*2018-08-272019-02-12电子科技大学 A full-type license plate recognition method based on target detection
CN110399880A (en)*2019-07-312019-11-01深圳市捷顺科技实业股份有限公司Recognition methods, device and the equipment of a kind of characters on license plate and license plate classification
CN111950546A (en)*2020-08-062020-11-17广东飞翔云计算有限公司License plate recognition method and device, computer equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102306282A (en)*2011-07-192012-01-04北京博康智能信息技术有限公司License plate positioning method and license plate positioning device
CN103116751A (en)*2013-01-242013-05-22河海大学Automatic license plate character recognition method
CN103984949A (en)*2014-06-112014-08-13四川九洲电器集团有限责任公司License plate positioning method and system based on high and low cap transformation and connected domain
CN105447491A (en)*2014-07-252016-03-30北京大学深圳研究生院Signboard image binaryzation method and device
CN104573692A (en)*2014-12-182015-04-29厦门翼歌软件科技有限公司Vehicle license plate binarizing method based on fuzzy degradation model
KR101719549B1 (en)*2016-01-072017-03-24(주)아이엠시티Image preprocessing method for license plate recognition and license plate recognition device using thereof
CN106295638A (en)*2016-07-292017-01-04北京小米移动软件有限公司Certificate image sloped correcting method and device
CN109325487A (en)*2018-08-272019-02-12电子科技大学 A full-type license plate recognition method based on target detection
CN110399880A (en)*2019-07-312019-11-01深圳市捷顺科技实业股份有限公司Recognition methods, device and the equipment of a kind of characters on license plate and license plate classification
CN111950546A (en)*2020-08-062020-11-17广东飞翔云计算有限公司License plate recognition method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
姜谊;严京旗;: "车牌定位及倾斜校正方法", 微型电脑应用, no. 04, 20 April 2010 (2010-04-20), pages 45 - 47*
张洪刚;陈光;刘刚;郭军;: "采用信号匹配的支票图像二值化", 北京邮电大学学报, no. 02, 30 April 2006 (2006-04-30), pages 47 - 49*

Similar Documents

PublicationPublication DateTitle
CN111914834B (en)Image recognition method, device, computer equipment and storage medium
CN110414507B (en)License plate recognition method and device, computer equipment and storage medium
CN108985137B (en)License plate recognition method, device and system
US10552705B2 (en)Character segmentation method, apparatus and electronic device
CN101789080B (en)Detection method for vehicle license plate real-time positioning character segmentation
CN109753838B (en)Two-dimensional code identification method, device, computer equipment and storage medium
CN109492642B (en)License plate recognition method, license plate recognition device, computer equipment and storage medium
US8170340B2 (en)Device, method and computer program for identifying a traffic sign in an image
CN112132163A (en)Method, system and computer readable storage medium for identifying edges of objects
CN114038004A (en) A method, device, device and storage medium for extracting certificate information
CN106529532A (en)License plate identification system based on integral feature channels and gray projection
CN114387591A (en) License plate recognition method, system, device and storage medium
CN109308478B (en)Character recognition method and device
CN110766016A (en) A method of inkjet character recognition based on probabilistic neural network
CN108241859A (en) Calibration method and device for license plate
CN111027535A (en)License plate recognition method and related equipment
CN113177899A (en)Method for correcting text tilt of medical photocopy, electronic device and readable storage medium
CN109858484A (en)A kind of multi-class transformation VLP correction algorithm based on deflection evaluation
CN113743218B (en)License plate recognition method, license plate recognition device and computer readable storage medium
CN110728276B (en) A license plate recognition method and device
CN112052859B (en)License plate accurate positioning method and device in free scene
CN113256644B (en) Bill image segmentation method, device, medium and equipment
CN112308061B (en)License plate character recognition method and device
CN107103607B (en) A Global Optimal Image Segmentation Method Based on Automatic Selection of Seed Points
CN118823789A (en) Method and device for automatic tilt correction of document images of scanning equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp