Intelligent deduplication method and device for image data based on digital camera

By adopting a contrast deduplication method of mixed command sets and image data handles in the digital camera image data acquisition, combined with the comparison of feature vectors and image quality scores, the problems of inefficiency and poor results in the existing technology are solved, and support for a variety of platforms and brand models is achieved, and the stability and accuracy of image data acquisition and deduplication are improved.

CN119848275BActive Publication Date: 2025-05-23CHENGDU RADIO & TELEVISION MEDIA CULTRUAL DIFFUSION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510316850.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-05-23
Estimated Expiration
2045-03-18

AI Technical Summary

Technical Problem

The existing digital camera image data acquisition and deduplication methods lack support for a variety of mobile terminal platforms and digital camera brands and models, and rely on manual inspection or simple image matching algorithms, which are inefficient and have poor results, especially when processing images in complex situations, misjudgment or misjudgment is prone to occur.

Method used

The polling thread is formulated using a mixed command set based on the PTP protocol and the MTP protocol, the image data of the digital camera is collected, the image data is compared and deduplicated through the image data handle, the feature vector is extracted and the image quality score is calculated, and the aggregated comparison is performed as a description object to retain the target image data with the highest image quality.

Benefits of technology

It has achieved support for a variety of mobile terminal platforms and digital camera brands and models, improved the stability, real-time and accuracy of image data acquisition and deduplication, and can effectively handle image deduplication in complex situations, reducing misjudgment and misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848275B_ABST
    Figure CN119848275B_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for intelligent deduplication of image data based on a digital camera, and relates to the technical field of image data processing. The method is applied to a mobile terminal, and the mobile terminal is connected to the digital camera. The method comprises: formulating a polling thread based on a hybrid command set of a PTP protocol and an MTP protocol to collect image data of the digital camera, determining an image data handle of the digital camera, and performing comparison and deduplication on the image data through the image data handle, extracting feature vectors, calculating image quality scores, and aggregating them as description objects of the image data handle, performing comparison and processing on feature vectors and quality score sets stored in the mobile terminal and feature vectors and image quality score sets after aggregation, obtaining target image data with the highest image quality, and performing intelligent deduplication using image handle comparison and deduplication as well as image data feature vectors and quality scores to ensure obtaining the best image data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image data processing, and in particular to a method and device for intelligently deduplicating image data based on a digital camera. Background Art

[0002] With the rapid development of the Internet and digital camera technology, the way of collecting and deduplicating image data from mobile terminals and digital cameras has changed. Based on the latest digital camera image data collection and deduplication method, photographers can collect image data from digital cameras to mobile terminals.

[0003] However, the digital camera image data acquisition and deduplication methods in the related art not only lack the support of multiple mobile terminal platforms and multiple brands and models of digital cameras, but also usually rely on manual inspection or the use of simple image matching algorithms for deduplication of image data. Although manual inspection is accurate, it is inefficient, especially when there are a large number of images, manual inspection becomes impractical. Simple image matching algorithms, such as direct comparison based on pixel values, can handle some duplicate images, but they are not effective in deduplicating images under complex conditions such as lighting changes, angle rotation, and partial occlusion. In addition, existing image deduplication methods often lack in-depth understanding and analysis of image data, which leads to misjudgment or missed judgment when processing images that are similar but not exactly the same. Summary of the invention

[0004] In view of the above problems, the present invention provides a method and device for intelligent deduplication of image data based on a digital camera, so as to at least solve the problems existing in the related art.

[0005] In a first aspect, an embodiment of the present invention provides a method for intelligent deduplication of image data based on a digital camera, which is applied to a mobile terminal, wherein the mobile terminal is connected to a digital camera, and the method for intelligent deduplication of image data based on a digital camera comprises:

[0006] A polling thread is formulated based on a hybrid command set of PTP protocol and MTP protocol to collect image data from digital cameras;

[0007] Determine the image data handle of the digital camera, and compare and remove duplicates from the image data using the image data handle;

[0008] Extracting and comparing the feature vectors of the deduplicated image data, and calculating the image quality score of the deduplicated image data, and aggregating the feature vectors and the image quality score as a description object of the image data handle;

[0009] Compare the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality;

[0010] The target image data is retained and stored in the mobile terminal.

