Methods, devices and electronic equipment for deduplicating images in cloud storage
By using facial recognition and similarity detection methods, the problems of low efficiency and high false deletion rate of images in cloud storage have been solved, achieving efficient and accurate image deduplication and saving storage space.
Patent Information
- Application Number
- CN202411146112.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-08-20
AI Technical Summary
Existing methods for deduplicating images in cloud storage are inefficient and have a high probability of accidental deletion, making it difficult to effectively identify and delete highly similar images.
User identity is determined by facial recognition, images of the same user are grouped into image groups, and similarity is detected among the images in each group. Images with a similarity greater than a preset value are deleted.
It improves the efficiency and accuracy of deduplication of images in cloud storage, reduces the probability of accidental deletion of non-duplicate images, and saves storage space.
Smart Images

Figure CN119201868B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, specifically relating to a method, apparatus, and electronic device for deduplicating images from a cloud drive. Background Technology
[0002] As cloud storage applications, such as photo album management, become more widespread, a large number of highly similar images may exist in the cloud storage, occupying a significant amount of cloud storage space.
[0003] Currently, there are several methods for deduplicating images on cloud storage. One method is to manually delete duplicate images, but this method is inefficient and has a high probability of mistakenly deleting non-duplicate images. Another method is to hash each image and then calculate the Hamming distance between two encoded images. If the Hamming distance is less than a threshold, the two images are considered highly similar. This method may mistakenly identify non-duplicate images as duplicates, leading to accidental deletion. Yet another method is to identify highly similar images by comparing their grayscale histograms, thus performing deduplication. However, different types of images may have similar grayscale histograms, resulting in a high probability of accidental deletion. Summary of the Invention
[0004] The purpose of this application is to provide a method, apparatus, and electronic device for deduplicating images in cloud storage, which can solve at least one of the problems of low efficiency and high probability of accidental deletion.
[0005] In a first aspect, embodiments of this application provide a method for deduplicating images in a cloud drive. The method includes: performing facial recognition on multiple facial images in a pre-acquired cloud drive to determine the user identity corresponding to the facial images; classifying the multiple facial images according to the user identity, and grouping facial images of the same user identity into a facial image group; performing similarity detection on a first image and a second image in the facial image group, and deleting the first image or the second image if the similarity is greater than or equal to a preset value.
[0006] Secondly, embodiments of this application provide a cloud drive image deduplication device, which includes: a determining module, used to determine the user identity corresponding to the face images by performing face recognition on multiple face images in a pre-acquired cloud drive; a classification module, used to classify the multiple face images according to the user identity, and divide face images of the same user identity into a face image group; and a deletion module, used to perform similarity detection on a first image and a second image in the face image group, and delete the first image or the second image if the similarity is greater than or equal to a preset value.
[0007] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0008] Fourthly, embodiments of this application provide a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0009] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0010] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0011] In this embodiment, facial recognition can be performed on multiple facial images in a pre-acquired cloud drive to determine the user identity corresponding to each image. Then, facial images of the same user identity are grouped into a single image group. Finally, a similarity test is performed on the first and second images within the same image group. If the similarity is greater than or equal to a preset value, either the first or second image is deleted. This not only improves the efficiency of deduplicating images in the cloud drive but also enhances the accuracy of identifying duplicate images by specifically performing similarity detection on facial images of the same user identity, reducing the probability of mistakenly deleting non-duplicate images and saving cloud drive space. Attached Figure Description
[0012] Figure 1 This illustration shows a flowchart of a cloud disk image deduplication method provided in an embodiment of this application;
[0013] Figure 2 This diagram illustrates the structure of a cloud drive image deduplication device according to an embodiment of this application.
[0014] Figure 3 This application shows a structural block diagram of an electronic device provided in an exemplary embodiment;
[0015] Figure 4 A structural block diagram of another electronic device provided by an exemplary embodiment of this application is shown. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0017] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0018] The cloud disk image deduplication method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0019] Figure 1 This application illustrates an exemplary embodiment of a cloud drive image deduplication method 100. This method 100 can be executed by an electronic device; in other words, it can be executed by software or hardware installed on an electronic device, such as a mobile phone or other terminal device. Figure 1 As shown, the method mainly includes the following steps:
[0020] S101: By performing face recognition on multiple face images in the pre-acquired cloud drive, the user identity corresponding to the face images is determined. In this embodiment, the user identity corresponding to the face images can be determined by performing face recognition on multiple face images in the pre-acquired cloud drive. In practical applications, traditional face recognition algorithms such as principal component analysis (PCA) can be used to confirm the user identity in the face images, or unsupervised neural network algorithms or supervised neural network algorithms can be used. PCA has high computational efficiency, while unsupervised or supervised neural network algorithms have high face recognition accuracy, and face recognition can be performed according to the actual situation.
[0021] In an optional implementation, before determining the user identity corresponding to the face image by performing face recognition on multiple face images in the pre-acquired cloud disk, the method further includes:
[0022] Perform facial recognition on multiple images in the cloud drive to obtain multiple facial images.
[0023] In this embodiment, face recognition can be performed on multiple images in the cloud drive to obtain images containing people. In practical applications, PCA can be used to determine whether a face exists in an image, or other face recognition methods can be used. Optionally, in this embodiment, each of the multiple face images can be an image containing one face.
[0024] S102: Classify the multiple face images according to the user identity, and group face images of the same user identity into one face image group.
[0025] In this embodiment, facial images can be classified according to user identity, grouping facial images of the same user into a single facial image group. For example, if the 1st, 3rd, and 5th facial images detect the face of user A, these three images can be grouped into a set belonging to user A; similarly, if the 2nd, 4th, and 6th facial images detect the face of user B, these three images can be grouped into a set belonging to user B.
[0026] S103: Perform similarity detection on the first image and the second image in the face image group. If the similarity is greater than or equal to a preset value, delete either the first image or the second image. In this embodiment, similarity detection can be performed on the first image and the second image in the face image group. If the similarity between the first image and the second image is not less than a preset value, delete one of the images. The first image is any image in the face image group, and the second image is any image in the face image group other than the first image.
[0027] In an optional implementation, the similarity detection of the first and second images in the face image group may include:
[0028] Step 1: Extract key points from the first image and the second image to obtain human body key points in the first image and the second image;
[0029] Step 2: Based on the human body key points in the first image and the second image and the weights corresponding to the human body parts to which the human body key points belong, determine the first human body pose vector corresponding to the first image and the second human body pose vector corresponding to the second image.
[0030] Step 3: Obtain the cosine similarity between the first image and the second image based on the first human pose vector and the second human pose vector.
[0031] In the above optional implementation methods, in practical applications, step 1 is performed to extract key points from the first and second images. The key points can be extracted using the Scale-invariant feature transform (SIFT) algorithm or the Speeded-uprobust features (SURF) algorithm. SURF has higher computational efficiency than SIFT, and the SURF algorithm can extract features in multi-scale space, and it is more efficient in extracting the position and orientation of key points.
[0032] In an optional implementation, taking the SURF algorithm as an example, the key point extraction of the first image and the second image to obtain the key points in the first image and the second image may include the following steps:
[0033] (1) Perform Gaussian filtering on the first image and the second image to obtain the first Gaussian filtered image and the second Gaussian filtered image;
[0034] (2) Perform Laplacian operation on the first Gaussian filtered image and the second Gaussian filtered image to obtain the first Hessian matrix and the second Hessian matrix;
[0035] (3) Calculate the determinant of the first Hessian matrix and the determinant of the second Hessian matrix;
[0036] (4) Extract the key point positions of the first image based on the determinant of the first Hessian matrix, and extract the key point positions of the second image based on the determinant of the second Hessian matrix;
[0037] (5) Extract the key point direction of the first image based on the key point position of the first image and extract the key point direction of the second image based on the key point position of the second image.
[0038] In the specific implementation, (1) Gaussian filtering is applied to the face images (first image and second image):
[0039] in, G For Gaussian filtering operators, x The x-axis is... y The vertical axis is , Standard deviation Images of human faces (first image and second image). The image after Gaussian filtering (Gaussian filtering of the first image generates the first Gaussian-filtered image, and Gaussian filtering of the second image generates the second Gaussian-filtered image).
[0040] (2) Perform Laplacian operation on the first Gaussian filtered image and the second Gaussian filtered image:
[0041]
[0042] in, This indicates taking the second derivative of the Gaussian-filtered image in the x-direction. This indicates that the first derivative of the Gaussian-filtered image is taken in the x and y directions. This indicates taking the second derivative of the Gaussian-filtered image in the y-direction. H The Hessian matrix is represented by the first Hessian matrix obtained by performing a Laplacian operation on the first Gaussian filtered image and the second Hessian matrix obtained by performing a Laplacian operation on the second Gaussian filtered image.
[0043] (3) Calculate the determinant of the Hessian matrix:
[0044]
[0045] In the embodiments of this application, the determinant of the first Hessian matrix and the determinant of the second Hessian matrix can be calculated according to the above formula.
[0046] (4) Extracting key point locations of face images based on the determinant of the Hessian matrix;
[0047] In this embodiment of the application, the key point positions of the first image can be extracted based on the determinant of the first Hessian matrix, and the key point positions of the second image can be extracted based on the determinant of the second Hessian matrix.
[0048] (5) Extract key point orientation based on key point location:
[0049] In one optional implementation, extracting the key point orientation of the first image based on the key point position of the first image includes:
[0050] Centered on the key point location of the first image, wavelet features in the x and y directions are statistically analyzed within a 60-degree sector area, wherein the wavelet features are accumulated using Gaussian weighted coefficients;
[0051] Rotate the 60-degree sector region at 15-degree intervals, traverse the entire circle, and take the sector direction corresponding to the 60-degree sector region with the largest wavelet feature value as the key point direction of the first image.
[0052] In practical applications, wavelet features in all x and y directions within a 60-degree sector centered on the keypoint can be statistically analyzed. These features are accumulated using Gaussian weighted coefficients, meaning that wavelet features farther from the center have smaller weighted coefficients. Then, this 60-degree sector is rotated at 15-degree intervals, traversing the entire circle. The sector direction with the highest statistical value is the main direction of the keypoint.
[0053] (6) Obtain key human body points from the first and second images:
[0054] In an optional implementation, step 2 above, determining the first human pose vector corresponding to the first image and the second human pose vector corresponding to the second image based on the key points in the first and second images and the weights corresponding to the human body parts to which the key points belong, may include:
[0055] The key points are divided into different human body parts according to human body regions;
[0056] Based on the weights corresponding to the key points of one or more human body parts and the key points in the first and second images, a first human pose vector corresponding to the first image and a second human pose vector corresponding to the second image are determined.
[0057] In this embodiment, all extracted key points can be divided into facial key points and human body key points based on their location and orientation. Facial key points include the left eye, right eye, left ear, right ear, and nose. Human body key points include 18 points, such as the neck, shoulders, arms, wrists, hips, knees, and ankles. Optionally, in practical applications, when dividing key points into different human body parts according to human body regions, the division can be simple, based on facial and human body key points. Alternatively, human body key points can be divided into four parts, or each human body key point can be considered as one part, resulting in 18 parts. This embodiment does not impose specific limitations. When dividing human body key points into four parts according to human body regions, the left shoulder, left arm, and left wrist can be considered the first part; the right shoulder, right arm, and right wrist the second part; the left hip, left knee, and left ankle the third part; and the right hip, right knee, and right ankle the fourth part. Taking four parts as an example, all key points of the human body in each part are converted into one-dimensional vectors, resulting in a total of four one-dimensional vectors. The formula for calculating the human pose vector is as follows:
[0058]
[0059] in, Let be the vector of the first human body part. To and The corresponding weights Let be the vector of the second human body part. To and The corresponding weights Let be the vector of the third human body part. To and The corresponding weights Let be the vector of the fourth human body part. To and The corresponding weights s This is the human pose vector for the face image. Based on the weights of one or more keypoints belonging to different human body parts, and the keypoints in the first and second images, the first human pose vector for the first image and the second human pose vector for the second image are determined. Finally, the first human pose vector for the first image and the second human pose vector for the second image can be obtained.
[0060] In the above optional implementation, determining the first human pose vector corresponding to the first image and the second human pose vector corresponding to the second image based on the weights of the human body parts to which the key points of one or more of the human body parts belong, and the key points in the first image and the second image, includes:
[0061] The key points of the first image of the same human body part are converted into one-dimensional vectors, and the first human pose vector corresponding to the first image is determined according to the weight of the human body part to which the key points belong.
[0062] The key points of the second image of the same human body part are converted into one-dimensional vectors. Based on the weights of the human body parts to which the key points belong, the second human pose vector corresponding to the second image is determined.
[0063] In practical applications, the first human pose vector corresponding to the first image and the second human pose vector corresponding to the second image are calculated separately. The key points of the first image of the same human body part are converted into one-dimensional vectors. Based on the weight of the human body part to which the key points belong, the first human pose vector corresponding to the first image is determined. Taking four parts as an example, the key points of the left shoulder, left arm and left wrist of the first part can be converted into one-dimensional vectors corresponding to the first part. The key points of the right shoulder, right arm and right wrist of the second part can be converted into one-dimensional vectors corresponding to the second part. The key points of the left hip, left knee and left ankle of the third part can be converted into one-dimensional vectors corresponding to the third part. The key points of the right hip, right knee and right ankle of the fourth part can be converted into one-dimensional vectors corresponding to the fourth part.
[0064]
[0065] in, Let be the vector of the first human body part. To and The corresponding weights Let be the vector of the second human body part. To and The corresponding weights Let be the vector of the third human body part. To and The corresponding weights Let be the vector of the fourth human body part. To and The corresponding weights The first human pose vector corresponds to the first image. The calculation process for the second human pose vector corresponding to the second image is similar to that for the first image. In the above optional implementation, in practical applications, when performing step 3 to obtain the cosine similarity between the first and second images, the cosine similarity method can be used to calculate the cosine similarity between the first and second human pose vectors. The range of cosine similarity is 0-1. The closer the cosine similarity is to 1, the higher the similarity of the human poses of the two face images; the closer the cosine similarity is to 0, the lower the similarity of the human poses of the two face images.
[0066] In an optional implementation, deleting the first image or the second image when the similarity is greater than or equal to a preset value includes:
[0067] If the cosine similarity is greater than or equal to the preset value, calculate the degree of deviation of the first image from the center of the first image and the degree of deviation of the second image from the center of the second image.
[0068] If the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold, then delete the first image or the second image.
[0069] In this embodiment, when the cosine similarity between the first image and the second image is greater than or equal to a preset value, it indicates that the first image and the second image are highly similar. To improve the accuracy of deduplication, the image similarity between the first image and the second image can be further calculated to determine whether to perform a deletion operation. The deviation of the first image from its center and the deviation of the second image from its center can be calculated first. When the difference between the deviation of the first image from its center and the deviation of the second image from its center is less than a first threshold, it indicates that the two face images are highly similar, and either the first image or the second image is deleted. In this embodiment, during the deletion operation, either the first image or the second image can be deleted randomly, or the first image or the second image can be deleted each time; this embodiment does not impose specific limitations.
[0070] In an optional implementation, deleting either the first image or the second image when the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold includes:
[0071] If the difference between the deviation of the first image from its center in the x-direction and the deviation of the second image from its center in the x-direction is less than a first distance threshold, and the difference between the deviation of the first image from its center in the y-direction and the deviation of the second image from its center in the y-direction is less than a second distance threshold, then delete either the first image or the second image.
[0072] In this embodiment, the first threshold may include a first distance threshold and a second distance threshold. In practical applications, for example, if two face images are 600×600 pixels in size and their center points are 300×300 pixels, the midpoint of the line connecting the two eyes is used as a reference point for the first image. The distances between this point and the center point in the x and y directions are calculated to obtain... x 1 and y 1. Similarly, define the reference point of the second face image as the midpoint of the line connecting the two eyes, and calculate the distances between this point and the center point in the x and y directions. x 2 and y 2. Calculation ,calculate ,like If the distance is less than the first distance threshold, it means that the deviation of the first image from the center and the deviation of the second image from the center are approximately the same in the x-direction. If the distance is less than the second distance threshold, it means that the deviation of the first image from the center and the deviation of the second image from the center in the y-direction are approximately the same. Therefore, the two face images can be judged to be highly similar, and one of the face images can be deleted. If... Not less than the first distance threshold, or If the distance is not less than the second distance threshold, it means that the similarity between the first image and the second image is limited, and both images can be retained for the next round of similarity comparison.
[0073] In one optional implementation, if the cosine similarity is less than the preset value, the first image and the second image are retained.
[0074] In this embodiment, if the cosine similarity between the first image and the second image is less than a preset value, it indicates that the similarity between the first image and the second image is not very high, and these two images need to be retained for comparison with other images in the face image group. For example, in user A's set, if the cosine similarity between image 1 and image 2 is less than the preset value, similarity detection can be performed between image 1 and image 3 (image 3 has not been compared with image 1).
[0075] In this embodiment, the order in which similarity detection is performed on images in the same face image group is not specifically limited. It can be performed randomly or in a preset order, ensuring that only one or any two face images in the final face image group have a cosine similarity less than a preset value, or that the cosine similarity of any two face images is greater than or equal to a preset value and the difference in the degree of deviation between the two images is greater than or equal to a first threshold.
[0076] In this embodiment, facial images of the same user are grouped into a single group based on the user identity corresponding to the determined facial image. Then, a similarity test is performed on the first and second images within the same group. If the similarity is greater than or equal to a preset value, either the first or second image is deleted. This improves the accuracy of identifying duplicate images, reduces the probability of mistakenly deleting non-duplicate images, and also improves the efficiency of deduplicating images on cloud drives, reducing the space occupied by duplicate images and saving resources.
[0077] The cloud drive image deduplication method provided in this application can be executed by a cloud drive image deduplication device. This application uses the execution of the cloud drive image deduplication method by a cloud drive image deduplication device as an example to illustrate the cloud drive image deduplication device provided in this application.
[0078] Figure 2 This illustration shows a schematic diagram of a cloud disk image deduplication device provided in an exemplary embodiment of this application. This cloud disk image deduplication device can achieve the following: Figure 1 The cloud disk image deduplication device, as shown in all or part of the embodiments, includes: a determination module 201, a classification module 202, and a deletion module 203.
[0079] In this embodiment, the determining module 201 is used to determine the user identity corresponding to the face image by performing face recognition on multiple face images in the pre-acquired cloud disk; the classification module 202 is used to classify the multiple face images according to the user identity, and divide face images of the same user identity into a face image group; the deletion module 203 is used to perform similarity detection on the first image and the second image in the face image group, and delete the first image or the second image if the similarity is greater than or equal to a preset value.
[0080] In an optional implementation, when performing similarity detection on the first and second images in the face image group, the deletion module 203 is specifically used for:
[0081] Key points are extracted from the first image and the second image to obtain the key points in the first image and the second image;
[0082] Based on the key points in the first image and the second image and the weights corresponding to the human body parts to which the key points belong, determine the first human posture vector corresponding to the first image and the second human posture vector corresponding to the second image.
[0083] The cosine similarity between the first image and the second image is obtained based on the first human pose vector and the second human pose vector.
[0084] In an optional implementation, when the deletion module 203 is used to extract key points from the first image and the second image, specifically to obtain key points in the first image and the second image, it is used to:
[0085] Gaussian filtering is applied to the first image and the second image to obtain a first Gaussian-filtered image and a second Gaussian-filtered image;
[0086] Perform a Laplacian operation on the first Gaussian filtered image and the second Gaussian filtered image to obtain the first Hessian matrix and the second Hessian matrix;
[0087] Calculate the determinant of the first Hessian matrix and the determinant of the second Hessian matrix;
[0088] The key point positions of the first image are extracted based on the determinant of the first Hessian matrix, and the key point positions of the second image are extracted based on the determinant of the second Hessian matrix.
[0089] Extract the key point orientation of the first image based on the key point location of the first image, and extract the key point orientation of the second image based on the key point location of the second image.
[0090] In an optional implementation, when the deletion module 203 is used to extract the key point orientation of the first image based on the key point position of the first image, it is specifically used for:
[0091] Centered on the key point location of the first image, wavelet features in the x and y directions are statistically analyzed within a 60-degree sector area, wherein the wavelet features are accumulated using Gaussian weighted coefficients;
[0092] Rotate the 60-degree sector region at 15-degree intervals, traverse the entire circle, and take the sector direction corresponding to the 60-degree sector region with the largest wavelet feature value as the key point direction of the first image.
[0093] In an optional implementation, when the deletion module 203 determines the first human pose vector corresponding to the first image and the second human pose vector corresponding to the second image based on the key points in the first image and the second image and the weights corresponding to the human body parts to which the key points belong, it is specifically used for:
[0094] The key points are divided into different human body parts according to human body regions;
[0095] Based on the weights corresponding to the key points of one or more human body parts and the key points in the first and second images, a first human pose vector corresponding to the first image and a second human pose vector corresponding to the second image are determined.
[0096] In an optional implementation, when the deletion module 203 determines the first human pose vector corresponding to the first image and the second human pose vector corresponding to the second image based on the weights of the human body parts to which the key points of one or more of the human body parts belong and the key points in the first image and the second image, it is specifically used for:
[0097] The key points of the first image of the same human body part are converted into one-dimensional vectors, and the first human pose vector corresponding to the first image is determined according to the weight of the human body part to which the key points belong.
[0098] The key points of the second image of the same human body part are converted into one-dimensional vectors. Based on the weights of the human body parts to which the key points belong, the second human pose vector corresponding to the second image is determined.
[0099] In an optional implementation, when the deletion module 203 deletes the first image or the second image when the similarity is greater than or equal to a preset value, it is specifically used for:
[0100] If the cosine similarity is greater than or equal to the preset value, calculate the degree of deviation of the first image from the center of the first image and the degree of deviation of the second image from the center of the second image.
[0101] If the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold, then delete the first image or the second image.
[0102] In an optional implementation, the deletion module 203 is further configured to retain the first image and the second image if the cosine similarity is less than the preset value.
[0103] In an optional implementation, when the deletion module 203 deletes the first image or the second image when the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold, it specifically performs the following:
[0104] If the difference between the deviation of the first image from its center in the x-direction and the deviation of the second image from its center in the x-direction is less than a first distance threshold, and the difference between the deviation of the first image from its center in the y-direction and the deviation of the second image from its center in the y-direction is less than a second distance threshold, then delete either the first image or the second image.
[0105] In an optional implementation, the determining module 201 is also used to perform face recognition on multiple images in the cloud drive to obtain multiple face images.
[0106] The cloud disk image deduplication device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0107] The cloud drive image deduplication device in this embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this embodiment does not specifically limit it.
[0108] The cloud disk image deduplication device provided in this application embodiment can achieve... Figure 1 To avoid repetition, the various processes implemented in the method embodiments shown will not be described again here.
[0109] Optionally, such as Figure 3 As shown, this application embodiment also provides an electronic device 300, including a processor 301 and a memory 302. The memory 302 stores a program or instructions that can run on the processor 301. When the program or instructions are executed by the processor 301, they implement the various steps of the above-mentioned cloud disk image deduplication method and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0110] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0111] Figure 4This illustration shows a structural block diagram of another electronic device 400 according to an exemplary embodiment of this application. The electronic device 400 can be implemented as a smartphone, tablet computer, laptop computer, desktop computer, smartwatch, and television, etc. The electronic device 400 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0112] Typically, electronic device 400 includes a processor 401 and a memory 402.
[0113] Processor 401 may include one or more processing cores, such as a quad-core processor or a deca-core processor. Processor 401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0114] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 402 is used to store at least one instruction, which is executed by the processor 401 to implement all or part of the steps in the cloud disk image deduplication method shown in the method embodiments of this application.
[0115] In some embodiments, the electronic device 400 may also optionally include a peripheral device interface 403 and at least one peripheral device. The processor 401, memory 402, and peripheral device interface 403 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 403 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 404, a display screen 405, a camera assembly 406, an audio circuit 407, and a power supply 408.
[0116] In some embodiments, the electronic device 400 further includes one or more sensors 409. The one or more sensors 409 include, but are not limited to, an accelerometer 410, a gyroscope 411, a pressure sensor 412, an optical sensor 413, and a proximity sensor 414.
[0117] Those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the electronic device 400, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0118] This application also provides a computer-readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described cloud disk image deduplication method and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0119] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0120] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-mentioned cloud disk image deduplication method and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0121] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0122] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the cloud disk image deduplication method described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0123] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0125] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for deduplicating images on a cloud storage drive, characterized in that, include: By performing facial recognition on multiple facial images in the pre-acquired cloud drive, the user identity corresponding to the facial images is determined; The multiple face images are classified according to the user identity, and face images with the same user identity are grouped into one face image group. A similarity detection is performed on the first image and the second image in the face image group. If the similarity is greater than or equal to a preset value, the first image or the second image is deleted. The step of performing similarity detection on the first and second images in the face image group includes: Perform cosine similarity detection on the first and second images in the face image group; Wherein, deleting the first image or the second image when the similarity is greater than or equal to a preset value includes: When the cosine similarity is greater than or equal to the preset value, the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image are calculated, wherein the deviation of the first image from the center of the first image is the distance between the reference point of the first image and the geometric center point of the first image, and the deviation of the second image from the center of the second image is the distance between the reference point of the second image and the geometric center point of the second image. If the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold, then delete the first image or the second image.
2. The method according to claim 1, characterized in that, The cosine similarity detection of the first and second images in the face image group includes: Key points are extracted from the first image and the second image to obtain the key points in the first image and the second image; Based on the key points in the first image and the second image and the weights corresponding to the human body parts to which the key points belong, determine the first human posture vector corresponding to the first image and the second human posture vector corresponding to the second image. The cosine similarity between the first image and the second image is obtained based on the first human pose vector and the second human pose vector.
3. The method according to claim 2, characterized in that, The step of extracting key points from the first image and the second image, and obtaining key points in the first image and the second image, includes: Gaussian filtering is applied to the first image and the second image to obtain a first Gaussian-filtered image and a second Gaussian-filtered image; Perform a Laplacian operation on the first Gaussian filtered image and the second Gaussian filtered image to obtain the first Hessian matrix and the second Hessian matrix; Calculate the determinant of the first Hessian matrix and the determinant of the second Hessian matrix; The key point positions of the first image are extracted based on the determinant of the first Hessian matrix, and the key point positions of the second image are extracted based on the determinant of the second Hessian matrix. Extract the key point orientation of the first image based on the key point location of the first image, and extract the key point orientation of the second image based on the key point location of the second image.
4. The method according to claim 3, characterized in that, The step of extracting the direction of key points in the first image based on the key point positions includes: Centered on the key point location of the first image, wavelet features in the x and y directions are statistically analyzed within a 60-degree sector area, wherein the wavelet features are accumulated using Gaussian weighted coefficients; Rotate the 60-degree sector region at 15-degree intervals, traverse the entire circle, and take the sector direction corresponding to the 60-degree sector region with the largest wavelet feature value as the key point direction of the first image.
5. The method according to claim 2, characterized in that, The step of determining the first human pose vector corresponding to the first image and the second human pose vector corresponding to the second image based on key points in the first image and the second image, and the weights corresponding to the human body parts to which the key points belong, includes: The key points are divided into different human body parts according to human body regions; Based on the weights corresponding to the key points of one or more human body parts and the key points in the first and second images, a first human pose vector corresponding to the first image and a second human pose vector corresponding to the second image are determined.
6. The method according to claim 5, characterized in that, The step of determining a first human pose vector corresponding to the first image and a second human pose vector corresponding to the second image based on the weights of the key points of one or more human body parts and the key points in the first and second images includes: The key points of the first image of the same human body part are converted into one-dimensional vectors, and the first human pose vector corresponding to the first image is determined according to the weight of the human body part to which the key points belong. The key points of the second image of the same human body part are converted into one-dimensional vectors. Based on the weights of the human body parts to which the key points belong, the second human pose vector corresponding to the second image is determined.
7. The method according to claim 1, characterized in that, The method further includes: If the cosine similarity is less than the preset value, both the first image and the second image are retained.
8. The method according to claim 6, characterized in that, The step of deleting either the first image or the second image when the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold includes: If the difference between the deviation of the first image from its center in the x-direction and the deviation of the second image from its center in the x-direction is less than a first distance threshold, and the difference between the deviation of the first image from its center in the y-direction and the deviation of the second image from its center in the y-direction is less than a second distance threshold, then delete either the first image or the second image.
9. The method according to any one of claims 1 to 8, characterized in that, Before determining the user identity corresponding to the face images by performing face recognition on multiple pre-acquired face images in the cloud drive, the method further includes: Perform facial recognition on multiple images in the cloud drive to obtain multiple facial images.
10. A cloud drive image deduplication device, characterized in that, include: The determination module is used to determine the user identity corresponding to the face image by performing face recognition on multiple face images in the pre-acquired cloud disk; The classification module is used to classify the multiple face images according to the user identity, and to group face images of the same user identity into a face image group; The deletion module is used to perform similarity detection on the first image and the second image in the face image group, and delete the first image or the second image if the similarity is greater than or equal to a preset value. The deletion module is used to perform similarity detection on the first and second images in the face image group, including: Perform cosine similarity detection on the first and second images in the face image group; The deletion module is used to delete the first image or the second image when the similarity is greater than or equal to a preset value, including: When the cosine similarity is greater than or equal to the preset value, the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image are calculated, wherein the deviation of the first image from the center of the first image is the distance between the reference point of the first image and the geometric center point of the first image, and the deviation of the second image from the center of the second image is the distance between the reference point of the second image and the geometric center point of the second image. If the difference between the deviation of the first image from the center of the first image and the deviation of the second image from the center of the second image is less than a first threshold, then delete the first image or the second image.
11. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing programs or instructions that can run on the processor, the programs or instructions being executed by the processor to implement the steps of the cloud disk image deduplication method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the cloud disk image deduplication method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product stores a program or instructions, which, when executed by a processor, implement the steps of the cloud disk image deduplication method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Mobile terminal, picture sorting management method and picture sorting management device of mobile terminal
CN103034714A
Artificial intelligence-based portrait filing method and device, and storage medium
CN114639143A
Human body posture description method, terminal and storage medium
CN115631390A