WO2020253063A1 - 一种相似图片的检索方法及装置 - Google Patents

一种相似图片的检索方法及装置 Download PDF

Info

Publication number
WO2020253063A1
WO2020253063A1 PCT/CN2019/118369 CN2019118369W WO2020253063A1 WO 2020253063 A1 WO2020253063 A1 WO 2020253063A1 CN 2019118369 W CN2019118369 W CN 2019118369W WO 2020253063 A1 WO2020253063 A1 WO 2020253063A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
target
color
pictures
similarity
Prior art date
Application number
PCT/CN2019/118369
Other languages
English (en)
French (fr)
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 WO2020253063A1 publication Critical patent/WO2020253063A1/zh

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
    • G06F16/538Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Definitions

  • This application relates to the field of image processing technology, in particular to a method and device for searching similar pictures.
  • methods for retrieving similar pictures include: obtaining multiple saliency regions of a target picture; extracting convolutional neural network CNN features of multiple saliency regions; and obtaining information about the target image based on the CNN features of multiple saliency regions Feature vector: According to the feature vector of the target picture, a similar picture matching the target picture is obtained from multiple candidate pictures included in the candidate picture group of the target picture.
  • Convolutional Neural Networks is a type of feedforward neural network that includes convolution calculations and has a deep structure. Convolutional neural network imitates the construction of biological visual perception mechanism, which can perform supervised learning and unsupervised learning.
  • the convolution kernel parameter sharing in the hidden layer and the sparsity of inter-layer connections enable the convolutional neural network to perform smaller calculations
  • Quantitative learning of lattice features has been widely used in computer vision, natural language processing and other fields. When searching for similar images, users may need to find products with similar colors, similar styles, similar texts, or the same brand.
  • the existing method of retrieving similar pictures is based on the CNN feature comparison search of the salient area of the overall picture, ignoring insignificant features such as brand trademarks and text, resulting in a large deviation between the retrieval results and the retrieval needs of users.
  • the present application provides a search method and device for similar pictures, the main purpose of which is to solve the problem of large deviations between search results and user search requirements in the prior art.
  • a method for searching similar pictures including:
  • the edge detection method extract the overall feature information of the target picture; according to the overall feature information, calculate the overall similarity between the picture to be tested and the target picture; extract the detailed feature information of the target picture according to the Mask RCNN model; The detailed feature information calculates the detail similarity between the picture to be tested and the target picture; calculates the picture to be tested and the target according to the overall similarity, the detail similarity and preset retrieval weights Retrieval similarity of pictures; display the pictures to be tested corresponding to the retrieval similarity in descending order of the value of the retrieval similarity.
  • a similar picture retrieval device including:
  • the extraction module is used to extract the overall feature information of the target picture according to the edge detection method; the first calculation module is used to calculate the overall similarity between the picture to be tested and the target picture according to the overall feature information; the extraction module , Used to extract the detailed feature information of the target picture according to the Mask RCNN model; the first calculation module is also used to calculate the detailed similarity between the picture to be tested and the target picture according to the detailed feature information; The second calculation module is used to calculate the retrieval similarity between the picture to be tested and the target picture according to the overall similarity, the detail similarity and preset retrieval weights; the display module is used to The numerical value of the search similarity is in descending order, and the pictures to be tested corresponding to the search similarity are displayed.
  • a computer-readable storage medium stores at least one computer-readable executable instruction, and the computer-readable executable instruction causes a processor to execute Operation corresponding to the retrieval method of similar pictures.
  • a computer device including: a processor, a memory, a communication interface, and a communication bus.
  • the processor, the memory, and the communication interface complete mutual communication through the communication bus.
  • Communication; the memory is used to store at least one computer-readable executable instruction, the computer-readable executable instruction causes the processor to perform operations corresponding to the above-mentioned similar image retrieval method.
  • this application provides a method and device for searching similar pictures.
  • the edge detection method the overall feature information of the target picture is extracted, and the test is calculated.
  • the overall similarity between the picture and the target picture extract the detailed feature information of the target picture according to the Mask RCNN model, and then calculate the detail similarity between the picture to be tested and the target picture according to the detailed feature information, and then according to the overall similarity and details
  • Similarity and preset retrieval weights are used to calculate the retrieval similarity between the picture to be tested and the target picture, and finally the pictures to be tested corresponding to the retrieval similarity are displayed in descending order of the retrieval similarity value.
  • the embodiment of the present application uses different preset retrieval weights for overall similarity and detail similarity to calculate the retrieval similarity between the picture to be tested and the target picture.
  • Fig. 1 shows a flowchart of a method for searching similar pictures provided by an embodiment of the present application
  • Figure 2 shows a flowchart of another method for retrieving similar pictures provided by an embodiment of the present application
  • Fig. 3 shows a block diagram of a similar picture retrieval device provided by an embodiment of the present application
  • Fig. 4 shows a block diagram of another similar picture retrieval device provided by an embodiment of the present application.
  • Fig. 5 shows a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the embodiment of the present application provides a method for searching similar pictures. As shown in FIG. 1, the method includes:
  • the target image refers to the product image that the user has inquired about.
  • the purpose of this application is to retrieve similar images of the target image.
  • the overall feature information refers to the overall information of the object in the target graphic, including color and outline. Assuming that the content of the target image is a white coat of brand A, the white coat is the overall feature information.
  • Edge detection methods can greatly reduce the amount of data, and eliminate irrelevant information, while retaining the important structural attributes of the image, which is conducive to extracting the overall feature information.
  • Edge detection methods can be divided into two categories: first-order derivative search method and second-order derivative zero-crossing method.
  • the search-based method detects the boundary by finding the maximum and minimum values in the first derivative of the image, and usually locates the boundary in the direction of the maximum gradient.
  • the method based on zero crossing finds the boundary by looking for the second derivative zero crossing of the image, usually the Laplacian zero crossing point or the zero crossing point represented by the nonlinear difference.
  • the target image content is a white coat of brand A, and the shape and color of the coat are extracted.
  • the picture to be tested refers to all pictures that may be similar to the target picture, may be all pictures in the system, may be related pictures retrieved based on the text description of the target picture, or may be retrieved based on the attributes of the object in the target picture Related graphics.
  • the source and quantity of the pictures to be tested are not limited.
  • the method for obtaining the overall feature information of the target picture is the same as that of obtaining the overall feature information of the picture to be tested, and then calculating the overall similarity between the picture to be tested and the target picture.
  • the overall similarity can be calculated according to methods such as Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity or Pearson correlation coefficient.
  • the target image refers to the product image that the user has inquired about.
  • the purpose of this application is to retrieve similar images of the target image.
  • the detailed feature information refers to the detailed part of the target picture, which refers to the part of the image that occupies a small proportion relative to the entire picture but has rich information. Assuming that the target image content is a white coat of brand A, brand A is the detailed feature information, and brand A refers to the shape of the brand's trademark, or the shape and color of the trademark.
  • the algorithm model of the Mask RCNN algorithm needs to be trained by training pictures marked with the detailed feature information of the target picture.
  • the content of the target image is a white coat of brand A, and the shape of the trademark and the shape of the general coat are marked during the training of the training image. Through training, the target image can distinguish the coat and the trademark on the coat.
  • the method is the same as that of obtaining the detailed feature information of the target picture.
  • the detailed feature information of the picture to be tested is obtained, and then the detail similarity between the picture to be tested and the target picture is calculated.
  • the detail similarity can be calculated according to methods such as Euclidean distance, Manhattan distance, Minkowski distance, cosine similarity or Pearson correlation coefficient.
  • the preset retrieval weight refers to the proportion of overall similarity and detail similarity when calculating retrieval similarity. Assuming that the preset retrieval weight is 1:2, the weight corresponding to the overall similarity is 1, the weight corresponding to the detail similarity is 2, and the retrieval similarity is the sum of the overall similarity multiplied by 1, and the detail similarity multiplied by 2. When calculating search similarity, you can set the preset search weight sum to 1. Then suppose the preset search weight is 1:2, the weight corresponding to the overall similarity is 1/3, and the weight corresponding to the detail similarity is 2/3. The retrieval similarity is the sum of the overall similarity multiplied by 1/3, and the detail similarity multiplied by 2/3.
  • Sort the search similarity values from largest to smallest find the pictures to be tested corresponding to the search similarity according to their order, and then display the pictures to be tested.
  • display set the number of images displayed at the same time according to the size of the display area.
  • This application provides a method for searching similar pictures.
  • the embodiment of the present application uses different preset retrieval weights for overall similarity and detail similarity to calculate the retrieval similarity between the picture to be tested and the target picture.
  • the embodiment of the present application provides another method for retrieving similar pictures. As shown in FIG. 2, the method includes:
  • the target image refers to the product image that the user queries.
  • the purpose of this application is to retrieve similar images of the target image.
  • the overall feature information refers to the overall information of the object in the target graphic, including color and outline. Assuming that the content of the target image is a white coat of brand A, the white coat is the overall feature information.
  • the overall feature information includes the target object color and target edge contour.
  • Obtaining the overall feature information of the target picture specifically includes: using an edge detection method to identify and extract the target edge contour of the target object in the target picture; and extract the target object of the target object within the target edge contour colour.
  • Image edge detection greatly reduces the amount of data, and eliminates information that can be considered irrelevant, retaining the important structural attributes of the image.
  • the edge contour of the target is extracted and identified by edge detection algorithm.
  • the target edge contour is the contour of the target object in the target picture, so the color in the target edge contour is the actual color of the target object.
  • Extracting the target object color of the target object within the target edge contour specifically includes: dividing the target picture into a plurality of grid pictures according to the first preset division granularity; querying the target edge contour in the target picture The grid color of each grid picture, where the grid color includes a single color and a mixed color; calculating the mixed color of the number of pictures whose grid color is a mixed color compared to the total number of grid pictures Ratio; if the mixed color ratio is greater than the first preset ratio, then re-divide the target picture according to the second preset division granularity; if the mixed color ratio is not greater than the first preset ratio, record the The grid color is the number of single-color pictures of each color of the single-color grid pictures; if the single-color ratio of the number of single-color pictures to the total number of grid pictures is greater than the second preset ratio, determine all The grid color corresponding to the number of single-color pictures is the target object color; if the difference between the number of single-color pictures of each color is less than
  • the picture to be tested refers to all pictures that may be similar to the target picture, may be all pictures in the system, may be related pictures retrieved based on the text description of the target picture, or may be retrieved based on the attributes of the object in the target picture Related graphics.
  • the source and quantity of the pictures to be tested are not limited.
  • This step specifically includes: acquiring the overall feature information of the picture to be tested, the overall feature information of the picture to be tested includes the color of the object to be tested and the edge contour of the test; according to the overall feature information of the picture to be tested, the target Object color and the target edge contour, calculate the object color similarity and edge contour similarity between the target picture and the picture to be measured; calculate the overall ratio between the target picture and the picture to be measured according to the preset overall weight State the overall similarity.
  • the preset overall proportion refers to the proportion of object color similarity and edge contour similarity when calculating the overall similarity.
  • the target image refers to the product image that the user queries.
  • the purpose of this application is to retrieve similar images of the target image.
  • the detailed feature information refers to the detailed part of the target picture, which refers to the part of the image that occupies a small proportion relative to the entire picture but has rich information. Assuming that the target image content is a white coat of brand A, brand A is the detailed feature information.
  • Existing items such as clothing, shoes, hats, and electronic products usually include two similarities when searching for similar products. One is the same in detail and the other is similar in overall features.
  • the detailed feature information includes special graphics such as text trademarks, pattern trademarks, prints, embroidery, etc., which are often similar to the overall color of the target graphics or have a large color contrast. This difference is used as the basis for obtaining detailed feature information.
  • Extracting detailed feature information of a target picture specifically includes: extracting a grid picture whose grid color is a mixed color; filtering out the color of the target object in a grid picture whose grid color is a mixed color to obtain a grid feature picture ; Determine whether the picture contour in the grid feature picture is a closed contour; if the result of the judgment is yes, determine the character or figure contour in the grid feature picture as detailed feature information; if the judgment result is no, then Combine the grid picture with the mixed color of the grid color and its adjacent grid pictures, filter out the color of the target object, and obtain the grid feature picture again.
  • Combining a grid picture whose grid color is a mixed color and its adjacent grid pictures means that the grid picture with a grid color as a mixed color is the center and the grid pictures adjacent to it are merged.
  • extracting detailed feature information of a target picture specifically includes: matching the target picture with the target edge contour, screening the target physical picture in the target picture; The target physical picture is input into the Mask RCNN model, and the binary mask image of the target physical picture is extracted; the image contour in the binary mask image is marked; the target physical picture is combined with the marked binary The mask image is matched, the detailed feature picture in the target physical picture corresponding to the image outline is selected; the character or graphic outline in the grid feature picture is determined as the detailed feature information.
  • the Mask RCNN model is used to accelerate the segmentation of the target picture, so as to accurately extract the image contours of the target picture in the case of lower time and space complexity to obtain accurate detailed feature information.
  • This step specifically includes: obtaining detailed feature information of the picture to be tested; calculating the detailed feature information of the target picture and the picture to be tested based on the detailed feature information of the picture to be tested and the detailed feature information of the target picture degree.
  • the method is the same as that of obtaining the detailed feature information of the target picture, and the detailed feature information of the picture to be tested is obtained.
  • the preset retrieval weight refers to the proportion of overall similarity and detail similarity when calculating retrieval similarity. Assuming that the preset retrieval weight is 1:2, the weight corresponding to the overall similarity is 1, the weight corresponding to the detail similarity is 2, and the retrieval similarity is the sum of the overall similarity multiplied by 1, and the detail similarity multiplied by 2. When calculating search similarity, you can set the preset search weight sum to 1. If the preset search weight is 1:2, the weight corresponding to the overall similarity is 1/3, and the weight corresponding to the detail similarity is 2/3 , The retrieval similarity is the sum of the overall similarity multiplied by 1/3, and the detail similarity multiplied by 2/3.
  • Sort the search similarity values from largest to smallest find the pictures to be tested corresponding to the search similarity according to their order, and then display the pictures to be tested.
  • display set the number of images displayed at the same time according to the size of the display area.
  • the preset condition is that the user does not select the picture to be tested corresponding to the maximum value of the retrieval similarity for the first time, or sets that the number of times that the picture to be tested selected for the first time after searching for similar pictures of different target pictures is not the picture with the highest similarity is greater than Preset times.
  • This application provides a method for searching similar pictures.
  • the embodiment of the present application uses different preset retrieval weights for overall similarity and detail similarity to calculate the retrieval similarity between the picture to be tested and the target picture.
  • the device includes:
  • the extraction module 31 is used to extract the overall feature information of the target picture according to the edge detection method
  • the first calculation module 32 is configured to calculate the overall similarity between the picture to be tested and the target picture according to the overall feature information
  • the extraction module 31 is configured to extract detailed feature information of the target picture according to the Mask RCNN model
  • the first calculation module 32 is further configured to calculate the detail similarity between the picture to be tested and the target picture according to the detailed feature information
  • the second calculation module 33 is configured to calculate the retrieval similarity between the picture to be tested and the target picture according to the overall similarity, the detail similarity, and preset retrieval weights;
  • the display module 34 is configured to display the pictures to be tested corresponding to the retrieval similarity in descending order of the retrieval similarity value.
  • This application provides a similar picture retrieval device.
  • extract the overall feature information of the target picture calculate the overall similarity between the picture to be tested and the target picture, and then extract the target picture according to the Mask RCNN model.
  • Detailed feature information and then calculate the detail similarity between the picture to be tested and the target picture according to the detailed feature information, and then calculate the retrieval similarity between the picture to be tested and the target picture based on the overall similarity, detail similarity and preset retrieval weights. Display the pictures to be tested corresponding to the search similarity in descending order of the search similarity value.
  • the embodiment of the present application uses different preset retrieval weights for overall similarity and detail similarity to calculate the retrieval similarity between the picture to be tested and the target picture.
  • the device includes:
  • the extraction module 41 is used to extract the overall feature information of the target picture according to the edge detection method
  • the first calculation module 42 is configured to calculate the overall similarity between the picture to be tested and the target picture according to the overall feature information
  • the extraction module 41 is configured to extract detailed feature information of the target picture according to the Mask RCNN model
  • the first calculation module 42 is further configured to calculate the detail similarity between the picture to be tested and the target picture according to the detailed feature information
  • the second calculation module 43 is configured to calculate the retrieval similarity between the picture to be tested and the target picture according to the overall similarity, the detail similarity and preset retrieval weights;
  • the display module 44 is configured to display the pictures to be tested corresponding to the retrieval similarity in descending order of the retrieval similarity value.
  • the overall feature information includes the target object color and target edge contour
  • the extraction module 41 includes:
  • the first extraction unit 411 is configured to use an edge detection method to identify and extract the target edge contour of the target object in the target picture;
  • the second extraction unit 412 is configured to extract the target object color of the target object within the target edge contour.
  • the second extraction unit 412 includes:
  • the dividing subunit 4121 is configured to divide the target picture into multiple grid pictures according to the first preset division granularity
  • the query subunit 4122 is configured to query the grid color of each grid picture within the target edge contour in the target picture, and the grid color includes a single color and a mixed color;
  • the calculating subunit 4123 is configured to calculate the mixed color ratio of the number of pictures whose grid color is a mixed color compared to the total number of grid pictures;
  • the division subunit 4121 is further configured to re-divide the target picture according to a second preset division granularity if the mixed color ratio is greater than a first preset ratio;
  • a recording subunit 4124 configured to record the number of single-color pictures of each color of the single-color grid pictures if the mixed color ratio is not greater than the first preset ratio
  • the determining subunit 4125 is configured to determine that the grid color corresponding to the number of single-color pictures is a target object if the single-color ratio of the number of single-color pictures to the total number of grid pictures is greater than a second preset ratio colour;
  • the determining subunit 4125 is further configured to determine that the grid color of the grid picture is the target object color if the difference between the number of single-color pictures of each color is less than a third preset number.
  • the extraction module 41 includes:
  • the screening unit 413 is configured to match the target picture with the target edge contour, and filter the target physical picture in the target picture;
  • the extraction unit 414 is configured to input the target physical picture into the Mask RCNN model, and extract a binary mask image of the target physical picture;
  • the marking unit 415 is used to mark the image contour in the binary mask image
  • the screening unit 413 is further configured to match the target physical picture with the marked binary mask image, and filter the detailed feature pictures in the target physical picture corresponding to the image contour;
  • the determining unit 416 is configured to determine the character or graphic outline in the grid feature picture as detailed feature information.
  • the first calculation module 42 includes:
  • the obtaining unit 421 is configured to obtain overall feature information of the picture to be tested, where the overall feature information of the picture to be tested includes the color of the object to be tested and the edge contour of the test to be tested;
  • the calculating unit 422 is configured to calculate the object color similarity and edge contour similarity of the target picture and the picture to be tested according to the overall feature information of the picture to be measured, the color of the target object and the contour of the target edge ;
  • the calculation unit 422 is further configured to calculate the overall similarity between the target picture and the picture to be tested according to a preset overall weight.
  • the first calculation module 42 includes:
  • the acquiring unit 421 is further configured to acquire detailed feature information of the picture to be tested;
  • the calculation unit 422 is further configured to calculate the detail similarity between the target picture and the picture to be tested according to the detailed feature information of the picture to be tested and the detailed feature information of the target picture.
  • the method further includes:
  • the correction module 45 is used to display the pictures to be tested corresponding to the search similarity in the descending order of the search similarity, if the user operation meets the preset conditions, follow the preset rules , Modify the preset retrieval weight, the preset condition is that the user does not select the picture to be tested corresponding to the maximum value of the retrieval similarity for the first time, or sets the picture to be selected for the first time after the user has searched for similar pictures of different target pictures The number of times of detecting that the picture is not the most similar picture is greater than the preset number of times.
  • This application provides a similar picture retrieval device.
  • extract the overall feature information of the target picture calculate the overall similarity between the picture to be tested and the target picture, and then extract the target picture according to the Mask RCNN model.
  • Detailed feature information and then calculate the detail similarity between the picture to be tested and the target picture according to the detailed feature information, and then calculate the retrieval similarity between the picture to be tested and the target picture based on the overall similarity, detail similarity and preset retrieval weights. Display the pictures to be tested corresponding to the search similarity in descending order of the search similarity value.
  • the preset retrieval weight can be adjusted according to the preset rules, or the user can set the first selection after searching for similar pictures of different target pictures
  • the preset retrieval weight can be changed.
  • the embodiment of the present application uses different preset retrieval weights for overall similarity and detail similarity to calculate the retrieval similarity between the picture to be tested and the target picture.
  • a computer-readable storage medium stores at least one computer-readable executable instruction, and the computer-readable executable instruction can execute similar methods in any of the foregoing method embodiments.
  • Image retrieval method The computer-readable storage medium may be a non-volatile storage medium or a volatile storage medium.
  • FIG. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present application, and the specific embodiment of the present application does not limit the specific implementation of the computer device.
  • the computer device may include: a processor (processor) 502, a communication interface (Communications Interface) 504, a memory (memory) 506, and a communication bus 508.
  • processor processor
  • communication interface Communication Interface
  • memory memory
  • the processor 502, the communication interface 504, and the memory 506 communicate with each other through the communication bus 508.
  • the communication interface 504 is used to communicate with network elements of other devices, such as clients or other servers.
  • the processor 502 is configured to execute the program 510, and specifically can execute the relevant steps in the above-mentioned similar picture retrieval method embodiment.
  • the program 510 may include program code, and the program code includes a computer executable operation instruction.
  • the processor 502 may be a central processing unit CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
  • the one or more processors included in the computer device may be the same type of processor, such as one or more CPUs, or different types of processors, such as one or more CPUs and one or more ASICs.
  • the memory 506 is used to store the program 510.
  • the memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one disk memory.
  • the program 510 may be specifically used to cause the processor 502 to perform the following operations:
  • the edge detection method extract the overall feature information of the target picture; according to the overall feature information, calculate the overall similarity between the picture to be tested and the target picture; extract the detailed feature information of the target picture according to the Mask RCNN model; The detailed feature information calculates the detail similarity between the picture to be tested and the target picture; calculates the picture to be tested and the target according to the overall similarity, the detail similarity and preset retrieval weights Retrieval similarity of pictures; display the pictures to be tested corresponding to the retrieval similarity in descending order of the value of the retrieval similarity.
  • modules or steps of this application can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here.