[0011] In some embodiments, determining the image data handle of the digital camera and comparing and deduplicating the image data using the image data handle includes:

[0012] Establish a first-in-first-out cache queue;

[0013] Detecting whether the cache queue already contains the newly added image data handle;

[0014] If the cache queue does not contain the newly added image data handle, the newly added image data handle is stored in the cache queue, otherwise the newly added image data handle is abandoned;

[0015] Determine the queue length after the newly added image data handle is stored in the cache queue;

[0016] When the queue length does not meet the threshold, discard the last item of the cache queue;

[0017] When the queue length meets the threshold, the comparison and deduplication are completed, and the image data after the comparison and deduplication is output.

[0018] In some embodiments, extracting and comparing the feature vector of the deduplicated image data, calculating the image quality score of the deduplicated image data, and aggregating the feature vector and the image quality score as the description object of the image data handle includes:

[0019] Perform image preprocessing on the image data handle in the image data after comparison and deduplication to obtain a preprocessed image;

[0020] Extracting an image feature vector of the preprocessed image based on a preset model;

[0021] Calculate the image quality score of the preprocessed image according to various scoring indicators;

[0022] The image feature vector and the image quality score are aggregated as a description object of the image data handle.

[0023] In some embodiments, the comparing the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain the target image data with the highest image quality includes:

[0024] Performing image feature vector similarity comparison on the first image data feature vector and the first quality score set stored in the mobile terminal and the aggregated feature vector and the image quality score set to obtain a target image feature vector and a target image quality score set that meet similarity probability requirements;

[0025] The target image feature vector and the target image quality score set are compared in image quality scores to obtain target image data with the highest image quality.

[0026] In some embodiments, the hybrid command set based on the PTP protocol and the MTP protocol formulates a polling thread to collect image data of the digital camera, including:

[0027] Detecting stored image data of the digital camera based on the polling thread;

[0028] Newly added image data of the digital camera is detected based on the polling thread.

[0029] In some embodiments, the detecting the stored image data of the digital camera based on the polling thread includes:

[0030] Acquire a storage data set of a memory card in a digital camera based on a first instruction in the hybrid command set;

[0031] Processing the stored data set by using the polling thread, and acquiring a set of image data handles in the stored data set of the current round by using a second instruction in a hybrid command set;

[0032] The stored image data is determined based on the image data handle set using a third instruction in a hybrid command set.

[0033] In some embodiments, the detecting new image data of the digital camera based on the polling thread includes:

[0034] Setting a delay time difference of the polling thread, and comparing adjacent image data handle sets that satisfy the delay time difference; outputting a newly added image handle set after the comparison is completed; and acquiring first newly added image data based on the newly added image handle set;

[0035] The delay time difference of the polling thread is set, and the notification event data set sent by the digital camera is obtained based on the fourth instruction in the hybrid command set; the notification event data set is polled by the polling thread to determine whether the notification event data set satisfies the newly added image event; when it is determined that the notification event data set satisfies the newly added image event, the image data handle corresponding to the notification event data set is determined; and the second newly added image data is obtained based on the image data handle.

[0036] In a second aspect, an embodiment of the present invention provides an intelligent deduplication device for image data based on a digital camera, wherein the device is applied to a mobile terminal connected to a digital camera, and comprises:

[0037] An acquisition module, used for formulating a polling thread based on a hybrid command set of the PTP protocol and the MTP protocol to acquire image data of a digital camera;

[0038] A first deduplication module, used for determining the image data handle of the digital camera, and performing comparison and deduplication on the image data through the image data handle;

[0039] An evaluation module, used for extracting and comparing feature vectors of the deduplicated image data, calculating an image quality score of the deduplicated image data, and aggregating the feature vectors and the image quality score as a description object of the image data handle;

[0040] A second deduplication module is used to compare the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality;

[0041] The storage module is used to store the target image data in the mobile terminal.

