An image duplicate removal method, device, electronic device and storage medium
By determining image features and matching group deduplication, the problem of insufficient image deduplication in the application is solved, and the reduction of software compression packages and the improvement of installation efficiency are achieved.
Patent Information
- Application Number
- CN202210394688.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-04-14
AI Technical Summary
The lack of effective image deduplication schemes in the prior art leads to excessive volume of software compression packages in the application, which is not conducive to rapid installation of users.
By determining the image characteristics of the image to be deduplicated, matching based on the image characteristics, dividing the mutually matched images into the same image group, and deduplication operations are performed according to the image grouping.
It effectively realizes image deduplication, reduces the application's software compression package scale, and improves installation efficiency.
Smart Images

Figure CN114764863B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of image processing technologies, and in particular, to an image deduplication method, apparatus, electronic device, and storage medium. Background Art
[0002] Currently, with the rapid development of Internet technologies, more and more applications (Apps) are designed and produced. With the increasing complexity of App design, the internal images (such as various icons) are also increasing, which will cause the software compression package of the App to become larger and larger, and is not conducive to the rapid installation of users.
[0003] Considering that there are many identical or similar images among these images, the scale of the software compression package can be reduced through image deduplication. However, there is currently no effective image deduplication solution. Summary of the Invention
[0004] Embodiments of the present disclosure provide an image deduplication method, apparatus, electronic device, and storage medium to achieve the effect of image deduplication.
[0005] In a first aspect, embodiments of the present disclosure provide an image deduplication method, which may include:
[0006] For each image to be deduplicated that has been acquired, determine the image features of the image to be deduplicated;
[0007] Based on the image features of each image to be deduplicated, match each image to be deduplicated, and divide the mutually matching images to be deduplicated into the same image group;
[0008] Perform deduplication operations on each image to be deduplicated according to each image group.
[0009] In a second aspect, embodiments of the present disclosure further provide an image deduplication apparatus, which may include:
[0010] An image feature determination module, configured to determine the image features of each image to be deduplicated that has been acquired;
[0011] An image grouping module, configured to match each image to be deduplicated based on the image features of each image to be deduplicated, and divide the mutually matching images to be deduplicated into the same image group;
[0012] An image deduplication module, configured to perform deduplication operations on each image to be deduplicated according to each image group.
[0013] In a third aspect, embodiments of the present disclosure further provide an electronic device, which may include:
[0014] One or more processors;
[0015] A memory for storing one or more programs,
[0016] When the one or more programs are executed by one or more processors, the one or more processors implement the image deduplication method provided in any embodiment of the present disclosure.
[0017] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the image deduplication method provided in any embodiment of the present disclosure is implemented.
[0018] In the technical solution of the embodiment of the present disclosure, for each image to be deduplicated that has been acquired, by determining its image features, and then combining the image features of each image to be deduplicated to implement the matching between each image to be deduplicated, and dividing the mutually matching images to be deduplicated into the same image group, that is, any image to be deduplicated in a certain image group is matched (i.e., the same or similar) with the remaining images to be deduplicated in the image group; thus, the deduplication operation can be performed on all images to be deduplicated according to each image group. The above technical solution effectively realizes the effect of image deduplication through the mutual cooperation of technical means such as determining image features, implementing image matching and grouping based on image features, and implementing image deduplication based on image groups. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Combined with the accompanying drawings and referring to the following specific embodiments, the above and other features, advantages and aspects of the embodiments of the present disclosure will become more obvious. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the original components and elements are not necessarily drawn to scale.
[0020] Figure 1 is a flowchart of an image deduplication method in Embodiment 1 of the present disclosure;
[0021] Figure 2 is a schematic diagram of image grouping in an image deduplication method in Embodiment 1 of the present disclosure;
[0022] Figure 3 is a schematic diagram of two images to be deduplicated that are divided into the same image group in an image deduplication method in Embodiment 1 of the present disclosure;
[0023] Figure 4 is a flowchart of an image deduplication method in Embodiment 2 of the present disclosure;
[0024] Figure 5 is a schematic diagram of a regional image in an image deduplication method in Embodiment 2 of the present disclosure;
[0025] Figure 6It is a flowchart of an image deduplication method in Embodiment 3 of the present disclosure;
[0026] Figure 7 It is a structural block diagram of an image deduplication device in Embodiment 5 of the present disclosure;
[0027] Figure 8 It is a schematic structural diagram of an electronic device in Embodiment 6 of the present disclosure. Detailed implementation manners
[0028] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0029] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0030] The term "including" and its variations used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions executed by these devices, modules or units or their interdependent relationships.
[0032] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0034] In the following embodiments, optional features and examples are provided in each embodiment. The features described in the embodiments can be combined to form multiple alternative solutions. Each numbered embodiment should not be regarded as only one technical solution.
[0035] Embodiment 1
[0036] Figure 1 It is a flowchart of an image duplicate removal method provided in Embodiment 1 of the present disclosure. This embodiment is applicable to the situation of image duplicate removal. This method can be executed by the image duplicate removal device provided in the embodiments of the present disclosure. The device can be implemented in a software and / or hardware manner and can be integrated on an electronic device.
[0037] See Figure 1 , the method of the embodiments of the present disclosure specifically includes the following steps:
[0038] S110. For each image to be duplicate-removed that has been acquired, determine the image features of the image to be duplicate-removed.
[0039] Among them, at least two images to be duplicate-removed are acquired. Any two of the at least two images to be duplicate-removed may be the same or similar images, or may be different images, which is related to the actual situation and is not specifically limited herein. The image features of each image to be duplicate-removed are determined respectively. The image features may be at least one of shape features, color features, texture features, and spatial relationship features. Of course, they may also be other features that can represent the image properties of the image to be duplicate-removed, which are not specifically limited herein.
[0040] S120. Based on the image features of the images to be duplicate-removed, match the images to be duplicate-removed, and divide the mutually matching images to be duplicate-removed into the same image group.
[0041] Among them, since the image features can represent the image properties of the images to be deduplicated, and the image properties are the key to distinguishing the matching degree between two images to be deduplicated, it is possible to achieve the matching between them based on the image features of these images to be deduplicated, that is, to determine which of these images to be deduplicated are the same or similar images, and which images to be deduplicated are different images. The specific matching method can be pairwise matching, three-by-three matching, and / or four-by-four matching, etc., which are not specifically limited herein. Taking pairwise matching as an example, for the first image and the second image among the images to be deduplicated, it is determined whether the first image and the second image match based on the image features of the first image and the image features of the second image. Since these two images are any two images among the images to be deduplicated, pairwise matching of each image to be deduplicated can be achieved through the above steps. In practical applications, optionally, assuming that N images to be deduplicated are obtained, where N is a positive integer greater than 1, in order to achieve pairwise matching of these N images to be deduplicated, the first image to be deduplicated among these N images to be deduplicated can be matched with the remaining (N - 1) images to be deduplicated respectively; then the second image to be deduplicated among these N images to be deduplicated can be matched with the remaining (N - 2) images to be deduplicated (that is, the images to be deduplicated except the first and the second) respectively; and so on, until the matching between the (N - 1)th image to be deduplicated and the Nth image to be deduplicated among these N images to be deduplicated is completed, thereby achieving pairwise matching among all the images to be deduplicated.
[0042] The images to be deduplicated that match each other can be grouped into the same image group, that is, the images to be deduplicated within a certain image group match each other, and further, any image to be deduplicated within this image group matches all the other images to be deduplicated. Exemplarily, as Figure 2 shown, there are 3 images to be deduplicated related to a cross under image group 0, and 5 images to be deduplicated related to some pentagrams under image group 3. The situations of image groups 1 and 2 are similar and will not be elaborated here. Another example is as Figure 3 shown, where the two images to be deduplicated in the same row correspond to the same image group, and the images to be deduplicated in different rows correspond to different image groups. Taking the first row as an example, the sizes of these two images to be deduplicated are inconsistent, but the others are the same. Therefore, after analyzing their image features, it is determined that they match. The situations of the second row and the third row are similar and will not be elaborated here. Taking the first image to be deduplicated in the first row and the first image to be deduplicated in the second row as an example, the sizes and colors of these two images to be deduplicated are the same, but the others are different. Therefore, after analyzing their image features, it is determined that they do not match.
[0043] S130. Perform deduplication operations on each image to be deduplicated according to each image group.
[0044] Among them, since the images to be deduplicated within the same image group are repeated due to mutual matching, the deduplication operation of each image to be deduplicated can be performed according to each image group. For example, for each image group, the deduplication operation is performed on the images to be deduplicated within the image group. Specifically, at least one image to be deduplicated among the images to be deduplicated within the image group can be retained, and the remaining images to be deduplicated can be deleted. After processing each image group separately, the effective deduplication effect of all the images to be deduplicated can be achieved.
[0045] Combined with the application scenarios that the embodiments of the present disclosure may involve, all the icons to be deduplicated related to a certain app can be traversed through the above technical solutions to obtain the matching results among these icons to be deduplicated, and then the deduplication operation is performed on the icons to be deduplicated within the same icon group, thereby realizing the deduplication and compression of these icons to be deduplicated, and thus reducing the size of the software compression package of the app.
[0046] In the technical solutions of the embodiments of the present disclosure, for each obtained image to be deduplicated, by determining its image features, and then combining the image features of each image to be deduplicated to achieve the matching among the images to be deduplicated, and the images to be deduplicated that match each other are divided into the same image group, that is, any image to be deduplicated within a certain image group matches the remaining images to be deduplicated within the image group (that is, the same or similar); thus, the deduplication operation can be performed on all the images to be deduplicated according to each image group. Through the mutual cooperation of technical means such as determining image features, realizing image matching and grouping based on image features, and realizing image deduplication based on image grouping, the above technical solutions effectively achieve the effect of image deduplication.
[0047] An alternative technical solution, based on the first embodiment, dividing each pair of duplicate images to be removed into the same image group may include: using each duplicate image to be removed as a vertex of a target graph to be constructed, and connecting the vertices corresponding to two mutually matching duplicate images to be removed to construct the target graph; dividing the duplicate images to be removed corresponding to the vertices in the connected region including two or more vertices in the target graph into the same image group. Among them, a graph can be understood as a composition of a vertex set plus a set of edges connecting different vertex pairs. For the target graph to be constructed, each duplicate image to be removed can be used as a vertex in the target graph respectively, and then for each pair of vertices corresponding to two mutually matching duplicate images to be removed, connect between the pair of vertices, that is, connect an edge between the pair of vertices, thereby constructing the target graph. The connected region in the target graph can be understood as that the vertices therein are connected to each other, and there is no connection relationship between these vertices and the remaining vertices in the target graph. In other words, the duplicate images to be removed corresponding to the vertices in a certain connected region are mutually matching, and these duplicate images to be removed do not match the remaining duplicate images to be removed. On this basis, since there may be a situation where there is only one vertex in the connected region, combined with the application scenario of the embodiments of the present disclosure, only the image group with at least two duplicate images to be removed has the meaning of image duplicate removal. Therefore, the duplicate images to be removed corresponding to the vertices in the connected region including two or more (i.e., two and above) vertices in the target graph can be divided into the same image group, thereby achieving the effect of effectively grouping each duplicate image to be removed through the graph.
[0048] Another alternative technical solution, based on the first embodiment, performing duplicate removal operations on each duplicate image to be removed according to each image group may include: for each image group, determining a first reference image in the image group, and performing duplicate removal operations on the duplicate images to be removed in the image group except the first reference image; and / or, for each displayed image group, determining a second reference image in the image group according to the received image selection operation input by the user for the image group, and performing duplicate removal operations on the duplicate images to be removed in the image group except the second reference image.
[0049] Among them, the first reference image may be the duplicate image to be removed that is retained among the duplicate images to be removed in the image group. Therefore, after obtaining the first reference image, duplicate removal operations can be performed on the remaining duplicate images to be removed in the image group, thereby achieving the effect of image duplicate removal. In practical applications, optionally, the image with the best quality among the duplicate images to be removed in the image group can be used as the first reference image, because such a first reference image can store more image information, which is helpful for subsequently generating the duplicate images to be removed in the image group based on it.
[0050] After grouping images for display, the user can select the second reference image from each group of image groups according to the display result. Therefore, when receiving an image selection operation input by the user for a certain image group, the second reference image within the image group can be determined accordingly, so as to perform a duplicate removal operation on the remaining images to be de-duplicated within the image group based on this. In practical applications, optionally, since the image groups are the results of automatic division according to image features, there may be differences between them and the user's actual perception of the matching of each image to be de-duplicated. For example, for two images to be de-duplicated with color differences, some users think they are matching, while some users think they are not. Therefore, if an image adjustment operation input by the user for a certain image group is received before receiving the image selection operation, the image to be de-duplicated within the image group that is adjusted can be adjusted accordingly, such as removing the image to be de-duplicated from the image group, moving it to another image group, etc., which is not specifically limited here.
[0051] On this basis, optionally, the duplicate removal operation for the images to be de-duplicated other than the first reference image within the image group may include: for each image to be de-duplicated other than the first reference image within the image group, determining the transformation information of the image to be de-duplicated relative to the first reference image; deleting the images to be de-duplicated other than the first reference image within the image group; the above image duplicate removal method may further include: packing the remaining first reference images and each transformation information after deletion. For each image group, since the de-duplicated images to be de-duplicated within it may be continuously applied in subsequent steps, the transformation information of each image to be de-duplicated relative to the first reference image can be determined respectively, and then the images to be de-duplicated corresponding to these transformation information can be deleted. After processing each image group, the remaining first reference images and each transformation information after deletion can be packed. In this way, the deleted images to be de-duplicated can be generated according to the first reference images and each transformation information stored in the packing result in the subsequent steps. For example, for the first reference image and each transformation information corresponding to the same image group in the packing result, the first reference image can be transformed according to the transformation information to generate the deleted image to be de-duplicated. Thus, the re-generation and re-application effects of the deleted images to be de-duplicated are achieved through the reuse of the first reference image. Combining with the application scenarios that the embodiments of the present disclosure may involve, the above packing result may be a software compression package of a certain app, which means that when installing the app according to the software compression package, the deleted images to be de-duplicated icons can be directly generated during the installation process, thus ensuring the normal application of the app.
[0052] In practical applications, optionally, for the second reference image actively determined by the user, the same or different processing methods as those of the above first reference image can also be adopted for processing, which is not specifically limited here.
[0053] Example 2
[0054] Figure 4 It is a flowchart of an image duplicate removal method provided in Example 2 of the present disclosure. This embodiment is optimized based on each optional solution in the above embodiments. In this embodiment, optionally, determining the image features of the image to be duplicate-removed may include: determining the shape feature and / or color feature of the image to be duplicate-removed; using the shape feature and / or color feature as the image features of the image to be duplicate-removed. Among them, the explanations of the same or corresponding terms as those in the above embodiments will not be elaborated here.
[0055] Correspondingly, as Figure 4 shown, the method of this embodiment may specifically include the following steps:
[0056] S210. For each obtained image to be duplicate-removed, determine the shape feature and / or color feature of the image to be duplicate-removed, and use the shape feature and / or color feature as the image features of the image to be duplicate-removed.
[0057] Among them, the shape feature and / or color feature is an important basis for determining whether two images to be duplicate-removed match. Therefore, the shape feature and / or color feature of each image to be duplicate-removed can be determined respectively and used as the image features of their respective images to be duplicate-removed. In practical applications, optionally, the shape feature can have two types of representation forms. One is the contour feature, which mainly refers to the outer boundary of the image to be duplicate-removed; the other is the region feature, which is mainly related to the entire shape region. Further optionally, the color feature can be understood as the feature used to describe the surface properties of the image to be duplicate-removed, and it can be represented in various forms such as color histogram, color set, color distribution, color aggregation vector, and color correlation diagram.
[0058] S220. Based on the image features of each image to be duplicate-removed, match each image to be duplicate-removed, and divide the mutually matching images to be duplicate-removed into the same image group.
[0059] S230. Perform duplicate removal operations on each image to be duplicate-removed according to each image group.
[0060] The technical solution of the embodiment of the present disclosure achieves the effect of accurately determining the image features of each image to be duplicate-removed by determining the shape feature and / or color feature of each image to be duplicate-removed.
[0061] An alternative technical solution, based on Embodiment 2, determines the shape features of the image to be de-duplicated, including: determining the global hash feature of the image to be de-duplicated and using the global hash feature as the shape feature of the image to be de-duplicated, where the global hash feature includes at least one of a perception hash feature, an average hash feature, a gradient hash feature, a gradient hash vertical feature, and a wavelet transform feature. Among them, the global hash feature can be used to describe the hash feature of the entire image to be de-duplicated, and it can include at least one of a perception hashing (phash) feature, an average hashing (ahash) feature, a difference hashing (dhash) feature, a difference hashing vertical (dhash_vertical) feature, and a wavelet hashing (whash) feature. In practical applications, optionally, each of the above features can be considered as a kind of global hash feature img_hashes. In other words, at least one global hash feature of the image to be de-duplicated can be determined.
[0062] On this basis, optionally, in the case of using the global hash feature as the image feature, the images to be de-duplicated are matched based on the image features of each image to be de-duplicated, including: for the first image and the second image among the images to be de-duplicated, determining a first distance between the global hash feature of the first image and the global hash feature of the second image, and determining whether the first image and the second image match according to the first distance, so as to achieve pairwise matching of each image to be de-duplicated. Among them, the first image and the second image can be any two images to be de-duplicated among all the images to be de-duplicated. Therefore, by determining whether they match through the first distance between the global hash features of the two, pairwise matching of each image to be de-duplicated is achieved. This is a way to determine whether two images to be de-duplicated match as a whole. In practical applications, optionally, the above first distance can be represented in various ways such as Hamming distance, cosine distance, Euclidean distance, Pearson correlation coefficient, Jaccard similarity coefficient, and Bray-Curtis distance, and no specific limitation is made here. Additionally, as described above, since each image to be de-duplicated can correspond to at least one global hash feature, here the corresponding first distance can be determined according to each type of global hash feature respectively, and then whether the first image and the second image match is determined based on the at least one first distance obtained therefrom.
[0063] Another alternative technical solution, based on Embodiment 2, determines the shape features of the image to be de-duplicated, including: dividing the image to be de-duplicated into regions to obtain at least one regional image, and respectively determining the local hash features of each regional image, and using the local hash features as the shape features of the image to be de-duplicated. The local hash features include at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature. Among them, the regional image can be a part of the image to be de-duplicated obtained after dividing the image to be de-duplicated into regions. Exemplarily, as Figure 5 shown, this is a way of region division, from which the regional image 0 in the upper left corner, the regional image 1 in the upper right corner, the regional image 2 in the lower left corner, the regional image 3 in the lower right corner, and the regional image 4 in the center of the image to be de-duplicated can be obtained. The local hash feature of a certain regional image can be a hash feature used to describe the shape characteristics of the regional image, and its type can be the same as or different from that of the global hash feature, which is not specifically limited here. Therefore, for each image region, at least one local hash feature thereof can be determined.
[0064] On this basis, optionally, when using the local hash feature as the image feature, matching the images to be deduplicated based on the image features of each image to be deduplicated includes: for the first regional image in each regional image of the first image and the second regional image corresponding to the first regional image in each regional image of the second image, determining a second distance between the local hash feature of the first regional image and the local hash feature of the second regional image; determining whether the first regional image and the second regional image match according to the second distance, so as to determine whether the first image and the second image match according to the number of matching regional images in the first image and the second image, thereby realizing pairwise matching between each image to be deduplicated. Among them, the first regional image can be any one of the regional images in each regional image of the first image, and the second regional image can be the regional image corresponding to the first regional image in each regional image of the second image (i.e., having the same spatial position as the first regional image). Therefore, the matching process between the corresponding regional images in the first image and the second image can be realized by determining whether they match through the second distance between the local hash features of the two. In practical applications, optionally, the types of the second distance and the first distance can be the same or different, and no specific limitation is made here. Additionally, as described above, since each regional image can correspond to at least one local hash feature, the corresponding second distance can be determined according to each type of local hash feature here, and then whether the first regional image and the second regional image match can be determined based on the at least one second distance obtained therefrom. Further, it can be determined whether the first image and the second image match according to the number of matching regional images in the first image and the second image, thereby realizing pairwise matching between all images to be deduplicated. This is a way to determine whether two images to be deduplicated match from the details.
[0065] Another optional technical solution, based on Embodiment 2, determining the color feature of the image to be deduplicated includes: determining the color histogram of the image to be deduplicated in a preset color channel, and using the color histogram as the color feature of the image to be deduplicated. Among them, the preset color channel can be a pre-set color channel, such as at least one of the red channel, green channel, blue channel, and alpha channel. In practical applications, optionally, the above color channels can all be considered as a kind of preset color channel, so the color histogram of the image to be deduplicated can be determined separately in each preset color channel. Further optionally, since the sizes of the images to be deduplicated may vary, in order to ensure the consistency in subsequent image matching based on the color histogram, when determining the color histogram of a certain image to be deduplicated in a certain preset color channel, for a certain sub-section in the feature space, the number of pixel points in this sub-section can be divided by the total number of pixel points of the image to be deduplicated, thereby obtaining the normalized color histogram in this preset color channel. On this basis, optionally, the above sub-section can be divided according to the actual situation. For example, when there are 256 pixel values in the preset color channel, each pixel value can be used as a sub-section, and the feature length of the obtained color histogram is 256. Of course, other methods can also be used to divide the sub-section, which is not specifically limited here.
[0066] On this basis, optionally, in the case of using the color histogram as the image feature, based on the image features of each image to be deduplicated, matching each image to be deduplicated includes: for the first image and the second image in each image to be deduplicated, determining the third distance between the color histogram of the first image and the color histogram of the second image, and determining whether the first image and the second image match according to the third distance, so as to achieve pairwise matching of each image to be deduplicated. Among them, the first image and the second image can be any two images to be deduplicated among each image to be deduplicated. Therefore, by determining whether they match through the third distance between the color histograms of the two, pairwise matching of each image to be deduplicated is achieved. This is a method of determining whether two images to be deduplicated match by color. In practical applications, optionally, the type of the above third distance can be the same as or different from that of the first distance and / or the second distance, which is not specifically limited here. Further optionally, as mentioned above, since each image to be deduplicated can correspond to at least one color histogram, the corresponding third distance can be determined separately according to the color histogram in each preset color channel here, and then it is determined whether the first image and the second image match according to the at least one third distance obtained therefrom.
[0067] Embodiment 3
[0068] Figure 6It is a flowchart of an image deduplication method provided in Embodiment 3 of the present disclosure. This embodiment is optimized based on each of the above optional solutions. Among them, the explanations of the same or corresponding terms as those in the above embodiments will not be elaborated here.
[0069] Correspondingly, as Figure 6 shown, the method of this embodiment may specifically include the following steps:
[0070] S3010. For each image to be deduplicated that has been obtained, determine the global hash feature of the image to be deduplicated and the color histogram under a preset color channel, and perform region division on the image to be deduplicated to obtain at least one region image, and respectively determine the local hash features of each region image. Among them, both the global hash feature and the local hash feature include the following features: perceptual hash feature, average hash feature, gradient hash feature, gradient hash vertical feature, and wavelet transform feature. The preset color channel includes the pre-set red channel, green channel, and blue channel.
[0071] Among them, taking the global hash feature as an example, the above-mentioned perceptual hash feature, average hash feature, gradient hash feature, gradient hash vertical feature, and wavelet transform feature can respectively be used as a global hash feature. The situation of the local hash feature is similar and will not be elaborated here. Similarly, the above-mentioned red channel, green channel, and blue channel can respectively be used as a preset color channel, and the image to be deduplicated respectively corresponds to a color histogram under each preset color channel.
[0072] S3020. For the first image and the second image among the images to be deduplicated, calculate the global Hamming distance between the global hash feature of the first image and the global hash feature of the second image, and determine whether each global Hamming distance is less than or equal to a first preset threshold.
[0073] Among them, since each image to be deduplicated corresponds to 5 global hash features, 5 global Hamming distances can be calculated in this step. For example, the global Hamming distance between the perceptual hash feature of the first image and the perceptual hash feature of the second image, the global Hamming distance between the average hash feature of the first image and the average hash feature of the second image, etc. The essence of the global Hamming distance is the Hamming distance. Here, it is only named to distinguish it from the local Hamming distance in the subsequent steps, and it is not a specific limitation on its essential meaning. This is a way to determine whether two images to be deduplicated match as a whole.
[0074] S3030. If not, determine that the first image and the second image do not match, otherwise execute S3040.
[0075] S3040. For the first regional image in each regional image of the first image and the second regional image corresponding to the first regional image in each regional image of the second image, calculate the local Hamming distance between the local hash feature of the first regional image and the local hash feature of the second regional image, and determine whether each local Hamming distance is less than or equal to a second preset threshold.
[0076] Among them, similar to S3020, since each regional image corresponds to 5 local hash features, 5 local Hamming distances can be calculated in this step. This is a way to further determine whether two images to be deduplicated match from the details. The significance of such a setting is that overall matching does not mean that the two images to be deduplicated really match. For example, if there is only one detail difference between the two and the rest of the details are the same, then simply judging by the global hash feature may consider them to match, but in fact they do not match. Therefore, here, the local hash feature is used to judge again, thus ensuring the accuracy of image matching.
[0077] S3050. If so, determine that the first regional image and the second regional image match; otherwise, determine that the first regional image and the second regional image do not match.
[0078] S3060. Determine whether the number of non-matching regional images in the first image and the second image is greater than or equal to a third preset threshold.
[0079] S3070. If so, determine that the first image and the second image do not match; otherwise, execute S3080.
[0080] S3080. Calculate the cosine distance between the color histogram of the first image and the color histogram of the second image, and determine whether there is a cosine distance less than a fourth preset threshold among the cosine distances.
[0081] Among them, since each image to be deduplicated corresponds to 3 color histograms, 3 cosine distances can be calculated in this step, such as the cosine distance between the color histogram of the first image in the red channel and the color histogram of the second image in the red channel, the cosine distance between the color histogram of the first image in the green channel and the color histogram of the second image in the green channel, etc. The above several steps judge whether the first image and the second image match from the shape, and this step further judges whether the two match from the color.
[0082] S3090. If so, determine that the first image and the second image do not match; otherwise, determine that the first image and the second image match to achieve pairwise matching of each image to be deduplicated.
[0083] S3100. Use each image to be deduplicated as a vertex of the target graph to be constructed, and connect the vertices corresponding to two mutually matching images to be deduplicated to construct the target graph.
[0084] S3110. Divide the images to be deduplicated corresponding to the vertices in the connected region including two or more vertices in the target graph into the same image group.
[0085] S3120. Perform deduplication operations on each image to be deduplicated according to each image group.
[0086] With the technical solutions of the embodiments of the present disclosure, through the cooperation of the above steps, the deduplication effect of each image to be deduplicated can be effectively achieved.
[0087] Embodiment 4
[0088] Figure 7 As shown in the block diagram of the image deduplication device provided in Embodiment 4 of the present disclosure, the device is used to execute the image deduplication method provided in any of the above embodiments. The device and the image deduplication method of the above embodiments belong to the same concept. For the details not described in detail in the embodiments of the image deduplication device, reference can be made to the embodiments of the above image deduplication method. Refer to Figure 7 , the device may specifically include: an image feature determination module 410, an image grouping module 420, and an image deduplication module 430. Among them,
[0089] The image feature determination module 410 is configured to determine the image features of each image to be deduplicated for each acquired image to be deduplicated;
[0090] The image grouping module 420 is configured to match each image to be deduplicated based on the image features of each image to be deduplicated, and divide the mutually matching images to be deduplicated into the same image group;
[0091] The image deduplication module 430 is configured to perform deduplication operations on each image to be deduplicated according to each image group.
[0092] Optionally, the image feature determination module may include:
[0093] A shape and color feature determination unit configured to determine the shape feature and / or color feature of the image to be deduplicated;
[0094] An image feature determination unit configured to use the shape feature and / or color feature as the image feature of the image to be deduplicated.
[0095] On this basis, optionally, the shape and color feature determination unit may include:
[0096] A first shape feature determining subunit, configured to determine the global hash feature of the image to be de-duplicated, and use the global hash feature as the shape feature of the image to be de-duplicated, where the global hash feature includes at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature;
[0097] On this basis, optionally, the image grouping module may include:
[0098] A first image matching unit, configured to, when using the global hash feature as the image feature, for a first image and a second image among the images to be de-duplicated, determine a first distance between the global hash feature of the first image and the global hash feature of the second image, and determine whether the first image and the second image match according to the first distance, so as to implement pairwise matching among the images to be de-duplicated;
[0099] Another optionally, the shape and color feature determining unit may include:
[0100] A second shape feature determining subunit, configured to divide the image to be de-duplicated into regions to obtain at least one regional image, respectively determine the local hash feature of each regional image, and use each local hash feature as the shape feature of the image to be de-duplicated, where the local hash feature includes at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature.
[0101] On this basis, optionally, the image grouping module may include:
[0102] A second distance determining unit, configured to, when using the local hash feature as the image feature, for a first regional image among the regional images of the first image and a second regional image corresponding to the first regional image among the regional images of the second image, determine a second distance between the local hash feature of the first regional image and the local hash feature of the second regional image;
[0103] A second image matching unit, configured to determine whether the first regional image and the second regional image match according to the second distance, so as to determine whether the first image and the second image match according to the number of matching regional images in the first image and the second image, and implement pairwise matching among the images to be de-duplicated.
[0104] Another optionally, the shape and color feature determining unit may include:
[0105] A color feature determining subunit, configured to determine the color histogram of the image to be de-duplicated in a preset color channel, and use the color histogram as the color feature of the image to be de-duplicated.
[0106] On this basis, optionally, the image grouping module may include:
[0107] An image third matching unit, which, in the case of using a color histogram as an image feature, is used to determine a third distance between the color histogram of a first image and the color histogram of a second image for the first image and the second image in each image to be deduplicated, and determine whether the first image and the second image match according to the third distance, so as to achieve pairwise matching between each image to be deduplicated.
[0108] Optionally, the image grouping module may include:
[0109] A target graph construction unit, which is used to use each image to be deduplicated as a vertex of the target graph to be constructed, and connect the vertices corresponding to two mutually matching images to be deduplicated to construct a target graph;
[0110] An image grouping unit, which is used to divide the images to be deduplicated corresponding to each vertex in the connected region including two or more vertices in the target graph into the same image group.
[0111] Optionally, the image deduplication module may include:
[0112] An image first deduplication unit, which is used to, for each image group, determine a first reference image in the image group and perform a deduplication operation on the images to be deduplicated in the image group except the first reference image;
[0113] And / or
[0114] An image second deduplication unit, which is used to, for each displayed image group, determine a second reference image in the image group according to the image selection operation input by the user for the image group, and perform a deduplication operation on the images to be deduplicated in the image group except the second reference image.
[0115] On this basis, optionally, the image first deduplication unit may include:
[0116] A transformation information determination subunit, which is used to, for each image to be deduplicated in the image group except the first reference image, determine the transformation information of the image to be deduplicated relative to the first reference image;
[0117] An image deletion subunit, which is used to delete the images to be deduplicated in the image group except the first reference image;
[0118] The above image deduplication device may further include:
[0119] An image information packaging module, which is used to package the remaining first reference images and the transformation information after deletion.
[0120] The image duplicate removal device provided in the fourth embodiment of the present disclosure, through the cooperation of the image feature determination module and the image grouping module, determines the image features of each duplicate-removal target image obtained, and then realizes the matching between the duplicate-removal target images by combining the image features of each duplicate-removal target image, and divides the mutually matching duplicate-removal target images into the same image group, that is, any duplicate-removal target image in a certain image group matches (i.e., is the same or similar) the remaining duplicate-removal target images in the same image group; thus, the duplicate-removal module performs duplicate-removal operations on all the duplicate-removal target images according to each image group. The above device effectively realizes the effect of image duplicate removal through the mutual cooperation of technical means such as determining image features, realizing image matching and grouping based on image features, and realizing image duplicate removal based on image grouping.
[0121] The image duplicate removal device provided in the embodiments of the present disclosure can execute the image duplicate removal method provided in any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.
[0122] It should be noted that in the embodiments of the above image duplicate removal device, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the present disclosure.
[0123] Embodiment Five
[0124] Next, refer to Figure 8 , which shows a schematic structural diagram of an electronic device 500 suitable for implementing the embodiments of the present disclosure (such as Figure 8 the terminal device or server in Figure 8 The shown electronic device is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present disclosure.
[0125] As Figure 8As shown, the electronic device 500 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 501, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. The input / output (I / O) interface 505 is also connected to the bus 504.
[0126] Generally, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 8 the electronic device 500 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices may be implemented or had alternatively.
[0127] Embodiment Six
[0128] Specifically, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above functions defined in the methods of the embodiments of the present disclosure are executed.
[0129] It should be noted that the computer-readable medium described above can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0130] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (for example, a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0131] The above computer-readable medium can be included in the above electronic device; it can also exist separately and not be assembled into the electronic device.
[0132] The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device is caused to:
[0133] For each image to be de-duplicated that has been acquired, determine the image features of the image to be de-duplicated;
[0134] Based on the image features of each image to be deduplicated, match each image to be deduplicated, and divide the mutually matching images to be deduplicated into the same image group;
[0135] Perform deduplication operations on each image to be deduplicated according to each image group.
[0136] Computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0137] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0138] The units involved in the embodiments described in the present disclosure can be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the image feature determination module can also be described as "a module that determines the image features of each image to be deduplicated for each acquired image to be deduplicated".
[0139] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), Systems on Chip (SOCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0140] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or flash memory), optical fibers, portable compact disc read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0141] According to one or more embodiments of the present disclosure, [Example 1] provides an image deduplication method, which may include:
[0142] For each image to be deduplicated that has been acquired, determine the image features of the image to be deduplicated;
[0143] Based on the image features of each image to be deduplicated, match each image to be deduplicated, and divide the mutually matching images to be deduplicated into the same image group;
[0144] Perform deduplication operations on each image to be deduplicated according to each image group.
[0145] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1. Determining the image features of the image to be deduplicated may include:
[0146] Determine the shape features and / or color features of the image to be deduplicated;
[0147] Use the shape features and / or color features as the image features of the image to be deduplicated.
[0148] According to one or more embodiments of the present disclosure, [Example 3] provides the method of Example 2. Determining the shape features of the image to be deduplicated may include:
[0149] Determine the global hash feature of the image to be de-duplicated, and use the global hash feature as the shape feature of the image to be de-duplicated, where the global hash feature includes at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature.
[0150] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 3. Matching the images to be de-duplicated based on the image features of each image to be de-duplicated may include:
[0151] In the case of using the global hash feature as the image feature, for the first image and the second image among the images to be de-duplicated, determine the first distance between the global hash feature of the first image and the global hash feature of the second image, and determine whether the first image and the second image match according to the first distance, so as to achieve pairwise matching between the images to be de-duplicated.
[0152] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 2. Determining the shape feature of the image to be de-duplicated may include:
[0153] Perform region division on the image to be de-duplicated to obtain at least one region image, respectively determine the local hash feature of each region image, and use each local hash feature as the shape feature of the image to be de-duplicated, where the local hash feature includes at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature.
[0154] According to one or more embodiments of the present disclosure, [Example 6] provides the method of Example 5. Matching the images to be de-duplicated based on the image features of each image to be de-duplicated may include:
[0155] In the case of using the local hash feature as the image feature, determine the first image and the second image from the images to be de-duplicated, and for the first region image among the region images of the first image and the second region image corresponding to the first region image among the region images of the second image, determine the second distance between the local hash feature of the first region image and the local hash feature of the second region image;
[0156] Determine whether the first region image and the second region image match according to the second distance, so as to determine whether the first image and the second image match according to the number of matching region images in the first image and the second image, and achieve pairwise matching between the images to be de-duplicated.
[0157] According to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 2. Determining the color feature of the image to be de-duplicated may include:
[0158] Determine the color histogram of the image to be deduplicated under a preset color channel, and use the color histogram as the color feature of the image to be deduplicated.
[0159] According to one or more embodiments of the present disclosure, [Example Eight] provides the method of Example Seven. Based on the image features of each image to be deduplicated, matching each image to be deduplicated may include:
[0160] In the case where the color histogram is used as the image feature, for the first image and the second image among each image to be deduplicated, determine the third distance between the color histogram of the first image and the color histogram of the second image, and determine whether the first image and the second image match according to the third distance, so as to realize pairwise matching among each image to be deduplicated.
[0161] According to one or more embodiments of the present disclosure, [Example Nine] provides the method of Example One. Dividing each mutually matching image to be deduplicated into the same image group may include:
[0162] Take each image to be deduplicated as the vertex of the target graph to be constructed, and connect the vertices corresponding to two mutually matching images to be deduplicated to construct the target graph;
[0163] Divide the images to be deduplicated corresponding to the vertices in the connected region including two or more vertices in the target graph into the same image group.
[0164] According to one or more embodiments of the present disclosure, [Example Ten] provides the method of Example One. According to each image group, performing the deduplication operation on each image to be deduplicated may include:
[0165] For each image group, determine the first reference image in the image group, and perform the deduplication operation on the images to be deduplicated in the image group except the first reference image;
[0166] And / or
[0167] For each displayed image group, determine the second reference image in the image group according to the received image selection operation input by the user for the image group, and perform the deduplication operation on the images to be deduplicated in the image group except the second reference image.
[0168] According to one or more embodiments of the present disclosure, [Example Eleven] provides the method of Example Ten. Performing the deduplication operation on the images to be deduplicated in the image group except the first reference image may include:
[0169] For each image to be deduplicated in the image group except the first reference image, determine the transformation information of the image to be deduplicated relative to the first reference image;
[0170] Delete the duplicate images to be removed in the image group except the first reference image;
[0171] The above image deduplication method may further include:
[0172] Package each of the remaining first reference images and each transformation information after deletion.
[0173] According to one or more embodiments of the present disclosure, [Example XII] provides an image deduplication device, which may include:
[0174] An image feature determination module, configured to determine the image features of each duplicate image to be removed for each acquired duplicate image to be removed;
[0175] An image grouping module, configured to match each duplicate image to be removed based on the image features of each duplicate image to be removed, and divide the mutually matching duplicate images to be removed into the same image group;
[0176] An image deduplication module, configured to perform deduplication operations on each duplicate image to be removed according to each image group.
[0177] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0178] In addition, although the operations are depicted in a specific order, this should not be construed as requiring the operations to be performed in the specific order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0179] Although the subject matter has been described in language specific to structural features and / or method logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. An image duplicate removal method, characterized in that, Including: For each duplicate-removal image obtained, determining the image features of the duplicate-removal image; Based on the image features of each of the duplicate-removal images, matching each of the duplicate-removal images and dividing the mutually matching duplicate-removal images into the same image group; Performing duplicate-removal operations on each of the duplicate-removal images according to each of the image groups; The performing duplicate-removal operations on each of the duplicate-removal images according to each of the image groups includes: For each of the image groups, determining a first reference image in the image group, and for each of the duplicate-removal images in the image group other than the first reference image, determining the transformation information of the duplicate-removal image relative to the first reference image; deleting the duplicate-removal images in the image group other than the first reference image; Packing the remaining first reference images and the transformation information after deletion.
2. The method according to claim 1, wherein The determining the image features of the duplicate-removal image includes: Determining the shape feature and / or color feature of the duplicate-removal image; Taking the shape feature and / or the color feature as the image features of the duplicate-removal image.
3. The method according to claim 2, wherein The determining the shape feature of the duplicate-removal image includes: Determining the global hash feature of the duplicate-removal image and taking the global hash feature as the shape feature of the duplicate-removal image, where the global hash feature includes at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature.
4. The method according to claim 3, wherein The matching each of the duplicate-removal images based on the image features of each of the duplicate-removal images includes: In the case of taking the global hash feature as the image feature, for a first image and a second image among each of the duplicate-removal images, determining a first distance between the global hash feature of the first image and the global hash feature of the second image, and determining whether the first image and the second image match according to the first distance, so as to achieve pairwise matching among each of the duplicate-removal images.
5. The method according to claim 2, wherein The determining the shape feature of the duplicate-removal image includes: Performing region division on the duplicate-removal image to obtain at least one region image, respectively determining the local hash feature of each of the region images, and taking each of the local hash features as the shape feature of the duplicate-removal image, where the local hash feature includes at least one of a perceptual hash feature, an average hash feature, a gradient hash feature, a vertical gradient hash feature, and a wavelet transform feature.
6. The method according to claim 5, characterized in that, The matching each of the duplicate-removal images based on the image features of each of the duplicate-removal images includes: In the case of taking the local hash feature as the image feature, determining a first image and a second image from each of the duplicate-removal images, and for a first region image among the region images of the first image and a second region image corresponding to the first region image among the region images of the second image, determining a second distance between the local hash feature of the first region image and the local hash feature of the second region image; Determine whether the first region image and the second region image match according to the second distance, and determine whether the first image and the second image match according to the number of the region images that match in the first image and the second image, so as to realize pairwise matching between the to-be-deduplicated images.
7. The method according to claim 2, wherein The determining the color feature of the to-be-deduplicated image includes: Determine the color histogram of the to-be-deduplicated image in a preset color channel, and use the color histogram as the color feature of the to-be-deduplicated image.
8. The method according to claim 7, wherein The pairwise matching of the to-be-deduplicated images based on the image features of the to-be-deduplicated images includes: In the case where the color histogram is used as the image feature, for the first image and the second image in each of the to-be-deduplicated images, determine the third distance between the color histogram of the first image and the color histogram of the second image, and determine whether the first image and the second image match according to the third distance, so as to realize pairwise matching between the to-be-deduplicated images.
9. The method according to claim 1, wherein The dividing the pairwise-matched to-be-deduplicated images into the same image group includes: Take each of the to-be-deduplicated images as a vertex of a target graph to be constructed, and connect the vertices corresponding to two pairwise-matched to-be-deduplicated images to construct the target graph; Divide the to-be-deduplicated images corresponding to the vertices in the connected region including two or more vertices in the target graph into the same image group.
10. The method according to claim 1, characterized in that, The deduplication operation of the to-be-deduplicated images according to each image group further includes: For each of the displayed image groups, determine the second reference image in the image group according to the received image selection operation input by the user for the image group, and perform a deduplication operation on the to-be-deduplicated images in the image group except the second reference image.
11. An image duplicate removal device, characterized in that, including: An image feature determination module, configured to determine the image feature of each to-be-deduplicated image obtained; An image grouping module, configured to match the to-be-deduplicated images based on the image features of the to-be-deduplicated images, and divide the pairwise-matched to-be-deduplicated images into the same image group; An image deduplication module, configured to perform a deduplication operation on the to-be-deduplicated images according to each image group; The image deduplication module includes: An image first deduplication unit, configured to, for each image group, determine the first reference image in the image group, and for each to-be-deduplicated image in the image group except the first reference image, determine the transformation information of the to-be-deduplicated image relative to the first reference image; delete the to-be-deduplicated images in the image group except the first reference image; An image information packaging module, configured to package the remaining first reference images and the transformation information after deletion.
12. An electronic device, characterized in that, including: One or more processors; A memory, configured to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image deduplication method according to any one of claims 1-10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, the image deduplication method according to any one of claims 1-10 is implemented.
Citation Information
Patent Citations
Image deduplication method and device based on feature point matching
CN111209940A
Cited By
Image data set duplicate target de-duplication method with segmentation annotation
CN116257492A
Image dataset with segmentation annotation repetitive target deduplication method
CN116257492B