CN112115292A - Image search method and device, storage medium, and electronic device - Google Patents
Image search method and device, storage medium, and electronic device Download PDFInfo
- Publication number
- CN112115292A CN112115292A CN202011025293.0A CN202011025293A CN112115292A CN 112115292 A CN112115292 A CN 112115292A CN 202011025293 A CN202011025293 A CN 202011025293A CN 112115292 A CN112115292 A CN 112115292A
- Authority
- CN
- China
- Prior art keywords
- hash code
- picture
- searched
- value
- hash
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000004422 calculation algorithm Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 15
- 230000000007 visual effect Effects 0.000 claims description 12
- 238000007781 pre-processing Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 abstract description 21
- 239000000463 material Substances 0.000 abstract description 12
- 238000013136 deep learning model Methods 0.000 abstract description 4
- 238000004364 calculation method Methods 0.000 abstract description 3
- 238000012545 processing Methods 0.000 description 11
- 230000009466 transformation Effects 0.000 description 8
- 238000013135 deep learning Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 230000000052 comparative effect Effects 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/583—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T9/00—Image coding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Library & Information Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
技术领域technical field
本发明涉及通信领域,具体而言,涉及一种图片搜索方法及装置、存储介质、电子装置。The present invention relates to the field of communications, and in particular, to a picture search method and device, a storage medium, and an electronic device.
背景技术Background technique
随着科学技术的进步和人工智能的发展,智能算法也越来越多的应用到日常生活中,特别是对于电视而言,作为使用频率较高的日常家电之一,其智能化发展是至关重要的,而智能化的最关键问题,就在于对日常生活提供便利。With the advancement of science and technology and the development of artificial intelligence, more and more intelligent algorithms are applied in daily life, especially for TV, as one of the daily household appliances with high frequency, its intelligent development is the most important The most important thing, and the most critical issue of intelligence, is to provide convenience for daily life.
现有技术采用深度学习算法实现图片搜索(例如,可以对两个图片中的衣物进行检测),根据检测结果,提取目标深度学习特征,并在搜索库中检索,得到相似度最大值的作为搜索结果输出。这类算法由于使用深度学习算法,采用云端GPU部署方案,对算力要求较高,对网络依赖较大,而且在训练时需要采集海量数据集,并需要对数据集进行人工标注,耗费大量的人力物力。In the prior art, a deep learning algorithm is used to realize image search (for example, clothing in two pictures can be detected), and according to the detection results, the target deep learning feature is extracted, and retrieved in the search database, and the one with the maximum similarity is obtained as the search result. result output. Due to the use of deep learning algorithms and cloud GPU deployment solutions, this type of algorithm requires high computing power and relies heavily on the network. In addition, it needs to collect massive data sets during training and manually label the data sets, which consumes a lot of time. Human and material resources.
针对相关技术中,采用深度学习模型对图片进行搜索的过程,存在算力要求高,耗费人力物力等问题,尚未提出有效的解决方案。In the related art, the process of using a deep learning model to search for pictures has problems such as high computing power requirements, manpower and material resources, and no effective solution has yet been proposed.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种图片搜索方法及装置、存储介质、电子装置,以解决了采用深度学习模型对图片进行搜索的过程,存在算力要求高,耗费人力物力等问题。Embodiments of the present invention provide a picture search method and device, a storage medium, and an electronic device, so as to solve the problems of high computing power requirements, manpower and material resources in the process of using a deep learning model to search for pictures.
根据本发明的一个可选实施例,提供了一种图片搜索方法,包括:获取待搜索图片的第一显著性区域,并对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。According to an optional embodiment of the present invention, a picture search method is provided, comprising: acquiring a first salient region of a picture to be searched, and performing hash coding on the first salient region to determine the first salient region. A hash code value of a saliency area; according to the hash code value, a target image matching the to-be-searched image is searched in a pre-established database, wherein a plurality of images are stored in the database.
可选的,根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,包括:获取所述第一显著性区域的哈希编码值,以及所述数据库中的多个第二显著性区域的多个哈希编码值,其中,所述数据库中的多个图片分别对应有多个第二显著性区域;根据所述第一显著性区域的哈希编码值与所述多个哈希编码值的多个比较结果查找所述目标图片。Optionally, searching for a target picture matching the to-be-searched picture in a pre-established database according to the hash code value includes: acquiring the hash code value of the first saliency region, and storing the data in the database. A plurality of hash code values of a plurality of second salience regions, wherein, a plurality of pictures in the database respectively correspond to a plurality of second salience regions; according to the hash code values of the first salience regions The target picture is searched for a plurality of comparison results with the plurality of hash code values.
可选的,获取所述第一显著性区域的哈希编码值,以及所述数据库中的多个第二显著性区域的多个哈希编码值,包括:对所述第一显著性区域和所述多个图片的第二显著性区域按照相同规则进行划分,分别得到多个块区域;获取所述第一显著性区域的多个块区域所分别对应的第一哈希编码值,以及所述第二显著性区域的多个块区域所分别对应的第二哈希编码值。Optionally, acquiring the hash code value of the first salience area and the multiple hash code values of multiple second salience areas in the database includes: comparing the first salience area and the The second salient regions of the plurality of pictures are divided according to the same rule, and a plurality of block regions are obtained respectively; the first hash code values corresponding to the plurality of block regions of the first salience region are obtained, and the second hash code values corresponding to the plurality of block regions of the second salience region respectively.
可选的,根据所述第一显著性区域的哈希编码值与所述多个哈希编码值的比较结果在预先建立的数据库中进行查找所述待搜索图片匹配的目标图片之前,所述方法还包括:依次比较所述第一哈希编码值,以及每个第二显著性区域的第二哈希编码值,得到多个比较结果,其中,在比较结果指示哈希编码值相同的情况下,将哈希编码值相同的块区域的像素值设置为第一值,在比较结果指示哈希编码值不同的情况下,将哈希编码值不同的块区域的像素值设置为第二值。Optionally, before searching for a target picture matching the to-be-searched picture in a pre-established database according to a comparison result between the hash code value of the first salient region and the plurality of hash code values, the The method further includes: sequentially comparing the first hash code value and the second hash code value of each second salience region to obtain a plurality of comparison results, wherein the comparison results indicate that the hash code values are the same , set the pixel value of the block area with the same hash code value as the first value, and if the comparison result indicates that the hash code value is different, set the pixel value of the block area with different hash code value as the second value .
可选的,根据所述第一显著性区域的哈希编码值与所述多个哈希编码值的多个比较结果在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,包括:根据所述多个比较结果确定多个对比特征图,其中,所述对比特征图在对应块区域的位置上设置有与块区域对应的值,与块区域对应的值至少包括以下之一:所述第一值,所述第二值;根据所述多个对比特征图确定所述目标图片。Optionally, searching for a target picture that matches the to-be-searched picture in a pre-established database according to multiple comparison results between the hash code value of the first salient region and the plurality of hash code values, including: : determine a plurality of comparison feature maps according to the multiple comparison results, wherein the comparison feature maps are provided with values corresponding to the block regions at positions corresponding to the block regions, and the values corresponding to the block regions include at least one of the following: the first value, the second value; the target picture is determined according to the multiple comparison feature maps.
可选的,根据所述多个对比特征图确定所述目标图片,包括:从所述多个对比特征图中确定第一值的数量最多的目标对比特征图;将所述目标对比特征图对应的图片作为与所述待搜索图片匹配的目标图片。Optionally, determining the target picture according to the multiple comparison feature maps includes: determining the target comparison feature map with the largest number of first values from the multiple comparison feature maps; The picture is used as the target picture matching the to-be-searched picture.
可选的,获取待搜索图片的第一显著性区域,包括:对所述待搜索图片进行预处理;根据视觉注意算法对预处理后的待搜索图片进行处理,以确定所述待搜索图片的第一显著性区域。Optionally, acquiring the first saliency area of the picture to be searched includes: preprocessing the picture to be searched; processing the preprocessed picture to be searched according to a visual attention algorithm to determine the first salient region.
根据本发明的另一个可选实施例,还提供了一种图片搜索装置,包括:获取模块,用于获取待搜索图片的第一显著性区域;哈希编码模块,用于对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;查找模块,用于根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。According to another optional embodiment of the present invention, there is also provided a picture search apparatus, including: an acquisition module for acquiring a first saliency region of a picture to be searched; a hash coding module for The saliency area is hash-coded to determine the hash code value of the first salience area; the search module is used to search for the image matching the to-be-searched picture in the pre-established database according to the hash code value The target picture, wherein, the database stores multiple pictures.
根据本发明的又一个实施例,还提供了一种计算机可读的存储介质,所述计算机可读的存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, there is also provided a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute any one of the above when running steps in a method embodiment.
根据本发明的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。According to yet another embodiment of the present invention, there is also provided an electronic device comprising a memory and a processor, wherein the memory stores a computer program, the processor is configured to run the computer program to execute any of the above Steps in Method Examples.
通过本发明,获取待搜索图片的第一显著性区域,并对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片。即先确定图片的显著性区域,确定显著性区域的哈希编码值,进而通过根据哈编码查找到与待搜索的图片最匹配的目标图片,采用上述技术方案,解决了相关技术中采用深度学习模型对图片进行搜索的过程,存在算力要求高,耗费人力物力等问题。进而在图片搜索中,提高搜索速度和准确率,无需较大的算力要求,不用浪费很多人力物力。Through the present invention, the first salient region of the picture to be searched is obtained, and the first salient region is hash-coded to determine the hash coding value of the first salient region; according to the hash coding The value searches a pre-established database for a target picture that matches the picture to be searched. That is, first determine the saliency area of the picture, determine the hash code value of the salient area, and then find the target image that best matches the image to be searched according to the hash code, and adopt the above technical solution to solve the problem of using deep learning in the related art. The process of the model searching for pictures has problems such as high computing power requirements and labor and material resources. Furthermore, in the image search, the speed and accuracy of the search are improved without the need for large computing power requirements and without wasting a lot of manpower and material resources.
附图说明Description of drawings
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described herein are used to provide further understanding of the present invention and constitute a part of the present application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the attached image:
图1是本发明实施例的一种图片搜索方法的计算机终端的硬件结构框图;Fig. 1 is the hardware structure block diagram of the computer terminal of a kind of picture search method of the embodiment of the present invention;
图2是根据本发明实施例的图片搜索方法的流程图;2 is a flowchart of a picture search method according to an embodiment of the present invention;
图3为根据本发明可选实施例的图片搜索方法的流程示意图;3 is a schematic flowchart of a picture search method according to an optional embodiment of the present invention;
图4是根据本发明实施例的另一种图片搜索装置的结构框图。FIG. 4 is a structural block diagram of another image search apparatus according to an embodiment of the present invention.
具体实施方式Detailed ways
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present invention will be described in detail with reference to the accompanying drawings and in conjunction with embodiments. It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict.
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second" and the like in the description and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence.
本申请实施例所提供的方法实施例可以在计算机终端,或者类似的运算装置中执行。以运行在计算机终端上为例,图1是本发明实施例的一种图片搜索方法的计算机终端的硬件结构框图。如图1所示,计算机终端可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,在一个示例性实施例中,上述计算机终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述计算机终端的结构造成限定。例如,计算机终端还可包括比图1中所示更多或者更少的组件,或者具有与图1所示等同功能或比图1所示功能更多的不同的配置。The method embodiments provided in the embodiments of the present application may be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, FIG. 1 is a block diagram of a hardware structure of a computer terminal of a picture search method according to an embodiment of the present invention. As shown in FIG. 1 , the computer 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, etc.) As well as the memory 104 for storing data, in an exemplary embodiment, the above-mentioned computer terminal may also include a
存储器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 computer programs corresponding to the image search method in the embodiment of the present invention. A functional application and data processing are implemented, namely, the above-mentioned method is implemented. 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, which may be connected to a computer 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 means 106 are used to receive or transmit data via a network. The specific example of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal. In one example, the
在本实施例中提供了一种图片搜索方法,应用于上述计算机终端,图2是根据本发明实施例的图片搜索方法的流程图,该流程包括如下步骤:This embodiment provides a picture search method, which is applied to the above-mentioned computer terminal. FIG. 2 is a flowchart of a picture search method according to an embodiment of the present invention, and the process includes the following steps:
步骤S202,用于获取待搜索图片的第一显著性区域;Step S202, for obtaining the first saliency area of the picture to be searched;
步骤S204,用于对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;Step S204, for performing hash coding on the first significant area to determine the hash code value of the first significant area;
步骤S206,用于根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。Step S206 , for searching for a target picture matching the to-be-searched picture in a pre-established database according to the hash code value, wherein a plurality of pictures are stored in the database.
通过本发明,获取待搜索图片的第一显著性区域,并对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片。即先确定图片的显著性区域,确定显著性区域的哈希编码值,进而通过根据哈编码查找到与待搜索的图片最匹配的目标图片,采用上述技术方案,解决了相关技术中采用深度学习模型对图片进行搜索的过程,存在算力要求高,耗费人力物力等问题。进而在图片搜索中,提高搜索速度和准确率,无需较大的算力要求,不用浪费很多人力物力。Through the present invention, the first salient region of the picture to be searched is obtained, and the first salient region is hash-coded to determine the hash coding value of the first salient region; according to the hash coding The value searches a pre-established database for a target picture that matches the picture to be searched. That is, first determine the saliency area of the picture, determine the hash code value of the salient area, and then find the target image that best matches the image to be searched according to the hash code, and adopt the above technical solution to solve the problem of using deep learning in the related art. The process of the model searching for pictures has problems such as high computing power requirements and labor and material resources. Furthermore, in the image search, the speed and accuracy of the search are improved without the need for large computing power requirements and without wasting a lot of manpower and material resources.
上述步骤S202中用于获取待搜索图片的第一显著性区域的实现方式有多种,在一个可选实施例中:对所述待搜索图片进行预处理;根据视觉注意算法对预处理后的待搜索图片进行处理,以确定所述待搜索图片的第一显著性区域。In the above step S202, there are various implementations for obtaining the first saliency region of the picture to be searched. In an optional embodiment, the picture to be searched is preprocessed; The picture to be searched is processed to determine the first saliency area of the picture to be searched.
更具体地,预处理过程可以包括将搜索库图片进行去噪及灰度变换等预处理,确定图片中的显著性区域的就技术方案可以用视觉注意算法来实现。视觉注意算法进行显著区域检测的具体实现过程包括:More specifically, the preprocessing process may include performing preprocessing such as denoising and grayscale transformation on the search library image, and the technical solution for determining the salient area in the image may be implemented by a visual attention algorithm. The specific implementation process of visual attention algorithm for salient region detection includes:
1、对预处理后的图像进行图像金字塔处理,得到6张不同尺度的图像;1. Perform image pyramid processing on the preprocessed images to obtain 6 images of different scales;
2、分别对6张图像进行DCT变换,对变换后的图像用sign函数进行归一化处理;2. Perform DCT transformation on the 6 images respectively, and normalize the transformed images with the sign function;
3、对处理后的图像用离散余弦变化(Discrete Cosine Transform,简称为DCT)逆变换,并对各尺度图像加权相加得到显著图;3. Inverse transform the processed image with Discrete Cosine Transform (referred to as DCT), and add weighted images of each scale to obtain a saliency map;
4、对显著图用OSTU算法得到分割后的图像,用连通域方法得到目标区域,并得到目标外接矩形框,即为显著性区域。4. Use the OSTU algorithm to obtain the segmented image for the saliency map, use the connected domain method to obtain the target area, and obtain the target bounding rectangle, which is the saliency area.
需要说明的是,对图像的检索可以是任何图像,比如衣物,手机,小皮包等等。在确定了一个图像后,先对其做预处理,之后经过DCT变换与DCT逆变换,对各尺度图像加权相加得到显著图,其中,显著图中包括了显著性区域。对显著图用OSTU算法得到分割后的图像,用连通域方法得到目标区域,并得到目标外接矩形框。其中得到目标外接矩形框就是视觉检测到的显著性区域。It should be noted that the retrieval of the image can be any image, such as clothes, mobile phones, small bags and so on. After an image is determined, it is preprocessed first, and then DCT transform and DCT inverse transform are performed to obtain a saliency map by weighted addition of each scale image, wherein the saliency map includes saliency regions. For the saliency map, use the OSTU algorithm to obtain the segmented image, use the connected domain method to obtain the target area, and obtain the target bounding rectangle. The obtained target bounding rectangle is the saliency area detected by vision.
步骤S204中确定哈希编码值的方式也有可能多种,在一个可选实施例中,对视觉检测到的显著性区域进行分块处理,每块大小为8x8像素,对分块后的图片分别进行哈希编码,具体编码过程如下:第一步,将RGB图像转化为灰度图,并将图像转换为64级灰度。第二步,计算平均值。计算所有64个像素的灰度平均值。第三步,比较像素的灰度。将每个像素的灰度,与平均值进行比较。大于或等于平均值,记为1;小于平均值,记为0。第四步,哈希编码。将上一步的比较结果,组合在一起,就构成了一个64位的整数。就得到图片的哈希编码值,需要说明的是,上述像素值8x8仅作为一个可选的实现方式进行说明,但不用于限定本发明实施例的技术方案,实际实现过程中可以是任何像素值。There may also be various ways of determining the hash code value in step S204. In an optional embodiment, the visually detected saliency region is subjected to block processing, and the size of each block is 8×8 pixels. Perform hash encoding, and the specific encoding process is as follows: The first step is to convert the RGB image into a grayscale image, and convert the image to 64-level grayscale. The second step is to calculate the average. Calculate the grayscale average of all 64 pixels. The third step is to compare the grayscale of the pixels. Compare the grayscale of each pixel with the average. If it is greater than or equal to the average value, it is recorded as 1; if it is less than the average value, it is recorded as 0. The fourth step is hash coding. The comparison results of the previous step are combined together to form a 64-bit integer. As far as the hash code value of the picture is obtained, it should be noted that the above-mentioned pixel value of 8×8 is only described as an optional implementation manner, but is not used to limit the technical solution of the embodiment of the present invention, and any pixel value can be used in the actual implementation process. .
根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片的实现方案,在一个可选实施例中,可以是获取所述第一显著性区域的哈希编码值,以及所述数据库中的多个第二显著性区域的多个哈希编码值,其中,所述数据库中的多个图片分别对应有多个第二显著性区域;根据所述第一显著性区域的哈希编码值与所述多个哈希编码值的多个比较结果查找所述目标图片。The implementation scheme of searching for the target picture matching the to-be-searched picture in the pre-established database according to the hash code value, in an optional embodiment, it may be to obtain the hash code of the first saliency region value, and multiple hash code values of multiple second saliency regions in the database, wherein multiple pictures in the database respectively correspond to multiple second saliency regions; according to the first saliency region The target picture is searched for through the comparison results of the hash code value of the sex region and the plurality of hash code values.
即由于数据库中保存有多个图片,数据库中的每一个图片也都是要经过显著性区域的确定,以及哈希编码值的确定的,即根据待搜索图片的哈希编码值,以及数据库中多个图片的多个哈希编码值在数据库中查找与所述待搜索图片匹配的目标图片。That is, since there are multiple pictures stored in the database, each picture in the database is also subject to the determination of the salient region and the determination of the hash code value, that is, according to the hash code value of the image to be searched, and the value of the hash code in the database. The plurality of hash code values of the plurality of pictures searches the database for a target picture that matches the picture to be searched.
具体地,在获取所述第一显著性区域的哈希编码值,以及所述数据库中的多个第二显著性区域的多个哈希编码值还可以通过以下方式实现:对所述第一显著性区域和所述多个图片的第二显著性区域按照相同规则进行划分,分别得到多个块区域;获取所述第一显著性区域的多个块区域所分别对应的第一哈希编码值,以及所述第二显著性区域的多个块区域所分别对应的第二哈希编码值。其中对所述第一显著性区域和所述多个图片的第二显著性区域按照相同规则进行划分,这是根据视觉注意算法得到多个显著性区域,这样特征明显的在检索时便能及时发现。Specifically, obtaining the hash code value of the first saliency area and the multiple hash code values of multiple second salience areas in the database may also be implemented by the following manner: The saliency region and the second saliency regions of the plurality of pictures are divided according to the same rule to obtain a plurality of block regions respectively; the first hash codes corresponding to the plurality of block regions of the first salience region are obtained respectively value, and the second hash code values corresponding to the plurality of block regions of the second significant region respectively. The first saliency area and the second saliency area of the multiple pictures are divided according to the same rule, which is to obtain multiple saliency areas according to the visual attention algorithm, so that the obvious features can be retrieved in time. Find.
也就是说,通过视觉注意算法,可以到获取所述第一显著性区域的哈希编码值,以及所述数据库中的多个图片的第二显著性区域的多个哈希编码值,可以计算资源优先分配给那些容易引起观察者注意的区域,这样必将极大的提高现有的图像处理分析方法的工作效率。That is to say, through the visual attention algorithm, it is possible to obtain the hash code value of the first saliency region and the plurality of hash code values of the second saliency region of the plurality of pictures in the database, and can calculate The resources are preferentially allocated to those areas that are easy to attract the attention of the observer, which will greatly improve the work efficiency of the existing image processing and analysis methods.
需要说明的是在检索图片时,我们是根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片。也就是说我们并没有直接比较两张图片,比如在传统深度学习中我们采集大量数据和标注,通过模型的训练,最终是使模型去鉴别图像的。在本发明的基于视觉注意的图片搜索方法中,是通过哈希编码在特征库中的哈希编码进行特征比对,是两个编码的比较。所以不需要采集大量数据和标注,只需要对图像进行预处理,视觉注意算法处理,哈希编码提取特征值即可。It should be noted that when retrieving a picture, we search for a target picture matching the to-be-searched picture in a pre-established database according to the hash code value. That is to say, we do not directly compare the two images. For example, in traditional deep learning, we collect a large amount of data and annotations, and through the training of the model, the model is finally used to identify the image. In the image search method based on visual attention of the present invention, the feature comparison is performed through the hash code in the feature database, which is a comparison of two codes. Therefore, there is no need to collect a large amount of data and annotations, and only need to preprocess the image, process the visual attention algorithm, and extract the feature value by hash coding.
根据所述第一显著性区域的哈希编码值与所述多个哈希编码值的比较结果在预先建立的数据库中进行查找所述待搜索图片匹配的目标图片之前,依次比较所述第一哈希编码值,以及每个第二显著性区域的第二哈希编码值,得到多个比较结果,其中,在比较结果指示哈希编码值相同的情况下,将哈希编码值相同的块区域的像素值设置为第一值,在比较结果指示哈希编码值不同的情况下,将哈希编码值不同的块区域的像素值设置为第二值。According to the comparison result of the hash code value of the first saliency region and the plurality of hash code values, before searching for the target image matching the to-be-searched image in the pre-established database, compare the first saliency area sequentially. The hash code value, and the second hash code value of each second salience region, obtain a plurality of comparison results, wherein, in the case where the comparison result indicates that the hash code value is the same, the block with the same hash code value is The pixel value of the area is set as the first value, and in the case where the comparison result indicates that the hash code value is different, the pixel value of the block area with the different hash code value is set as the second value.
也就是说,由于第一显著性区域和第二显著性区域都进行了区域划分,得到了多个块区域,直接比较块区域与块区域之间的哈希编码值,如果哈希编码相同,则将该部分块区域的像素值均设置为第一值,可选地,为255,如果哈希编码不相同,则将该部分块区域的像素值均设置为第二值,可选地,为0,将像素值为第一值或第二值的图可以理解为是一种对比特征图,即待搜索图片与每一个数据库里的图片都存在一个对比特征图,从多个对比特征图中就能够很清楚的确定与待搜索图片最相关的图片。That is to say, since both the first saliency region and the second saliency region are divided into regions, multiple block regions are obtained, and the hash code values between the block regions and the block regions are directly compared. If the hash codes are the same, Then, the pixel values of the partial block area are set to the first value, optionally, 255. If the hash codes are not the same, the pixel values of the partial block area are set to the second value. Optionally, If it is 0, the image with the pixel value of the first value or the second value can be understood as a comparative feature map, that is, there is a comparative feature map between the image to be searched and the image in each database, from multiple comparative feature maps. It can clearly determine the most relevant images to the images to be searched.
根据所述多个比较结果确定多个对比特征图,其中,所述对比特征图在对应块区域的位置上设置有与块区域对应的值,与块区域对应的值至少包括以下之一:所述第一值,所述第二值;根据所述多个对比特征图确定所述目标图片,进而从所述多个对比特征图中确定第一值的数量最多的目标对比特征图;将所述目标对比特征图对应的图片作为与所述待搜索图片匹配的目标图片。A plurality of comparison feature maps are determined according to the plurality of comparison results, wherein the comparison feature maps are provided with values corresponding to the block regions at positions corresponding to the block regions, and the values corresponding to the block regions include at least one of the following: the first value and the second value; determine the target picture according to the plurality of comparison feature maps, and then determine the target comparison feature map with the largest number of first values from the plurality of comparison feature maps; The picture corresponding to the target comparison feature map is used as the target picture matching the to-be-searched picture.
可以理解的是,由于将每个图片中的显著性区域都划分了多个块区域,通过在对比特征图中查找像素第一值的数量最多的对比特征图,所以从所述多个对比特征图中确定第一值的数量最多的目标对比特征既是搜索结果。It can be understood that, since the saliency region in each picture is divided into multiple block regions, the comparison feature map with the largest number of pixel first values is found in the comparison feature map, so from the multiple comparison features The target contrast feature with the largest number of determined first values in the figure is both the search result.
为了更好的理解上述技术方案,本发明可选实施例还提供了一种可选实施例,用于解释说明上述技术方案。In order to better understand the above technical solution, the optional embodiment of the present invention further provides an optional embodiment for explaining the above technical solution.
在一个可选实施例中,图3为根据本发明可选实施例的图片搜索方法的流程示意图,如图3所示,包括以下步骤:In an optional embodiment, FIG. 3 is a schematic flowchart of a picture search method according to an optional embodiment of the present invention, as shown in FIG. 3 , including the following steps:
步骤S302:搜索库图片;Step S302: search for library pictures;
步骤S304:将搜索库图片进行去噪及灰度变换等预处理;Step S304: perform preprocessing such as denoising and grayscale transformation on the image of the search library;
步骤S306:采用视觉注意算法对数据库中的图片进行处理。对预处理后的图像进行图像金字塔处理,得到6张不同尺度的图像;分别对6张图像进行DCT变换,对变换后的图像用sign函数进行归一化处理;3、对处理后的图像用DCT逆变换,并对各尺度图像加权相加得到显著图;对显著图用OSTU算法得到分割后的图像,用连通域方法得到目标区域,并得到目标外接矩形框,其中得到目标外接矩形框就是显著性区域;Step S306: Use the visual attention algorithm to process the pictures in the database. Perform image pyramid processing on the preprocessed images to obtain 6 images of different scales; perform DCT transformation on the 6 images respectively, and use the sign function to normalize the transformed images; 3. Inverse DCT transform, weighted addition of each scale image to obtain saliency map; use OSTU algorithm to obtain the segmented image of the saliency map, use the connected domain method to obtain the target area, and obtain the target bounding rectangle, where the obtained target bounding rectangle is significant area;
步骤S308:对显著性区域进行哈希特征提取,可以理解为是确定显著性区域确定哈希编码值的过程。对视觉检测到的显著性区域进行分块处理,每块大小为8x8像素,对分块后的图片分别进行哈希编码,具体编码过程如下:将RGB图像转化为灰度图,并将图像转换为64级灰度。计算平均值;计算所有64个像素的灰度平均值。比较像素的灰度。将每个像素的灰度,与平均值进行比较;大于或等于平均值,记为1;小于平均值,记为0;哈希编码。将上一步的比较结果,组合在一起,就构成了一个64位的整数;就得到图片的哈希编码;Step S308 : extracting the hash feature of the salient region, which can be understood as a process of determining the salient region and determining the hash code value. The visually detected saliency area is divided into blocks, each block is 8x8 pixels, and the divided pictures are hash-coded respectively. The specific coding process is as follows: convert the RGB image into a grayscale image, and convert the image 64 grayscale. Calculate the mean; calculate the grayscale mean of all 64 pixels. Compare the grayscale of pixels. Compare the gray level of each pixel with the average value; if it is greater than or equal to the average value, it is recorded as 1; if it is less than the average value, it is recorded as 0; hash code. Combine the comparison results of the previous step to form a 64-bit integer; get the hash code of the picture;
步骤S310:哈希索引库中的计算。比较拍摄前后分块后的两个小块图像的哈希编码,计算需要的参数,具体计算方法为:如果哈希编码相同则加1,把得到的结果除以哈希编码长度。当得到的参数大于设定的阈值时该小块所有像素值设置为255,小于设定阈值时该小块所有像素值设置为0,把所有小块按照分块顺序重新组合成图像,即得到对比特征图,将所有搜索库中的图像建立特征图检索库;Step S310: Calculation in the hash index library. Compare the hash codes of the two small-block images before and after shooting, and calculate the required parameters. The specific calculation method is: if the hash codes are the same, add 1, and divide the obtained result by the length of the hash code. When the obtained parameter is greater than the set threshold, set all pixel values of the small block to 255, and set all the pixel values of the small block to 0 when it is less than the set threshold, and recombine all the small blocks into an image according to the block order, that is, get Compare the feature maps, and build a feature map retrieval database for all the images in the search database;
步骤S312:提取待检索图片;Step S312: extract the picture to be retrieved;
步骤S314:将待检索图片进行去噪及灰度变换等预处理;Step S314: Perform preprocessing such as denoising and grayscale transformation on the image to be retrieved;
步骤S316:视觉注意算法。对预处理后的图像进行图像金字塔处理,得到6张不同尺度的图像;分别对6张图像进行DCT变换,对变换后的图像用sign函数进行归一化处理;3、对处理后的图像用DCT逆变换,并对各尺度图像加权相加得到显著图;对显著图用OSTU算法得到分割后的图像,用连通域方法得到目标区域,并得到目标外接矩形框,其中得到目标外接矩形框就是显著性区域;Step S316: Visual attention algorithm. Perform image pyramid processing on the preprocessed images to obtain 6 images of different scales; perform DCT transformation on the 6 images respectively, and use the sign function to normalize the transformed images; 3. Inverse DCT transform, weighted addition of each scale image to obtain saliency map; use OSTU algorithm to obtain the segmented image of the saliency map, use the connected domain method to obtain the target area, and obtain the target bounding rectangle, where the obtained target bounding rectangle is significant area;
步骤S318:哈希特征提取。对视觉检测到的显著性区域进行分块处理,每块大小为8x8像素,对分块后的图片分别进行哈希编码,具体编码过程如下:将RGB图像转化为灰度图,并将图像转换为64级灰度。计算平均值;计算所有64个像素的灰度平均值。比较像素的灰度。将每个像素的灰度,与平均值进行比较;大于或等于平均值,记为1;小于平均值,记为0;哈希编码。将上一步的比较结果,组合在一起,就构成了一个64位的整数;就得到图片的哈希编码;Step S318: Hash feature extraction. The visually detected saliency area is divided into blocks, each block is 8x8 pixels, and the divided pictures are hash-coded respectively. The specific coding process is as follows: convert the RGB image into a grayscale image, and convert the image 64 grayscale. Calculate the mean; calculate the grayscale mean of all 64 pixels. Compare the grayscale of pixels. Compare the gray level of each pixel with the average value; if it is greater than or equal to the average value, it is recorded as 1; if it is less than the average value, it is recorded as 0; hash code. Combine the comparison results of the previous step to form a 64-bit integer; get the hash code of the picture;
步骤S320:通过哈希编码在特征库中的哈希编码进行特征比对,输出结果。Step S320 : perform feature comparison through the hash code in the feature database by the hash code, and output the result.
需要说明的是,上述步骤的执行顺序并不是方案的实际操作流程,在实际操作过程中,很多步骤都可以是并行操作的,部分步骤的执行顺序也可以调换,本发明实施例对此不进行限定。It should be noted that the execution order of the above steps is not the actual operation flow of the solution. In the actual operation process, many steps may be operated in parallel, and the execution order of some steps may also be reversed, which is not performed in this embodiment of the present invention. limited.
通过本发明可选实施例的技术方案,首先对图像进行预处理,之后获取待搜索图片的第一显著性区域,并对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;然后根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片。从特征库中进行特征比对,找到相似度最高的图像即为检索结果图像。采用上述技术方案,解决了相关技术中采用深度学习模型对图片进行搜索的过程,存在算力要求高,耗费人力物力等问题。进而在图片搜索中,提高搜索速度和准确率,无需较大的算力要求,不用浪费很多人力物力。According to the technical solution of the optional embodiment of the present invention, the image is first preprocessed, then the first salient region of the picture to be searched is acquired, and hash coding is performed on the first salient region to determine the first salient region. The hash code value of the saliency region; and then according to the hash code value, a target picture matching the to-be-searched picture is searched in a pre-established database. The feature comparison is performed from the feature library, and the image with the highest similarity is found as the retrieval result image. By adopting the above technical solutions, the process of using a deep learning model to search for pictures in the related art, which has high requirements on computing power and consumes manpower and material resources, is solved. Furthermore, in the image search, the speed and accuracy of the search are improved without the need for large computing power requirements and without wasting a lot of manpower and material resources.
在本实施例中还提供了一种图片搜索装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a picture search apparatus is also provided, and the apparatus is used to implement the above-mentioned embodiments and preferred implementations, and the descriptions that have been described will not be repeated. As used below, the term "module" 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.
图4是根据本发明实施例的一种图片搜索装置的结构框图;如图4所示,包括:FIG. 4 is a structural block diagram of a picture search apparatus according to an embodiment of the present invention; as shown in FIG. 4 , it includes:
获取模块40,用于获取待搜索图片的第一显著性区域;an obtaining
哈希编码模块42,用于对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;A
查找模块44,用于根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。The
获取模块,用于获取待搜索图片的第一显著性区域,视觉注意算法进行显著区域检测的具体实现过程为:1、对预处理后的图像进行图像金字塔处理,得到6张不同尺度的图像;2、分别对6张图像进行DCT变换,对变换后的图像用sign函数进行归一化处理;3、对处理后的图像用DCT逆变换,并对各尺度图像加权相加得到显著图;4、对显著图用OSTU算法得到分割后的图像,用连通域方法得到目标区域,并得到目标外接矩形框。其中得到目标外接矩形框就是待搜索图片的第一显著性区域。The acquisition module is used to acquire the first salient area of the image to be searched. The specific implementation process of the visual attention algorithm for salient area detection is as follows: 1. Perform image pyramid processing on the preprocessed image to obtain 6 images of different scales; 2. Perform DCT transformation on the 6 images respectively, and use the sign function to normalize the transformed images; 3. Use DCT inverse transformation on the processed images, and add weighted images of each scale to obtain a saliency map; 4. , Use the OSTU algorithm to obtain the segmented image for the saliency map, use the connected domain method to obtain the target area, and obtain the target bounding rectangle. The obtained target bounding rectangle is the first saliency area of the image to be searched.
哈希编码模块,用于对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值。也即是哈希特征提取。哈希编码模块的具体实现过程为对视觉检测到的显著性区域进行分块处理,可选地,每块大小为8x8像素,对分块后的图片分别进行哈希编码,具体编码过程如下:将RGB图像转化为灰度图,并将图像转换为64级灰度。计算平均值;计算所有64个像素的灰度平均值。比较像素的灰度。将每个像素的灰度,与平均值进行比较;大于或等于平均值,记为1;小于平均值,记为0;哈希编码。将上一步的比较结果,组合在一起,就构成了一个64位的整数;就得到图片的哈希编码,需要说明的是哈希编码得到的64位的整数是对64个像素的编码,如果像素点越多则哈希编码得到的整数位数越多。A hash coding module, configured to perform hash coding on the first salience area to determine a hash code value of the first salience area. That is, hash feature extraction. The specific implementation process of the hash coding module is to perform block processing on the visually detected saliency area. Optionally, each block is 8×8 pixels in size, and hash coding is performed on the divided pictures respectively. The specific coding process is as follows: Convert the RGB image to grayscale and convert the image to 64 levels of grayscale. Calculate the mean; calculate the grayscale mean of all 64 pixels. Compare the grayscale of pixels. Compare the gray level of each pixel with the average value; if it is greater than or equal to the average value, it is recorded as 1; if it is less than the average value, it is recorded as 0; hash code. Combining the comparison results of the previous step together forms a 64-bit integer; the hash code of the picture is obtained. It should be noted that the 64-bit integer obtained by the hash code is the code for 64 pixels. If The more pixels, the more integer bits obtained by hash coding.
查找模块,用于根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。查找模块的具体方法是通过哈希编码在特征库中的哈希编码进行特征比对,是两个编码的比较。最终检索出我们需要的。A search module, configured to search for a target picture matching the to-be-searched picture in a pre-established database according to the hash code value, wherein a plurality of pictures are stored in the database. The specific method of finding the module is to compare the features through the hash code in the feature library, which is the comparison of the two codes. Finally retrieved what we needed.
需要说明的是图像检索是对特征部分的检索,如果检索图片在检索库中不存在,最后结果也会推荐特征部分类似的图片。It should be noted that image retrieval is the retrieval of feature parts. If the retrieved image does not exist in the retrieval database, the final result will also recommend images with similar feature parts.
通过上述技术方案,获取待搜索图片的第一显著性区域,并对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片。即先确定图片的显著性区域,确定显著性区域的哈希编码值,进而通过根据哈编码查找到与待搜索的图片最匹配的目标图片,采用上述技术方案,解决了相关技术中采用深度学习模型对图片进行搜索的过程,存在算力要求高,耗费人力物力等问题。进而在图片搜索中,提高搜索速度和准确率,无需较大的算力要求,不用浪费很多人力物力。Through the above technical solution, the first salient region of the picture to be searched is obtained, and the first salient region is hash-coded to determine the hash coding value of the first salient region; according to the hash code The encoded value searches a pre-established database for a target picture that matches the picture to be searched. That is, first determine the saliency area of the picture, determine the hash code value of the salient area, and then find the target image that best matches the image to be searched according to the hash code, and adopt the above technical solution to solve the problem of using deep learning in the related art. The process of the model searching for pictures has problems such as high computing power requirements and labor and material resources. Furthermore, in the image search, the speed and accuracy of the search are improved without the need for large computing power requirements and without wasting a lot of manpower and material resources.
可选的,查找模块44还用于:获取所述第一显著性区域的哈希编码值,以及所述数据库中的多个第二显著性区域的多个哈希编码值,其中,所述数据库中的多个图片分别对应有多个第二显著性区域;根据所述第一显著性区域的哈希编码值与所述多个哈希编码值的多个比较结果查找所述目标图片。Optionally, the
可选的,哈希编码模块,还用于对所述第一显著性区域和所述多个图片的第二显著性区域按照相同规则进行划分,分别得到多个块区域;获取所述第一显著性区域的多个块区域所分别对应的第一哈希编码值,以及所述第二显著性区域的多个块区域所分别对应的第二哈希编码值。Optionally, the hash coding module is further configured to divide the first saliency region and the second saliency regions of the plurality of pictures according to the same rule, to obtain a plurality of block regions respectively; obtain the first saliency region; The first hash code values corresponding to the plurality of block regions of the saliency region respectively, and the second hash code values corresponding to the plurality of block regions of the second salience region respectively.
可选的,所述装置还包括:处理模块,用于依次比较所述第一哈希编码值,以及每个第二显著性区域的第二哈希编码值,得到多个比较结果,其中,在比较结果指示哈希编码值相同的情况下,将哈希编码值相同的块区域的像素值设置为第一值,在比较结果指示哈希编码值不同的情况下,将哈希编码值不同的块区域的像素值设置为第二值。Optionally, the apparatus further includes: a processing module configured to sequentially compare the first hash code value and the second hash code value of each second significant region to obtain multiple comparison results, wherein, If the comparison result indicates that the hash code values are the same, the pixel values of the block regions with the same hash code value are set as the first value, and if the comparison result indicates that the hash code values are different, the hash code values are different The pixel value of the block region is set to the second value.
可选的,查找模块44:还用于根据所述多个比较结果确定多个对比特征图,其中,所述对比特征图在对应块区域的位置上设置有与块区域对应的值,与块区域对应的值至少包括以下之一:所述第一值,所述第二值;根据所述多个对比特征图确定所述目标图片。Optionally, the
可选的,查找模块44:还用于:从所述多个对比特征图中确定第一值的数量最多的目标对比特征图;将所述目标对比特征图对应的图片作为与所述待搜索图片匹配的目标图片。Optionally, the
可选的,获取模块40,还用于获取待搜索图片的第一显著性区域,包括:对所述待搜索图片进行预处理;根据视觉注意算法对预处理后的待搜索图片进行处理,以确定所述待搜索图片的第一显著性区域。Optionally, the obtaining
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be implemented by software or hardware, and the latter can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
本发明的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。An embodiment of the present invention further provides a storage medium, where a computer program is stored in the storage medium, wherein the computer program is configured to execute the steps in any one of the above method embodiments when running.
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:Optionally, in this embodiment, the above-mentioned storage medium may be configured to store a computer program for executing the following steps:
S1,获取待搜索图片的第一显著性区域;S1, obtaining the first saliency area of the image to be searched;
S2,对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;S2, performing hash coding on the first significant area to determine a hash code value of the first significant area;
S3,根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。S3 , searching for a target picture matching the to-be-searched picture in a pre-established database according to the hash code value, where a plurality of pictures are stored in the database.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
本发明的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。An embodiment of the present invention also provides an electronic device, comprising 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:
S1,获取待搜索图片的第一显著性区域;S1, obtaining the first saliency area of the image to be searched;
S2,对所述第一显著性区域进行哈希编码,以确定所述第一显著性区域的哈希编码值;S2, performing hash coding on the first significant area to determine a hash code value of the first significant area;
S3,根据所述哈希编码值在预先建立的数据库中查找与所述待搜索图片匹配的目标图片,其中,所述数据库中保存有多个图片。S3 , searching for a target picture matching the to-be-searched picture in a pre-established database according to the hash code value, where a plurality of pictures are stored in the database.
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。Optionally, 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.
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device, or distributed in a network composed of multiple computing devices Alternatively, they may be implemented in program code executable by a computing device, such that they may be stored in a storage device and executed by the computing device, and in some cases, in a different order than here The steps shown or described are performed either by fabricating them separately into individual integrated circuit modules, or by fabricating multiple modules or steps of them into a single integrated circuit module. As such, the present invention is not limited to any particular combination of hardware and software.
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included within the protection scope of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011025293.0A CN112115292A (en) | 2020-09-25 | 2020-09-25 | Image search method and device, storage medium, and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011025293.0A CN112115292A (en) | 2020-09-25 | 2020-09-25 | Image search method and device, storage medium, and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112115292A true CN112115292A (en) | 2020-12-22 |
Family
ID=73796925
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011025293.0A Pending CN112115292A (en) | 2020-09-25 | 2020-09-25 | Image search method and device, storage medium, and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112115292A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905927A (en) * | 2021-03-19 | 2021-06-04 | 北京字节跳动网络技术有限公司 | Searching method, device, equipment and medium |
CN113343033A (en) * | 2021-06-29 | 2021-09-03 | 平安普惠企业管理有限公司 | Video searching method and device, computer equipment and storage medium |
CN113535117A (en) * | 2021-06-20 | 2021-10-22 | 奥比中光科技集团股份有限公司 | A data storage method, device and electronic device |
CN114710649A (en) * | 2022-06-01 | 2022-07-05 | 广东中浦科技有限公司 | Pollution source video monitoring method and system |
CN113535117B (en) * | 2021-06-20 | 2025-03-28 | 奥比中光科技集团股份有限公司 | Data storage method, device and electronic device |
Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102810160A (en) * | 2012-06-06 | 2012-12-05 | 北京京东世纪贸易有限公司 | Method and device for searching images |
CN102819582A (en) * | 2012-07-26 | 2012-12-12 | 华数传媒网络有限公司 | Quick searching method for mass images |
CN103996195A (en) * | 2014-05-26 | 2014-08-20 | 清华大学深圳研究生院 | Image saliency detection method |
CN104021220A (en) * | 2014-06-24 | 2014-09-03 | 中国科学院深圳先进技术研究院 | Image retrieval method based on significant model |
CN104021207A (en) * | 2014-06-18 | 2014-09-03 | 厦门美图之家科技有限公司 | Food information providing method based on image |
CN104200240A (en) * | 2014-09-24 | 2014-12-10 | 梁爽 | Sketch retrieval method based on content adaptive Hash encoding |
CN104240256A (en) * | 2014-09-25 | 2014-12-24 | 西安电子科技大学 | Image salient detecting method based on layering sparse modeling |
CN105005565A (en) * | 2014-04-18 | 2015-10-28 | 大连恒锐科技股份有限公司 | On-the-spot shoe sole trace pattern image retrieval method |
CN105574063A (en) * | 2015-08-24 | 2016-05-11 | 西安电子科技大学 | Image retrieval method based on visual saliency |
CN107145487A (en) * | 2016-03-01 | 2017-09-08 | 深圳中兴力维技术有限公司 | Image search method and device |
CN107239535A (en) * | 2017-05-31 | 2017-10-10 | 北京小米移动软件有限公司 | Similar pictures search method and device |
CN107506429A (en) * | 2017-08-22 | 2017-12-22 | 北京联合大学 | A kind of image rearrangement sequence method integrated based on marking area and similitude |
CN107730506A (en) * | 2017-07-21 | 2018-02-23 | 苏州大学 | Image partition method and image search method |
CN108038436A (en) * | 2017-12-05 | 2018-05-15 | 奕响(大连)科技有限公司 | A kind of similar decision method of local pixel gray scale picture |
CN108694411A (en) * | 2018-04-03 | 2018-10-23 | 南昌奇眸科技有限公司 | A method of identification similar image |
CN110263205A (en) * | 2019-06-06 | 2019-09-20 | 温州大学 | A kind of search method for ginseng image |
CN110297931A (en) * | 2019-04-23 | 2019-10-01 | 西北大学 | A kind of image search method |
CN110738236A (en) * | 2019-09-16 | 2020-01-31 | 深圳市国信合成科技有限公司 | Image matching method and device, computer equipment and storage medium |
-
2020
- 2020-09-25 CN CN202011025293.0A patent/CN112115292A/en active Pending
Patent Citations (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102810160A (en) * | 2012-06-06 | 2012-12-05 | 北京京东世纪贸易有限公司 | Method and device for searching images |
CN102819582A (en) * | 2012-07-26 | 2012-12-12 | 华数传媒网络有限公司 | Quick searching method for mass images |
CN105005565A (en) * | 2014-04-18 | 2015-10-28 | 大连恒锐科技股份有限公司 | On-the-spot shoe sole trace pattern image retrieval method |
CN103996195A (en) * | 2014-05-26 | 2014-08-20 | 清华大学深圳研究生院 | Image saliency detection method |
CN104021207A (en) * | 2014-06-18 | 2014-09-03 | 厦门美图之家科技有限公司 | Food information providing method based on image |
CN104021220A (en) * | 2014-06-24 | 2014-09-03 | 中国科学院深圳先进技术研究院 | Image retrieval method based on significant model |
CN104200240A (en) * | 2014-09-24 | 2014-12-10 | 梁爽 | Sketch retrieval method based on content adaptive Hash encoding |
CN104240256A (en) * | 2014-09-25 | 2014-12-24 | 西安电子科技大学 | Image salient detecting method based on layering sparse modeling |
CN105574063A (en) * | 2015-08-24 | 2016-05-11 | 西安电子科技大学 | Image retrieval method based on visual saliency |
CN107145487A (en) * | 2016-03-01 | 2017-09-08 | 深圳中兴力维技术有限公司 | Image search method and device |
CN107239535A (en) * | 2017-05-31 | 2017-10-10 | 北京小米移动软件有限公司 | Similar pictures search method and device |
CN107730506A (en) * | 2017-07-21 | 2018-02-23 | 苏州大学 | Image partition method and image search method |
CN107506429A (en) * | 2017-08-22 | 2017-12-22 | 北京联合大学 | A kind of image rearrangement sequence method integrated based on marking area and similitude |
CN108038436A (en) * | 2017-12-05 | 2018-05-15 | 奕响(大连)科技有限公司 | A kind of similar decision method of local pixel gray scale picture |
CN108694411A (en) * | 2018-04-03 | 2018-10-23 | 南昌奇眸科技有限公司 | A method of identification similar image |
CN110297931A (en) * | 2019-04-23 | 2019-10-01 | 西北大学 | A kind of image search method |
CN110263205A (en) * | 2019-06-06 | 2019-09-20 | 温州大学 | A kind of search method for ginseng image |
CN110738236A (en) * | 2019-09-16 | 2020-01-31 | 深圳市国信合成科技有限公司 | Image matching method and device, computer equipment and storage medium |
Non-Patent Citations (4)
Title |
---|
方玉明: "《视觉注意力建模理论与方法》", 30 April 2017, 吉林大学出版社, pages: 19 * |
杜军平: "《跨尺度运动图像的目标检测与跟踪》", 30 June 2018, 北京邮电大学出版社, pages: 146 * |
王娟: "基于社会化标签和显著性区域的深度学习图像检索方法", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 138 - 1648 * |
田岩: "《数字图像处理与分析》", 30 June 2009, 华中科技大学出版社, pages: 248 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112905927A (en) * | 2021-03-19 | 2021-06-04 | 北京字节跳动网络技术有限公司 | Searching method, device, equipment and medium |
CN113535117A (en) * | 2021-06-20 | 2021-10-22 | 奥比中光科技集团股份有限公司 | A data storage method, device and electronic device |
CN113535117B (en) * | 2021-06-20 | 2025-03-28 | 奥比中光科技集团股份有限公司 | Data storage method, device and electronic device |
CN113343033A (en) * | 2021-06-29 | 2021-09-03 | 平安普惠企业管理有限公司 | Video searching method and device, computer equipment and storage medium |
CN113343033B (en) * | 2021-06-29 | 2022-07-22 | 平安普惠企业管理有限公司 | Video searching method and device, computer equipment and storage medium |
CN114710649A (en) * | 2022-06-01 | 2022-07-05 | 广东中浦科技有限公司 | Pollution source video monitoring method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021068330A1 (en) | Intelligent image segmentation and classification method and device and computer readable storage medium | |
US11886492B2 (en) | Method of matching image and apparatus thereof, device, medium and program product | |
CN110830807B (en) | Image compression method, device and storage medium | |
CN112115292A (en) | Image search method and device, storage medium, and electronic device | |
CN113704531A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
CN113688261B (en) | Image data cleaning method and device, electronic equipment and readable storage medium | |
Zhao et al. | Cracking BING and Beyond. | |
US11714921B2 (en) | Image processing method with ash code on local feature vectors, image processing device and storage medium | |
CN109426831B (en) | Image similarity matching and model training method and device and computer equipment | |
CN111821693B (en) | Method, device, equipment and storage medium for detecting perspective plug-in of game | |
WO2023124278A1 (en) | Image processing model training method and apparatus, and image classification method and apparatus | |
Kumar et al. | Near lossless image compression using parallel fractal texture identification | |
Priyankara et al. | Computer assisted plant identification system for Android | |
CN102592129B (en) | Scenario-driven image characteristic point selection method for smart phone | |
CN109598250A (en) | Feature extracting method, device, electronic equipment and computer-readable medium | |
Abdesselam | Improving local binary patterns techniques by using edge information | |
CN115687670A (en) | Image searching method and device, computer readable storage medium and electronic equipment | |
JP5146229B2 (en) | Method for determining optimal image direction, program for executing instruction set, and system for determining optimal image direction | |
CN112001430A (en) | Refrigerator food detection method, device, storage medium and electronic device | |
CN114550175A (en) | Image processing method, image processing device, electronic equipment and computer readable storage medium | |
CN112883827B (en) | Method and device for identifying specified target in image, electronic equipment and storage medium | |
CN114048851A (en) | Semantic feature self-learning method and equipment based on unbalanced interval and storage medium | |
CN111866376A (en) | Feature recognition method and device, pan-tilt camera and storage medium | |
CN116959113A (en) | Gait recognition method and device | |
CN114913305B (en) | Model processing method, device, equipment, storage medium and computer program product |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201222 |