[0042] An embodiment of the present invention provides a method and device for intelligent deduplication of image data based on a digital camera, which is applied to a mobile terminal. The mobile terminal is connected to the digital camera, and a polling thread is formulated through a hybrid command set based on the PTP protocol and the MTP protocol to collect image data from the digital camera; the image data handle of the digital camera is determined, and the image data is compared and deduplicated through the image data handle; the feature vector of the image data after comparison and deduplication is extracted, and the image quality score of the image data after deduplication is calculated, and the feature vector and the image quality score are aggregated as the description object of the image data handle; the first image data feature vector and the first quality score set stored in the mobile terminal are compared and processed with the aggregated feature vector and the image quality score set, so as to support stable, real-time and highly accurate intelligent collection and deduplication of image data of digital cameras of various mobile terminal platforms and various brands and models.

[0043] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Hereinafter, the present invention will be described in more detail based on embodiments and with reference to the accompanying drawings.

[0045] Figure 1 A schematic diagram of a flow chart of an intelligent deduplication method for image data based on a digital camera proposed in one embodiment of the present invention is shown;

[0046] Figure 2 A schematic diagram of an exemplary specific deduplication method implementation method proposed in an embodiment of the present invention is shown;

[0047] Figure 3 A schematic diagram of an exemplary specific intelligent deduplication method implementation method proposed in an embodiment of the present invention is shown;

[0048] Figure 4 A schematic diagram of the structure of an intelligent deduplication device for image data based on a digital camera proposed in one embodiment of the present invention is shown. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0050] In the related art, deduplication of image data usually relies on manual inspection or the use of simple image matching algorithms.

[0051] Manual inspection is accurate but inefficient, especially when there are a large number of images, making manual inspection impractical. Simple image matching algorithms, such as direct comparison based on pixel values, can handle some duplicate images, but they are not effective in removing duplicate images under complex conditions such as illumination changes, angle rotation, and partial occlusion. In addition, existing image deduplication methods often lack in-depth understanding and analysis of image data, which makes it easy to make misjudgments or missed judgments when processing images that are similar but not exactly the same.

[0052] In view of the above problems, the applicant has considered that in order to better adapt to various mobile terminal platforms and various brands and models of digital cameras, and has proposed an intelligent deduplication method and device for image data based on a digital camera provided by an embodiment of the present invention. The intelligent deduplication method for image data based on a digital camera is applied to a mobile terminal, and the mobile terminal is connected to the digital camera, including: formulating a polling thread based on a hybrid command set of the PTP protocol and the MTP protocol to collect image data of the digital camera, determining the image data handle of the digital camera, and comparing and deduplicating the image data through the image data handle, extracting the feature vector of the image data after comparison and deduplication, and calculating the image quality score of the deduplicated image data, using the feature vector and the image quality score after aggregation as the description object of the deduplicated image data handle, comparing and processing the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain the target image data with the highest image quality, retaining the target image data and storing it in the mobile terminal, and using the image handle comparison and deduplication combined with the polling thread and the image data feature vector and the quality score set to comprehensively perform intelligent deduplication to ensure that the best image data in repeated similar images is obtained. The intelligent deduplication method of image data based on a digital camera is described in detail in the subsequent embodiments.

[0053] The following is an introduction to the application scenarios of the method for intelligent deduplication of image data based on a digital camera provided by an embodiment of the present invention:

[0054] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a method for intelligent deduplication of image data based on a digital camera provided in an embodiment of the present invention. In this embodiment, the method for intelligent deduplication of image data based on a digital camera can be applied to the following: Figure 4 In the intelligent deduplication device 300 for image data based on a digital camera shown in FIG. Figure 1 The process shown is described in detail. The method for intelligent deduplication of image data based on a digital camera is applied to a mobile terminal. The mobile terminal is connected to a digital camera and may include S110 to S150.

[0055] S110: Formulate a polling thread based on a hybrid command set of the PTP protocol and the MTP protocol to collect image data of the digital camera.

[0056] In the embodiment of the present invention, the mobile terminal formulates multiple polling threads based on the hybrid command set of the PTP protocol and the MTP protocol, which can respectively detect the newly added image data of the digital camera and all the image data in the storage medium of the digital camera.

[0057] S110 formulates a polling thread based on a hybrid command set of the PTP protocol and the MTP protocol to collect image data of the digital camera, which may include S111 to S112.

[0058] S111: Detecting stored image data of a digital camera based on a polling thread.

[0059] Among them, S111 includes S1111 to S1113.

[0060] S1111: Acquire a storage data set of a memory card in a digital camera based on the first instruction in the mixed command set.

