WO2020140611A1 - Vin code identification method based on image processing, device and medium - Google Patents

Vin code identification method based on image processing, device and medium Download PDF

Info

Publication number
WO2020140611A1
WO2020140611A1 PCT/CN2019/117069 CN2019117069W WO2020140611A1 WO 2020140611 A1 WO2020140611 A1 WO 2020140611A1 CN 2019117069 W CN2019117069 W CN 2019117069W WO 2020140611 A1 WO2020140611 A1 WO 2020140611A1
Authority
WO
WIPO (PCT)
Prior art keywords
vehicle
shooting
target
target vehicle
vin code
Prior art date
Application number
PCT/CN2019/117069
Other languages
French (fr)
Chinese (zh)
Inventor
林春伟
马进
王健宗
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020140611A1 publication Critical patent/WO2020140611A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion

Definitions

  • vehicle environment information of the target vehicle within the shooting range of the shooting device includes the model of the target vehicle, the ambient light intensity of the target vehicle, and the distance between the target vehicle and the shooting device Any one or more of distance and system time;
  • an embodiment of the present application provides a computer non-volatile readable storage medium, where the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions When executed by a processor, the processor is caused to perform the method of the first aspect described above.
  • the vin code image After acquiring the vin code image including the vin code area, the vin code image can be processed to extract the vin code area.
  • edge detection can be performed on the vin code image, for example, the edge detection can be performed using a Canny operator.
  • the characteristic of the Canny algorithm is to try to assemble candidate pixels of independent edges into an outline.
  • the specific algorithm steps of Canny operator to find edge points are as follows:
  • the N can be obtained based on the statistical relationship between the character pitch size of the vin code area and the vin code image size in the captured image. For example, the larger the ratio between the character pitch size and the vin code image size, the larger the value of N.
  • the correspondence relationship between N and the ratio of the character pitch size to the image size is preset.
  • the N can be obtained according to the image width setting, for example, the value of the N can be 5% of the image width.
  • the morphological closed calculation result is obtained to exclude small black holes (black areas).
  • FIG. 2 is a schematic flowchart of another vin code recognition method based on image processing provided by an embodiment of the present application.
  • the vin code recognition method based on image processing may include the following steps:
  • the vehicle environment information of the target vehicle may include the vehicle model of the target vehicle.
  • the image processing device determines the target shooting parameter, it may find the shooting parameter corresponding to the same vehicle model as the target vehicle model from the database according to the preset correspondence between the vehicle model and the shooting parameter, and find out The shooting parameter of is determined as the target shooting parameter for shooting the target vehicle.
  • a variety of vehicle models and shooting parameters corresponding to each vehicle model can be pre-stored in the database.
  • the shooting parameters corresponding to each vehicle model may be selected vin code images with better shooting effects under the vehicle model, such as shooting quality greater than the preset quality threshold and/or vin code area accounting for the image ratio greater than the preset ratio threshold, etc. Sample shooting parameters.
  • the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle
  • the database stores multiple vehicle models and shooting parameters corresponding to each vehicle model.
  • the processing unit 302 may be specifically configured to determine a target distance interval in which the distance between the target vehicle and the shooting device is among the multiple distance intervals according to preset multiple distance intervals; according to the preset vehicle Correspondence between the vehicle model, the distance interval and the shooting parameters, the shooting parameters corresponding to the vehicle model of the target vehicle and the target distance interval are found from the database, and the found shooting parameters are determined Target shooting parameters for shooting the target vehicle;
  • the following steps may be specifically performed: performing edge detection on the vin code image after the tophat transformation to obtain an edge image after edge detection .
  • An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the computer program can be implemented as described in the embodiments corresponding to FIG. 1 to FIG. 2 Part or all of the steps in the vin code recognition method based on image processing may also realize the functions of the image processing device of the embodiment shown in FIG. 3 or FIG. 4 of the present application, and details are not described here.

Landscapes

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

Abstract

A vin code identification method based on image processing, a device and a medium, applied to the technical field of image processing. The method comprises: obtaining vehicle environment information of a target vehicle (101); determining a target photographing parameter according to the vehicle environment information, and acquiring a vin code image of the target vehicle by using a photographing device according to the target photographing parameter (102); performing edge detection on the vin code image to obtain an edge image subjected to the edge detection (103); performing morphological closing operation on the edge image to obtain a closing operation image (104); performing morphological opening operation on the closing operation image to obtain an opening operation image (105); determining a minimum enclosing rectangle of a vin code region in the opening operation image, and determining the region determined by the minimum enclosing rectangle as the vin code region of the target vehicle (106); and identifying the vin code region of the target vehicle to identify the vin code (107). The method is conductive to improving the identification efficiency of the vin code of the vehicle image.

Description

