CN114708524A - Parcel image recognition method and device, electronic device and storage medium - Google Patents

Parcel image recognition method and device, electronic device and storage medium Download PDF

Info

Publication number
CN114708524A
CN114708524A CN202210218670.5A CN202210218670A CN114708524A CN 114708524 A CN114708524 A CN 114708524A CN 202210218670 A CN202210218670 A CN 202210218670A CN 114708524 A CN114708524 A CN 114708524A
Authority
CN
China
Prior art keywords
package
image
parcel
size
ratio
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210218670.5A
Other languages
Chinese (zh)
Other versions
CN114708524B (en
Inventor
黄锐鑫
杨斌
孙文峰
陈春瑶
鞠金采
张坤飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huashi Zhijian Technology Co ltd
Original Assignee
Zhejiang Huashi Zhijian Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Huashi Zhijian Technology Co ltd filed Critical Zhejiang Huashi Zhijian Technology Co ltd
Priority to CN202210218670.5A priority Critical patent/CN114708524B/en
Publication of CN114708524A publication Critical patent/CN114708524A/en
Application granted granted Critical
Publication of CN114708524B publication Critical patent/CN114708524B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The application relates to a parcel image recognition method, a device, an electronic device and a storage medium, wherein the parcel image recognition method comprises the following steps: acquiring a first package image and a second package image to be identified, and determining an image display ratio between the first package image and the second package image; acquiring the size of a first package in the first package image and the size of a second package in the second package image, and calculating the ratio of the size of the second package to the size of the first package to obtain the package size ratio; and determining a first difference value of the image display proportion and the parcel size ratio, and judging that the first parcel is different from the second parcel when the first difference value is out of a preset numerical range. Through the method and the device, the problem that a plurality of images corresponding to the same parcel are mistakenly identified as different parcel images is solved, the accuracy of data statistics is improved, and the security inspection efficiency is improved.

Description

一种包裹图像识别方法、装置、电子装置和存储介质A package image recognition method, device, electronic device and storage medium

技术领域technical field

本申请涉及图像处理领域,特别是涉及一种包裹图像识别方法、装置、电子装置和存储介质。The present application relates to the field of image processing, and in particular, to a package image recognition method, device, electronic device and storage medium.

背景技术Background technique

现代社会中,为了快速有效检测出可能威胁公共安全的物品,需要在一些场所对人员携带的行李进行安检,因此,安检设备被广泛应用于机场、车站、会展中心、景区、体育馆等场所。随着人工智能技术的发展,在安检时已经可以实现行李物品的智能识别分类和可视化呈现,大大提高了危险物品的检出率。In modern society, in order to quickly and effectively detect items that may threaten public safety, it is necessary to carry out security inspection of luggage carried by people in some places. Therefore, security inspection equipment is widely used in airports, stations, exhibition centers, scenic spots, gymnasiums and other places. With the development of artificial intelligence technology, the intelligent identification, classification and visual presentation of luggage items can be realized during security inspection, which greatly improves the detection rate of dangerous goods.

在相关技术中,通过采集安检设备输出的视频进行智能分析,通常安检设备的输出帧率在60~120帧之间,当一个包裹从进入安检设备到出安检设备,会被多次采集并分析。由于安检员在包裹通过安检设备的过程中操作图像进行放大、缩小,或者图像中本身的水波纹、横竖条纹等因素的干扰,前后多次采集同一个包裹形成的多个图像,在处理后可能会存在差异。从而导致将同一个包裹形成的多个图像,误判断为不同包裹对应的图像,进行多次识别并上报数据,最终导致存储大量同一包裹的图像,造成数据统计错误,降低安检效率。In the related art, intelligent analysis is performed by collecting the video output by the security inspection equipment. Usually, the output frame rate of the security inspection equipment is between 60 and 120 frames. . Due to the interference of factors such as water ripples, horizontal and vertical stripes in the image, the security inspector manipulates the image to zoom in and out during the process of the package passing through the security inspection equipment. There will be differences. As a result, multiple images formed by the same package are misjudged as images corresponding to different packages, and the data is identified and reported multiple times, which eventually leads to the storage of a large number of images of the same package, resulting in errors in data statistics and reduced security inspection efficiency.

目前针对相关技术中,同一包裹对应的多个图像被误识别为不同包裹图像的问题,尚未提出有效的解决方案。Currently, in the related art, multiple images corresponding to the same package are mistakenly identified as different package images, and no effective solution has yet been proposed.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种包裹图像识别方法、装置、电子装置和存储介质,以至少解决相关技术中,同一包裹对应的多个图像被误识别为不同包裹图像的问题。Embodiments of the present application provide a package image recognition method, device, electronic device, and storage medium, so as to at least solve the problem in the related art that multiple images corresponding to the same package are mistakenly recognized as different package images.

第一方面,本申请实施例提供了一种包裹图像识别方法。In a first aspect, an embodiment of the present application provides a package image recognition method.

在其中一些实施例中,所述方法包括:In some of these embodiments, the method includes:

获取待识别的第一包裹图像和第二包裹图像,确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例;acquiring the first package image and the second package image to be identified, and determining the image display ratio between the second package image and the first package image;

获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值;Obtain the size of the first package in the first package image and the size of the second package in the second package image, calculate the ratio of the size of the second package to the size of the first package, and obtain the package size ratio ;

确定所述图像显示比例与所述包裹尺寸比值的第一差值,当所述第一差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。A first difference between the image display ratio and the package size ratio is determined, and when the first difference is outside a preset value range, it is determined that the first package is different from the second package.

在其中一些实施例中,所述确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例包括:In some of these embodiments, the determining an image display ratio between the second package image and the first package image includes:

获取所述第一包裹图像中的第一图像显示系数,以及所述第二包裹图像中的第二图像显示系数;acquiring a first image display coefficient in the first packaged image, and a second image display coefficient in the second packaged image;

计算所述第二图像显示系数与所述第一图像显示系数的比值,得到所述图像显示比例。The ratio of the second image display coefficient to the first image display coefficient is calculated to obtain the image display ratio.

在其中一些实施例中,所述方法还包括:In some of these embodiments, the method further includes:

当所述第一差值在预设数值范围内时,识别所述第一包裹图像中的所述第一包裹中容纳的第一物品的数量和所述第二包裹图像中的所述第二包裹中容纳的第二物品的数量;When the first difference is within a preset value range, identifying the quantity of the first item contained in the first package in the first package image and the second package in the second package image the quantity of the second item contained in the package;

当所述第一物品的数量和所述第二物品的数量不相等时,判断所述第一包裹与所述第二包裹不相同。When the quantity of the first item and the quantity of the second item are not equal, it is determined that the first package is not the same as the second package.

在其中一些实施例中,所述方法还包括:In some of these embodiments, the method further includes:

当所述第一物品的数量和所述第二物品的数量相等时,确定所述第一包裹中容纳的所述第一物品的种类以得到第一种类集合,以及,确定所述第二包裹中容纳的所述第二物品的种类以得到第二种类集合;When the quantity of the first item and the quantity of the second item are equal, determining the category of the first item contained in the first package to obtain a first category set, and determining the second package the category of the second item contained in the second category to obtain a second category set;

当所述第一种类集合与所述第二种类集合不相同时,判断所述第一包裹与所述第二包裹不相同。When the first category set is different from the second category set, it is determined that the first package and the second package are different.

在其中一些实施例中,所述方法还包括:In some of these embodiments, the method further includes:

当所述第一种类集合与所述第二种类集合相同时,确定所述第一物品与所述第二物品之间的对应关系,计算每个所述第二物品的尺寸与对应的所述第一物品的尺寸的比值,得到多个物品尺寸比值;When the first category set is the same as the second category set, determine the correspondence between the first item and the second item, and calculate the size of each second item and the corresponding The ratio of the size of the first item to obtain the size ratio of multiple items;

确定所述图像显示比例与每个所述物品尺寸比值的第二差值,当至少一个所述第二差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。Determine a second difference between the image display ratio and the size ratio of each item, and when at least one of the second differences is outside a preset value range, determine that the first package and the second package are not same.

在其中一些实施例中,所述确定所述第一物品与所述第二物品之间的对应关系包括:In some of the embodiments, the determining the correspondence between the first item and the second item includes:

确定每个所述第一物品在所述第一包裹图像中的第一位置,以及,确定每个所述第二物品在所述第二包裹图像中的第二位置,根据所述第一位置和所述第二位置,确定所述第一物品与所述第二物品之间的对应关系;和/或,determining a first position of each of the first items in the first package image, and determining a second position of each of the second items in the second package image, based on the first position and the second position, to determine the correspondence between the first item and the second item; and/or,

根据所述第一物品的尺寸和所述第二物品的尺寸,确定所述第一物品与所述第二物品之间的对应关系。According to the size of the first item and the size of the second item, the corresponding relationship between the first item and the second item is determined.

在其中一些实施例中,所述预设数值范围为-0.1至0.1。In some of the embodiments, the predetermined value range is -0.1 to 0.1.

第二方面,本申请实施例提供了一种包裹图像识别装置。In a second aspect, an embodiment of the present application provides a package image recognition device.

在其中一些实施例中,所述装置包括图像显示比例确定模块,包裹尺寸比值计算模块和包裹图像识别模块:In some of these embodiments, the device includes an image display ratio determination module, a package size ratio calculation module and a package image recognition module:

所述图像显示比例确定模块,用于获取待识别的第一包裹图像和第二包裹图像,确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例;The image display ratio determination module is used to obtain the first package image and the second package image to be recognized, and determine the image display ratio between the second package image and the first package image;

所述包裹尺寸比值计算模块,用于获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值;The package size ratio calculation module is used to obtain the size of the first package in the first package image and the size of the second package in the second package image, and calculate the size of the second package and the first package. The ratio of the package size to get the package size ratio;

所述包裹图像识别模块,用于确定所述图像显示比例与所述包裹尺寸比值的第一差值,当所述第一差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。The package image recognition module is used to determine the first difference between the ratio of the image display ratio and the package size, and when the first difference is outside the preset value range, determine the difference between the first package and the package size. The second package is not the same.

第三方面,本申请实施例提供了一种电子装置,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的包裹图像识别方法。In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, when the processor executes the computer program Implement the package image recognition method described in the first aspect above.

第四方面,本申请实施例提供了一种存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面所述的包裹图像识别方法。In a fourth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, implements the method for recognizing a package image as described in the first aspect above.

相比于相关技术,本申请实施例提供的包裹图像识别方法、装置、电子装置和存储介质,通过获取待识别的第一包裹图像和第二包裹图像,确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例,并获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值,以及确定所述图像显示比例与所述包裹尺寸比值的第一差值,当所述第一差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同,解决了相关技术中同一包裹对应的多个图像被误识别为不同包裹图像的问题,提高了数据统计的准确性,提升了安检效率。Compared with the related art, the package image recognition method, device, electronic device, and storage medium provided in the embodiments of the present application determine the second package image and the second package image by acquiring the first package image and the second package image to be recognized. The image display ratio between the first package images, and obtain the size of the first package in the first package image and the size of the second package in the second package image, and calculate the size of the second package and the The ratio of the size of the first package is obtained, the package size ratio is obtained, and the first difference between the image display ratio and the package size ratio is determined, and when the first difference is outside the preset value range, it is determined that the The first package is different from the second package, which solves the problem in the related art that multiple images corresponding to the same package are mistakenly identified as different package images, improves the accuracy of data statistics, and improves the efficiency of security inspection.

本申请的一个或多个实施例的细节在以下附图和描述中提出,以使本申请的其他特征、目的和优点更加简明易懂。The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below in order to make other features, objects and advantages of the application more apparent.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:

图1是根据本申请实施例的包裹图像识别方法的终端的硬件结构框图;1 is a block diagram of a hardware structure of a terminal according to a package image recognition method according to an embodiment of the present application;

图2是根据本申请实施例的包裹图像识别方法的流程图;2 is a flowchart of a package image recognition method according to an embodiment of the present application;

图3是根据本申请实施例的又一种包裹图像识别方法的流程图;3 is a flowchart of another method for identifying a package image according to an embodiment of the present application;

图4是根据本申请优选实施例的包裹图像识别方法的流程图;4 is a flowchart of a package image recognition method according to a preferred embodiment of the present application;

图5是根据本申请优选实施例的包裹图像识别方法的包裹图像示意图;5 is a schematic diagram of a package image according to a package image recognition method according to a preferred embodiment of the present application;

图6是根据本申请实施例的包裹图像识别装置的结构框图。FIG. 6 is a structural block diagram of a package image recognition device according to an embodiment of the present application.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行描述和说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。基于本申请提供的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。此外,还可以理解的是,虽然这种开发过程中所作出的努力可能是复杂并且冗长的,然而对于与本申请公开的内容相关的本领域的普通技术人员而言,在本申请揭露的技术内容的基础上进行的一些设计,制造或者生产等变更只是常规的技术手段,不应当理解为本申请公开的内容不充分。In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application. In addition, it will also be appreciated that while such development efforts may be complex and lengthy, for those of ordinary skill in the art to which the present disclosure pertains, the techniques disclosed in this application Some changes in design, manufacture or production based on the content are only conventional technical means, and it should not be understood that the content disclosed in this application is not sufficient.

在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域普通技术人员显式地和隐式地理解的是,本申请所描述的实施例在不冲突的情况下,可以与其它实施例相结合。Reference in this application to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor a separate or alternative embodiment that is mutually exclusive of other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

除非另作定义,本申请所涉及的技术术语或者科学术语应当为本申请所属技术领域内具有一般技能的人士所理解的通常意义。本申请所涉及的“一”、“一个”、“一种”、“该”等类似词语并不表示数量限制,可表示单数或复数。本申请所涉及的术语“包括”、“包含”、“具有”以及它们任何变形,意图在于覆盖不排他的包含;例如包含了一系列步骤或模块(单元)的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可以还包括没有列出的步骤或单元,或可以还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。本申请所涉及的“连接”、“相连”、“耦接”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电气的连接,不管是直接的还是间接的。本申请所涉及的“多个”是指大于或者等于两个。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。本申请所涉及的术语“第一”、“第二”、“第三”等仅仅是区别类似的对象,不代表针对对象的特定排序。Unless otherwise defined, the technical or scientific terms involved in this application shall have the usual meanings understood by those with ordinary skill in the technical field to which this application belongs. Words such as "a", "an", "an", "the" and the like mentioned in this application do not denote a quantitative limitation, and may denote the singular or the plural. The terms "comprising", "comprising", "having" and any of their variants referred to in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or process comprising a series of steps or modules (units) The apparatus is not limited to the steps or units listed, but may further include steps or units not listed, or may further include other steps or units inherent to the process, method, product or apparatus. Words like "connected," "connected," "coupled," and the like referred to in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "plurality" referred to in this application means greater than or equal to two. "And/or" describes the association relationship between associated objects, indicating that there can be three kinds of relationships. For example, "A and/or B" can mean that A exists alone, A and B exist at the same time, and B exists alone. The terms "first", "second", "third", etc. involved in this application are only to distinguish similar objects, and do not represent a specific order for the objects.

本实施例提供的方法实施例可以在终端、计算机或者类似的运算装置中执行。以运行在终端上为例,图1是本发明实施例的包裹图像识别方法的终端的硬件结构框图。如图1所示,终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,可选地,上述终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述终端的结构造成限定。例如,终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiments provided in this embodiment may be executed in a terminal, a computer or a similar computing device. Taking running on a terminal as an example, FIG. 1 is a block diagram of a hardware structure of a terminal of a package image recognition method according to an embodiment of the present invention. As shown in FIG. 1 , the terminal may include one or more (only one is shown in FIG. 1 ) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and The memory 104 for storing data, optionally, the above-mentioned terminal may further include a transmission device 106 and an input and output device 108 for communication functions. Those of ordinary skill in the art can understand that the structure shown in FIG. 1 is only for illustration, which does not limit the structure of the above-mentioned terminal. For example, the terminal may also include more or fewer components than shown in FIG. 1 , or have a different configuration than that shown in FIG. 1 .

存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的包裹图像识别方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer programs corresponding to the package image recognition method in the embodiment of the present invention. The processor 102 executes the computer programs stored in the memory 104 to execute Various functional applications and data processing implement the above method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, memory 104 may further include memory located remotely from processor 102, and these remote memories may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

传输设备106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括终端的通信供应商提供的无线网络。在一个实例中,传输设备106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。Transmission device 106 is used to receive or transmit data via a network. The specific example of the above-mentioned network may include a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is used to communicate with the Internet in a wireless manner.

本申请实施例提供了一种包裹图像识别方法,图2是根据本申请实施例的包裹图像识别方法的流程图,如图2所示,该流程包括如下步骤:An embodiment of the present application provides a method for recognizing a package image. FIG. 2 is a flowchart of a method for recognizing a package image according to an embodiment of the present application. As shown in FIG. 2 , the process includes the following steps:

步骤S201,获取待识别的第一包裹图像和第二包裹图像,确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例。Step S201: Acquire a first package image and a second package image to be recognized, and determine an image display ratio between the second package image and the first package image.

本实施例中,可以由具备智能分析能力的服务器来获取待识别的第一包裹图像和第二包裹图像。其中,第一包裹图像和第二包裹图像可以是相邻的两帧待识别图像,也可以是间隔开的两帧待识别图像。优选的,获取的第一包裹图像和第二包裹图像之间可以间隔8帧至16帧图像。进一步的,上述的第二包裹图像和第一包裹图像之间的图像显示比例,可以是第二包裹图像的尺寸和第一包裹图像的尺寸的比值。需要说明的是,在本申请中所述的图像尺寸是广义上的,其既可以是指长度,也可以是面积、像素等的度量。In this embodiment, the first package image and the second package image to be identified may be acquired by a server with an intelligent analysis capability. Wherein, the first wrapping image and the second wrapping image may be two adjacent frames of images to be identified, or may be two frames of images to be identified separated from each other. Preferably, there may be an interval of 8 to 16 frames of images between the acquired first wrapping image and the second wrapping image. Further, the above-mentioned image display ratio between the second wrapping image and the first wrapping image may be the ratio of the size of the second wrapping image to the size of the first wrapping image. It should be noted that the image size described in this application is in a broad sense, and it may refer to either length, area, pixels, or the like.

步骤S202,获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值。Step S202: Obtain the size of the first package in the first package image and the size of the second package in the second package image, calculate the ratio of the size of the second package to the size of the first package, and obtain Package size ratio.

本申请实施例获取的每张包裹图像中包括有对应的一个目标包裹,即上述第一包裹图像中包括有第一包裹,第二包裹图像中包括有第二包裹。分别获取所述的第一包裹和第二包裹的尺寸,同样的,所述的包裹尺寸也是广义上的,其既可以是指长度,也可以是面积、像素等的度量。在统一度量对象的情况下计算包裹尺寸比值,例如,当第二包裹的尺寸为第二包裹对应的第二包裹目标框高度,第一包裹的尺寸为第一包裹对应的第一包裹目标框高度时,计算所述第二包裹目标框高度与所述第一包裹目标框高度的比值,得到包裹尺寸比值。可以理解,目标框的高度可以是包括目标的矩形框的长边所具备的长度。Each package image obtained in this embodiment of the present application includes a corresponding target package, that is, the first package image includes the first package, and the second package image includes the second package. The dimensions of the first package and the second package are obtained respectively. Similarly, the package size is also in a broad sense, which may refer to either length, area, pixels, or the like. Calculate the package size ratio in the case of a unified measurement object. For example, when the size of the second package is the height of the second package target box corresponding to the second package, the size of the first package is the height of the first package target box corresponding to the first package. When , the ratio of the height of the second wrapping target frame to the height of the first wrapping target frame is calculated to obtain the wrapping size ratio. It can be understood that the height of the target frame may be the length of the long side of the rectangular frame including the target.

步骤S203,确定所述图像显示比例与所述包裹尺寸比值的第一差值,当所述第一差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。Step S203, determining a first difference between the image display ratio and the package size ratio, and when the first difference is outside a preset value range, determine that the first package is different from the second package .

对应的,承接本实施例中步骤S202的举例,在所述包裹尺寸比值为第二包裹目标框高度与第一包裹目标框高度的比值时,则所述图像显示比例也应当是长度度量下的显示比例,例如,所述图像显示比例可以是第二包裹图像宽度和第一包裹图像宽度的比值。此时,预设某一数值范围,当确定的图像显示比例与所述包裹尺寸比值的第一差值在预设数值范围外时,说明在前后两帧图像之间变换时,包裹图像与包裹的比例变化不一致,则判断所述第一包裹与所述第二包裹不相同。需要说明的是,在本申请中所述的差值在预设数值范围外,不包括差值与数值范围端点值重合的情况,即当差值与预设数值范围的某一端点值相等,则认为差值在预设数值范围内。Correspondingly, following the example of step S202 in this embodiment, when the package size ratio is the ratio of the height of the second package target frame to the height of the first package target frame, the image display ratio should also be under the length measurement. The display ratio, for example, the image display ratio may be the ratio of the width of the second wrapping image to the width of the first wrapping image. At this time, a certain numerical range is preset, and when the first difference between the determined image display ratio and the package size ratio is outside the preset numerical range, it means that when changing between the two frames of images before and after, the package image and the package size are different. If the ratio of the changes is inconsistent, it is judged that the first package is not the same as the second package. It should be noted that the difference described in this application is outside the preset numerical range, excluding the case where the difference coincides with the end value of the numerical range, that is, when the difference is equal to a certain end value of the preset numerical range, The difference is considered to be within the preset value range.

通过上述步骤,本申请在获取待识别的第一包裹图像和第二包裹图像后,确定两帧图像之间的图像显示比例,并获取图像中的第一包裹的尺寸和第二包裹的尺寸,计算出两个包裹之间的包裹尺寸比值;其中,图像显示比例可以表明第一包裹图像到第二包裹图像的尺寸变化,包裹尺寸比值表明第一包裹到第二包裹的尺寸变化;确定上述的图像显示比例与包裹尺寸比值的第一差值,通过比较所述的第一差值和预设数值范围的关系,当所述第一差值在预设数值范围外时,表明包裹图像和包裹的尺寸变化不一致,此时判断所述第一包裹与所述第二包裹不相同,从而解决了相关技术中同一包裹对应的多个图像被误识别为不同包裹图像的问题,提高了数据统计的准确性,提升了安检效率。Through the above steps, after obtaining the first package image and the second package image to be recognized, the present application determines the image display ratio between the two frames of images, and obtains the size of the first package and the size of the second package in the images, Calculate the package size ratio between the two packages; wherein, the image display ratio can indicate the size change from the first package image to the second package image, and the package size ratio indicates the size change from the first package to the second package; determine the above The first difference between the image display ratio and the package size ratio, by comparing the relationship between the first difference and the preset value range, when the first difference is outside the preset value range, it indicates that the package image and the package are The size of the package is inconsistent, and it is judged that the first package is different from the second package, which solves the problem in the related art that multiple images corresponding to the same package are mistakenly identified as different package images, and improves the accuracy of data statistics. Accuracy improves security inspection efficiency.

在其中一些实施例中,步骤S201还包括:In some of these embodiments, step S201 further includes:

步骤S2011,获取所述第一包裹图像中的第一图像显示系数,以及所述第二包裹图像中的第二图像显示系数。Step S2011, acquiring a first image display coefficient in the first packaged image and a second image display coefficient in the second packaged image.

进一步的,可以在包裹图像预览界面中,分别采集获取第一包裹图像中的第一图像显示系数和第二包裹图像中的第二图像显示系数。Further, in the package image preview interface, the first image display coefficient in the first package image and the second image display coefficient in the second package image may be collected and acquired respectively.

步骤S2012,计算所述第二图像显示系数与所述第一图像显示系数的比值,得到所述图像显示比例。Step S2012: Calculate the ratio of the second image display coefficient to the first image display coefficient to obtain the image display ratio.

上述的图像显示系数可以表明包裹图像的尺寸大小,因此,通过计算所述第二图像显示系数与所述第一图像显示系数的比值,可以得到两帧包裹图像之间的尺寸比例,即图像显示比例。The above-mentioned image display coefficient can indicate the size of the wrapped image. Therefore, by calculating the ratio of the second image display coefficient to the first image display coefficient, the size ratio between the two frames of wrapped images can be obtained, that is, the image display Proportion.

基于本实施例,通过分别获取两帧图像的图像显示系数,计算两个图像显示系数之间的比值,以得到图像显示比例,从而使得计算简单,得到的图像显示比例准确。Based on this embodiment, the image display ratio is obtained by separately acquiring the image display coefficients of the two frames of images and calculating the ratio between the two image display coefficients, so that the calculation is simple and the obtained image display ratio is accurate.

本申请实施例还提供了一种包裹图像识别方法,如图3所示,在上述实施例的基础上还包括:The embodiment of the present application also provides a package image recognition method, as shown in FIG. 3 , which further includes:

步骤S301,当所述第一差值在预设数值范围内时,识别所述第一包裹图像中的所述第一包裹中容纳的第一物品的数量和所述第二包裹图像中的所述第二包裹中容纳的第二物品的数量。Step S301, when the first difference is within a preset value range, identify the quantity of the first item contained in the first package in the first package image and all items in the second package image. the quantity of the second item contained in the second package.

当第一差值在预设数值范围内时,表明第一包裹变换到第二包裹的比例变化,与第一包裹图像变换到第二包裹图像的比例变化是一致的,此时若需要判断第一包裹与第二包裹是否相同,则需要进一步比较两个包裹中容纳的物品的情况,由此,本实施例进一步获取上述第一物品的数量和第二物品的数量。When the first difference is within the preset value range, it indicates that the ratio change from the first package to the second package is consistent with the ratio change from the first package image to the second package image. Whether the first package is the same as the second package requires further comparison of the items contained in the two packages. Therefore, this embodiment further obtains the quantity of the first item and the quantity of the second item.

步骤S302,当所述第一物品的数量和所述第二物品的数量不相等时,判断所述第一包裹与所述第二包裹不相同。Step S302, when the quantity of the first item and the quantity of the second item are not equal, it is determined that the first package is not the same as the second package.

可以理解,当获取的第一物品的数量和第二物品的数量不相等时,则第一包裹与第二包裹不相同。It can be understood that when the acquired quantity of the first item and the quantity of the second item are not equal, the first package is different from the second package.

通过以上步骤,基于包裹内容纳的物品数量之间的比较,当两个包裹内物品数量不相等时,判断出第一包裹与第二包裹不相同,物品数量的获取相对简便精确,从而进一步提高了包裹异同判断的效率和准确性。Through the above steps, based on the comparison between the number of items contained in the packages, when the number of items in the two packages is not equal, it is determined that the first package is not the same as the second package, and the acquisition of the number of items is relatively simple and accurate, thereby further improving The efficiency and accuracy of the package similarities and differences judgments are improved.

本申请实施例还提供了一种包裹图像识别方法,在上述实施例的基础上还包括:The embodiment of the present application also provides a package image recognition method, which further includes:

步骤S401,当所述第一物品的数量和所述第二物品的数量相等时,确定所述第一包裹中容纳的所述第一物品的种类以得到第一种类集合,以及,确定所述第二包裹中容纳的所述第二物品的种类以得到第二种类集合。Step S401, when the quantity of the first item is equal to the quantity of the second item, determine the type of the first item contained in the first package to obtain a first type set, and determine the The category of the second item contained in the second package to obtain a second category set.

承接上一实施例,当第一物品的数量和第二物品的数量相等时,若要区分第一包裹与第二包裹的异同,则需要进一步获取第一物品的种类和第二物品的种类的情况,由此,得到上述的第一种类集合与第二种类集合。所述的种类集合包括对应包裹内容纳的每个物品的种类,例如,当第一包裹和第二包裹内的物品数量均为两个,其中第一包裹内容纳有一个水杯和一个钱包,第二包裹内容纳有一个水杯和一个手机,则上述的第一种类集合可以为{水杯,钱包},第二种类集合可以为{水杯,手机}。Following the previous example, when the quantity of the first item and the quantity of the second item are equal, to distinguish the similarities and differences between the first package and the second package, it is necessary to further obtain the type of the first item and the type of the second item. Therefore, the above-mentioned first category set and second category set are obtained. The category set includes the category of each item contained in the corresponding package. For example, when the number of items in the first package and the second package is two, the first package contains a water cup and a wallet, and the first package contains two items. The second package contains a water cup and a mobile phone, then the first type set above may be {water cup, wallet}, and the second type set may be {water cup, mobile phone}.

步骤S402,当所述第一种类集合与所述第二种类集合不相同时,判断所述第一包裹与所述第二包裹不相同。Step S402, when the first category set is different from the second category set, it is determined that the first package and the second package are different.

可以理解,当第一种类集合与第二种类集合不相同时,则第一包裹与第二包裹不相同。It can be understood that when the first category set is different from the second category set, the first package is different from the second package.

通过以上步骤,当两个包裹内物品数量相等时,进一步识别确认各个物品的种类,当两个包裹内物品种类不完全相同时,判断第一包裹与第二包裹不相同,从而进一步提高了包裹异同判断的准确性。Through the above steps, when the number of items in the two packages is equal, the type of each item is further identified and confirmed, and when the types of items in the two packages are not exactly the same, it is determined that the first package is different from the second package, thereby further improving the package. The accuracy of similarities and differences judgments.

本申请实施例还提供了一种包裹图像识别方法,在上述实施例的基础上还包括:The embodiment of the present application also provides a package image recognition method, which further includes:

步骤S501,当所述第一种类集合与所述第二种类集合相同时,确定所述第一物品与所述第二物品之间的对应关系,计算每个所述第二物品的尺寸与对应的所述第一物品的尺寸的比值,得到多个物品尺寸比值。Step S501, when the first category set is the same as the second category set, determine the correspondence between the first item and the second item, and calculate the size and correspondence of each of the second items. The ratio of the size of the first item to obtain a plurality of item size ratios.

在本实施例中,第一种类集合与第二种类集合相同,例如均为{水杯,手机},则需要确定第一物品与第二物品之间的对应关系,假设确定第一包裹中的水杯与第二包裹中的水杯对应,第一包裹中的手机与第二包裹中的手机对应,则计算第二包裹中的水杯与第一包裹中的水杯的尺寸比值,得到水杯尺寸比值,以及,计算第二包裹中的手机与第一包裹中的手机的尺寸比值,得到手机尺寸比值。In this embodiment, the first category set is the same as the second category set, for example, both are {water cups, mobile phones}, then the correspondence between the first item and the second item needs to be determined, assuming that the water cup in the first package is determined Corresponding to the water cup in the second package, the mobile phone in the first package corresponds to the mobile phone in the second package, then calculate the size ratio of the water cup in the second package and the water cup in the first package to obtain the water cup size ratio, and, Calculate the size ratio of the mobile phone in the second package and the mobile phone in the first package to obtain the size ratio of the mobile phone.

步骤S502,确定所述图像显示比例与每个所述物品尺寸比值的第二差值,当至少一个所述第二差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。Step S502, determining a second difference between the image display ratio and the size ratio of each item, and when at least one of the second differences is outside a preset value range, determine the difference between the first package and the first package. The two packages are not the same.

承接步骤S501,分别确定图像显示比例与水杯尺寸比值的第二差值,以及图像显示比例与手机尺寸比值的第二差值,当至少一个所述第二差值在预设数值范围外时,表明当从第一包裹图像变换到第二包裹图像时,至少有一组物品的尺寸比例变化与图像尺寸比例变化不一致,则判断该组物品对应在两帧图像中分别是不同物品,从而判断第一包裹与第二包裹不相同。Following step S501, respectively determining the second difference between the ratio of the image display ratio and the size of the water cup, and the second difference between the ratio of the image display ratio and the size of the mobile phone, when at least one of the second differences is outside the preset value range, Indicates that when transforming from the first package image to the second package image, there is at least one group of items whose size ratio change is inconsistent with the image size ratio change, then it is judged that the group of items corresponds to different items in the two frames of images, so that the first set of items is judged to be different. The package is not the same as the second package.

通过以上步骤,在两个包裹内的物品数量和种类均相同的情况下,进一步比较对应物品的尺寸比例变化与图像尺寸比例变化的一致性,当至少有一个物品的尺寸比例变化与图像尺寸比例变化不一致,则判断第一包裹与第二包裹不相同,从而进一步提高了包裹异同判断的准确性。Through the above steps, under the condition that the number and type of items in the two packages are the same, the consistency between the size ratio change of the corresponding item and the image size ratio change is further compared. When at least one item has the size ratio change and the image size ratio change If the changes are inconsistent, it is judged that the first package is different from the second package, thereby further improving the accuracy of judging the similarities and differences of the packages.

在一些实施例中,步骤S501还包括;In some embodiments, step S501 further includes;

步骤S5011,确定每个所述第一物品在所述第一包裹图像中的第一位置,以及,确定每个所述第二物品在所述第二包裹图像中的第二位置,根据所述第一位置和所述第二位置,确定所述第一物品与所述第二物品之间的对应关系。Step S5011, determining a first position of each of the first items in the first package image, and determining a second position of each of the second items in the second package image, according to the The first position and the second position determine the correspondence between the first item and the second item.

可选的,本实施例中可以基于位置关系来确定第一物品与第二物品之间的对应关系,具体的,可以扫描识别第一包裹图像和第二包裹图像,以分别得到上述的一个或多个第一位置和第二位置,将第一位置一一映射至第二包裹图像,依次选取并判断映射后的每个第一位置与所有第二位置的距离,将距离最近的第二位置与被选取的第一位置进行对应,从而得到第一物品与第二物品之间的对应关系。Optionally, in this embodiment, the corresponding relationship between the first item and the second item may be determined based on the positional relationship. Specifically, the first package image and the second package image may be scanned and identified to obtain one of the above or the second package image respectively. Multiple first positions and second positions, map the first positions to the second package image one by one, select and judge the distance between each first position after the mapping and all the second positions in turn, and map the closest second position to the second position. Corresponding to the selected first position, so as to obtain the corresponding relationship between the first item and the second item.

和/或,and / or,

步骤S5012,根据所述第一物品的尺寸和所述第二物品的尺寸,确定所述第一物品与所述第二物品之间的对应关系。Step S5012: Determine the correspondence between the first item and the second item according to the size of the first item and the size of the second item.

可选的,本实施例可以根据第一物品的尺寸和第二物品的尺寸,来确定第一物品与第二物品之间的对应关系,具体可以是,扫描识别第一包裹图像和第二包裹图像,分别得到一个或多个第一物品和第二物品,将第一物品按尺寸大小进行排序,将第二物品也按尺寸大小进行排序,并根据排序情况将第一物品与第二物品按照尺寸大小一一对应,即最大的第一物品对应最大的第二物品,次大的第一物品对应次大的第二物品,以此类推。Optionally, in this embodiment, the corresponding relationship between the first item and the second item may be determined according to the size of the first item and the size of the second item. Specifically, the image of the first package and the second package may be scanned and identified. image, get one or more first items and second items respectively, sort the first items by size, sort the second items by size, and sort the first item and the second item according to the sorting situation. Sizes correspond one-to-one, that is, the largest first item corresponds to the largest second item, the next largest first item corresponds to the next largest second item, and so on.

通过以上步骤,根据物品之间的位置和/或尺寸来确定第一物品与第二物品的对应关系,避免出现不同种类物品之间相比的情况,使得计算得到的物品尺寸比值准确,从而进一步提高了包裹异同判断的准确性。Through the above steps, the corresponding relationship between the first item and the second item is determined according to the position and/or size of the items, so as to avoid the situation of comparison between different types of items, so that the calculated item size ratio is accurate, thereby further Improves the accuracy of package similarities and differences judgments.

在一些实施例中,步骤S203中所述的预设数值范围为-0.1至0.1。In some embodiments, the preset value range described in step S203 is -0.1 to 0.1.

通过以上步骤,本申请预设合理的数值范围,避免当预设数值范围过大导致将不同包裹误判为相同包裹,同时避免预设数值范围过小导致将相同包裹误判为不同包裹,进一步提高包裹异同判断的准确性。Through the above steps, the application presets a reasonable range of values to avoid misjudging different packages as the same package when the preset value range is too large, and avoid misjudging the same package as different packages when the preset value range is too small, and further Improve the accuracy of package similarities and differences judgments.

下面通过优选实施例对本申请实施例进行描述和说明。The embodiments of the present application will be described and illustrated below through preferred embodiments.

图4是根据本申请优选实施例的包裹图像识别方法的流程图。图5是根据本申请优选实施例的包裹图像识别方法的包裹图像示意图。参照图4和图5,该包裹图像识别方法包括如下步骤:FIG. 4 is a flowchart of a method for recognizing a package image according to a preferred embodiment of the present application. FIG. 5 is a schematic diagram of a package image of a package image recognition method according to a preferred embodiment of the present application. 4 and 5, the package image recognition method includes the following steps:

步骤S4401,获取第一包裹图像和第二包裹图像。其中,第一包裹图像为图5中所示的第一帧检测图像,第二包裹图像为图5中所示的第n帧检测图像。Step S4401, acquiring a first package image and a second package image. The first wrapped image is the first frame detection image shown in FIG. 5 , and the second wrapped image is the nth frame detected image shown in FIG. 5 .

步骤S4402,获取所述第一包裹图像中的第一图像显示系数,以及所述第二包裹图像中的第二图像显示系数。本实施例中,第一图像显示系数为1.0,第二图像显示系数为1.8。Step S4402: Obtain a first image display coefficient in the first packaged image and a second image display coefficient in the second packaged image. In this embodiment, the display coefficient of the first image is 1.0, and the display coefficient of the second image is 1.8.

步骤S4403,计算所述第二图像显示系数与所述第一图像显示系数的比值,得到所述图像显示比例。通过计算,可以得到图像显示比例为1.8。Step S4403: Calculate the ratio of the second image display coefficient to the first image display coefficient to obtain the image display ratio. Through calculation, it can be obtained that the image display ratio is 1.8.

步骤S4404,获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值。在本实施例中,以包裹宽度作为包裹尺寸的度量,获取到第一包裹的宽度为14CM,第二包裹的宽度为25.5CM,计算得到包裹尺寸比值为1.821。Step S4404: Obtain the size of the first package in the first package image and the size of the second package in the second package image, calculate the ratio of the size of the second package to the size of the first package, and obtain Package size ratio. In this embodiment, the package width is used as the measure of the package size, the width of the first package is 14CM, the width of the second package is 25.5CM, and the package size ratio is calculated to be 1.821.

步骤S4405,确定所述图像显示比例与所述包裹尺寸比值的第一差值和预设数值范围。通过计算,得到第一差值为-0.021,预设数值范围为-0.1至0.1。Step S4405, determining a first difference between the ratio of the image display ratio and the package size and a preset value range. Through calculation, the first difference is -0.021, and the preset value range is -0.1 to 0.1.

步骤S4406,当所述第一差值在所述预设范围内时,识别所述第一包裹图像中的所述第一包裹中容纳的第一物品的数量和所述第二包裹图像中的所述第二包裹中容纳的第二物品的数量。如图5所示,识别到第一物品数量为2,第二物品数量为2。Step S4406, when the first difference is within the preset range, identify the quantity of the first item contained in the first package in the first package image and the number of items in the second package image. The quantity of the second item contained in the second package. As shown in FIG. 5 , it is recognized that the quantity of the first item is 2, and the quantity of the second item is 2.

步骤S4407,当所述第一物品的数量和所述第二物品的数量相等时,确定所述第一包裹中容纳的所述第一物品的种类以得到第一种类集合,以及,确定所述第二包裹中容纳的所述第二物品的种类以得到第二种类集合。如图5所示,确定第一种类集合为{刀,液体},确定第二种类集合为{刀,液体}。Step S4407, when the quantity of the first item and the quantity of the second item are equal, determine the type of the first item contained in the first package to obtain a first type set, and determine the The category of the second item contained in the second package to obtain a second category set. As shown in FIG. 5 , the first type set is determined to be {knife, liquid}, and the second type set is determined to be {knife, liquid}.

步骤S4408,当所述第一种类集合与所述第二种类集合相同时,确定所述第一物品与所述第二物品之间的对应关系,计算每个所述第二物品的尺寸与对应的所述第一物品的尺寸的比值,得到多个物品尺寸比值。本实施例中,选择物品对应目标框的宽度作为物品尺寸的度量。可以理解,目标框宽度是指包括目标的矩形框的短边长度。如图5所示,在第一帧检测图像中,刀的目标框的宽度为1CM,液体的目标框的宽度为2CM;第n帧检测图像中,刀的目标框的宽度为1.822CM,液体的目标框的宽度为3.643CM。分别计算得到两个物品尺寸比值为:1.822,1.8215。Step S4408, when the first category set is the same as the second category set, determine the correspondence between the first item and the second item, and calculate the size and correspondence of each second item. The ratio of the size of the first item to obtain a plurality of item size ratios. In this embodiment, the width of the target frame corresponding to the item is selected as the measure of the size of the item. It can be understood that the width of the target frame refers to the length of the short side of the rectangular frame including the target. As shown in Figure 5, in the first frame detection image, the width of the target frame of the knife is 1CM, and the width of the target frame of the liquid is 2CM; The width of the target box is 3.643CM. The size ratios of the two items are calculated separately: 1.822, 1.8215.

步骤S4409,确定所述图像显示比例与每个所述物品尺寸比值的第二差值,当所述第二差值均在预设数值范围内时,判断所述第一包裹与所述第二包裹相同。当所述第二差值至少一个在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同;而当所述第二差值均在预设数值范围内时,则判断所述第一包裹与所述第二包裹相同。通过计算,确定本实施例中对应的两个第二差值分别为:-0.022,-0.0215,可见两个第二差值均在预设范围内,此时判断第一包裹和第二包裹相同。Step S4409: Determine the second difference between the image display ratio and the size ratio of each item, and when the second difference is within a preset value range, determine the first package and the second The package is the same. When at least one of the second differences is outside the preset value range, it is determined that the first package is different from the second package; and when the second difference values are both within the preset value range, then It is judged that the first package is the same as the second package. Through calculation, it is determined that the corresponding two second differences in this embodiment are: -0.022, -0.0215 respectively. It can be seen that the two second differences are both within the preset range. At this time, it is judged that the first package and the second package are the same .

需要说明的是,在上述流程中或者附图的流程图中示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that the steps shown in the above flow or the flow chart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical sequence is shown in the flow chart, in the In some cases, steps shown or described may be performed in an order different from that herein.

本实施例还提供了一种包裹图像识别装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”、“单元”、“子单元”等可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a package image recognition device, which is used to implement the above-mentioned embodiments and preferred implementations, which have been described and will not be repeated. As used below, the terms "module," "unit," "subunit," etc. may be a combination of software and/or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.

图6是根据本申请实施例的包裹图像识别装置的结构框图,如图6所示,该装置包括:图像显示比例确定模块20,包裹尺寸比值计算模块30和包裹图像识别模块40。FIG. 6 is a structural block diagram of a package image recognition device according to an embodiment of the present application. As shown in FIG. 6 , the device includes an image display ratio determination module 20 , a package size ratio calculation module 30 and a package image recognition module 40 .

所述图像显示比例确定模块20,用于获取待识别的第一包裹图像和第二包裹图像,确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例;The image display ratio determination module 20 is configured to acquire the first package image and the second package image to be identified, and determine the image display ratio between the second package image and the first package image;

所述包裹尺寸比值计算模块30,用于获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值;The package size ratio calculation module 30 is configured to obtain the size of the first package in the first package image and the size of the second package in the second package image, and calculate the size of the second package and the first package. The ratio of the size of a package to get the package size ratio;

所述包裹图像识别模块40,用于确定所述图像显示比例与所述包裹尺寸比值的第一差值,当所述第一差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。The package image recognition module 40 is configured to determine the first difference between the image display ratio and the package size ratio, and when the first difference is outside the preset value range, determine that the first package is different from the package size. The second package is not the same.

需要说明的是,上述各个模块可以是功能模块也可以是程序模块,既可以通过软件来实现,也可以通过硬件来实现。对于通过硬件来实现的模块而言,上述各个模块可以位于同一处理器中;或者上述各个模块还可以按照任意组合的形式分别位于不同的处理器中。It should be noted that each of the above modules may be functional modules or program modules, and may be implemented by software or hardware. For the modules implemented by hardware, the above-mentioned modules may be located in the same processor; or the above-mentioned modules may also be located in different processors in any combination.

本实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。This embodiment also provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the above-mentioned electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the above-mentioned processor, and the input-output device is connected to the above-mentioned processor.

可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through a computer program:

获取待识别的第一包裹图像和第二包裹图像,确定所述第二包裹图像和所述第一包裹图像之间的图像显示比例;acquiring the first package image and the second package image to be identified, and determining the image display ratio between the second package image and the first package image;

获取所述第一包裹图像中第一包裹的尺寸和所述第二包裹图像中第二包裹的尺寸,计算所述第二包裹的尺寸与所述第一包裹的尺寸的比值,得到包裹尺寸比值;Obtain the size of the first package in the first package image and the size of the second package in the second package image, calculate the ratio of the size of the second package to the size of the first package, and obtain the package size ratio ;

确定所述图像显示比例与所述包裹尺寸比值的第一差值,当所述第一差值在预设数值范围外时,判断所述第一包裹与所述第二包裹不相同。A first difference between the image display ratio and the package size ratio is determined, and when the first difference is outside a preset value range, it is determined that the first package is different from the second package.

需要说明的是,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。It should be noted that, for specific examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and optional implementation manners, and details are not described herein again in this embodiment.

另外,结合上述实施例中的包裹图像识别方法,本申请实施例可提供一种存储介质来实现。该存储介质上存储有计算机程序;该计算机程序被处理器执行时实现上述实施例中的任意一种包裹图像识别方法。In addition, in combination with the package image recognition method in the above embodiment, the embodiment of the present application may provide a storage medium for implementation. A computer program is stored on the storage medium; when the computer program is executed by the processor, any one of the package image recognition methods in the foregoing embodiments is implemented.

本领域的技术人员应该明白,以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。Those skilled in the art should understand that the technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features of the above-described embodiments are not described. There is no contradiction in the combination of technical features, and it should be regarded as the scope of the description in this specification.

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

Claims (10)

1. A parcel image identification method is characterized by comprising the following steps:
acquiring a first package image and a second package image to be identified, and determining an image display proportion between the second package image and the first package image;
acquiring the size of a first parcel in the first parcel image and the size of a second parcel in the second parcel image, and calculating the ratio of the size of the second parcel to the size of the first parcel to obtain a parcel size ratio;
and determining a first difference value of the image display proportion and the parcel size ratio, and judging that the first parcel is different from the second parcel when the first difference value is out of a preset numerical range.
2. The parcel image recognition method of claim 1, wherein the determining an image display scale between the second parcel image and the first parcel image comprises:
acquiring a first image display coefficient in the first package image and a second image display coefficient in the second package image;
and calculating the ratio of the second image display coefficient to the first image display coefficient to obtain the image display scale.
3. The parcel image recognition method of claim 1 or 2, further comprising:
identifying a number of first items contained in the first parcel image and a number of second items contained in the second parcel image when the first difference value is within a preset range of values;
when the number of the first articles is not equal to that of the second articles, the first package and the second package are judged to be different.
4. The parcel image identification method of claim 3, further comprising:
determining a category of the first item contained in the first parcel to yield a first set of categories and determining a category of the second item contained in the second parcel to yield a second set of categories when the number of the first item and the number of the second item are equal;
when the first category set is different from the second category set, determining that the first parcel is different from the second parcel.
5. The parcel image identification method of claim 4, further comprising:
when the first kind set is the same as the second kind set, determining the corresponding relation between the first article and the second article, and calculating the ratio of the size of each second article to the size of the corresponding first article to obtain a plurality of article size ratios;
and determining a second difference value between the image display proportion and the size ratio of each article, and judging that the first package is different from the second package when at least one second difference value is out of a preset numerical range.
6. The parcel image recognition method of claim 5, wherein the determining a correspondence between the first item and the second item comprises:
determining a first position of each of the first items in the first parcel image and a second position of each of the second items in the second parcel image, the correspondence between the first and second items being determined in dependence on the first and second positions; and/or the presence of a gas in the gas,
and determining the corresponding relation between the first article and the second article according to the size of the first article and the size of the second article.
7. The parcel image recognition method according to claim 1 or 2, wherein the preset numerical value range is-0.1 to 0.1.
8. The parcel image recognition device is characterized by comprising an image display ratio determining module, a parcel size ratio calculating module and a parcel image recognition module, wherein the parcel size ratio calculating module comprises:
the image display proportion determining module is used for acquiring a first parcel image and a second parcel image to be identified and determining the image display proportion between the second parcel image and the first parcel image;
the parcel size ratio calculation module is configured to obtain a size of a first parcel in the first parcel image and a size of a second parcel in the second parcel image, and calculate a ratio of the size of the second parcel to the size of the first parcel to obtain a parcel size ratio;
the parcel image identification module is configured to determine a first difference between the image display ratio and the parcel size ratio, and when the first difference is outside a preset value range, determine that the first parcel is different from the second parcel.
9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the package image recognition method of any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, wherein the computer program is configured to execute the package image recognition method according to any one of claims 1 to 7 when the computer program is executed.
CN202210218670.5A 2022-03-02 2022-03-02 Package image recognition method, device, electronic device and storage medium Active CN114708524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210218670.5A CN114708524B (en) 2022-03-02 2022-03-02 Package image recognition method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210218670.5A CN114708524B (en) 2022-03-02 2022-03-02 Package image recognition method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114708524A true CN114708524A (en) 2022-07-05
CN114708524B CN114708524B (en) 2025-04-25

Family

ID=82169407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210218670.5A Active CN114708524B (en) 2022-03-02 2022-03-02 Package image recognition method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114708524B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013073606A (en) * 2011-09-29 2013-04-22 Dainippon Printing Co Ltd Individual identification device, individual identification method and program
CN104616321A (en) * 2015-02-09 2015-05-13 公安部第一研究所 Method for describing movement behavior of luggage image based on constant dimension and variable characteristics
CN108985196A (en) * 2018-06-29 2018-12-11 深圳市华讯方舟太赫兹科技有限公司 Evaluate method, terminal and the device with store function of the accuracy of safety check instrument
CN109829362A (en) * 2018-12-18 2019-05-31 深圳壹账通智能科技有限公司 Safety check aided analysis method, device, computer equipment and storage medium
CN110222728A (en) * 2019-05-15 2019-09-10 图灵深视(南京)科技有限公司 The training method of article discrimination model, system and article discrimination method, equipment
US20210192776A1 (en) * 2019-12-23 2021-06-24 Sensetime International Pte. Ltd. Method, system and apparatus for associating a target object in images
CN113391776A (en) * 2021-05-24 2021-09-14 浙江大华技术股份有限公司 Article information display method, article information display device, electronic device, and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013073606A (en) * 2011-09-29 2013-04-22 Dainippon Printing Co Ltd Individual identification device, individual identification method and program
CN104616321A (en) * 2015-02-09 2015-05-13 公安部第一研究所 Method for describing movement behavior of luggage image based on constant dimension and variable characteristics
CN108985196A (en) * 2018-06-29 2018-12-11 深圳市华讯方舟太赫兹科技有限公司 Evaluate method, terminal and the device with store function of the accuracy of safety check instrument
CN109829362A (en) * 2018-12-18 2019-05-31 深圳壹账通智能科技有限公司 Safety check aided analysis method, device, computer equipment and storage medium
CN110222728A (en) * 2019-05-15 2019-09-10 图灵深视(南京)科技有限公司 The training method of article discrimination model, system and article discrimination method, equipment
US20210192776A1 (en) * 2019-12-23 2021-06-24 Sensetime International Pte. Ltd. Method, system and apparatus for associating a target object in images
CN113391776A (en) * 2021-05-24 2021-09-14 浙江大华技术股份有限公司 Article information display method, article information display device, electronic device, and storage medium

Also Published As

Publication number Publication date
CN114708524B (en) 2025-04-25

Similar Documents

Publication Publication Date Title
EP3296975A1 (en) Collection and provision method, device, system and server for vehicle image data
KR20120001285A (en) Product classification search and shopping information provision service method, server and system through object recognition
CN112906750B (en) Hyperspectral image-based material analysis method and system
CN110475124A (en) Video cardton detection method and device
CN108171191A (en) For detecting the method and apparatus of face
CN113792725B (en) Component detection device and method
CN116109635B (en) Method, device, equipment and medium for detecting surface quality of composite suspension insulator
CN113391776B (en) Method, device, electronic device and storage medium for displaying article information
CN109784793A (en) Warehousing method, device, equipment and machine readable medium
CN106817677A (en) A kind of indoor objects information identifying method, apparatus and system based on multisensor
CN111078924A (en) Image retrieval method, device, terminal and storage medium
CN113978987B (en) Pallet object packaging and picking method, device, equipment and medium
CN112414326A (en) Method and device for detecting surface flatness of object, electronic device and storage medium
CN108745956A (en) Glass dropping fraction location detecting apparatus and method, computer readable storage medium
CN114581419A (en) Transformer insulating sleeve defect detection method, related equipment and readable storage medium
CN109325539A (en) Insulator falls crosstalk detecting method and device
CN109842851B (en) Storage article real-time positioning method and storage article positioning system
CN114708524A (en) Parcel image recognition method and device, electronic device and storage medium
CN105096350A (en) Image detection method and device
CN112985518B (en) Intelligent temperature and humidity monitoring method and device based on Internet of things
CN108305460A (en) A kind of method and terminal of identification overloaded vehicle
CN110135422B (en) Dense target detection method and device
WO2024094127A1 (en) Parameter tuning method and apparatus, and computer device and storage medium
CN118038151A (en) Wafer defect classification detection method, system, electronic equipment and storage medium
CN115147752A (en) Video analysis method and device and computer equipment

Legal Events

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