[0061] S1112: Process the storage data set using a polling thread, and obtain the image data handle set in the current round of storage data set through the second instruction in the hybrid command set.

[0062] S1113: Determine the storage image data using the third instruction in the mixed command set based on the image data handle set.

[0063] In an embodiment of the present invention, a set of SD memory cards connected to a digital camera is first obtained through a GetStorageIDs command (first instruction), the SD card set is polled, a set of image data handles under the current SD memory card of the digital camera is obtained through a GetObjectHandles command (second instruction), and then the corresponding image data information can be obtained through the image data handles in the set using a GetObjectInfo command (third instruction).

[0064] S112: Detecting newly added image data of the digital camera based on the polling thread.

[0065] Among them, S112 includes S1121 to S1122.

[0066] S1121: setting a delay time difference of the polling thread, and comparing adjacent image data handle sets that satisfy the delay time difference; outputting a newly added image handle set after the comparison is completed; and obtaining the first newly added image data based on the newly added image handle set.

[0067] In an embodiment of the present invention, an image data handle set is polled to detect newly added image data, and a polling thread with a one-second delay is established to repeatedly obtain the image data handle set of the digital camera through the GetStorageIDs command (first instruction) and GetObjectHandles command (second instruction) in S111, and the subsequent image data handle set A is compared with the graphic data handle set B of the previous cycle.

[0068] The comparison method is as follows: first, since the size of the image data handle is positively correlated with the file date, A and B are sorted from large to small; second, compare whether the lengths of A and B are equal, if not equal, return the result true, if equal, then compare A0 and B0, if not equal, return the result true and end the loop traversal, otherwise return the result false, that is, there is no new image data; then, when the result of the previous step is true, create a new empty image data handle set S, re-traverse the new round of image data handle set A, for each item Ai (i increases from 0 in sequence) of A, compare the size with B0, if Ai is greater than B0, it is the new image data, put Ai into S, continue traversal, if Ai is less than or equal to B0, end the loop traversal immediately, output the new image data set S, assign set A to set B, and update the data; S is the new image data handle set detected in this round, and the image data is obtained using the image data handle in S.

[0069] S1122: Set the delay time difference of the polling thread, and obtain the notification event data set sent by the digital camera based on the fourth instruction in the hybrid command set; use the polling thread to poll the notification event data set to determine whether the notification event data set satisfies the newly added image event; when it is determined that the notification event data set satisfies the newly added image event, determine the image data handle corresponding to the notification event data set; obtain the second newly added image data based on the image data handle.

[0070] In an embodiment of the present invention, a new image data event is polled to detect new image data, a polling thread with a one-second delay is established to obtain all notification events currently issued by the digital camera device through the GetEvent command (the fourth instruction), the event collection is polled, and it is determined whether the event code is equal to the representative value of EventObjectAdded. If it is new image data, the image data handle is parsed according to the event data, and the image data handle is used to obtain the image data.

[0071] In this embodiment, please refer to Figure 2 A schematic diagram of an exemplary specific deduplication method implementation is shown. In the figure, in the acquisition step, a detection technology based on jointly detecting image data is used using two methods: a new image detection method using a polling handle set for quick query and a new image event detection method using a polling query. By combining polling method 1 with polling method 2, the real-time and stability of image data acquisition is guaranteed.

[0072] S120: Determine the image data handle of the digital camera, and compare and remove duplicates from the image data using the image data handle.

[0073] Among them, S120 includes S121 to S126.

[0074] S121: Establish a first-in-first-out cache queue.

[0075] S122: Check whether the cache queue contains the newly added image data handle.

[0076] S123: If the cache queue does not contain the newly added image data handle, store the newly added image data handle into the cache queue; otherwise, abandon the newly added image data handle.

[0077] S124: Determine the queue length after the newly added image data handle is stored in the cache queue.

[0078] S125: When the queue length does not meet the threshold, an item of the cache queue is discarded.

[0079] S126: When the queue length meets the threshold, the comparison and deduplication are completed, and the image data after the comparison and deduplication is output.

[0080] In the embodiment of the present invention, refer to Figure 2 The deduplication steps shown in the above S112 adopt polling method 1 and polling method 2 in combination to adopt two query detection methods. In order to query the stability and real-time performance of the image data, the two polling detection methods are used in combination in this embodiment to establish two polling threads with a delay of one second. One thread adopts polling method 1 and the other thread adopts polling method 2.