Abstract

一种相似图片的检索方法及装置,涉及图像处理技术领域,其为解决现有技术中检索结果与用户的检索需求偏差较大的问题。该方法主要包括:根据边缘检测法,提取目标图片的整体特征信息(101);根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度(102);根据Mask RCNN模型,提取目标图片的细节特征信息(103);根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度(104);根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度(105);按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片(106)。该方法主要应用于图片检索的过程中。

Description

一种相似图片的检索方法及装置
本申请要求与2019年6月20日提交中国专利局、申请号为201910534899.8、申请名称为“一种相似图片的检索方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及图像处理技术领域,特别是涉及一种相似图片的检索方法及装置。
背景技术
以图片为信息存储方式,以查找相似图片为手段,以获取所需信息为目的,是一种新的检索信息方式。现有技术中,检索相似图片的方法包括:获取目标图片的多个显著性区域;提取多个显著性区域的卷积神经网络CNN特征;根据多个显著性区域的CNN特征,获取目标图片的特征向量;根据目标图片的特征向量,从目标图片的候选图片组包括的多个候选图片中获取与目标图片匹配的相似图片。
卷积神经网络CNN(Convolutional Neural Networks,CNN)是一类包含卷积计算且具有深度结构的前馈神经网络。卷积神经网络仿造生物的视知觉机制构建,可以进行监督学习和非监督学习,其隐含层内的卷积核参数共享和层间连接的稀疏性使得卷积神经网络能够以较小的计算量对格点化特征进行学习,被大量应用于计算机视觉、自然语言处理等领域。在检索相似图片时,用户可能需要查找颜色相近、款式相近、文字相近或者品牌相同的商品。而现有的检索相似图片的方法,是基于整体图片的显著性区域的CNN特征比对查找,忽略了品牌商标和文字等非显著性特征,导致了检索结果与用户的检索需求偏差较大。
发明内容
有鉴于此,本申请提供一种相似图片的检索方法及装置,主要目的在于解决现有技术中检索结果与用户的检索需求偏差较大的问题。
依据本申请一个方面,提供了一种相似图片的检索方法,包括:
根据边缘检测法,提取目标图片的整体特征信息;根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;根据Mask RCNN模型,提取所述目标图片的细节特征信息;根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
依据本申请另一个方面,提供了一种相似图片的检索装置,包括:
提取模块,用于根据边缘检测法,提取目标图片的整体特征信息;第一计算模块,用于根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;所述提取模块,用于根据Mask RCNN模型,提取所述目标图片的细节特征信息;所述第一计算模块,还用于根据所述细节特征信息,计算 所述待测图片与所述目标图片的细节相似度;第二计算模块,用于根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;展示模块,用于按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
根据本申请的又一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一种计算机可读执行指令,所述计算机可读执行指令使处理器执行如上述相似图片的检索方法对应的操作。
根据本申请的再一方面,提供了一种计算机设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;所述存储器用于存放至少一种计算机可读执行指令,所述计算机可读执行指令使所述处理器执行上述相似图片的检索方法对应的操作。
借由上述技术方案,本申请实施例提供的技术方案至少具有下列优点:本申请提供了一种相似图片的检索方法及装置,首先根据边缘检测法,提取目标图片的整体特征信息,计算待测图片与目标图片的整体相似度,再根据Mask RCNN模型,提取所述目标图片的细节特征信息,再根据细节特征信息,计算待测图片与目标图片的细节相似度,再根据整体相似度、细节相似度和预置检索权重,计算待测图片与目标图片的检索相似度,最后按照检索相似度的数值从大到小的顺序,展示与检索相似度对应的待测图片。与现有技术相比,本申请实施例通过采用为整体相似度和细节相似度设置不同的预置检索权重,以计算待测图片与目标图片的检索相似度。通过增加细节相似度对检索相似度的影响,能够区分出相似物体的细节冲突,提高相似图片的区分度,以提高识别效果,减少检索结果与用户检索需求的偏差。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了本申请实施例提供的一种相似图片的检索方法流程图;
图2示出了本申请实施例提供的另一种相似图片的检索方法流程图;
图3示出了本申请实施例提供的一种相似图片的检索装置组成框图;
图4示出了本申请实施例提供的另一种相似图片的检索装置组成框图;
图5示出了本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本申请实施例提供了一种相似图片的检索方法,如图1所示,该方法包括:
101、根据边缘检测法,提取目标图片的整体特征信息。
目标图片是指用户已查询的商品图片,本申请的目的就是检索目标图形的相似图片。整体特征信息,是指目标图形中物体的整体信息,包括颜色和轮廓。假设目标图片内容为一件A品牌的白色外套,则白色外套为整体特征信息。
采用边缘检测法能够大幅度地减少数据量,并且剔除不相关的信息,同时保留图像重要的结构属性,有利于提取整体特征信息。边缘检测法可以划分为两类:一阶导数查找法和二阶导数零穿越法。基于查找的方法通过寻找图像一阶导数中的最大和最小值来检测边界,通常是将边界定位在梯度最大的方向。基于零穿越的方法通过寻找图像二阶导数零穿越来寻找边界,通常是Laplacian过零点或者非线性差分表示的过零点。示例性的,目标图片内容为一件A品牌的白色外套,提取外套的形状及外套的颜色。
102、根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度。
待测图片,是指可能与目标图片相似的所有图片,可能是系统中的所有图片,可能是根据目标图片的文字描述检索到的相关图片,也可能是根据目标图片中物体的属性检索到的相关图形。在本申请实施例中对待测图片的图片来源以及数量不做限定。与获取目标图片的整体特征信息的方法相同,获取待测图片的整体特征信息,然后计算待测图片与目标图片的整体相似度。整体相似度可根据欧几里得距离、曼哈顿距离、明可夫斯基距离、余弦相似度或皮尔森相关系数等方法计算。
103、根据Mask RCNN模型,提取所述目标图片的细节特征信息。
目标图片是指用户已查询的商品图片,本申请的目的就是检索目标图形的相似图片。细节特征信息,是指目标图片中的细节部分,是指相对于整张图片所占比例较小却有着丰富信息的图像部分。假设目标图片内容为一件A品牌的白色外套,则A品牌为细节特征信息,A品牌是指该品牌的商标形状,或商标的形状及颜色。
如果采用Mask RCNN算法提取细节特征信息,那么Mask RCNN算法的算法模型,需要经过标注出目标图片细节特征信息的训练图片进行训练。示例性的,目标图片内容为一件A品牌的白色外套,在训练图像训练时标注出商标的形状和一般外套的形状,通过训练使得目标图片能区分出外套和外套上的商标。
104、根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度。
与获取目标图片的细节特征信息方法相同,获取待测图片的细节特征信息,然后计算待测图片 与目标图片的细节相似度。细节相似度可根据欧几里得距离、曼哈顿距离、明可夫斯基距离、余弦相似度或皮尔森相关系数等方法计算。
105、根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度。
预置检索权重,是指整体相似度和细节相似度在计算检索相似度时所占的比例。假设预置检索权重为1:2,整体相似度对应的权重为1,细节相似度对应的权重为2,检索相似度为整体相似度乘以1,与细节相似度乘以2的和。在计算检索相似度时,可以设置预置检索权重和为1,那么假设预置检索权重为1:2,整体相似度对应的权重为1/3,细节相似度对应的权重为2/3,检索相似度为整体相似度乘以1/3,与细节相似度乘以2/3的和。
106、按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
将检索相似度的数值从大到小排序,按照其排列顺序查找与检索相似度对应的待测图片,然后展示待测图片。在展示时,根据展示区的大小设置同时展示的图片数量。在展示时,可以按照待测图片的排列顺序,选取展示区可同时展示的图片数量,展示待测图片。
本申请提供了一种相似图片的检索方法,首先根据边缘检测法,提取目标图片的整体特征信息,计算待测图片与目标图片的整体相似度,再根据Mask RCNN模型,提取所述目标图片的细节特征信息,再根据细节特征信息,计算待测图片与目标图片的细节相似度,再根据整体相似度、细节相似度和预置检索权重,计算待测图片与目标图片的检索相似度,最后按照检索相似度的数值从大到小的顺序,展示与检索相似度对应的待测图片。与现有技术相比,本申请实施例通过采用为整体相似度和细节相似度设置不同的预置检索权重,以计算待测图片与目标图片的检索相似度。通过增加细节相似度对检索相似度的影响,能够区分出相似物体的细节冲突,提高相似图片的区分度,以提高识别效果,减少检索结果与用户检索需求的偏差。
本申请实施例提供了另一种相似图片的检索方法,如图2所示,该方法包括:
201、根据边缘检测法,提取目标图片的整体特征信息。
目标图片是指用户以查询的商品图片,本申请的目的就是检索目标图形的相似图片。整体特征信息,是指目标图形中物体的整体信息,包括颜色和轮廓。假设目标图片内容为一件A品牌的白色外套,则白色外套为整体特征信息。
现有的服装、鞋帽、电子产品等物品,通常在查找相似产品时包括两方面的相似,一是细节特征相同,二是整体特征相似。整体特征信息包括目标物体颜色和目标边缘轮廓。获取目标图片的整体特征信息,具体包括:采用边缘检测法,标识并提取所述目标图片中的目标物体的所述目标边缘轮廓;提取所述目标边缘轮廓内所述目标物体的所述目标物体颜色。图像边缘检测大幅度地减少了数据量,并且剔除了可以认为不相关的信息,保留了图像重要的结构属性。通过边缘检测算法提取并标识目标边缘轮廓。目标边缘轮廓,是目标图片中目标物体的轮廓,所以目标边缘轮廓内的颜色,是目标物体的实际颜色。
提取目标边缘轮廓内目标物体的目标物体颜色,具体包括:按照第一预置划分粒度,将所述目 标图片划分为多个网格图片;在所述目标图片中所述目标边缘轮廓内,查询每个所述网格图片的网格颜色,所述网格颜色包括单一色和混合色;计算所述网格颜色为混合色的图片数量与所述网格图片的总数量相比的混合色比例;如果所述混合色比例大于第一预置比例,则按照第二预置划分粒度重新划分所述目标图片;如果所述混合色比例不大于所述第一预置比例,则记录所述网格颜色为单一色的网格图片的每种颜色的单一色图片数量;如果所述单一色图片数量与所述网格图片的总数量的单一色比例大于第二预置比例,则确定所述单一色图片数量对应的网格颜色为目标物体颜色;如果所述每种颜色的单一色图片数量之间的差值小于第三预置数量,则确定所述网格图片的网格颜色为目标物体颜色。确定的目标物体颜色,可能是单独的某一个颜色,也可能是多种颜色组合。
202、根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度。
待测图片,是指可能与目标图片相似的所有图片,可能是系统中的所有图片,可能是根据目标图片的文字描述检索到的相关图片,也可能是根据目标图片中物体的属性检索到的相关图形。在本申请实施例中对待测图片的图片来源以及数量不做限定。本步骤具体包括:获取所述待测图片的整体特征信息,所述待测图片的整体特征信息包括待测物体颜色和待测边缘轮廓;根据所述待测图片的整体特征信息、所述目标物体颜色和所述目标边缘轮廓,计算所述目标图片与所述待测图片的物体颜色相似度和边缘轮廓相似度;根据预置整体比重,计算所述目标图片与所述待测图片的所述整体相似度。预置整体比重,是指物体颜色相似度和边缘轮廓相似度在计算整体相似度时所占的比重。
203、根据Mask RCNN模型,提取所述目标图片的细节特征信息。
目标图片是指用户以查询的商品图片,本申请的目的就是检索目标图形的相似图片。细节特征信息,是指目标图片中的细节部分,是指相对于整张图片所占比例较小却有着丰富信息的图像部分。假设目标图片内容为一件A品牌的白色外套,则A品牌为细节特征信息。
现有的服装、鞋帽、电子产品等物品,通常在查找相似产品时包括两方面的相似,一是细节特征相同,二是整体特征相似。细节特征信息包括文字商标、图案商标、印花、刺绣等特殊图形,常常与目标图形的整体颜色相近似或者颜色反差较大,以此区别作为获取细节特征信息的基础。提取目标图片的细节特征信息,具体包括:提取所述网格颜色为混合色的网格图片;滤除所述网格颜色为混合色的网格图片中的目标物体颜色,获取网格特征图片;判断所述网格特征图片中的图片轮廓是否为封闭轮廓;如果判断结果为是,则将所述网格特征图片中的字符或者图形轮廓确定为细节特征信息;如果判断结果为否,则合并所述网格颜色为混合色的网格图片及其相邻的网格图片,并滤除所述目标物体颜色,重新获取所述网格特征图片。合并网格颜色为混合色的网格图片及其相邻的网格图片,是指以网格颜色为混合色的网格图片为中心,与其四周相邻的网格图片合并。
为了提高提取细节特征信息的速度和准确度,提取目标图片细节特征信息,具体包括:将所述目标图片与所述目标边缘轮廓进行匹配,筛选所述目标图片中的目标实物图片;将所述目标实物图片输入所述Mask RCNN模型,提取所述目标实物图片的二值掩膜图像;标记所述二值掩膜图像中的图像轮廓;将所述目标实物图片与所述标记后的二值掩膜图像进行匹配,筛选与所述图像轮廓对应的目标实物图片中的细节特征图片;将所述网格特征图片中的字符或者图形轮廓确定为细节特征信 息。通过Mask RCNN模型加速对目标图片的分割,以实现较低时间和空间复杂度情况下,精确提取目标实物图片中的图像轮廓,以获取精确的细节特征信息。
204、根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度。
本步骤具体包括:获取所述待测图片的细节特征信息;根据所述待测图片的细节特征信息和所述目标图片的细节特征信息,计算所述目标图片与所述待测图片的细节相似度。与获取目标图片的细节特征信息方法相同,获取待测图片的细节特征信息。
205、根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度。
预置检索权重,是指整体相似度和细节相似度在计算检索相似度时所占的比例。假设预置检索权重为1:2,则整体相似度对应的权重为1,细节相似度对应的权重为2,检索相似度为整体相似度乘以1,与细节相似度乘以2的和。在计算检索相似度时,可以设置预置检索权重和为1,那么假设预置检索权重为1:2,则整体相似度对应的权重为1/3,细节相似度对应的权重为2/3,检索相似度为整体相似度乘以1/3,与细节相似度乘以2/3的和。
206、按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
将检索相似度的数值从大到小排序,按照其排列顺序查找与检索相似度对应的待测图片,然后展示待测图片。在展示时,根据展示区的大小设置同时展示的图片数量。在展示时,可以按照待测图片的排列顺序,选取展示区可同时展示的图片数量,展示待测图片。
207、如果用户操作符合预置条件,则按照预置规则,修正所述预置检索权重。
预置条件为用户首次未选取所述检索相似度最大值对应的待测图片,或设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数。在修正预置检索权重时,可以比较用户选取的待测图片与检索相似度最大值对应的待测图片的整体相似度和细节相似度的大小,确定整体相似度还是细节相似度对用户影响较大,然后增加对用户响应较大的权重,以此修正预置检索权重。
为了保证待检测图片的展示顺序更符合用户需求,保证更新后的权重能够反应用户的真实想法,还可以设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数时,才修正预置检索权重。
本申请提供了一种相似图片的检索方法,首先根据边缘检测法,提取目标图片的整体特征信息,计算待测图片与目标图片的整体相似度,再根据Mask RCNN模型,提取所述目标图片的细节特征信息,再根据细节特征信息,计算待测图片与目标图片的细节相似度,再根据整体相似度、细节相似度和预置检索权重,计算待测图片与目标图片的检索相似度,最后按照检索相似度的数值从大到小的顺序,展示与检索相似度对应的待测图片。如果用户首次未选取所述检索相似度最大值对应的待测图片,则按照预置规则,调整所述预置检索权重,或设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数时,则可改变预置检索权重。与现有技术相比,本申请实施例通过采用为整体相似度和细节相似度设置不同的预置检索 权重,以计算待测图片与目标图片的检索相似度。通过增加细节相似度对检索相似度的影响,能够区分出相似物体的细节冲突,提高相似图片的区分度,以提高识别效果,减少检索结果与用户检索需求的偏差。
进一步的,作为对上述图1所示方法的实现,本申请实施例提供了一种相似图片的检索装置,如图3所示,该装置包括:
提取模块31,用于根据边缘检测法,提取目标图片的整体特征信息;
第一计算模块32,用于根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;
所述提取模块31,用于根据Mask RCNN模型,提取所述目标图片的细节特征信息;
所述第一计算模块32,还用于根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;
第二计算模块33,用于根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;
展示模块34,用于按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
本申请提供了一种相似图片的检索装置,首先根据边缘检测法,提取目标图片的整体特征信息,计算待测图片与目标图片的整体相似度,再根据Mask RCNN模型,提取所述目标图片的细节特征信息,再根据细节特征信息,计算待测图片与目标图片的细节相似度,再根据整体相似度、细节相似度和预置检索权重,计算待测图片与目标图片的检索相似度,最后按照检索相似度的数值从大到小的顺序,展示与检索相似度对应的待测图片。与现有技术相比,本申请实施例通过采用为整体相似度和细节相似度设置不同的预置检索权重,以计算待测图片与目标图片的检索相似度。通过增加细节相似度对检索相似度的影响,能够区分出相似物体的细节冲突,提高相似图片的区分度,以提高识别效果,减少检索结果与用户检索需求的偏差。
进一步的,作为对上述图2所示方法的实现,本申请实施例提供了另一种相似图片的检索装置,如图4所示,该装置包括:
提取模块41,用于根据边缘检测法,提取目标图片的整体特征信息;
第一计算模块42,用于根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;
所述提取模块41,用于根据Mask RCNN模型,提取所述目标图片的细节特征信息;
所述第一计算模块42,还用于根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;
第二计算模块43,用于根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;
展示模块44,用于按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
进一步地,所述整体特征信息包括目标物体颜色和目标边缘轮廓;
所述提取模块41,包括:
第一提取单元411,用于采用边缘检测法,标识并提取所述目标图片中的目标物体的所述目标边缘轮廓;
第二提取单元412,用于提取所述目标边缘轮廓内所述目标物体的所述目标物体颜色。
进一步地,所述第二提取单元412,包括:
划分子单元4121,用于按照第一预置划分粒度,将所述目标图片划分为多个网格图片;
查询子单元4122,用于在所述目标图片中所述目标边缘轮廓内,查询每个所述网格图片的网格颜色,所述网格颜色包括单一色和混合色;
计算子单元4123,用于计算所述网格颜色为混合色的图片数量与所述网格图片的总数量相比的混合色比例;
所述划分子单元4121,还用于如果所述混合色比例大于第一预置比例,则按照第二预置划分粒度重新划分所述目标图片;
记录子单元4124,用于如果所述混合色比例不大于所述第一预置比例,则记录所述网格颜色为单一色的网格图片的每种颜色的单一色图片数量;
确定子单元4125,用于如果所述单一色图片数量与所述网格图片的总数量的单一色比例大于第二预置比例,则确定所述单一色图片数量对应的网格颜色为目标物体颜色;
所述确定子单元4125,还用于如果所述每种颜色的单一色图片数量之间的差值小于第三预置数量,则确定所述网格图片的网格颜色为目标物体颜色。
进一步地,所述提取模块41,包括:
筛选单元413,用于将所述目标图片与所述目标边缘轮廓进行匹配,筛选所述目标图片中的目标实物图片;
提取单元414,用于将所述目标实物图片输入所述Mask RCNN模型,提取所述目标实物图片的二值掩膜图像;
标记单元415,用于标记所述二值掩膜图像中的图像轮廓;
所述筛选单元413,还用于将所述目标实物图片与所述标记后的二值掩膜图像进行匹配,筛选与所述图像轮廓对应的目标实物图片中的细节特征图片;
确定单元416,用于将所述网格特征图片中的字符或者图形轮廓确定为细节特征信息。
进一步地,所述第一计算模块42,包括:
获取单元421,用于获取所述待测图片的整体特征信息,所述待测图片的整体特征信息包括待测物体颜色和待测边缘轮廓;
计算单元422,用于根据所述待测图片的整体特征信息、所述目标物体颜色和所述目标边缘轮廓,计算所述目标图片与所述待测图片的物体颜色相似度和边缘轮廓相似度;
所述计算单元422,还用于根据预置整体比重,计算所述目标图片与所述待测图片的所述整体相似度。
进一步地,所述第一计算模块42,包括:
所述获取单元421,还用于获取所述待测图片的细节特征信息;
所述计算单元422,还用于根据所述待测图片的细节特征信息和所述目标图片的细节特征信息,计算所述目标图片与所述待测图片的细节相似度。
进一步地,所述方法还包括:
修正模块45,用于所述按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片之后,如果用户操作符合预置条件,则按照预置规则,修正所述预置检索权重,所述预置条件为用户首次未选取所述检索相似度最大值对应的待测图片,或设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数。
本申请提供了一种相似图片的检索装置,首先根据边缘检测法,提取目标图片的整体特征信息,计算待测图片与目标图片的整体相似度,再根据Mask RCNN模型,提取所述目标图片的细节特征信息,再根据细节特征信息,计算待测图片与目标图片的细节相似度,再根据整体相似度、细节相似度和预置检索权重,计算待测图片与目标图片的检索相似度,最后按照检索相似度的数值从大到小的顺序,展示与检索相似度对应的待测图片。如果用户首次未选取所述检索相似度最大值对应的待测图片,则可按照预置规则,调整所述预置检索权重,或设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数时,则可改变预置检索权重。与现有技术相比,本申请实施例通过采用为整体相似度和细节相似度设置不同的预置检索权重,以计算待测图片与目标图片的检索相似度。通过增加细节相似度对检索相似度的影响,能够区分出相似物体的细节冲突,提高相似图片的区分度,以提高识别效果,减少检索结果与用户检索需求的偏差。
根据本申请一个实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有至少一种计算机可读执行指令,该计算机可读执行指令可执行上述任意方法实施例中的相似图片的检索方法。该计算机可读存储介质可以为非易失性存储介质,也可以为易失性存储介质。
图5示出了根据本申请一个实施例提供的一种计算机设备的结构示意图,本申请具体实施例并不对计算机设备的具体实现做限定。
如图5所示,该计算机设备可以包括:处理器(processor)502、通信接口(Communications Interface)504、存储器(memory)506、以及通信总线508。
其中:处理器502、通信接口504、以及存储器506通过通信总线508完成相互间的通信。
通信接口504,用于与其它设备比如客户端或其它服务器等的网元通信。
处理器502,用于执行程序510,具体可以执行上述相似图片的检索方法实施例中的相关步骤。
具体地,程序510可以包括程序代码,该程序代码包括计算机可执行操作指令。
处理器502可能是中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。计算机设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理 器,如一个或多个CPU以及一个或多个ASIC。
存储器506,用于存放程序510。存储器506可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
程序510具体可以用于使得处理器502执行以下操作:
根据边缘检测法,提取目标图片的整体特征信息;根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;根据Mask RCNN模型,提取所述目标图片的细节特征信息;根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (20)

  1. 一种相似图片的检索方法,其特征在于,包括:
    根据边缘检测法,提取目标图片的整体特征信息;
    根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;
    根据Mask RCNN模型,提取所述目标图片的细节特征信息;
    根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;
    根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;
    按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
  2. 如权利要求1所述的方法,其特征在于,所述整体特征信息包括目标物体颜色和目标边缘轮廓;
    所述根据边缘检测法,提取目标图片的整体特征信息,包括:
    采用所述边缘检测法,标识并提取所述目标图片中的目标物体的所述目标边缘轮廓;
    提取所述目标边缘轮廓内所述目标物体的所述目标物体颜色。
  3. 如权利要求2所述的方法,其特征在于,所述提取所述目标边缘轮廓内所述目标物体的目标物体颜色,包括:
    按照第一预置划分粒度,将所述目标图片划分为多个网格图片;
    在所述目标图片中所述目标边缘轮廓内,查询每个所述网格图片的网格颜色,所述网格颜色包括单一色和混合色;
    计算所述网格颜色为混合色的图片数量与所述网格图片的总数量相比的混合色比例;
    如果所述混合色比例大于第一预置比例,则按照第二预置划分粒度重新划分所述目标图片;
    如果所述混合色比例不大于所述第一预置比例,则记录所述网格颜色为单一色的网格图片的每种颜色的单一色图片数量;
    如果所述单一色图片数量与所述网格图片的总数量的单一色比例大于第二预置比例,则确定所述单一色图片数量对应的网格颜色为目标物体颜色;
    如果所述每种颜色的单一色图片数量之间的差值小于第三预置数量,则确定所述网格图片的网格颜色为目标物体颜色。
  4. 如权利要求2所述的方法,其特征在于,所述根据Mask RCNN模型,提取所述目标图片的细节特征信息,包括:
    将所述目标图片与所述目标边缘轮廓进行匹配,筛选所述目标图片中的目标实物图片;
    将所述目标实物图片输入所述Mask RCNN模型,提取所述目标实物图片的二值掩膜图像;
    标记所述二值掩膜图像中的图像轮廓;
    将所述目标实物图片与所述标记后的二值掩膜图像进行匹配,筛选与所述图像轮廓对应的目标实物图片中的细节特征图片;
    将所述网格特征图片中的字符或者图形轮廓确定为细节特征信息。
  5. 如权利要求1所述的方法,其特征在于,所述根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度,包括:
    获取所述待测图片的整体特征信息,所述待测图片的整体特征信息包括待测物体颜色和待测边缘轮廓;
    根据所述待测图片的整体特征信息、所述目标物体颜色和所述目标边缘轮廓,计算所述目标图片与所述待测图片的物体颜色相似度和边缘轮廓相似度;
    根据预置整体比重,计算所述目标图片与所述待测图片的所述整体相似度。
  6. 如权利要求1所述的方法,其特征在于,所述根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度,包括:
    获取所述待测图片的细节特征信息;
    根据所述待测图片的细节特征信息和所述目标图片的细节特征信息,计算所述目标图片与所述待测图片的细节相似度。
  7. 如权利要求1所述的方法,其特征在于,所述按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片之后,所述方法还包括:
    如果用户操作符合预置条件,则按照预置规则,修正所述预置检索权重,所述预置条件为用户首次未选取所述检索相似度最大值对应的待测图片,或设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数。
  8. 一种相似图片的检索装置,其特征在于,包括:
    提取模块,用于根据边缘检测法,提取目标图片的整体特征信息;
    第一计算模块,用于根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;
    所述提取模块,用于根据Mask RCNN模型,提取所述目标图片的细节特征信息;
    所述第一计算模块,还用于根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;
    第二计算模块,用于根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;
    展示模块,用于按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
  9. 如权利要求8所述的装置,其特征在于,所述整体特征信息包括目标物体颜色和目标边缘轮廓;
    所述提取模块,包括:
    第一提取单元,用于采用所述边缘检测法,标识并提取所述目标图片中的目标物体的所述目标边缘轮廓;
    第二提取单元,用于提取所述目标边缘轮廓内所述目标物体的所述目标物体颜色。
  10. 如权利要求9所述的装置,其特征在于,所述第二提取单元,包括:
    划分子单元,用于按照第一预置划分粒度,将所述目标图片划分为多个网格图片;
    查询子单元,用于在所述目标图片中所述目标边缘轮廓内,查询每个所述网格图片的网格颜色,所述网格颜色包括单一色和混合色;
    计算子单元,用于计算所述网格颜色为混合色的图片数量与所述网格图片的总数量相比的混合色比例;
    所述划分子单元,还用于如果所述混合色比例大于第一预置比例,则按照第二预置划分粒度重新划分所述目标图片;
    记录子单元,用于如果所述混合色比例不大于所述第一预置比例,则记录所述网格颜色为单一色的网格图片的每种颜色的单一色图片数量;
    确定子单元,用于如果所述单一色图片数量与所述网格图片的总数量的单一色比例大于第二预置比例,则确定所述单一色图片数量对应的网格颜色为目标物体颜色;
    所述确定子单元,还用于如果所述每种颜色的单一色图片数量之间的差值小于第三预置数量,则确定所述网格图片的网格颜色为目标物体颜色。
  11. 如权利要求9所述的装置,其特征在于,所述提取模块,包括:
    筛选单元,用于将所述目标图片与所述目标边缘轮廓进行匹配,筛选所述目标图片中的目标实物图片;
    提取单元,用于将所述目标实物图片输入所述Mask RCNN模型,提取所述目标实物图片的二值掩膜图像;
    标记单元,用于标记所述二值掩膜图像中的图像轮廓;
    所述筛选单元,还用于将所述目标实物图片与所述标记后的二值掩膜图像进行匹配,筛选与所述图像轮廓对应的目标实物图片中的细节特征图片;
    确定单元,用于将所述网格特征图片中的字符或者图形轮廓确定为细节特征信息。
  12. 如权利要求8所述的装置,其特征在于,所述第一计算模块,包括:
    获取单元,用于获取所述待测图片的整体特征信息,所述待测图片的整体特征信息包括待测物体颜色和待测边缘轮廓;
    计算单元,用于根据所述待测图片的整体特征信息、所述目标物体颜色和所述目标边缘轮廓,计算所述目标图片与所述待测图片的物体颜色相似度和边缘轮廓相似度;
    所述计算单元,还用于根据预置整体比重,计算所述目标图片与所述待测图片的所述整体相似度。
  13. 如权利要求8所述的装置,其特征在于,所述第一计算模块,包括:
    所述获取单元,还用于获取所述待测图片的细节特征信息;
    所述计算单元,还用于根据所述待测图片的细节特征信息和所述目标图片的细节特征信息,计算所述目标图片与所述待测图片的细节相似度。
  14. 如权利要求8所述的装置,其特征在于,所述装置还包括:
    修正模块,用于所述按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片之后,如果用户操作符合预置条件,则按照预置规则,修正所述预置检索权重,所述预置条件为用户首次未选取所述检索相似度最大值对应的待测图片,或设置当用户经过查找的不同目标图片的相似图片后首次选取的待检测图片不是相似度最高的图片的次数大于预置次数。
  15. 一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一种计算机可读执行指令,所述计算机可读执行指令使处理器执行实现相似图片的检索方法,包括:
    根据边缘检测法,提取目标图片的整体特征信息;根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;根据Mask RCNN模型,提取所述目标图片的细节特征信息;根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;根据所述整体相似度、所述细节相似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述整体特征信息包括目标物体颜色和目标边缘轮廓;所述计算机可读执行指令被处理器执行实现所述根据边缘检测法,提取目标图片的整体特征信息,包括:
    采用所述边缘检测法,标识并提取所述目标图片中的目标物体的所述目标边缘轮廓;提取所述目标边缘轮廓内所述目标物体的所述目标物体颜色。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机可读执行指令被处理器执行实现所述提取所述目标边缘轮廓内所述目标物体的目标物体颜色,包括:
    按照第一预置划分粒度,将所述目标图片划分为多个网格图片;在所述目标图片中所述目标边缘轮廓内,查询每个所述网格图片的网格颜色,所述网格颜色包括单一色和混合色;计算所述网格颜色为混合色的图片数量与所述网格图片的总数量相比的混合色比例;如果所述混合色比例大于第一预置比例,则按照第二预置划分粒度重新划分所述目标图片;如果所述混合色比例不大于所述第一预置比例,则记录所述网格颜色为单一色的网格图片的每种颜色的单一色图片数量;如果所述单一色图片数量与所述网格图片的总数量的单一色比例大于第二预置比例,则确定所述单一色图片数量对应的网格颜色为目标物体颜色;如果所述每种颜色的单一色图片数量之间的差值小于第三预置数量,则确定所述网格图片的网格颜色为目标物体颜色。
  18. 一种计算机设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;
    所述存储器用于存放至少一种计算机可读执行指令,所述计算机可读执行指令使所述处理器执行实现相似图片的检索方法,包括:
    根据边缘检测法,提取目标图片的整体特征信息;根据所述整体特征信息,计算待测图片与所述目标图片的整体相似度;根据Mask RCNN模型,提取所述目标图片的细节特征信息;根据所述细节特征信息,计算所述待测图片与所述目标图片的细节相似度;根据所述整体相似度、所述细节相 似度和预置检索权重,计算所述待测图片与所述目标图片的检索相似度;按照所述检索相似度的数值从大到小的顺序,展示与所述检索相似度对应的待测图片。
  19. 如权利要求18所述的计算机设备,其特征在于,所述整体特征信息包括目标物体颜色和目标边缘轮廓;所述计算机可读执行指令被处理器执行实现所述根据边缘检测法,提取目标图片的整体特征信息,包括:
    采用所述边缘检测法,标识并提取所述目标图片中的目标物体的所述目标边缘轮廓;提取所述目标边缘轮廓内所述目标物体的所述目标物体颜色。
  20. 根据权利要求18所述的计算机设备,其特征在于,所述计算机可读执行指令被处理器执行实现所述提取所述目标边缘轮廓内所述目标物体的目标物体颜色,包括:
    按照第一预置划分粒度,将所述目标图片划分为多个网格图片;在所述目标图片中所述目标边缘轮廓内,查询每个所述网格图片的网格颜色,所述网格颜色包括单一色和混合色;计算所述网格颜色为混合色的图片数量与所述网格图片的总数量相比的混合色比例;如果所述混合色比例大于第一预置比例,则按照第二预置划分粒度重新划分所述目标图片;如果所述混合色比例不大于所述第一预置比例,则记录所述网格颜色为单一色的网格图片的每种颜色的单一色图片数量;如果所述单一色图片数量与所述网格图片的总数量的单一色比例大于第二预置比例,则确定所述单一色图片数量对应的网格颜色为目标物体颜色;如果所述每种颜色的单一色图片数量之间的差值小于第三预置数量,则确定所述网格图片的网格颜色为目标物体颜色。
PCT/CN2019/118369 2019-06-20 2019-11-14 一种相似图片的检索方法及装置 WO2020253063A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910534899.8A CN110413824A (zh) 2019-06-20 2019-06-20 一种相似图片的检索方法及装置
CN201910534899.8 2019-06-20

Publications (1)

Publication Number Publication Date
WO2020253063A1 true WO2020253063A1 (zh) 2020-12-24

Family

ID=68359439

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118369 WO2020253063A1 (zh) 2019-06-20 2019-11-14 一种相似图片的检索方法及装置

Country Status (2)

Country Link
CN (1) CN110413824A (zh)
WO (1) WO2020253063A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626633A (zh) * 2021-09-01 2021-11-09 北京云蝶智学科技有限公司 图片检索方法及装置
CN113743420A (zh) * 2021-08-26 2021-12-03 北京邮电大学 一种基于云边端协同的Web AR图像识别方法及系统
CN115795288A (zh) * 2022-11-16 2023-03-14 钰深(北京)科技有限公司 服装版型查重方法、装置、电子设备以及存储介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413824A (zh) * 2019-06-20 2019-11-05 平安科技(深圳)有限公司 一种相似图片的检索方法及装置
CN111079793A (zh) * 2019-11-21 2020-04-28 北京云聚智慧科技有限公司 图标相似度的确定方法和电子设备
CN111581415B (zh) * 2020-03-18 2023-07-04 时时同云科技(成都)有限责任公司 确定相似物体的方法、物体相似度的确定方法和设备
CN111738362B (zh) * 2020-08-03 2020-12-01 成都睿沿科技有限公司 对象识别方法及装置、存储介质及电子设备
CN112464002A (zh) * 2020-12-02 2021-03-09 北京粉笔蓝天科技有限公司 用于图形推理题图像检索的方法、装置、存储介质和设备
CN112633397B (zh) * 2020-12-29 2021-12-14 江苏惟妙纺织科技有限公司 一种绣花定制方法及系统
CN112651953B (zh) * 2020-12-31 2024-03-15 平安国际智慧城市科技股份有限公司 图片相似度计算方法、装置、计算机设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070195344A1 (en) * 2006-02-01 2007-08-23 Sony Corporation System, apparatus, method, program and recording medium for processing image
CN103593458A (zh) * 2013-11-21 2014-02-19 电子科技大学 一种基于颜色特征与倒排索引的海量图像检索系统
CN104462502A (zh) * 2014-12-19 2015-03-25 中国科学院深圳先进技术研究院 一种基于特征融合的图像检索方法
CN107403437A (zh) * 2016-05-19 2017-11-28 上海慧流云计算科技有限公司 机器人跟踪物体的方法、装置及机器人
CN109284669A (zh) * 2018-08-01 2019-01-29 辽宁工业大学 基于Mask RCNN的行人检测方法
CN110413824A (zh) * 2019-06-20 2019-11-05 平安科技(深圳)有限公司 一种相似图片的检索方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101639858A (zh) * 2009-08-21 2010-02-03 深圳创维数字技术股份有限公司 基于目标区域匹配的图像检索方法
CN101853299B (zh) * 2010-05-31 2012-01-25 杭州淘淘搜科技有限公司 一种基于感性认知的图像检索结果排序方法
KR101326083B1 (ko) * 2011-11-28 2013-11-07 건국대학교 산학협력단 스케치 질의를 사용하는 콘텐츠 기반 이미지 검색기에서의 질의 이미지 및 검색 대상 영상의 전처리 장치 및 그 방법
CN103714181B (zh) * 2014-01-08 2016-09-28 天津大学 一种层级化的特定人物检索方法
CN106021575A (zh) * 2016-05-31 2016-10-12 北京奇艺世纪科技有限公司 一种视频中同款商品检索方法及装置
CN108898610B (zh) * 2018-07-20 2020-11-20 电子科技大学 一种基于mask-RCNN的物体轮廓提取方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070195344A1 (en) * 2006-02-01 2007-08-23 Sony Corporation System, apparatus, method, program and recording medium for processing image
CN103593458A (zh) * 2013-11-21 2014-02-19 电子科技大学 一种基于颜色特征与倒排索引的海量图像检索系统
CN104462502A (zh) * 2014-12-19 2015-03-25 中国科学院深圳先进技术研究院 一种基于特征融合的图像检索方法
CN107403437A (zh) * 2016-05-19 2017-11-28 上海慧流云计算科技有限公司 机器人跟踪物体的方法、装置及机器人
CN109284669A (zh) * 2018-08-01 2019-01-29 辽宁工业大学 基于Mask RCNN的行人检测方法
CN110413824A (zh) * 2019-06-20 2019-11-05 平安科技(深圳)有限公司 一种相似图片的检索方法及装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113743420A (zh) * 2021-08-26 2021-12-03 北京邮电大学 一种基于云边端协同的Web AR图像识别方法及系统
CN113743420B (zh) * 2021-08-26 2023-12-05 北京邮电大学 一种基于云边端协同的Web AR图像识别方法及系统
CN113626633A (zh) * 2021-09-01 2021-11-09 北京云蝶智学科技有限公司 图片检索方法及装置
CN115795288A (zh) * 2022-11-16 2023-03-14 钰深(北京)科技有限公司 服装版型查重方法、装置、电子设备以及存储介质
CN115795288B (zh) * 2022-11-16 2023-09-08 钰深(北京)科技有限公司 服装版型查重方法、装置、电子设备以及存储介质

