A method and apparatus for similar image retrieval, an electronic device, and a storage medium

By utilizing global and local features in an image database to filter similar images, the problem of low efficiency in similar image retrieval in large-scale image databases is solved, achieving efficient and accurate similar image retrieval.

CN116127118BActive Publication Date: 2026-06-26MICRO DREAM TECHTRONIC NETWORK TECH CHINACO

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MICRO DREAM TECHTRONIC NETWORK TECH CHINACO
Filing Date
2022-12-21
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies are inefficient and consume a lot of computational resources when performing similar image retrieval in large-scale image databases.

Method used

By determining the overall and local features of the target image, candidate images with the same overall features as the target image are selected from the image database, and the local features are used to further determine similar images, thereby reducing the amount of computation.

Benefits of technology

It improves the efficiency and accuracy of similar image retrieval and saves computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127118B_ABST
    Figure CN116127118B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for similar image retrieval, electronic equipment and storage medium, and belongs to the technical field of image processing. The method comprises the following steps: determining a first feature of a target image and a second feature of the target image, wherein the first feature is used for describing the overall feature of the image, and the second feature is used for describing the local feature of the image; determining at least one selected image from an image database, wherein the first feature of the selected image is the same as the first feature of the target image; and determining a second image similar to the target image from the at least one selected image according to the second feature of the target image and the second feature of the at least one selected image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, specifically relating to a method, apparatus, electronic device, and storage medium for similar image retrieval. Background Technology

[0002] In the field of image processing technology, it is often necessary to retrieve similar images from a large-scale image database for analysis. A common approach is to first generate a fingerprint f0 for the target image, typically a fixed-length string or a fixed-length floating-point vector. Then, the distance between f0 and all fingerprints in the image fingerprint database is calculated. The image corresponding to the fingerprint with the smallest distance is considered similar to the target image. However, due to the vast size of the image fingerprint database, each retrieval is time-consuming and inefficient. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, electronic device, and storage medium for similar image retrieval, which can improve the efficiency of similar image retrieval.

[0004] To solve the above-mentioned technical problems, this application is implemented as follows:

[0005] In a first aspect, embodiments of this application provide a method for similar image retrieval, the method comprising: determining a first feature of a target image and a second feature of the target image, wherein the first feature is used to describe the overall features of the image and the second feature is used to describe the local features of the image; determining at least one candidate image from an image database, wherein the first feature of the candidate image is the same as the first feature of the target image; and determining a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image.

[0006] Secondly, embodiments of this application provide an apparatus for similar image retrieval, the apparatus comprising: a first determining module, configured to determine a first feature of a target image and a second feature of the target image, wherein the first feature is used to describe the overall features of the image and the second feature is used to describe the local features of the image; a filtering module, configured to determine at least one candidate image from an image database, wherein the first feature of the candidate image is the same as the first feature of the target image; and a second determining module, configured to determine a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image.

[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions being executed by the processor to implement the steps of the similar image retrieval method as described in the first aspect.

[0008] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the similar image retrieval method as described in the first aspect.

[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the similar image retrieval method as described in the first aspect.

[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the similar image retrieval method as described in the first aspect.

[0011] In this embodiment of the application, by determining a first feature and a second feature of a target image, where the first feature describes the overall features of the image and the second feature describes the local features of the image; determining at least one candidate image from an image database, wherein the first feature of the candidate image is the same as the first feature of the target image; and determining a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image, the efficiency of similar image retrieval can be improved. Attached Figure Description

[0012] Figure 1 This illustration shows a flowchart of a similar image retrieval method provided in an embodiment of this application;

[0013] Figure 2 This illustration shows another flowchart of the similar image retrieval method provided in an embodiment of this application;

[0014] Figure 3 A schematic diagram of the structure of the similar image retrieval device provided in an embodiment of this application is shown;

[0015] Figure 4 This diagram illustrates the hardware structure of the electronic device provided in an embodiment of this application. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0017] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0018] The method for similar image retrieval provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0019] Figure 1 This is a schematic flowchart of a similar image retrieval method provided in an embodiment of this application, such as... Figure 1 As shown, the method may include the following steps.

[0020] S101: Determine the first feature of the target image and the second feature of the target image.

[0021] The first feature describes the overall features of the image, while the second feature describes the local features of the image. Specifically, the first feature includes, but is not limited to, the image's color and texture features. The second feature can be a contour feature, a spatial relationship feature, or a feature of a portion of the image; that is, if the image is divided into multiple regions, the second feature can be a feature of at least one of these regions.

[0022] Optionally, the features can be expressed in at least one way, such as character sequences, vectors, matrices, or function expressions.

[0023] S102: Determine at least one candidate image from the image database.

[0024] The first feature of the candidate image is the same as the first feature of the target image. That is, the overall features of the candidate image and the target image are the same. The image database includes multiple images of the same or similar category or from the same source as the target image. For example, if the target image is a remote sensing image, the image database contains multiple images belonging to the remote sensing image category or the natural landscape image category.

[0025] This step eliminates the need for related similarity distance calculations, allowing for the identification of a small number of candidate images with the same first feature as the target image from a large image database. This narrows the search scope and avoids the resource-intensive and inefficient problem of related similarity distance calculations, thus saving computational resources and achieving high computational efficiency.

[0026] S103: Based on the second feature of the target image and the second feature of the at least one candidate image, determine a second image similar to the target image from the at least one candidate image.

[0027] Specifically, the region described by the second feature of the target image corresponds to the region described by the second feature of the candidate image at least in size and position. For example, a second feature of the target image describes the upper left portion of the target image with a width of 100px and a height of 130px; correspondingly, a second feature of the candidate image also describes the upper left portion of the candidate image with a width of 100px and a height of 130px.

[0028] This step, from the identified limited number of candidate images, further determines a second image similar to the target image based on the second feature of the target image and the second feature of at least one candidate image. Because the number of candidate images is much smaller than the number of images in the image database, the computational and retrieval efficiency is greatly improved.

[0029] This application embodiment improves the efficiency of similar image retrieval by determining a first feature and a second feature of a target image, wherein the first feature describes the overall features of the image and the second feature describes the local features of the image; determining at least one candidate image from an image database, wherein the first feature of the candidate image is the same as the first feature of the target image; and determining a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image.

[0030] Figure 2 This is another schematic flowchart of the similar image retrieval method provided in the embodiments of this application, such as... Figure 2 As shown, the method may include the following steps.

[0031] S201: Determine the features of each channel of the target image based on multiple pixel values ​​of each channel; determine the first feature of the target image based on the features of each channel.

[0032] Specifically, the channels include, but are not limited to, the RGB channels (red, green, blue), with each channel's pixel value ranging from 0 to 255 (integers). Alternatively, they may consist of the CMY channels (cyan, magenta, and yellow), with each channel's pixel value ranging from 0 to 100 (integers). The features of each channel can be represented by at least one of vectors, matrices, or expressions.

[0033] Optionally, the range of pixel values ​​for the channel can be narrowed to simplify the representation of the channel's features without altering the characteristics of the target image. For example, for a pixel value r of the R channel... ij The conversion can be performed using the following formula:

[0034]

[0035] Where mod4 represents r ij Perform a remainder operation on 4. This means if r ij If r is a multiple of 4, then r remains unchanged. ij The pixel value; if r ij If the value is not a multiple of 4, decrease r. ij The formula is used to represent neighboring pixel values ​​with a single pixel value, reducing the range of pixel values ​​from integers between 0 and 255 to multiples of 4 between 0 and 252.

[0036] By processing the image pixel values ​​as described above, converting two pixels with pixel values ​​differing by less than 4 into the same pixel (classifying them into one category), the generated first feature becomes more robust.

[0037] S202: Determine at least one first image from the target image.

[0038] The first image is a portion of the target image, and different first images correspond to different portions of the target image. Specifically, the portion of the target image corresponding to at least one first image can be a regular or irregular portion. For example, the first image can be a rectangular target image divided into four smaller rectangles of equal height and width, or it can be divided in other ways, depending on the actual situation, and no specific limitation is made here.