[0081] Since multiple polling methods are used to detect the possibility of image data duplication, the results obtained need to be further deduplicated: in this embodiment, S121 establishes a first-in-first-out cache queue A, and S122-S123 detects the newly added image data handle T1 and gives priority to queue A to check whether it is included. If it is included, it is a duplicate and the newly added image data handle T1 is discarded; if it is not included, the newly added image data handle T1 is not duplicated, and queue A stores the object. After storage, it is determined in S123 whether the queue length is greater than X (X is the queue limit length, which should not be too large to ensure the efficiency of deduplication). If it is greater than X, an item of queue A is thrown out in S125, otherwise the queue is not operated in S126, and then the image data handle T1 is output, and deduplication is completed based on the image data handle.

[0082] The above steps implement a preliminary deduplication method by comparing handles.

[0083] S130: extracting and comparing feature vectors of the deduplicated image data, and calculating image quality scores of the deduplicated image data, and aggregating the feature vectors and the image quality scores as description objects of the image data handle.

[0084] Among them, S130 includes S131 to S134.

[0085] S131: performing image preprocessing on the image data handle in the image data after comparison and deduplication, and obtaining a preprocessed image.

[0086] In this embodiment, the output image data handle T1 is subjected to image preprocessing to obtain a preprocessed image T1P.

[0087] In some embodiments, extracting an image feature vector of a preprocessed image based on a preset model may include:

[0088] The mobile terminal image data processing program loads the optimized mobilenet_v1 model through TensorFlow Lite. The model is lightweight and efficient, and is suitable for resource-constrained mobile terminal environments.

[0089] Perform necessary preprocessing operations on the image data handle T1. The preprocessing includes adjusting the image data to the fixed size (224×224 pixels) required by the model to ensure that the shape of the input data is consistent with the input layer of the model;

[0090] Normalize the pixel values ​​of the image data and scale them to the range of [0, 1].

[0091] S132: Extracting an image feature vector of the preprocessed image based on a preset model.

[0092] In this embodiment, the preprocessed image T1P is subjected to an image feature vector extraction using the TensorFlow Lite model (mobilenet_v1) to obtain an image feature vector T1F.

[0093] In this embodiment, the above preprocessing can not only reduce the computational complexity, but also improve the prediction accuracy and robustness of the model. After the preprocessing is completed, a preprocessed image T1P is obtained.

[0094] In some implementations, extracting the image feature vector may further include the following steps:

[0095] The preprocessed image T1P is input into the mobilenet_v1 model, and the high-dimensional feature vector is extracted from its middle layer (GAP layer) as the feature representation of the image;

[0096] Choose to use the PCA dimensionality reduction algorithm to reduce the feature vector from the original dimension to a lower dimension, such as 128 dimensions, to optimize the subsequent processing efficiency;

[0097] The extracted feature vectors are normalized (L2 norm normalization) to ensure that the value range of the vectors is uniform and enhance the robustness of the comparative analysis, thereby improving the accuracy and stability of the similarity measurement. After processing, the image feature vector T1F is obtained.

[0098] S133: Calculate the image quality score of the preprocessed image according to various scoring indicators.

[0099] In this embodiment, the image quality score is calculated based on the preprocessed image T1P by using indicators such as clarity, brightness, and contrast to obtain an image quality score.

[0100] In some implementations, calculating the image quality score of the preprocessed image according to various scoring indicators further includes:

[0101] Define different weights for various scoring indicators, such as clarity indicator (e.g. 40% weight), brightness distribution indicator (e.g. 20% weight), contrast indicator (e.g. 25% weight) and noise level indicator (e.g. 15% weight);

[0102] The edge strength is calculated by Laplace transform for the clarity index, so that the blurred image has a lower score in the range of [0, 1];

[0103] The brightness distribution index is analyzed by histogram uniformity, so that the image score that deviates from the ideal value is reduced;

[0104] The contrast index is measured by the dynamic range of pixel values, so that the larger the value, the higher the score;

[0105] The noise level index is estimated by high-frequency components or residuals, so that the less noise, the higher the score;