Also Published As

Publication number Publication date
CN110413824A (zh) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2020253063A1 (zh) 一种相似图片的检索方法及装置
US11423076B2 (en) Image similarity-based group browsing
JP6144839B2 (ja) 画像を検索するための方法およびシステム
JP6228307B2 (ja) オンライン製品を推薦するための方法及びシステム
US9330111B2 (en) Hierarchical ranking of facial attributes
Garces et al. A similarity measure for illustration style
US9881226B1 (en) Object relation builder
US20120117072A1 (en) Automated Product Attribute Selection
CN107679960B (zh) 一种基于服装图像和标签文本双模态内容分析的个性化服装的推荐方法
CN104991954B (zh) 基于图像搜索的购物搜索系统及其实现方法
GB2593637A (en) Visual attribute determination for content selection
CN104281572B (zh) 一种基于互信息的目标匹配方法及其系统
CN106021603A (zh) 一种基于分割和特征匹配的服装图像检索方法
Lasserre et al. Studio2shop: from studio photo shoots to fashion articles
Lei et al. A new clothing image retrieval algorithm based on sketch component segmentation in mobile visual sensors
JP2023130409A (ja) 情報処理装置、情報処理方法及びプログラム
Carneiro Graph-based methods for the automatic annotation and retrieval of art prints
CN116935057A (zh) 目标评价方法、电子设备和计算机可读存储介质
Madhu et al. ICC++: Explainable feature learning for art history using image compositions
US20220100792A1 (en) Method, device, and program for retrieving image data by using deep learning algorithm
CN112650869B (zh) 图像检索重排序方法、装置、电子设备及存储介质
JP2016014990A (ja) 動画像検索方法、動画像検索装置及びそのプログラム
Tehsin et al. A caption text detection method from images/videos for efficient indexing and retrieval of multimedia data
Jadhav et al. Introducing Celebrities in an Images using HAAR Cascade algorithm
WO2023079769A1 (ja) 処理実行システム、処理実行方法、及びプログラム

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: 19933503

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: 19933503

Country of ref document: EP

Kind code of ref document: A1