一种基于图像处理的vin码识别方法、设备及介质Vin code recognition method, device and medium based on image processing
本申请要求于2019年01月04日提交中国专利局、申请号为201910013905.5、申请名称为“一种基于图像处理的vin码识别方法、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requires the priority of the Chinese patent application submitted to the China Patent Office on January 04, 2019, with the application number 201910013905.5 and the application name as "a vin code recognition method, equipment and medium based on image processing", all of its content Incorporated by reference in this application.
技术领域Technical field
本申请涉及图像处理技术领域,尤其涉及一种基于图像处理的vin码识别方法、设备及介质。The present application relates to the field of image processing technology, and in particular, to a vin code recognition method, device, and medium based on image processing.
背景技术Background technique
目前经常会遇到获取车辆识别号码(Vehicle Identification Number,vin)信息的场景,比如办理车辆业务时。而在保险业务员办理车险业务的过程中,常常需要手动拍摄车辆vin码的图片进行存档,并由人工录入这些vin码信息,效率较低。为了提高效率,可以使用图像识别的方式自动识别出业务员拍摄的图片中的vin码,而识别的第一步,就是要提取出图像中vin码标牌所处的区域。因此,如何识别vin码区域以进一步识别出vin码,从而提升图像识别效率成为关键。At present, we often encounter scenarios of obtaining vehicle identification number (Vehicle Identification Number, vin) information, such as when handling vehicle business. In the process of the insurance salesman handling the car insurance business, it is often necessary to manually take pictures of the vehicle's vin code and archive it, and manually enter the vin code information, which is less efficient. In order to improve efficiency, you can use image recognition to automatically recognize the vin code in the picture taken by the salesperson. The first step in recognition is to extract the area where the vin code sign is located in the image. Therefore, how to identify the vin code area to further identify the vin code, thereby improving the efficiency of image recognition becomes the key.
发明内容Summary of the invention
本申请实施例提供了一种基于图像处理的vin码识别方法、设备及介质,有助于提升对车辆图像的vin码的识别效率。Embodiments of the present application provide a vin code recognition method, device, and medium based on image processing, which help to improve the recognition efficiency of the vin code of a vehicle image.
第一方面,本申请实施例提供了一种基于图像处理的vin码识别方法,包括:In a first aspect, an embodiment of the present application provides a vin code recognition method based on image processing, including:
获取拍摄装置拍摄范围内的目标车辆的车辆环境信息,所述车辆环境信息包括所述目标车辆的车型、所述目标车辆所处的环境光强度、所述目标车辆与所述拍摄装置之间的距离和系统时间中的任一项或多项;Obtain vehicle environment information of the target vehicle within the shooting range of the shooting device, where the vehicle environment information includes the model of the target vehicle, the ambient light intensity of the target vehicle, and the distance between the target vehicle and the shooting device Any one or more of distance and system time;
根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数,使用所述拍摄装置并按照所述目标拍摄参数采集所述目标车辆的vin码图像,所述vin码图像包括所述目标车辆的vin码区域;Determining a target shooting parameter for shooting the target vehicle according to the vehicle environment information, using the shooting device and collecting a vin code image of the target vehicle according to the target shooting parameter, the vin code image including the target The vin code area of the vehicle;
对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像;Performing edge detection on the vin code image to obtain an edge image after edge detection;
对所述边缘图像进行形态学闭运算,以得到闭运算图像;Performing a morphological closed operation on the edge image to obtain a closed operation image;
对所述闭运算图像进行形态学开运算,以得到开运算图像;Performing morphological opening operation on the closed operation image to obtain an open operation image;
确定所述开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述目标车辆的vin码区域;Determine the minimum circumscribed rectangle of the vin code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle;
对所述目标车辆的vin码区域进行识别,以识别出所述目标车辆的vin码。The vin code area of the target vehicle is identified to identify the vin code of the target vehicle.
第二方面,本申请实施例提供了一种图像处理设备,该图像处理设备包括用于执行上述第一方面的方法的单元。In a second aspect, an embodiment of the present application provides an image processing device including an unit for performing the method of the first aspect described above.
第三方面,本申请实施例提供了另一种图像处理设备,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储支持图像处理设备执行上述方法的计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执 行上述第一方面的方法。可选的,该图像处理设备还可包括用户接口和/或通信接口。In a third aspect, an embodiment of the present application provides another image processing device, including a processor and a memory, where the processor and the memory are connected to each other, wherein the memory is used to store a computer program that supports the image processing device to execute the above method The computer program includes program instructions, and the processor is configured to call the program instructions to perform the method of the first aspect. Optionally, the image processing device may further include a user interface and/or a communication interface.
第四方面,本申请实施例提供了一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行上述第一方面的方法。According to a fourth aspect, an embodiment of the present application provides a computer non-volatile readable storage medium, where the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions When executed by a processor, the processor is caused to perform the method of the first aspect described above.
本申请实施例能够通过获取车辆的车辆环境信息,根据该车辆环境信息确定出拍摄参数,并按照该拍摄参数采集该车辆的vin码图像,进而能够通过对该vin码图像进行边缘检测得到边缘图像,对该边缘图像进行形态学闭运算和开运算,再根据图像中的最小外接矩形提取得到车辆的vin码区域,以通过对该vin码区域进行识别得到车辆的vin码,从而提升了vin码图像的拍摄效果,提升了获取的vin码图像的可靠性,有助于提升对车辆图像的vin码的识别效率。The embodiments of the present application can obtain the vehicle environment information of the vehicle, determine the shooting parameters according to the vehicle environment information, and collect the vin code image of the vehicle according to the shooting parameters, and then can obtain the edge image by performing edge detection on the vin code image , Perform morphological close operation and open operation on the edge image, and then extract the vin code area of the vehicle according to the smallest circumscribed rectangle in the image to identify the vin code area to obtain the vin code of the vehicle, thereby improving the vin code The shooting effect of the image improves the reliability of the acquired vin code image and helps to improve the recognition efficiency of the vin code of the vehicle image.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图进行说明。In order to more clearly explain the technical solutions of the embodiments of the present application, the drawings required in the description of the embodiments will be described below.
图1是本申请实施例提供的一种基于图像处理的vin码识别方法的流程示意图;1 is a schematic flowchart of a vin code recognition method based on image processing provided by an embodiment of the present application;
图2是本申请实施例提供的另一种基于图像处理的vin码识别方法的流程示意图;2 is a schematic flowchart of another vin code recognition method based on image processing provided by an embodiment of the present application;
图3是本申请实施例提供的一种图像处理设备的结构示意图;3 is a schematic structural diagram of an image processing device provided by an embodiment of the present application;
图4是本申请实施例提供的另一种图像处理设备的结构示意图。4 is a schematic structural diagram of another image processing device provided by an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
本申请的技术方案可应用于图像处理设备中,该图像处理设备可包括各种终端、服务器或其他设备,用于对图像进行处理,比如提取图像中的vin码区域、识别图像中的vin码等等。本申请涉及的终端可以是手机、电脑、平板、个人计算机、智能手表等,本申请不做限定。The technical solution of the present application may be applied to an image processing device, which may include various terminals, servers, or other devices, for processing an image, such as extracting a vin code area in an image, identifying a vin code in an image and many more. The terminal involved in this application may be a mobile phone, computer, tablet, personal computer, smart watch, etc. This application is not limited.
本申请能够通过获取车辆的车辆环境信息如车辆车型、车辆所处的环境光强度、车辆与拍摄装置之间的距离和/或系统时间等等,以根据该车辆环境信息确定出拍摄参数,并按照该拍摄参数采集该车辆的vin码图像,这就提升了vin码图像的拍摄效果,提升了获取的vin码图像的可靠性;进而能够通过对该vin码图像进行边缘检测得到边缘图像,对该边缘图像进行形态学闭运算和开运算,再根据图像中的最小外接矩形提取得到车辆的vin码区域,以通过对该vin码区域进行识别得到车辆的vin码,从而有助于提升对车辆图像的vin码的识别效率。以下分别详细说明。This application can determine the shooting parameters according to the vehicle environment information by acquiring vehicle environment information of the vehicle, such as the vehicle model, the ambient light intensity of the vehicle, the distance between the vehicle and the shooting device, and/or the system time, etc. According to the shooting parameters, the vin code image of the vehicle is collected, which improves the shooting effect of the vin code image and the reliability of the obtained vin code image; furthermore, the edge image can be obtained by performing edge detection on the vin code image. The edge image is morphologically closed and opened, and then the vin code area of the vehicle is extracted according to the smallest circumscribed rectangle in the image to identify the vin code area to obtain the vin code of the vehicle, thereby helping to improve the vehicle The recognition efficiency of the vin code of the image. Each is explained in detail below.
请参见图1,图1是本申请实施例提供的一种基于图像处理的vin码识别方法的流程示意图。具体的,本实施例的方法可具体应用于上述的图像处理设备中。如图1所示,该基于图像处理的vin码识别方法可以包括以下步骤:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a vin code recognition method based on image processing provided by an embodiment of the present application. Specifically, the method of this embodiment may be specifically applied to the above-mentioned image processing device. As shown in FIG. 1, the vin code recognition method based on image processing may include the following steps:
101、获取拍摄装置拍摄范围内的目标车辆的车辆环境信息。101. Acquire vehicle environment information of a target vehicle within a shooting range of a shooting device.
其中,该拍摄装置可以是相机、摄像机、摄像头或其他可用于拍摄的装置或设备,该拍摄装置可设置于该图像处理设备中,或者可以与该图像处理设备连接。该拍摄范围可以 为该拍摄装置可以采集到图像的范围,或者可以为该拍摄装置的采集图像的质量大于预设质量阈值的范围,或者可以为预设的距离范围,等等,本申请不做限定。Wherein, the shooting device may be a camera, a video camera, a camera, or other devices or devices that can be used for shooting, and the shooting device may be provided in the image processing device, or may be connected to the image processing device. The shooting range may be a range where the shooting device can collect images, or may be a range where the quality of the captured image of the shooting device is greater than a preset quality threshold, or may be a preset distance range, etc., which is not done in this application limited.
可选的,该目标车辆可以是指该拍摄范围内的任一车辆,或者可以为该拍摄范围内特定车型的车辆,或者可以为该拍摄范围内特定位置区域的车辆,或者可以为该拍摄范围内发出指示信号(如开启双闪或开启雨刷等等)的车辆,等等,具体可预先设置得到该目标车辆的选取规则,从而提升了目标车辆的选取的灵活性。Optionally, the target vehicle may refer to any vehicle within the shooting range, or may be a vehicle of a specific vehicle type within the shooting range, or may be a vehicle of a specific location area within the shooting range, or may be the shooting range Vehicles that emit instruction signals (such as turning on double flashes or turning on wipers, etc.), etc., can be set in advance to obtain the selection rules of the target vehicle, thereby improving the flexibility of selecting the target vehicle.
进一步可选的,该车辆环境信息可包括该目标车辆的车型、该目标车辆所处的环境光强度、该目标车辆与该拍摄装置之间的距离(或该目标车辆与该图像处理设备之间的距离)和系统时间等信息项中的任一项或多项。进一步可选的,该车辆环境信息可以是用户输入的;或者可以是由图像处理设备自动识别的,比如通过预览该目标车辆的采集图像确定其车型,通过预置的距离传感器确定出该距离,通过预置的光线传感器确定出该环境光强度,通过预置的时间模块确定系统时间等等;或者可以是其他设备(如该目标车辆)识别出该车辆环境信息后发送给该图像处理设备的,图像处理设备可接收来自其他设备发送的该目标车辆的车辆环境信息,等等,此处不一一列举。Further optionally, the vehicle environment information may include the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device (or between the target vehicle and the image processing device Any one or more of the information items such as distance) and system time. Further optionally, the vehicle environment information may be input by the user; or it may be automatically recognized by the image processing device, for example, by previewing the collected image of the target vehicle to determine its vehicle type, and determining the distance by a preset distance sensor, The ambient light intensity is determined by a preset light sensor, the system time is determined by a preset time module, etc.; or it may be sent to the image processing device after other devices (such as the target vehicle) recognize the vehicle environmental information The image processing device can receive the vehicle environment information of the target vehicle sent from other devices, and so on, which are not enumerated here.
102、根据该车辆环境信息确定用于拍摄该目标车辆的目标拍摄参数,使用该拍摄装置并按照该目标拍摄参数采集该目标车辆的vin码图像,该vin码图像包括该目标车辆的vin码区域。102. Determine the target shooting parameters for shooting the target vehicle according to the vehicle environment information, use the shooting device and collect the vin code image of the target vehicle according to the target shooting parameters, the vin code image includes the vin code area of the target vehicle .
其中,vin(Vehicle Identification Number)可以叫做车辆识别号码,还可以叫做车架号等等。vin码是一组由十七个数组成的,用于标识车辆的一组独一无二的号码,也就是说,每一车辆都有唯一的vin码。通过vin码可以识别车辆的生产商、引擎、底盘序号及其他性能等资料。Among them, vin (Vehicle Identification Number) can be called the vehicle identification number, can also be called the frame number and so on. The vin code is a set of seventeen numbers that is used to identify a unique number of vehicles. In other words, each vehicle has a unique vin code. The vin code can identify the vehicle manufacturer, engine, chassis serial number, and other performance data.
可选的,在确定用于拍摄该目标车辆的目标拍摄参数时,图像处理设备可以是通过预置的各车辆环境信息与拍摄参数的对应关系,基于该对应关系快速确定出该车辆环境信息对应的拍摄参数作为该目标拍摄参数,以提升拍摄参数的确定效率;或者,图像处理设备还可以是根据该车辆环境信息如车型,基于拍摄的该目标车辆的vin码图像与数据库中存储的该车型下的各vin码图像样本的相似度,将数据库中该车型下与该目标车辆的vin码图像相似度最高的vin码图像样本对应的拍摄参数作为该目标车辆的该目标拍摄参数,该数据库中可存储有多个vin码图像样本、多种车型以及与每个vin码图像样本和每种车型对应的(较佳)拍摄参数;或者,图像处理设备还可以是根据该车辆环境信息将上一次手动调节的与该车辆环境信息相同的车辆的拍摄参数作为该目标拍摄参数,等等,此处不一一列举。Optionally, when determining the target shooting parameters for shooting the target vehicle, the image processing device may quickly determine the correspondence of the vehicle environment information based on the correspondence between preset vehicle environment information and shooting parameters The shooting parameters are used as the target shooting parameters to improve the determination efficiency of the shooting parameters; or, the image processing device may also be based on the vehicle environment information such as the vehicle model, based on the captured vin code image of the target vehicle and the vehicle model stored in the database The similarity of each vin code image sample under the vehicle model, the shooting parameters corresponding to the vin code image sample with the highest vin code image similarity of the target vehicle in the database for the target vehicle are taken as the target shooting parameter of the target vehicle, the database It can store multiple vin code image samples, multiple car models, and (preferred) shooting parameters corresponding to each vin code image sample and each car model; or, the image processing device can also be based on the vehicle environment information. Manually adjusted shooting parameters of the vehicle with the same vehicle environmental information as the target shooting parameters, and so on, are not listed here one by one.
进一步的,在确定出拍摄该目标车辆的vin码的拍摄参数,即目标拍摄参数之后,即可使用该拍摄装置以该目标拍摄参数采集(拍摄)该目标车辆的vin码图像,即对该目标车辆的vin码区域进行拍摄,以得到包括该vin码区域的vin码图像。Further, after determining the shooting parameters for shooting the vin code of the target vehicle, that is, the target shooting parameters, the shooting device can be used to collect (shoot) the vin code image of the target vehicle with the target shooting parameters, that is, the target The vin code area of the vehicle is photographed to obtain a vin code image including the vin code area.
可选的,本申请涉及的拍摄参数如目标拍摄参数可包括拍摄角度(控制拍摄装置以该拍摄角度拍摄)、焦距、光圈、ISO和/或EV值等等,本申请不做限定。Optionally, the shooting parameters involved in the present application, such as target shooting parameters, may include a shooting angle (to control the shooting device to shoot at the shooting angle), a focal length, an aperture, an ISO and/or EV value, etc., which is not limited in this application.
103、对该vin码图像进行边缘检测,以得到边缘检测后的边缘图像。103. Perform edge detection on the vin code image to obtain an edge image after edge detection.
在采集得到包括该vin码区域的vin码图像之后,即可对该vin码图像进行处理,以提 取出该vin码区域。对该vin码图像进行处理时,可以对该vin码图像进行边缘检测,如可采用Canny算子进行边缘检测。该Canny算法的特点是试图将独立边的候选像素拼装成轮廓。Canny算子求边缘点具体算法步骤如下:After acquiring the vin code image including the vin code area, the vin code image can be processed to extract the vin code area. When processing the vin code image, edge detection can be performed on the vin code image, for example, the edge detection can be performed using a Canny operator. The characteristic of the Canny algorithm is to try to assemble candidate pixels of independent edges into an outline. The specific algorithm steps of Canny operator to find edge points are as follows:
1)用高斯滤波器与图像(如该vin码图像)进行卷积,以平滑图像,滤除噪声;1) Use a Gaussian filter to convolve the image (such as the vin code image) to smooth the image and filter out noise;
2)用一阶偏导有限差分计算图像中每个像素点的梯度幅值(梯度强度)和方向;图像中的边缘可以指向各个方向,Canny算法可以使用算子(如Roberts,Prewitt,Sobel等)来检测图像中的水平、垂直和对角边缘,获取水平和垂直方向的一阶导数值,由此确定出像素点的梯度幅值和方向,其中,梯度方向的计算和梯度算子的选取保持一致;2) Use the first-order partial derivative finite difference to calculate the gradient amplitude (gradient strength) and direction of each pixel in the image; the edges in the image can point in various directions, and the Canny algorithm can use operators (such as Roberts, Prewitt, Sobel, etc.) ) To detect the horizontal, vertical, and diagonal edges in the image, and obtain the first derivative values in the horizontal and vertical directions, thereby determining the gradient amplitude and direction of the pixel, where the gradient direction is calculated and the gradient operator is selected be consistent;
3)对梯度幅值进行非极大值抑制,以消除边缘检测带来的杂散响应;具体的,对梯度图像中每个像素进行非极大值抑制时,可以将当前像素的梯度强度与沿正负梯度方向上的两个像素进行比较,如果当前像素的梯度强度与另外两个像素相比最大,则该像素点保留为边缘点,否则该像素点将被抑制,从而将局部最大值之外的所有梯度值抑制为0,以实现“瘦”边;3) Perform non-maximum suppression on the gradient amplitude to eliminate the spurious response caused by edge detection; specifically, when performing non-maximum suppression on each pixel in the gradient image, the gradient intensity of the current pixel can be Compare the two pixels along the positive and negative gradient direction. If the gradient intensity of the current pixel is the largest compared to the other two pixels, the pixel point will remain as an edge point, otherwise the pixel point will be suppressed, thus the local maximum All gradient values except for are suppressed to 0 in order to achieve a "thin" edge;
4)用双阈值(Double-Threshold)算法检测和连接边缘;具体的,进行3)之后,此时还是存在由于噪声和颜色变化引起的一些边缘像素,由此可以通过设置高低阈值,如果边缘像素的梯度值高于高阈值,则可将其标记为强边缘像素;如果边缘像素的梯度值小于高阈值并且大于低阈值,则可将其标记为弱边缘像素;如果边缘像素的梯度值小于低阈值,则被抑制。从而能够通过边缘检测能够实现从不同视觉对象中提取有用的结构信息,并减少了要处理的数据量。4) Double-Threshold algorithm is used to detect and connect edges; specifically, after 3), there are still some edge pixels caused by noise and color changes, which can be set by setting high and low thresholds, if the edge pixels The gradient value of is higher than the high threshold, it can be marked as a strong edge pixel; if the gradient value of the edge pixel is less than the high threshold and greater than the low threshold, it can be marked as a weak edge pixel; if the gradient value of the edge pixel is less than low The threshold is suppressed. Therefore, it is possible to extract useful structural information from different visual objects through edge detection, and reduce the amount of data to be processed.
104、对该边缘图像进行形态学闭运算,以得到闭运算图像。104. Perform a morphological close operation on the edge image to obtain a closed operation image.
在对vin码图像进行边缘检测得到边缘检测结果图像即边缘图像之后,还可对该边缘图形进行形态学闭运算,先膨胀后腐蚀。从而得到形态学闭运算结果,以排除小型黑洞(黑色区域)。在进行形态学闭运算时,使用的结构元素可以为一个尺寸为1*N的行向量结构元素,以将水平方向上不连续的边缘连接起来。其中,N可以为列数,可用于指示结构元素的宽度,N大于0。After edge detection is performed on the vin code image to obtain an edge detection result image, that is, an edge image, a morphological closing operation can also be performed on the edge graphic, which is expanded first and then corroded. Thus, the morphological closed calculation result is obtained to exclude small black holes (black areas). When performing morphological closed operations, the structural element used may be a row vector structural element with a size of 1*N to connect discontinuous edges in the horizontal direction. Among them, N can be the number of columns, which can be used to indicate the width of the structural element, and N is greater than 0.
可选的,该N可以是根据该vin码图像的分辨率设置得到的;和/或,该N可以是根据该vin码图像中vin码区域的尺寸设置得到的,该尺寸可包括长度或宽度;和/或,该N可以是根据该vin码区域中字符间距与该vin码图像的尺寸的比值设置得到的;和/或,该N可以是根据该vin码图像的宽度设置得到的。例如,该N可根据图像的分辨率和/或图像中vin码区域的大小(尺寸)设置得到,分辨率越大和/或vin码区域越大,N的取值越大,具体可预先设置N与图像的分辨率(和/或图像中vin码区域的大小)的对应关系。又如,该N可根据拍摄图像中vin码区域的字符间距大小与vin码图像大小的统计关系得到,比如字符间距大小与vin码图像大小的比值越大,N的取值越大,具体可预先设置N与字符间距大小与图像大小的比值的对应关系。又如,该N可以根据图像宽度设置得到,比如该N的值可以取图像宽度的5%。从而得到形态学闭运算结果,以排除小型黑洞(黑色区域)。也就是说,进行闭运算的结构元素N可以是根据图像的分辨率和/或图像中vin码区域的大小、图像中vin码区域的字符间距大小与图像大小的比值、图像宽度等参数设置得到,灵活性较高,提升了图像处理效果。Optionally, the N may be obtained according to the resolution setting of the vin code image; and/or, the N may be obtained according to the size setting of the vin code area in the vin code image, and the size may include length or width ; And/or, the N may be set according to the ratio of the character pitch in the vin code area to the size of the vin code image; and/or, the N may be obtained according to the width setting of the vin code image. For example, the N can be set according to the resolution of the image and/or the size (size) of the vin code area in the image. The larger the resolution and/or the larger the vin code area, the larger the value of N, which can be set in advance. Correspondence with the resolution of the image (and/or the size of the vin code area in the image). For another example, the N can be obtained based on the statistical relationship between the character pitch size of the vin code area and the vin code image size in the captured image. For example, the larger the ratio between the character pitch size and the vin code image size, the larger the value of N. Specifically, The correspondence relationship between N and the ratio of the character pitch size to the image size is preset. For another example, the N can be obtained according to the image width setting, for example, the value of the N can be 5% of the image width. Thus, the morphological closed calculation result is obtained to exclude small black holes (black areas). That is to say, the structural element N for the closed operation can be obtained according to the parameters such as the resolution of the image and/or the size of the vin code area in the image, the ratio of the character pitch of the vin code area in the image to the image size, and the image width. , Higher flexibility and improved image processing effect.
105、对该闭运算图像进行形态学开运算,以得到开运算图像。105. Perform morphological opening operation on the closed operation image to obtain an open operation image.
在进行形态学闭运算后,再进行形态学开运算处理,先腐蚀后膨胀,以将图像中的小尺寸噪声去除。形态学开运算使用的结构元素可与上述的闭运算使用的结构元素保持一致。从而得到形态学开运算结果,以实现消除小物体、在纤细点处分离物体、平滑较大物体的边界的同时并不明显改变其面积等效果。After the morphology close operation is performed, the morphology open operation processing is performed, firstly eroded and then expanded to remove small-size noise in the image. The structural elements used in the open operation of morphology can be consistent with the structural elements used in the closed operation described above. Thus, the morphological opening operation result is obtained to achieve the effects of eliminating small objects, separating objects at slender points, and smoothing the boundaries of larger objects without significantly changing their area.
106、确定该开运算图像中vin码区域的最小外接矩形,并将该最小外接矩形确定的区域确定为该目标车辆的vin码区域。106. Determine the minimum circumscribed rectangle of the vin code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle.
在步骤105得到的结果图像中,显示为白色的部分为前景,黑色部分为背景,通过对该结果图像即开运算图像进行扫描,即可计算得到前景部分的最小外接矩形,则该最小外接矩形所确定(包围)的区域即为vin码标牌所在区域也即vin码区域。In the result image obtained in step 105, the part displayed as white is the foreground, and the black part is the background. By scanning the result image, the minimum circumscribed rectangle of the foreground part can be calculated, and then the minimum circumscribed rectangle The determined (enclosed) area is the area where the vin code sign is located, that is, the vin code area.
也就是说,在提取图像中的vin码区域时,本申请可采用边缘检测,形态学闭运算,形态学开运算,计算最小外接矩形的一套简单快速的算法来确定vin码区域,进而识别出vin码。可见,本申请提出的方法能够较好地从原始图像中提取出vin码区域。That is to say, when extracting the vin code area in the image, this application can use a set of simple and fast algorithms to determine the vin code area by using edge detection, morphological close operation, and morphological open operation to calculate the smallest circumscribed rectangle, and then identify Vin code. It can be seen that the method proposed in this application can better extract the vin code region from the original image.
107、对该目标车辆的vin码区域进行识别,以识别出该目标车辆的vin码。107. Identify the vin code area of the target vehicle to identify the vin code of the target vehicle.
在提取出该vin码区域之后,即可存储该vin码区域的图像,和/或进一步识别出该vin码区域包括的字符(标牌)或条码等等。可选的,对该vin码区域进行识别的方式包括OCR字符识别或其他识别方式,本方案不做限定。After the vin code area is extracted, an image of the vin code area can be stored, and/or a character (signage) or barcode included in the vin code area can be further recognized. Optionally, the manner of identifying the vin code area includes OCR character recognition or other recognition methods, which is not limited in this solution.
可选的,为了确保识别出的vin码的可靠性,在识别出该vin码之后,还可对该vin进行校验,以确定其是否正确/合法,比如可以对该识别出的vin码的第9位进行校验。因vin码的第9位始终为校验位,通过对vin码中的其他位进行一系列计算后即可获得正确的校验位(其中,vin码的第9位为1-9任意一位数字或“X”。计算方法可以为将vin中其余每一位字母或数字的对应数值乘以该位的加权系数,然后除以11,余数即为校验位,若余数为10,校验位为“X”,该加权系数可参见《世界汽车识别代号(VIN)资料手册》P21~23。例如,首先将其它16位中的字母按下列关系转换成数字:A=1 B=2 C=3 D=4 E=5 F=6 G=7 H=8 J=1 K=2 L=3 M=4 N=5 P=7 R=9 S=2 T=3 U=4 V=5 W=6 X=7 Y=8 Z=9,每个位置及其对应的加权系数为:位置:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17,加权系数:8 7 6 5 4 3 2 10*9 8 7 6 5 4 3 2),进而可通过将该计算出的校验位和该第9位进行比较,判断两者是否相同,确定识别出的vin码是否存在错误,也即,两者不同时,表明该vin码存在错误。或者,可以检测识别出的vin码中是否存在非法字符,具体可以通过预置合法字符白名单进行匹配比对,如果存在非法字符,比如该白名单以外的字符,如I、O、Q等等,可以确定该识别出的vin码存在错误。或者,可以通过检测识别出的vin码的位数,因为正常vin码是固定的17位,如果长于或短于17位,则可以确定该识别出的vin码存在错误。如果确定识别出的vin码存在错误,还可以触发重新识别(如果错误次数达到预设次数阈值如3次,还可重新进行vin码区域的提取并重新识别),或者发出告警信息以提示进行人工识别或检测等等。Optionally, in order to ensure the reliability of the identified vin code, after the vin code is identified, the vin can also be checked to determine whether it is correct/legal, such as the identification of the vin code The 9th digit is checked. Because the ninth bit of the vin code is always a check digit, the correct check digit can be obtained by performing a series of calculations on other bits in the vin code (wherein the ninth bit of the vin code is any one of 1-9 The number or "X". The calculation method can be multiplied by the corresponding value of each remaining letter or number in vin by the weighting coefficient of the bit, and then divided by 11, the remainder is the check digit. If the remainder is 10, the check digit The bit is "X", the weighting coefficient can be found in the "World Automobile Identification Code (VIN) Information Manual" P21 ~ 23. For example, first convert the letters in the other 16 bits into numbers according to the following relationship: A = 1 B = 2 C =3 D = 4 E = 5 F = 6 G = 7 H = 8 J = 1 K = 2 L = 3 M = 4 N = 5 P = 7 R = 9 S = 2 T = 3 U = 4 V = 5 W = 6 X = 7 Y = 8 Z = 9, each position and its corresponding weighting coefficient are: position: 1 2 3 4 4 5 6 7 8 8 9 10 11 12 13 14 15 16 16 weighting coefficient 8 7 6 5 4 4 3 2 10*9 8 7 7 6 5 4 3 2), and then by comparing the calculated check digit with the 9th digit to determine whether the two are the same, to determine whether there is an error in the recognized vin code , That is, when the two are different, it indicates that there is an error in the vin code. Or, it can detect whether there are illegal characters in the recognized vin code. Specifically, it can be matched and matched by presetting a white list of legal characters. If there are illegal characters, such as characters outside the white list, such as I, O, Q, etc. , It can be determined that the recognized vin code has an error. Alternatively, the number of digits of the recognized vin code can be detected because the normal vin code is a fixed 17 bits. If it is longer or shorter than 17 bits, it can be determined that the recognized vin code has an error. If it is determined that there is an error in the recognized vin code, it can also trigger re-identification (if the number of errors reaches the preset number of thresholds such as 3 times, the vin code area can be extracted and re-identified again), or an alarm message is issued to prompt manual Identification or detection, etc.
在获取到正确的vin码之后,即可存储该vin码,或者可基于该vin码办理车辆业务如车险投保等等,从而提升业务办理的智能化和效率。After the correct vin code is obtained, the vin code can be stored, or the vehicle business such as auto insurance can be processed based on the vin code, thereby improving the intelligence and efficiency of business processing.
本申请的vin码区域提取方式,在对图像中的vin码区域进行提取时,提升了检测效 率,可以很好地克服车体反射景物的干扰,准确性较高,且能够适用于在性能有限的嵌入式系统中应用,应用范围广。The vin code area extraction method of the present application improves the detection efficiency when extracting the vin code area in the image, can well overcome the interference of the vehicle body reflecting the scene, has high accuracy, and can be applied to the limited performance It is widely used in embedded systems.
在本实施例中,图像处理设备能够通过获取车辆的车辆环境信息,根据该车辆环境信息确定出拍摄参数,并按照该拍摄参数采集该车辆的vin码图像,进而能够通过对该vin码图像进行边缘检测得到边缘图像,对该边缘图像进行形态学闭运算和开运算,再根据图像中的最小外接矩形提取得到车辆的vin码区域,以通过对该vin码区域进行识别得到车辆的vin码,从而提升了vin码图像的拍摄效果,提升了获取的vin码图像的可靠性,有助于提升对车辆图像的vin码的识别效率。In this embodiment, the image processing device can obtain the vehicle environment information of the vehicle, determine the shooting parameters according to the vehicle environment information, and collect the vin code image of the vehicle according to the shooting parameters, and then can perform the vin code image Edge detection obtains an edge image, performs morphological close operation and open operation on the edge image, and then extracts the vin code area of the vehicle according to the smallest circumscribed rectangle in the image, to obtain the vin code of the vehicle by identifying the vin code area, Therefore, the shooting effect of the vin code image is improved, the reliability of the acquired vin code image is improved, and the recognition efficiency of the vin code of the vehicle image is improved.
请参见图2,图2是本申请实施例提供的另一种基于图像处理的vin码识别方法的流程示意图。具体的,如图2所示,该基于图像处理的vin码识别方法可以包括以下步骤:Please refer to FIG. 2, which is a schematic flowchart of another vin code recognition method based on image processing provided by an embodiment of the present application. Specifically, as shown in FIG. 2, the vin code recognition method based on image processing may include the following steps:
201、获取拍摄装置拍摄范围内的目标车辆的车辆环境信息。201. Acquire vehicle environment information of a target vehicle within a shooting range of the shooting device.
其中,该车辆环境信息可包括该目标车辆的车型、该目标车辆所处的环境光强度、该目标车辆与该拍摄装置之间的距离和系统时间等信息中的任一项或多项。该步骤201的描述可参见上述图1所示实施例中步骤101的相关描述,此处不赘述。The vehicle environment information may include any one or more of information such as the model of the target vehicle, the ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device, and the system time. For the description of this step 201, reference may be made to the relevant description of step 101 in the embodiment shown in FIG. 1 above, which is not repeated here.
202、根据预设的车辆环境信息和拍摄参数的对应关系,确定出与该目标车辆的车辆环境信息对应的拍摄参数,并将确定出的该拍摄参数确定为用于拍摄该目标车辆的目标拍摄参数。202. Determine the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determine the determined shooting parameters as the target shooting for shooting the target vehicle parameter.
可选的,在一种可能的实施方式中,该目标车辆的车辆环境信息可包括该目标车辆的车型。图像处理设备在确定该目标拍摄参数,可以是根据预设的车辆车型和拍摄参数的对应关系,从数据库中查找出与该目标车辆的车型相同的车辆车型所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该目标车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型以及每种车辆车型对应的拍摄参数。该每种车型对应的拍摄参数可以是选择出的该车型下拍摄效果较好比如拍摄质量大于预设的质量阈值和/或vin码区域占图像比例大于预设的比例阈值等等的vin码图像样本的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the target vehicle may include the vehicle model of the target vehicle. When the image processing device determines the target shooting parameter, it may find the shooting parameter corresponding to the same vehicle model as the target vehicle model from the database according to the preset correspondence between the vehicle model and the shooting parameter, and find out The shooting parameter of is determined as the target shooting parameter for shooting the target vehicle. Among them, a variety of vehicle models and shooting parameters corresponding to each vehicle model can be pre-stored in the database. The shooting parameters corresponding to each vehicle model may be selected vin code images with better shooting effects under the vehicle model, such as shooting quality greater than the preset quality threshold and/or vin code area accounting for the image ratio greater than the preset ratio threshold, etc. Sample shooting parameters.
可选的,在一种可能的实施方式中,该目标车辆的车辆环境信息可包括该目标车辆的车型和该目标车辆所处的环境光强度。图像处理设备在确定该目标拍摄参数时,可以是根据预设的多个环境光强度区间,确定该目标车辆所处的环境光强度在该多个环境光强度区间中所在的目标环境光强度区间;根据预设的车辆车型、环境光强度区间和拍摄参数三者之间的对应关系,从数据库中查找出与该目标车辆的车型和该目标环境光强度区间所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该目标车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型、该多个环境光强度区间以及与每种车辆车型和每个环境光强度区间对应的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the target vehicle may include the vehicle model of the target vehicle and the ambient light intensity where the target vehicle is located. When determining the target shooting parameter, the image processing device may determine the target ambient light intensity interval where the target vehicle is located in the multiple ambient light intensity intervals according to the preset multiple ambient light intensity intervals ; According to the correspondence between the preset vehicle model, the ambient light intensity interval and the shooting parameters, find the shooting parameters corresponding to the target vehicle model and the target ambient light intensity interval from the database, and The found shooting parameters are determined as target shooting parameters for shooting the target vehicle. Among them, the database may pre-store multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
可选的,在一种可能的实施方式中,该目标车辆的车辆环境信息包括该目标车辆的车型和该目标车辆与该拍摄装置之间的距离。图像处理设备在确定该目标拍摄参数,可以是根据预设的多个距离区间,确定该目标车辆与该拍摄装置之间的距离在该多个距离区间中所在的目标距离区间;根据预设的车辆车型、距离区间和拍摄参数三者之间的对应关系,从数据库中查找出与该目标车辆的车型和该目标距离区间所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该目标车辆的目标拍摄参数。其中,该数据库中可预先存储 有多种车辆车型、该多个距离区间以及与每种车辆车型和每个距离区间对应的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the target vehicle includes the model of the target vehicle and the distance between the target vehicle and the shooting device. When the image processing device determines the target shooting parameter, it may determine the target distance interval where the distance between the target vehicle and the shooting device is in the multiple distance intervals according to preset multiple distance intervals; according to the preset Correspondence between the vehicle model, distance interval and shooting parameters, the shooting parameters corresponding to the vehicle model of the target vehicle and the target distance interval are found from the database, and the found shooting parameters are determined as the For shooting the target shooting parameters of the target vehicle. Among them, the database may pre-store a variety of vehicle models, the plurality of distance intervals, and shooting parameters corresponding to each vehicle model and each distance interval.
可选的,在一种可能的实施方式中,该目标车辆的车辆环境信息包括该目标车辆的车型和系统时间。图像处理设备在确定该目标拍摄参数,可以是根据预设的多个时间段,确定该系统时间在该多个时间段中所属的目标时间段;根据预设的车辆车型、时间段和拍摄参数三者之间的对应关系,从数据库中查找出与该目标车辆的车型和该目标时间段所对应的拍摄参数,并将查找出的该拍摄参数确定为用于拍摄该目标车辆的目标拍摄参数。其中,该数据库中可预先存储有多种车辆车型、该多个时间段以及与每种车辆车型和每个时间段对应的拍摄参数。Optionally, in a possible implementation manner, the vehicle environment information of the target vehicle includes the vehicle model and system time of the target vehicle. When the image processing device determines the target shooting parameter, the target time period to which the system time belongs in the multiple time periods may be determined according to preset multiple time periods; according to the preset vehicle model, time period and shooting parameters Correspondence between the three, the shooting parameters corresponding to the vehicle model of the target vehicle and the target time period are found from the database, and the found shooting parameters are determined as the target shooting for shooting the target vehicle parameter. Among them, a plurality of vehicle models, the plurality of time periods, and shooting parameters corresponding to each vehicle model and each time period may be pre-stored in the database.
可选的,在一种可能的实施方式中,该目标车辆的车辆环境信息包括系统时间,图像处理设备在确定该目标拍摄参数,可根据预设的时间段和拍摄参数的对应关系,确定出该系统时间对应的拍摄参数作为该目标拍摄参数;或者,该目标车辆的车辆环境信息包括该目标车辆所处的环境光强度,图像处理设备在确定该目标拍摄参数,可根据预设的环境光强度区间和拍摄参数的对应关系,确定出该环境光强度对应的拍摄参数作为该目标拍摄参数;该目标车辆的车辆环境信息包括该目标车辆与该拍摄装置之间的距离,图像处理设备在确定该目标拍摄参数时,可根据预设的距离区间和拍摄参数的对应关系,确定出该距离对应的拍摄参数作为该目标拍摄参数;或者,该车辆环境信息还可包括该目标车辆的车型、该目标车辆所处的环境光强度、该目标车辆与该拍摄装置之间的距离和系统时间,或者包括该目标车辆所处的环境光强度和该目标车辆与该拍摄装置之间的距离,或者包括该目标车辆所处的环境光强度和系统时间,以基于对应的车辆环境信息和拍摄参数的对应关系确定目标拍摄参数,等等,此处不一一列举。Optionally, in a possible implementation manner, the vehicle environment information of the target vehicle includes the system time, and the image processing device may determine the target shooting parameter according to the preset time period and the corresponding relationship between the shooting parameters to determine The shooting parameter corresponding to the system time is used as the target shooting parameter; or, the vehicle environment information of the target vehicle includes the ambient light intensity of the target vehicle. The image processing device may determine the target shooting parameter according to the preset ambient light The corresponding relationship between the intensity interval and the shooting parameters determines the shooting parameters corresponding to the ambient light intensity as the target shooting parameters; the vehicle environment information of the target vehicle includes the distance between the target vehicle and the shooting device, and the image processing device determines For the target shooting parameter, the shooting parameter corresponding to the distance may be determined as the target shooting parameter according to the correspondence between the preset distance interval and the shooting parameter; or, the vehicle environment information may further include the target vehicle model, the The ambient light intensity of the target vehicle, the distance between the target vehicle and the shooting device and the system time, or include the ambient light intensity of the target vehicle and the distance between the target vehicle and the shooting device, or include The ambient light intensity and system time of the target vehicle are used to determine the target shooting parameters based on the corresponding relationship between the corresponding vehicle environment information and the shooting parameters, etc., which are not listed here one by one.
例如,需要对某一车辆的信息如vin码进行识别时,可以调用拍摄装置对vin码区域进行拍摄,得到包括vin码的拍摄图像,简称vin码图像。或者,在一种可选的实施方式中,该拍摄装置可装载于一固定位置处,且该拍摄装置可旋转,即该拍摄装置的拍摄角度可调节。由此可通过对该拍摄装置采集的历史数据中的vin码图像进行分析,得到不同车型的vin码图像数据,并从中选择出拍摄效果较好的(比如涵盖全部vin码区域,且干扰较少的)vin码图像,获取该vin码图像的拍摄参数,预置得到各车型和拍摄参数的对应关系,以便于拍摄装置在识别到车辆的车型之后,能够根据车辆的车型快速调用拍摄参数,包括拍摄装置拍摄角度(控制拍摄装置以该拍摄角度拍摄)、焦距、光圈、ISO、EV值等等。For example, when it is necessary to identify the information of a certain vehicle such as the vin code, the shooting device can be called to shoot the vin code area to obtain a captured image including the vin code, referred to as the vin code image for short. Or, in an optional embodiment, the shooting device can be loaded at a fixed position, and the shooting device can be rotated, that is, the shooting angle of the shooting device can be adjusted. Therefore, the vin code image in the historical data collected by the shooting device can be analyzed to obtain vin code image data of different car models, and the better shooting effect can be selected from them (such as covering all the vin code area with less interference) ) Vin code image, obtain the shooting parameters of the vin code image, preset to obtain the corresponding relationship between each vehicle model and the shooting parameters, so that the shooting device can quickly call the shooting parameters according to the vehicle model after identifying the vehicle model, including Camera shooting angle (control camera shooting at this shooting angle), focal length, aperture, ISO, EV value, etc.
又如,还可结合时间和/或环境光强度,获取历史数据中拍摄效果较好的vin码图像的拍摄时间和拍摄参数,进而可通过获取当前车辆的车型和当前时间(和/或环境光强度)来快速调用更加匹配的拍摄参数,以提升拍摄可靠性。因不同时间或者不同环境光强度均会对拍摄效果产生影响,比如白天和晚上采用相同的拍摄参数拍摄得到的图像效果完全不同。由此,可预先设置得到不同时间段和车辆车型,与拍摄装置的拍摄参数之间的对应关系;或者,预先设置得到环境光强度和车辆车型,与拍摄装置的拍摄参数之间的对应关系,或者,预先设置得到不同时间段、环境光强度和车辆车型,与拍摄装置的拍摄参数之间的对应关系,等等。举例来说,可通过对该拍摄装置采集的历史数据中的vin码图像进行分析(每个vin码图像关联记录了其拍摄图像时的拍摄时间),得到不同时间段的vin码图像数据,并根据每个时间段内相同车型的vin码图像数据选择出拍摄效果较好的vin码图像,获 取该vin码图像的拍摄参数,从而确定出不同时间段和车辆车型,与拍摄装置的拍摄参数之间的对应关系;以便于拍摄装置在识别到当前时间处于的时间段以及车辆的车型之后,能够根据识别出的时间段和车型快速调用对应的拍摄参数进行拍摄。又如,可通过对该拍摄装置采集的历史数据中的vin码图像进行分析(每个vin码图像关联记录了其拍摄图像时的环境光强度),得到不同环境光强度下的vin码图像数据,并根据每个环境光强度区间下相同车型的vin码图像数据选择出拍摄效果较好的vin码图像,获取该vin码图像的拍摄参数,从而确定出不同环境光强度区间和车辆车型,与拍摄装置的拍摄参数之间的对应关系;以便于拍摄装置在识别到当前环境光强度处于的环境光强度区间以及车辆的车型之后,能够根据识别出的环境光强度区间和车型快速调用对应的拍摄参数进行拍摄。For another example, the time and/or ambient light intensity can also be combined to obtain the shooting time and shooting parameters of the vin code image with better shooting results in the historical data, and then the current vehicle model and current time (and/or ambient light) can be obtained by Intensity) to quickly recall more matching shooting parameters to improve shooting reliability. Different times or different ambient light intensities will affect the shooting effect, for example, the image effects obtained by shooting with the same shooting parameters during the day and night are completely different. Thereby, the correspondence between different time periods and vehicle models and the shooting parameters of the shooting device can be preset; or, the correspondence between the ambient light intensity and the vehicle model and the shooting parameters of the shooting device can be preset. Or, pre-set correspondence between different time periods, ambient light intensity, vehicle model, and shooting parameters of the shooting device, and so on. For example, by analyzing the vin-code images in the historical data collected by the shooting device (each vin-code image is associated with the recording time when the image was captured), vin-code image data of different time periods can be obtained, and According to the vin code image data of the same vehicle type in each time period, select a vin code image with better shooting effect, obtain the shooting parameters of the vin code image, so as to determine different time periods and vehicle models, and the shooting parameters of the shooting device Corresponding relationship between; so that the camera can quickly call the corresponding shooting parameters according to the identified time zone and vehicle model after the current time zone and the vehicle model are identified. For another example, the vin code image data in different ambient light intensities can be obtained by analyzing the vin code images in the historical data collected by the photographing device (each vin code image correlates and records the ambient light intensity at the time of capturing the image) , And according to the vin code image data of the same car model in each ambient light intensity section, select a vin code image with better shooting effect, obtain the shooting parameters of the vin code image, so as to determine different ambient light intensity sections and vehicle models, and Correspondence between the shooting parameters of the shooting device; so that the shooting device can quickly call the corresponding shooting according to the identified ambient light intensity section and vehicle model after identifying the ambient light intensity section where the current ambient light intensity is located and the vehicle model Parameters for shooting.
203、使用该拍摄装置并按照该目标拍摄参数采集该目标车辆的vin码图像,该vin码图像包括该目标车辆的vin码区域。203. Use the shooting device and collect the vin code image of the target vehicle according to the target shooting parameter, where the vin code image includes the vin code area of the target vehicle.
204、对该vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像。204. Perform a top hat tophat transformation on the vin code image to obtain a tophat transformed vin code image.
其中,该顶帽(tophat)变换可用于检测暗处明亮的细节,提取图像中灰度较高的区域。通过对拍摄的vin码图像进行tophat变换,能够减少该vin码图像区域受到的干扰。由于tophat在图像分割中对检测暗处明亮的细节效果较好,特别是有均匀宽度或大小的目标,由此,可通过对拍摄的vin码图像进行tophat变换以进一步区分出vin码区域。可选的,在vin码图像中存在一些车辆车体反射干扰,为了减少这些干扰,可以将原拍摄得到的vin码图像即原始图像转换为灰度图像,得到转换后的灰度图像之后,再对灰度图像进行tophat变换,得到的tophat变换结果。原vin码图像经过tophat滤波后,就具有简单、均匀的背景和前景,以便于更好地区分出vin码区域。Among them, the tophat transformation can be used to detect bright details in dark places and extract areas with higher gray levels in the image. By tophat transforming the captured vin code image, the interference received by the vin code image area can be reduced. Since tophat is better for detecting bright details in dark places in image segmentation, especially for objects with uniform width or size, tophat transformation can be performed on the captured vin code image to further distinguish the vin code area. Optionally, there are some reflection disturbances of the vehicle body in the vin code image. In order to reduce these interferences, the vin code image obtained by the original shooting, that is, the original image, can be converted into a grayscale image. After the converted grayscale image is obtained, then The tophat transform is performed on the grayscale image to obtain the tophat transform result. After the original vin code image is filtered by tophat, it has a simple and uniform background and foreground, so as to better distinguish the vin code area.
例如,灰度级图像f的tophat变换定义为f减去其开运算的结果,即That(f)=f-(f°b),其中,b为均值滤波模板,°为开运算。For example, the tophat transformation of the grayscale image f is defined as the result of f minus its opening operation, that is, That(f)=f-(f°b), where b is the mean filter template and ° is the opening operation.
可选的,在一些实施例中,如果拍摄条件较好,比如vin码图像的亮度处于预设亮度区间范围内,则可以不进行tophat变换。从而减少了设备开销。由此,可通过检测该vin码图像的亮度是否处于预设的亮度区间范围内;如果该vin码图像的亮度不处于该亮度区间范围内,对该vin码图像进行tophat变换,以得到tophat变换后的vin码图像。进一步可选的,如果该vin码图像的亮度处于该亮度区间范围内,则可不进行tophat变换,而直接对该vin码图像进行边缘检测,此处不赘述。Optionally, in some embodiments, if the shooting conditions are better, for example, the brightness of the vin code image is within the preset brightness interval, the tophat transformation may not be performed. Thereby reducing equipment overhead. Therefore, by detecting whether the brightness of the vin code image is within the preset brightness interval range; if the brightness of the vin code image is not within the brightness interval range, the tophat transformation is performed on the vin code image to obtain the tophat transformation After the vin code image. Further optionally, if the brightness of the vin code image is within the range of the brightness interval, edge detection may be performed directly on the vin code image without tophat transformation, which will not be described here.
205、对该tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的边缘图像。205. Perform edge detection on the tophat-transformed vin code image to obtain an edge image after edge detection.
如果无需进行tophat变换,则可直接对采集的vin码图像进行边缘检测,此处不赘述。If there is no need to perform tophat transformation, you can directly perform edge detection on the collected vin code image, which will not be repeated here.
206、对该边缘图像进行形态学闭运算,以得到闭运算图像。206. Perform a morphological close operation on the edge image to obtain a closed operation image.
207、对该闭运算图像进行形态学开运算,以得到开运算图像。207. Perform morphological opening operation on the closed operation image to obtain an open operation image.
208、确定该开运算图像中vin码区域的最小外接矩形,并将该最小外接矩形确定的区域确定为该目标车辆的vin码区域。208. Determine the minimum circumscribed rectangle of the vin code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle.
也就是说,在提取图像中的vin码区域时,本申请可采用tophat变换,边缘检测,形态学闭运算,形态学开运算,计算最小外接矩形的一套简单快速的算法来确定vin码区域,进行识别出vin码。That is to say, when extracting the vin code region in the image, this application can use tophat transform, edge detection, morphological closed operation, morphological open operation, a set of simple and fast algorithms to calculate the minimum circumscribed rectangle to determine the vin code region To identify the vin code.
209、对该目标车辆的vin码区域进行识别,以识别出该目标车辆的vin码。209. Identify the vin code area of the target vehicle to identify the vin code of the target vehicle.
可选的,该步骤203、205-209的描述请参照图1所示实施例中步骤102-107的相关描述,此处不赘述。Optionally, for the description of the steps 203 and 205-209, please refer to the relevant description of the steps 102-107 in the embodiment shown in FIG. 1, which is not repeated here.
在本实施例中,图像处理设备能够通过获取车辆的车辆环境信息,根据预设的车辆环境信息和拍摄参数的对应关系确定出该车辆的拍摄参数,并按照该拍摄参数采集该车辆的vin码图像,进而能够通过对该vin码图像进行tophat变换,进行tophat变换后进行边缘检测得到边缘图像,对该边缘图像进行形态学闭运算和开运算,再根据图像中的最小外接矩形提取得到车辆的vin码区域,以通过对该vin码区域进行识别得到车辆的vin码,从而提升了vin码图像的拍摄效果,提升了获取的vin码图像的可靠性,且提升了对车辆图像的vin码的识别效率。In this embodiment, the image processing device can determine the shooting parameters of the vehicle according to the correspondence between the preset vehicle environment information and the shooting parameters by acquiring the vehicle environment information of the vehicle, and collect the vin code of the vehicle according to the shooting parameters The image can be obtained by performing a tophat transformation on the vin code image, performing edge detection after the tophat transformation to obtain an edge image, and performing a morphological close operation and an open operation on the edge image, and then extracting the vehicle's vin code area, to obtain the vin code of the vehicle by identifying the vin code area, thereby improving the shooting effect of the vin code image, the reliability of the obtained vin code image, and the vin code of the vehicle image Recognize efficiency.
上述方法实施例都是对本申请的基于图像处理的vin码识别方法的举例说明,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。The above method embodiments are all examples of the vin code recognition method based on image processing of the present application, and the description of each embodiment has its own focus. For a part that is not detailed in an embodiment, you can refer to the other embodiments. description.
请参见图3,图3是本申请实施例提供的一种图像处理设备的结构示意图。本申请实施例的图像处理设备包括用于执行上述基于图像处理的vin码识别方法的单元。具体的,本实施例的图像处理设备300可包括:获取单元301和处理单元302。其中,Please refer to FIG. 3, which is a schematic structural diagram of an image processing device according to an embodiment of the present application. The image processing apparatus of the embodiment of the present application includes a unit for performing the above-described image processing-based vin code recognition method. Specifically, the image processing apparatus 300 of this embodiment may include: an acquisition unit 301 and a processing unit 302. among them,
获取单元301,用于获取拍摄装置拍摄范围内的目标车辆的车辆环境信息,所述车辆环境信息包括所述目标车辆的车型、所述目标车辆所处的环境光强度、所述目标车辆与所述拍摄装置之间的距离和系统时间中的任一项或多项;The obtaining unit 301 is configured to obtain the vehicle environment information of the target vehicle within the shooting range of the shooting device, the vehicle environment information including the vehicle model of the target vehicle, the ambient light intensity of the target vehicle, the target vehicle and the location Any one or more of the distance between the shooting devices and the system time;
处理单元302,用于根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数,The processing unit 302 is configured to determine target shooting parameters for shooting the target vehicle according to the vehicle environment information,
获取单元301,还用于使用所述拍摄装置并按照所述目标拍摄参数采集所述目标车辆的vin码图像,所述vin码图像包括所述目标车辆的vin码区域;The obtaining unit 301 is further configured to collect the vin code image of the target vehicle according to the target shooting parameter using the shooting device, and the vin code image includes the vin code area of the target vehicle;
处理单元302,还用于对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像;对所述边缘图像进行形态学闭运算,以得到闭运算图像;对所述闭运算图像进行形态学开运算,以得到开运算图像;确定所述开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述目标车辆的vin码区域;对所述目标车辆的vin码区域进行识别,以识别出所述目标车辆的vin码。The processing unit 302 is further configured to perform edge detection on the vin code image to obtain an edge image after edge detection; perform a morphological closed operation on the edge image to obtain a closed operation image; and perform a closed operation image on Morphological open operation to obtain an open operation image; determine the minimum circumscribed rectangle of the vin code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle; The vin code area of the target vehicle is identified to identify the vin code of the target vehicle.
可选的,处理单元302,可具体用于根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数。Optionally, the processing unit 302 may be specifically configured to determine the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence relationship between the vehicle environment information and the shooting parameters, and store the determined shooting The parameter is determined as a target shooting parameter for shooting the target vehicle.
进一步可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型;Further optionally, the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle;
处理单元302,可具体用于根据预设的车辆车型和拍摄参数的对应关系,从数据库中查找出与所述目标车辆的车型相同的车辆车型所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit 302 may be specifically configured to search for the shooting parameters corresponding to the same vehicle model as the target vehicle model from the database according to the preset correspondence between the vehicle model and the shooting parameters, and store the found The shooting parameters are determined as target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型以及每种车辆车型对应的拍摄参数。Wherein, the database stores multiple vehicle models and shooting parameters corresponding to each vehicle model.
进一步可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆所处的环境光强度;Further optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the ambient light intensity where the target vehicle is located;
处理单元302,可具体用于根据预设的多个环境光强度区间,确定所述目标车辆所处 的环境光强度在所述多个环境光强度区间中所在的目标环境光强度区间;根据预设的车辆车型、环境光强度区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标环境光强度区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit 302 may be specifically configured to determine the target ambient light intensity interval where the ambient light intensity of the target vehicle is among the multiple ambient light intensity intervals according to preset multiple ambient light intensity intervals; Set the correspondence between the vehicle model, the ambient light intensity interval and the shooting parameters, find the shooting parameters corresponding to the target vehicle model and the target ambient light intensity interval from the database, and find The shooting parameters determined are the target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型、所述多个环境光强度区间以及与每种车辆车型和每个环境光强度区间对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
进一步可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆与所述拍摄装置之间的距离;Further optionally, the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle and the distance between the target vehicle and the shooting device;
处理单元302,可具体用于根据预设的多个距离区间,确定所述目标车辆与所述拍摄装置之间的距离在所述多个距离区间中所在的目标距离区间;根据预设的车辆车型、距离区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标距离区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit 302 may be specifically configured to determine a target distance interval in which the distance between the target vehicle and the shooting device is among the multiple distance intervals according to preset multiple distance intervals; according to the preset vehicle Correspondence between the vehicle model, the distance interval and the shooting parameters, the shooting parameters corresponding to the vehicle model of the target vehicle and the target distance interval are found from the database, and the found shooting parameters are determined Target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型、所述多个距离区间以及与每种车辆车型和每个距离区间对应的拍摄参数。Among them, the database stores a plurality of vehicle models, the plurality of distance sections, and shooting parameters corresponding to each vehicle model and each distance section.
进一步可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型和系统时间;Further optionally, the vehicle environment information of the target vehicle includes the vehicle model and system time of the target vehicle;
处理单元302,可具体用于根据预设的多个时间段,确定所述系统时间在所述多个时间段中所属的目标时间段;根据预设的车辆车型、时间段和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标时间段所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit 302 may be specifically configured to determine the target time period to which the system time belongs in the multiple time periods according to preset multiple time periods; according to the preset vehicle model, time period and shooting parameters three The corresponding relationship between the persons, the shooting parameters corresponding to the vehicle model of the target vehicle and the target time period are found from the database, and the found shooting parameters are determined to be used for shooting the target vehicle Target shooting parameters;
其中,所述数据库中存储有多种车辆车型、所述多个时间段以及与每种车辆车型和每个时间段对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple time periods, and shooting parameters corresponding to each vehicle model and each time period.
可选的,处理单元302,还可用于在所述对所述vin码图像进行边缘检测之前,检测所述vin码图像的亮度是否处于预设的亮度区间范围内;如果所述vin码图像的亮度不处于所述亮度区间范围内,对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像;Optionally, the processing unit 302 may be further configured to detect whether the brightness of the vin code image is within a preset brightness interval before performing edge detection on the vin code image; if the The brightness is not within the range of the brightness interval, and the top hat transformation is performed on the vin code image to obtain a tophat transformed vin code image;
处理单元302,可具体用于对所述tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的边缘图像。The processing unit 302 may be specifically configured to perform edge detection on the tophat-transformed vin code image to obtain an edge image after edge detection.
具体的,该图像处理设备可通过上述单元实现上述图1至图2所示实施例中的基于图像处理的vin码识别方法中的部分或全部步骤。应理解,本申请实施例是对应方法实施例的装置实施例,对方法实施例的描述,也适用于本申请实施例。Specifically, the image processing device may implement part or all of the steps in the vin code recognition method based on image processing in the embodiments shown in FIG. 1 to FIG. 2 through the above units. It should be understood that the embodiments of the present application are device embodiments corresponding to the method embodiments, and the description of the method embodiments is also applicable to the embodiments of the present application.
请参见图4,图4是本申请实施例提供的另一种图像处理设备的结构示意图。该图像处理设备用于执行上述的方法。如图4所示,本实施例中的图像处理设备400可以包括:一个或多个处理器401和存储器402。该图像处理设备还可包括拍摄装置或者与拍摄装置连接。可选的,该图像处理设备还可包括一个或多个用户接口403,和/或,一个或多个通信接口404。上述处理器401、用户接口403、通信接口404和存储器402可通过总线405连接,或者可以通过其他方式连接,图4中以总线方式进行示例说明。其中,存储器402用于存储计算机程序,所述计算机程序包括程序指令,处理器401用于执行存储器402存 储的程序指令。Please refer to FIG. 4, which is a schematic structural diagram of another image processing device according to an embodiment of the present application. The image processing device is used to perform the method described above. As shown in FIG. 4, the image processing device 400 in this embodiment may include: one or more processors 401 and a memory 402. The image processing apparatus may further include or be connected to a photographing device. Optionally, the image processing device may further include one or more user interfaces 403, and/or one or more communication interfaces 404. The processor 401, the user interface 403, the communication interface 404, and the memory 402 may be connected through the bus 405, or may be connected in other ways. The bus mode is used as an example in FIG. Wherein, the memory 402 is used to store a computer program, and the computer program includes program instructions, and the processor 401 is used to execute the program instructions stored in the memory 402.
其中,处理器401可用于调用所述程序指令执行以下步骤:获取拍摄装置拍摄范围内的目标车辆的车辆环境信息,所述车辆环境信息包括所述目标车辆的车型、所述目标车辆所处的环境光强度、所述目标车辆与所述拍摄装置之间的距离和系统时间中的任一项或多项;根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数,使用所述拍摄装置并按照所述目标拍摄参数采集所述目标车辆的vin码图像,所述vin码图像包括所述目标车辆的vin码区域;对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像;对所述边缘图像进行形态学闭运算,以得到闭运算图像;对所述闭运算图像进行形态学开运算,以得到开运算图像;确定所述开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述目标车辆的vin码区域;对所述目标车辆的vin码区域进行识别,以识别出所述目标车辆的vin码。The processor 401 can be used to call the program instructions to perform the following steps: obtain vehicle environment information of the target vehicle within the shooting range of the shooting device, the vehicle environment information including the model of the target vehicle and the location of the target vehicle Any one or more of the ambient light intensity, the distance between the target vehicle and the shooting device, and the system time; determine the target shooting parameters for shooting the target vehicle according to the vehicle environmental information, and use the The shooting device collects the vin code image of the target vehicle according to the target shooting parameters, the vin code image includes the vin code area of the target vehicle; performs edge detection on the vin code image to obtain the edge detection Edge image; perform a morphological close operation on the edge image to obtain a closed operation image; perform a morphological open operation on the closed operation image to obtain an open operation image; determine the vin code area in the open operation image A minimum circumscribed rectangle, and the area determined by the minimum circumscribed rectangle is determined as the vin code area of the target vehicle; identifying the vin code area of the target vehicle to identify the vin code of the target vehicle.
可选的,处理器401在执行所述根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数时,可具体执行以下步骤:根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数。Optionally, when the processor 401 executes the determination of the target shooting parameters for shooting the target vehicle according to the vehicle environment information, it may specifically perform the following steps: according to the correspondence between the preset vehicle environment information and the shooting parameters , Determine the shooting parameters corresponding to the vehicle environment information of the target vehicle, and determine the determined shooting parameters as the target shooting parameters for shooting the target vehicle.
可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型;Optionally, the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle;
处理器401在执行所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数时,可具体执行以下步骤:根据预设的车辆车型和拍摄参数的对应关系,从数据库中查找出与所述目标车辆的车型相同的车辆车型所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processor 401 executes the correspondence between the preset vehicle environment information and the shooting parameters to determine the shooting parameters corresponding to the vehicle environment information of the target vehicle, and determines the determined shooting parameters to be used for When shooting the target shooting parameters of the target vehicle, the following steps may be specifically executed: according to the preset correspondence between the vehicle model and the shooting parameters, a shooting corresponding to the same vehicle model as the target vehicle model is found from the database Parameters, and the found shooting parameters are determined as target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型以及每种车辆车型对应的拍摄参数。Wherein, the database stores multiple vehicle models and shooting parameters corresponding to each vehicle model.
可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆所处的环境光强度;Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the ambient light intensity where the target vehicle is located;
处理器401在执行所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数时,可具体执行以下步骤:根据预设的多个环境光强度区间,确定所述目标车辆所处的环境光强度在所述多个环境光强度区间中所在的目标环境光强度区间;根据预设的车辆车型、环境光强度区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标环境光强度区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processor 401 executes the correspondence between the preset vehicle environment information and the shooting parameters to determine the shooting parameters corresponding to the vehicle environment information of the target vehicle, and determines the determined shooting parameters to be used for When photographing the target shooting parameters of the target vehicle, the following steps may be specifically performed: according to a plurality of preset ambient light intensity intervals, determine where the ambient light intensity of the target vehicle is located in the multiple ambient light intensity intervals The target ambient light intensity interval; according to the correspondence between the preset vehicle model, the ambient light intensity interval and the shooting parameters, find out the model of the target vehicle and the target ambient light intensity interval from the database Corresponding shooting parameters, and determining the found shooting parameters as target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型、所述多个环境光强度区间以及与每种车辆车型和每个环境光强度区间对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆与所述拍摄装置之间的距离;Optionally, the vehicle environment information of the target vehicle includes the model of the target vehicle and the distance between the target vehicle and the shooting device;
处理器401在执行所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数时,可具体执行以下步骤:根据预设的多个距离区间,确定 所述目标车辆与所述拍摄装置之间的距离在所述多个距离区间中所在的目标距离区间;根据预设的车辆车型、距离区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标距离区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processor 401 executes the correspondence between the preset vehicle environment information and the shooting parameters to determine the shooting parameters corresponding to the vehicle environment information of the target vehicle, and determines the determined shooting parameters to be used for When photographing the target shooting parameters of the target vehicle, the following steps may be specifically performed: according to a preset plurality of distance intervals, determine the distance between the target vehicle and the shooting device in the plurality of distance intervals Target distance interval; according to the correspondence between the preset vehicle model, distance interval and shooting parameters, find the shooting parameters corresponding to the target vehicle model and the target distance interval from the database, and Determining the found shooting parameters as target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型、所述多个距离区间以及与每种车辆车型和每个距离区间对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple distance intervals, and shooting parameters corresponding to each vehicle model and each distance interval.
可选的,所述目标车辆的车辆环境信息包括所述目标车辆的车型和系统时间;Optionally, the vehicle environment information of the target vehicle includes the vehicle model and system time of the target vehicle;
处理器401在执行所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数时,可具体执行以下步骤:根据预设的多个时间段,确定所述系统时间在所述多个时间段中所属的目标时间段;根据预设的车辆车型、时间段和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标时间段所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processor 401 executes the correspondence between the preset vehicle environment information and the shooting parameters to determine the shooting parameters corresponding to the vehicle environment information of the target vehicle, and determines the determined shooting parameters to be used for When shooting the target shooting parameters of the target vehicle, the following steps may be specifically executed: according to a preset plurality of time periods, determine a target time period to which the system time belongs in the plurality of time periods; according to a preset vehicle Correspondence between the vehicle model, the time period and the shooting parameters, the shooting parameters corresponding to the vehicle model of the target vehicle and the target time period are found from the database, and the found shooting parameters are determined Target shooting parameters for shooting the target vehicle;
其中,所述数据库中存储有多种车辆车型、所述多个时间段以及与每种车辆车型和每个时间段对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple time periods, and shooting parameters corresponding to each vehicle model and each time period.
可选的,处理器401在执行所述对所述vin码图像进行边缘检测之前,还可执行以下步骤:检测所述vin码图像的亮度是否处于预设的亮度区间范围内;如果所述vin码图像的亮度不处于所述亮度区间范围内,对所述vin码图像进行顶帽tophat变换,以得到tophat变换后的vin码图像;Optionally, before performing the edge detection on the vin code image, the processor 401 may also perform the following steps: detect whether the brightness of the vin code image is within a preset brightness interval; if the vin The brightness of the code image is not within the range of the brightness interval, and the top hat transformation is performed on the vin code image to obtain a tophat transformed vin code image;
所述对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像时,可具体执行以下步骤:对所述tophat变换后的vin码图像进行边缘检测,以得到边缘检测后的边缘图像。When performing edge detection on the vin code image to obtain an edge image after edge detection, the following steps may be specifically performed: performing edge detection on the vin code image after the tophat transformation to obtain an edge image after edge detection .
其中,所述处理器401可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Wherein, the processor 401 may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), application specific integrated circuits (Application Specific Integrated) Circuit (ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
用户接口403可包括输入设备和输出设备,输入设备可以包括触控板、麦克风等,输出设备可以包括显示器(LCD等)、扬声器等。The user interface 403 may include an input device and an output device. The input device may include a touch panel, a microphone, and the like, and the output device may include a display (LCD, etc.), a speaker, and the like.
通信接口404可包括接收器和发射器,用于与其他设备进行通信。The communication interface 404 may include a receiver and a transmitter for communicating with other devices.
存储器402可以包括只读存储器和随机存取存储器,并向处理器401提供指令和数据。存储器402的一部分还可以包括非易失性随机存取存储器。例如,存储器402还可以存储上述的函数指针和函数的对应关系等等。The memory 402 may include a read-only memory and a random access memory, and provide instructions and data to the processor 401. A portion of the memory 402 may also include non-volatile random access memory. For example, the memory 402 may also store the correspondence between the function pointers and functions described above, and so on.
具体实现中,本申请实施例中所描述的处理器401等可执行上述图1至图2所示的方法实施例中所描述的实现方式,也可执行本申请实施例图3所描述的各单元的实现方式,此处不赘述。In a specific implementation, the processor 401 and the like described in the embodiments of the present application can execute the implementation described in the method embodiments shown in FIG. 1 to FIG. 2 above, and can also execute each of the methods described in FIG. 3 of the embodiment of the present application. The implementation of the unit is not repeated here.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计 算机程序,所述计算机程序被处理器执行时可实现图1至图2所对应实施例中描述的基于图像处理的vin码识别方法中的部分或全部步骤,也可实现本申请图3或图4所示实施例的图像处理设备的功能,此处不赘述。An embodiment of the present application also provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the computer program can be implemented as described in the embodiments corresponding to FIG. 1 to FIG. 2 Part or all of the steps in the vin code recognition method based on image processing may also realize the functions of the image processing device of the embodiment shown in FIG. 3 or FIG. 4 of the present application, and details are not described here.
本申请实施例还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述方法中的部分或全部步骤。An embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, causes the computer to perform some or all of the steps in the above method.
所述计算机可读存储介质可以是前述任一实施例所述的图像处理设备的内部存储单元,例如图像处理设备的硬盘或内存。所述计算机可读存储介质也可以是所述图像处理设备的外部存储设备,例如所述图像处理设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The computer-readable storage medium may be an internal storage unit of the image processing device described in any of the foregoing embodiments, such as a hard disk or a memory of the image processing device. The computer-readable storage medium may also be an external storage device of the image processing device, such as a plug-in hard disk equipped on the image processing device, a smart memory card (Smart, Media, Card, SMC), and secure digital (Secure Digital) , SD) card, flash card (Flash Card), etc.
在本申请中,术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。In this application, the term "and/or" is merely an association relationship that describes an associated object, indicating that there may be three relationships, for example, A and/or B, which may mean: A exists alone, and A and B exist simultaneously There are three cases of B alone. In addition, the character “/” in this article generally indicates that the related objects before and after it are in an “or” relationship.
在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。In various embodiments of the present application, the size of the sequence numbers of the above processes does not mean that the execution order is sequential, and the execution order of each process should be determined by its function and inherent logic, and should not correspond to the implementation process of the embodiments of the present application Constitute any limitation.
以上所述,仅为本申请的部分实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。The above is only part of the implementation of this application, but the scope of protection of this application is not limited to this, any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application Modifications or replacements, these modifications or replacements should be covered within the scope of protection of this application.