[0106] The above feature extraction algorithm is run on the preprocessed image T1P to generate scores for each indicator and calculate the normalized total image quality score T1Q according to the weights, with the final range being [0, 1].

[0107] S134: Aggregate the image feature vector and the image quality score as a description object of the image data handle.

[0108] In this embodiment, the image feature vector T1F and the image quality score T1Q may be aggregated into an image feature vector and image quality score description object T1D of the image data handle T1.

[0109] In some implementations, aggregating the image feature vector and the image quality score further includes:

[0110] Collect the extracted image feature vector T1F and the calculated image quality score T1Q;

[0111] Aggregate T1F and T1Q into a complete description object T1D = (T1F, T1Q), where T1F is usually a high-dimensional feature (such as 128 dimensions) and is normalized, and T1Q is a normalized quality score in the range of [0, 1];

[0112] Store the description object T1D in an efficient data structure (such as SQLite).

[0113] In this embodiment, subsequent efficient similarity comparison and intelligent deduplication analysis are supported, and the aggregation achieves the combination of features and quality information to achieve more accurate data management and comparison.

[0114] S140: Compare the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality.

[0115] Among them, S140 includes S141 to S142.

[0116] S141: performing image feature vector similarity comparison between the first image data feature vector and the first quality score set stored in the mobile terminal and the aggregated feature vector and the image quality score set to obtain a target image feature vector and a target image quality score set that meet similarity probability requirements.

[0117] In this embodiment, the image feature vector comparison step includes:

[0118] The Euclidean distance L2 algorithm is used as the similarity measurement method, and the geometric distance between the two vectors is calculated to measure the similarity by calculating the feature vectors stored and obtained by the mobile terminal;

[0119] Set a similarity threshold (e.g., L2 distance < 0.15 is considered as highly similar image data) to ensure comparison accuracy;

[0120] The image feature vector T1F obtained from the input description object T1D is batch-calculated with the image feature vectors of the image data set in the existing mobile terminal storage medium and all the feature vectors in the image quality score description object set S1, and the feature pairs whose distances meet the threshold conditions are quickly screened out to form a preliminary similar image candidate set S2.

[0121] The image quality score comparison steps include:

[0122] For the similar image candidate set S2, firstly, the quality score T1Q obtained from the description object T1D of each image is sorted in descending order to ensure that high-quality images are given priority;

[0123] Set a quality score threshold (e.g., Q>0.7) to filter out low-quality images and keep only images with higher scores for further analysis;

[0124] Among the images that meet the similarity condition, the image with the highest quality score is preferentially retained as a representative to ensure that the best image is included in the deduplication result, and the image data T2 with the highest image quality score is output.

[0125] S142: Perform image quality score comparison between the target image feature vector and the target image quality score set to obtain target image data with the highest image quality.

[0126] In the embodiment of the present invention, refer to Figure 3 , the intelligent deduplication process in the present invention is shown in the figure, and the image feature vector similarity comparison (Euclidean distance L2) of the image feature vector and image quality score set S1 of the image data set in the existing mobile terminal storage medium is performed to obtain the image feature vector and image quality score set S2 that meet the similarity probability requirements.

[0127] By comparing the image quality scores between the image feature vector that meets the similarity probability requirement and the image quality score set S2, the image data T2 with the highest image quality score is obtained; the image data T2 after intelligent deduplication is output, and the image data T2 includes the image itself and the image-attached metadata (including resolution, color mode, contrast, saturation and brightness, etc.), and the intelligent deduplication is completed.

[0128] The output of intelligent deduplication results also includes:

[0129] By comparing the results of comprehensive feature vector similarity and quality score, the image with the highest quality score is preferentially retained as the representative image.

[0130] Prior to this, the image data handle T1 obtained after deduplication is preprocessed to obtain T1P, and then the feature vector and image quality score are extracted.

[0131] Extract feature vector: Extract image feature vector from preprocessed image T1P by using TensorFlow Lite model (mobilenet_v1) to obtain image feature vector T1F;

[0132] Image quality score: The image quality score of the preprocessed image T1P is calculated by using indicators such as clarity, brightness, and contrast to obtain the image quality score T1Q;

[0133] The image feature vector and image quality score description object T1D of the image data handle T1 obtained above are used as image feature vector similarity comparison (Euclidean distance L2) and combined with S1 to obtain an image feature vector and image quality score set S2 that meet the similarity probability requirements.

[0134] The image quality scores of the image feature vectors that meet the similarity probability requirements and the image quality score set S2 are compared.

[0135] The remaining images are marked as duplicates and supplemented with auxiliary information such as similarity scores and quality scores.

[0136] The image data T2 outputting the highest image quality score is stored in the storage medium of the mobile terminal, and the image feature vector and the image quality score description object corresponding to the image data T2 are stored in the image feature vector and image quality score description object set S1;

[0137] The description object set S1 is stored in an efficient data structure (such as SQLite) to facilitate the next intelligent deduplication comparison. Intelligent deduplication is completed.

[0138] In summary, the present invention better realizes the real-time acquisition of digital camera image data, adopts two methods of polling handle set and polling query of new image data events to combine query detection data, thereby ensuring the stability and real-time performance of image data acquisition; it realizes intelligent deduplication of image data in complex situations, and can accurately and intelligently compare the feature vector similarity and quality score of the same and similar image data in specific scenarios such as continuous shooting and snapshot, thereby ensuring that the best image data in repeated similar images is obtained.

[0139] See also Figure 4 , Figure 4 The present invention provides a block diagram of a device for intelligent deduplication of image data based on a digital camera, which is applied to a mobile terminal, and the mobile terminal is connected to a digital camera, including: an acquisition module 310, a first deduplication module 320, an evaluation module 330, a second deduplication module 340 and a storage module 350, wherein:

[0140] The acquisition module 310 is used to formulate a polling thread based on a hybrid command set of the PTP protocol and the MTP protocol to acquire image data of the digital camera.

[0141] The first deduplication module 320 is used to determine the image data handle of the digital camera and compare and deduplication the image data through the image data handle.

[0142] The evaluation module 330 is used to extract the feature vector of the image data after comparison and deduplication, and calculate the image quality score of the image data after deduplication, and aggregate the feature vector and the image quality score as the description object of the image data handle.

[0143] The second deduplication module 340 is used to compare the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality.

[0144] The storage module 350 is used to store the target image data in the mobile terminal.

[0145] It should be noted that the device embodiment of the present invention corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment, which will not be repeated here.

[0146] In several embodiments provided in this embodiment, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0147] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.

[0148] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An intelligent deduplication method for image data based on a digital camera, characterized in that: Applied to a mobile terminal, the mobile terminal is connected to a digital camera, and the method for intelligent deduplication of image data based on the digital camera includes: A polling thread is formulated based on a hybrid command set of the PTP protocol and the MTP protocol to collect image data of a digital camera, including: detecting stored image data of the digital camera based on the polling thread; detecting newly added image data of the digital camera based on the polling thread, wherein the delay time difference of the polling thread is set to detect the image data of the digital camera using different polling methods; Determine the image data handle of the digital camera, and compare and deduplicate the image data through the image data handle, including: establish a first-in-first-out cache queue; detect whether the cache queue already contains the newly added image data handle; if the cache queue does not contain the newly added image data handle, store the newly added image data handle in the cache queue, otherwise abandon the newly added image data handle; determine the queue length after the newly added image data handle is stored in the cache queue; if the queue length does not meet the threshold, throw out an item of the cache queue, wherein the size of the image data handle is positively correlated with the date; Extracting the feature vector of the image data after comparison and deduplication, and calculating the image quality score of the image data after deduplication, aggregating the feature vector and the image quality score as the description object of the image data handle, including: performing image preprocessing on the image data handle in the image data after comparison and deduplication to obtain the preprocessed image; extracting the image feature vector of the preprocessed image based on a preset model, including: extracting a high-dimensional feature vector from the middle layer of the preset model, using the PCA dimensionality reduction algorithm to reduce the high-dimensional feature vector from the original dimension to a target feature vector of a lower dimension, and normalizing the target feature vector to obtain the image feature vector of the preprocessed image, wherein the preset model is a lightweight model; calculating the image quality score of the preprocessed image according to various scoring indicators, wherein the scoring indicators include clarity, brightness and contrast; aggregating the image feature vector and the image quality score as the description object of the image data handle; Compare the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality; The target image data is retained and stored in the mobile terminal.

2. The method for intelligent deduplication of image data based on a digital camera according to claim 1, characterized in that: The determining the image data handle of the digital camera and comparing and deduplicating the image data by using the image data handle comprises: When the queue length meets the threshold, the comparison and deduplication are completed, and the image data after the comparison and deduplication is output.

3. The method for intelligent deduplication of image data based on a digital camera according to claim 1, characterized in that: The comparing the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality includes: Performing image feature vector similarity comparison on the first image data feature vector and the first quality score set stored in the mobile terminal and the aggregated feature vector and the image quality score set to obtain a target image feature vector and a target image quality score set that meet similarity probability requirements; The target image feature vector and the target image quality score set are compared in image quality scores to obtain target image data with the highest image quality.

4. The method for intelligent deduplication of image data based on a digital camera according to claim 1, characterized in that: The detecting the stored image data of the digital camera based on the polling thread comprises: Acquire a storage data set of a memory card in a digital camera based on a first instruction in the hybrid command set; Processing the stored data set by using the polling thread, and acquiring a set of image data handles in the stored data set of the current round by using a second instruction in a hybrid command set; The stored image data is determined based on the image data handle set using a third instruction in a hybrid command set.

5. The method for intelligent deduplication of image data based on a digital camera according to claim 4, characterized in that: The detecting the newly added image data of the digital camera based on the polling thread includes: Setting a delay time difference of the polling thread, and comparing adjacent image data handle sets that satisfy the delay time difference; outputting a newly added image handle set after the comparison is completed; and acquiring first newly added image data based on the newly added image handle set; The delay time difference of the polling thread is set, and the notification event data set sent by the digital camera is obtained based on the fourth instruction in the hybrid command set; the notification event data set is polled by the polling thread to determine whether the notification event data set satisfies the newly added image event; when it is determined that the notification event data set satisfies the newly added image event, the image data handle corresponding to the notification event data set is determined; and the second newly added image data is obtained based on the image data handle.

6. An intelligent deduplication device for image data based on a digital camera, characterized in that: Applied to a mobile terminal, the mobile terminal is connected to a digital camera, and the device comprises: The acquisition module is used to formulate a polling thread based on a hybrid command set of the PTP protocol and the MTP protocol to acquire image data of the digital camera, including: detecting the stored image data of the digital camera based on the polling thread; detecting the newly added image data of the digital camera based on the polling thread, wherein the delay time difference of the polling thread is set to detect the image data of the digital camera using different polling methods; The first deduplication module is used to determine the image data handle of the digital camera and compare and dedupe the image data through the image data handle, including: establishing a first-in-first-out cache queue; detecting whether the cache queue already contains the newly added image data handle; if the cache queue does not contain the newly added image data handle, storing the newly added image data handle in the cache queue, otherwise abandoning the newly added image data handle; judging the queue length after the newly added image data handle is stored in the cache queue; if the queue length does not meet the threshold, throwing out an item of the cache queue, wherein the size of the image data handle is positively correlated with the date; An evaluation module is used to extract feature vectors of image data after comparison and deduplication, and calculate the image quality score of the image data after deduplication, and aggregate the feature vector and the image quality score as the description object of the image data handle, including: performing image preprocessing on the image data handle in the image data after comparison and deduplication to obtain the preprocessed image; extracting the image feature vector of the preprocessed image based on a preset model, including: extracting a high-dimensional feature vector from the middle layer of the preset model, using the PCA dimensionality reduction algorithm to reduce the high-dimensional feature vector from the original dimension to a target feature vector of a lower dimension, and performing standardization on the target feature vector to obtain the image feature vector of the preprocessed image, wherein the preset model is a lightweight model; calculating the image quality score of the preprocessed image according to various scoring indicators, wherein the scoring indicators include clarity, brightness and contrast; aggregating the image feature vector and the image quality score as the description object of the image data handle; A second deduplication module is used to compare the first image data feature vector and the first quality score set stored in the mobile terminal with the aggregated feature vector and the image quality score set to obtain target image data with the highest image quality; The storage module is used to store the target image data in the mobile terminal.

Citation Information

Patent Citations

  • Method and device for managing memory

    CN105224409A

  • Data transmission method, device and system, electronic equipment and storage medium

    CN117978787A

  • Image deduplication method and device, equipment and storage medium

    CN118485848A