Image Processing Method, Apparatus, Computer Device, and Storage Medium
By dynamically adjusting the similarity threshold, the problem of low accuracy of facial recognition clustering is solved, the recognition accuracy and clustering effect are improved, and the image characteristics are adapted to different environments and devices.
Patent Information
- Application Number
- CN202510323627.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-03-19
AI Technical Summary
In the prior art, the accuracy of facial recognition gathering is low, and this problem cannot be effectively solved.
By obtaining the similarity between the target image data and the image data in the first data set, the difference between the similarity and the initial similarity threshold is calculated, and the similarity threshold is dynamically adjusted under specified conditions to adapt to image characteristics under different environments and devices.
It improves the accuracy of face recognition, enhances the file-gathering effect of image recognition, and reduces the impact of device and environmental factors on the recognition results.
Smart Images

Figure CN119888825B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and particularly to an image processing method, apparatus, computer device, and storage medium. Background Art
[0002] Computer vision technology is a technology that enables a computer to obtain information and make decisions from images or videos through computer and image processing technologies. It involves multiple fields such as image processing, pattern recognition, and machine learning, and is an important part of artificial intelligence. In face recognition technology, face retrieval algorithms are commonly used technologies that can determine whether two people are the same person by comparing face features. For face recognition, the relevant solutions mainly use face retrieval algorithms to identify and cluster faces. However, when identifying and clustering faces using the system default similarity threshold, the clustering effect is not ideal.
[0003] Regarding the problem of low accuracy in face recognition clustering in related technologies, no effective solution has been proposed yet. Summary of the Invention
[0004] Based on this, it is necessary to provide an image processing method, apparatus, computer device, and storage medium that can solve the problem of low accuracy in face recognition clustering for the above technical problems.
[0005] In a first aspect, an image processing method is provided in this embodiment. The method includes:
[0006] Obtain target image data to be processed, and determine first image data associated with the image information of the target image data in a first data set; wherein, the similarity between the image data in the first data set and second image data is greater than or equal to a similarity threshold, and the second image data corresponds to the first data set;
[0007] Obtain a first similarity between the first image data and the second image data, and calculate a first difference between the first similarity and the similarity threshold;
[0008] In the case where there are a specified number of the first differences corresponding to the first image data that are greater than or equal to a preset second difference, adjust the similarity threshold based on the first difference;
[0009] In the case where a second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, update the first data set according to the target image data.
[0010] In some of these embodiments, obtaining a first similarity between the first image data and the second image data, and calculating a first difference between the first similarity and a similarity threshold, includes:
[0011] Determine a target device for obtaining the target image data;
[0012] Calculate a first similarity between the first image data captured by the target device in the first dataset and the second image data;
[0013] Obtain a first threshold corresponding to the target device, and calculate a first difference between the first similarity and the first threshold.
[0014] In some of these embodiments, obtaining a first similarity between the first image data and the second image data, and calculating a first difference between the first similarity and a similarity threshold, includes:
[0015] Determine a target time period for obtaining the target image data;
[0016] Calculate a first similarity between the first image data captured within the first time period in the first dataset and the second image data;
[0017] Obtain a second threshold corresponding to the first time period, and calculate a first difference between the first similarity and the second threshold.
[0018] In some of these embodiments, according to the target image data to be processed, determining first image data associated with the image information of the target image data in the first dataset includes:
[0019] Evaluate the quality of the target image data;
[0020] In the case where it is evaluated that the quality of the target image data meets the evaluation requirements, determine first image data associated with the image information of the target image data in the first dataset.
[0021] In some of these embodiments, in the case where a second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, updating the first dataset according to the target image data includes:
[0022] In the case where the second similarity between the target image data and multiple pieces of the second image data is greater than or equal to the adjusted similarity threshold, merge multiple first datasets corresponding to the multiple pieces of the second image data;
[0023] Update the merged first dataset according to the target image data.
[0024] In some of these embodiments, the method further includes:
[0025] In the case where the second similarity between the target image data and the second image data is less than the adjusted similarity threshold, a second data set is established according to the target image data.
[0026] In some of these embodiments, obtaining the target image data to be processed includes:
[0027] Obtaining the target image data according to the facial features in the image to be recognized.
[0028] In a second aspect, an image processing apparatus is provided in this embodiment. The apparatus includes:
[0029] A selection module, configured to obtain target image data to be processed and determine first image data associated with the image information of the target image data in a first data set; wherein, the similarity between the image data in the first data set and second image data is greater than or equal to a similarity threshold, and the second image data corresponds to the first data set;
[0030] A calculation module, configured to obtain a first similarity between the first image data and the second image data and calculate a first difference between the first similarity and the similarity threshold;
[0031] An adjustment module, configured to adjust the similarity threshold based on the first difference in the case where there are a specified number of the first differences corresponding to the first image data that are greater than or equal to a preset second difference;
[0032] A clustering module, configured to update the first data set according to the target image data in the case where the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold.
[0033] In a third aspect, a computer device is provided in this embodiment, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the image processing method described in the first aspect above is implemented.
[0034] In a fourth aspect, a computer-readable storage medium is provided in this embodiment, on which a computer program is stored. When the computer program is executed by a processor, the image processing method described in the first aspect above is implemented.
[0035] The above image processing method, apparatus, computer device, and storage medium can obtain the historical comparison result of the first image data related to the target image data by obtaining the first difference between the first similarity between the first image data and the second image data and the similarity threshold, and dynamically adjust the similarity threshold based on the first difference, so as to adapt to the different characteristics of the image data obtained in different environments, improve the accuracy of target image data recognition, and thus achieve the effect of improving the accuracy of image recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is an application environment diagram of the image processing method in an embodiment;
[0037] Figure 2 It is a schematic flowchart of the image processing method in an embodiment;
[0038] Figure 3 It is a schematic flowchart of the image processing method in another embodiment;
[0039] Figure 4 It is a schematic flowchart of the face clustering method in an embodiment;
[0040] Figure 5 It is a structural block diagram of the image processing apparatus in an embodiment;
[0041] Figure 6 It is an internal structure diagram of the computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0042] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] The method embodiments provided in this embodiment can be executed on a terminal, a computer, or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of the terminal of the image processing method according to an embodiment of the present application. As Figure 1 shown, the terminal may include one or more ( Figure 1 only one is shown in Figure 1 processors 102 for storing data and a memory 104. Among them, the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1more or fewer components shown, or having a different configuration from that Figure 1 shown.
[0044] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the image processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implements the above method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and their combinations.
[0045] The transmission device 106 is used to receive or send data via a network. The above network includes the wireless network provided by the communication provider of the terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus can communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0046] In this embodiment, an image processing method is provided. Figure 2 is a flowchart of the image processing method of this embodiment, as Figure 2 shown, and this process includes the following steps:
[0047] Step S202, obtain target image data to be processed, and determine first image data associated with the image information of the target image data in the first data set; wherein, the similarity between the image data in the first data set and the second image data is greater than or equal to a similarity threshold, and the second image data corresponds to the first data set.
[0048] Among them, the target image data is one or more image data that have not been processed such as face recognition and clustering. The image information of the target image data includes but is not limited to one or more information such as the shooting device, shooting time, and shooting venue of the image data.
[0049] The first data set is obtained based on the image data that has been completed for filing. Therefore, the first data set includes one or more image data with a similarity to the corresponding second image data greater than or equal to the similarity threshold. The first data set may include one or more of the following data: first image data, second image data, the format and information corresponding to each image data. The first image data is the data for which face recognition has been performed and has a high similarity to the second image data, and at least one image information of the first image data is consistent with the target image data. The second image data is one or more known face image data, and the second image data corresponding to different data sets is different.
[0050] The similarity threshold can be an initially set threshold or a threshold adjusted based on the first difference. The size of the similarity threshold can be set and adjusted according to application requirements and scenarios. Optionally, the corresponding similarity threshold is obtained according to one or more relevant factors such as the shooting device, shooting time, shooting environment, etc. of the first image data.
[0051] Step S204, obtain the first similarity between the first image data and the second image data, and calculate the first difference between the first similarity and the similarity threshold.
[0052] Among them, the first image data and the second image data can be directly compared, including: obtaining the structural similarity index between the first image data and the second image data, and obtaining the similarity according to the structural similarity index; or calculating the color histogram or grayscale histogram of the first image data and the second image data. The histogram comparison is realized through a similarity measurement method, and the histogram comparison result is used as the similarity; or the similarity is calculated by means of feature point matching.
[0053] Alternatively, the first image data and the second image data can be first subjected to image recognition, and the recognized object faces are compared to obtain the similarity. For example, in the case where the image recognition requirement is a face recognition requirement, the face information in the first image data and the second image data is extracted, and whether the face information in the two types of image data is the same is compared.
[0054] Optionally, the first similarities corresponding to multiple first image data are respectively obtained, and the differences between the multiple first similarities and the similarity threshold are calculated, that is, multiple first differences are obtained. Among them, the first difference can be obtained by calculation algorithms such as the absolute difference, normalized difference, square difference, etc. between the first similarity and the similarity threshold; the calculation method of the first difference can be set according to requirements.
[0055] Step S206, in the case where there are a specified number of first differences corresponding to the first image data greater than or equal to the preset second difference, adjust the similarity threshold based on the first difference.
[0056] Among them, although the first similarity between the first image data and the second image data in the first dataset is less than the similarity threshold, the magnitudes of the first similarities calculated based on the respective first image data may be different. Therefore, the first differences between the first similarities corresponding to the respective first image data and the similarity threshold are different. If there are multiple first differences corresponding to the first image data that deviate significantly from the similarity threshold, there is a possibility that the set similarity threshold is unreasonable. An unreasonable similarity threshold may overstate the influence of the device and the environment on image capture. For example, even if there are significant differences between the target image data and the second image data, they may still be judged to be similar. An unreasonable similarity threshold may also underestimate the influence of the device and the environment on image capture, causing target image data that is actually similar to the second image data to be wrongly judged as dissimilar. By adjusting the similarity threshold, the problem of low image recognition accuracy can be effectively improved.
[0057] The greater the first difference, the greater the adjustment amplitude of the similarity threshold; the smaller the first difference, the smaller the adjustment amplitude of the similarity threshold. Optionally, before adjusting the similarity threshold based on the first difference, the first differences corresponding to a specified number of first image data can be integrated by calculating the average value, weighted average value, variance, etc. The second difference can be set and adjusted according to application requirements and scenarios. Optionally, by adjusting the similarity threshold, the differences between the similarities corresponding to multiple first image data and the adjusted similarity threshold are made less than the second difference.
[0058] Step S208, when the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, update the first dataset according to the target image data.
[0059] Optionally, obtain and calculate the second similarity between the target image data and the second image data. The first image data can be compared with multiple second image data in the database to obtain multiple similarities. When there is second image data whose similarity to the first image data is greater than or equal to the similarity threshold, determine the first dataset corresponding to the second image data, and cluster the first image data into the first dataset. Among them, when updating the first dataset, at least part of the data in the target image data can be added to the first dataset.
[0060] Among them, when the second similarity between the target image data and the second image data is less than the adjusted similarity threshold, the first dataset corresponding to the second image data is not updated.
[0061] In the above image processing method, considering that there are differences in the image data obtained by photographing the same object in different environments and with different devices, if a unified similarity threshold is used to judge the similarity, inaccurate situations may occur. By obtaining first image data related to the target image data from the existing first dataset, based on the first differences between multiple similarities between the first image data and the second image data and the similarity threshold, a similarity comparison result of the image data is obtained; after dynamically adjusting the current similarity threshold based on the first differences, and then judging whether to update the first dataset based on the target image data through the adjusted similarity threshold, the influence of factors such as the image shooting environment and devices on face recognition is reduced, and the accuracy of face recognition filing is improved.
[0062] In one embodiment, obtaining the first similarity between the first image data and the second image data, and calculating the first difference between the first similarity and the similarity threshold includes: determining the target device for obtaining the target image data; calculating the first similarity between the first image data obtained by the target device in the first dataset and the second image data; obtaining the first threshold corresponding to the target device, and calculating the first difference between the first similarity and the first threshold.
[0063] Among them, corresponding similarity thresholds can be set for different image data acquisition devices. According to the association relationship between the target device and the similarity threshold, the similarity threshold corresponding to the target device, that is, the first threshold, is obtained. Optionally, the first image data obtained by the target device in one or more datasets is obtained. According to the relationship between the first image data and the first dataset, and the relationship between the first dataset and the second image data, the second image data corresponding to each first image data is determined, and the first similarity is calculated based on the first image data and the corresponding second image data.
[0064] In this embodiment, due to the different shooting characteristics of different devices, even in the same environment, there are differences in the first image data obtained by different devices when photographing the same object. Determining the first image data and the first threshold corresponding to the target image data according to the target device, and then adjusting the similarity threshold, can reduce the influence of device differences on the accuracy of image recognition.
[0065] In one embodiment, obtaining the first similarity between the first image data and the second image data, and calculating the first difference between the first similarity and the similarity threshold includes: determining the target time period for obtaining the target image data; calculating the first similarity between the first image data obtained in the first time period in the first dataset and the second image data; obtaining the second threshold corresponding to the first time period, and calculating the first difference between the first similarity and the second threshold.
[0066] Among them, corresponding initial similarity thresholds are set for different time periods of the first image data acquisition; according to the association relationship between the time period and the similarity threshold, the similarity threshold corresponding to the first time period is obtained, that is, the second threshold. Optionally, one or more pieces of first image data captured within the target time period in one or more data sets are obtained. According to the relationship between the first image data and the first data set, and the relationship between the first data set and the second image data, the second image data corresponding to each piece of first image data is determined, and the first similarity is calculated based on the first image data and the corresponding second image data.
[0067] Under the influence of the environment, there are also differences in the first image data captured by the same device at different time periods for the same object. In this embodiment, the first image data and the second threshold corresponding to the target graphic data are determined according to the time period when the target image data is obtained, and then the similarity threshold corresponding to each time period is adjusted, which can reduce the influence of time difference on the accuracy of image recognition.
[0068] In one embodiment, one or more pieces of first image data obtained by the target device within the target time period are obtained, and the corresponding similarity threshold is obtained according to the target device and the target time period, and the relationship between the similarity of the image data obtained by the target device within the first time period and the similarity threshold is obtained. In this way, the influence of time and device on the accuracy of image recognition can be comprehensively considered.
[0069] In one embodiment, the steps of obtaining the first image data and adjusting the similarity threshold can be executed periodically. Optionally, a period is divided into multiple fixed time periods. At the end of each time period, the first image data obtained by the target device in the previous same time period (that is, the time period of the previous cycle) is obtained, and the similarity threshold corresponding to the target device and the target time period is adjusted. Based on the same principle, the length of the cycle and the time period can be flexibly adjusted according to specific requirements and set to different time units, such as several minutes, several hours, several days or longer. By periodically obtaining image data and adjusting the corresponding similarity threshold, the regular update of the similarity threshold within a specific cycle can be ensured, thereby improving the accuracy of image recognition.
[0070] Furthermore, in one embodiment, to obtain the first similarity, multiple first similarities can be integrated. The integration of the similarities corresponding to the first image data includes, but is not limited to, methods such as normalizing or standardizing the similarities, calculating the average value between similarity thresholds, weighted average value, etc.
[0071] In one embodiment, determining first image data associated with the image information of the target image data in the first dataset according to the target image data to be processed includes: evaluating the quality of the target image data; and determining the first image data associated with the image information of the target image data in the first dataset when it is evaluated that the quality of the target image data meets the evaluation requirements.
[0072] Among them, the quality evaluation of the target image data can be implemented based on Image Quality Assessment, including but not limited to: extracting features from the target image data to be evaluated and predicting its quality based on a deep learning network; and performing image evaluation according to the mean square error (MSE) or peak signal-to-noise ratio (PSNR) of the first image data when there is an evaluation reference, etc.
[0073] Optionally, quantifying the evaluation result into a score. If the quality score of the target image data is lower than the specified score, it is considered that the image quality is low and it is filtered; if the quality score of the target image data is higher than or equal to the specified score, it is considered that the image quality is high, and the step of determining the first image data associated with the image information of the target image data in the first dataset according to the target image data to be processed is performed.
[0074] In this embodiment, by filtering images with reduced image quality, it is possible to effectively avoid low-quality images from participating in image recognition and reduce the impact of low-quality images on the accuracy of face recognition clustering.
[0075] In one embodiment, when the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, updating the first dataset according to the target image data includes: when the second similarity between the target image data and multiple second image data is greater than or equal to the adjusted similarity threshold, merging multiple first datasets corresponding to the multiple second image data; and updating the merged first dataset according to the target image data.
[0076] Among them, each second image data corresponds to a different first dataset in the database. If the second similarity between the first image data and multiple second image data is high, there may be a situation where multiple first datasets belong to the same face. By merging multiple second datasets, the accuracy of face recognition and clustering is improved.
[0077] In one embodiment, when the second similarity between the target image data and the second image data is less than the adjusted similarity threshold, a second dataset is established according to the target image data.
[0078] Among them, the second data set is a data set newly created based on the second image data. The second data set includes, but is not limited to, the second image data and the associated information of the second image data. The associated information may be the acquisition device and acquisition time of the second image data, and may also include image features, objects, etc. included in the second image. In this embodiment, real-time clustering of the second image data can be achieved by creating the second data set.
[0079] In one embodiment, obtaining target image data to be processed includes: obtaining the target image data according to the face features in the image to be recognized.
[0080] Optionally, machine learning, deep learning, etc. can be used to perform face detection on the image to be recognized to locate the face in the image to be recognized and determine the face features in the image to be recognized. One or more recognized face features are used as the first image data.
[0081] In this embodiment, face retrieval and clustering based on the database can be achieved by using the face features as the first image data.
[0082] In one embodiment, after establishing the first data set, the method further includes: checking whether there is first image data in the first data set that does not match the second image data corresponding to the current first data set; if so, removing the first image data that does not match the second image data from the first data set.
[0083] Among them, the inspection of the first data set can be realized by comparing the histograms of the first image data and the second image data in the first data set, matching feature points, etc. In the case where the feature points do not match, or the histogram similarity between the first image data and the second image data is less than a specified degree, it is determined that the first image data does not match the second image data. It is also possible to manually inspect the first image data in the first data set to obtain the first image data that does not match the second image data.
[0084] Optionally, after removing the first image data that does not match the second image data from the first data set, a new data set can also be established according to the unmatched first image data, or the first image data can be merged into the data set corresponding to the second image data that matches it.
[0085] In this embodiment, the accuracy and accuracy of the clustering result are further improved by inspecting the first data set.
[0086] In one embodiment, Figure 3 Another image evaluation method is provided, and this method mainly includes the following steps:
[0087] Step S301: Determine whether the quality score of the first image data is greater than or equal to the quality score threshold. If so, execute step S301; if not, end the execution of the image evaluation method.
[0088] Obtain a preset quality score threshold based on the evaluation requirements. If the quality score of the first image data is lower than the quality score threshold, filter the first image data so that the first image data with quality not meeting the evaluation requirements no longer participates in the face recognition and file aggregation process; if the quality score of the first image data is greater than or equal to the quality score threshold, retain the first image data and execute step S302 based on this first image data.
[0089] By calculating the quality score of the picture through the picture quality score algorithm and filtering out the image data with low quality, and retaining the high-quality image data, it can effectively avoid the impact of low-quality image data on the accuracy of file aggregation, thereby further improving the effect of file aggregation.
[0090] Step S302: Compare the face features in the first image data with the known face features to obtain a similarity. By comparing the similarity with the similarity threshold, determine whether to create a new file or merge files based on the first image data.
[0091] As a non-limiting example, known facial features are obtained from a database to obtain second image data. After determining the device for obtaining the first image data, a similarity threshold corresponding to the device is obtained. After comparing the first image data with the second image data and obtaining the similarity between the two, when the similarity between the first image data and the second image data is greater than or equal to the similarity threshold, the first image data is merged into the file corresponding to the second image data. When the similarity between the first image data and the second image data is less than the similarity threshold, a file is newly created according to the first image data. Among them, the file corresponding to the second image data is the first data set in the above embodiment; the file newly created according to the first image data is the second data set in the above embodiment. The file includes, but is not limited to, information such as the acquisition time of the second image data, the user information corresponding to the facial features, and the similarity between the second image data and the first image data. Among them, the similarity threshold can be obtained by dynamic setting. After determining the device for obtaining the first image data, when performing facial feature comparison on the first image data obtained based on the device for the first time, a default similarity threshold can be used. When performing facial feature comparison on the first image data obtained based on the device not for the first time, the similarity between the first image data obtained by the device in the historical time period and the second image data is determined, and the similarity threshold is dynamically adjusted according to the difference between the similarity corresponding to the first image data and the initial similarity threshold and / or user feedback. For example, if the comparison result between the similarity corresponding to the image data obtained by the device and the similarity threshold is always deviated greatly, the similarity threshold corresponding to the device can be appropriately increased to reduce the situation of misidentification. Among them, different initial similarity thresholds can be set for each device for obtaining the first image data; different initial similarity thresholds can be set for the image data obtained by the same device at different times.
[0092] By setting and dynamically adjusting the similarity threshold, and performing facial comparison on the first image data based on the adjusted similarity threshold, and judging whether to create a new file or merge files based on the comparison result, the effect of flexibly and dynamically adjusting the similarity threshold according to different devices, the impact of the environment on the picture quality, and user feedback can be achieved, so as to adapt to different facial comparison scenarios and facial comparison requirements and improve the accuracy of the facial file aggregation method.
[0093] Step S303, adjust the file in response to the user interaction instruction.
[0094] Optionally, the user is allowed to perform manual intervention on the existing file according to the actual situation. For example, the images aggregated incorrectly in the file can be removed, and two merged files can be merged in the case of multiple files aggregated for the same face, etc.
[0095] Optionally, an interactive interface for implementing file adjustment is provided, and user interaction instructions are received through the interactive interface to adjust the file. Among them, the user interaction instructions can be input into the interface for implementing file adjustment based on methods such as mouse, voice, and keys. User instructions include, but are not limited to: deleting image data that has been wrongly aggregated into a certain file, merging image data in different files, deleting or adding files, manually adding new image data to a file, and modifying file information.
[0096] Step S304: Set the adjustment period, obtain the average value of the similarity between the first image data and the second image data obtained by the same device in the same time period within the previous adjustment period, and adjust the similarity threshold according to the difference between the average value and the similarity threshold default in the system.
[0097] Optionally, when the adjustment period is in days, obtain the similarity threshold corresponding to a certain device in the same time period of the previous day. Among them, the similarity threshold may be the initially set threshold or the threshold adjusted on the basis of the initially set threshold. Obtain the average value of multiple similarity thresholds of the device in the same time period of the previous day. If the difference between the average value and the initially set threshold is less than the preset third difference, it indicates that the file aggregation effect of the face features corresponding to the current device is ideal, and face feature comparison can be performed based on the initially set threshold; if the second difference between the average value and the initially set threshold is greater than the preset third difference, the similarity threshold needs to be dynamically adjusted to the average value. Among them, a threshold adjustment is performed based on step S304 for each adjustment period. For ease of understanding, optionally, the average value of the similarity thresholds of the same device in the corresponding time period of the previous cycle can be calculated every once in a while (such as one day), and step S304 is executed. It can be understood that the adjustment period can be set and modified according to requirements.
[0098] Step S305: Respond to the user interaction instruction to adjust the methods in steps S301 to S304.
[0099] Optionally, it can respond to the instruction input by the user on the interactive interface to change the image quality evaluation method in step S301, adjust the face feature vectors and algorithm parameters of face feature comparison in step S302. Further, an AI annotation function can also be provided on the interactive interface, and the misrecognized first image data can be uploaded to the AI training platform for secondary training, so as to meet different user needs and further improve the accuracy and precision of file aggregation.
[0100] Based on the same inventive concept, exemplarily, Figure 4 A face file aggregation method is provided, such as Figure 4As shown, after receiving the image data, it is determined whether the image quality evaluation score is greater than or equal to the quality scoring threshold. If so, it is determined whether a corresponding similarity threshold is set for the target device for obtaining the first image data and the target time period for obtaining the first image data. If there is no corresponding similarity threshold for the target device and the target time period, the first image data is set to a unified initial similarity threshold; otherwise, the similarity threshold corresponding to the target device and the target time period can be obtained.
[0101] After obtaining the similarity threshold, it is determined whether the dynamic adjustment field of the target device for obtaining the first image data in the corresponding time period is a specified field; if the dynamic adjustment field is a specified field, the similarity threshold corresponding to the first image data has been adjusted, and face retrieval can be performed based on the current similarity threshold. Taking the specified field as "true" as an example: when the similarity threshold corresponding to the first image data is dynamically adjusted, the dynamic adjustment field is "true"; when the similarity threshold corresponding to the first image data is the initial value, the dynamic adjustment field is not "true". When the dynamic adjustment field is not a specified field, the first similarity between the first image data obtained in the target time period corresponding to the target device in the previous time cycle and the matching face data (second image data) is determined, and multiple first similarities are integrated by calculating the average value. When the first difference between the average value of the first similarities and the default initial similarity threshold is within 0.05, the initial similarity threshold is not modified; otherwise, the current similarity threshold is modified to the average value of the first similarities. Among them, 0.05 is the above-mentioned second difference, and 0.05 can also be set to other values.
[0102] Performing face retrieval based on the current similarity threshold includes: determining whether the first image data is similar to the second image data (face data) in the database. Among them, it is obtained whether the similarity between the first image data and the second image data in the database is greater than or equal to the similarity threshold. If not, new archive data is created, and a unique archive id record is generated in the database, and the id of the first image data is used as the newly generated archive id to obtain the second data set; if so, it is determined whether the retrieved data is obtained, and it is determined whether the similarity between the first image data and multiple second data images is greater than or equal to the similarity threshold: when the similarity between the first image data and multiple second image data is greater than or equal to the similarity threshold, the archives (first data set) corresponding to the multiple second image data are triggered to be merged; when the similarity between the first image data and multiple second image data is less than the similarity threshold, the id of the first image data is set as the archive id corresponding to the second image data.
[0103] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps. For example, step S305 can be executed in advance before executing steps S301 to S304; or, after executing step S304 to adjust the similarity threshold, execute the step of adjusting the file in response to a user interaction instruction.
[0104] Based on the same inventive concept, an embodiment of the present application also provides an image processing apparatus for implementing the above-mentioned image processing method. The implementation solution provided by this apparatus to solve the problem is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following image processing apparatus can refer to the limitations on the image processing method in the above text, and will not be repeated here.
[0105] In one embodiment, as Figure 5 shown, an image processing apparatus is provided, including: a selection module, a calculation module, an adjustment module, and a clustering module, where:
[0106] The selection module is used to obtain target image data to be processed and determine first image data associated with the image information of the target image data in the first data set; wherein, the similarity between the image data in the first data set and the second image data is greater than or equal to the similarity threshold, and the second image data corresponds to the first data set;
[0107] The calculation module is used to obtain the first similarity between the first image data and the second image data and calculate the first difference between the first similarity and the similarity threshold;
[0108] The adjustment module is used to adjust the similarity threshold based on the first difference when there are a specified number of first differences corresponding to the first image data that are greater than or equal to a preset second difference;
[0109] The clustering module is used to update the first data set according to the target image data when the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold.
[0110] Optionally, obtaining target image data to be processed, including: obtaining the target image data according to the face features in the image to be recognized.
[0111] In some embodiments, the calculation module obtains a first similarity between the first image data and the second image data, and calculates a first difference between the first similarity and a similarity threshold, including: determining a target device for obtaining the target image data; calculating the first similarity between the first image data captured by the target device in the first data set and the second image data; obtaining a first threshold corresponding to the target device, and calculating the first difference between the first similarity and the first threshold. In some embodiments, the calculation module obtains a first similarity between the first image data and the second image data, and calculates a first difference between the first similarity and a similarity threshold, including: determining a target time period for obtaining the target image data; calculating the first similarity between the first image data captured within the first time period in the first data set and the second image data; obtaining a second threshold corresponding to the first time period, and calculating the first difference between the first similarity and the second threshold.
[0112] In some embodiments, the selection module determines, according to the target image data to be processed, first image data associated with the image information of the target image data in the first data set, including: evaluating the quality of the target image data; and determining, when it is evaluated that the quality of the target image data meets the evaluation requirements, first image data associated with the image information of the target image data in the first data set.
[0113] In some embodiments, when the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, the clustering module updates the first data set according to the target image data, including: when the second similarity between the target image data and multiple second image data is greater than or equal to the adjusted similarity threshold, merging multiple first data sets corresponding to the multiple second image data; and updating the merged first data set according to the target image data.
[0114] In some embodiments, the clustering module is further configured to establish a second data set according to the target image data when the second similarity between the target image data and the second image data is less than the adjusted similarity threshold.
[0115] Each module in the above image processing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or can be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0116] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structural diagram may be as shown in Figure 6 . The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store image data and data sets. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements an image processing method.
[0117] Those skilled in the art can understand that Figure 6 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0118] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0120] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0121] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0122] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0123] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire target image data to be processed, and determine first image data associated with image information of the target image data in a first data set; wherein the similarity between the image data in the first data set and the second image data is greater than or equal to a similarity threshold, and the second image data corresponds to the first data set; Acquire a first similarity between the first image data and the second image data, and calculate a first difference between the first similarity and a similarity threshold; In a case where there are a specified number of the first image data corresponding to the first difference value being greater than or equal to a preset second difference value, adjusting the similarity threshold value based on the first difference value; When the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, the first data set is updated according to the target image data.
2. The method according to claim 1, characterized in that Acquiring a first similarity between the first image data and the second image data, and calculating a first difference between the first similarity and a similarity threshold, includes: determining a target device for acquiring the target image data; Calculating a first similarity between first image data captured by a target device and the second image data in the first data set; A first threshold corresponding to the target device is acquired, and a first difference between the first similarity and the first threshold is calculated.
3. The method according to claim 1, characterized in that Acquiring a first similarity between the first image data and the second image data, and calculating a first difference between the first similarity and a similarity threshold, includes: Determine a target time period for acquiring the target image data; Calculating a first similarity between first image data captured in a first time period in the first data set and the second image data; A second threshold corresponding to the first time period is acquired, and a first difference between the first similarity and the second threshold is calculated.
4. The method according to claim 1, characterized in that: Determining, in a first data set, first image data associated with image information of the target image data according to the target image data to be processed, comprises: evaluating the quality of the target image data; When it is assessed that the quality of the target image data meets the assessment requirement, first image data associated with the image information of the target image data is determined in the first data set.
5. The method according to claim 1, characterized in that When the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold, updating the first data set according to the target image data includes: When the second similarity between the target image data and the plurality of second image data is greater than or equal to the adjusted similarity threshold, merging the plurality of first data sets corresponding to the plurality of second image data; The merged first data set is updated according to the target image data.
6. The method according to claim 1, characterized in that The method further comprises: In a case where the second similarity between the target image data and the second image data is less than the adjusted similarity threshold, a second data set is established according to the target image data.
7. The method according to any one of claims 1 to 6, characterized in that: Acquiring the target image data to be processed, including: The target image data is obtained according to the facial features in the image to be recognized.
8. An image processing device, characterized in that: The device comprises: A selection module, configured to obtain target image data to be processed, and determine first image data associated with image information of the target image data in a first data set; wherein the similarity between the image data in the first data set and the second image data is greater than or equal to a similarity threshold, and the second image data corresponds to the first data set; a calculation module, configured to obtain a first similarity between the first image data and the second image data, and calculate a first difference between the first similarity and a similarity threshold; an adjusting module, configured to adjust the similarity threshold based on the first difference value when there are a specified number of the first image data corresponding to the first difference value being greater than or equal to a preset second difference value; A clustering module is used to update the first data set according to the target image data when the second similarity between the target image data and the second image data is greater than or equal to the adjusted similarity threshold.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Threshold setting method and device in spectral similarity matching classification
CN112418314A
Image processing method and device, image processing equipment and storage medium
CN112633424A