[0039] Optionally, the first images may also have overlapping portions.

[0040] S203: For each of the first images, determine the features of each channel of the first image based on multiple pixel values ​​of each channel of the first image; determine the second feature of the target image corresponding to the first image based on the features of each channel of the first image.

[0041] This step can be described using step S201 of this embodiment, and will not be repeated here.

[0042] It should be noted that the more first images identified and the larger the range of target images covered by multiple first images, the more second features are extracted, and the richer the feature expression.

[0043] S204: Determine at least one candidate image from the image database.

[0044] This step can be adopted. Figure 1 The description of step S102 in the embodiment will not be repeated here.

[0045] S205: For each candidate image, compare each second feature of the target image with the corresponding second feature of the candidate image, and determine the similarity value corresponding to the candidate image based on the results of the multiple comparisons.

[0046] Specifically, the similarity of each second feature of the target image with the corresponding second feature of the candidate image is compared. The comparison result can be a score based on the similarity between each corresponding second feature, and the score can be expressed as a decimal or percentage between 0 and 1. For example, if the target image and the candidate image have 4 sets of corresponding second features, that is, there are 4 corresponding first images, the following formula can be used for scoring:

[0047]

[0048] Where j = 1, 2, 3, 4, p represents the candidate image i The score on the j-th second feature, p represents the candidate image i The j-th second feature, Let j represent the j-th second feature of the target image p0.

[0049] Then, based on the results of multiple sets of comparisons of corresponding second features, the similarity value between the candidate image and the target image is determined. Specifically, the similarity value between the candidate image and the target image can be obtained by summing or averaging the results of the multiple sets of comparisons of corresponding second features. For example, the following formula can be used to sum the results of each set of second feature comparisons, as p. i Similarity value with p0:

[0050]

[0051] Optionally, to differentiate the similarity results between different candidate images, a second set of features (the 5th feature) can be added using the following formula to improve the accuracy of the comparison results:

[0052]

[0053] in, and The second feature of the target image p0 represents the feature components in the three color channels.

[0054] Yes, and p represents the candidate image i The second feature is found in the feature components of the three color channels. A one-to-one comparison of the feature components of the three color channels is performed, and the feature component with the largest difference is selected. Then, p0 and p1 in the corresponding color channel of that feature component are calculated. i The similarity.

[0055] It should be noted that setting the similarity score for each of the second features to 0.2 can make the similarity value of the final candidate images between [0,1]. However, this score can also be set to other values. When the score is set to other values, the final similarity value can be normalized to between [0,1].

[0056] S206: The candidate image with the highest similarity value is determined as the second image.

[0057] Specifically, prior to this step, the similarity values ​​of each candidate image are sorted, and the candidate image with the highest similarity value is determined. In one implementation, determining the first feature of the target image includes: identifying the following string f0 as the first feature of the target image:

[0058] f0=h×w,δ1_δ2,j 11 _j 12 _…_j 1m _j 21 _j 22 _…_j 2m _j 31 _j 32 _…_j 3m Where h and w are the height and width of the target image, respectively, and δ1, δ2, and m are preset parameters satisfying δ1>δ2, m∈[2,255], j i1 j i2 ...j imThese are the first m pixel values ​​in the i-th channel of the target image whose grayscale percentage is greater than or equal to δ1, and δ2 is used to... i1 j i2 ...j im The order is adjusted, and the i-th channel includes one of the three channels: red, green, blue, and RGB.

[0059] Specifically, for each channel, the grayscale proportions corresponding to multiple pixel values ​​are sorted from largest to smallest, and the first m grayscale proportions greater than or equal to δ1 are extracted to form a feature vector, for example, δ1 = 1. After calculating the grayscale proportion of each pixel value, the grayscale proportions are... The proportion u of the gray level of pixel value j in each channel. j Sort the data from largest to smallest, and extract the first m ratios whose grayscale percentage is greater than or equal to δ1 to form a vector. That is, the conditions are met. For k = 1, 2, ..., n, if the ratio u is greater than or equal to δ1 j If there are fewer than m, then use u. -1 =0 is used for padding. For example, u= Subscript (j) i1 j i2 The pixel values ​​corresponding to (-1, -1, -1) are (252, 68, -1, -1, -1). By performing similar processing on the pixels of each channel, the first feature can be obtained.