Claims (20)

  1. 一种基于图像处理的vin码识别方法,其特征在于,包括:A vin code recognition method based on image processing is characterized in that it includes:
    获取拍摄装置拍摄范围内的目标车辆的车辆环境信息,所述车辆环境信息包括所述目标车辆的车型、所述目标车辆所处的环境光强度、所述目标车辆与所述拍摄装置之间的距离和系统时间中的任一项或多项;Obtain vehicle environment information of the target vehicle within the shooting range of the shooting device, where the vehicle environment information includes the model of the target vehicle, the ambient light intensity of the target vehicle, and the distance between the target vehicle and the shooting device Any one or more of distance and system time;
    根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数,使用所述拍摄装置并按照所述目标拍摄参数采集所述目标车辆的vin码图像,所述vin码图像包括所述目标车辆的vin码区域;Determining a target shooting parameter for shooting the target vehicle according to the vehicle environment information, using the shooting device and collecting a vin code image of the target vehicle according to the target shooting parameter, the vin code image including the target The vin code area of the vehicle;
    对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像;Performing edge detection on the vin code image to obtain an edge image after edge detection;
    对所述边缘图像进行形态学闭运算,以得到闭运算图像;Performing a morphological closed operation on the edge image to obtain a closed operation image;
    对所述闭运算图像进行形态学开运算,以得到开运算图像;Performing morphological opening operation on the closed operation image to obtain an open operation image;
    确定所述开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述目标车辆的vin码区域;Determine the minimum circumscribed rectangle of the vin code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle;
    对所述目标车辆的vin码区域进行识别,以识别出所述目标车辆的vin码。The vin code area of the target vehicle is identified to identify the vin code of the target vehicle.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数,包括:The method according to claim 1, wherein the determining the target shooting parameters for shooting the target vehicle according to the vehicle environment information includes:
    根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数。According to the preset correspondence between the vehicle environment information and the shooting parameters, the shooting parameters corresponding to the vehicle environment information of the target vehicle are determined, and the determined shooting parameters are determined as targets for shooting the target vehicle Shooting parameters.
  3. 根据权利要求2所述的方法,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型;The method according to claim 2, wherein the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle;
    所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数,包括:The shooting parameters corresponding to the vehicle environment information of the target vehicle are determined according to the correspondence between the preset vehicle environment information and the shooting parameters, and the determined shooting parameters are determined to be used to shoot the target vehicle Target shooting parameters, including:
    根据预设的车辆车型和拍摄参数的对应关系,从数据库中查找出与所述目标车辆的车型相同的车辆车型所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;According to the preset correspondence between the vehicle model and the shooting parameters, the shooting parameters corresponding to the same vehicle model as the target vehicle model are found from the database, and the found shooting parameters are determined to be used for shooting Describe the target shooting parameters of the target vehicle;
    其中,所述数据库中存储有多种车辆车型以及每种车辆车型对应的拍摄参数。Wherein, the database stores multiple vehicle models and shooting parameters corresponding to each vehicle model.
  4. 根据权利要求2所述的方法,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆所处的环境光强度;The method according to claim 2, wherein the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle and the ambient light intensity where the target vehicle is located;
    所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数,包括:The shooting parameters corresponding to the vehicle environment information of the target vehicle are determined according to the correspondence between the preset vehicle environment information and the shooting parameters, and the determined shooting parameters are determined to be used to shoot the target vehicle Target shooting parameters, including:
    根据预设的多个环境光强度区间,确定所述目标车辆所处的环境光强度在所述多个环境光强度区间中所在的目标环境光强度区间;Determine the target ambient light intensity interval where the ambient light intensity of the target vehicle is among the multiple ambient light intensity intervals according to preset multiple ambient light intensity intervals;
    根据预设的车辆车型、环境光强度区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标环境光强度区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;According to the correspondence between the preset vehicle model, the ambient light intensity interval and the shooting parameters, find the shooting parameters corresponding to the target vehicle model and the target ambient light intensity interval from the database, and Determining the found shooting parameters as target shooting parameters for shooting the target vehicle;
    其中,所述数据库中存储有多种车辆车型、所述多个环境光强度区间以及与每种车辆车型和每个环境光强度区间对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
  5. 根据权利要求2所述的方法,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆与所述拍摄装置之间的距离;The method according to claim 2, wherein the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle and the distance between the target vehicle and the shooting device;
    所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数,包括:The shooting parameters corresponding to the vehicle environment information of the target vehicle are determined according to the correspondence between the preset vehicle environment information and the shooting parameters, and the determined shooting parameters are determined to be used to shoot the target vehicle Target shooting parameters, including:
    根据预设的多个距离区间,确定所述目标车辆与所述拍摄装置之间的距离在所述多个距离区间中所在的目标距离区间;Determine a target distance interval where the distance between the target vehicle and the shooting device is among the multiple distance intervals according to preset multiple distance intervals;
    根据预设的车辆车型、距离区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标距离区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;According to the correspondence between the preset vehicle model, distance interval and shooting parameters, the shooting parameters corresponding to the target vehicle model and the target distance interval are searched from the database, and the searched out The shooting parameters are determined as target shooting parameters for shooting the target vehicle;
    其中,所述数据库中存储有多种车辆车型、所述多个距离区间以及与每种车辆车型和每个距离区间对应的拍摄参数。Among them, the database stores a plurality of vehicle models, the plurality of distance sections, and shooting parameters corresponding to each vehicle model and each distance section.
  6. 根据权利要求2所述的方法,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型和系统时间;The method according to claim 2, wherein the vehicle environment information of the target vehicle includes the vehicle model and system time of the target vehicle;
    所述根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数,包括:Determining the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determining the determined shooting parameters to be used for shooting the target vehicle Target shooting parameters, including:
    根据预设的多个时间段,确定所述系统时间在所述多个时间段中所属的目标时间段;Determine a target time period to which the system time belongs in the multiple time periods according to preset multiple time periods;
    根据预设的车辆车型、时间段和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标时间段所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;According to the correspondence between the preset vehicle model, time period and shooting parameters, the shooting parameters corresponding to the target vehicle model and the target time period are found from the database, and the found The shooting parameters are determined as target shooting parameters for shooting the target vehicle;
    其中,所述数据库中存储有多种车辆车型、所述多个时间段以及与每种车辆车型和每个时间段对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple time periods, and shooting parameters corresponding to each vehicle model and each time period.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,在所述对所述vin码图像进行边缘检测之前,所述方法还包括:The method according to any one of claims 1 to 6, wherein before the edge detection is performed on the vin code image, the method further comprises:
    检测所述vin码图像的亮度是否处于预设的亮度区间范围内;Detecting whether the brightness of the vin code image is within a preset brightness interval range;
    如果所述vin码图像的亮度不处于所述亮度区间范围内,对所述vin码图像进行顶帽变换,以得到顶帽变换后的vin码图像;If the brightness of the vin code image is not within the range of the brightness interval, perform top-hat transformation on the vin code image to obtain a vin-code image after top hat transformation;
    所述对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像,包括:The performing edge detection on the vin code image to obtain an edge image after edge detection includes:
    对所述顶帽变换后的vin码图像进行边缘检测,以得到边缘检测后的边缘图像。Perform edge detection on the vin code image after the top hat transformation to obtain an edge image after edge detection.
  8. 根据权利要求1-6任一项所述的方法,其特征在于,所述拍摄装置装载于一固定位置处,且该拍摄装置的拍摄角度可调节,所述目标拍摄参数包括拍摄角度。The method according to any one of claims 1 to 6, wherein the shooting device is mounted at a fixed position, and the shooting angle of the shooting device is adjustable, and the target shooting parameter includes the shooting angle.
  9. 一种图像处理设备,其特征在于,包括:获取单元和处理单元;An image processing device, characterized by comprising: an acquisition unit and a processing unit;
    所述获取单元,用于获取拍摄装置拍摄范围内的目标车辆的车辆环境信息,所述车辆环境信息包括所述目标车辆的车型、所述目标车辆所处的环境光强度、所述目标车辆与所述拍摄装置之间的距离和系统时间中的任一项或多项;The acquiring unit is configured to acquire vehicle environment information of the target vehicle within the shooting range of the shooting device, the vehicle environment information includes the model of the target vehicle, the ambient light intensity of the target vehicle, the target vehicle and Any one or more of the distance between the shooting devices and the system time;
    所述处理单元,用于根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数;The processing unit is configured to determine a target shooting parameter for shooting the target vehicle according to the vehicle environment information;
    所述获取单元,还用于使用所述拍摄装置并按照所述目标拍摄参数采集所述目标车辆的vin码图像,所述vin码图像包括所述目标车辆的vin码区域;The acquiring unit is further configured to acquire the vin code image of the target vehicle using the shooting device and according to the target shooting parameter, the vin code image including the vin code area of the target vehicle;
    所述处理单元,还用于对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像;对所述边缘图像进行形态学闭运算,以得到闭运算图像;对所述闭运算图像进行形态学开运算,以得到开运算图像;确定所述开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述目标车辆的vin码区域;对所述目标车辆的vin码区域进行识别,以识别出所述目标车辆的vin码。The processing unit is further used for performing edge detection on the vin code image to obtain an edge image after edge detection; performing a morphological closed operation on the edge image to obtain a closed operation image; and on the closed operation image Perform morphological opening operation to obtain an opening operation image; determine the minimum circumscribed rectangle of the vin code area in the opening operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle; The vin code area of the target vehicle is identified to identify the vin code of the target vehicle.
  10. 根据权利要求9所述的设备,其特征在于,The device according to claim 9, characterized in that
    所述处理单元,具体用于根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数。The processing unit is specifically configured to determine the shooting parameters corresponding to the vehicle environment information of the target vehicle according to the preset correspondence between the vehicle environment information and the shooting parameters, and determine the determined shooting parameters as the For shooting the target shooting parameters of the target vehicle.
  11. 根据权利要求10所述的设备,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型;The apparatus according to claim 10, wherein the vehicle environment information of the target vehicle includes the vehicle model of the target vehicle;
    所述处理单元,具体用于根据预设的车辆车型和拍摄参数的对应关系,从数据库中查找出与所述目标车辆的车型相同的车辆车型所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit is specifically configured to search for the shooting parameters corresponding to the vehicle model that is the same as the target vehicle model from the database according to the preset correspondence between the vehicle model and the shooting parameters, and store the found The shooting parameters are determined as target shooting parameters for shooting the target vehicle;
    其中,所述数据库中存储有多种车辆车型以及每种车辆车型对应的拍摄参数。Wherein, the database stores multiple vehicle models and shooting parameters corresponding to each vehicle model.
  12. 根据权利要求10所述的设备,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆所处的环境光强度;The apparatus according to claim 10, wherein the vehicle environment information of the target vehicle includes a vehicle model of the target vehicle and an ambient light intensity where the target vehicle is located;
    所述处理单元,具体用于根据预设的多个环境光强度区间,确定所述目标车辆所处的环境光强度在所述多个环境光强度区间中所在的目标环境光强度区间;根据预设的车辆车型、环境光强度区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标环境光强度区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit is specifically configured to determine the target ambient light intensity interval in which the ambient light intensity of the target vehicle is located in the multiple ambient light intensity intervals according to preset multiple ambient light intensity intervals; Set the correspondence between the vehicle model, the ambient light intensity interval and the shooting parameters, find the shooting parameters corresponding to the target vehicle model and the target ambient light intensity interval from the database, and find The shooting parameters determined are the target shooting parameters for shooting the target vehicle;
    其中,所述数据库中存储有多种车辆车型、所述多个环境光强度区间以及与每种车辆车型和每个环境光强度区间对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple ambient light intensity intervals, and shooting parameters corresponding to each vehicle model and each ambient light intensity interval.
  13. 根据权利要求10所述的设备,其特征在于,所述目标车辆的车辆环境信息包括所述目标车辆的车型和所述目标车辆与所述拍摄装置之间的距离;The apparatus according to claim 10, wherein the vehicle environment information of the target vehicle includes a vehicle model of the target vehicle and a distance between the target vehicle and the shooting device;
    所述处理单元,具体用于根据预设的多个距离区间,确定所述目标车辆与所述拍摄装置之间的距离在所述多个距离区间中所在的目标距离区间;根据预设的车辆车型、距离区间和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标距离区间所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit is specifically configured to determine a target distance interval where the distance between the target vehicle and the shooting device is among the multiple distance intervals according to preset multiple distance intervals; according to the preset vehicle Correspondence between the vehicle model, the distance interval and the shooting parameters, the shooting parameters corresponding to the vehicle model of the target vehicle and the target distance interval are found from the database, and the found shooting parameters are determined Target shooting parameters for shooting the target vehicle;
    其中,所述数据库中存储有多种车辆车型、所述多个距离区间以及与每种车辆车型和每个距离区间对应的拍摄参数。Among them, the database stores a plurality of vehicle models, the plurality of distance sections, and shooting parameters corresponding to each vehicle model and each distance section.
  14. 根据权利要求10所述的设备,其特征在于,所述目标车辆的车辆环境信息包括所 述目标车辆的车型和系统时间;The apparatus according to claim 10, wherein the vehicle environment information of the target vehicle includes a vehicle model and a system time of the target vehicle;
    所述处理单元,具体用于根据预设的多个时间段,确定所述系统时间在所述多个时间段中所属的目标时间段;根据预设的车辆车型、时间段和拍摄参数三者之间的对应关系,从数据库中查找出与所述目标车辆的车型和所述目标时间段所对应的拍摄参数,并将查找出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数;The processing unit is specifically configured to determine the target time period to which the system time belongs in the multiple time periods according to preset multiple time periods; according to the preset vehicle model, time period and shooting parameters three The corresponding relationship between the persons, the shooting parameters corresponding to the vehicle model of the target vehicle and the target time period are found from the database, and the found shooting parameters are determined to be used for shooting the target vehicle Target shooting parameters;
    其中,所述数据库中存储有多种车辆车型、所述多个时间段以及与每种车辆车型和每个时间段对应的拍摄参数。Wherein, the database stores multiple vehicle models, the multiple time periods, and shooting parameters corresponding to each vehicle model and each time period.
  15. 根据权利要求9-14任一项所述的设备,其特征在于,The device according to any one of claims 9-14, characterized in that
    所述处理单元,还用于在所述对所述vin码图像进行边缘检测之前,检测所述vin码图像的亮度是否处于预设的亮度区间范围内;如果所述vin码图像的亮度不处于所述亮度区间范围内,对所述vin码图像进行顶帽变换,以得到顶帽变换后的vin码图像;The processing unit is further configured to detect whether the brightness of the vin code image is within a preset brightness interval before performing edge detection on the vin code image; if the brightness of the vin code image is not Performing a top-hat transformation on the vin code image within the brightness interval to obtain a vin-code image after the top hat transformation;
    所述处理单元,具体用于对所述顶帽变换后的vin码图像进行边缘检测,以得到边缘检测后的边缘图像。The processing unit is specifically configured to perform edge detection on the vin code image after the top hat transformation to obtain an edge image after edge detection.
  16. 根据权利要求9-14任一项所述的设备,其特征在于,所述拍摄装置装载于一固定位置处,且该拍摄装置的拍摄角度可调节,所述目标拍摄参数包括拍摄角度。The apparatus according to any one of claims 9 to 14, wherein the shooting device is mounted at a fixed position, and the shooting angle of the shooting device is adjustable, and the target shooting parameter includes the shooting angle.
  17. 一种图像处理设备,其特征在于,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行以下步骤:An image processing apparatus, characterized by comprising a processor and a memory, the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured For calling the program instructions, perform the following steps:
    获取拍摄装置拍摄范围内的目标车辆的车辆环境信息,所述车辆环境信息包括所述目标车辆的车型、所述目标车辆所处的环境光强度、所述目标车辆与所述拍摄装置之间的距离和系统时间中的任一项或多项;Obtain vehicle environment information of the target vehicle within the shooting range of the shooting device, where the vehicle environment information includes the model of the target vehicle, the ambient light intensity of the target vehicle, and the distance between the target vehicle and the shooting device Any one or more of distance and system time;
    根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数,使用所述拍摄装置并按照所述目标拍摄参数采集所述目标车辆的vin码图像,所述vin码图像包括所述目标车辆的vin码区域;Determining a target shooting parameter for shooting the target vehicle according to the vehicle environment information, using the shooting device and collecting a vin code image of the target vehicle according to the target shooting parameter, the vin code image including the target The vin code area of the vehicle;
    对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像;Performing edge detection on the vin code image to obtain an edge image after edge detection;
    对所述边缘图像进行形态学闭运算,以得到闭运算图像;Performing a morphological closed operation on the edge image to obtain a closed operation image;
    对所述闭运算图像进行形态学开运算,以得到开运算图像;Performing morphological opening operation on the closed operation image to obtain an open operation image;
    确定所述开运算图像中vin码区域的最小外接矩形,并将所述最小外接矩形确定的区域确定为所述目标车辆的vin码区域;Determine the minimum circumscribed rectangle of the vin code area in the open operation image, and determine the area determined by the minimum circumscribed rectangle as the vin code area of the target vehicle;
    对所述目标车辆的vin码区域进行识别,以识别出所述目标车辆的vin码。The vin code area of the target vehicle is identified to identify the vin code of the target vehicle.
  18. 根据权利要求17所述的设备,其特征在于,所述处理器在执行所述根据所述车辆环境信息确定用于拍摄所述目标车辆的目标拍摄参数时,具体执行以下步骤:The apparatus according to claim 17, wherein the processor specifically executes the following steps when performing the determination of the target shooting parameters for shooting the target vehicle according to the vehicle environment information:
    根据预设的车辆环境信息和拍摄参数的对应关系,确定出与所述目标车辆的车辆环境信息对应的拍摄参数,并将确定出的所述拍摄参数确定为用于拍摄所述目标车辆的目标拍摄参数。According to the preset correspondence between the vehicle environment information and the shooting parameters, the shooting parameters corresponding to the vehicle environment information of the target vehicle are determined, and the determined shooting parameters are determined as targets for shooting the target vehicle Shooting parameters.
  19. 根据权利要求17或18所述的设备,其特征在于,所述处理器在执行所述对所述vin码图像进行边缘检测之前,还执行以下步骤:The device according to claim 17 or 18, wherein the processor further performs the following steps before performing the edge detection on the vin code image:
    检测所述vin码图像的亮度是否处于预设的亮度区间范围内;Detecting whether the brightness of the vin code image is within a preset brightness interval;
    如果所述vin码图像的亮度不处于所述亮度区间范围内,对所述vin码图像进行顶帽变换,以得到顶帽变换后的vin码图像;If the brightness of the vin code image is not within the range of the brightness interval, perform top-hat transformation on the vin code image to obtain a vin-code image after top hat transformation;
    所述对所述vin码图像进行边缘检测,以得到边缘检测后的边缘图像,包括:The performing edge detection on the vin code image to obtain an edge image after edge detection includes:
    对所述顶帽变换后的vin码图像进行边缘检测,以得到边缘检测后的边缘图像。Perform edge detection on the vin code image after the top hat transformation to obtain an edge image after edge detection.
  20. 一种计算机非易失性可读存储介质,其特征在于,所述计算机非易失性可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1-8任一项所述的方法。A computer non-volatile readable storage medium, characterized in that the computer non-volatile readable storage medium stores a computer program, the computer program includes program instructions, when the program instructions are executed by a processor Causing the processor to perform the method according to any one of claims 1-8.
