CN118053148A - New energy vehicle identification method and system - Google Patents
New energy vehicle identification method and system Download PDFInfo
- Publication number
- CN118053148A CN118053148A CN202410185828.2A CN202410185828A CN118053148A CN 118053148 A CN118053148 A CN 118053148A CN 202410185828 A CN202410185828 A CN 202410185828A CN 118053148 A CN118053148 A CN 118053148A
- Authority
- CN
- China
- Prior art keywords
- license plate
- image
- new energy
- energy vehicle
- characters
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/62—Text, e.g. of license plates, overlay texts or captions on TV images
- G06V20/625—License plates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/40—Scenes; Scene-specific elements in video content
- G06V20/41—Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Medical Informatics (AREA)
- General Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Image Processing (AREA)
Abstract
本申请公开了一种新能源车辆识别方法,可以精准快速地检测车牌,其不仅可以定位车牌位置和对检测目标进行分类,还可以矫正畸变车牌从而提高后续车牌识别准确率。而且可以识别出单层车牌或双层车牌的具体车牌字符,也可以识别出车牌的颜色,帮助提高系统的识别准确性,最后通过判断车牌字符长度或车牌颜色,进行车辆类型判别,进一步提高了新能源车辆的识别准确率。
The present application discloses a new energy vehicle identification method, which can detect license plates accurately and quickly. It can not only locate the license plate position and classify the detection target, but also correct the distorted license plate to improve the subsequent license plate recognition accuracy. It can also identify the specific license plate characters of single-layer license plates or double-layer license plates, and can also identify the color of the license plate to help improve the recognition accuracy of the system. Finally, by judging the length of the license plate characters or the color of the license plate, the vehicle type is distinguished, which further improves the recognition accuracy of new energy vehicles.
Description
技术领域Technical Field
本发明涉及新能源汽车技术领域,具体涉及一种新能源车辆识别方法及系统。The present invention relates to the technical field of new energy vehicles, and in particular to a new energy vehicle identification method and system.
背景技术Background technique
新能源车辆是取代传统汽车且使用来自新能源技术的能量的汽车,比如电动汽车、插电式混合动力汽车、氢燃料电池汽车等。此类汽车往往有着先进的动力和能源回收技术,运行效率高,可以大大减少对环境的污染,帮助人类创造一个更清洁的环境。New energy vehicles are cars that replace traditional cars and use energy from new energy technologies, such as electric cars, plug-in hybrid cars, hydrogen fuel cell cars, etc. Such cars often have advanced power and energy recovery technologies, high operating efficiency, can greatly reduce environmental pollution, and help humans create a cleaner environment.
然而,汽车外观众多复杂,如何客观高效识别新能源汽车成为一个难题。众所周知,车牌是识别车辆类型的重要标志之一,不同类型车辆的车牌在编码规则上也会有明确不同的规定。因此,通过识别车牌字符可以确定车辆是否为新能源车型,于是如何高效准确地获取车牌号成为对大量机动车类型进行自动识别的关键。However, the appearance of cars is complex and objective, so how to objectively and efficiently identify new energy vehicles has become a difficult problem. As we all know, the license plate is one of the important signs to identify the type of vehicle, and the license plates of different types of vehicles will also have clear and different regulations on the encoding rules. Therefore, by identifying the characters on the license plate, it can be determined whether the vehicle is a new energy vehicle. Therefore, how to efficiently and accurately obtain the license plate number has become the key to automatically identifying a large number of motor vehicle types.
现有成熟的车牌检测识别算法有EasyPR、HyperLPR等。其中,EasyPR的算法流程为:首先通过车牌的信息特征将车牌位置检测出来,然后将车牌上的每一个字符都单独检测分割出来,最后将每一个分割出来的字符对照字符模板意义配对从而识别字符。HyperLPR的算法流程为:第一步使用opencv的HAAR Cascade检测车牌大致位置,第二步扩展检测到的大致位置的矩形区域,第三步使用类似于MSER的方式的多级二值化和RANSAC拟合车牌的上下边界,第四步使用卷积神经网络回归车牌左右边界,第五步使用基于纹理场的算法进行车牌校正倾斜,第六步使用卷积神经网络滑动窗切割字符并使用卷积神经网络识别字符。The existing mature license plate detection and recognition algorithms include EasyPR, HyperLPR, etc. Among them, the algorithm flow of EasyPR is: first, the license plate position is detected through the information features of the license plate, and then each character on the license plate is detected and segmented separately, and finally each segmented character is matched with the meaning of the character template to identify the character. The algorithm flow of HyperLPR is: the first step is to use opencv's HAAR Cascade to detect the approximate position of the license plate, the second step is to expand the rectangular area of the detected approximate position, the third step is to use multi-level binarization and RANSAC similar to MSER to fit the upper and lower boundaries of the license plate, the fourth step is to use a convolutional neural network to regress the left and right boundaries of the license plate, the fifth step is to use an algorithm based on texture field to correct the tilt of the license plate, and the sixth step is to use a convolutional neural network sliding window to cut characters and use a convolutional neural network to recognize characters.
然而,以上算法需要将车牌的每一个字符分割出来进行识别,且皆没有对畸变车牌进行矫正,不能识别双层车牌,也不能识别车牌颜色。However, the above algorithms need to separate each character of the license plate for recognition, and none of them corrects the distorted license plate, cannot recognize double-layer license plates, and cannot recognize the color of the license plate.
发明内容Summary of the invention
鉴于现有技术中的上述缺陷或不足,期望提供一种新能源车辆识别方法及系统。In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a new energy vehicle identification method and system.
第一方面,本申请实施例提供了一种新能源车辆识别方法,该方法包括:In a first aspect, an embodiment of the present application provides a method for identifying a new energy vehicle, the method comprising:
S1:输入包括车牌的视频或者图像;S1: Input video or image including license plate;
S2:检测出视频或图像中车牌的位置;S2: Detect the location of the license plate in the video or image;
S3:根据检测得到的车牌的位置将车牌对应的图像按照预设尺寸裁剪;S3: cropping the image corresponding to the license plate according to a preset size according to the detected position of the license plate;
S4:矫正裁剪后的图像,并识别矫正后的图像中的车牌信息,得到车牌字符和车牌颜色;S4: Correct the cropped image, and recognize the license plate information in the corrected image to obtain the license plate characters and license plate color;
S5:根据车牌字符和车牌颜色判断车辆是否为新能源车辆。S5: Determine whether the vehicle is a new energy vehicle based on the license plate characters and license plate color.
在其中一个实施例中,所述输入包括车牌的视频或者图像,包括:In one embodiment, the input includes a video or image of a license plate, including:
S11:读取原始车牌的图像数据;S11: Read the image data of the original license plate;
S12:对图像数据进行预处理,所述预处理包括对数据进行扩充和增加数据多样性;S12: Preprocessing the image data, wherein the preprocessing includes expanding the data and increasing the data diversity;
S13:将图像数据进行调整,得到辨识度强的图像数据。S13: Adjust the image data to obtain image data with high recognition.
在其中一个实施例中,所述检测出视频或图像中车牌的位置,包括:In one embodiment, detecting the location of the license plate in the video or image includes:
S21:提取图像中车牌数据的尺寸信息;S21: extracting size information of the license plate data in the image;
S22:按预设比例调节提取到的尺寸信息,以使得提取到的尺寸信息与原始车牌尺寸信息比例在预设值内。S22: adjusting the extracted size information according to a preset ratio so that the ratio of the extracted size information to the original license plate size information is within a preset value.
在其中一个实施例中,所述矫正裁剪后的图像,包括:通过透视变换方式将任意倾斜畸变的四边形图像转化为矩形图像;In one of the embodiments, the correcting the cropped image includes: converting an arbitrarily tilted and distorted quadrilateral image into a rectangular image by perspective transformation;
对矩形图像进行裁剪。Crop a rectangular image.
在其中一个实施例中,所述在矫正裁剪后的图像之后,该方法还包括:In one embodiment, after correcting the cropped image, the method further comprises:
判断矫正裁剪后的图像中的车牌字符为单层还是双层,若为单层,则直接识别矫正后的图像中的车牌信息;若为双层,则将双层字符转化为单层字符后再别矫正后的图像中的车牌信息。Determine whether the license plate characters in the corrected and cropped image are single-layer or double-layer. If they are single-layer, directly recognize the license plate information in the corrected image; if they are double-layer, convert the double-layer characters into single-layer characters and then recognize the license plate information in the corrected image.
在其中一个实施例中,所述识别矫正后的图像中的车牌信息,包括:In one embodiment, the identifying the license plate information in the rectified image includes:
将矫正后的图像尺寸进行归一化处理,使其符合CRDPNet网络的输入要求;Normalize the size of the rectified image to meet the input requirements of the CRDPNet network;
将处理后的图像输入到CRDPNet网络中的Backbone网络中,提取图像中的车牌字符信息。The processed image is input into the Backbone network in the CRDPNet network to extract the license plate character information in the image.
在其中一个实施例中,在提取图像中的车牌字符信息之后,该方法还包括:In one embodiment, after extracting the license plate character information in the image, the method further includes:
计算每个字符出现的概率,将出现概率最大的字符作为车牌字符序列。Calculate the probability of each character appearing, and use the character with the highest probability of appearing as the license plate character sequence.
在其中一个实施例中,所述根据车牌字符和车牌颜色判断车辆是否为新能源车辆,包括:In one embodiment, judging whether a vehicle is a new energy vehicle based on the license plate characters and the license plate color includes:
当车牌字符位数满足八位数或者车牌颜色为绿色时,则判断车辆为新能源车辆。When the number of characters in the license plate meets eight digits or the color of the license plate is green, the vehicle is judged to be a new energy vehicle.
第二方面,本申请实施例提供了一种新能源车辆识别系统,该系统包括:In a second aspect, an embodiment of the present application provides a new energy vehicle identification system, the system comprising:
输入模块,用于输入包括车牌的视频或者图像;An input module, used to input a video or image including a license plate;
检测模块,用于检测出视频或图像中车牌的位置;A detection module is used to detect the location of the license plate in the video or image;
裁切模块,用于根据检测得到的车牌的位置将车牌对应的图像按照预设尺寸裁剪;A cropping module, used to crop the image corresponding to the license plate according to a preset size based on the detected position of the license plate;
识别模块,用于矫正裁剪后的图像,并识别矫正后的图像中的车牌信息,得到车牌字符和车牌颜色;A recognition module is used to correct the cropped image and recognize the license plate information in the corrected image to obtain the license plate characters and license plate color;
判断模块,用于根据车牌字符和车牌颜色判断车辆是否为新能源车辆。The judgment module is used to judge whether the vehicle is a new energy vehicle based on the license plate characters and license plate color.
本申请的有益效果包括:The beneficial effects of this application include:
本申请提供的新能源车辆识别方法,可以精准快速地检测车牌,其不仅可以定位车牌位置和对检测目标进行分类,还可以矫正畸变车牌从而提高后续车牌识别准确率。而且可以识别出单层车牌或双层车牌的具体车牌字符,也可以识别出车牌的颜色,帮助提高系统的识别准确性,最后通过判断车牌字符长度或车牌颜色,进行车辆类型判别,进一步提高了新能源车辆的识别准确率。The new energy vehicle identification method provided by the present application can detect license plates accurately and quickly. It can not only locate the license plate position and classify the detection target, but also correct the distorted license plate to improve the subsequent license plate recognition accuracy. It can also identify the specific license plate characters of single-layer license plates or double-layer license plates, and can also identify the color of the license plate to help improve the recognition accuracy of the system. Finally, by judging the length of the license plate characters or the color of the license plate, the vehicle type is identified, which further improves the recognition accuracy of new energy vehicles.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
图1示出了本申请实施例提供的新能源车辆识别方法的流程示意图;FIG1 is a schematic diagram showing a flow chart of a new energy vehicle identification method provided in an embodiment of the present application;
图2示出了本申请实施例提供的又一新能源车辆识别方法的流程示意图;FIG2 is a schematic diagram showing a flow chart of another new energy vehicle identification method provided in an embodiment of the present application;
图3示出了本申请实施例提供的YOLO8Plate算法模型网络结构示意图;FIG3 shows a schematic diagram of the network structure of the YOLO8Plate algorithm model provided in an embodiment of the present application;
图4示出了本申请实施例提供的CBS模块结构示意图;FIG4 shows a schematic diagram of the structure of a CBS module provided in an embodiment of the present application;
图5示出了本申请实施例提供的C2f模块网络结构示意图;FIG5 shows a schematic diagram of a C2f module network structure provided in an embodiment of the present application;
图6示出了本申请实施例提供的SPPF模块网络结构;FIG6 shows a network structure of an SPPF module provided in an embodiment of the present application;
图7示出了本申请实施例提供的Neck学习不同尺度的特征图;FIG7 shows feature graphs of different scales of Neck learning provided by an embodiment of the present application;
图8示出了本申请实施例提供的YOLO8Plate的Neck网络架构图;FIG8 shows a Neck network architecture diagram of the YOLO8Plate provided in an embodiment of the present application;
图9示出了本申请实施例提供的后处理部分工作流程图;FIG9 shows a flowchart of the post-processing part provided in an embodiment of the present application;
图10示出了本申请实施例提供的透视变换矫正畸变车牌示意图;FIG10 shows a schematic diagram of a license plate distortion correction by perspective transformation provided by an embodiment of the present application;
图11示出了本申请实施例提供的双行车牌处理为单行车牌示意图;FIG11 is a schematic diagram showing a double-row license plate processed into a single-row license plate according to an embodiment of the present application;
图12为现有的GA36-2018规定标准车牌样式示意图;FIG12 is a schematic diagram of the existing GA36-2018 standard license plate style;
图13为现有的新能源车辆车牌标准样式示意图。FIG. 13 is a schematic diagram of the existing standard license plate style for new energy vehicles.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与申请相关的部分。The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant application, rather than to limit the application. It is also necessary to explain that, for ease of description, only the parts related to the application are shown in the accompanying drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
如图12所示,图12为GA36-2018规定标准车牌样式,我国现行汽车牌照是遵循中华人民共和国汽车牌号的国家标准即GA36-2018的,而且现在的车牌既有单层车牌,也有双层车牌。国内常规车牌会按其动力方式可划分为蓝底白字传统汽油动力小型车车牌、黄底黑字传统汽油动力中大型车车牌、绿底黑字新能源动力车辆车牌等。除此之外,特殊的车辆还会划分为警用、军用、农用、使馆用等。根据国标GA36-2018,国内要求常规标准车牌尺寸固定为440mm×140mm,且车牌内每个字符之间的间距也固定不变。一般车牌字符为7位,字符由代表省份的汉字,以及标志不同车牌的A-Z大写字母(不含O、I)和0-9数字标识符组成。除此以外,特殊车辆车牌的字符位数可能不为7位。As shown in Figure 12, Figure 12 is the standard license plate style specified by GA36-2018. my country's current automobile license plates follow the national standard of the People's Republic of China for automobile license plates, namely GA36-2018, and the current license plates include both single-layer license plates and double-layer license plates. Domestic conventional license plates can be divided into traditional gasoline-powered small car license plates with white characters on a blue background, traditional gasoline-powered medium and large car license plates with black characters on a yellow background, and new energy power vehicle license plates with black characters on a green background, etc., according to their power mode. In addition, special vehicles are also divided into police, military, agricultural, and embassy vehicles. According to the national standard GA36-2018, the domestic standard license plate size is required to be fixed at 440mm×140mm, and the spacing between each character in the license plate is also fixed. Generally, the license plate characters are 7 digits, and the characters are composed of Chinese characters representing provinces, A-Z capital letters (excluding O and I) and 0-9 digital identifiers that mark different license plates. In addition, the number of characters in special vehicle license plates may not be 7 digits.
如图13所示,图13为新能源车辆车牌标准样式,新能源车辆车牌则由8位车牌字符组成,整体颜色为绿色。因此通过车牌字符长度和车牌底层颜色,就可以判断车牌所属车辆是否为新能源车辆。为了更加精准的判断车牌所属车辆是否为新能源车辆,本申请提供了如下方案。As shown in Figure 13, Figure 13 is a standard style of new energy vehicle license plate, and the new energy vehicle license plate consists of 8 license plate characters, and the overall color is green. Therefore, by the length of the license plate characters and the underlying color of the license plate, it is possible to determine whether the vehicle to which the license plate belongs is a new energy vehicle. In order to more accurately determine whether the vehicle to which the license plate belongs is a new energy vehicle, this application provides the following solution.
请参考图1并结合图2所示,图1示出了本申请实施例提供的一种新能源车辆识别方法,该方法包括:Please refer to FIG. 1 and FIG. 2 , FIG. 1 shows a new energy vehicle identification method provided by an embodiment of the present application, the method comprising:
步骤110:输入包括车牌的视频或者图像;Step 110: Input a video or image including a license plate;
步骤120:检测出视频或图像中车牌的位置;Step 120: Detect the location of the license plate in the video or image;
步骤130:根据检测得到的车牌的位置将车牌对应的图像按照预设尺寸裁剪;Step 130: cropping the image corresponding to the license plate according to a preset size based on the detected position of the license plate;
步骤140:矫正裁剪后的图像,并识别矫正后的图像中的车牌信息,得到车牌字符和车牌颜色;Step 140: Correcting the cropped image, and recognizing the license plate information in the corrected image to obtain the license plate characters and license plate color;
步骤150:根据车牌字符和车牌颜色判断车辆是否为新能源车辆。Step 150: Determine whether the vehicle is a new energy vehicle based on the license plate characters and license plate color.
示例性的,本申请中新能源车辆识别方法主要采用如图3所示的YOLO8Plate算法模型网络结构,该算法主要包括输入层(Input)、骨干网络(Backbone)、融合层(Neck)、检测头(Detection Head)与后处理部分(PostProcessing)五个部分组成。Exemplarily, the new energy vehicle identification method in this application mainly adopts the YOLO8Plate algorithm model network structure shown in Figure 3. The algorithm mainly includes five parts: input layer (Input), backbone network (Backbone), fusion layer (Neck), detection head (Detection Head) and post-processing part (PostProcessing).
其中,步骤110主要的作用是读取原始车牌图像数据,并对数据进行预处理,为进一步提取特征打下基础。图像预处理流程主要为三个部分:数据增强、Anchor自适应调整、图像尺寸调整。Among them, the main function of step 110 is to read the original license plate image data and pre-process the data to lay the foundation for further feature extraction. The image pre-processing process mainly consists of three parts: data enhancement, anchor adaptive adjustment, and image size adjustment.
YOLO8Plate采用Mosaic数据增强方法。其主要思想是将多张图片拼接在一起,形成一张更大的画面,从而对输入车牌图像数据集进行扩充和增加数据多样性,进而提高模型的泛化能力和鲁棒性。具体实现时,Mosaic数据增强方法将四张随机选择的图片按照一定比例、随机裁剪和随机排列的方法拼接在一起,然后将目标框坐标相对位置进行调整,以适应新图片的大小和位置。其方法提高了对细小目标对象的辨识能力,很好地满足了本论文中对汽车车牌的要求。YOLO8Plate uses the Mosaic data enhancement method. The main idea is to stitch multiple images together to form a larger picture, thereby expanding the input license plate image dataset and increasing data diversity, thereby improving the generalization and robustness of the model. In specific implementation, the Mosaic data enhancement method stitches four randomly selected images together according to a certain ratio, random cropping, and random arrangement, and then adjusts the relative position of the target frame coordinates to adapt to the size and position of the new image. This method improves the recognition ability of small target objects and well meets the requirements for car license plates in this paper.
Anchor(锚框)自适应调整是目标检测中的一种技术,其主要思想是自动提取数据集中物体的尺度和长宽比等信息,从而生成最佳的锚框。在网络训练中,网络在Anchor的基础上输出预测框,进而和真实框GT进行比较和计算los s,从而反向不断更新和迭代网络参数。在YOLO8Plate算法中,可以针对数据集设置初始的Anchor,算法自身也会在每次训练后不断计算调整和更新最优Anchor值。Anchor (anchor box) adaptive adjustment is a technology in target detection. Its main idea is to automatically extract information such as the scale and aspect ratio of objects in the data set to generate the best anchor box. In network training, the network outputs a predicted box based on the anchor, and then compares it with the real box GT and calculates the loss, thereby continuously updating and iterating the network parameters in reverse. In the YOLO8Plate algorithm, the initial anchor can be set for the data set, and the algorithm itself will continuously calculate, adjust and update the optimal anchor value after each training.
最后的图像尺寸调整是指将输入的原始图像调整为统一的尺寸,从而在模型网络中进一步继续训练。具体过程分为3步:第一步确定缩放比例并根据比例进行缩放;第二步若图像缩放后不足要求的大小,需要在图像周围填充黑色、白色或者灰色边界;最后一步将缩放调整且填充后的图像送入网络。The final image resizing refers to resizing the input original image to a uniform size so that it can be further trained in the model network. The specific process is divided into three steps: the first step is to determine the scaling ratio and scale it according to the ratio; the second step is to fill the image with black, white or gray borders if the image is not large enough after scaling; the last step is to send the scaled and filled image to the network.
骨干网络(Backbone)由图4的CBS模块、图5的C2f模块以及图6的SPPF模块组成,其主要作用为提取图像的特征信息。The backbone network (Backbone) consists of the CBS module in Figure 4, the C2f module in Figure 5 and the SPPF module in Figure 6, and its main function is to extract the feature information of the image.
其中,如图4所示,CBS模块是卷积神经网络常见的一种基础模块,其由卷积层、BatchNorm层、SiLu激活函数组成。其中,卷积层的主要任务是进行卷积计算,从而利用卷积运算抽取图像中的局部区域的空间特征信息。BatchNorm层是一种归一化层,在网络中常位于卷积层后。其作用对网络中的特征量进行标准化处理,从而加快训练速度和增强网络的泛化性。实现过程中,其首先输入一批(batch)特征图,然后计算每个通道上特征值的均值和方差,以及对每个通道上特征值进行归一化,最后将归一化的结果线性变换得到输出结果。SiLu激活函数是一种引入非线性变换能力的非线性函数,其使得网络可以更好适应各种数据变化分布。Among them, as shown in Figure 4, the CBS module is a common basic module of the convolutional neural network, which consists of a convolution layer, a BatchNorm layer, and a SiLu activation function. Among them, the main task of the convolution layer is to perform convolution calculations, so as to use the convolution operation to extract the spatial feature information of the local area in the image. The BatchNorm layer is a normalization layer, which is often located after the convolution layer in the network. Its function is to standardize the feature quantities in the network, thereby speeding up the training speed and enhancing the generalization of the network. In the implementation process, it first inputs a batch of feature maps, then calculates the mean and variance of the feature values on each channel, and normalizes the feature values on each channel, and finally linearly transforms the normalized results to obtain the output results. The SiLu activation function is a nonlinear function that introduces nonlinear transformation capabilities, which enables the network to better adapt to various data change distributions.
如图5所示的C2f模块加入了更多并行分支且丰富了梯度支流,让YOLO8Plate在处于拥有轻量化优势的同时获得更多分支的梯度流信息。The C2f module shown in Figure 5 adds more parallel branches and enriches the gradient branches, allowing YOLO8Plate to obtain more branch gradient flow information while having the advantage of being lightweight.
如图6所示的SPPF(Spatial Pyramid Pooling-Fast)模块。SPPF模块是一种基于空间金字塔池化(SPP)思想改进的卷积神经网络模块,其实现了自适应尺寸输出的目标,在本模型中用于。除此以外,SPPF模块解决了两个问题:首先,为了使图像尺寸符合设计的网络层输入规格,目标图像需要经过缩放裁剪等操作,但是上述操作往往会导致图像失真,相较下SPPF可以解决图像的失真问题。其次第二个问题,网络需要处理多个尺度目标时不能使用固定大小的全连接层,SPPF模块可以替代在网络模型中全连接层的作用。The SPPF (Spatial Pyramid Pooling-Fast) module is shown in Figure 6. The SPPF module is a convolutional neural network module improved based on the idea of spatial pyramid pooling (SPP), which achieves the goal of adaptive size output and is used in this model. In addition, the SPPF module solves two problems: First, in order to make the image size meet the designed network layer input specifications, the target image needs to undergo operations such as scaling and cropping, but the above operations often cause image distortion. In contrast, SPPF can solve the image distortion problem. Secondly, when the network needs to process multiple scale targets, it cannot use a fixed-size fully connected layer. The SPPF module can replace the role of the fully connected layer in the network model.
SPPF模块被用于提取多尺度特征,然后将其转换为固定大小的特征向量输出,以便对不同大小的目标进行检测与识别。具体来说,SPPF模块首先将输入特征图分成不同大小的网格,然后对每个网格进行池化操作,得到一个固定维度的特征向量。这些特征向量最后再按照一定的顺序拼接在一起,形成一个固定大小的输出向量。这样就能够处理不同尺度的目标,并且不会因为特征图尺寸的不同而导致全连接层输入的维度不同。The SPPF module is used to extract multi-scale features and then convert them into fixed-size feature vector outputs to detect and identify objects of different sizes. Specifically, the SPPF module first divides the input feature map into grids of different sizes, and then performs a pooling operation on each grid to obtain a feature vector of fixed dimension. These feature vectors are finally spliced together in a certain order to form an output vector of fixed size. This makes it possible to handle objects of different scales, and the dimensions of the fully connected layer input will not be different due to different feature map sizes.
本申请中的YOLO8Plate算法的Neck部分使用自上而下的FPN(Feature PyramidNetwork)架构的基础上增加了自底向上的路径,通过构建高、中、低分辨率特征金字塔,将低分辨率的高层特征金字塔与高分辨率的低层特征金字塔进行融合,对不同尺寸的特征图进行多尺度特征融合,并把这些特征传递给预测层,实现对不同尺度目标的有效检测。The Neck part of the YOLO8Plate algorithm in this application uses a bottom-up path based on the top-down FPN (Feature Pyramid Network) architecture. It builds high-, medium-, and low-resolution feature pyramids, fuses the low-resolution high-level feature pyramid with the high-resolution low-level feature pyramid, performs multi-scale feature fusion on feature maps of different sizes, and passes these features to the prediction layer to achieve effective detection of targets of different scales.
从图7可以得到,Neck部分的左侧是Backbone部分提取特征得到的不同尺度特征图。通过Backbone部分,算法网络可以得到{P1,P2,P3,P4,P5}五组不同尺度的特征图,它们的大小是原图的{1/2,1/4,1/8,1/16,1/32}。As can be seen from Figure 7, the left side of the Neck part is the feature map of different scales obtained by extracting features from the Backbone part. Through the Backbone part, the algorithm network can obtain five groups of feature maps of different scales {P1, P2, P3, P4, P5}, and their sizes are {1/2, 1/4, 1/8, 1/16, 1/32} of the original image.
紧接着就是Neck的重点部分,Neck部分的具体网络如图8所示,Neck左半部分在特征金字塔结构上对得到的特征图进行上采样,然后将来自Backbone的下采样得到的特征图{P3,P4,P5}与上采样过程中得到的不同尺度的特征图分别进行融合,从而增大特征图的比例尺和融合不同尺度特征图。Neck部分的右边以类似的方式继续进行下采样,同样获得不同尺度、逐渐减小的特征图,并且将浅层的图形特征和深层的语义特征进行融合,得到更加完备的图像特征。Next is the key part of Neck. The specific network of Neck is shown in Figure 8. The left half of Neck upsamples the feature map obtained on the feature pyramid structure, and then fuses the feature map {P3, P4, P5} obtained by downsampling from Backbone with the feature maps of different scales obtained in the upsampling process, thereby increasing the scale of the feature map and fusing feature maps of different scales. The right side of Neck continues to downsample in a similar way, and also obtains feature maps of different scales and gradually decreasing, and fuses the shallow graphic features and deep semantic features to obtain more complete image features.
YOLO8Plate算法的Detection Head部分由损失函数和非极大值抑制(NMS)组成。DetectionHead部分将Neck部分输出的特征图作为输入,输出车牌的预测车牌类别(单行车牌或双行车牌)、预测关键框、车牌四个直角的预测关键点坐标,以及预测类别置信度。The Detection Head part of the YOLO8Plate algorithm consists of a loss function and non-maximum suppression (NMS). The Detection Head part takes the feature map output by the Neck part as input and outputs the predicted license plate category (single-row license plate or double-row license plate), the predicted key box, the predicted key point coordinates of the four right angles of the license plate, and the predicted category confidence.
训练时主要包含多个方面的损失:预测关键矩形框损失Lossbox、置信度损失Lossobj、分类损失Losscls、关键点损失Losskpts、关键点置信度损失函数Losskpts_conf。YOLO8Plate算法的整体损失函数公式如下:The training mainly includes several aspects of loss: prediction key rectangular box loss Loss box , confidence loss Loss obj , classification loss Loss cls , key point loss Loss kpts , key point confidence loss function Loss kpts_conf . The overall loss function formula of the YOLO8Plate algorithm is as follows:
YOLO8Plate使用的预测关键矩形框损失为CIOU_LOSS,置信度损失Lossobj为BCE_LOSS损失函数。The predicted key rectangular box loss used by YOLO8Plate is CIOU_LOSS, and the confidence loss Loss obj is BCE_LOSS loss function.
每个预测框的置信度表征这个预测框的靠谱程度,取值范围为0~1,其值越大表示该预测框越真实可信,也即越接近目标的真实最小包围关键框。以3*80*80图像矩阵为例(40*40和20*20图像矩阵同理),假设置信度标签为矩阵L,预测置信度为矩阵P,预测正确表示为mask=true,则3*80*80特征图像矩阵的置信度损失函数公式为:The confidence of each prediction box represents the reliability of the prediction box, and the value range is 0 to 1. The larger the value, the more credible the prediction box is, that is, the closer it is to the actual minimum enclosing key box of the target. Taking the 3*80*80 image matrix as an example (the same applies to the 40*40 and 20*20 image matrices), assuming that the confidence label is the matrix L, the prediction confidence is the matrix P, and the prediction is correct as mask = true, then the confidence loss function formula of the 3*80*80 feature image matrix is:
YOLO8Plate使用的分类损失Losscls也为BCE_LOSS损失函数。以3*80*80图像矩阵为例(3*40*40和3*20*20图像矩阵同理),神经网络对80*80矩阵的每个像素格子都预测3个预测框,每个预测框的预测信息都包含了N个分类概率。其中N为总类别数,比如本文车牌数据集有2个类别即单行车牌和双行车牌,那么N取2。所以对于本文车牌数据集,每个预测框有N个0~1的分类概率,那么神经网络总共预测3*80*80*80个分类概率,组成预测概率矩阵P。假设置标签概率为矩阵L,预测正确表示为mask=true,则3*80*80特征图像矩阵的分类损失函数公式为:The classification loss Loss cls used by YOLO8Plate is also the BCE_LOSS loss function. Taking the 3*80*80 image matrix as an example (the same applies to the 3*40*40 and 3*20*20 image matrices), the neural network predicts 3 prediction boxes for each pixel grid of the 80*80 matrix, and the prediction information of each prediction box contains N classification probabilities. N is the total number of categories. For example, the license plate data set in this article has 2 categories, namely single-row license plates and double-row license plates, so N is 2. Therefore, for the license plate data set in this article, each prediction box has N classification probabilities of 0 to 1, so the neural network predicts a total of 3*80*80*80 classification probabilities, forming the prediction probability matrix P. Assuming that the label probability is set as the matrix L, and the correct prediction is expressed as mask=true, the classification loss function formula of the 3*80*80 feature image matrix is:
YOLO8Plate算法的关键点损失Losskpts解决了关键点坐标的回归问题,其采用的损失函数为WING_LOSS。WING_LOSS是一个分段的复合损失函数,在训练初期误差较大时用对异常值相不是过分敏感的L1损失函数,促进定位错误的关键点从大错误中快速恢复。在训练后期误差相对小,用一个具有偏移量的对数函数,使神经网络的训练应更多关注具有小或中误差的样本,恢复不同大小误差之间的平衡。WINGLOSS函数公式如下:The key point loss Loss kpts of the YOLO8Plate algorithm solves the regression problem of key point coordinates, and the loss function it uses is WING_LOSS. WING_LOSS is a piecewise composite loss function. When the error is large in the early stage of training, the L1 loss function that is not overly sensitive to outliers is used to promote the rapid recovery of key points with positioning errors from large errors. In the later stage of training, the error is relatively small, and a logarithmic function with an offset is used to make the training of the neural network pay more attention to samples with small or medium errors, restoring the balance between errors of different sizes. The WINGLOSS function formula is as follows:
其中,正数w将非线性部分的范围限制在[-w,w]区间内,∈代表约束非线性区域的曲率,C是一个常数,来平滑地连接分段的线性和非线性部分。∈的取值是一个很小的数值,防止使网络训练变得不稳定,即因为小误差导致梯度爆炸问题。Among them, the positive number w limits the range of the nonlinear part to the interval [-w, w], ∈ represents the curvature of the constrained nonlinear region, and C is a constant to smoothly connect the linear and nonlinear parts of the segment. The value of ∈ is a very small value to prevent the network training from becoming unstable, that is, the gradient explosion problem caused by small errors.
针对每一个关键点,YOLO8Plate算法学习了一个置信度参数,它能够表示目标是否存在该关键点。YOLO8Plate算法使用的关键点置信度损失函数Losskpts_conf也是BCE_LOSS。假设代表第n个关键点的预测置信度,δ(vn)代表每个关键点的可见性标志,则关键点置信度损失函数公式如下:For each key point, the YOLO8Plate algorithm learns a confidence parameter, which can indicate whether the target has the key point. The key point confidence loss function Loss kpts_conf used by the YOLO8Plate algorithm is also BCE_LOSS. Assume represents the prediction confidence of the nth key point, δ(v n ) represents the visibility flag of each key point, and the key point confidence loss function formula is as follows:
最后训练阶段,YOLO8Plate算法预测生成大量目标预测关键框,这就会导致相同物体在候选框方面可能会有重叠和冗余的问题。因此在这种情况下,YOLO8Plate算法使用NMS算法判断哪些候选框是无效的,只保留最优的检测结果。具体过程为找到得分最高的预测框作为输出框,然后将所有与其IOU(交并比)大于阈值的其他边界框删掉。接着从剩余的预测框中再找到得分最高的预测框作为输出框,然后将与其IOU大于阈值的其他边界框删掉。重复上述步骤,直到所有的预测框都被处理完毕。In the final training stage, the YOLO8Plate algorithm predicts and generates a large number of target prediction key boxes, which may cause overlap and redundancy in the candidate boxes of the same object. Therefore, in this case, the YOLO8Plate algorithm uses the NMS algorithm to determine which candidate boxes are invalid and only retains the best detection results. The specific process is to find the prediction box with the highest score as the output box, and then delete all other bounding boxes whose IOU (intersection-over-union ratio) is greater than the threshold. Then find the prediction box with the highest score from the remaining prediction boxes as the output box, and then delete other bounding boxes whose IOU is greater than the threshold. Repeat the above steps until all prediction boxes have been processed.
YOLO8Plate算法的后处理(PostProcessing)部分的主要任务是将图像或视频中检测到的车牌图像裁剪下来并且对其进行矫正,并且将所有检测到的车牌转换为单行车牌,从而输入至后续车牌字符识别网络提高车牌字符识别的准确率。The main task of the post-processing part of the YOLO8Plate algorithm is to crop and correct the license plate images detected in the image or video, and convert all detected license plates into single-row license plates, which are then input into the subsequent license plate character recognition network to improve the accuracy of license plate character recognition.
后处理部分的流程图如图9所示。通过检测头(DetectionHead),YOLO8Plate算法可以得到车牌类别和关键点坐标等输出结果。紧接着,后处理部分通过四个关键点坐标,使用透视变换方式将任意倾斜畸变的四边形转化为矩形,从而对图像中的车牌小图进行裁剪且进行矫正。The flowchart of the post-processing part is shown in Figure 9. Through the detection head (DetectionHead), the YOLO8Plate algorithm can obtain output results such as license plate category and key point coordinates. Next, the post-processing part uses the perspective transformation method to transform any tilted and distorted quadrilateral into a rectangle through the four key point coordinates, thereby cropping and correcting the small license plate image in the image.
透视变换是一种基于投影原理的图像处理技术,其可以使图像重新投影至一个新的平面。将透视变换技术应用至本文系统中,即可以把任意四边形形状的畸变车牌转换为正常的矩形形状车牌。具体公式如下所示:Perspective transformation is an image processing technology based on the projection principle, which can reproject the image to a new plane. Applying perspective transformation technology to the system in this paper can convert any quadrilateral distorted license plate into a normal rectangular license plate. The specific formula is as follows:
其中,(U,V,W)是原始图像中坐标(u,v)对应的齐次坐标,(x,y)代表变换后图像内的坐标,T代表透视变换矩阵。为了得到透视变换矩阵T,至少需要4组原始图像的坐标点和其变换后图像对应的坐标点。通过透视变换矩阵T,本文系统可以实现畸变车牌的矫正。Among them, (U, V, W) is the homogeneous coordinate corresponding to the coordinate (u, v) in the original image, (x, y) represents the coordinate in the transformed image, and T represents the perspective transformation matrix. In order to obtain the perspective transformation matrix T, at least 4 sets of coordinate points of the original image and the coordinate points corresponding to the transformed image are required. Through the perspective transformation matrix T, the system in this paper can realize the correction of distorted license plates.
具体而言,后处理部分工作实现过程分为三步:首先,通过检测头输出的四个关键点坐标,在变换前的图像中选择一个四边形,并将其在变换后的图像设置为长方形。其次,使用OpenCV中的getPerspectiveTransform()函数,根据四边形的顶点坐标和相机参数等信息计算透视变换矩阵。最后,通过OpenCV中的warpPerspective()函数,将透视变换矩阵应用到原始图像上,得到变换后的图像。透视变换后图像效果如图10所示。Specifically, the post-processing part is implemented in three steps: First, through the four key point coordinates output by the detection head, a quadrilateral is selected in the image before transformation, and it is set to a rectangle in the transformed image. Second, the getPerspectiveTransform() function in OpenCV is used to calculate the perspective transformation matrix based on the vertex coordinates of the quadrilateral and camera parameters. Finally, the warpPerspective() function in OpenCV is used to apply the perspective transformation matrix to the original image to obtain the transformed image. The image effect after perspective transformation is shown in Figure 10.
在完成透视变换处理后,后处理部分紧接着对双行车牌进行变换处理。PostProcessing部分首先会对车牌对应车牌种类进行判别,若车牌是单行车牌,则后处理部分不作处理,直接将其输入至后续车牌字符识别网络。而若车牌是双行车牌,则后处理部分会在矫正后将其转换为单行车牌,作为后续车牌字符识别网络的输入。具体来说,车牌小图经过裁剪和透视变换校正后,后处理部分会先计算小图的尺寸,然后将车牌上半5/12高度的部分裁剪出来作为upper_img,将下半2/3高度的车牌图像部分裁剪出来作为lower_img,最后将upper_img尺寸resize调整为lower_img的尺寸,从左至右将upper_img和lower_img水平拼接起来得到单行车牌,具体效果如图11所示。After completing the perspective transformation, the post-processing part will then transform the double-row license plate. The PostProcessing part will first identify the type of license plate corresponding to the license plate. If the license plate is a single-row license plate, the post-processing part will not process it and directly input it into the subsequent license plate character recognition network. If the license plate is a double-row license plate, the post-processing part will convert it into a single-row license plate after correction as the input of the subsequent license plate character recognition network. Specifically, after the license plate thumbnail is cropped and perspective-corrected, the post-processing part will first calculate the size of the thumbnail, then crop the upper 5/12 height of the license plate as upper_img, and crop the lower 2/3 height of the license plate image as lower_img. Finally, resize the upper_img to the size of lower_img, and horizontally splice the upper_img and lower_img from left to right to obtain a single-row license plate. The specific effect is shown in Figure 11.
CRDPNet是一种用于车牌字符识别的深度学习算法,可以自动从车牌图像中识别出车牌字符号码,而不需要对车牌字符序列进行分割得到单个字符配对识别。其中,CRDPNet的网络结构包括预处理部分(Preprocessing)、骨干网络(Backbone)、预测网络部分(Prediction)。CRDPNet通过预处理模块规范网络的输入数据,然后通过骨干网络对图像进行特征提取,最后通过预测网络模块预测获得车牌字符序列。CRDPNet is a deep learning algorithm for license plate character recognition. It can automatically identify license plate character numbers from license plate images without segmenting the license plate character sequence to obtain single character pairing recognition. Among them, the network structure of CRDPNet includes a preprocessing part (Preprocessing), a backbone network (Backbone), and a prediction network part (Prediction). CRDPNet normalizes the input data of the network through the preprocessing module, then extracts features from the image through the backbone network, and finally predicts the license plate character sequence through the prediction network module.
除此以外,CRDPNet网络使用CTC(Connectionist Temporal Classification)损失进行端到端对模型训练,使模型自动学习到车牌号码的起始和结束位置,并预测出最可能识别车牌字符正确的概率向量和标签序列,从而识别出不定长的车牌字符序列。In addition, the CRDPNet network uses CTC (Connectionist Temporal Classification) loss for end-to-end model training, so that the model automatically learns the starting and ending positions of the license plate number, and predicts the probability vector and label sequence that are most likely to identify the correct license plate characters, thereby identifying license plate character sequences of indefinite length.
CRDPNet网络的预处理模块的主要任务调整输入车牌图像的尺寸,同时归一化图像矩阵并调整图像矩阵通道,使其符合CRDPNet网络的输入要求。The main task of the preprocessing module of the CRDPNet network is to adjust the size of the input license plate image, normalize the image matrix and adjust the image matrix channels to meet the input requirements of the CRDPNet network.
CRDPNet网络的Backbone部分主要由含有卷积神经网络的卷积层构成,负责提取车牌图像的图像特征。其最终会输出尺寸为(1,27,78)的特征张量,输送到后续网络结构进行解码计算得到车牌字符。The backbone of the CRDPNet network is mainly composed of convolutional layers containing convolutional neural networks, which are responsible for extracting the image features of the license plate image. It will eventually output a feature tensor of size (1, 27, 78) and send it to the subsequent network structure for decoding and calculation to obtain the license plate characters.
详细骨干网络结构如表1所示。其中,每一个卷积层模块都会在卷积操作后进行BatchNorm(批量归一化)操作和使用Relu激活函数。除此以外,最大池化层也会在池化过程中使用ceil_mod策略,即每次池化操作都会将自动填充图像不满足池化核尺寸的部分,以此保证池化输出张量尺寸满足后续输入要求。The detailed backbone network structure is shown in Table 1. Each convolutional layer module will perform BatchNorm (batch normalization) operation and use Relu activation function after the convolution operation. In addition, the maximum pooling layer will also use the ceil_mod strategy in the pooling process, that is, each pooling operation will automatically fill the part of the image that does not meet the pooling kernel size, so as to ensure that the pooling output tensor size meets the subsequent input requirements.
表1骨干网络结构Table 1 Backbone network structure
Prdiction部分由一个字符预测分支和一个颜色预测分支组成。The Prdiction part consists of a character prediction branch and a color prediction branch.
字符预测分支的主要作用将Backbone提取的特征进行分类预测,得到一个可以预测字符序列中每个字符概率的张量,最终计算得到预测概率最大的每个字符,即得到最可能识别正确的车牌字符序列。字符预测分支的网络结构如表2所示:The main function of the character prediction branch is to classify and predict the features extracted by Backbone, obtain a tensor that can predict the probability of each character in the character sequence, and finally calculate each character with the highest prediction probability, that is, obtain the license plate character sequence that is most likely to be recognized correctly. The network structure of the character prediction branch is shown in Table 2:
表2字符预测分支网络结构Table 2 Character prediction branch network structure
经过字符预测分支,网络最终会输出一个尺寸为(1,21,78)的预测结果张量。其中,数值78代表所有可能出现的车牌字符种类,后续挑选出概率最大的字符索引和比对字符表,CRDPNet算法网络可以识别得到的预测车牌字符序列结果。After the character prediction branch, the network will eventually output a prediction result tensor of size (1, 21, 78). The value 78 represents all possible license plate character types. The character index with the highest probability and the comparison character table are then selected. The CRDPNet algorithm network can recognize the predicted license plate character sequence results.
而颜色预测分支则是对提取的车牌底色特征进行颜色预测,最终得到颜色预测概率张量。颜色预测分支如表3所示。The color prediction branch performs color prediction on the extracted license plate background color features and finally obtains the color prediction probability tensor. The color prediction branch is shown in Table 3.
表3颜色预测分支网络结构Table 3 Color prediction branch network structure
经过颜色预测分支,网络最终输出的预测结果张量是一个仅有5个元素的一维向量。其中,数值5代表可能出现的车牌颜色,包括蓝色、绿色、黑色、白色、黄色。后续颜色预测分支挑选出预测概率最大的颜色索引和比对颜色表,可以识别得到的预测车牌颜色结果。After the color prediction branch, the network finally outputs a prediction result tensor of only 5 elements. The value 5 represents the possible license plate colors, including blue, green, black, white, and yellow. The subsequent color prediction branch selects the color index with the highest prediction probability and compares it with the color table to identify the predicted license plate color result.
在一些实施例中,输入包括车牌的视频或者图像,包括:In some embodiments, the input includes a video or image of a license plate, including:
S11:读取原始车牌的图像数据;S11: Read the image data of the original license plate;
S12:对图像数据进行预处理,预处理包括对数据进行扩充和增加数据多样性;S12: preprocessing the image data, including expanding the data and increasing the data diversity;
S13:将图像数据进行调整,得到辨识度强的图像数据。S13: Adjust the image data to obtain image data with high recognition.
在一些实施例中,检测出视频或图像中车牌的位置,包括:In some embodiments, detecting the location of a license plate in a video or image includes:
S21:提取图像中车牌数据的尺寸信息;S21: extracting size information of the license plate data in the image;
S22:按预设比例调节提取到的尺寸信息,以使得提取到的尺寸信息与原始车牌尺寸信息比例在预设值内。S22: adjusting the extracted size information according to a preset ratio so that the ratio of the extracted size information to the original license plate size information is within a preset value.
在一些实施例中,矫正裁剪后的图像,包括:通过透视变换方式将任意倾斜畸变的四边形图像转化为矩形图像;In some embodiments, correcting the cropped image includes: converting the arbitrarily tilted and distorted quadrilateral image into a rectangular image by perspective transformation;
对矩形图像进行裁剪。Crop a rectangular image.
在一些实施例中,在矫正裁剪后的图像之后,该方法还包括:判断矫正裁剪后的图像中的车牌字符为单层还是双层,若为单层,则直接识别矫正后的图像中的车牌信息;若为双层,则将双层字符转化为单层字符后再别矫正后的图像中的车牌信息。In some embodiments, after correcting the cropped image, the method also includes: determining whether the license plate characters in the corrected cropped image are single-layer or double-layer. If it is single-layer, directly identifying the license plate information in the corrected image; if it is double-layer, converting the double-layer characters into single-layer characters and then identifying the license plate information in the corrected image.
在一些实施例中,识别矫正后的图像中的车牌信息,包括:In some embodiments, identifying the license plate information in the rectified image includes:
将矫正后的图像尺寸进行归一化处理,使其符合CRDPNet网络的输入要求;Normalize the size of the rectified image to meet the input requirements of the CRDPNet network;
将处理后的图像输入到CRDPNet网络中的Backbone网络中,提取图像中的车牌字符信息。The processed image is input into the Backbone network in the CRDPNet network to extract the license plate character information in the image.
在一些实施例中,在提取图像中的车牌字符信息之后,该方法还包括:In some embodiments, after extracting the license plate character information in the image, the method further includes:
计算每个字符出现的概率,将出现概率最大的字符作为车牌字符序列。Calculate the probability of each character appearing, and use the character with the highest probability of appearing as the license plate character sequence.
在一些实施例中,根据车牌字符和车牌颜色判断车辆是否为新能源车辆,包括:In some embodiments, judging whether a vehicle is a new energy vehicle based on the license plate characters and the license plate color includes:
当车牌字符位数满足八位数或者车牌颜色为绿色时,则判断车辆为新能源车辆。When the number of characters in the license plate meets eight digits or the color of the license plate is green, the vehicle is judged to be a new energy vehicle.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的申请范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离前述申请构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims (9)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410185828.2A CN118053148A (en) | 2024-02-19 | 2024-02-19 | New energy vehicle identification method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410185828.2A CN118053148A (en) | 2024-02-19 | 2024-02-19 | New energy vehicle identification method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118053148A true CN118053148A (en) | 2024-05-17 |
Family
ID=91047724
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410185828.2A Pending CN118053148A (en) | 2024-02-19 | 2024-02-19 | New energy vehicle identification method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118053148A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118968778A (en) * | 2024-10-09 | 2024-11-15 | 思翼科技(深圳)有限公司 | License plate recognition method and device based on drone, drone and storage medium |
-
2024
- 2024-02-19 CN CN202410185828.2A patent/CN118053148A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118968778A (en) * | 2024-10-09 | 2024-11-15 | 思翼科技(深圳)有限公司 | License plate recognition method and device based on drone, drone and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110414507B (en) | License plate recognition method and device, computer equipment and storage medium | |
CN112381775B (en) | Image tampering detection method, terminal device and storage medium | |
US10198657B2 (en) | All-weather thermal-image pedestrian detection method | |
CN117253154B (en) | Container weak and small serial number target detection and identification method based on deep learning | |
CN111222513B (en) | License plate number recognition method and device, electronic equipment and storage medium | |
CN109344727B (en) | Identity card text information detection method and device, readable storage medium and terminal | |
CN115496928B (en) | Multi-modal image feature matching method based on multi-feature matching | |
CN110555464A (en) | Vehicle color identification method based on deep learning model | |
CN115331245B (en) | Table structure identification method based on image instance segmentation | |
CN113052170B (en) | Small target license plate recognition method under unconstrained scene | |
CN113139896A (en) | Target detection system and method based on super-resolution reconstruction | |
CN116612292A (en) | A small target detection method based on deep learning | |
CN113989794B (en) | License plate detection and recognition method | |
CN117456590B (en) | Face recognition method and device for visual transformation of intelligent city application | |
CN110969164A (en) | Low-illumination imaging license plate recognition method and device based on deep learning end-to-end | |
CN118053148A (en) | New energy vehicle identification method and system | |
CN115761444B (en) | Training method of incomplete information target recognition model and target recognition method | |
CN111612802B (en) | Re-optimization training method based on existing image semantic segmentation model and application | |
CN117576699A (en) | Locomotive work order information intelligent recognition method and system based on deep learning | |
CN113537211A (en) | A deep learning license plate frame location method based on asymmetric IOU | |
CN115690770A (en) | License Plate Recognition Method in Unconstrained Scenes Based on Spatial Attention Features | |
CN114283431B (en) | Text detection method based on differentiable binarization | |
CN116246059A (en) | Vehicle target recognition method based on improved YOLO multi-scale detection | |
CN115953744A (en) | A vehicle recognition and tracking method based on deep learning | |
CN113379001B (en) | Processing method and device for image recognition model |
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 |