[0060] To improve the generalization ability of the extracted features, this embodiment can further adjust the aforementioned extracted feature vector. Specifically, if adjacent grayscale proportions satisfy the condition that the difference between them is less than δ2, and the corresponding grayscale proportion with higher pixel value precedes the corresponding grayscale proportion with lower pixel value (where δ2 can be set to a smaller number less than δ1), then the order of the grayscale proportions with lower and higher pixel values ​​in the feature vector is swapped. For example, the feature vector...

[0061] u=(7.058, 6.922, 5.824, 4.913, 4.518)

[0062] The corresponding pixel values ​​are (12, 16, 20, 24, 8). We adjust the order by taking δ² = 0.5 to obtain the adjusted feature vector.

[0063]

[0064] The corresponding pixel values ​​are (12, 16, 20, 8, 24).

[0065] For example, if the feature height and width of the target image are h = 421 and w = 690 respectively, and the preset parameters are δ1 = 1.0, δ2 = 0.5, and m = 5, then the first feature of the target image can be expressed as:

[0066] f0=421×690,1.0_0.5,0_4_8_12_16_0_4_8_12_16_0_4_8_12_16.

[0067] Additionally, if and If all elements are 0, then let δ1 = δ1 / 2, and then recalculate. and Fingerprint f0 is a comma-separated string containing 3 segments. When m = 5, f0 = h × w, δ1_δ2, j 11 _j 12 _j 13 _j 14 _j 15 _j 21 _j 22 _j 23 _j 24 _j 25 _j 31 _j 22 _j 33 _j 34 _j 35 , where × is a character and _ is also a character.

[0068] In one implementation, the second feature of the target image includes: [the following string f] k The second feature identified as the target image:

[0069] f k =l 11 _l 12 _…_l 1m _l 21 _l 22 _…_l 2m _l 31 _l 32 _…_l 3m

[0070] Among them, l i1 l i2 ... l im The first image is defined as the first m pixel values ​​in the i-th channel of the first image whose grayscale percentage is greater than or equal to δ1. The i-th channel includes one of the three RGB channels (red, green, blue). The first image is the k-th part of the target image, where k = 1, 2, ..., K, and K is the number of first images in the target image. The height of the first image... Or h1 = h- The width of the first image or or or h and w are the height and width of the target image, respectively.

[0071] Where h and w are the height and width of the target image, respectively. The above settings for the first image can effectively retrieve similar images that differ only in the presence or absence of a watermark. Furthermore, by representing image features with strings, comparing the similarity of two strings eliminates the need for distance calculations, saving computational resources and improving computational efficiency.

[0072] Optionally, the grayscale ratio of each pixel value can also be used as a second feature of the target image to further enrich the extracted features and improve the accuracy of image retrieval. In one implementation, the second feature of the target image further includes: determining the following vector as the second feature of the target image:

[0073]

[0074] in, The pixel values ​​in the i-th channel of the target image are j, respectively. i1 j i2 ..., j im grayscale percentage, For the i-th channel of the target image, the pixel value is equal to j. im The number of.

[0075] This application embodiment determines the features of each channel of the target image based on multiple pixel values ​​of each channel; determines a first feature of the target image based on the features of each channel; determines at least one first image from the target image; for each first image, determines the features of each channel of the first image based on multiple pixel values ​​of each channel of the first image; determines a second feature of the target image corresponding to the first image based on the features of each channel of the first image; determines at least one candidate image from an image database; for each candidate image, compares each second feature of the target image with the corresponding second feature of the candidate image, and determines a similarity value corresponding to the candidate image based on the results of multiple comparisons; and determines the candidate image with the highest similarity value as the second image. This approach saves computational resources and improves the efficiency and accuracy of similar image retrieval.

[0076] Figure 3The diagram shows a structural schematic of a similar image retrieval device provided in an embodiment of this application. The device 300 includes: a first determining module 301, a filtering module 302, and a second determining module 303.

[0077] The first determining module 301 is used to determine a first feature and a second feature of the target image, wherein the first feature is used to describe the overall features of the image and the second feature is used to describe the local features of the image; the filtering module 302 is used to determine at least one candidate image from the image database, wherein the first feature of the candidate image is the same as the first feature of the target image; the second determining module 303 is used to determine a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image.

[0078] In one implementation, the second determining module 303 is further configured to, for each candidate image, compare each second feature of the target image with the corresponding second feature of the candidate image, determine the similarity value corresponding to the candidate image based on the results of the multiple comparisons, and determine the candidate image with the highest similarity value as the second image.

[0079] In one implementation, the first determining module 301 is further configured to determine the features of each channel of the target image based on multiple pixel values ​​of each channel of the target image; and determine the first feature of the target image based on the features of each channel.

[0080] In one implementation, the first determining module 301 is further configured to determine at least one first image from the target image, wherein the first image is a portion of the target image, and different first images correspond to different portions of the target image; for each first image, determine the features of each channel of the first image based on multiple pixel values ​​of each channel of the first image; and determine the second feature of the target image corresponding to the first image based on the features of each channel of the first image.

[0081] In one implementation, the first determining module 301 is further configured to determine the following string f0 as a first feature of the target image:

[0082] f0=h×w,δ1_δ2,j 11 _j 12 _…_j 1m _j 21 _j 22 _…_j 2m _j 31 _j 32 _…_j 3m

[0083] Where h and w are the height and width of the target image, respectively, and δ1, δ2, and m are preset parameters satisfying δ1>δ2, m∈[2,255], j i1 j i2 ..., j im The first m pixel values ​​of the i-th channel of the target image whose grayscale ratio is greater than or equal to δ1 are defined as follows: the i-th channel includes one of the three channels: red, green, blue, and RGB.

[0084] In one implementation, the first determining module 301 is further configured to set the following string f k The second feature identified as the target image:

[0085] f k =l 11 _l 12 _…_l 1m _l 21 _l 22 _…_l 2m _l 31 _l 32 _…_l 3m

[0086] Among them, l i1 l i2 ... l im The first image is defined as the first m pixel values ​​in the i-th channel of the first image whose grayscale percentage is greater than or equal to δ1. The i-th channel includes one of the three RGB channels (red, green, blue). The first image is the k-th part of the target image, where k = 1, 2, ..., K, and K is the number of first images in the target image. The height of the first image... or The width of the first image or or or h and w are the height and width of the target image, respectively.

[0087] In one embodiment, the first determining module 301 is further configured to determine the following vectors as a second feature of the target image:

[0088]

[0089] in, The pixel values ​​in the i-th channel of the target image are j, respectively. i1 j i2 ..., j im grayscale percentage, For the i-th channel of the target image, the pixel value is equal to j. im The number of.

[0090] The device 300 provided in this application embodiment can execute the methods described in the preceding method embodiments and achieve the functions and beneficial effects of the methods described in the preceding method embodiments, which will not be repeated here.

[0091] Figure 4 This diagram illustrates the hardware structure of an electronic device performing the similar image retrieval provided in the embodiments of this application. Referring to the diagram, at the hardware level, the electronic device includes a processor and optionally, an internal bus, a network interface, and a memory. The memory may include RAM, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other services.

[0092] The processor, network interface, and memory can be interconnected via an internal bus, which can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only a single bidirectional arrow is used in this diagram, but this does not imply that there is only one bus or one type of bus.

[0093] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0094] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a device for locating the target user at the logical level. The processor executes the program stored in memory and specifically performs the actions described in the preceding method embodiments. Figure 1-2 The methods described above, and the implementations of the methods in the preceding embodiments. Figure 1-2 The functions and beneficial effects of the methods described will not be elaborated here.

[0095] The above is as stated in this application. Figure 1-2The methods disclosed in the illustrated embodiments can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0096] The electronic device can also perform the methods described in the preceding embodiments. Figure 1-2 The methods described above, and the implementations of the methods in the preceding embodiments. Figure 1-2 The functions and beneficial effects of the methods described will not be elaborated here.