PCT/CN2019/117069 2019-01-04 2019-11-11 Vin code identification method based on image processing, device and medium WO2020140611A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910013905.5A CN109784322A (en) 2019-01-04 2019-01-04 A kind of recognition methods of vin code, equipment and medium based on image procossing
CN201910013905.5 2019-01-04

Publications (1)

Publication Number Publication Date
WO2020140611A1 true WO2020140611A1 (en) 2020-07-09

Family

ID=66500102

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117069 WO2020140611A1 (en) 2019-01-04 2019-11-11 Vin code identification method based on image processing, device and medium

Country Status (2)

Country Link
CN (1) CN109784322A (en)
WO (1) WO2020140611A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818746A (en) * 2020-12-30 2021-05-18 北京立禾物联科技有限公司 Method, device and system for identifying certification

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109784322A (en) * 2019-01-04 2019-05-21 平安科技(深圳)有限公司 A kind of recognition methods of vin code, equipment and medium based on image procossing
CN110503102A (en) * 2019-08-27 2019-11-26 上海眼控科技股份有限公司 Vehicle identification code detection method, device, computer equipment and storage medium
CN110796709A (en) * 2019-10-29 2020-02-14 上海眼控科技股份有限公司 Method and device for acquiring size of frame number, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246551A (en) * 2008-03-07 2008-08-20 北京航空航天大学 Fast license plate locating method
CN102646195A (en) * 2012-02-21 2012-08-22 北京工业大学 License plate locating method based on JPEG (Joint Photographic Experts Group) compressed image
CN105426899A (en) * 2014-09-19 2016-03-23 腾讯科技(北京)有限公司 Vehicle identification method and device and client side
CN105913059A (en) * 2016-04-11 2016-08-31 吉林大学 Vehicle VIN code automatic identifying system and control method therefor
CN106558121A (en) * 2015-09-30 2017-04-05 中兴通讯股份有限公司 The method and device of shooting
CN109784322A (en) * 2019-01-04 2019-05-21 平安科技(深圳)有限公司 A kind of recognition methods of vin code, equipment and medium based on image procossing

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927526B (en) * 2014-04-30 2017-02-15 长安大学 Vehicle detecting method based on Gauss difference multi-scale edge fusion
CN104751097B (en) * 2015-03-30 2018-05-11 深圳市道通科技股份有限公司 A kind of detection process method and device of vehicle identification code

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246551A (en) * 2008-03-07 2008-08-20 北京航空航天大学 Fast license plate locating method
CN102646195A (en) * 2012-02-21 2012-08-22 北京工业大学 License plate locating method based on JPEG (Joint Photographic Experts Group) compressed image
CN105426899A (en) * 2014-09-19 2016-03-23 腾讯科技(北京)有限公司 Vehicle identification method and device and client side
CN106558121A (en) * 2015-09-30 2017-04-05 中兴通讯股份有限公司 The method and device of shooting
CN105913059A (en) * 2016-04-11 2016-08-31 吉林大学 Vehicle VIN code automatic identifying system and control method therefor
CN109784322A (en) * 2019-01-04 2019-05-21 平安科技(深圳)有限公司 A kind of recognition methods of vin code, equipment and medium based on image procossing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112818746A (en) * 2020-12-30 2021-05-18 北京立禾物联科技有限公司 Method, device and system for identifying certification

