CN116127118A - Method, device, electronic equipment and storage medium for searching similar images - Google Patents

Method, device, electronic equipment and storage medium for searching similar images Download PDF

Info

Publication number
CN116127118A
CN116127118A CN202211646951.7A CN202211646951A CN116127118A CN 116127118 A CN116127118 A CN 116127118A CN 202211646951 A CN202211646951 A CN 202211646951A CN 116127118 A CN116127118 A CN 116127118A
Authority
CN
China
Prior art keywords
image
feature
target image
determining
characteristic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211646951.7A
Other languages
Chinese (zh)
Inventor
何沧平
周鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weimeng Chuangke Network Technology China Co Ltd
Original Assignee
Weimeng Chuangke Network Technology China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weimeng Chuangke Network Technology China Co Ltd filed Critical Weimeng Chuangke Network Technology China Co Ltd
Priority to CN202211646951.7A priority Critical patent/CN116127118A/en
Publication of CN116127118A publication Critical patent/CN116127118A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses a method, a device, electronic equipment and a storage medium for similar image retrieval, 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 integral feature of the image, and the second feature is used for describing the local feature of the image; determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image; and determining a second image similar to the target image from the at least one image to be selected according to the second characteristic of the target image and the second characteristic of the at least one image to be selected.

Description