[0097] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0098] This application also proposes a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the methods described in the preceding embodiments. Figure 1-2 The methods described above, and the implementations of the methods in the preceding embodiments. Figure 1-2 The functions and beneficial effects of the methods described will not be elaborated here.

[0099] The computer-readable storage medium includes read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, etc.

[0100] Furthermore, this application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, implement the method described in the preceding embodiments. Figure 1-2 The functions and beneficial effects of the methods described will not be elaborated here.

[0101] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0102] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0103] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0104] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0106] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A method for similar image retrieval, characterized in that, The method includes: A first feature and a second feature of the target image are determined, wherein the first feature is used to describe the overall features of the image and the second feature is used to describe the local features of the image; From an image database, at least one candidate image is determined, wherein the first feature of the candidate image is the same as the first feature of the target image; Based on the second feature of the target image and the second feature of the at least one candidate image, a second image similar to the target image is determined from the at least one candidate image; The determination of the first feature of the target image includes: Please use the following string The first feature identified as the target image is: in, and These are the height and width of the target image, respectively. , and These are preset parameters that satisfy... , , The first and second images of the target image are respectively The grayscale percentage of multiple pixel values ​​in each channel is greater than or equal to The former pixel value, Used for The order is adjusted, the first Each channel includes one of the three channels: red, green, blue, or RGB.

2. The method according to claim 1, characterized in that, The second feature includes multiple features used to describe different parts of the image; The step of determining a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image includes: For each candidate image, each second feature of the target image is compared with the corresponding second feature of the candidate image, and a similarity value corresponding to the candidate image is determined based on the results of the multiple comparisons. The candidate image with the highest similarity value is selected as the second image.

3. The method according to claim 1, characterized in that, The determination of the first feature of the target image includes: Based on multiple pixel values ​​of each channel of the target image, the features of each channel of the target image are determined; Based on the characteristics of each channel, a first feature of the target image is determined.

4. The method according to claim 1, characterized in that, The determination of the second feature of the target image includes: At least one first image is determined from the target image, wherein the first image is a portion of the target image, and different first images correspond to different portions of the target image; For each of the first images, features of each channel of the first image are determined based on multiple pixel values ​​of each channel of the first image; and second features of the target image corresponding to the first image are determined based on the features of each channel of the first image.

5. The method according to claim 4, characterized in that, The determination of the second feature of the target image includes: Please use the following string The second feature identified as the target image: in, For the first image The grayscale percentage of multiple pixel values ​​in each channel is greater than The former The pixel value, the first Each channel includes one of the three RGB channels (red, green, blue), and the first image is the first [image name] of the target image. Partial images, , K The number of first images in the target image, and the height of the first image. or The width of the first image or or or , and These are the height and width of the target image, respectively.

6. The method according to claim 1 or 5, characterized in that, Also includes: The following vectors are identified as the second feature of the target image: , in, The first and second images of the target image are respectively The pixel values ​​in each channel are respectively grayscale percentage, , For the target image of the first Among multiple pixel values ​​in a channel, the pixel value is equal to The number of.

7. A device for similar image retrieval, characterized in that, The device includes: The first determining module is used to determine a first feature of the target image and a second feature of the target image, wherein the first feature is used to describe the overall features of the image and the second feature is used to describe the local features of the image. A filtering module is used to determine at least one candidate image from an image database, wherein a first feature of the candidate image is the same as a first feature of the target image; The second determining module is used to determine a second image similar to the target image from the at least one candidate image based on the second feature of the target image and the second feature of the at least one candidate image; The first determining module is also used to: determine the following strings The first feature identified as the target image is: in, and These are the height and width of the target image, respectively. , and These are preset parameters that satisfy... , , The first and second images of the target image are respectively The grayscale percentage of multiple pixel values ​​in each channel is greater than or equal to The former pixel value, Used for The order is adjusted, the first Each channel includes one of the three channels: red, green, blue, or RGB.

8. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method as described in any one of claims 1-6.

9. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-6.