Face image comparison method, device, electronic device and storage medium
By using the calculation method of weighted comparison related values in the automatic naming system, the error comparison problem caused by manual addition of errors is solved, and the accuracy and robustness of naming are improved.
Patent Information
- Application Number
- CN202111678079.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the existing automatic naming technology, manually adding incorrect image library will lead to incorrect comparison and abnormal naming.
By obtaining the captured image of the object to be identified, the first comparison correlation value of all pre-stored images and the captured image in the image database is calculated, the target image is determined, and the target image collection is obtained based on the identity identification of the target image, the second comparison correlation value of each image and the captured image is calculated, the weighted comparison correlation value of the captured image is calculated using the weighted average coefficient, and the weighted comparison correlation value is compared with the preset threshold value to determine the identity comparison result.
It effectively solves the problem of errors caused by manual addition of errors in comparison images, improves the robustness of image comparison, and ensures the accuracy of the name result.
Smart Images

Figure CN114579786B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic roll call, and in particular, to a face image comparison method, device, electronic device, and storage medium. Background Art
[0002] Currently, in most domestic specific places, it is necessary to confirm the personnel, count the number of people, and summarize the number of people for the roll call objects, and most of them use traditional manual methods for operation. The disadvantage of manual roll call is that it is time-consuming and laborious, and it is easy to have missed reports or misreports. Therefore, there is also an automatic roll call method. When performing roll call comparison, the captured image is compared with the images in the static image library and the comparison image library, and the image with the highest relevant value of the comparison result is selected as the comparison image.
[0003] In the related art, when there are manual addition errors in the comparison images in the comparison image library, it will cause miscomparison, resulting in abnormal roll call situations. Summary of the Invention
[0004] Embodiments of the present invention provide a face image comparison method, device, electronic device, and storage medium, aiming to solve the problems existing in the above background art.
[0005] To solve the above technical problems, the present invention is implemented as follows:
[0006] In a first aspect, an embodiment of the present invention provides a face image comparison method, and the method includes:
[0007] Obtain a captured image of the object to be recognized;
[0008] Calculate the first comparison relevant value between all the pre-stored images in the image database and the captured image, and determine the pre-stored image with the highest first comparison relevant value as the target image;
[0009] According to the identity identifier of the target image, obtain the target image set corresponding to the target image in the image database;
[0010] Calculate the second comparison relevant value between each image in the target image set and the captured image;
[0011] According to the first comparison relevant value, all the second comparison relevant values, and a preset weighted average coefficient, determine the weighted comparison relevant value of the captured image;
[0012] Compare the weighted average relevant value with a preset threshold value to determine the identity comparison result of the object to be recognized.
[0013] Optionally, the step of comparing the weighted average relevant value with a preset threshold value to determine the identity comparison result of the object to be recognized includes:
[0014] If the weighted average comparison related value is greater than a preset threshold value, it is determined that the identity comparison result of the object to be recognized is successful;
[0015] If the weighted average comparison related value is less than a preset threshold value, it is determined that the identity comparison result of the object to be recognized fails.
[0016] Optionally, the step of calculating the first comparison related value between all pre-stored images in the image database and the captured image includes:
[0017] Obtain the first feature vector of the captured image;
[0018] Obtain the second feature vectors of all pre-stored images in the image database;
[0019] Based on the first feature vector and the second feature vectors, calculate the first comparison related value.
[0020] Optionally, the formula for calculating the first comparison related value based on the first feature vector and the second feature vectors is:
[0021]
[0022] In the formula, corr(p,q) is the first comparison related value, CV p (i) is the first feature vector of the captured image, CV q (i) is the second feature vector of each pre-stored image.
[0023] Optionally, the image database includes a static comparison image library and a dynamic comparison image library, and the step of calculating the first comparison related value between all pre-stored images in the image database and the captured image further includes:
[0024] Calculate the first comparison related value between all pre-stored static images in the static comparison image library and the captured image;
[0025] Obtain the set of static images in the static comparison image library whose first comparison related value is greater than a preset threshold;
[0026] Based on the set of static images, determine the corresponding set of dynamic images in the dynamic comparison image library;
[0027] Calculate the first comparison related value between all images in the set of dynamic images and the captured image.
[0028] Optionally, the step of determining the corresponding first set of dynamic images in the dynamic comparison image library based on the set of static images includes:
[0029] Obtain the identity identifier of each static image in the static image collection;
[0030] Based on the preset corresponding relationship, determine the dynamic image corresponding to the identity identifier of each static image in the dynamic comparison image library to obtain a dynamic image collection.
[0031] Optionally, according to the first comparison correlation value of the target image and each of the second comparison correlation values, the formula for calculating the weighted comparison correlation value of the captured image is:
[0032]
[0033] In the formula, corr(p) is the weighted comparison correlation value of the captured image, α is the weighted average coefficient, corr(p,q0) is the first comparison correlation value, is the second comparison correlation value.
[0034] A second aspect of the invention embodiment provides a face image comparison device, and the device includes:
[0035] An acquisition unit, configured to obtain a captured image of an object to be recognized;
[0036] A first calculation module, configured to calculate the first comparison correlation value between all pre-stored images in the image database and the captured image, and determine the pre-stored image with the highest first comparison correlation value as the target image;
[0037] An acquisition module, configured to obtain the target image collection corresponding to the target image in the image database according to the identity identifier of the target image;
[0038] A second calculation module, configured to calculate the second comparison correlation value between each image in the target image collection and the captured image;
[0039] A third calculation module, configured to determine the weighted comparison correlation value of the captured image according to the first comparison correlation value, all the second comparison correlation values, and a preset weighted average coefficient;
[0040] A comparison module, configured to compare the weighted average correlation value with a preset threshold value to determine the identity comparison result of the object to be recognized.
[0041] A third aspect of the invention embodiment provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0042] The memory is used to store a computer program;
[0043] A processor, when executing a program stored in a memory, implements the method steps proposed in the first aspect of the embodiments of the present invention.
[0044] A computer-readable storage medium is proposed in the fourth aspect of the embodiments of the present invention, on which a computer program is stored. When the program is executed by a processor, it implements the method proposed in the first aspect of the embodiments of the present invention.
[0045] The embodiments of the present invention have the following advantages: By obtaining a captured image of an object to be recognized, calculating the first comparison correlation value between all pre-stored images in the image database and the captured image, and determining the pre-stored image with the highest first comparison correlation value as the target image. According to the identity identifier of the target image, obtaining the target image set corresponding to the target image in the image database, calculating the second comparison correlation value between each image in the target image set and the captured image, and determining the weighted comparison correlation value of the captured image according to the first comparison correlation value, all the second comparison correlation values, and a preset weighted average coefficient. Comparing the weighted average correlation value with a preset threshold value to determine the identity comparison result of the object to be recognized. By using all comparison images in the comparison image library as evaluation objects, it effectively solves the problem of false comparison caused by manual addition errors of comparison images and improves the robustness of image comparison. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0047] Figure 1 It is a flowchart of the steps of a face image comparison method in the embodiments of the present invention;
[0048] Figure 2 It is a schematic diagram of the system flow of face image comparison in the embodiments of the present invention;
[0049] Figure 3 It is a schematic diagram of the modules of a face image comparison device in the embodiments of the present invention;
[0050] Figure 4 It is a schematic diagram of the functional modules of an electronic device in the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts shall fall within the protection scope of the present invention.
[0052] An embodiment of the present invention provides a face image comparison method, which is applicable to the application scenario of taking attendance for each user to be recognized. Refer to Figure 1 , Figure 1 which shows a flowchart of the steps of a face image comparison method according to an embodiment of the present invention. The method includes:
[0053] Step S101: Obtain a captured image of the object to be recognized.
[0054] The captured image can be collected by the acquisition terminals installed at various fixed points. During the attendance-taking stage, each acquisition terminal captures the facial images of each object to be recognized walking back and forth, so as to obtain the captured image of the object to be recognized. The acquisition terminal can be various types of image acquisition devices, and can also be an image acquisition device with voice capabilities. The specific type of the acquisition terminal is not limited in this application. After the captured image of the object to be recognized is collected, the real-time captured image is transmitted to the main control unit.
[0055] Step S102: Calculate the first comparison correlation value between all the pre-stored images in the image database and the captured image, and determine the pre-stored image with the highest first comparison correlation value as the target image.
[0056] The image database includes a static comparison image library and a dynamic comparison image library. The static comparison image library is used to store the static images of each object to be recognized. The static images refer to formal photos such as the photos used to identify the identity of each user to be recognized, ID photos, etc. The dynamic comparison image library is used to store the dynamic images of each object to be recognized. The dynamic images refer to the life photos regularly collected for each object to be recognized, which are used to reflect the appearance update status of the object to be recognized. The hairstyles and clothing of the objects to be recognized will change over time. Therefore, it is necessary to regularly update their dynamic images and store them in the dynamic comparison image library to ensure the accuracy of recognition. When the system performs a roll call operation and obtains the captured image of the object to be recognized, calculate the first comparison correlation value with all the photos pre-stored in the image database. The first comparison correlation value is used to reflect the probability that the object to be recognized and the person corresponding to the photo in the image database are the same person. For example, if the first comparison correlation value between the object to be recognized and a certain photo in the image database is 0.9, and the identity identifier corresponding to this photo is "Zhang San". It means that the probability that the object to be recognized is "Zhang San" is 0.9 (1 is the maximum probability value). It should be noted that the first comparison correlation value can only reflect the probability that the object to be recognized and the person corresponding to the photo in the image database are the same person, and only indicates that the higher the probability, the greater the possibility. After all the first comparison correlation values of the photos pre-stored in the image database are calculated, determine the image corresponding to the maximum value of the first comparison correlation value as the target image, that is, the probability that its corresponding image is the object to be recognized is the highest.
[0057] Step S103: According to the identity identifier of the target image, obtain the target image set corresponding to the target image in the image database.
[0058] The identity identifier is used to represent the identity information of the object. The identity identifier can be: name, number used to identify the identity of the user to be recognized, identity number, or a combination of one or more of them. As an example, when the identity identifier is the identity number, folders indexed by the identity number will be created separately in the static comparison image library and the dynamic comparison image library, and static images and dynamic images will be stored separately under these files. When the target image is determined and the identity identifier of the target object is obtained, the static images and dynamic images under the file corresponding to the identity identifier of the target object are taken together as the target image set.
[0059] Step S104: Calculate the second comparison correlation value between each image in the target image set and the captured image.
[0060] When the target image set is determined, calculate the second comparison correlation value between each image in the target image set and the captured image respectively. That is, by evaluating the probability that the person corresponding to each image in the target image set and the captured image is the same person. Thus, a plurality of second comparison correlation values are obtained. Under normal conditions, the images in the target image set are photo images of the object to be recognized. Therefore, the second comparison correlation value is relatively high; in the abnormal state, here it refers to the situation where there is a mistransmission of the photo of the object to be recognized, and the images in the target image set are not photo images of the object to be recognized. Therefore, the second comparison correlation value is relatively low.
[0061] Step S105: Determine the weighted comparison correlation value of the captured image according to the first comparison correlation value, all the second comparison correlation values, and a preset weighted average coefficient.
[0062] After calculating the first comparison correlation value of the target image and a plurality of second comparison correlation values, the weighted comparison correlation value of the captured image can be determined according to a preset formula. Using the weighted comparison correlation value of the captured image can effectively solve the problem of miscomparison caused by manual addition errors of comparison images.
[0063] Step S106: Compare the weighted average correlation value with a preset threshold value to determine the identity comparison result of the object to be recognized.
[0064] After calculating the weighted comparison correlation value of the captured image, use it as a judgment basis to compare with the preset threshold value, and determine the identity comparison result of this roll call task through the comparison result.
[0065] In this embodiment, after receiving the captured image, first compare the captured image with all the images in the comparison image library, and select the comparison image with the highest correlation value as the target image. Then, perform a weighted average on the correlation values between all the comparison images corresponding to the identity identifier of the target image and the captured image to obtain the weighted comparison correlation value. This correlation value is used as the final comparison correlation value for image comparison. By using all the comparison images in the comparison image library as the evaluation object, and taking the correlation degree between the image set corresponding to the comparison image with the highest correlation value and the captured image of the object to be recognized as a reference index, multi-dimensional evaluation is carried out. It effectively solves the problem of miscomparison caused by manual addition errors of comparison images and improves the robustness of image comparison.
[0066] Combined with the steps in the above embodiment, as Figure 2As shown, this embodiment takes the actual execution process of roll call as an example. During the process of daily updating of dynamic photos of users to be recognized, on the premise that the operator mistakenly uploads the photo of person "A" as the photo of person "B". When the roll call operation is executed, the acquisition end or the video acquisition device performs image acquisition. When the facial capture image p of person "B" is captured and transmitted to the main control unit in real time, the main control unit transmits the capture image p to the image analysis unit. The image analysis unit analyzes and processes the capture image p, that is, performs corresponding image preprocessing, and returns the processed data to the main control unit. The main control unit retrieves all the images in the image database and sends them together with the analyzed capture image p to the comparison unit. In the image comparison unit, first calculate the first comparison correlation value between the capture image p and all the images q in the image database. The specific steps are as follows:
[0067] Obtain the first feature vector of the capture image;
[0068] Obtain the second feature vectors of all the pre-stored images in the image database;
[0069] Based on the first feature vector and the second feature vectors, calculate the first comparison correlation value. In this embodiment, obtain the first feature vector CV p =[CV p (1),…,CV p (512)]; The first feature vector is a 512-dimensional array generated from the capture image through a deep learning algorithm. The image database includes a static comparison image library and a dynamically updatable dynamic comparison image library. Each user to be recognized contains one or more comparison images in the image database, and all the image sets in the image database are denoted as where ID1,..., IDN represent the IDs of the comparison objects. The image set P IDn of each ID n contains all the comparison images corresponding to this ID.
[0070] Then determine the first comparison correlation value according to the following formula.
[0071]
[0072] In the formula, corr(p,q) is the first comparison correlation value, CV p (i) is the first feature vector of the capture image, and CV q (i) is the second feature vector of each pre-stored image.
[0073] And take the image q0 corresponding to the maximum value of the first comparison correlation value as the target image.
[0074]
[0075] It should be noted that due to the premise that the operator may accidentally upload the photo of person "A" as the photo of person "B". Therefore, during this process, the photo corresponding to the image q0 is actually the photo of person "B". However, the actual ID and identity information are actually those of person "A". Therefore, there is a mismatch and a problem of incorrect comparison. Therefore, after determining the target image q0, based on the identity identification information of the target image q0, that is, the above ID information, its ID is determined to be m. The set of target images corresponding to this ID is then P Idm , P Idm contains M sub-images. Then, according to the following formula, the second comparison correlation value between each image in the set of target images and the captured image can be determined.
[0076]
[0077] In the formula, M is the number of sub-images in the set of target images, corr(p,q) is the first comparison correlation value, is the second comparison correlation value.
[0078] The sub-images in the set of target images are actually the images of person "A". Therefore, the second comparison correlation value between its captured image p (which is actually the facial captured image of person "B") and the sub-images in the set of target images will be relatively low. After calculating the first comparison correlation value of the target image and multiple second comparison correlation values, the weighted comparison correlation value of the captured image can be determined according to a preset formula
[0079]
[0080] In the formula, corr(p) is the weighted comparison correlation value of the captured image, α is the weighted average coefficient, corr(p,q0) is the first comparison correlation value, is the second comparison correlation value. The typical value is α = 0.6.
[0081] After determining the weighted comparison correlation value of the captured image, the steps of comparing the weighted average correlation value with a preset threshold value to determine the identity comparison result of the object to be recognized include:
[0082] If the weighted average comparison correlation value is greater than the preset threshold value, it is determined that the identity comparison result of the object to be recognized is a success;
[0083] If the weighted average comparison correlation value is less than the preset threshold value, it is determined that the identity comparison result of the object to be recognized is a failure.
[0084] In this embodiment, the weighted average correlation value corr(p) is compared with the decision threshold CORR_THR. If corr(p) > CORR_THR, it is determined that the comparison is successful; otherwise, it is determined that the comparison fails. A typical value of the decision threshold is CORR_THR = 0.8. When there is a problem of photo mistransmission, since the second comparison correlation value between each image in the target image set and the captured image is determined, the second comparison correlation value between the captured object and each image in the target image set is reduced. Through a preset weighting algorithm, the weighted average comparison correlation value is reduced according to the weight. Thus, when there is photo mistransmission, the comparison result shows a failure.
[0085] In a feasible embodiment, the step of calculating the first comparison correlation value between all pre-stored images in the image database and the captured image further includes:
[0086] Calculating the first comparison correlation value between all pre-stored static images in the static comparison image library and the captured image;
[0087] Obtaining a set of static images in the static comparison image library whose first comparison correlation value is greater than a preset threshold;
[0088] Based on the set of static images, determining a corresponding set of dynamic images in the dynamic comparison image library;
[0089] Calculating the first comparison correlation value between all images in the set of dynamic images and the captured image.
[0090] In this embodiment, when calculating the first comparison correlation value between all pre-stored images in the image database and the captured image, if the data volume in the image database is too large, it will lead to an excessive amount of calculation and a long calculation time. When the data volume in the image database is too large, the captured image can be compared with all pre-stored static images in the static comparison image library, and a set of static images that meet the preset threshold can be selected according to the first comparison correlation value. The threshold can be adjusted manually. That is, the set of static images is actually a preliminary screening of the captured image. By comparing with the images in the static comparison image library with a smaller data volume, a set of static images that are more similar to the object to be recognized is selected. Then, based on the set of static images, the corresponding set of dynamic images in the corresponding dynamic comparison image library is determined. Next, the first comparison correlation value between all images in the set of dynamic images and the captured image is calculated, and the dynamic image with the highest first comparison correlation value is determined as the target image. Through such a screening method, the target image can be quickly confirmed when there is a large amount of data in the image database, reducing the calculation amount of the system.
[0091] In a feasible embodiment, the step of determining the corresponding first set of dynamic images in the dynamic comparison image library based on the set of static images includes:
[0092] Obtain the identity identifier of each static image in the static image collection;
[0093] Based on a preset correspondence relationship, determine the dynamic image corresponding to the identity identifier of each static image in the dynamic comparison image library to obtain a dynamic image collection.
[0094] In this embodiment, in the static comparison image library, the ID is used as the file name, and the corresponding static image is stored in the folder. Similarly, in the dynamic comparison image library, the ID is used as the file name, and the corresponding dynamic image is stored in the folder. Obtain the identity ID of each static image in the static image collection. Correspondingly, according to the identity ID, obtain the dynamic image in the folder with the same name ID in the dynamic comparison image library, so as to obtain a dynamic image collection.
[0095] The embodiment of the present invention also provides a face image comparison device. Refer to Figure 3 , which shows the functional module diagram of the face image comparison device of the present invention. The device may include the following modules:
[0096] The acquisition module 301 is used to obtain the captured image of the object to be recognized;
[0097] The first calculation module 302 is used to calculate the first comparison correlation value between all the pre-stored images in the image database and the captured image, and determine the pre-stored image with the highest first comparison correlation value as the target image;
[0098] The acquisition module 303 is used to obtain the target image collection corresponding to the target image in the image database according to the identity identifier of the target image;
[0099] The second calculation module 304 is used to calculate the second comparison correlation value between each image in the target image collection and the captured image;
[0100] The third calculation module 305 is used to determine the weighted comparison correlation value of the captured image according to the first comparison correlation value, all the second comparison correlation values, and a preset weighted average coefficient;
[0101] The comparison module 306 is used to compare the weighted average correlation value with a preset threshold value to determine the identity comparison result of the object to be recognized.
[0102] In a feasible embodiment, the comparison module 306 includes:
[0103] The first judgment sub-module is used to determine that the identity comparison result of the object to be recognized is successful if the weighted average comparison correlation value is greater than the preset threshold value;
[0104] A second judgment sub-module, configured to determine that the identity comparison result of the object to be recognized fails if the weighted average comparison correlation value is less than a preset threshold value.
[0105] In a feasible implementation manner, the first calculation module 302 includes:
[0106] A first acquisition sub-module, configured to acquire a first feature vector of the captured image;
[0107] A second acquisition sub-module, configured to acquire second feature vectors of all pre-stored images in the image database;
[0108] A calculation sub-module, configured to calculate a first comparison correlation value based on the first feature vector and the second feature vector.
[0109] In a feasible implementation manner, the first calculation module 302 further includes:
[0110] A first calculation sub-module, configured to calculate a first comparison correlation value between all pre-stored static images in the static comparison image library and the captured image;
[0111] A first acquisition sub-module, configured to acquire a set of static images in the static comparison image library whose first comparison correlation value is greater than a preset threshold;
[0112] A first determination sub-module, configured to determine a corresponding set of dynamic images in the dynamic comparison image library based on the set of static images;
[0113] A second calculation sub-module, configured to calculate a first comparison correlation value between all images in the set of dynamic images and the captured image.
[0114] In a feasible implementation manner, the first determination sub-module includes:
[0115] An identification acquisition unit, configured to acquire an identity identification of each static image in the set of static images;
[0116] An image acquisition unit, configured to determine, in the dynamic comparison image library, a dynamic image corresponding to the identity identification of each static image based on a preset corresponding relationship, to obtain a set of dynamic images.
[0117] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, as Figure 4 shown, including a processor 41, a communication interface 42, a memory 43, and a communication bus 44, where the processor 41, the communication interface 42, and the memory 43 complete mutual communication through the communication bus 44,
[0118] The memory 43 is configured to store a computer program;
[0119] The processor 41 is configured to implement the steps of the first aspect of the embodiments of the present invention when executing the programs stored in the memory 43.
[0120] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0121] The communication interface is used for communication between the above terminal and other devices.
[0122] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0123] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0124] In another embodiment provided by the present invention, a computer-readable storage medium is also provided. Instructions are stored in the computer-readable storage medium, and when executed on a computer, the computer is caused to execute any one of the face image comparison methods in the above embodiments.
[0125] Those skilled in the art should understand that the embodiments of the present invention may be provided as a method, an apparatus, or a computer program product. Therefore, the embodiments of the present invention may take the form of an all-hardware embodiment, an all-software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0126] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (apparatuses), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0127] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal devices to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal devices, such that a series of operation steps are executed on the computer or other programmable terminal devices to generate a computer-implemented process, so that the instructions executed on the computer or other programmable terminal devices provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks or the combination of blocks.
[0129] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. "And / or" means that either one of the two can be selected, or both can be selected. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the said element.
[0130] The above has introduced in detail a face image comparison method, device, electronic device and storage medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A face image comparison method, characterized in that, The method includes: Obtaining a captured image of an object to be recognized; Calculating a first comparison correlation value between all pre-stored images in the image database and the captured image, and determining the pre-stored image with the highest first comparison correlation value as the target image; According to the identity identifier of the target image, obtaining a target image set corresponding to the target image in the image database; Calculating a second comparison correlation value between each image in the target image set and the captured image; Determining a weighted comparison correlation value of the captured image according to the first comparison correlation value, all the second comparison correlation values, and a preset weighted average coefficient; Comparing the weighted comparison correlation value with a preset threshold value to determine an identity comparison result of the object to be recognized; Wherein, the image database includes a static comparison image library and a dynamic comparison image library. The step of calculating a first comparison correlation value between all pre-stored images in the image database and the captured image, and determining the pre-stored image with the highest first comparison correlation value as the target image includes: Calculating a first comparison correlation value between all pre-stored static images in the static comparison image library and the captured image; Obtaining a set of static images in the static comparison image library whose first comparison correlation value is greater than a preset threshold value; Obtaining the identity identifier of each static image in the set of static images; Based on a preset correspondence relationship, determining a dynamic image corresponding to the identity identifier of each static image in the dynamic comparison image library to obtain a set of dynamic images; Calculating a first comparison correlation value between all images in the set of dynamic images and the captured image; Determining the dynamic image with the highest first comparison correlation value as the target image.
2. The method according to claim 1, wherein The step of comparing the weighted comparison correlation value with a preset threshold value to determine an identity comparison result of the object to be recognized includes: If the weighted average comparison correlation value is greater than the preset threshold value, determining that the identity comparison result of the object to be recognized is successful; If the weighted average comparison correlation value is less than the preset threshold value, determining that the identity comparison result of the object to be recognized fails.
3. The method according to claim 1, characterized in that, The step of calculating a first comparison correlation value between all pre-stored images in the image database and the captured image includes: Obtaining a first feature vector of the captured image; Obtaining second feature vectors of all pre-stored images in the image database; Calculating a first comparison correlation value based on the first feature vector and the second feature vectors.
4. The method according to claim 3, wherein The formula for calculating a first comparison correlation value based on the first feature vector and the second feature vectors is: Wherein, corr(p, q) is the first comparison correlation value, and CV p (i) is the first feature vector of the captured image, and CV q (i) is the second feature vector of each pre-stored image.
5. The method according to claim 1, wherein The formula for calculating the weighted comparison correlation value of the captured image according to the first comparison correlation value of the target image and each of the second comparison correlation values is: Wherein, corr(p) is the correlation value of weighted comparison of the captured image, α is the weighted average coefficient, and corr(p,q0) is the first comparison correlation value, and it is the second comparison correlation value.
6. A face image comparison device, characterized in that, The device includes: A collection unit for obtaining a captured image of an object to be recognized; A first calculation module for calculating a first comparison correlation value between all pre-stored images in the image database and the captured image, and determining the pre-stored image with the highest first comparison correlation value as the target image; An acquisition module for obtaining a target image set corresponding to the target image in the image database according to the identity identifier of the target image; A second calculation module, configured to calculate a second comparison correlation value between each image in the target image set and the captured image; A third calculation module, configured to determine a weighted comparison correlation value of the captured image according to the first comparison correlation value, all the second comparison correlation values, and a preset weighted average coefficient; A comparison module, configured to compare the weighted comparison correlation value with a preset threshold value to determine an identity comparison result of the object to be identified; Wherein, the image database includes a static comparison image library and a dynamic comparison image library, and the first calculation module includes: A first calculation sub-module, configured to calculate a first comparison correlation value between all pre-stored static images in the static comparison image library and the captured image; A first acquisition sub-module, configured to acquire a set of static images in the static comparison image library whose first comparison correlation value is greater than a preset threshold; An identity acquisition unit, configured to acquire an identity identifier of each static image in the set of static images; An image acquisition unit, configured to determine, based on a preset correspondence relationship, a dynamic image corresponding to the identity identifier of each static image in the dynamic comparison image library to obtain a set of dynamic images; Calculate a first comparison correlation value between all images in the set of dynamic images and the captured image; The first calculation module is further configured to determine the dynamic image with the highest first comparison correlation value as the target image.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store a computer program; The processor is configured to implement the method steps described in any one of claims 1-5 when executing the program stored on the memory.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1-5.
Citation Information
Patent Citations
Loan approval method and system based on face recognition
CN110009481A
Face recognition method and device, electronic equipment and storage medium
CN113762106A