Method, device, electronic equipment and storage medium for searching similar images
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a method and device for searching similar images, electronic equipment and a storage medium.
Background
In the field of image processing technology, it is often necessary to retrieve similar images from a large-scale image for analysis. The related method is that the fingerprint f0 of the target image is firstly generated, generally a fixed-length character string or a fixed-length floating point number vector is generated, then the distance between f0 and all fingerprints in a picture fingerprint library is calculated, and the image corresponding to the fingerprint with the smallest distance is the image similar to the target image, but the time spent in each search is long due to the huge picture fingerprint library, and the efficiency is low.
Disclosure of Invention
The embodiment of the application aims to provide a method, a device, electronic equipment and a storage medium for searching similar images, which can improve the efficiency of similar image searching.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for searching similar images, including: 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 integral feature of the image, and the second feature is used for describing the local feature of the image; determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image; and determining a second image similar to the target image from the at least one image to be selected according to the second characteristic of the target image and the second characteristic of the at least one image to be selected.
In a second aspect, embodiments of the present application provide an apparatus for similar image retrieval, including: a first determining module, configured to determine a first feature of a target image and a second feature of the target image, where the first feature is used to describe an overall feature of the image, and the second feature is used to describe a local feature of the image; the screening module is used for determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image; and the second determining module is used for determining a second image similar to the target image from the at least one image to be selected according to the second characteristic of the target image and the second characteristic of the at least one image to be selected.
In a third aspect, embodiments of the present application provide an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method of similar image retrieval as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method of similar image retrieval as described in the first aspect.
In a fifth aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method for similar image retrieval as described in the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement a method of similar image retrieval as described in the first aspect.
In the embodiment of the application, a first characteristic of a target image and a second characteristic of the target image are determined, wherein the first characteristic is used for describing the integral characteristic of the image, and the second characteristic is used for describing the local characteristic of the image; determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image; according to the second characteristic of the target image and the second characteristic of the at least one image to be selected, the second image similar to the target image is determined from the at least one image to be selected, and the efficiency of similar image retrieval can be improved.
Drawings
FIG. 1 is a schematic flow chart of a method for similar image retrieval according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of another method for similar image retrieval according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for searching similar images according to an embodiment of the present application;
fig. 4 shows a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type and not limited to the number of objects, e.g., the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The method for searching similar images provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method for searching similar images according to an embodiment of the present application, and as shown in fig. 1, the method may include the following steps.
S101: a first feature of a target image and a second feature of the target image are determined.
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. In particular, the first features include, but are not limited to, color features, texture features of the image. The second feature may be a contour feature, a spatial relationship feature, or a feature of a partial region in the image, i.e. the image is divided into a plurality of partial regions, and the second feature may be a feature of at least one partial region.
Alternatively, the feature may take at least one expression such as a character sequence, vector, matrix, functional expression, and the like.
S102: at least one image to be selected is determined from an image database.
Wherein the first feature of the image to be selected is the same as the first feature of the target image. That is, the overall characteristics of the candidate image and the target image are the same. The image database comprises a plurality of images which are the same as or similar to the target image in category or the same in source, for example, the target image is a remote sensing image, and the image database comprises a plurality of images belonging to the remote sensing image category or the nature landscape image category.
The method can determine a small number of images to be selected, which are the same as the first feature of the target image, from a larger image database without calculating the relevant similarity distance, so that the search range is narrowed, the problems of high consumption and low efficiency of calculating the relevant similarity distance are avoided, the calculation resources are saved, and the calculation efficiency is high.
S103: and determining a second image similar to the target image from the at least one image to be selected according to the second characteristic of the target image and the second characteristic of the at least one image to be selected.
Specifically, the region described by the second feature of the target image corresponds to the region described by the second feature of the image to be selected at least in size and position. For example, one second feature of the target image is used to describe an upper left part image with a width of 100px (pixel) and a height of 130px in the target image, and the corresponding second feature of the image to be selected is also used to describe an upper left part image with a width of 100px and a height of 130px in the image to be selected.
In the step, in the determined small number of images to be selected, a second image similar to the target image is further determined according to the second characteristics of the target image and the second characteristics of the at least one image to be selected. Because the number of the images to be selected is much smaller than the number of the images in the image database, the calculation and retrieval efficiency is greatly improved.
According to the method, the first characteristic of the target image and the second characteristic of the target image are determined, wherein the first characteristic is used for describing the integral characteristic of the image, and the second characteristic is used for describing the local characteristic of the image; determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image; according to the second characteristic of the target image and the second characteristic of the at least one image to be selected, the second image similar to the target image is determined from the at least one image to be selected, and the efficiency of similar image retrieval can be improved.
Fig. 2 is another flow chart of a method for similar image retrieval according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps.
S201: determining a characteristic of each channel of the target image according to a plurality of pixel values of each channel of the target image; and determining a first characteristic of the target image according to the characteristic of each channel.
Specifically, the channels include, but are not limited to, three red, green and blue RGB channels, and the pixel value of each channel is an integer in the range of 0 to 255. Or CMY three channels consisting of cyan, magenta and yellow, wherein the pixel value of each channel is an integer in the range of 0-100. The characteristics of each channel may be represented by at least one of a vector, a matrix, or an expression.
Optionally, the range of pixel values of the channel is narrowed, simplifying the representation of the characteristics of the channel without changing the characteristics of the target image. For example, for a pixel value R of the R channel ij The conversion is performed by the following formula:
Figure BDA0004010041240000051
wherein mod4 represents r ij The remainder operation is carried out on the 4,
Figure BDA0004010041240000052
representing if r ij Is an integer multiple of 4, then r is not changed ij Pixel values of (2); if r ij Not an integer multiple of 4, r is reduced ij Until it is an integer multiple of 4. The adjacent pixel values can be represented by one pixel value through the formula, namely, the value range of the pixel value is reduced from an integer in 0-255 to an integer multiple of 4 in 0-252.
The first feature generated is made more robust by the above-described processing of the image pixel values, i.e. converting two pixels whose pixel values differ by less than 4 into the same pixel (classified as one).
S202: at least one first image is determined from the target image.
The first images are images of parts in the target images, and the parts of the target images corresponding to different first images are different. Specifically, the portion in the target image corresponding to the at least one first image may be a regular portion or an irregular portion. For example, the target image of the rectangle may be equally divided into four first images of small rectangles according to the same width, or may be divided into different portions, and may be set according to the actual situation, which is not particularly limited herein.
Alternatively, there may be an overlapping portion between the first images.
S203: determining, for each of the first images, a feature of each channel of the first image from a plurality of pixel values of each channel of the first image; and determining a second characteristic of the target image corresponding to the first image according to the characteristic of each channel of the first image.
This step may be described in step S201 of this embodiment, and will not be described herein.
The more the first images are determined, the larger the range of the target image covered by the plurality of first images, the more the extracted second features are, and the more the feature expression is enriched.
S204: at least one image to be selected is determined from an image database.
This step may be described in step S102 of the embodiment of fig. 1, which is not described herein.
S205: and comparing each second characteristic of the target image with the corresponding second characteristic of the image to be selected according to each image to be selected, and determining a similarity value corresponding to the image to be selected according to a plurality of comparison results.
Specifically, each second feature of the target image is compared with the corresponding second feature of the image to be selected, and the comparison result may be a result of scoring according to the similarity between the second features, and the score value may be expressed by a fraction or a percentage between 0 and 1. For example, if the target image has 4 sets of corresponding second features with the candidate image, i.e., 4 corresponding first images, the following formula may be used for scoring:
Figure BDA0004010041240000061
where j=1, 2,3,4,
Figure BDA0004010041240000062
representing a candidate image p i Score on the j-th second feature,/->
Figure BDA0004010041240000063
Representing a candidate image p i Is the j-th second feature of>
Figure BDA0004010041240000064
Representing the target image p 0 Is the j-th second feature of (2).
And then, according to the comparison results of the multiple groups of corresponding second features, determining the similarity value of the image to be selected and the target image. Specifically, the similarity value between the image to be selected and the target image can be obtained by adding or averaging the results of the comparison of the multiple sets of corresponding second features. For example, the results of each set of second feature comparisons are summed as p using the formula i And p is as follows 0 Similarity value of (2):
Figure BDA0004010041240000065
optionally, in order to differentiate the similarity results between different candidate images, the following formula is used to increase the comparison of a set of second features (5 th) to achieve the accuracy of the comparison results:
Figure BDA0004010041240000071
wherein,,
Figure BDA0004010041240000072
and->
Figure BDA0004010041240000073
Representing the target image p 0 The second characteristic of (2) is in the characteristic component of three color channels, pair
In response to this, the device,
Figure BDA0004010041240000074
and->
Figure BDA0004010041240000075
Representing a candidate image p i Is characterized by the characteristic components of the three color channels. The characteristic components of the three color channels are compared in a one-to-one correspondence manner, the characteristic component with the largest difference is selected, and then the p on the color channel corresponding to the characteristic component is calculated 0 And p i Is a similarity of (3).
It should be noted that, the similarity score value corresponding to each second feature is set to 0.2, so that the similarity value of the finally obtained candidate image may be set to be between [0,1], but the score value may also be set to be another value, and when the score value is another value, the finally obtained similarity value may be normalized to be between [0,1 ].
S206: and determining the image to be selected with the highest similarity value as the second image.
Specifically, prior to this step, for each phase of the image to be selectedAnd sequencing the similarity values, and determining the image to be selected with the highest similarity value. In one implementation, the determining the first feature of the target image includes: the following character string f will be described 0 Determining a first feature of the target image:
f 0 =h×w,δ 12 ,j 11 _j 12 _…_j 1m _j 21 _j 22 _…_j 2m _j 31 _j 32 _…_j 3m wherein h and w are the height and width, delta, respectively, of the target image 1 、δ 2 M is a preset parameter, and delta is satisfied 12 ,m∈[2,255],j i1 、j i2 、…j im Respectively, the gray scale ratio of a plurality of pixel values in the ith channel of the target image is more than or equal to delta 1 Delta for the first m pixel values 2 For j i1 、j i2 、…j im The ith channel includes one of three red, green and blue RGB channels.
Specifically, the gray scale duty ratios corresponding to the pixel values contained in each channel are respectively ordered from large to small, and m is greater than or equal to delta before interception 1 Is a gray scale ratio of (d) to form a feature vector, e.g., delta 1 =1. After the gray scale ratio of each pixel value is calculated, the following steps
Figure BDA0004010041240000076
The proportion u of gray scale with the pixel value j in each channel j Sequencing from big to small, and intercepting gray scale duty ratio to be more than or equal to delta 1 The first m ratios of (a) constitute a vector, i.e. +.>
Figure BDA0004010041240000077
I.e. satisfy the condition->
Figure BDA0004010041240000078
k=1, 2,..n, if δ or more 1 Ratio u of (2) j Less than m, then use u -1 Complement =0. For example, u= =>
Figure BDA0004010041240000079
Subscript (j) i1 ,j i2 -1, -1, -1) is (252, 68, -1, -1, -1), and the first feature is obtained by performing a similar process on the pixels of each channel.
In order to make the extracted feature have better generalization capability, the embodiment can also adjust the extracted feature vector, specifically if the adjacent gray scale ratio satisfies that the difference is smaller than delta 2 And the gray-scale ratio of the corresponding pixel value is higher than the gray-scale ratio of the corresponding pixel value which is lower than the gray-scale ratio, wherein delta 2 Can be set to be less than delta 1 And the order of the gray scale ratio with the low pixel value and the gray scale ratio with the high pixel value in the feature vector is exchanged. For example, feature vectors
u=(7.058,6.922,5.824,4.913,4.518
The corresponding pixel value is (12, 16, 20, 24, 8), delta is taken 2 Sequentially adjusting the values of the feature vectors to obtain the adjusted feature vectors
Figure BDA0004010041240000081
The corresponding pixel value is (12, 16, 20,8, 24).
For example, the feature height and width of the target image are h=421 and w=690, respectively, and the parameter δ is preset 1 =1.0,δ 2 =0.5, m=5, then the first feature of the target image can be expressed as:
f 0 =421×690,1.0_0.5,0_4_8_12_16_0_4_8_12_16_0_4_8_12_16。
in addition, if
Figure BDA0004010041240000082
And->
Figure BDA0004010041240000083
All elements of (2) are 0, let delta 1 =δ 1 2, then recalculate->
Figure BDA0004010041240000084
And->
Figure BDA0004010041240000085
Fingerprint f 0 Is a comma-separated character string, and contains 3 segments in total. When m=5, f 0 =h×w,δ 12 ,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 x is a character and _ is also a character.
In one implementation, the second feature of the target image includes: the following character string f will be described k Determining a second feature of the target image:
f k =l 11 _l 12 _…_l 1m _l 21 _l 22 _…_l 2m _l 31 _l 32 _…_l 3m
wherein l i1 、l i2 、…、l im A gray scale duty ratio of delta or more among a plurality of pixel values of an ith channel of the first image 1 The ith channel including one of three red, green and blue (RGB) channels, the first image being an image of a kth portion of the target image, k=1, 2, …, K being a number of first images in the target image, the first image being high
Figure BDA0004010041240000086
Or h 1 =h-/>
Figure BDA0004010041240000091
Width of the first image
Figure BDA0004010041240000092
Or->
Figure BDA0004010041240000093
Or->
Figure BDA0004010041240000094
Or->
Figure BDA0004010041240000095
h and w are the height and width of the target image, respectively.
Wherein h and w are the height and width of the target image, respectively. The above-described arrangement for the first image allows to efficiently retrieve similar images differing only in the presence or absence of watermarks. And the characteristics of the image are represented by character strings, and by comparing whether the two character strings are identical, the distance calculation is not needed, so that the calculation resources are saved, and the calculation efficiency is improved.
Optionally, the gray scale ratio of each pixel value can be used as the second feature of the target image, so that the extracted feature is further richer, and the accuracy of image retrieval is improved. In one implementation, the second feature of the target image further includes: determining the following vector as a second feature of the target image:
Figure BDA0004010041240000096
wherein,,
Figure BDA0004010041240000097
the pixel values in the ith channel of the target image are j respectively i1 、j i2 、…、j im Gray scale ratio of>
Figure BDA0004010041240000098
For a plurality of pixel values in an ith channel of the target image, a pixel value equal to j im Is a number of (3).
According to the embodiment of the application, the characteristics of each channel of the target image are determined according to a plurality of pixel values of each channel of the target image; determining a first characteristic of the target image according to the characteristic of each channel; determining at least one first image from the target image; determining, for each of the first images, a feature of each channel of the first image from a plurality of pixel values of each channel of the first image; determining a second feature of the target image corresponding to the first image according to the feature of each channel of the first image; determining at least one image to be selected from an image database; comparing each second characteristic of the target image with the corresponding second characteristic of the image to be selected according to each image to be selected, and determining a similarity value corresponding to the image to be selected according to a plurality of comparison results; and determining the image to be selected with the highest similarity value as the second image, so that the computing resource can be saved, and the efficiency and accuracy of similar image retrieval can be improved.
Fig. 3 is a schematic structural diagram of an apparatus for similar image retrieval according to an embodiment of the present application, where the apparatus 300 includes: a first determination module 301, a screening module 302 and a second determination module 303.
The first determining module 301 is configured to determine a first feature of a target image and a second feature of the target image, where the first feature is used to describe an overall feature of the image and the second feature is used to describe a local feature of the image; the filtering module 302 is configured to determine at least one image to be selected from an image database, where a first feature of the image to be selected is the same as a first feature of the target image; the second determining module 303 is configured to determine a second image similar to the target image from the at least one candidate image according to the second feature of the target image and the second feature of the at least one candidate image.
In one implementation manner, the second determining module 303 is further configured to compare, for each of the to-be-selected images, each second feature of the target image with a corresponding second feature of the to-be-selected image, and determine a similarity value corresponding to the to-be-selected image according to a plurality of results of the comparison; and determining the image to be selected with the highest similarity value as the second image.
In one implementation, the first determining module 301 is further configured to determine a feature of each channel of the target image according to a plurality of pixel values of each channel of the target image; and determining a first characteristic of the target image according to the characteristic of each channel.
In one implementation manner, the first determining module 301 is further configured to determine at least one first image from the target images, where the first image is a part of the images in the target images, and the parts of the target images corresponding to different first images are different; determining, for each of the first images, a feature of each channel of the first image from a plurality of pixel values of each channel of the first image; and determining a second characteristic of the target image corresponding to the first image according to the characteristic of each channel of the first image.
In one implementation, the first determining module 301 is further configured to send the following character string f 0 Determining a first feature of the target image:
f 0 =h×w,δ 12 ,j 11 _j 12 _…_j 1m _j 21 _j 22 _…_j 2m _j 31 _j 32 _…_j 3m
wherein h and w are the height and width, delta, respectively, of the target image 1 、δ 2 M is a preset parameter, and delta is satisfied 12 ,m∈[2,255],j i1 、j i2 、…、j im Multiple i-th channels of the target image Image forming apparatus The gray scale ratio in the prime value is more than or equal to delta 1 The ith channel includes one of three red, green and blue RGB channels.
In one implementation, the first determining module 301 is further configured to send the following character string f k Determining a second feature of the target image:
f k11 _ 12 _…_l 1m _ 21 _ 22 _…_l 2m _ 31 _ 32 _…_l 3m
wherein l i1 、l i2 、…、l im Is saidThe gray scale ratio of the pixel values of the ith channel of the first image is greater than or equal to delta 1 The ith channel including one of three red, green and blue (RGB) channels, the first image being an image of a kth portion of the target image, k=1, 2, …, K being a number of first images in the target image, the first image being high
Figure BDA0004010041240000111
Or->
Figure BDA0004010041240000112
Width of the first image
Figure BDA0004010041240000113
Or->
Figure BDA0004010041240000114
Or->
Figure BDA0004010041240000115
Or->
Figure BDA0004010041240000116
h and w are the height and width of the target image, respectively.
In one implementation, the first determining module 301 is further configured to determine the following vector as the second feature of the target image:
Figure BDA0004010041240000117
wherein,,
Figure BDA0004010041240000118
the pixel values in the ith channel of the target image are j respectively i1 、j i2 、…、j im Gray scale ratio of>
Figure BDA0004010041240000119
I-th pass of the target imageA pixel value of the plurality of pixel values in the track is equal to j im Is a number of (3).
The apparatus 300 provided in this embodiment of the present application may perform the methods described in the foregoing method embodiments, and implement the functions and beneficial effects of the methods described in the foregoing method embodiments, which are not described herein again.
Fig. 4 shows a schematic diagram of a hardware structure of an electronic device for performing similar image retrieval provided in an embodiment of the present application, and referring to the figure, at a hardware level, the electronic device includes a processor, optionally including an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an industry standard architecture (Industry Standard Architecture, ISA) bus, a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in the figure, but not only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs to form a device for locating the target user on a logic level. The processor executes the program stored in the memory, and is specifically configured to execute each method described in fig. 1-2 in the foregoing method embodiment, and implement the functions and beneficial effects of each method described in fig. 1-2 in the foregoing method embodiment, which are not described herein again.
The methods disclosed above in the embodiments of fig. 1-2 of the present application may be applied to, or implemented by, a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may also execute the methods described in fig. 1-2 in the foregoing method embodiments, and implement the functions and beneficial effects of the methods described in fig. 1-2 in the foregoing method embodiments, which are not described herein again.
Of course, other implementations, such as a logic device or a combination of hardware and software, are not excluded from the electronic device of the present application, that is, the execution subject of the following processing flow is not limited to each logic unit, but may be hardware or a logic device.
The embodiments of the present application further provide a computer readable storage medium storing one or more programs, where the one or more programs, when executed by an electronic device including a plurality of application programs, cause the electronic device to execute the methods described in fig. 1-2 in the foregoing method embodiments, and implement the functions and the beneficial effects of the methods described in fig. 1-2 in the foregoing method embodiments, which are not described herein again.
The computer readable storage medium includes Read-Only Memory (ROM), random access Memory (Random Access Memory RAM), magnetic disk or optical disk, etc.
Further, embodiments of the present application also provide a computer program product, where the computer program product includes a computer program stored on a non-transitory computer readable storage medium, where the computer program includes program instructions, when the program instructions are executed by a computer, implement the functions and benefits of the methods described in fig. 1-2 in the foregoing method embodiments, which are not described herein again.
In summary, the foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (10)

1. A method of 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 for describing the integral feature of the image, and the second feature is used for describing the local feature of the image;
determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image;
and determining a second image similar to the target image from the at least one image to be selected according to the second characteristic of the target image and the second characteristic of the at least one image to be selected.
2. The method of claim 1, wherein the second features comprise a plurality of features for describing different portions of the image;
the determining, from the at least one candidate image, a second image similar to the target image according to the second feature of the target image and the second feature of the at least one candidate image, includes:
comparing each second characteristic of the target image with the corresponding second characteristic of the image to be selected according to each image to be selected, and determining a similarity value corresponding to the image to be selected according to a plurality of comparison results;
and determining the image to be selected with the highest similarity value as the second image.
3. The method of claim 1, wherein determining the first characteristic of the target image comprises:
determining a characteristic of each channel of the target image according to a plurality of pixel values of each channel of the target image;
and determining a first characteristic of the target image according to the characteristic of each channel.
4. The method of claim 1, wherein determining the second characteristic of the target image comprises:
determining at least one first image from the target images, wherein the first image is an image of part of the target images, and the parts of the target images corresponding to different first images are different;
determining, for each of the first images, a feature of each channel of the first image from a plurality of pixel values of each channel of the first image; and determining a second characteristic of the target image corresponding to the first image according to the characteristic of each channel of the first image.
5. A method according to claim 1 or 3, wherein said determining a first characteristic of the target image comprises:
the following character string f will be described 0 Determining a first feature of the target image:
f 0 =h×w,δ 12 ,j 11 _j 12 _…_j 1m _j 21 _j 22 _…_j 2m _j 31 _j 32 _…_j 3m wherein h and w are eachHeight and width of the target image, delta 1 、δ 2 M is a preset parameter, and delta is satisfied 1 >δ 2 ,m∈[2,255],j i1 、j i2 、…j im The gray scale ratio of the pixel values of the ith channel of the target image is more than or equal to delta 1 Delta for the first m pixel values 2 For j i1 、j i2 、…j im The ith channel includes one of three red, green and blue RGB channels.
6. The method of any one of claims 1, 4, 5, wherein determining the second characteristic of the target image comprises:
the following character string f will be described k Determining a second feature of the target image:
f k =l 11 _l 12 _…_l 1m _l 21 _l 22 _…_l 2m _l 31 _l 32 _…_l 3m
wherein l i1 、l i2 、…、l im A gray scale duty ratio of delta or more among a plurality of pixel values of an ith channel of the first image 1 The ith channel comprises one of three red, green, blue, RGB channels, the first image is an image of a kth portion of the target image, k=1, 2..
Figure FDA0004010041230000021
Or->
Figure FDA0004010041230000022
Figure FDA0004010041230000023
The width of the first image +.>
Figure FDA0004010041230000024
Or (b)
Figure FDA0004010041230000025
Or->
Figure FDA0004010041230000026
Or->
Figure FDA0004010041230000027
h and w are the height and width of the target image, respectively.
7. The method according to claim 5 or 6, further comprising:
determining the following vector as a second feature of the target image:
u=(u i1 ,u i2 ,…,u im ),
wherein u is i1 、u i2 、…、u im The pixel values in the ith channel of the target image are j respectively i1 、j i2 、…j im Is used for the gray scale ratio of (a),
Figure FDA0004010041230000028
Figure FDA0004010041230000029
for a plurality of pixel values in an ith channel of the target image, a pixel value equal to j im Is a number of (3).
8. 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, where the first feature is used to describe an overall feature of the image, and the second feature is used to describe a local feature of the image;
the screening module is used for determining at least one image to be selected from an image database, wherein the first characteristic of the image to be selected is the same as the first characteristic of the target image;
and the second determining module is used for determining a second image similar to the target image from the at least one image to be selected according to the second characteristic of the target image and the second characteristic of the at least one image to be selected.
9. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which program or instruction when executed by the processor implements the steps of the method of any of claims 1-8.
10. A readable storage medium, characterized in that it stores thereon a program or instructions, which when executed by a processor, implement the steps of the method according to any of claims 1-8.
CN202211646951.7A 2022-12-21 2022-12-21 Method, device, electronic equipment and storage medium for searching similar images Pending CN116127118A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211646951.7A CN116127118A (en) 2022-12-21 2022-12-21 Method, device, electronic equipment and storage medium for searching similar images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211646951.7A CN116127118A (en) 2022-12-21 2022-12-21 Method, device, electronic equipment and storage medium for searching similar images

Publications (1)

Publication Number Publication Date
CN116127118A true CN116127118A (en) 2023-05-16

Family

ID=86296574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211646951.7A Pending CN116127118A (en) 2022-12-21 2022-12-21 Method, device, electronic equipment and storage medium for searching similar images

Country Status (1)

Country Link
CN (1) CN116127118A (en)

Similar Documents

Publication Publication Date Title
CN112651438A (en) Multi-class image classification method and device, terminal equipment and storage medium
CN111476309A (en) Image processing method, model training method, device, equipment and readable medium
CN112132832B (en) Method, system, device and medium for enhancing image instance segmentation
CN111291826B (en) Pixel-by-pixel classification method of multisource remote sensing image based on correlation fusion network
CN113704531A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN112348081A (en) Transfer learning method for image classification, related device and storage medium
CN113298096B (en) Method, system, electronic device and storage medium for training zero sample classification model
CN111932544A (en) Tampered image detection method and device and computer readable storage medium
CN111931782B (en) Semantic segmentation method, system, medium and device
CN115147598A (en) Target detection segmentation method and device, intelligent terminal and storage medium
CN112101360A (en) Target detection method and device and computer readable storage medium
CN111179270A (en) Image co-segmentation method and device based on attention mechanism
CN116363538B (en) Bridge detection method and system based on unmanned aerial vehicle
CN111027412A (en) Human body key point identification method and device and electronic equipment
US20160292537A1 (en) Feature Interpolation
CN111898544A (en) Character and image matching method, device and equipment and computer storage medium
CN116778148A (en) Target detection method, target detection device, electronic equipment and storage medium
CN111222558A (en) Image processing method and storage medium
CN117975259A (en) Wheat head detection method, device, equipment and storage medium based on improved YOLOv5
CN116486153A (en) Image classification method, device, equipment and storage medium
CN110245669B (en) Palm key point identification method, device, terminal and readable storage medium
US20170270390A1 (en) Computerized correspondence estimation using distinctively matched patches
CN111126187A (en) Fire detection method, system, electronic device and storage medium
CN116127118A (en) Method, device, electronic equipment and storage medium for searching similar images
CN115984951A (en) Method and device for judging shielding type of fisheye image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination