Image processing method and device, computer equipment and storage medium
By dynamically adjusting the similarity threshold, the problem of low accuracy of facial recognition clustering is solved, and the accuracy of image recognition is improved under different environments and devices.
Patent Information
- Application Number
- CN202510323627.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-04-25
- 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 acquiring 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 when a specific condition is met to improve the accuracy of image recognition.
By dynamically adjusting the similarity threshold, adapting to image characteristics under different environments and devices, the accuracy of face recognition and gathering is improved.
Smart Images

Figure CN119888825A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and in particular to image processing methods, devices, computer equipment and storage media. Background Art
[0002] Computer vision technology is a technology that enables computers to obtain information and make decisions from images or videos through computer and image processing technology. 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 algorithm is a commonly used technology that can determine whether two people are the same person by comparing facial features. For face recognition, the relevant solution is mainly to identify and cluster faces through face retrieval algorithms. However, when using the system default similarity threshold to identify and cluster faces, there are cases where the clustering effect is not ideal.
[0003] With regard to the problem of low accuracy of face recognition in related technologies, no effective solution has been proposed so far. Summary of the invention
[0004] Based on this, it is necessary to provide an image processing method, device, computer equipment and storage medium that can solve the problem of low accuracy of face recognition aggregation in response to the above technical problems.
[0005] In a first aspect, an image processing method is provided in this embodiment, the method comprising: 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.
[0006] In some 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: 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.
[0007] In some 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: 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.
[0008] In some embodiments, determining, in the first data set, first image data associated with image information of the target image data according to the target image data to be processed includes: 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.
[0009] 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, 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.
[0010] In some embodiments, 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.
[0011] In some embodiments, obtaining the target image data to be processed includes: The target image data is obtained according to the facial features in the image to be recognized.
[0012] In a second aspect, an image processing device is provided in this embodiment, the device comprising: 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.
[0013] In a third aspect, a computer device is provided in this embodiment, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the image processing method described in the first aspect when executing the computer program.
[0014] 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 is implemented.
[0015] The above-mentioned image processing method, apparatus, computer equipment 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 image recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A diagram showing an application environment of an image processing method in an embodiment; Figure 2 is a schematic flow chart of an image processing method in one embodiment; Figure 3 is a schematic flow chart of an image processing method in another embodiment; Figure 4 1 is a flow chart of a face aggregation method according to an embodiment; Figure 5 is a structural block diagram of an image processing device in one embodiment; Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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.
[0018] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure block diagram of a terminal of an image processing method according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein 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 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0019] 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 program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0020] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0021] In this embodiment, an image processing method is provided. Figure 2 is a flow chart of the image processing method of this embodiment, such as Figure 2 As shown, the process includes the following steps: Step S202, obtaining target image data to be processed, and determining first image data associated with 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.
[0022] The target image data is one or more image data that has not been processed by face recognition, clustering, etc. 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 location of the image data.
[0023] The first data set is obtained based on the image data that has been archived. Therefore, the first data set includes one or more image data whose similarity with the corresponding second image data is greater than or equal to a similarity threshold. The first data set may include one or more of the following data: first image data, second image data, and the format and information corresponding to each image data. The first image data is data that has undergone face recognition and has a high similarity with 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 different data sets correspond to different second image data.
[0024] The similarity threshold may be an initially set threshold or a threshold adjusted based on the first difference, and the size of the similarity threshold may 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, and shooting environment of the first image data.
[0025] Step S204: 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.
[0026] The first image data and the second image data may be directly compared, including: obtaining a 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 a color histogram or a grayscale histogram of the first image data and the second image data. The histogram comparison is realized by a similarity measurement method, and the histogram comparison result is used as the similarity; or the similarity calculation is realized by feature point matching.
[0027] Alternatively, image recognition may be performed on the first image data and the second image data, and the recognized object faces may be compared to obtain similarity. For example, when the image recognition requirement is a face recognition requirement, face information in the first image data and the second image data may be extracted, and the face information in the two types of image data may be compared to see whether they are the same.
[0028] Optionally, first similarities corresponding to a plurality of first image data are obtained respectively, and differences between a plurality of first similarities and a similarity threshold are calculated, that is, a plurality of first differences are obtained. The first difference may be obtained by using an absolute difference, a standardized difference, a square difference or other calculation algorithm between the first similarity and the similarity threshold; the calculation method of the first difference may be set as required.
[0029] Step S206: If there are first difference values corresponding to a specified number of first image data that are greater than or equal to a preset second difference value, adjust the similarity threshold based on the first difference value.
[0030] Among them, although the first similarities between the first image data and the second image data in the first data set are all less than the similarity threshold, the sizes of the first similarities calculated based on each first image data may be different, so the first difference between the first similarity corresponding to each first image data and the similarity threshold is different. If there are multiple first difference values corresponding to the first image data that deviate from the similarity threshold by a large margin, there is a possibility that the similarity threshold is set unreasonably. An unreasonable similarity threshold may exaggerate the impact of the device and environment on image capture. For example, even if there are significant differences between the target image data and the second image data, they are judged to be similar. An unreasonable similarity threshold may also underestimate the impact of the device and environment on image capture, causing the target image data that is actually similar to the second image data to be mistakenly judged to be dissimilar. By adjusting the similarity threshold, the problem of low image recognition accuracy can be effectively improved.
[0031] The larger the first difference is, the larger the adjustment range of the similarity threshold is; the smaller the first difference is, the smaller the adjustment range of the similarity threshold is. Optionally, before adjusting the similarity threshold based on the first difference, the first difference 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 difference between the similarities corresponding to the plurality of first image data and the adjusted similarity threshold is smaller than the second difference.
[0032] 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 data set according to the target image data.
[0033] Optionally, a second similarity between the target image data and the second image data is obtained and calculated. The first image data may be compared with a plurality of second image data in a database to obtain a plurality of similarities. In the case where the similarity between the second image data and the first image data is greater than or equal to a similarity threshold, a first data set corresponding to the second image data is determined, and the first image data is clustered into the first data set. When the first data set is updated, at least part of the target image data may be added to the first data set.
[0034] Wherein, when the second similarity between the target image data and the second image data is less than the adjusted similarity threshold, the first data set corresponding to the second image data is not updated.
[0035] In the above image processing method, considering that there are differences in image data obtained by taking the same object in different environments and with different devices, if a unified similarity threshold is used to judge the similarity, there will be inaccuracies. By obtaining the first image data related to the target image data in the existing first data set, a similarity comparison result of the image data is obtained based on a first difference between multiple similarities between the first image data and the second image data and the similarity threshold; after dynamically adjusting the current similarity threshold based on the first difference, it is judged whether to update the first data set based on the target image data through the adjusted similarity threshold, which reduces the influence of factors such as the image shooting environment and equipment on face recognition and improves the accuracy of face recognition aggregation.
[0036] In one embodiment, obtaining a first similarity between first image data and second image data, and calculating a first difference between the first similarity and a similarity threshold, includes: determining a target device for obtaining target image data; calculating a first similarity between first image data captured by the target device and second image data in a first data set; obtaining a first threshold corresponding to the target device, and calculating a first difference between the first similarity and the first threshold.
[0037] 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, a similarity threshold corresponding to the target device, i.e., a first threshold, is obtained. Optionally, first image data captured by the target device 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 first image data is determined, and the first similarity is calculated based on the first image data and the corresponding second image data.
[0038] In this embodiment, different devices have different shooting characteristics, resulting in differences in first image data even when different devices shoot the same object under the same environment. The first image data and the first threshold corresponding to the target image data are determined according to the target device, and the similarity threshold is then adjusted, which can reduce the impact of device differences on image recognition accuracy.
[0039] In one embodiment, obtaining a first similarity between first image data and second image data, and calculating a first difference between the first similarity and a similarity threshold, includes: determining a target time period for obtaining target image data; calculating a first similarity between first image data and second image data captured in a first data set within a first time period; obtaining a second threshold corresponding to the first time period, and calculating a first difference between the first similarity and the second threshold.
[0040] Wherein, corresponding initial similarity thresholds are set for different time periods of the first image data acquisition; and according to the correlation between the time period and the similarity threshold, a similarity threshold corresponding to the first time period, i.e., a second threshold, is obtained. Optionally, the first image data captured in one or more data sets within the target time period is 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 first image data is determined, and the first similarity is calculated based on the first image data and the corresponding second image data.
[0041] Under the influence of the environment, there may be differences in the first image data obtained by the same device when photographing the same object in different time periods. 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 acquired, and then the similarity threshold corresponding to each time period is adjusted, which can reduce the impact of time differences on image recognition accuracy.
[0042] In one embodiment, one or more first image data acquired by the target device within the target time period are acquired, and a corresponding similarity threshold is obtained according to the target device and the target time period, and a relationship between the similarity corresponding to the image data acquired by the target device within the first time period and the similarity threshold is acquired. In this way, the influence of time and device on the accuracy of image recognition can be comprehensively considered.
[0043] In one embodiment, the steps of acquiring the first image data and adjusting the similarity threshold may be performed periodically. Optionally, a cycle is divided into a plurality of fixed time periods. At the end of each time period, the first image data acquired by the target device in the previous same time period (i.e., the time period of the previous cycle) is acquired, 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 time period can be flexibly adjusted according to specific needs, and can be set to different time units, such as a few minutes, a few hours, a few days or a longer time. By periodically acquiring 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.
[0044] Furthermore, in one embodiment, the first similarity may be obtained by integrating multiple first similarities, and integrating the similarities corresponding to the first image data includes but is not limited to standardizing or normalizing the similarities, calculating the average value between similarity thresholds, weighted average value, and other methods.
[0045] In one embodiment, based on the target image data to be processed, first image data associated with image information of the target image data is determined in a first data set, including: evaluating the quality of the target image data; and when it is assessed that the quality of the target image data meets evaluation requirements, determining the first image data associated with image information of the target image data in the first data set.
[0046] Among them, the quality assessment of the target image data can be achieved 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; in the presence of an evaluation reference, performing image evaluation based on the image mean square error (MSE) or peak signal-to-noise ratio (PSNR) of the first image data, etc.
[0047] Optionally, the evaluation result is quantified into a score. If the quality score of the target image data is lower than a specified score, the image quality is considered to be low and is filtered; if the quality score of the target image data is higher than or equal to the specified score, the image quality is considered to be high, and a step of determining, in a first data set, first image data associated with image information of the target image data is performed based on the target image data to be processed.
[0048] In this embodiment, by filtering images with reduced image quality, it is possible to effectively avoid low-quality images from participating in image recognition, thereby reducing the impact of low-quality images on the accuracy of face recognition.
[0049] 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 data set 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 data sets corresponding to multiple second image data; and updating the merged first data set according to the target image data.
[0050] Wherein, each second image data corresponds to a different first data set in the database. If the second similarity between the first image data and the plurality of second image data is high, then there may be a situation where the plurality of first data sets belong to the same face. By merging the plurality of second data sets, the accuracy of face recognition and clustering is improved.
[0051] In one embodiment, when the second similarity between the target image data and the second image data is less than the adjusted similarity threshold, the second data set is established according to the target image data.
[0052] The second data set is a data set newly created based on the second image data, and the second data set includes but is not limited to the second image data and associated information of the second image data, and the associated information may be an acquisition device and acquisition time of the second image data, and may also include image features and objects contained in the second image, etc. In this embodiment, real-time clustering of the second image data may be achieved by creating the second data set.
[0053] In one embodiment, obtaining target image data to be processed includes: obtaining the target image data according to facial features in the image to be recognized.
[0054] Optionally, face detection can be performed on the image to be identified by machine learning, deep learning, etc. to locate the face in the image to be identified and determine the facial features in the image to be identified. One or more facial features obtained by identification are used as the first image data.
[0055] In this embodiment, by using facial features as the first image data, database-based face retrieval and clustering can be achieved.
[0056] 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 in the first data set.
[0057] The first data set may be verified by comparing the first image data in the first data set with the second image data, matching feature points, etc. If the feature points do not match, or if 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 and the second image data do not match. The first image data in the first data set may also be manually verified to obtain the first image data that does not match the second image data.
[0058] Optionally, after removing the first image data that does not match the second image data from the first data set, a new data set may be established based on the first image data that does not match, or the first image data may be merged into a data set corresponding to the second image data that matches.
[0059] In this embodiment, the precision and accuracy of the aggregation result are further improved by verifying the first data set.
[0060] In one embodiment, Figure 3 Another image evaluation method is provided, which mainly includes the following steps: Step S301, determining whether the quality score of the first image data is greater than or equal to a quality score threshold. If yes, executing step S301; if no, terminating the execution of the image evaluation method.
[0061] A preset quality score threshold is obtained based on the evaluation requirements. If the quality score of the first image data is lower than the quality score threshold, the first image data is filtered so that the first image data whose quality does not meet the evaluation requirements no longer participates in the face recognition and aggregation process; if the quality score of the first image data is greater than or equal to the quality score threshold, the first image data is retained, and step S302 is performed based on the first image data.
[0062] The image quality score is calculated through the image quality score algorithm, and the low-quality image data is filtered out and the high-quality image data is retained, which can effectively avoid the influence of low-quality image data on the accuracy of clustering, thereby further improving the effect of clustering.
[0063] Step S302, comparing the facial features in the first image data with known facial features to obtain similarity, and by comparing the similarity with a similarity threshold, determining whether to create a new file or merge files based on the first image data.
[0064] As a non-limiting example, known facial features are obtained from a database to obtain the second image data. After determining the device used to obtain 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, if 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 archive corresponding to the second image data. If the similarity between the first image data and the second image data is less than the similarity threshold, a new archive is created based on the first image data. Among them, the archive corresponding to the second image data is the first data set in the above embodiment; the archive newly created based on the first image data is the second data set in the above embodiment. The archive includes but is not limited to the acquisition time of the second image data, the user information corresponding to the facial features, the similarity between the second image data and the first image data, and other information. Among them, the similarity threshold can be obtained by dynamic setting. After determining the device used to obtain the first image data, when the facial features are compared for the first time based on the first image data obtained by the device, the default similarity threshold can be used. In the case where it is not the first time to perform facial feature comparison based on the first image data acquired by the device, determine the similarity between the first image data acquired by the device in the historical time period and the second image data, and dynamically adjust the similarity threshold 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 acquired by the device and the similarity threshold is always greatly deviated, the similarity threshold corresponding to the device can be appropriately increased to reduce the possibility of misidentification. Among them, a different initial similarity threshold can be set for each device that acquires the first image data; and a different initial similarity threshold can be set for the image data acquired by the same device at different times.
[0065] By setting and dynamically adjusting the similarity threshold, and realizing face comparison of the first image data based on the adjusted similarity threshold, and judging whether to create a new file or merge files based on the first image data according to the comparison result, it is possible to flexibly and dynamically adjust the similarity threshold according to the impact of different devices and environments on image quality and user feedback, thereby adapting to different face comparison scenarios and face comparison requirements and improving the accuracy of the face clustering method.
[0066] Step S303, adjusting the file in response to the user interaction instruction.
[0067] Optionally, the user is allowed to manually intervene in the existing archives according to the actual situation. For example, images with incorrect aggregation in the archives can be removed, and two merged archives can be merged when multiple archives are obtained by aggregating the same face.
[0068] Optionally, an interactive interface for realizing file adjustment is provided, and the file is adjusted by receiving user interaction instructions through the interactive interface. The user interaction instructions can be input into the interface for realizing file adjustment based on the mouse, voice, key, etc. User instructions include but are not limited to: deleting image data that is mistakenly aggregated into a certain file, merging image data in different files, deleting or adding a new file, manually adding new image data to the file, and modifying file information.
[0069] Step S304, setting an adjustment cycle, obtaining an 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 in the previous adjustment cycle, and adjusting the similarity threshold according to the difference between the average value and the system default similarity threshold.
[0070] Optionally, when the adjustment cycle 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 threshold initially set, or it may be a 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 means that the clustering effect of the facial features corresponding to the current device is ideal, and the facial features can be compared 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, it is necessary to dynamically adjust the similarity threshold to the average value. Among them, each adjustment cycle performs a threshold adjustment based on step S304. For ease of understanding, optionally, the average value of the similarity threshold of the same device in the corresponding time period of the previous cycle can be calculated every period of time (for example, one day), and step S304 is executed. It can be understood that the adjustment cycle can be set and modified according to needs.
[0071] Step S305 , adjusting the method of steps S301 to S304 in response to the user interaction instruction.
[0072] Optionally, the image quality assessment method in step S301 can be changed, and the facial feature vector and facial feature comparison algorithm parameters in step S302 can be adjusted in response to the user's instructions input in the interactive interface. Furthermore, an AI annotation function can be provided in the interactive interface, and the first image data with incorrect recognition can be transmitted to the AI training platform for secondary training, thereby meeting different user needs and further improving the precision and accuracy of the aggregated files.
[0073] Based on the same inventive concept, illustratively, Figure 4 A face clustering method is provided, such as Figure 4As shown, after receiving the image data, it is determined whether the image quality assessment score is greater than or equal to the quality score threshold. If so, it is determined whether the target device for acquiring the first image data and the target time period for acquiring the first image data are set with a corresponding similarity threshold. If the target device and the target time period do not have a corresponding similarity threshold, 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.
[0074] After obtaining the similarity threshold, determine whether the dynamic adjustment field of the target device that obtains the first image data in the corresponding time period is a designated field; if the dynamic adjustment field is a designated 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. Take the designated 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 designated field, determine the first similarity between the first image data obtained by the target device in the target time period corresponding to the previous time period and the matching face data (second image data), and integrate multiple first similarities by calculating the average value. When the first difference between the average value of the first similarity 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.
[0075] 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, obtaining and determining 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, then creating new archive data, and generating a unique archive id record in the database, and using the id of the first image data as the newly generated archive id to obtain the second data set; if so, then determining the retrieved data, and determining whether the similarity between the first image data and the plurality of second data images is greater than or equal to the similarity threshold: in the case where the similarity between the first image data and the plurality of second image data is greater than or equal to the similarity threshold, triggering the merging of archives (first data sets) corresponding to the plurality of second image data; in the case where the similarity between the first image data and the plurality of second image data is less than the similarity threshold, setting the id of the first image data to the archive id corresponding to the second image data.
[0076] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on 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-mentioned embodiments may include multiple steps or multiple stages, and 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 in turn or alternately with other steps or at least a part of the 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, the step of adjusting the archive in response to the user interaction instruction is executed.
[0077] Based on the same inventive concept, the embodiment of the present application also provides an image processing device for implementing the above-mentioned image processing method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image processing device embodiments provided below can refer to the limitations on the image processing method above, and will not be repeated here.
[0078] In one embodiment, Figure 5 As shown, an image processing device is provided, comprising: a selection module, a calculation module, an adjustment module and a clustering module, wherein: A selection module is used to obtain target image data to be processed, and determine first image data associated with 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; A calculation module, used 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 adjustment module, configured to adjust the similarity threshold based on the first difference value when there is a first difference value corresponding to a specified number of first image data that is greater than or equal to a preset second difference value; 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.
[0079] Optionally, obtaining target image data to be processed includes: obtaining the target image data according to facial features in the image to be recognized.
[0080] In some of the embodiments, the calculation module obtains the first similarity between the first image data and the second image data, and calculates the first difference between the first similarity and the similarity threshold, including: determining the target device for obtaining the target image data; calculating the first similarity between the first image data and the second image data captured by the target device in the first data set; obtaining the first threshold corresponding to the target device, and calculating the first difference between the first similarity and the first threshold. In some of the embodiments, the calculation module obtains the first similarity between the first image data and the second image data, and calculates the first difference between the first similarity and the similarity threshold, including: determining the target time period for obtaining the target image data; calculating the first similarity between the first image data and the second image data captured in the first time period in the first data set; obtaining the second threshold corresponding to the first time period, and calculating the first difference between the first similarity and the second threshold.
[0081] In some of the embodiments, the selection module determines, in the first data set, first image data associated with image information of the target image data based on the target image data to be processed, including: evaluating the quality of the target image data; and when it is assessed that the quality of the target image data meets the evaluation requirements, determining in the first data set first image data associated with image information of the target image data.
[0082] In some of the embodiments, the clustering module updates 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, including: merging multiple first data sets corresponding to the multiple second image data when the second similarity between the target image data and the multiple second image data is greater than or equal to the adjusted similarity threshold; and updating the merged first data set according to the target image data.
[0083] In some of the embodiments, the clustering module is further configured to establish a second data set based on the target image data when a second similarity between the target image data and the second image data is less than an adjusted similarity threshold.
[0084] Each module in the above image processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0085] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. 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. 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 an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image processing method is implemented.
[0086] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0087] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0088] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0089] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0091] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.
[0092] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached 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
Face clustering and archivingmethod and device and storage medium
CN111401300A
Threshold setting method and device in spectral similarity matching classification
CN112418314A
Image processing method and device, image processing equipment and storage medium
CN112633424A
Non-inductive attendance checking method and system based on face recognition
CN113888128A
Face recognition method and device, computer equipment and storage medium
CN117238017A