WO2020125100A1 - Image search method, apparatus, and device - Google Patents

Image search method, apparatus, and device Download PDF

Info

Publication number
WO2020125100A1
WO2020125100A1 PCT/CN2019/106737 CN2019106737W WO2020125100A1 WO 2020125100 A1 WO2020125100 A1 WO 2020125100A1 CN 2019106737 W CN2019106737 W CN 2019106737W WO 2020125100 A1 WO2020125100 A1 WO 2020125100A1
Authority
WO
WIPO (PCT)
Prior art keywords
matching
image
query image
local
features
Prior art date
Application number
PCT/CN2019/106737
Other languages
French (fr)
Chinese (zh)
Inventor
党琪
索勃
顾明
钟伟才
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020125100A1 publication Critical patent/WO2020125100A1/en

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/53Querying

Definitions

  • the present application relates to the field of computer technology, in particular to an image retrieval method, and corresponding devices and equipment.
  • Image retrieval is a technique to retrieve matching images that are similar or identical to the query image input by the user.
  • the technology has a wide range of application areas, such as search engines and infringing image recognition. Taking the identification of infringing images as an example, in today's copyright market, there are a large number of copyrighted images that are used at will without authorization. Therefore, it is necessary to use technical means to retrieve the infringing images on the network to help image agencies and photographers further combat infringement and pirated images. The current network image data is huge, which puts forward higher requirements for the efficiency of image retrieval.
  • the present application provides an image retrieval method, which improves the efficiency of image retrieval.
  • an image retrieval method is provided.
  • the image retrieval method is executed by at least one computing device and is used to retrieve a matching image that is the same as or similar to a query image input by a user.
  • the method includes the following three-stage matching process:
  • the first segment of matching obtaining the hash value of the global feature of the query image, matching the hash value of the global feature of the query image and the hash value of the global feature of the matching image of the matching image library; according to the globality of the query image
  • the matching result of the hash value of the feature and the hash value of the global feature of the matching image of the matching image library is to select the first candidate set from the matching image of the matching image library.
  • Second stage matching acquiring the global features of the query image, matching the global features of the query image and the global features of the matching images in the first candidate set; according to the global features of the query image and the first candidate The matching result of the global features of the matching matching images is selected from the matching images of the first candidate set.
  • Third-stage matching obtaining the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set; according to the local features of the query image and the second candidate
  • the matching result of the local features of the matching matching images is determined from the matching images of the second candidate set.
  • the hash values, global features, and local features of the global features of the matching images in the matching image library have been previously extracted and stored in the feature library before the method is executed.
  • the first segment of matching quickly filters a large number of matching images through hash value matching, which improves the efficiency of image retrieval.
  • the second-stage matching and the third-stage matching further finely match the filtered matching images, ensuring the accuracy of image retrieval.
  • the method further includes: obtaining location information of the local features of the query image, where the location information of the local features of the query image includes coordinate information of the local features of the query image or the Local information of the query image is in the region information of the query image;
  • the position information of the local features of the query image includes the coordinate information of the local features of the query image
  • the matching result of the local features of the image, and determining the retrieval result from the matching images of the second candidate set includes:
  • Using the location information of local features to filter matching images as the retrieval result can reduce the false retrieval results caused by the mismatch of local features and further improve the retrieval accuracy.
  • the method further includes: acquiring location information of the local features of the query image, the location information of the local features of the query image includes local features of the query image in the query image Regional information
  • the position information of the local features of the query image includes the coordinate information of the local features of the query image
  • the matching result of the local features of the image, and determining the retrieval result from the matching images of the second candidate set includes:
  • the distribution vector of the first region of the first based on the region information of the local features of the matching images of the second candidate set, obtain the local features of the matching images of the matching image of the second candidate set on the matching images of the second candidate set
  • the second area distribution vector determine whether the similarity between the first area distribution vector and the second area distribution vector is greater than a second threshold, if the first area distribution vector and the second area distribution vector are similar The degree is greater than the second threshold, and it is determined that the matching image in the second candidate set is included in the retrieval result.
  • an image retrieval device including: a first matching module, a second matching module, and a third matching module.
  • the three modules can be implemented by software running on a computing device, and the three modules can run on different computing devices.
  • a computing device system including at least one computing device, each computing device including a processor and a memory, the processor of the at least one computing device is configured to execute the program code in the memory to perform the foregoing first aspect Or the method provided in any possible implementation manner of the first aspect.
  • a non-transitory readable storage medium When the non-transitory readable storage medium is executed by at least one computing device, the at least one computing device performs the foregoing first aspect or In one aspect, the method provided in any possible implementation manner.
  • the storage medium stores the program.
  • the types of storage media include but are not limited to volatile memory, such as random access memory, non-volatile memory, such as flash memory, hard disk drive (HDD), solid state drive (SSD).
  • a fifth aspect provides a computing device program product.
  • the computing device program product When the computing device program product is executed by at least one computing device, the at least one computing device executes the foregoing first aspect or any possible implementation manner of the first aspect The method provided.
  • the computer program product may be a software installation package, and when the method provided in the first aspect or any possible implementation manner of the first aspect needs to be used, the computer program product may be downloaded and executed on the computing device The computer program product.
  • an image retrieval method is also provided.
  • the method uses the region information where the local features of the query image and the local features of the matching image are located.
  • the distribution vector indicates that whether the query image matches the matching image is determined by comparing the similarity between the regional distribution vectors. This method reduces the negative impact of matching mismatched local features on the retrieval results and improves the retrieval accuracy.
  • the method includes:
  • the location information of each local feature of the query image includes local features of the query image in the region of the query image Information
  • the location information of each local feature of the matching image includes region information of the local feature of the matching image in the matching image
  • the position information of the local features of the query image includes the coordinate information of the local features of the query image
  • the region information of at least one local feature of the query image obtain a distribution vector of at least one local feature of the query image in a first region of the query image, where the first region distribution vector includes each of the query images The number of local features included in each area;
  • the region information of the at least one local feature of the matching image obtain the distribution vector of the at least one local feature of the matching image in the second region of the matching image, where the second region distribution vector includes each of the matching images The number of local features included in each area;
  • a computing device system including at least one computing device, each computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute the program code in the memory to perform the sixth aspect The method provided.
  • a non-transitory readable storage medium is also provided.
  • the non-transitory readable storage medium is executed by at least one computing device, the at least one computing device performs the foregoing sixth aspect provides Methods.
  • a computing device program product is also provided.
  • the computing device program product is executed by at least one computing device, the at least one computing device executes the method provided in the foregoing sixth aspect.
  • FIG. 1 is a schematic diagram of the system architecture provided by this application.
  • Figure 2 is a schematic diagram of the system operating environment provided by the application.
  • FIG. 3 is a schematic diagram of another system operating environment provided by the application.
  • FIG. 6 is a schematic diagram of the position information of the feature points provided by the application.
  • FIG. 10 is a schematic structural diagram of a pretreatment device provided by this application.
  • FIG. 11 is a schematic structural diagram of an image retrieval device provided by this application.
  • FIG. 12 is a schematic structural diagram of an image retrieval system provided by the present application.
  • Global features features extracted with the entire image as input, are generally used to express the overall characteristics of the image.
  • Global features include any one or a combination of the following: pre-trained deep learning features, GIST features, local binary pattern (LBP) features, or color distribution features.
  • the pre-training deep learning feature is an image feature calculated using a pre-trained convolutional neural network model, and the pre-training model refers to a model obtained by training on an image in a data set.
  • Data sets such as the ImageNet project, is a large visualization database for visual object recognition software research, containing 1000 categories and tens of millions of images.
  • Color distribution features refer to image features represented by color statistical distribution vectors, such as color histograms, color moments, color aggregation vectors, etc.; color histograms refer to the distribution characteristics of image color spaces in different color intervals, such as red green blue (red green blue) , RGB) color distribution space, etc.; color moments include first-order moment, second-order moment, third-order moment, etc.
  • the GIST feature is an abstract scene representation. This representation can naturally stimulate the concept of different classification scenarios, such as cities and mountains. The characteristics of GIST were first published in Friedman A. Framing pictures: Therole of knowledge in automatized encoding and memory [J]. Journal of experimental psychology: General, 1979, 108(3): 316.
  • Local features features extracted with part of the image as input, are generally used to express local characteristics of the image.
  • Local features include any one or a combination of the following: scale invariant (SIFT) features, accelerated robust features (SURF), and affine SIFT features (also called ASIFT feature), principal component analysis-based scale-invariant feature (principal component analysis-scale feature variation (PCA-SIFT), histogram of orientation oriented gradient (HOG), oriented FAST detection and rotated BRIEF descriptor Features (oriented FAST and rotated (Brief, ORB), including accelerated segmentation detection features (features from accelerated segmentation test, FAST), binary robust invariant scale features (binary robust independent independent features), or binary robust non-variable features (binary robust invariant scalable keypoints, BRISK), etc.
  • SIFT scale invariant
  • SURF accelerated robust features
  • affine SIFT features also called ASIFT feature
  • PCA-SIFT principal component analysis-based scale-invariant
  • Local features are generally extracted with a pixel in the image as the center. Such pixels are also called points of interest, key points, or feature points.
  • the various descriptors extracted in the local range of feature points generally have the characteristics of local scale invariance, that is, if the content in the local range of feature points is subjected to various types of processing, such as zooming, rotating, adding noise, occlusion, change Illumination, the descriptor extracted in the local range after processing is the same as or similar to the descriptor extracted in the local range before processing. Therefore, if there are a large number of local feature matches in the two images, that is, a large number of feature points match, it can generally be considered that the two images have a high degree of similarity.
  • multiple local features can be extracted for each local feature in an image.
  • Similarity refers to the degree of similarity between two hash values, features, or vectors.
  • the similarity may be the distance between two hash values, features, or vectors, or a value obtained by normalizing the distance between two hash values, features, or vectors.
  • the distance here can be Euclidean distance, cosine distance, editor distance, Hamming distance, etc. The smaller the distance between two hash values, features, or vectors, the greater the similarity.
  • FIG. 1 introduces a system structure diagram provided by the present application.
  • the system is divided into a preprocessing section 100 and an online processing section 200.
  • the preprocessing part 100 is used to extract corresponding hash values, global features, local features, and position information for the matching images in the matching image library 105.
  • the online processing section 200 is used to retrieve similar images for the query images input by the user in the matching image library 105, and provide the retrieval results to the user.
  • the matching images in the matching image library 105 come from the network or an image library prepared in advance. Since the number of matching images stored in the matching image library 105 may be huge, the pre-processing part 100 generally needs to be pre-processed before the online processing part 200 works .
  • the preprocessing part 100 may periodically extract corresponding hash values, global features, local features, and position information for newly added matching images in the matching image library, so as to maintain the real-time retrieval result of the query image.
  • the online processing part 200 and the preprocessing part 100 can also be processed in parallel to further improve the working efficiency of the system.
  • the matching image library 105 stores matching images, and each matching image is input to the local feature extraction module 101 and the global feature extraction module 102, respectively.
  • the local feature extraction module 101 extracts the local features and position information of the matching image, and stores the local features and position information in the feature library 104.
  • the global feature extraction module 102 extracts the global features of the matching image, and stores the global features in the feature library 104.
  • the global feature extraction module 102 also inputs the extracted global feature into the hash module 103, and the hash module 103 hashes the input global feature to obtain a hash value corresponding to the global feature, and stores the obtained hash value in Feature library 104.
  • the query image input by the user through the query interface/interface 207 is input to the local feature extraction module 201 and the global feature extraction module 202, respectively.
  • the global feature extraction module 202 extracts the global features of the query image, and inputs the global features into the hash module 203 and the second matching module 205.
  • the hash module 203 generates a hash value according to the global feature input by the global feature extraction module 202, and inputs the generated hash value into the first matching module 204.
  • the first matching module 204 matches the hash value of the matching image 106 in the feature library 104 and the hash value generated by the hash module 203, and selects the first candidate set from the matching image library 105 according to the matching result.
  • the similarity between the hash value of the matching image in the first candidate set and the hash value of the query image is higher than the threshold.
  • the matching image in the first candidate set is input to the second matching module 205, and the second matching module 205 matches the global feature of the matching image in the first candidate set and the global feature generated by the global feature extraction module 202, according to the matching result from the first
  • the matching images in the candidate set select part or all of the matching images as the second candidate set.
  • the similarity between the global feature of the matching image and the global feature of the query image in the second candidate set is higher than the threshold.
  • the images in the second candidate set are input to the third matching module 206.
  • the local feature extraction module 201 extracts local features and position information of the query image, and inputs the local features and position information into the third matching module 206.
  • the third matching module matches the local features and position information of the images in the second candidate set and the local features and position information generated by the local feature extraction module 201, and selects partial or full matches from the images in the second candidate set according to the matching results
  • the image is returned to the user through the query interface/interface 207 as a search result.
  • the local feature extraction module 201 of the online processing part and the local feature extraction module 201 of the preprocessing part are the same.
  • the global feature extraction module 202 of the online processing part is the same as the global feature extraction module 202 of the preprocessing part.
  • the hash module 203 of the online processing section is the same as the hash module 103 of the pre-processing section.
  • the system shown in Figure 1 includes at least the following two operating environments. As shown in FIG. 2, both the preprocessing section 100 and the online processing section 200 are deployed on the cloud.
  • the system provides the image retrieval function as a cloud service to the user.
  • the user transmits the query image to the cloud through the query interface/interface 207 (application programming interface or browser). After finding a matching image that is the same as or similar to the query image on the cloud, the search result is returned to the user.
  • the query interface/interface 207 application programming interface or browser
  • the preprocessing section 100 is deployed on the cloud, and the abundant matching image resources and storage resources are used to extract features from the huge matching image library 105.
  • the online processing part 200 is deployed on the user equipment, and the user equipment completes the feature extraction and matching functions of the query image. Since the online processing section 200 requires less computing resources and storage resources, the online processing section 200 is placed on the user equipment in the operating environment shown in FIG. 3, and the resources of the cloud and user equipment are further rationally utilized. In the operating environment shown in FIG. 3, the online processing part 200 may be provided to the user in the form of a software module by a cloud operator and installed on the user device.
  • the preprocessing part 100 is deployed on the cloud, and the first matching module 204, the second matching module 205, and the third matching module 206 are also deployed on the cloud.
  • the other modules of the online processing section 200 are deployed on the user equipment.
  • the first matching module 204, the second matching module 205, the third matching module 206, and the feature library 104 are all deployed on the cloud to avoid the feature library 104, the first matching module 204, and the second
  • the network resource consumption caused by the transmission of hash values, global features, and local features between the matching module 205 and the third matching module 206.
  • the remaining modules of the online processing section 200 are placed on the user equipment, and the resources of the cloud and the user equipment are further rationally utilized.
  • the local feature extraction module 201, the global feature extraction module 202, the hash module 203, and the query interface/interface 207 can be provided to users by a cloud operator as software modules and installed on user devices on.
  • FIG. 5 provides a flowchart of the preprocessing method performed by the preprocessing section 100.
  • the local feature extraction module 101 obtains the matching image and the identification ID of the matching image from the matching image library 105.
  • Each matching image stored in the matching image library 105 has a unique ID.
  • the local feature extraction module 101 extracts local features for the matching image, and sends the extracted local features and their corresponding position information and matching image ID to the feature database 104.
  • the local feature extraction module 101 may include at least one sub-module, each sub-module is used to extract a local feature, for example, the SIFT sub-module is used to extract SIFT local features from the matching image, and the SURF sub-module is used to extract SURF from the matching image Local features.
  • the various local features extracted together with the matching image ID are sent to the feature library 104.
  • the location information of the feature point of each local feature of each local feature, such as coordinates or area information in the matching image, is also sent to the feature library 104 as the location information of the local feature.
  • the matching image library 105 sends the matching image and the identification ID of the matching image to the global feature extraction module 102.
  • the global feature extraction module 102 extracts global features for the matching image, and sends the extracted global features and the matching image ID to the hash module 103 and the feature library 104.
  • the global feature extraction module 102 may include at least one submodule, each submodule is used to extract a local feature, for example, the RGB submodule is used to extract RGB global features from the matched image, and the LBP submodule is used to extract LBP from the matched image Global characteristics.
  • the extracted various global features are sent to the feature library 104 together with the matching image ID.
  • S304 and S306 may be executed in parallel or in any order.
  • the hash module 103 hashes the global feature, generates a hash value, and sends the generated hash value and the matching image ID to the feature database 104.
  • S301-S302 and S303-S306 can be executed in parallel or in any order.
  • the feature library 104 After performing S301-S306 for each matching image in the matching image library 105, the feature library 104 stores a series of information for each matching image, including the ID, hash value, global features, local features and location information of the matching images ,As shown in Table 1:
  • Image ID Hashes Global feature Local features location information ID1 Hash value 1 Global Features 1 Local features 1-1 Location Information 1-1 A A Global Features 2 Local features 1-2 Location information 1-2 A A Global Features 3 ... ... A A ... Local features 2-1 Location information 2-1 A A Global feature M ... ... A A A Local features 3-1 Location Information 3-1 A A A ... ... A A A Local features N-1 Location information N-1 ID 2 ... ... ... ...
  • Table 1 records the global feature 1 to the global feature M extracted from the matching image ID 1.
  • Each global feature refers to a global feature.
  • the global feature 1 may be an RBG global feature
  • the global feature 2 may be an LBP global feature.
  • Table 1 also records the hash value 1 generated from the hash of the global feature 1 to the global feature M.
  • the hash value 1 can be composed of at least one hash value, that is, the global feature 1 to the global feature M can be combined. If a hash value 1 is desired, the global feature 1 to the global feature M may be divided into multiple segments and hashed separately, and multiple hash values are hashed to form a hash value 1.
  • the hash value 1 of the matching image ID 1 may be composed of ⁇ m i hash values, that is, each dimension of each global feature is hashed into one hash value. It is also possible to arbitrarily combine the M global features and hash the combined result to obtain a hash value. In this case, the hash value 1 is composed of less than ⁇ m i hash values.
  • the hashing algorithm adopted by the hashing module 103 may adopt the following manner: mapping a positive number to 1, and mapping a non-positive number to 0.
  • mapping a positive number to 1 When this hash algorithm is used and each dimension of each global feature is hashed into a hash value, the global features of ⁇ m i dimensions matching the image ID 1 are mapped to ⁇ m i bit
  • the binary sequence greatly reduces the complexity of global features and improves the matching speed of the subsequent first candidate set.
  • Table 1 also records the local feature 1-1 to the local feature N-1 extracted from the matching image ID 1 and the location information of each local feature. Since the matching image ID 1 can generally extract multiple feature points for each local feature, for example, the local feature 1-1 and the local feature 1-2 are SIFT local features, and the local feature 201 is a SURF local feature. A total of M global features and N local features are recorded in Table 1, M and N are both positive integers.
  • FIG. 6 provides a schematic diagram of the location information of each local feature recorded in the feature library 104.
  • the image in FIG. 6 includes 10 feature points, each feature point corresponds to a local feature, and different feature points may correspond to the same or different kinds of local features.
  • the position information of the local feature corresponding to each feature point includes the coordinate information of the feature point in the image or the area information of the feature point in the image.
  • Each image is divided into H areas, H is a positive integer greater than 1.
  • both the query image and the matching image can be divided into n rows and m columns, n*m is equal to H, m and n are positive integers, for example, the image in Figure 6 is divided into 3*3 total 9 areas. Therefore, the location information corresponding to each feature point may be the area ID where each feature point is located.
  • Table 1 is shown in Table 2:
  • Image ID Hashes Global feature Local features location information ID1 Hash value 1 Global Features 1 Local features 1-1 Zone 1 A A Global Features 2 Local features 1-2 Zone 6 A A Global Features 3 ... ... A A ... Local features 2-1 Zone 7 A A Global feature M ... ... A A A Local features 3-1 Zone 2 A A A ... ... A A A Local features N-1 Zone 3 ID 2 ... ... ... ...
  • the preprocessing part 100 may further include a matching image acquisition module for acquiring new matching images from other image libraries or from the network, and storing the new matching images in the matching image library 105. Whenever a new matching image is stored in the matching image library 105, each module of the preprocessing section 100 executes the process shown in FIG. 5, and stores the hash value of the new matching image and various types of features and position information in the feature library 104 so that the new matching image can be matched with the query image.
  • FIG. 8 provides a flowchart of the online processing method performed by the online processing section 200.
  • the query interface/interface 207 acquires a query image input by the user, and sends the query image to the local feature extraction module 201.
  • the local feature extraction module 201 extracts the local features of the query image and the location information of each local feature, and sends the local features of the query image and the location information of each local feature to the third matching module 206.
  • S402 refers to S302.
  • the query interface/interface 207 sends the query image to the global feature extraction module 202.
  • the global feature extraction module 202 extracts the global features in the query image, and sends the global features to the hash module 203 and the second matching module 205.
  • S404/S406 refer to S304/S306.
  • the hash module 203 hashes the global feature, generates a hash value, and sends the hash value to the first matching module 204.
  • S405 refers to S305 and the related description of the foregoing hash operation.
  • the first matching module 204 obtains the hash value of the matching image and the ID of the matching image from the feature library 104. After obtaining the hash value of the matching image and the ID of the matching image, the first matching module 204 matches the hash value of the query image and the hash value of the matching image, and takes the ID of the matching image on the match as the first according to the matching result
  • the candidate set is sent to the second matching module 205.
  • the first matching module 204 can match the hash value of the query image and the hash value of the matching image by calculating the similarity between the hash value of the query image and the hash value of each matching image.
  • the first matching module 204 uses the ID of the matching image corresponding to the hash value of the hash value of the query image greater than the first threshold as the first candidate set. Alternatively, the first matching module 204 uses the IDs of the matching images corresponding to the Q hash values with the highest similarity of the hash values of the query images in the matching image library 105 as the first candidate set, where Q is a positive integer.
  • the matching images in the matching image library 105 are preliminarily screened, and a large number of images with low similarity to the query image are eliminated, thereby improving the matching speed and matching accuracy of the query image.
  • the second matching module 205 obtains the global features corresponding to the matching image ID from the feature library 104 according to the matching image ID in the first candidate set.
  • the second matching module 205 matches the global features of the query image with the obtained global features of the matching image, and sends the ID of the matching image on the match as the second candidate set to the third matching module 205 according to the matching result.
  • the second matching module 205 matches the global features of the query image and the global features of the matching images in the first candidate set by calculating the similarity between the global features of the query image and the global features of the matching image, that is, the matching result includes the query image’s The similarity between the global feature and the global feature of the matching image.
  • the second matching module 205 uses the ID of the matching image corresponding to the global feature whose similarity of the global feature of the query image is greater than the second threshold as the second candidate set.
  • the second matching module 205 uses the IDs of the matching images corresponding to the W groups of global features with the largest similarity of the global features of the query image in the first candidate set as the second candidate set, where W is a positive integer.
  • the second matching module 205 further filters the matching images in the first candidate set, further filters out images with a low similarity to the query image from the first candidate set, reduces the calculation amount of subsequent matching, and further improves the query image Matching speed and matching accuracy.
  • the third matching module 206 obtains local features and position information corresponding to the matching image ID from the feature database 104 according to the matching image ID in the second candidate set.
  • the third matching module 206 matches the local features and corresponding location information of the query image with the obtained local features and corresponding location information of the matching image, determines the ID of the matching image based on the matching result, and determines the ID of the matching image based on the matching result.
  • the ID of the matching image acquires the corresponding matching image from the matching image library 105 as the retrieval result.
  • S412 includes two parts, the first part is the matching of local features, and the second part is the matching of the location information of the local features on the match.
  • the matching of the first part and the second part is performed on each matching image in the query image and the second candidate set to determine which matching images corresponding to IDs in the second candidate set can be used as the retrieval result.
  • the third matching module 206 calculates the similarity between each local feature of the query image and each local feature of the matching image x in the second candidate set, and the ID of the matching image x is any one of the second candidate set. If the local feature with the highest similarity to the local feature 1 in the query image among the local features of the matching image x is the local feature 1-1, the local feature with the second highest similarity to the local feature 1 in the query image among the local features of the matching image x The feature is local feature 1-2, and the similarity between local feature 1 and local feature 1-1 is d 1 The similarity between local feature 1 and local feature 1-2 is d 2 , if the ratio of d 1 and d 2 is less than With three thresholds, the local feature 1 matches the local feature 1-1 successfully.
  • the third matching module 206 acquires the local feature set on the match between the query image and each matched image.
  • the query image and the matching image x matching 10 local features are denoted as v 1 to v 10
  • the matching image x matching the query image is 10
  • the local features are denoted as V 1 to V 10 , where v 1 to v 10 and V 1 to V 10 are matched one-to-one.
  • the second part according to the location information of v 1 to v 10 in the query image and the location information of V 1 to V 10 in the matching image x, determine the regional distribution of v 1 to v 10 in the query image and V 1 The distribution of the regions in V to 10 in the matching image x. If the location information acquired in S402 and S411 is coordinates, it is necessary to determine which region of the query image v 1 to v 10 belong to according to the coordinates and which region of the matching image x V 1 to V 10 belong to according to the coordinates .
  • f i [2,1,1,1,0,1,1,3,0]
  • F i [2,2,0,1,0,1,1,2,1 ].
  • the similarity between f i and F i is calculated as the matching result. If the similarity between f i and F i is greater than the fourth threshold, the matching image x can be used as the retrieval result.
  • the third matching module 206 obtains the corresponding matching image from the matching image library 104 according to the ID of the matching image x as a retrieval result.
  • the search results are further selected from the second candidate set, and the accuracy of the search results is further improved.
  • the use of location information of local features makes the query image and the image in the retrieval result not only have more local feature matches, but also the location of the feature points corresponding to the local features on the match in the image are similar, ensuring the query image Similarity to matching images.
  • the retrieval result may be selected from the second candidate set through the first part and the second part. It is also possible to select the search result from the second candidate set without using the second part, that is, without using the position information of the local features. In this case, none of the aforementioned local feature extraction modules 101/201, the third matching module 206, and the feature library 104 in FIG. 5 and FIG. 8 need to generate, transmit, or store the location information of the local features.
  • the first part after obtaining the number of matching local features on the query image and the matching image x, determine whether the number of matching local features is greater than the fifth threshold, or the number of matching local features is within the query image Whether the ratio of the total number of local features is greater than the sixth threshold. If the number of local features on the match is greater than the fifth threshold, or the ratio of the number of local features on the match to the total number of local features in the query image is greater than the sixth threshold, the matching image x may be used as the retrieval result.
  • the third matching module 206 returns the search result to the user through the query interface/interface 207.
  • S401 to S402 and S403 to S406 can be executed in parallel.
  • S404 to S405 and S406 can be executed in parallel.
  • S407, S409, and S411 can be executed in parallel or combined into one step, that is, the hash value, matching image ID, global features, local features, and location information are sent to the first matching module 204 in S407, and in S408
  • the first matching module 204 also sends the ID, global features, local features, and location information of the matching image to the second matching module 205.
  • the second matching module 205 in addition to sending the second candidate set to the third matching module 206, the second matching module 205 also sends the ID, local features, and position information of the matching image to the third matching module 206.
  • the present application also provides a preprocessing device 500 for performing the preprocessing part 100.
  • the preprocessing device 500 includes a local feature extraction module 101, a global feature extraction module 102, a hash module 103, and a feature library 104 ⁇ matching image library 105.
  • the present application also provides an image retrieval device 600 for performing an online processing section 200.
  • the image retrieval device 600 includes a local feature extraction module 201, a global feature extraction module 202, a hash module 203, and a first match Module 204, second matching module 205 and third matching module 206.
  • Each module in the preprocessing device 500 and the image retrieval device 600 may be a software module
  • the feature library 104 may be a database or a storage space provided by a cloud storage service.
  • the present application also provides an image retrieval system 700.
  • the image retrieval system 700 includes a preprocessing cluster and an online processing cluster.
  • the preprocessing cluster is used to perform the preprocessing section 100
  • the online processing cluster is used to process the online processing section 200.
  • Each cluster includes at least one computing device 705 .
  • the computing device 705 includes a bus 703, a processor 701, a communication interface 702, and a memory 704.
  • the processor 701, the memory 704, and the communication interface 702 communicate via a bus 703.
  • the processor 701 may be a central processing unit (English: central processing unit, abbreviation: CPU).
  • the memory may include a volatile memory (English: volatile memory), for example, a random access memory (English: random access memory, abbreviation: RAM).
  • the memory 704 may also include non-volatile memory (English: non-volatile memory), such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory, HDD, or SSD.
  • An executable program code is stored in the memory 704, and the processor 701 executes the executable code to perform the aforementioned methods of FIGS. 5 and 8.
  • the memory 704 may further include software modules required by other operating processes such as an operating system.
  • the operating system can be LINUX TM , UNIX TM , WINDOWS TM and so on.
  • the memory 704 of the computing device 705 stores codes required to run each module in the preprocessing apparatus 500 and the image retrieval apparatus 600, and the processor 701 executes these codes to realize the functions of the preprocessing apparatus 500 and the image retrieval apparatus 600, that is, executes The methods shown in Figures 5 and 8.
  • the computing device 700 in the pre-processing cluster may be a computing device in a cloud environment.
  • the computing device 700 in the online processing cluster may be a computing device in a cloud environment, or a computing device in an edge environment or a computing device in a user environment.
  • the storage resources required by the feature library 104 and the matching image library 105 are relatively large, and can also be stored in the storage cluster in the preprocessing cluster.
  • the online processing system communicates with the user's query interface/interface 207 to obtain the query image input by the user and return the search result to the user.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmit to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium may be a computer Any available media that can be accessed or a data storage device that includes one or more available media integrated servers, data centers, etc.
  • the available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg , DVD), or semiconductor media (such as SSD), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Processing Or Creating Images (AREA)

Abstract

Disclosed by the present application is an image search method; first, first segment matching is performed on a hash value of a global feature of a query image inputted by a user and a matching image in a matching image library, to obtain a first candidate set comprising a rough match result. Then, second segment matching is performed on the global features of the matching image in the first candidate set and the global features of the query image, to obtain a second candidate set comprising a fine match result. Finally, third segment matching is performed on the local features of the matching image in the second candidate set and the local features of the query image, to obtain a final search result. The method uses a three-segment search method to obtain matching images similar to a query image; the faster the speed of matching during the coarse-grained matching process, the more matching images are filtered, avoiding the repetition of matching of multiple features of each matching image, improving the speed of image search.

Description

一种图像检索方法、装置以及设备Image retrieval method, device and equipment 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种图像检索方法,以及相应的装置和设备。The present application relates to the field of computer technology, in particular to an image retrieval method, and corresponding devices and equipment.
背景技术Background technique
图像检索是一项检索与用户输入的查询图像相似或相同的匹配图像的技术。该技术应用领域广泛,例如搜索引擎、侵权图像识别等。以侵权图像识别为例,在当今的版权市场内,存在着大量版权图像在未经授权的情况下被随意使用,因此需要利用技术手段检索出网络中的侵权图像,帮助图像机构和摄影师进一步打击侵权盗版图像。目前的网络图像数据量庞大,对图像检索的效率提出了更高的要求。Image retrieval is a technique to retrieve matching images that are similar or identical to the query image input by the user. The technology has a wide range of application areas, such as search engines and infringing image recognition. Taking the identification of infringing images as an example, in today's copyright market, there are a large number of copyrighted images that are used at will without authorization. Therefore, it is necessary to use technical means to retrieve the infringing images on the network to help image agencies and photographers further Combat infringement and pirated images. The current network image data is huge, which puts forward higher requirements for the efficiency of image retrieval.
发明内容Summary of the invention
本申请提供了一种图像检索的方法,该方法提升了图像检索的效率。The present application provides an image retrieval method, which improves the efficiency of image retrieval.
第一方面,提供了一种图像检索方法,该图像检索方法由至少一个计算设备执行,用于检索与用户输入的查询图像相同或相似的匹配图像,该方法包括以下三段匹配过程:In a first aspect, an image retrieval method is provided. The image retrieval method is executed by at least one computing device and is used to retrieve a matching image that is the same as or similar to a query image input by a user. The method includes the following three-stage matching process:
第一段匹配:获取查询图像的全局特征的哈希值,匹配所述查询图像的全局特征的哈希值和匹配图像库的匹配图像的全局特征的哈希值;根据所述查询图像的全局特征的哈希值和所述匹配图像库的匹配图像的全局特征的哈希值的匹配结果,从所述匹配图像库的匹配图像中选取第一候选集。The first segment of matching: obtaining the hash value of the global feature of the query image, matching the hash value of the global feature of the query image and the hash value of the global feature of the matching image of the matching image library; according to the globality of the query image The matching result of the hash value of the feature and the hash value of the global feature of the matching image of the matching image library is to select the first candidate set from the matching image of the matching image library.
第二段匹配:获取所述查询图像的全局特征,匹配所述查询图像的全局特征和所述第一候选集中的匹配图像的全局特征;根据所述查询图像的全局特征和所述第一候选集中的匹配图像的全局特征的匹配结果,从所述第一候选集的匹配图像中选取第二候选集。Second stage matching: acquiring the global features of the query image, matching the global features of the query image and the global features of the matching images in the first candidate set; according to the global features of the query image and the first candidate The matching result of the global features of the matching matching images is selected from the matching images of the first candidate set.
第三段匹配:获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果。其中,匹配图像库的匹配图像的全局特征的哈希值、全局特征、局部特征,在该方法执行前已经预先提取完毕并存储于特征库中。Third-stage matching: obtaining the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set; according to the local features of the query image and the second candidate The matching result of the local features of the matching matching images is determined from the matching images of the second candidate set. Among them, the hash values, global features, and local features of the global features of the matching images in the matching image library have been previously extracted and stored in the feature library before the method is executed.
第一段匹配通过哈希值的匹配,快速的过滤大量的匹配图像,提升了图像检索的效率。第二段匹配和第三段匹配进一步精细的匹配了过滤后的匹配图像,保证了图像检索的精度。The first segment of matching quickly filters a large number of matching images through hash value matching, which improves the efficiency of image retrieval. The second-stage matching and the third-stage matching further finely match the filtered matching images, ensuring the accuracy of image retrieval.
在一种可能的实现方式中,该方法还包括:获取所述查询图像的局部特征的位置信息,所述查询图像的局部特征的位置信息包括所述查询图像的局部特征的坐标信息 或所述查询图像的局部特征在所述查询图像的区域信息;In a possible implementation manner, the method further includes: obtaining location information of the local features of the query image, where the location information of the local features of the query image includes coordinate information of the local features of the query image or the Local information of the query image is in the region information of the query image;
在所述查询图像的局部特征的位置信息包括所述查询图像的局部特征的坐标信息的情况下,还需要根据所述查询图像的局部特征的坐标信息获取所述查询图像的局部特征的区域信息;In the case where the position information of the local features of the query image includes the coordinate information of the local features of the query image, it is also necessary to obtain the area information of the local features of the query image according to the coordinate information of the local features of the query image ;
所述获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果包括:Acquiring the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set; according to the matching of the local features of the query image and the second candidate set The matching result of the local features of the image, and determining the retrieval result from the matching images of the second candidate set includes:
匹配所述查询图像的局部特征的区域信息和所述第二候选集中的匹配图像的局部特征的区域信息;根据所述查询图像的局部特征的区域信息和所述第二候选集中的匹配图像的局部特征的区域信息的匹配结果,从所述第二候选集的匹配图像中确定所述检索结果,所述检索结果中的匹配图像的局部特征的区域信息和所述查询图像的局部特征的区域信息的相似度大于第一阈值。Area information matching the local features of the query image and area information of the local features of the matching image in the second candidate set; according to the area information of the local features of the query image and the matching image in the second candidate set The matching result of the local information of the local feature, the search result is determined from the matching image of the second candidate set, the local information of the local feature of the matching image in the search result and the local feature of the query image The similarity of the information is greater than the first threshold.
采用局部特征的位置信息来筛选匹配图像作为检索结果,可以降低局部特征误匹配带来的错误检索结果,进一步提升了检索精度。Using the location information of local features to filter matching images as the retrieval result can reduce the false retrieval results caused by the mismatch of local features and further improve the retrieval accuracy.
在一种可能的实现方式中,该方法还包括:获取所述查询图像的局部特征的位置信息,所述查询图像的局部特征的位置信息包括所述查询图像的局部特征在所述查询图像的区域信息;In a possible implementation manner, the method further includes: acquiring location information of the local features of the query image, the location information of the local features of the query image includes local features of the query image in the query image Regional information
在所述查询图像的局部特征的位置信息包括所述查询图像的局部特征的坐标信息的情况下,还需要根据所述查询图像的局部特征的坐标信息获取所述查询图像的局部特征的区域信息;In the case where the position information of the local features of the query image includes the coordinate information of the local features of the query image, it is also necessary to obtain the area information of the local features of the query image according to the coordinate information of the local features of the query image ;
所述获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果包括:Acquiring the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set; according to the matching of the local features of the query image and the second candidate set The matching result of the local features of the image, and determining the retrieval result from the matching images of the second candidate set includes:
匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征的区域信息,获取匹配上的所述查询图像的局部特征在所述查询图像的第一区域分布向量;根据所述第二候选集的匹配图像的局部特征的区域信息,获取匹配上的所述第二候选集的匹配图像的局部特征在所述第二候选集的匹配图像的第二区域分布向量;判断所述第一区域分布向量和所述第二区域分布向量的相似度是否大于第二阈值,如果所述第一区域分布向量和所述第二区域分布向量的相似度大于第二阈值,确定所述第二候选集中的匹配图像包括于所述检索结果。Matching the local features of the query image with the local features of the matching image in the second candidate set; according to the region information of the local features of the query image, acquiring the local features of the query image matching on the query image The distribution vector of the first region of the first; based on the region information of the local features of the matching images of the second candidate set, obtain the local features of the matching images of the matching image of the second candidate set on the matching images of the second candidate set The second area distribution vector; determine whether the similarity between the first area distribution vector and the second area distribution vector is greater than a second threshold, if the first area distribution vector and the second area distribution vector are similar The degree is greater than the second threshold, and it is determined that the matching image in the second candidate set is included in the retrieval result.
将匹配上的局部特征回归到查询图像和匹配图像上获取其区域信息,通过比较匹配上的局部特征在查询图像的区域信息和匹配上的局部特征在匹配图像的区域信息,进一步降低匹配错误的局部特征对检索结果的负面影响,提升了检索精度。Retrieve the local features of the match to the query image and the matched image to obtain its regional information. By comparing the local information of the matched feature in the query image and the local feature of the match in the matched image, the matching error is further reduced. The negative impact of local features on the retrieval results improves the retrieval accuracy.
第二方面,提供了一种图像检索装置,包括:第一匹配模块,第二匹配模块和第三匹配模块。这三个模块可以由运行在计算设备上的软件实现,且这三个模块可以运行在不同的计算设备上。In a second aspect, an image retrieval device is provided, including: a first matching module, a second matching module, and a third matching module. The three modules can be implemented by software running on a computing device, and the three modules can run on different computing devices.
第三方面,提供了一种计算设备系统,包括至少一个计算设备,每个计算设备包括处理器和存储器,所述至少一个计算设备的处理器用于执行存储器中的程序代码以执行前述第一方面或第一方面的任意一种可能的实现方式提供的方法。In a third aspect, a computing device system is provided, including at least one computing device, each computing device including a processor and a memory, the processor of the at least one computing device is configured to execute the program code in the memory to perform the foregoing first aspect Or the method provided in any possible implementation manner of the first aspect.
第四方面,提供了一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被至少一台计算设备执行时,所述至少一台计算设备执行前述第一方面或第一方面的任意一种可能的实现方式中提供的方法。该存储介质中存储了程序。该存储介质的类型包括但不限于易失性存储器,例如随机访问存储器,非易失性存储器,例如快闪存储器、硬盘(hard disk drive,HDD)、固态硬盘(solid state drive,SSD)。According to a fourth aspect, a non-transitory readable storage medium is provided. When the non-transitory readable storage medium is executed by at least one computing device, the at least one computing device performs the foregoing first aspect or In one aspect, the method provided in any possible implementation manner. The storage medium stores the program. The types of storage media include but are not limited to volatile memory, such as random access memory, non-volatile memory, such as flash memory, hard disk drive (HDD), solid state drive (SSD).
第五方面提供了一种计算设备程序产品,所述计算设备程序产品被至少一台计算设备执行时,所述至少一台计算设备执行前述第一方面或第一方面的任意可能的实现方式中提供的方法。该计算机程序产品可以为一个软件安装包,在需要使用前述第一方面或第一方面的任意一种可能的实现方式中提供的方法的情况下,可以下载该计算机程序产品并在计算设备上执行该计算机程序产品。A fifth aspect provides a computing device program product. When the computing device program product is executed by at least one computing device, the at least one computing device executes the foregoing first aspect or any possible implementation manner of the first aspect The method provided. The computer program product may be a software installation package, and when the method provided in the first aspect or any possible implementation manner of the first aspect needs to be used, the computer program product may be downloaded and executed on the computing device The computer program product.
第六方面,还提供了一种图像检索方法,该方法在匹配查询图像的局部特征和匹配图像的局部特征的过程中,将查询图像的局部特征和匹配图像的局部特征所在的区域信息用区域分布向量表示,通过比较区域分布向量之间的相似度来判断查询图像和匹配图像是否匹配。该方法降低了匹配错误的局部特征对检索结果的负面影响,提升了检索精度。该方法包括:In the sixth aspect, an image retrieval method is also provided. In the process of matching the local features of the query image and the local features of the matching image, the method uses the region information where the local features of the query image and the local features of the matching image are located. The distribution vector indicates that whether the query image matches the matching image is determined by comparing the similarity between the regional distribution vectors. This method reduces the negative impact of matching mismatched local features on the retrieval results and improves the retrieval accuracy. The method includes:
获取查询图像的至少一个局部特征的位置信息和匹配图像的至少一个局部特征的位置信息,所述查询图像的每个局部特征的位置信息包括所述查询图像的局部特征在所述查询图像的区域信息,所述匹配图像的每个局部特征的位置信息包括所述匹配图像的局部特征在所述匹配图像的区域信息;Acquiring location information of at least one local feature of the query image and location information of at least one local feature of the matching image, the location information of each local feature of the query image includes local features of the query image in the region of the query image Information, the location information of each local feature of the matching image includes region information of the local feature of the matching image in the matching image;
在所述查询图像的局部特征的位置信息包括所述查询图像的局部特征的坐标信息的情况下,还需要根据所述查询图像的局部特征的坐标信息获取所述查询图像的局部特征的区域信息;In the case where the position information of the local features of the query image includes the coordinate information of the local features of the query image, it is also necessary to obtain the area information of the local features of the query image according to the coordinate information of the local features of the query image ;
根据所述查询图像的至少一个局部特征的区域信息,获取所述查询图像的至少一个局部特征在所述查询图像的第一区域分布向量,所述第一区域分布向量包括所述查询图像的每个区域内包括的局部特征的数量;According to the region information of at least one local feature of the query image, obtain a distribution vector of at least one local feature of the query image in a first region of the query image, where the first region distribution vector includes each of the query images The number of local features included in each area;
根据所述匹配图像的至少一个局部特征的区域信息,获取所述匹配图像的至少一个局部特征在所述匹配图像的第二区域分布向量,所述第二区域分布向量包括所述匹配图像的每个区域内包括的局部特征的数量;According to the region information of the at least one local feature of the matching image, obtain the distribution vector of the at least one local feature of the matching image in the second region of the matching image, where the second region distribution vector includes each of the matching images The number of local features included in each area;
确定所述第一区域分布向量和所述第二区域分布向量的相似度大于阈值;Determining that the similarity between the first area distribution vector and the second area distribution vector is greater than a threshold;
确定所述查询图像与所述匹配图像匹配。It is determined that the query image matches the matching image.
第七方面,还提供了一种计算设备系统,包括至少一个计算设备,每个计算设备包括处理器和存储器,所述至少一个计算设备的处理器用于执行存储器中的程序代码以执行第六方面提供的方法。In a seventh aspect, a computing device system is also provided, including at least one computing device, each computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute the program code in the memory to perform the sixth aspect The method provided.
第八方面,还提供了一种非瞬态的可读存储介质,所述非瞬态的可读存储介质被至少一台计算设备执行时,所述至少一台计算设备执行前述第六方面提供的方法。According to an eighth aspect, a non-transitory readable storage medium is also provided. When the non-transitory readable storage medium is executed by at least one computing device, the at least one computing device performs the foregoing sixth aspect provides Methods.
第九方面。还提供了一种计算设备程序产品,所述计算设备程序产品被至少一台计算设备执行时,所述至少一台计算设备执行前述第六方面提供的方法。The ninth aspect. A computing device program product is also provided. When the computing device program product is executed by at least one computing device, the at least one computing device executes the method provided in the foregoing sixth aspect.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本申请实施例的技术方法,下面将对实施例中所需要使用的附图作以简单地介绍。In order to more clearly explain the technical methods of the embodiments of the present application, the drawings required in the embodiments will be briefly described below.
图1为本申请提供的系统架构示意图;Figure 1 is a schematic diagram of the system architecture provided by this application;
图2为本申请提供的系统运行环境示意图;Figure 2 is a schematic diagram of the system operating environment provided by the application;
图3为本申请提供的又一系统运行环境示意图;FIG. 3 is a schematic diagram of another system operating environment provided by the application;
图4为本申请提供的又一系统运行环境示意图;4 is a schematic diagram of another system operating environment provided by the application;
图5为本申请提供的预处理方法流程图;5 is a flow chart of the preprocessing method provided by this application;
图6为本申请提供的特征点的位置信息的示意图;6 is a schematic diagram of the position information of the feature points provided by the application;
图7为本申请提供的特征点的区域划分的示意图;7 is a schematic diagram of the area division of the feature points provided by this application;
图8为本申请提供的在线处理方法流程图;8 is a flowchart of an online processing method provided by this application;
图9为本申请提供的位置信息的示意图;9 is a schematic diagram of the location information provided by the application;
图10为本申请提供的预处理装置的结构示意图;10 is a schematic structural diagram of a pretreatment device provided by this application;
图11为本申请提供的图像检索装置的结构示意图;11 is a schematic structural diagram of an image retrieval device provided by this application;
图12为本申请提供的图像检索系统的结构示意图。12 is a schematic structural diagram of an image retrieval system provided by the present application.
具体实施方式detailed description
下面结合本申请实施例中的附图,对本申请实施例中的技术方法进行描述。本申请中各个“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系。The technical methods in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In this application, there is no logical or timing dependency between the "first", "second", and "nth".
全局特征,以图像(image)整体作为输入提取的特征,一般用于表现图像的整体特性。全局特征包括以下任意一种或多种的组合:预训练深度学习特征,GIST特征,局部二值模式(local binary pattern,LBP)特征,或颜色分布特征等。其中,预训练深度学习特征是利用预先训练的卷积神经网络模型计算得到的图像特征,预训练模型是指在通过数据集中的图像训练得到的模型。数据集,例如ImageNet项目是一个用于视觉对象识别软件研究的大型可视化数据库,包含1000个类别、上千万张图像。图像被输入到预先训练的卷积神经网络模型后,该模型的任一卷积层内的特征均可以作为该图像的全局特征。颜色分布特征是指通过颜色统计分布向量表示图像特征,例如颜色直方图、颜色矩、颜色聚合向量等;颜色直方图指图像颜色空间在不同颜色区间的分布特征,例如红绿蓝(red green blue,RGB)颜色分布空间等;颜色矩包括一阶矩、二阶矩、三阶矩等。GIST特征是一种抽象的场景表征,这种表征可以自然地激发不同分类场景的概念,例如城市、高山等。GIST特征最早发布于Friedman A.Framing pictures:The role of knowledge in automatized encoding and memory for gist[J].Journal of experimental psychology:General,1979,108(3):316。Global features, features extracted with the entire image as input, are generally used to express the overall characteristics of the image. Global features include any one or a combination of the following: pre-trained deep learning features, GIST features, local binary pattern (LBP) features, or color distribution features. Among them, the pre-training deep learning feature is an image feature calculated using a pre-trained convolutional neural network model, and the pre-training model refers to a model obtained by training on an image in a data set. Data sets, such as the ImageNet project, is a large visualization database for visual object recognition software research, containing 1000 categories and tens of millions of images. After the image is input to the pre-trained convolutional neural network model, the features in any convolutional layer of the model can be used as the global features of the image. Color distribution features refer to image features represented by color statistical distribution vectors, such as color histograms, color moments, color aggregation vectors, etc.; color histograms refer to the distribution characteristics of image color spaces in different color intervals, such as red green blue (red green blue) , RGB) color distribution space, etc.; color moments include first-order moment, second-order moment, third-order moment, etc. The GIST feature is an abstract scene representation. This representation can naturally stimulate the concept of different classification scenarios, such as cities and mountains. The characteristics of GIST were first published in Friedman A. Framing pictures: Therole of knowledge in automatized encoding and memory [J]. Journal of experimental psychology: General, 1979, 108(3): 316.
局部特征,以图像的一部分区域作为输入提取的特征,一般用于表现图像的局部特性。局部特征包括以下任意一种或多种的组合:尺度不变(scale invariant feature transform,SIFT)特征,加速稳健特征(speeded up robust features,SURF)、仿射(affine)SIFT特征(又称之为ASIFT特征),基于主成分分析的尺度不变特征(principal component analysis-scale invariant feature transform,PCA-SIFT), 方向梯度直方图(histogram of oriented gradient,HOG),定向FAST检测和旋转的BRIEF描述子特征(oriented FAST and rotated BRIEF,ORB),其中加速分割检测特征(features from accelerated segment test,FAST),二进制鲁棒不变尺度特征(binary robust independent elementary features,BRIEF),或二值稳健不可变特征(binary robust invariant scalable keypoints,BRISK)等。局部特征一般以图像中的某一像素为中心提取,这类像素也称之为兴趣点,关键点或特征点。特征点的局部范围内提取出的各类描述子一般具有局部尺度不变的特征,也即特征点的局部范围内的内容如果被进行各类处理,例如缩放、旋转、添加噪声、遮挡、变化光照,处理后的局部范围内提取出的描述子和处理前的局部范围内提取出的描述子相同或者相似。因此,如果两个图像中有大量局部特征匹配,也即有大量特征点匹配,一般可以认为这两个图像的相似程度较高。一个图像中针对每种局部特征一般可以提取出多个局部特征。Local features, features extracted with part of the image as input, are generally used to express local characteristics of the image. Local features include any one or a combination of the following: scale invariant (SIFT) features, accelerated robust features (SURF), and affine SIFT features (also called ASIFT feature), principal component analysis-based scale-invariant feature (principal component analysis-scale feature variation (PCA-SIFT), histogram of orientation oriented gradient (HOG), oriented FAST detection and rotated BRIEF descriptor Features (oriented FAST and rotated (Brief, ORB), including accelerated segmentation detection features (features from accelerated segmentation test, FAST), binary robust invariant scale features (binary robust independent independent features), or binary robust non-variable features (binary robust invariant scalable keypoints, BRISK), etc. Local features are generally extracted with a pixel in the image as the center. Such pixels are also called points of interest, key points, or feature points. The various descriptors extracted in the local range of feature points generally have the characteristics of local scale invariance, that is, if the content in the local range of feature points is subjected to various types of processing, such as zooming, rotating, adding noise, occlusion, change Illumination, the descriptor extracted in the local range after processing is the same as or similar to the descriptor extracted in the local range before processing. Therefore, if there are a large number of local feature matches in the two images, that is, a large number of feature points match, it can generally be considered that the two images have a high degree of similarity. Generally, multiple local features can be extracted for each local feature in an image.
相似度,指代两个哈希值、特征或向量之间相似程度。相似度可以为两个哈希值、特征或向量之间的距离,或者为两个哈希值、特征或向量之间的距离归一化后获得的数值。此处的距离可以为欧式距离、余弦距离、编辑(editor)距离、汉明距离等。两个哈希值、特征或向量之间的距离越小,相似度越大。Similarity refers to the degree of similarity between two hash values, features, or vectors. The similarity may be the distance between two hash values, features, or vectors, or a value obtained by normalizing the distance between two hash values, features, or vectors. The distance here can be Euclidean distance, cosine distance, editor distance, Hamming distance, etc. The smaller the distance between two hash values, features, or vectors, the greater the similarity.
图1介绍了本申请提供的系统结构图,该系统分为预处理部分100和在线处理200部分。预处理部分100用于为匹配图像库105里的匹配图像提取对应的哈希值,全局特征以及局部特征及其位置信息。在线处理部分200用于在匹配图像库105内为用户输入的查询图像检索相似的图像,并将检索结果提供给用户。匹配图像库105内的匹配图像来源于网络或者预先准备的图像库,由于匹配图像库105内存储的匹配图像的数量可能巨大,因此预处理部分100一般需要在在线处理部分200工作前预先处理完毕。预处理部分100可以周期性的为匹配图像库内新增的匹配图像提取对应的哈希值,全局特征以及局部特征及其位置信息,以保持查询图像的检索结果的实时性。在线处理部分200和预处理部分100也可以并行处理,以进一步提升系统的工作效率。FIG. 1 introduces a system structure diagram provided by the present application. The system is divided into a preprocessing section 100 and an online processing section 200. The preprocessing part 100 is used to extract corresponding hash values, global features, local features, and position information for the matching images in the matching image library 105. The online processing section 200 is used to retrieve similar images for the query images input by the user in the matching image library 105, and provide the retrieval results to the user. The matching images in the matching image library 105 come from the network or an image library prepared in advance. Since the number of matching images stored in the matching image library 105 may be huge, the pre-processing part 100 generally needs to be pre-processed before the online processing part 200 works . The preprocessing part 100 may periodically extract corresponding hash values, global features, local features, and position information for newly added matching images in the matching image library, so as to maintain the real-time retrieval result of the query image. The online processing part 200 and the preprocessing part 100 can also be processed in parallel to further improve the working efficiency of the system.
匹配图像库105内存储了匹配图像,每个匹配图像被分别输入局部特征提取模块101和全局特征提取模块102。局部特征提取模块101提取出匹配图像的局部特征及其位置信息,并将局部特征及其位置信息存入特征库104。全局特征提取模块102提取出匹配图像的全局特征,将全局特征存入特征库104。全局特征提取模块102还将提取出的全局特征输入哈希模块103,哈希模块103对输入的全局特征进行哈希,获得该全局特征对应的哈希值,并将获得的哈希值存入特征库104。The matching image library 105 stores matching images, and each matching image is input to the local feature extraction module 101 and the global feature extraction module 102, respectively. The local feature extraction module 101 extracts the local features and position information of the matching image, and stores the local features and position information in the feature library 104. The global feature extraction module 102 extracts the global features of the matching image, and stores the global features in the feature library 104. The global feature extraction module 102 also inputs the extracted global feature into the hash module 103, and the hash module 103 hashes the input global feature to obtain a hash value corresponding to the global feature, and stores the obtained hash value in Feature library 104.
用户通过查询接口/界面207输入的查询图像被分别输入局部特征提取模块201和全局特征提取模块202。全局特征提取模块202提取出查询图像的全局特征,并将全局特征输入哈希模块203和第二匹配模块205。哈希模块203根据全局特征提取模块202输入的全局特征生成哈希值,将生成的哈希值输入第一匹配模块204。第一匹配模块204匹配特征库104内的匹配图像106的哈希值和哈希模块203生成的哈希值,根据匹配结果从匹配图像库105中选取第一候选集。第一候选集内的匹配图像的哈希值与查询图像的哈希值的相似度高于阈值。第一候选集内的匹配图像被输入第二匹配模块205,第二匹配模块205匹配第一候选集内的匹配图像的全局特征和全局特征提 取模块202生成的全局特征,根据匹配结果从第一候选集中的匹配图像选取部分或全部匹配图像作为第二候选集。第二候选集内的匹配图像的全局特征与查询图像的全局特征的相似度高于阈值。第二候选集内的图像被输入第三匹配模块206。局部特征提取模块201提取出查询图像的局部特征及其位置信息,并将局部特征及其位置信息输入第三匹配模块206。第三匹配模块匹配第二候选集内的图像的局部特征及其位置信息和局部特征提取模块201生成的局部特征及其位置信息,根据匹配结果从第二候选集内的图像选取部分或全部匹配图像作为检索结果通过查询接口/界面207返回给用户。The query image input by the user through the query interface/interface 207 is input to the local feature extraction module 201 and the global feature extraction module 202, respectively. The global feature extraction module 202 extracts the global features of the query image, and inputs the global features into the hash module 203 and the second matching module 205. The hash module 203 generates a hash value according to the global feature input by the global feature extraction module 202, and inputs the generated hash value into the first matching module 204. The first matching module 204 matches the hash value of the matching image 106 in the feature library 104 and the hash value generated by the hash module 203, and selects the first candidate set from the matching image library 105 according to the matching result. The similarity between the hash value of the matching image in the first candidate set and the hash value of the query image is higher than the threshold. The matching image in the first candidate set is input to the second matching module 205, and the second matching module 205 matches the global feature of the matching image in the first candidate set and the global feature generated by the global feature extraction module 202, according to the matching result from the first The matching images in the candidate set select part or all of the matching images as the second candidate set. The similarity between the global feature of the matching image and the global feature of the query image in the second candidate set is higher than the threshold. The images in the second candidate set are input to the third matching module 206. The local feature extraction module 201 extracts local features and position information of the query image, and inputs the local features and position information into the third matching module 206. The third matching module matches the local features and position information of the images in the second candidate set and the local features and position information generated by the local feature extraction module 201, and selects partial or full matches from the images in the second candidate set according to the matching results The image is returned to the user through the query interface/interface 207 as a search result.
可选的,在线处理部分的局部特征提取模块201和预处理部分的局部特征提取模块201相同。在线处理部分的全局特征提取模块202和预处理部分的全局特征提取模块202相同。在线处理部分的哈希模块203和预处理部分的哈希模块103相同。Optionally, the local feature extraction module 201 of the online processing part and the local feature extraction module 201 of the preprocessing part are the same. The global feature extraction module 202 of the online processing part is the same as the global feature extraction module 202 of the preprocessing part. The hash module 203 of the online processing section is the same as the hash module 103 of the pre-processing section.
图1所示的系统至少包括以下两种运行环境。如图2所示,预处理部分100和在线处理部分200均部署在云上。系统将图像检索功能以云服务的方式提供给用户使用,用户通过查询接口/界面207(应用编程接口或者浏览器)将查询图像传输至云。在云上搜寻到了与该查询图像相同或相似的匹配图像后,将检索结果返回给用户。The system shown in Figure 1 includes at least the following two operating environments. As shown in FIG. 2, both the preprocessing section 100 and the online processing section 200 are deployed on the cloud. The system provides the image retrieval function as a cloud service to the user. The user transmits the query image to the cloud through the query interface/interface 207 (application programming interface or browser). After finding a matching image that is the same as or similar to the query image on the cloud, the search result is returned to the user.
如图3所示,预处理部分100部署在云上,利用云上充沛的计算资源和存储资源对庞大的匹配图像库105进行特征提取。在线处理部分200部署于用户设备上,由用户设备完成查询图像的特征提取和匹配功能。由于在线处理部分200需要的计算资源和存储资源较少,图3所示的运行环境中将在线处理部分200放置在用户设备上,进一步合理利用了云和用户设备的资源。图3所示的运行环境中,在线处理部分200可以由云的运营商以软件模块的方式提供给用户并安装在用户设备上。As shown in FIG. 3, the preprocessing section 100 is deployed on the cloud, and the abundant matching image resources and storage resources are used to extract features from the huge matching image library 105. The online processing part 200 is deployed on the user equipment, and the user equipment completes the feature extraction and matching functions of the query image. Since the online processing section 200 requires less computing resources and storage resources, the online processing section 200 is placed on the user equipment in the operating environment shown in FIG. 3, and the resources of the cloud and user equipment are further rationally utilized. In the operating environment shown in FIG. 3, the online processing part 200 may be provided to the user in the form of a software module by a cloud operator and installed on the user device.
如图4所示,预处理部分100部署在云上,同时第一匹配模块204,第二匹配模块205,第三匹配模块206也部署在云上。在线处理部分200的其他模块部署在用户设备上。图4所示的运行环境中将第一匹配模块204,第二匹配模块205,第三匹配模块206和特征库104都部署在云上,避免了特征库104和第一匹配模块204、第二匹配模块205、第三匹配模块206之间传输哈希值、全局特征、局部特征带来的网络资源消耗。同时,将在线处理部分200的其余模块放置在用户设备上,进一步合理利用了云和用户设备的资源。图4所示的运行环境中,局部特征提取模块201、全局特征提取模块202、哈希模块203、查询接口/界面207可以由云的运营商以软件模块的方式提供给用户并安装在用户设备上。As shown in FIG. 4, the preprocessing part 100 is deployed on the cloud, and the first matching module 204, the second matching module 205, and the third matching module 206 are also deployed on the cloud. The other modules of the online processing section 200 are deployed on the user equipment. In the operating environment shown in FIG. 4, the first matching module 204, the second matching module 205, the third matching module 206, and the feature library 104 are all deployed on the cloud to avoid the feature library 104, the first matching module 204, and the second The network resource consumption caused by the transmission of hash values, global features, and local features between the matching module 205 and the third matching module 206. At the same time, the remaining modules of the online processing section 200 are placed on the user equipment, and the resources of the cloud and the user equipment are further rationally utilized. In the operating environment shown in FIG. 4, the local feature extraction module 201, the global feature extraction module 202, the hash module 203, and the query interface/interface 207 can be provided to users by a cloud operator as software modules and installed on user devices on.
图5提供了预处理部分100执行的预处理方法流程图。FIG. 5 provides a flowchart of the preprocessing method performed by the preprocessing section 100.
S301,局部特征提取模块101从匹配图像库105获取匹配图像以及该匹配图像的标识ID。匹配图像库105内存储的每个匹配图像拥有唯一的ID。S301, the local feature extraction module 101 obtains the matching image and the identification ID of the matching image from the matching image library 105. Each matching image stored in the matching image library 105 has a unique ID.
S302,局部特征提取模块101为匹配图像提取局部特征,并将提取出的局部特征以及其相应的位置信息和匹配图像ID发送至特征库104。In S302, the local feature extraction module 101 extracts local features for the matching image, and sends the extracted local features and their corresponding position information and matching image ID to the feature database 104.
局部特征提取模块101可以包括至少一个子模块,每个子模块用于提取一种局部特征,例如,SIFT子模块用于从匹配图像中提取SIFT局部特征,SURF子模块用于从匹配图像中提取SURF局部特征。提取出的各种局部特征连同匹配图像ID被一并发送至特征库104。每种局部特征的每个局部特征的特征点的位置信息,例如在匹配图像 内的坐标或者区域信息,作为该局部特征的位置信息也被发送至特征库104。The local feature extraction module 101 may include at least one sub-module, each sub-module is used to extract a local feature, for example, the SIFT sub-module is used to extract SIFT local features from the matching image, and the SURF sub-module is used to extract SURF from the matching image Local features. The various local features extracted together with the matching image ID are sent to the feature library 104. The location information of the feature point of each local feature of each local feature, such as coordinates or area information in the matching image, is also sent to the feature library 104 as the location information of the local feature.
S303,匹配图像库105将匹配图像以及该匹配图像的标识ID发送至全局特征提取模块102。S303, the matching image library 105 sends the matching image and the identification ID of the matching image to the global feature extraction module 102.
S304/S306,全局特征提取模块102为匹配图像提取全局特征,并将提取出的全局特征和匹配图像ID发送至哈希模块103和特征库104。S304/S306, the global feature extraction module 102 extracts global features for the matching image, and sends the extracted global features and the matching image ID to the hash module 103 and the feature library 104.
全局特征提取模块102可以包括至少一个子模块,每个子模块用于提取一种局部特征,例如,RGB子模块用于从匹配图像中提取RGB全局特征,LBP子模块用于从匹配图像中提取LBP全局特征。提取出的各种全局特征连同匹配图像ID被一并发送至特征库104。全局特征提取模块102提取了全局特征后,可以并行执行S304和S306或以任何先后顺序执行S304和S306。The global feature extraction module 102 may include at least one submodule, each submodule is used to extract a local feature, for example, the RGB submodule is used to extract RGB global features from the matched image, and the LBP submodule is used to extract LBP from the matched image Global characteristics. The extracted various global features are sent to the feature library 104 together with the matching image ID. After the global feature extraction module 102 extracts the global features, S304 and S306 may be executed in parallel or in any order.
S305,哈希模块103对全局特征进行哈希,生成哈希值,将生成的哈希值和匹配图像ID发送至特征库104。S305, the hash module 103 hashes the global feature, generates a hash value, and sends the generated hash value and the matching image ID to the feature database 104.
S301-S302和S303-S306可以并行执行或以任何先后顺序执行。S301-S302 and S303-S306 can be executed in parallel or in any order.
针对匹配图像库105中每个匹配图像执行S301-S306后,特征库104内存储了每个匹配图像的一系列信息,包括匹配图像的ID,哈希值,全局特征,局部特征及其位置信息,如表1所示:After performing S301-S306 for each matching image in the matching image library 105, the feature library 104 stores a series of information for each matching image, including the ID, hash value, global features, local features and location information of the matching images ,As shown in Table 1:
图像IDImage ID 哈希值Hashes 全局特征Global feature 局部特征Local features 位置信息location information
ID 1 ID1 哈希值1Hash value 1 全局特征1 Global Features 1 局部特征1-1Local features 1-1 位置信息1-1Location Information 1-1
 A  A 全局特征2Global Features 2 局部特征1-2Local features 1-2 位置信息1-2Location information 1-2
 A  A 全局特征3Global Features 3 ...... ......
 A  A ...... 局部特征2-1Local features 2-1 位置信息2-1Location information 2-1
 A  A 全局特征MGlobal feature M ...... ......
 A  A  A 局部特征3-1Local features 3-1 位置信息3-1Location Information 3-1
 A  A  A ...... ......
 A  A  A 局部特征N-1Local features N-1 位置信息N-1Location information N-1
ID 2ID 2 ...... ...... ...... ......
表1Table 1
表1中记录了从匹配图像ID 1提取出的全局特征1至全局特征M,每个全局特征指代一种全局特征,例如全局特征1可以是RBG全局特征,全局特征2可以是LBP全局特征。表1中还记录了由全局特征1至全局特征M哈希生成的哈希值1,哈希值1可以由至少一个哈希值构成,也即可以将全局特征1至全局特征M组合后哈希成一个哈希值1,也可以将全局特征1至全局特征M划分为多段后分别哈希,哈希出多个哈希值以构成哈希值1。以匹配图像ID 1的全局特征包括M个,每个全局特征包括m i个维度为例,1≤i≤M。则匹配图像ID 1的哈希值1可以由∑m i个哈希值构成,也即将每个全局特征的每个维度哈希成一个哈希值。也可以将这M个全局特征任意组合后,对组合的结果进行哈希获得哈希值,此种情况下哈希值1由小于∑m i个哈希值构成。 Table 1 records the global feature 1 to the global feature M extracted from the matching image ID 1. Each global feature refers to a global feature. For example, the global feature 1 may be an RBG global feature, and the global feature 2 may be an LBP global feature. . Table 1 also records the hash value 1 generated from the hash of the global feature 1 to the global feature M. The hash value 1 can be composed of at least one hash value, that is, the global feature 1 to the global feature M can be combined. If a hash value 1 is desired, the global feature 1 to the global feature M may be divided into multiple segments and hashed separately, and multiple hash values are hashed to form a hash value 1. Taking the global features matching the image ID 1 including M, each global feature including mi dimensions as an example, 1≦ i ≦M. Then, the hash value 1 of the matching image ID 1 may be composed of ∑m i hash values, that is, each dimension of each global feature is hashed into one hash value. It is also possible to arbitrarily combine the M global features and hash the combined result to obtain a hash value. In this case, the hash value 1 is composed of less than ∑m i hash values.
示例性的,哈希模块103采用的哈希算法可以采用如下方式:将正数映射成1,将非正数映射成0。采用这种哈希算法且每个全局特征的每个维度被哈希成一个哈希值的情况下,匹配图像ID 1的共计∑m i个维度的全局特征被映射成了∑m i bit的二进 制序列,大幅降低了全局特征的复杂度,提升了后续第一候选集的匹配速度。 Exemplarily, the hashing algorithm adopted by the hashing module 103 may adopt the following manner: mapping a positive number to 1, and mapping a non-positive number to 0. When this hash algorithm is used and each dimension of each global feature is hashed into a hash value, the global features of ∑m i dimensions matching the image ID 1 are mapped to ∑m i bit The binary sequence greatly reduces the complexity of global features and improves the matching speed of the subsequent first candidate set.
表1中还记录了从匹配图像ID 1提取出的局部特征1-1至局部特征N-1以及每个局部特征的位置信息。由于匹配图像ID 1中一般可以针对每种局部特征提取多个特征点,例如局部特征1-1、局部特征1-2均是SIFT局部特征,局部特征201是SURF局部特征。表1中一共记录了M种全局特征和N种局部特征,M和N均为正整数。Table 1 also records the local feature 1-1 to the local feature N-1 extracted from the matching image ID 1 and the location information of each local feature. Since the matching image ID 1 can generally extract multiple feature points for each local feature, for example, the local feature 1-1 and the local feature 1-2 are SIFT local features, and the local feature 201 is a SURF local feature. A total of M global features and N local features are recorded in Table 1, M and N are both positive integers.
图6提供了特征库104中记录的每个局部特征的位置信息的示意图。图6中的图像中包括10个特征点,每个特征点对应于一个局部特征,不同特征点可以对应于相同或不同种类的局部特征。每个特征点对应的局部特征的位置信息包括特征点在图像中的坐标信息或特征点在图像中的区域信息。每个图像被分为H个区域,H为大于1的正整数。如图7所示,查询图像和匹配图像均可以被分为n行m列个区域,n*m等于H,m和n均为正整数,例如图6中的图像被分为3*3共计9个区域。因此,每个特征点对应的位置信息可以为每个特征点位于的区域ID,这种情况下,表1的位置信息如表2所示:FIG. 6 provides a schematic diagram of the location information of each local feature recorded in the feature library 104. The image in FIG. 6 includes 10 feature points, each feature point corresponds to a local feature, and different feature points may correspond to the same or different kinds of local features. The position information of the local feature corresponding to each feature point includes the coordinate information of the feature point in the image or the area information of the feature point in the image. Each image is divided into H areas, H is a positive integer greater than 1. As shown in Figure 7, both the query image and the matching image can be divided into n rows and m columns, n*m is equal to H, m and n are positive integers, for example, the image in Figure 6 is divided into 3*3 total 9 areas. Therefore, the location information corresponding to each feature point may be the area ID where each feature point is located. In this case, the location information of Table 1 is shown in Table 2:
图像IDImage ID 哈希值Hashes 全局特征Global feature 局部特征Local features 位置信息location information
ID 1 ID1 哈希值1Hash value 1 全局特征1 Global Features 1 局部特征1-1Local features 1-1 区域1Zone 1
 A  A 全局特征2Global Features 2 局部特征1-2Local features 1-2 区域6Zone 6
 A  A 全局特征3Global Features 3 ...... ......
 A  A ...... 局部特征2-1Local features 2-1 区域7Zone 7
 A  A 全局特征MGlobal feature M ...... ......
 A  A  A 局部特征3-1Local features 3-1 区域2Zone 2
 A  A  A ...... ......
 A  A  A 局部特征N-1Local features N-1 区域3Zone 3
ID 2ID 2 ...... ...... ...... ......
表2Table 2
预处理部分100还可以包括匹配图像获取模块,用于从其他图像库或者从网络获取新的匹配图像,并将新的匹配图像存入匹配图像库105。每当有新的匹配图像被存入匹配图像库105,预处理部分100的各个模块执行图5所示的流程,将新的匹配图像的哈希值和各类特征以及位置信息存入特征库104以便新的匹配图像能够被查询图像匹配上。The preprocessing part 100 may further include a matching image acquisition module for acquiring new matching images from other image libraries or from the network, and storing the new matching images in the matching image library 105. Whenever a new matching image is stored in the matching image library 105, each module of the preprocessing section 100 executes the process shown in FIG. 5, and stores the hash value of the new matching image and various types of features and position information in the feature library 104 so that the new matching image can be matched with the query image.
图8提供了在线处理部分200执行的在线处理方法流程图。FIG. 8 provides a flowchart of the online processing method performed by the online processing section 200.
S401,查询接口/界面207获取用户输入的查询图像,将查询图像发送至局部特征提取模块201。S401. The query interface/interface 207 acquires a query image input by the user, and sends the query image to the local feature extraction module 201.
S402,局部特征提取模块201提取查询图像的局部特征以及每个局部特征的位置信息,将查询图像的局部特征以及每个局部特征的位置信息发送至第三匹配模块206。S402参考S302。S402. The local feature extraction module 201 extracts the local features of the query image and the location information of each local feature, and sends the local features of the query image and the location information of each local feature to the third matching module 206. S402 refers to S302.
S403,查询接口/界面207将查询图像发送至全局特征提取模块202。S403, the query interface/interface 207 sends the query image to the global feature extraction module 202.
S404/S406,全局特征提取模块202提取查询图像中的全局特征,将全局特征发送至哈希模块203和第二匹配模块205。S404/S406参考S304/S306。S404/S406, the global feature extraction module 202 extracts the global features in the query image, and sends the global features to the hash module 203 and the second matching module 205. S404/S406 refer to S304/S306.
S405,哈希模块203对全局特征进行哈希,生成哈希值,将哈希值发送至第一匹 配模块204。S405参考S305以及前述哈希运算的相关描述。S405, the hash module 203 hashes the global feature, generates a hash value, and sends the hash value to the first matching module 204. S405 refers to S305 and the related description of the foregoing hash operation.
S407/S408,第一匹配模块204从特征库104获取匹配图像的哈希值和匹配图像的ID。获取匹配图像的哈希值和匹配图像的ID后,第一匹配模块204将查询图像的哈希值和匹配图像的哈希值进行匹配,根据匹配结果将匹配上的匹配图像的ID作为第一候选集发送至第二匹配模块205。第一匹配模块204匹配查询图像的哈希值和匹配图像的哈希值的方式可以为计算查询图像的哈希值和每个匹配图像的哈希值的相似度。第一匹配模块204将与查询图像的哈希值的相似度大于第一阈值的哈希值对应的匹配图像的ID作为第一候选集。或者,第一匹配模块204将匹配图像库105中与查询图像的哈希值的相似度最大的Q个哈希值对应的匹配图像的ID作为第一候选集,Q为正整数。In S407/S408, the first matching module 204 obtains the hash value of the matching image and the ID of the matching image from the feature library 104. After obtaining the hash value of the matching image and the ID of the matching image, the first matching module 204 matches the hash value of the query image and the hash value of the matching image, and takes the ID of the matching image on the match as the first according to the matching result The candidate set is sent to the second matching module 205. The first matching module 204 can match the hash value of the query image and the hash value of the matching image by calculating the similarity between the hash value of the query image and the hash value of each matching image. The first matching module 204 uses the ID of the matching image corresponding to the hash value of the hash value of the query image greater than the first threshold as the first candidate set. Alternatively, the first matching module 204 uses the IDs of the matching images corresponding to the Q hash values with the highest similarity of the hash values of the query images in the matching image library 105 as the first candidate set, where Q is a positive integer.
通过第一匹配模块204对匹配图像库105内的匹配图像进行初步筛选,大量筛除掉了与查询图像相似度较低的图像,提升了查询图像的匹配速度和匹配精度。Through the first matching module 204, the matching images in the matching image library 105 are preliminarily screened, and a large number of images with low similarity to the query image are eliminated, thereby improving the matching speed and matching accuracy of the query image.
S409,第二匹配模块205根据第一候选集内的匹配图像ID从特征库104获取匹配图像ID对应的全局特征。S409. The second matching module 205 obtains the global features corresponding to the matching image ID from the feature library 104 according to the matching image ID in the first candidate set.
S410,第二匹配模块205将查询图像的全局特征和获取的匹配图像的全局特征进行匹配,根据匹配结果将匹配上的匹配图像的ID作为第二候选集发送至第三匹配模块205。第二匹配模块205匹配查询图像的全局特征和第一候选集内的匹配图像的全局特征的方式可以为计算查询图像的全局特征和匹配图像的全局特征的相似度,即匹配结果包括查询图像的全局特征和匹配图像的全局特征的相似度。第二匹配模块205将与查询图像的全局特征的相似度大于第二阈值的全局特征对应的匹配图像的ID作为第二候选集。或者,第二匹配模块205将第一候选集中与查询图像的全局特征的相似度最大的W组全局特征对应的匹配图像的ID作为第二候选集,W为正整数。S410. The second matching module 205 matches the global features of the query image with the obtained global features of the matching image, and sends the ID of the matching image on the match as the second candidate set to the third matching module 205 according to the matching result. The second matching module 205 matches the global features of the query image and the global features of the matching images in the first candidate set by calculating the similarity between the global features of the query image and the global features of the matching image, that is, the matching result includes the query image’s The similarity between the global feature and the global feature of the matching image. The second matching module 205 uses the ID of the matching image corresponding to the global feature whose similarity of the global feature of the query image is greater than the second threshold as the second candidate set. Alternatively, the second matching module 205 uses the IDs of the matching images corresponding to the W groups of global features with the largest similarity of the global features of the query image in the first candidate set as the second candidate set, where W is a positive integer.
通过第二匹配模块205对第一候选集内的匹配图像进行进一步筛选,进一步从第一候选集中筛除了与查询图像相似度较低的图像,减少了后续匹配的计算量,进一步提升了查询图像的匹配速度和匹配精度。The second matching module 205 further filters the matching images in the first candidate set, further filters out images with a low similarity to the query image from the first candidate set, reduces the calculation amount of subsequent matching, and further improves the query image Matching speed and matching accuracy.
S411,第三匹配模块206根据第二候选集内的匹配图像ID从特征库104获取匹配图像ID对应的局部特征以及位置信息。In S411, the third matching module 206 obtains local features and position information corresponding to the matching image ID from the feature database 104 according to the matching image ID in the second candidate set.
S412,第三匹配模块206将查询图像的局部特征和相应的位置信息和获取的匹配图像的局部特征和相应的位置信息进行匹配,根据匹配结果确定匹配上的匹配图像的ID,根据匹配上的匹配图像的ID从匹配图像库105中获取相应的匹配图像作为检索结果。S412. The third matching module 206 matches the local features and corresponding location information of the query image with the obtained local features and corresponding location information of the matching image, determines the ID of the matching image based on the matching result, and determines the ID of the matching image based on the matching result. The ID of the matching image acquires the corresponding matching image from the matching image library 105 as the retrieval result.
S412包括两个部分,第一部分是局部特征的匹配,第二部分是匹配上的局部特征的位置信息的匹配。对查询图像和第二候选集中的每个匹配图像进行第一部分和第二部分的匹配,以判断第二候选集中哪些ID对应的匹配图像可以作为检索结果。S412 includes two parts, the first part is the matching of local features, and the second part is the matching of the location information of the local features on the match. The matching of the first part and the second part is performed on each matching image in the query image and the second candidate set to determine which matching images corresponding to IDs in the second candidate set can be used as the retrieval result.
第一部分,第三匹配模块206计算查询图像的每个局部特征与第二候选集中的匹配图像x的每一局部特征相似度,匹配图像x的ID为第二候选集合中之任一。如果匹配图像x的局部特征中与查询图像中的局部特征1相似度最大的局部特征为局部特征1-1,匹配图像x的局部特征中与查询图像中的局部特征1相似度次大的局部特征为局部特征1-2,且局部特征1与局部特征1-1的相似度为d 1局部特征1与局部特征1-2的相似度为d 2,如果d 1和d 2的比值小于第三阈值,则局部特征1与局部特征1-1匹配 成功。如果d 1和d 2的比值不小于第三阈值,那么查询图像的局部特征1在匹配图像x的局部特征中没有匹配的局部特征。第一部分完成后,第三匹配模块206获取了查询图像和每个匹配图像的匹配上的局部特征集合。以查询图像与匹配图像x匹配上了10个局部特征为例,该查询图像与匹配图像x匹配上的10个局部特征记为v 1至v 10,匹配图像x与该查询图像匹配上的10个局部特征记为V 1至V 10,其中v 1至v 10和V 1至V 10一一对应匹配。 In the first part, the third matching module 206 calculates the similarity between each local feature of the query image and each local feature of the matching image x in the second candidate set, and the ID of the matching image x is any one of the second candidate set. If the local feature with the highest similarity to the local feature 1 in the query image among the local features of the matching image x is the local feature 1-1, the local feature with the second highest similarity to the local feature 1 in the query image among the local features of the matching image x The feature is local feature 1-2, and the similarity between local feature 1 and local feature 1-1 is d 1 The similarity between local feature 1 and local feature 1-2 is d 2 , if the ratio of d 1 and d 2 is less than With three thresholds, the local feature 1 matches the local feature 1-1 successfully. If the ratio of d 1 and d 2 is not less than the third threshold, then the local feature 1 of the query image has no matching local feature among the local features of the matching image x. After the first part is completed, the third matching module 206 acquires the local feature set on the match between the query image and each matched image. Taking the query image and the matching image x matching 10 local features as an example, the query image and matching image x matching 10 local features are denoted as v 1 to v 10 , and the matching image x matching the query image is 10 The local features are denoted as V 1 to V 10 , where v 1 to v 10 and V 1 to V 10 are matched one-to-one.
第二部分,分别根据v 1至v 10在查询图像中的位置信息和V 1至V 10在匹配图像x中的位置信息,确定v 1至v 10在查询图像中的区域分布情况和V 1至V 10在匹配图像x中的区域分布情况。如果S402和S411中获取的位置信息是坐标的情况下,此时需要根据坐标确定v 1至v 10分别属于查询图像的哪个区域和根据坐标确定V 1至V 10分别属于匹配图像x的哪个区域。根据v 1至v 10在查询图像中的区域分布情况生成区域分布向量f i=[c 1,c 2,...,c H],其中c i代表了查询图像的区域i中包括的v 1至v 10对应的特征点的个数,1≤i≤H。根据V 1至V 10在匹配图像中的区域分布情况生成区域分布向量F i=[C 1,C 2,...,C H],其中C i代表了匹配图像的区域i中包括的V 1至V 10对应的特征点的个数,1≤i≤H。以图9为例,f i=[2,1,1,1,0,1,1,3,0],F i=[2,2,0,1,0,1,1,2,1]。计算f i和F i的相似度作为匹配结果,如果f i和F i的相似度大于第四阈值,则匹配图像x可以作为检索结果。第三匹配模块206根据匹配图像x的ID从匹配图像库104内获取对应的匹配图像作为检索结果。 The second part, according to the location information of v 1 to v 10 in the query image and the location information of V 1 to V 10 in the matching image x, determine the regional distribution of v 1 to v 10 in the query image and V 1 The distribution of the regions in V to 10 in the matching image x. If the location information acquired in S402 and S411 is coordinates, it is necessary to determine which region of the query image v 1 to v 10 belong to according to the coordinates and which region of the matching image x V 1 to V 10 belong to according to the coordinates . Generate the regional distribution vector f i =[c 1 ,c 2 ,...,c H ] according to the regional distribution of v 1 to v 10 in the query image, where c i represents v included in the region i of the query image The number of feature points corresponding to 1 to v 10 , 1≤i≤H. Generate a regional distribution vector F i =[C 1 ,C 2 ,...,C H ] according to the regional distribution of V 1 to V 10 in the matching image, where C i represents V included in the region i of the matching image The number of feature points corresponding to 1 to V 10 , 1≤i≤H. Take FIG. 9 as an example, f i =[2,1,1,1,0,1,1,3,0], F i =[2,2,0,1,0,1,1,2,1 ]. The similarity between f i and F i is calculated as the matching result. If the similarity between f i and F i is greater than the fourth threshold, the matching image x can be used as the retrieval result. The third matching module 206 obtains the corresponding matching image from the matching image library 104 according to the ID of the matching image x as a retrieval result.
通过以上第一部分和第二部分从第二候选集中进一步筛选出检索结果,进一步提升了检索结果的准确性。局部特征的位置信息的采用,使得查询图像和检索结果中的图像不仅要有较多的局部特征匹配,同时匹配上的局部特征对应的特征点在图像中的位置也要相似,保证了查询图像和匹配图像的相似度。Through the first part and the second part above, the search results are further selected from the second candidate set, and the accuracy of the search results is further improved. The use of location information of local features makes the query image and the image in the retrieval result not only have more local feature matches, but also the location of the feature points corresponding to the local features on the match in the image are similar, ensuring the query image Similarity to matching images.
可选的,S412中,可以通过第一部分和第二部分来从第二候选集中选取检索结果。也可以不采用第二部分,也即不采用局部特征的位置信息来从第二候选集中选取检索结果。这种情况下,前述图5和图8中局部特征提取模块101/201、第三匹配模块206、特征库104均无须生成、传送、存储局部特征的位置信息。仅采用第一部分的情况下,获取查询图像与匹配图像x匹配上的局部特征的数量后,判断匹配上的局部特征的数量是否大于第五阈值,或匹配上的局部特征的数量与查询图像内局部特征的数量的总数的比值是否大于第六阈值。如果匹配上的局部特征的数量大于第五阈值,或匹配上的局部特征的数量与查询图像内局部特征的数量的总数的比值大于第六阈值,则匹配图像x可以作为检索结果。Optionally, in S412, the retrieval result may be selected from the second candidate set through the first part and the second part. It is also possible to select the search result from the second candidate set without using the second part, that is, without using the position information of the local features. In this case, none of the aforementioned local feature extraction modules 101/201, the third matching module 206, and the feature library 104 in FIG. 5 and FIG. 8 need to generate, transmit, or store the location information of the local features. In the case of using only the first part, after obtaining the number of matching local features on the query image and the matching image x, determine whether the number of matching local features is greater than the fifth threshold, or the number of matching local features is within the query image Whether the ratio of the total number of local features is greater than the sixth threshold. If the number of local features on the match is greater than the fifth threshold, or the ratio of the number of local features on the match to the total number of local features in the query image is greater than the sixth threshold, the matching image x may be used as the retrieval result.
S413,第三匹配模块206将检索结果通过查询接口/界面207返回给用户。In S413, the third matching module 206 returns the search result to the user through the query interface/interface 207.
以上步骤中,S401至S402,S403至S406可以并列执行。S404至S405,S406可以并列执行。S407,S409,S411可以并列执行,也可以合并为一个步骤执行,即在S407中将哈希值、匹配图像ID、全局特征、局部特征和位置信息一并发送至第一匹配模块204,S408中第一匹配模块204除了发送第一候选集至第二匹配模块205,还发送了匹配图像的ID、全局特征、局部特征和位置信息至第二匹配模块205。S410中第二匹配模块205除了发送第二候选集至第三匹配模块206,还发送了匹配图像的ID、局部特征和位置信息至第三匹配模块206。In the above steps, S401 to S402 and S403 to S406 can be executed in parallel. S404 to S405 and S406 can be executed in parallel. S407, S409, and S411 can be executed in parallel or combined into one step, that is, the hash value, matching image ID, global features, local features, and location information are sent to the first matching module 204 in S407, and in S408 In addition to sending the first candidate set to the second matching module 205, the first matching module 204 also sends the ID, global features, local features, and location information of the matching image to the second matching module 205. In S410, in addition to sending the second candidate set to the third matching module 206, the second matching module 205 also sends the ID, local features, and position information of the matching image to the third matching module 206.
本申请还提供了一种预处理装置500用于执行预处理部分100,如图10所示,预处理装置500包括局部特征提取模块101,全局特征提取模块102,哈希模块103,特征库104和匹配图像库105。本申请还提供了一种图像检索装置600用于执行在线处理部分200,如图11所示,图像检索装置600包括局部特征提取模块201,全局特征提取模块202,哈希模块203,第一匹配模块204,第二匹配模块205和第三匹配模块206。预处理装置500和图像检索装置600中的各个模块可以为软件模块,特征库104可以为一个数据库或者由云存储服务提供的存储空间。The present application also provides a preprocessing device 500 for performing the preprocessing part 100. As shown in FIG. 10, the preprocessing device 500 includes a local feature extraction module 101, a global feature extraction module 102, a hash module 103, and a feature library 104和matching image library 105. The present application also provides an image retrieval device 600 for performing an online processing section 200. As shown in FIG. 11, the image retrieval device 600 includes a local feature extraction module 201, a global feature extraction module 202, a hash module 203, and a first match Module 204, second matching module 205 and third matching module 206. Each module in the preprocessing device 500 and the image retrieval device 600 may be a software module, and the feature library 104 may be a database or a storage space provided by a cloud storage service.
本申请还提供了一种图像检索系统700。如图12所示,图像检索系统700包括预处理集群和在线处理集群,预处理集群用于执行预处理部分100,在线处理集群用于处理在线处理部分200,每个集群包括至少一个计算设备705。计算设备705包括总线703、处理器701、通信接口702和存储器704。处理器701、存储器704和通信接口702之间通过总线703通信。The present application also provides an image retrieval system 700. As shown in FIG. 12, the image retrieval system 700 includes a preprocessing cluster and an online processing cluster. The preprocessing cluster is used to perform the preprocessing section 100, and the online processing cluster is used to process the online processing section 200. Each cluster includes at least one computing device 705 . The computing device 705 includes a bus 703, a processor 701, a communication interface 702, and a memory 704. The processor 701, the memory 704, and the communication interface 702 communicate via a bus 703.
其中,处理器701可以为中央处理器(英文:central processing unit,缩写:CPU)。存储器可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random access memory,缩写:RAM)。存储器704还可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器,HDD或SSD。存储器704中存储有可执行的程序代码,处理器701执行该可执行代码以执行前述图5和图8的方法。存储器704中还可以包括操作系统等其他运行进程所需的软件模块。操作系统可以为LINUX TM,UNIX TM,WINDOWS TM等。 The processor 701 may be a central processing unit (English: central processing unit, abbreviation: CPU). The memory may include a volatile memory (English: volatile memory), for example, a random access memory (English: random access memory, abbreviation: RAM). The memory 704 may also include non-volatile memory (English: non-volatile memory), such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory, HDD, or SSD. An executable program code is stored in the memory 704, and the processor 701 executes the executable code to perform the aforementioned methods of FIGS. 5 and 8. The memory 704 may further include software modules required by other operating processes such as an operating system. The operating system can be LINUX TM , UNIX TM , WINDOWS TM and so on.
计算设备705的存储器704中存储了运行预处理装置500和图像检索装置600中各个模块所需的代码,处理器701执行这些代码实现了预处理装置500和图像检索装置600的功能,即执行了图5和图8所示的方法。预处理集群中的计算设备700可以为云环境中的计算设备。在线处理集群中的计算设备700可以为云环境中的计算设备,或边缘环境中的计算设备或用户环境中的计算设备。特征库104和匹配图像库105所需占用的存储资源较大,也可以存储于预处理集群中的存储集群中。在线处理系统与用户的查询接口/界面207通信,获取用户输入的查询图像和返回检索结果给用户。The memory 704 of the computing device 705 stores codes required to run each module in the preprocessing apparatus 500 and the image retrieval apparatus 600, and the processor 701 executes these codes to realize the functions of the preprocessing apparatus 500 and the image retrieval apparatus 600, that is, executes The methods shown in Figures 5 and 8. The computing device 700 in the pre-processing cluster may be a computing device in a cloud environment. The computing device 700 in the online processing cluster may be a computing device in a cloud environment, or a computing device in an edge environment or a computing device in a user environment. The storage resources required by the feature library 104 and the matching image library 105 are relatively large, and can also be stored in the storage cluster in the preprocessing cluster. The online processing system communicates with the user's query interface/interface 207 to obtain the query image input by the user and return the search result to the user.
上述各个附图对应的流程的描述各有侧重,某个流程中没有详述的部分,可以参见其他流程的相关描述。The description of the processes corresponding to the above drawings has its own emphasis. For a part of a process that is not detailed, please refer to the relevant descriptions of other processes.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、 磁带)、光介质(例如,DVD)、或者半导体介质(例如SSD)等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be from a website site, computer, server or data center Transmit to another website, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be a computer Any available media that can be accessed or a data storage device that includes one or more available media integrated servers, data centers, etc. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg , DVD), or semiconductor media (such as SSD), etc.

Claims (10)

  1. 一种计算设备执行的图像检索方法,其特征在于,包括:An image retrieval method performed by a computing device is characterized by including:
    获取查询图像的全局特征的哈希值,匹配所述查询图像的全局特征的哈希值和匹配图像库的匹配图像的全局特征的哈希值;Acquiring the hash value of the global feature of the query image, matching the hash value of the global feature of the query image and the hash value of the global feature of the matching image of the matching image library;
    根据所述查询图像的全局特征的哈希值和所述匹配图像库的匹配图像的全局特征的哈希值的匹配结果,从所述匹配图像库的匹配图像中选取第一候选集;Selecting the first candidate set from the matching images of the matching image library according to the matching result of the hash values of the global features of the query image and the hash values of the global features of the matching images of the matching image library;
    获取所述查询图像的全局特征,匹配所述查询图像的全局特征和所述第一候选集中的匹配图像的全局特征;Acquiring the global features of the query image, matching the global features of the query image and the global features of the matching images in the first candidate set;
    根据所述查询图像的全局特征和所述第一候选集中的匹配图像的全局特征的匹配结果,从所述第一候选集的匹配图像中选取第二候选集;Selecting a second candidate set from the matching images of the first candidate set according to the matching result of the global features of the query image and the global features of the matching images in the first candidate set;
    获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;Acquiring the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set;
    根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果。The retrieval result is determined from the matching images of the second candidate set according to the matching results of the local features of the query image and the local features of the matching images in the second candidate set.
  2. 如权利要求1所述的方法,其特征在于,还包括:获取所述查询图像的局部特征在所述查询图像的区域信息;The method according to claim 1, further comprising: acquiring regional information of local features of the query image in the query image;
    所述获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果包括:Acquiring the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set; according to the matching of the local features of the query image and the second candidate set The matching result of the local features of the image, and determining the retrieval result from the matching images of the second candidate set includes:
    匹配所述查询图像的局部特征的区域信息和所述第二候选集中的匹配图像的局部特征的区域信息;Region information matching the local features of the query image and region information of the local features of the matching images in the second candidate set;
    根据所述查询图像的局部特征的区域信息和所述第二候选集中的匹配图像的局部特征的区域信息的匹配结果,从所述第二候选集的匹配图像中确定所述检索结果,所述检索结果中的匹配图像的局部特征的区域信息和所述查询图像的局部特征的区域信息的相似度大于第一阈值。Determine the retrieval result from the matching images of the second candidate set according to the matching result of the region information of the local features of the query image and the region information of the local features of the matching images in the second candidate set, the The similarity between the region information of the local feature of the matching image and the region information of the local feature of the query image in the search result is greater than the first threshold.
  3. 如权利要求1所述的方法,其特征在于,还包括:获取所述查询图像的局部特征在所述查询图像的区域信息;The method according to claim 1, further comprising: acquiring regional information of local features of the query image in the query image;
    所述获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果包括:Acquiring the local features of the query image, matching the local features of the query image and the local features of the matching image in the second candidate set; according to the matching of the local features of the query image and the second candidate set The matching result of the local features of the image, and determining the retrieval result from the matching images of the second candidate set includes:
    匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;Matching the local features of the query image and the local features of the matching image in the second candidate set;
    根据所述查询图像的局部特征的区域信息,获取匹配上的所述查询图像的局部特征在所述查询图像的第一区域分布向量;Acquiring, according to the region information of the local features of the query image, the matching local features of the query image in the first region of the query image;
    根据所述第二候选集的匹配图像的局部特征的区域信息,获取匹配上的所述第二候选集的匹配图像的局部特征在所述第二候选集的匹配图像的第二区域分布向量;Acquiring, according to the region information of the local features of the matching images of the second candidate set, the local features of the matching images of the second candidate set on the match in the second region of the matching images of the second candidate set;
    判断所述第一区域分布向量和所述第二区域分布向量的相似度是否大于第二阈值,如果所述第一区域分布向量和所述第二区域分布向量的相似度大于第二阈值,确定所述第二候选集中的匹配图像包括于所述检索结果。Determine whether the similarity between the first area distribution vector and the second area distribution vector is greater than a second threshold, and if the similarity between the first area distribution vector and the second area distribution vector is greater than a second threshold, determine The matching image in the second candidate set is included in the retrieval result.
  4. 一种图像检索装置,其特征在于,包括:An image retrieval device is characterized by comprising:
    第一匹配模块,用于获取查询图像的全局特征的哈希值,匹配所述查询图像的全局特征的哈希值和匹配图像库的匹配图像的全局特征的哈希值;根据所述查询图像的全局特征的哈希值和所述匹配图像库的匹配图像的全局特征的哈希值的匹配结果,从所述匹配图像库的匹配图像中选取第一候选集;将所述第一候选集发送至第二匹配模块;The first matching module is used to obtain the hash value of the global feature of the query image, match the hash value of the global feature of the query image and the hash value of the global feature of the matching image of the matching image library; according to the query image A matching result of the hash value of the global feature of the global feature and the hash value of the global feature of the matching image of the matching image library, selecting a first candidate set from the matching images of the matching image library; Send to the second matching module;
    所述第二匹配模块,用于获取所述查询图像的全局特征,匹配所述查询图像的全局特征和所述第一候选集中的匹配图像的全局特征;根据所述查询图像的全局特征和所述第一候选集中的匹配图像的全局特征的匹配结果,从所述第一候选集的匹配图像中选取第二候选集;将所述第二候选集发送至第三匹配模块;The second matching module is used to obtain the global features of the query image, match the global features of the query image and the global features of the matching images in the first candidate set; according to the global features and the query image A matching result of the global features of the matching images in the first candidate set, selecting a second candidate set from the matching images in the first candidate set; sending the second candidate set to a third matching module;
    所述第三匹配模块,用于获取所述查询图像的局部特征,匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征的匹配结果,从所述第二候选集的匹配图像中确定检索结果。The third matching module is used to obtain the local features of the query image, match the local features of the query image and the local features of the matching image in the second candidate set; according to the local features of the query image and all The matching result of the local features of the matching images in the second candidate set is determined from the matching images in the second candidate set.
  5. 如权利要求4所述的装置,其特征在于,所述第三匹配模块用于:The apparatus of claim 4, wherein the third matching module is used to:
    获取所述查询图像的局部特征在所述查询图像的区域信息;匹配所述查询图像的局部特征的区域信息和所述第二候选集中的匹配图像的局部特征的区域信息;根据所述查询图像的局部特征的区域信息和所述第二候选集中的匹配图像的局部特征的区域信息的匹配结果,从所述第二候选集的匹配图像中确定所述检索结果,所述检索结果中的匹配图像的局部特征的区域信息和所述查询图像的局部特征的区域信息的相似度大于第一阈值。Acquiring the region information of the local feature of the query image in the query image; the region information matching the local feature of the query image and the region information of the local feature of the matching image in the second candidate set; according to the query image The matching result of the local information of the local feature and the local feature of the matching image in the second candidate set, the search result is determined from the matching image of the second candidate set, and the match in the search result The similarity between the area information of the local features of the image and the area information of the local features of the query image is greater than the first threshold.
  6. 如权利要求4所述的装置,其特征在于,所述第三匹配模块用于:The apparatus of claim 4, wherein the third matching module is used to:
    获取所述查询图像的局部特征在所述查询图像的区域信息;匹配所述查询图像的局部特征和所述第二候选集中的匹配图像的局部特征;根据所述查询图像的局部特征的区域信息,获取匹配上的所述查询图像的局部特征在所述查询图像的第一区域分布向量;根据所述第二候选集的匹配图像的局部特征的区域信息,获取匹配上的所述第二候选集的匹配图像的局部特征在所述第二候选集的匹配图像的第二区域分布向量;判断所述第一区域分布向量和所述第二区域分布向量的相似度是否大于第二阈值,如果所述第一区域分布向量和所述第二区域分布向量的相似度大于第二阈值,确定所述第二候选集中的匹配图像包括于所述检索结果。Obtain the local information of the local features of the query image in the query image; match the local features of the query image and the local features of the matching image in the second candidate set; and regional information based on the local features of the query image , Obtain the local features of the matching image on the query image in the first region of the query image distribution; according to the second candidate set of matching image local features of the regional information, get the matching on the second candidate The local features of the matching image of the set are distributed in the second region of the matching image of the second candidate set; determining whether the similarity between the first region distribution vector and the second region distribution vector is greater than the second threshold, if The similarity between the first area distribution vector and the second area distribution vector is greater than a second threshold, and it is determined that the matching images in the second candidate set are included in the retrieval result.
  7. 一种计算设备系统,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器,所述至少一个计算设备的处理器用于执行存储器中的程序代码以执行权利要求1至3任一所述的方法。A computing device system, characterized in that it includes at least one computing device, each computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute the program code in the memory to execute any of claims 1 to 3 One of the methods.
  8. 一种非瞬态的可读存储介质,其特征在于,所述非瞬态的可读存储介质被计算设备执行时,所述计算设备执行上述权利要求1至3任一所述的方法。A non-transitory readable storage medium, characterized in that, when the non-transitory readable storage medium is executed by a computing device, the computing device performs the method according to any one of claims 1 to 3 above.
  9. 一种计算设备执行的图像匹配方法,其特征在于,包括:An image matching method performed by a computing device is characterized in that it includes:
    获取查询图像的至少一个局部特征的区域信息和匹配图像的至少一个局部特征的区域信息;Acquiring area information of at least one local feature of the query image and area information of at least one local feature of the matching image;
    根据所述查询图像的至少一个局部特征的区域信息,获取所述查询图像的至少一个局部特征在所述查询图像的第一区域分布向量,所述第一区域分布向量包括所述查 询图像的每个区域内包括的局部特征的数量;According to the region information of at least one local feature of the query image, obtain a distribution vector of at least one local feature of the query image in a first region of the query image, where the first region distribution vector includes each of the query images The number of local features included in each area;
    根据所述匹配图像的至少一个局部特征的区域信息,获取所述匹配图像的至少一个局部特征在所述匹配图像的第二区域分布向量,所述第二区域分布向量包括所述匹配图像的每个区域内包括的局部特征的数量;According to the region information of the at least one local feature of the matching image, obtain the distribution vector of the at least one local feature of the matching image in the second region of the matching image, where the second region distribution vector includes each of the matching images The number of local features included in each area;
    确定所述第一区域分布向量和所述第二区域分布向量的相似度大于阈值;Determining that the similarity between the first area distribution vector and the second area distribution vector is greater than a threshold;
    确定所述查询图像与所述匹配图像匹配。It is determined that the query image matches the matching image.
  10. 一种计算设备系统,其特征在于,包括至少一个计算设备,每个计算设备包括处理器和存储器,所述至少一个计算设备的处理器用于执行存储器中的程序代码以执行权利要求9所述的方法。A computing device system, characterized in that it includes at least one computing device, each computing device includes a processor and a memory, and the processor of the at least one computing device is used to execute the program code in the memory to execute the program of claim 9 method.
PCT/CN2019/106737 2018-12-21 2019-09-19 Image search method, apparatus, and device WO2020125100A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811568022.2 2018-12-21
CN201811568022.2A CN111353062A (en) 2018-12-21 2018-12-21 Image retrieval method, device and equipment

Publications (1)

Publication Number Publication Date
WO2020125100A1 true WO2020125100A1 (en) 2020-06-25

Family

ID=71102024

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/106737 WO2020125100A1 (en) 2018-12-21 2019-09-19 Image search method, apparatus, and device

Country Status (2)

Country Link
CN (1) CN111353062A (en)
WO (1) WO2020125100A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112329889A (en) * 2020-11-26 2021-02-05 Oppo广东移动通信有限公司 Image processing method and device and electronic equipment
CN113160167B (en) * 2021-04-16 2022-01-14 深圳市铱硙医疗科技有限公司 Medical image data extraction working method through deep learning network model
WO2023272659A1 (en) * 2021-06-30 2023-01-05 东莞市小精灵教育软件有限公司 Method and apparatus for recognizing cover image, storage medium, and recognition device
CN114359590A (en) * 2021-12-06 2022-04-15 支付宝(杭州)信息技术有限公司 NFT image work infringement detection method and device and computer storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100290708A1 (en) * 2009-05-12 2010-11-18 Canon Kabushiki Kaisha Image retrieval apparatus, control method for the same, and storage medium
CN102368237A (en) * 2010-10-18 2012-03-07 中国科学技术大学 Image retrieval method, device and system
CN103177105A (en) * 2013-03-26 2013-06-26 新浪网技术(中国)有限公司 Method and device of image search
CN103995864A (en) * 2014-05-19 2014-08-20 深圳先进技术研究院 Image retrieval method and device
CN105608230A (en) * 2016-02-03 2016-05-25 南京云创大数据科技股份有限公司 Image retrieval based business information recommendation system and image retrieval based business information recommendation method
CN106383891A (en) * 2016-09-22 2017-02-08 重庆理工大学 Deep hash-based medical image distributed retrieval method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542058B (en) * 2011-12-29 2013-04-03 天津大学 Hierarchical landmark identification method integrating global visual characteristics and local visual characteristics
CN105069089B (en) * 2015-08-04 2019-02-12 小米科技有限责任公司 Picture detection method and device
CN107239535A (en) * 2017-05-31 2017-10-10 北京小米移动软件有限公司 Similar pictures search method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100290708A1 (en) * 2009-05-12 2010-11-18 Canon Kabushiki Kaisha Image retrieval apparatus, control method for the same, and storage medium
CN102368237A (en) * 2010-10-18 2012-03-07 中国科学技术大学 Image retrieval method, device and system
CN103177105A (en) * 2013-03-26 2013-06-26 新浪网技术(中国)有限公司 Method and device of image search
CN103995864A (en) * 2014-05-19 2014-08-20 深圳先进技术研究院 Image retrieval method and device
CN105608230A (en) * 2016-02-03 2016-05-25 南京云创大数据科技股份有限公司 Image retrieval based business information recommendation system and image retrieval based business information recommendation method
CN106383891A (en) * 2016-09-22 2017-02-08 重庆理工大学 Deep hash-based medical image distributed retrieval method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU, XUETING: "Research of Image Retrieval Based on the Fusion of Local and Global Features", ELECTRONIC TECHNOLOGY & INFORMATION SCIENCE, CHINA MASTER’S THESES FULL-TEXT DATABASE, no. 8, 15 August 2016 (2016-08-15) *

Also Published As

Publication number Publication date
CN111353062A (en) 2020-06-30

Similar Documents

Publication Publication Date Title
WO2020125100A1 (en) Image search method, apparatus, and device
EP3477506B1 (en) Video detection method, server and storage medium
Simonyan et al. Learning local feature descriptors using convex optimisation
CN109710780B (en) Archiving method and device
US10061999B1 (en) System and method for using segmentation to identify object location in images
JP6099793B2 (en) Method and system for automatic selection of one or more image processing algorithms
EP2805262B1 (en) Image index generation based on similarities of image features
CN111651636B (en) Video similar segment searching method and device
US10997459B2 (en) Video content indexing and searching
Zhang et al. Panorama: a data system for unbounded vocabulary querying over video
JP2020525935A (en) Method and apparatus for determining duplicate video
Zhi et al. Two-stage pooling of deep convolutional features for image retrieval
US11714921B2 (en) Image processing method with ash code on local feature vectors, image processing device and storage medium
WO2019080908A1 (en) Image processing method and apparatus for implementing image recognition, and electronic device
Wang et al. Duplicate discovery on 2 billion internet images
CN109800318B (en) Filing method and device
US20180247152A1 (en) Method and apparatus for distance measurement
US20160232428A1 (en) Efficient local feature descriptor filtering
US20220139085A1 (en) Method and apparatus for video frame processing
Xie et al. Bag-of-words feature representation for blind image quality assessment with local quantized pattern
CN109697240B (en) Image retrieval method and device based on features
WO2019100348A1 (en) Image retrieval method and device, and image library generation method and device
Reta et al. Color uniformity descriptor: An efficient contextual color representation for image indexing and retrieval
US20230222762A1 (en) Adversarially robust visual fingerprinting and image provenance models
CN114860991A (en) Short video de-duplication method and computer readable storage medium

Legal Events

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

Ref document number: 19901374

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19901374

Country of ref document: EP

Kind code of ref document: A1