CN112115292A - Picture searching method and device, storage medium and electronic device - Google Patents

Picture searching method and device, storage medium and electronic device Download PDF

Info

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
picture
hash code
region
searched
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011025293.0A
Other languages
Chinese (zh)
Inventor
刘彦甲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Haier Uplus Intelligent Technology Beijing 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 Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Haier Uplus Intelligent Technology Beijing Co Ltd
Priority to CN202011025293.0A priority Critical patent/CN112115292A/en
Publication of CN112115292A publication Critical patent/CN112115292A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image 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

The invention discloses a picture searching method and device, a storage medium and an electronic device, wherein the method comprises the following steps: acquiring a first significance region of a picture to be searched, and performing hash coding on the first significance region to determine a hash coding value of the first significance region; according to the technical scheme, the problems that the calculation requirement is high, manpower and material resources are consumed and the like in the process of searching the pictures by adopting the deep learning model are solved.

Description

Picture searching method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method and an apparatus for searching for pictures, a storage medium, and an electronic apparatus.
Background
With the progress of scientific technology and the development of artificial intelligence, intelligent algorithms are also increasingly applied to daily life, especially for televisions, the intelligent development of the intelligent algorithms is crucial as one of daily household appliances with high use frequency, and the most critical problem of intelligence is to provide convenience for daily life.
In the prior art, a deep learning algorithm is adopted to realize image search (for example, clothes in two images can be detected), a target deep learning feature is extracted according to a detection result, and the target deep learning feature is searched in a search library to obtain a maximum similarity value which is output as a search result. Due to the fact that the deep learning algorithm is used, a cloud GPU deployment scheme is adopted, the algorithm is high in calculation force requirement and high in network dependence, a large amount of data sets need to be collected during training, manual labeling needs to be conducted on the data sets, and a large amount of manpower and material resources are consumed.
Aiming at the problems of high computational requirement, manpower and material resource consumption and the like in the process of searching the picture by adopting a deep learning model in the related technology, an effective solution is not provided.
Disclosure of Invention
The embodiment of the invention provides a picture searching method and device, a storage medium and an electronic device, and aims to solve the problems of high computational requirement, manpower and material resource consumption and the like in the process of searching pictures by adopting a deep learning model.
According to an alternative embodiment of the present invention, there is provided a picture searching method, including: acquiring a first significance region of a picture to be searched, and performing hash coding on the first significance region to determine a hash coding value of the first significance region; and searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein a plurality of pictures are stored in the database.
Optionally, searching for the target picture matched with the picture to be searched in a pre-established database according to the hash code value includes: acquiring a hash code value of the first significance region and a plurality of hash code values of a plurality of second significance regions in the database, wherein a plurality of pictures in the database correspond to the plurality of second significance regions respectively; and searching the target picture according to a plurality of comparison results of the hash code value of the first significance region and the plurality of hash code values.
Optionally, the obtaining the hash code value of the first significance region and the hash code values of the second significance regions in the database includes: dividing the first saliency areas and the second saliency areas of the pictures according to the same rule to respectively obtain a plurality of block areas; and acquiring first hash code values respectively corresponding to the plurality of block areas of the first significance area and second hash code values respectively corresponding to the plurality of block areas of the second significance area.
Optionally, before searching for the target picture matched with the picture to be searched in a pre-established database according to the comparison result between the hash code value of the first significant region and the plurality of hash code values, the method further includes: and sequentially comparing the first hash code value and the second hash code value of each second significance region to obtain a plurality of comparison results, wherein the pixel value of the block region with the same hash code value is set as a first value under the condition that the comparison results indicate that the hash code values are the same, and the pixel value of the block region with different hash code values is set as a second value under the condition that the comparison results indicate that the hash code values are different.
Optionally, searching a target picture matched with the picture to be searched in a pre-established database according to a plurality of comparison results between the hash code value of the first significant region and the hash code values, including: determining a plurality of comparison feature maps according to the comparison results, wherein the comparison feature maps are provided with values corresponding to the block areas at positions corresponding to the block areas, and the values corresponding to the block areas at least comprise one of the following values: the first value, the second value; and determining the target picture according to the plurality of comparison feature maps.
Optionally, determining the target picture according to the plurality of comparison feature maps includes: determining a target contrast feature map with the largest number of first values from the plurality of contrast feature maps; and taking the picture corresponding to the target contrast characteristic graph as a target picture matched with the picture to be searched.
Optionally, the obtaining a first significant region of the picture to be searched includes: preprocessing the picture to be searched; and processing the preprocessed picture to be searched according to a visual attention algorithm to determine a first saliency region of the picture to be searched.
According to another alternative embodiment of the present invention, there is also provided a picture search apparatus including: the acquisition module is used for acquiring a first saliency region of a picture to be searched; a hash encoding module for hash encoding the first significance region to determine a hash encoded value of the first significance region; and the searching module is used for searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein the database stores a plurality of pictures.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to carry out the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the method and the device, a first significance region of a picture to be searched is obtained, and Hash coding is carried out on the first significance region to determine a Hash coding value of the first significance region; and searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value. The method comprises the steps of determining a significance region of a picture, determining a Hash code value of the significance region, finding a target picture which is most matched with the picture to be searched according to the Hash code, and solving the problems that in the related technology, the calculation force requirement is high, manpower and material resources are consumed and the like in the process of searching the picture by adopting a deep learning model. And furthermore, in the picture search, the search speed and the search accuracy are improved, the higher calculation force requirement is not required, and a lot of manpower and material resources are not wasted.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a computer terminal of a picture search method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a picture searching method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating an image searching method according to an alternative embodiment of the invention;
fig. 4 is a block diagram of another picture searching apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the embodiment of the application can be executed in a computer terminal or a similar operation device. Taking the operation on a computer terminal as an example, fig. 1 is a hardware structure block diagram of a computer terminal of a picture searching method according to an embodiment of the present invention. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the picture searching method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The 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 examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC), 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 (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a picture searching method is provided, which is applied to the computer terminal, and fig. 2 is a flowchart of the picture searching method according to the embodiment of the present invention, where the flowchart includes the following steps:
step S202, a first saliency region of a picture to be searched is obtained;
step S204, configured to perform hash coding on the first significance region to determine a hash coding value of the first significance region;
step S206, configured to search a target picture matched with the picture to be searched in a pre-established database according to the hash code value, where the database stores a plurality of pictures.
According to the method and the device, a first significance region of a picture to be searched is obtained, and Hash coding is carried out on the first significance region to determine a Hash coding value of the first significance region; and searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value. The method comprises the steps of determining a significance region of a picture, determining a Hash code value of the significance region, finding a target picture which is most matched with the picture to be searched according to the Hash code, and solving the problems that in the related technology, the calculation force requirement is high, manpower and material resources are consumed and the like in the process of searching the picture by adopting a deep learning model. And furthermore, in the picture search, the search speed and the search accuracy are improved, the higher calculation force requirement is not required, and a lot of manpower and material resources are not wasted.
There are various implementation manners for acquiring the first saliency area of the picture to be searched in step S202, and in an optional embodiment: preprocessing the picture to be searched; and processing the preprocessed picture to be searched according to a visual attention algorithm to determine a first saliency region of the picture to be searched.
More specifically, the preprocessing process may include preprocessing such as denoising and gray-scale transformation on the search library picture, and the technical solution for determining the salient region in the picture may be implemented by using a visual attention algorithm. The specific implementation process of the visual attention algorithm for detecting the salient region comprises the following steps:
1. carrying out image pyramid processing on the preprocessed images to obtain 6 images with different scales;
2. performing DCT (discrete cosine transformation) on the 6 images respectively, and performing normalization processing on the transformed images by using a sign function;
3. inverse transformation is carried out on the processed image by Discrete Cosine Transform (DCT), and weighted addition is carried out on the images of all scales to obtain a saliency map;
4. and obtaining the segmented image of the saliency map by using an OSTU algorithm, obtaining a target area by using a connected domain method, and obtaining a target external rectangular frame, namely the saliency area.
It should be noted that the retrieval of the image may be any image, such as clothes, mobile phone, small purse, etc. After an image is determined, preprocessing is carried out on the image, then DCT transformation and inverse DCT transformation are carried out, and weighting and adding are carried out on the images of all scales to obtain a saliency map, wherein the saliency map comprises a saliency area. And obtaining the segmented image of the saliency map by using an OSTU algorithm, obtaining a target area by using a connected domain method, and obtaining a target circumscribed rectangular frame. The bounding rectangle of the target is the area of visual saliency.
In an optional embodiment, the blocking process is performed on the visually detected salient region, where the size of each block is 8 × 8 pixels, and the hash coding is performed on the blocked pictures respectively, where the specific coding process is as follows: first, an RGB image is converted into a gray scale image, and the image is converted into 64-level gray scale. Second, the average is calculated. The gray level average of all 64 pixels is calculated. And thirdly, comparing the gray scales of the pixels. The gray scale of each pixel is compared to the average. Greater than or equal to the average value, noted 1; less than the average, noted as 0. And fourthly, carrying out hash coding. The results of the previous comparison are combined to form a 64-bit integer. To obtain the hash code value of the picture, it should be noted that the pixel value 8x8 is only described as an optional implementation manner, but is not limited to the technical solution of the embodiment of the present invention, and any pixel value may be used in an actual implementation process.
According to an implementation scheme that the hash code value is used for searching for a target picture matched with the picture to be searched in a pre-established database, in an optional embodiment, the hash code value of the first significance region and a plurality of hash code values of a plurality of second significance regions in the database may be obtained, wherein the plurality of pictures in the database correspond to the plurality of second significance regions respectively; and searching the target picture according to a plurality of comparison results of the hash code value of the first significance region and the plurality of hash code values.
Namely, because a plurality of pictures are stored in the database, each picture in the database is also subjected to the determination of the significance region and the determination of the hash code value, namely, the target picture matched with the picture to be searched is searched in the database according to the hash code value of the picture to be searched and the plurality of hash code values of the plurality of pictures in the database.
Specifically, the obtaining of the hash code value of the first significance region and the hash code values of the second significance regions in the database may be further implemented by: dividing the first saliency areas and the second saliency areas of the pictures according to the same rule to respectively obtain a plurality of block areas; and acquiring first hash code values respectively corresponding to the plurality of block areas of the first significance area and second hash code values respectively corresponding to the plurality of block areas of the second significance area. The first saliency region and the second saliency regions of the pictures are divided according to the same rule, a plurality of saliency regions are obtained according to a visual attention algorithm, and therefore the features are obvious and can be found in time during retrieval.
That is, by using a visual attention algorithm, the hash code values of the first saliency region and the hash code values of the second saliency regions of the pictures in the database can be obtained, and the computing resources can be preferentially allocated to the regions which are easy to attract the attention of the observer, so that the working efficiency of the existing image processing analysis method is greatly improved.
It should be noted that when retrieving a picture, we search for a target picture matching the picture to be searched in a pre-established database according to the hash code value. That is to say, we do not directly compare two images, for example, in the traditional deep learning, we collect a large amount of data and labels, and finally make the model identify the image through the training of the model. In the picture searching method based on visual attention, the characteristic comparison is carried out through the hash codes of the hash codes in the characteristic library, and the comparison is carried out on the two codes. Therefore, a large amount of data and labels do not need to be collected, and only the image needs to be preprocessed, processed by a visual attention algorithm, and subjected to Hash coding to extract a characteristic value.
And sequentially comparing the first hash code value and the second hash code value of each second significance region to obtain a plurality of comparison results before searching the target picture matched with the picture to be searched in a pre-established database according to the comparison result of the hash code value of the first significance region and the plurality of hash code values, wherein under the condition that the comparison results indicate that the hash code values are the same, the pixel value of the block region with the same hash code value is set as a first value, and under the condition that the comparison results indicate that the hash code values are different, the pixel value of the block region with different hash code values is set as a second value.
That is to say, since the first saliency region and the second saliency region are both subjected to region division to obtain a plurality of block regions, hash coding values between the block regions are directly compared, if the hash coding values are the same, pixel values of the part of the block regions are set to be a first value, optionally 255, if the hash coding values are different, pixel values of the part of the block regions are set to be a second value, optionally 0, a graph with the pixel values being the first value or the second value can be understood as a contrast feature map, that is, a contrast feature map exists between the picture to be searched and each picture in the database, and a picture most relevant to the picture to be searched can be clearly determined from the plurality of contrast feature maps.
Determining a plurality of comparison feature maps according to the comparison results, wherein the comparison feature maps are provided with values corresponding to the block areas at positions corresponding to the block areas, and the values corresponding to the block areas at least comprise one of the following values: the first value, the second value; determining the target picture according to the plurality of comparison feature maps, and further determining the target comparison feature map with the largest number of first values from the plurality of comparison feature maps; and taking the picture corresponding to the target contrast characteristic graph as a target picture matched with the picture to be searched.
It can be understood that, since the salient region in each picture is divided into a plurality of block regions, by searching the contrast feature map with the largest number of first values of pixels in the contrast feature map, the target contrast feature with the largest number of first values determined from the plurality of contrast feature maps is the search result.
In order to better understand the above technical solutions, an alternative embodiment of the present invention is further provided for explaining the above technical solutions.
In an alternative embodiment, fig. 3 is a schematic flowchart of a picture searching method according to an alternative embodiment of the present invention, as shown in fig. 3, including the following steps:
step S302: searching the library picture;
step S304: preprocessing the search library picture such as denoising, gray level transformation and the like;
step S306: and processing the pictures in the database by adopting a visual attention algorithm. Carrying out image pyramid processing on the preprocessed images to obtain 6 images with different scales; performing DCT (discrete cosine transformation) on the 6 images respectively, and performing normalization processing on the transformed images by using a sign function; 3. performing inverse DCT transformation on the processed image, and performing weighted addition on the images of all scales to obtain a saliency map; obtaining a segmented image of the saliency map by using an OSTU algorithm, obtaining a target area by using a connected domain method, and obtaining a target external rectangular frame, wherein the obtained target external rectangular frame is the saliency area;
step S308: the hash feature extraction is performed on the salient region, which can be understood as a process of determining a hash code value by determining the salient region. Partitioning the visually detected salient region, wherein the size of each block is 8x8 pixels, and performing hash coding on the partitioned pictures respectively, wherein the specific coding process is as follows: the RGB image is converted into a gray scale image, and the image is converted into 64-level gray scale. Calculating an average value; the gray level average of all 64 pixels is calculated. The gray levels of the pixels are compared. Comparing the gray level of each pixel with the average value; greater than or equal to the average value, noted 1; less than the average value, and is marked as 0; and (6) carrying out hash coding. Combining the comparison results of the previous step together to form a 64-bit integer; obtaining the Hash code of the picture;
step S310: computation in a hash index repository. And comparing the Hash codes of two small images after being blocked before and after shooting, and calculating required parameters, wherein the specific calculation method comprises the following steps: if the hash codes are the same, 1 is added, and the obtained result is divided by the hash code length. When the obtained parameters are larger than a set threshold value, all pixel values of the small blocks are set to be 255, when the obtained parameters are smaller than the set threshold value, all pixel values of the small blocks are set to be 0, all the small blocks are recombined into an image according to a blocking sequence, a comparison feature map is obtained, and a feature map retrieval library is established for the images in all the search libraries;
step S312: extracting a picture to be retrieved;
step S314: preprocessing a picture to be retrieved such as denoising and gray level transformation;
step S316: a visual attention algorithm. Carrying out image pyramid processing on the preprocessed images to obtain 6 images with different scales; performing DCT (discrete cosine transformation) on the 6 images respectively, and performing normalization processing on the transformed images by using a sign function; 3. performing inverse DCT transformation on the processed image, and performing weighted addition on the images of all scales to obtain a saliency map; obtaining a segmented image of the saliency map by using an OSTU algorithm, obtaining a target area by using a connected domain method, and obtaining a target external rectangular frame, wherein the obtained target external rectangular frame is the saliency area;
step S318: and (5) extracting the hash characteristics. Partitioning the visually detected salient region, wherein the size of each block is 8x8 pixels, and performing hash coding on the partitioned pictures respectively, wherein the specific coding process is as follows: the RGB image is converted into a gray scale image, and the image is converted into 64-level gray scale. Calculating an average value; the gray level average of all 64 pixels is calculated. The gray levels of the pixels are compared. Comparing the gray level of each pixel with the average value; greater than or equal to the average value, noted 1; less than the average value, and is marked as 0; and (6) carrying out hash coding. Combining the comparison results of the previous step together to form a 64-bit integer; obtaining the Hash code of the picture;
step S320: and comparing the characteristics through the hash codes in the characteristic library, and outputting the result.
It should be noted that the execution sequence of the above steps is not an actual operation flow of the scheme, many steps may be operated in parallel in an actual operation process, and the execution sequence of some steps may also be exchanged, which is not limited in the embodiment of the present invention.
According to the technical scheme of the optional embodiment of the invention, firstly, an image is preprocessed, then a first significance region of a picture to be searched is obtained, and the first significance region is subjected to Hash coding to determine a Hash coding value of the first significance region; and then searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value. And comparing the features from the feature library to find the image with the highest similarity, namely the retrieval result image. By adopting the technical scheme, the problems of high computational requirement, consumption of manpower and material resources and the like in the process of searching the picture by adopting the deep learning model in the related technology are solved. And furthermore, in the picture search, the search speed and the search accuracy are improved, the higher calculation force requirement is not required, and a lot of manpower and material resources are not wasted.
In this embodiment, an image searching apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description already made is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of a picture search apparatus according to an embodiment of the present invention; as shown in fig. 4, includes:
an obtaining module 40, configured to obtain a first saliency region of a picture to be searched;
a hash encoding module 42, configured to hash encode the first significance region to determine a hash encoded value of the first significance region;
and the searching module 44 is configured to search a target picture matched with the picture to be searched in a pre-established database according to the hash code value, where the database stores a plurality of pictures.
The acquisition module is used for acquiring a first salient region of a picture to be searched, and the specific implementation process of the visual attention algorithm for detecting the salient region comprises the following steps: 1. carrying out image pyramid processing on the preprocessed images to obtain 6 images with different scales; 2. performing DCT (discrete cosine transformation) on the 6 images respectively, and performing normalization processing on the transformed images by using a sign function; 3. performing inverse DCT transformation on the processed image, and performing weighted addition on the images of all scales to obtain a saliency map; 4. and obtaining the segmented image of the saliency map by using an OSTU algorithm, obtaining a target area by using a connected domain method, and obtaining a target circumscribed rectangular frame. The obtained target circumscribed rectangular frame is the first saliency area of the picture to be searched.
A hash encoding module to hash encode the first significance region to determine a hash encoded value of the first significance region. Namely hash feature extraction. The specific implementation process of the hash coding module is to perform blocking processing on the visually detected salient region, optionally, each block has a size of 8 × 8 pixels, and perform hash coding on the blocked pictures respectively, where the specific coding process is as follows: the RGB image is converted into a gray scale image, and the image is converted into 64-level gray scale. Calculating an average value; the gray level average of all 64 pixels is calculated. The gray levels of the pixels are compared. Comparing the gray level of each pixel with the average value; greater than or equal to the average value, noted 1; less than the average value, and is marked as 0; and (6) carrying out hash coding. Combining the comparison results of the previous step together to form a 64-bit integer; the hash coding of the picture is obtained, it should be noted that the 64-bit integer obtained by the hash coding is coding 64 pixels, and if the number of pixel points is more, the number of bits of the integer obtained by the hash coding is more.
And the searching module is used for searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein the database stores a plurality of pictures. The specific method of the searching module is to compare the characteristics of the hash codes in the characteristic library by the hash codes, and the comparison is carried out on the two codes. Finally, the requirement of the user is retrieved.
It should be noted that image retrieval is retrieval of feature parts, and if a retrieval picture does not exist in a retrieval library, a picture with similar feature parts is recommended as a final result.
According to the technical scheme, a first significance region of a picture to be searched is obtained, and Hash coding is carried out on the first significance region to determine a Hash coding value of the first significance region; and searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value. The method comprises the steps of determining a significance region of a picture, determining a Hash code value of the significance region, finding a target picture which is most matched with the picture to be searched according to the Hash code, and solving the problems that in the related technology, the calculation force requirement is high, manpower and material resources are consumed and the like in the process of searching the picture by adopting a deep learning model. And furthermore, in the picture search, the search speed and the search accuracy are improved, the higher calculation force requirement is not required, and a lot of manpower and material resources are not wasted.
Optionally, the search module 44 is further configured to: acquiring a hash code value of the first significance region and a plurality of hash code values of a plurality of second significance regions in the database, wherein a plurality of pictures in the database correspond to the plurality of second significance regions respectively; and searching the target picture according to a plurality of comparison results of the hash code value of the first significance region and the plurality of hash code values.
Optionally, the hash coding module is further configured to divide the first significant region and the second significant regions of the multiple pictures according to the same rule, so as to obtain multiple block regions respectively; and acquiring first hash code values respectively corresponding to the plurality of block areas of the first significance area and second hash code values respectively corresponding to the plurality of block areas of the second significance area.
Optionally, the apparatus further comprises: and the processing module is used for sequentially comparing the first hash code value and the second hash code value of each second significance region to obtain a plurality of comparison results, wherein the pixel value of the block region with the same hash code value is set as a first value under the condition that the comparison results indicate that the hash code values are the same, and the pixel value of the block region with different hash code values is set as a second value under the condition that the comparison results indicate that the hash code values are different.
Optionally, the lookup module 44: the processing module is further configured to determine a plurality of comparison feature maps according to the comparison results, where the comparison feature maps are provided with values corresponding to the block areas at positions corresponding to the block areas, and the values corresponding to the block areas at least include one of: the first value, the second value; and determining the target picture according to the plurality of comparison feature maps.
Optionally, the lookup module 44: and is also used for: determining a target contrast feature map with the largest number of first values from the plurality of contrast feature maps; and taking the picture corresponding to the target contrast characteristic graph as a target picture matched with the picture to be searched.
Optionally, the obtaining module 40 is further configured to obtain a first significant region of the picture to be searched, and includes: preprocessing the picture to be searched; and processing the preprocessed picture to be searched according to a visual attention algorithm to determine a first saliency region of the picture to be searched.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a first salient region of the picture to be searched;
s2, hash-coding the first saliency region to determine a hash-coded value of the first saliency region;
and S3, searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein the database stores a plurality of pictures.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a first salient region of the picture to be searched;
s2, hash-coding the first saliency region to determine a hash-coded value of the first saliency region;
and S3, searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein the database stores a plurality of pictures.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. An image searching method, comprising:
acquiring a first significance region of a picture to be searched, and performing hash coding on the first significance region to determine a hash coding value of the first significance region;
and searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein a plurality of pictures are stored in the database.
2. The method according to claim 1, wherein searching for the target picture matching the picture to be searched in a pre-established database according to the hash code value comprises:
acquiring a hash code value of the first significance region and a plurality of hash code values of a plurality of second significance regions in the database, wherein a plurality of pictures in the database correspond to the plurality of second significance regions respectively;
and searching the target picture according to a plurality of comparison results of the hash code value of the first significance region and the plurality of hash code values.
3. The method of claim 2, wherein obtaining the hash code value for the first significance region and the hash code values for the second significance regions in the database comprises:
dividing the first saliency areas and the second saliency areas of the pictures according to the same rule to respectively obtain a plurality of block areas;
and acquiring first hash code values respectively corresponding to the plurality of block areas of the first significance area and second hash code values respectively corresponding to the plurality of block areas of the second significance area.
4. The method according to claim 3, wherein before searching for the target picture matching the picture to be searched in a pre-established database according to the comparison result between the hash code value of the first significant region and the plurality of hash code values, the method further comprises:
and sequentially comparing the first hash code value and the second hash code value of each second significance region to obtain a plurality of comparison results, wherein the pixel value of the block region with the same hash code value is set as a first value under the condition that the comparison results indicate that the hash code values are the same, and the pixel value of the block region with different hash code values is set as a second value under the condition that the comparison results indicate that the hash code values are different.
5. The method according to claim 4, wherein searching for the target picture matching the picture to be searched in a pre-established database according to a plurality of comparison results between the hash code value of the first significance region and the plurality of hash code values comprises:
determining a plurality of comparison feature maps according to the comparison results, wherein the comparison feature maps are provided with values corresponding to the block areas at positions corresponding to the block areas, and the values corresponding to the block areas at least comprise one of the following values: the first value, the second value;
and determining the target picture according to the plurality of comparison feature maps.
6. The method of claim 5, wherein determining the target picture according to the plurality of comparison feature maps comprises:
determining a target contrast feature map with the largest number of first values from the plurality of contrast feature maps;
and taking the picture corresponding to the target contrast characteristic graph as a target picture matched with the picture to be searched.
7. The method according to claim 1, wherein obtaining the first salient region of the picture to be searched comprises:
preprocessing the picture to be searched;
and processing the preprocessed picture to be searched according to a visual attention algorithm to determine a first saliency region of the picture to be searched.
8. An image search device, comprising:
the acquisition module is used for acquiring a first saliency region of a picture to be searched;
a hash encoding module for hash encoding the first significance region to determine a hash encoded value of the first significance region;
and the searching module is used for searching a target picture matched with the picture to be searched in a pre-established database according to the Hash code value, wherein the database stores a plurality of pictures.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202011025293.0A 2020-09-25 2020-09-25 Picture searching method and device, storage medium and electronic device Pending CN112115292A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011025293.0A CN112115292A (en) 2020-09-25 2020-09-25 Picture searching 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 Picture searching 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 Picture searching method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112115292A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
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 奥比中光科技集团股份有限公司 Data storage method and device and electronic equipment
CN114710649A (en) * 2022-06-01 2022-07-05 广东中浦科技有限公司 Pollution source video monitoring method and system

Citations (18)

* Cited by examiner, † Cited by third party
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
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
CN105005565A (en) * 2014-04-18 2015-10-28 大连恒锐科技股份有限公司 Onsite 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

Patent Citations (18)

* Cited by examiner, † Cited by third party
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 大连恒锐科技股份有限公司 Onsite 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)

* Cited by examiner, † Cited by third party
Title
方玉明: "《视觉注意力建模理论与方法》", 30 April 2017, 吉林大学出版社, pages: 19 *
杜军平: "《跨尺度运动图像的目标检测与跟踪》", 30 June 2018, 北京邮电大学出版社, pages: 146 *
王娟: "基于社会化标签和显著性区域的深度学习图像检索方法", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 138 - 1648 *
田岩: "《数字图像处理与分析》", 30 June 2009, 华中科技大学出版社, pages: 248 *

Cited By (5)

* Cited by examiner, † Cited by third party
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 奥比中光科技集团股份有限公司 Data storage method and device and electronic equipment
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
CN112115292A (en) Picture searching method and device, storage medium and electronic device
RU2505856C2 (en) Method and apparatus for representing and identifying feature descriptors using compressed histogram of gradients
WO2021068330A1 (en) Intelligent image segmentation and classification method and device and computer readable storage medium
CN110147722A (en) A kind of method for processing video frequency, video process apparatus and terminal device
CN109409377B (en) Method and device for detecting characters in image
CN116188805B (en) Image content analysis method and device for massive images and image information network
CN113762280A (en) Image category identification method, device and medium
CN110532413B (en) Information retrieval method and device based on picture matching and computer equipment
CN116188808B (en) Image feature extraction method and system, storage medium and electronic device
CN110599554A (en) Method and device for identifying face skin color, storage medium and electronic device
Kumar et al. Near lossless image compression using parallel fractal texture identification
CN110765882A (en) Video tag determination method, device, server and storage medium
CN109598250A (en) Feature extracting method, device, electronic equipment and computer-readable medium
CN110991298A (en) Image processing method and device, storage medium and electronic device
CN113988147A (en) Multi-label classification method and device for remote sensing image scene based on graph network, and multi-label retrieval method and device
CN112001430A (en) Refrigerator food material detection method and device, storage medium and electronic device
Vogt Quantifying landscape fragmentation
CN113360911A (en) Malicious code homologous analysis method and device, computer equipment and storage medium
CN112906517A (en) Self-supervision power law distribution crowd counting method and device and electronic equipment
CN109657546B (en) Video behavior recognition method based on neural network and terminal equipment
CN110795993A (en) Method and device for constructing model, terminal equipment and medium
CN115631339A (en) Visual feature extraction method and device and electronic equipment
CN111866376B (en) Feature recognition method and device, pan-tilt camera and storage medium
CN114329024A (en) Icon searching method and system
CN116665261A (en) Image processing method, device and 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