Also Published As

Publication number Publication date
CN109784322A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
WO2020140610A1 (en) Image processing method and device, and computer-readable storage medium
WO2020140611A1 (en) Vin code identification method based on image processing, device and medium
CN109740478B (en) Vehicle detection and identification method, device, computer equipment and readable storage medium
Zhang et al. Image segmentation based on 2D Otsu method with histogram analysis
Kasaei et al. New morphology-based method for robustiranian car plate detection and recognition
US20070281734A1 (en) Method, system and apparatus for handset screen analysis
US7460689B1 (en) System and method of detecting, recognizing, and tracking moving targets
US20080166018A1 (en) Method and apparatus for performing object recognition on a target detected using motion information
CN111325769B (en) Target object detection method and device
CN110335216B (en) Image processing method, image processing apparatus, terminal device, and readable storage medium
WO2009105812A1 (en) Spatio-activity based mode matching field of the invention
US20180047271A1 (en) Fire detection method, fire detection apparatus and electronic equipment
US20140056519A1 (en) Method, apparatus and system for segmenting an image in an image sequence
CN112507897A (en) Cross-modal face recognition method, device, equipment and storage medium
CN108805838B (en) Image processing method, mobile terminal and computer readable storage medium
CN113158773B (en) Training method and training device for living body detection model
CN111178118A (en) Image acquisition processing method and device and computer readable storage medium
CN108805883B (en) Image segmentation method, image segmentation device and electronic equipment
CN108769521B (en) Photographing method, mobile terminal and computer readable storage medium
KR20220047749A (en) How to create a slab/finger foreground mask
CN108810407B (en) Image processing method, mobile terminal and computer readable storage medium
CN111402185B (en) Image detection method and device
CN111062272A (en) Image processing and pedestrian identification method and device based on color recovery and readable storage medium
CN112883762A (en) Living body detection method, device, system and storage medium
CN110610178A (en) Image recognition method, device, terminal and computer readable storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19907388

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 25.08.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19907388

Country of ref document: EP

Kind code of ref document: A1