Face Recognition Method and Device
By optimizing the face recognition method, the encryption of key face areas and the transmission of completed pictures in the existing technology is solved, and the efficiency and security of face recognition are improved.
Patent Information
- Application Number
- CN202011637996.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2040-12-31
AI Technical Summary
In order to improve security protection capabilities in the process of facial recognition, the existing technology requires encrypting and decrypting the entire face image, resulting in an increase in time and reducing the efficiency of facial recognition.
A face recognition method is proposed, which is to locate the face area of the recognized image, intercept the key face area pictures and encrypt it, send encrypted information and completed single face pictures for face recognition, and restore the complete picture to recognize after decryption.
By obtaining pictures of key areas of faces and encrypting them, the security of information transmission during face recognition is improved, and the time-consuming consumption of encryption and decryption is reduced, and the efficiency of face recognition is improved.
Smart Images

Figure CN112633240B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and particularly to a face recognition method and device. Background Art
[0002] At present, face recognition technology has been widely applied to scenarios such as offline face payment, in-person identity verification at the counter, access control, and attendance.
[0003] With the wide use of face recognition technology, there are criminals stealing face information or attacking the face recognition process. In the prior art, in order to prevent hackers from forging, tampering with, or stealing face picture information, when collecting face pictures, the entire face picture is encrypted to achieve end-to-end transmission encryption of the face picture during face recognition, improving the security protection ability of the face recognition process and ensuring the security of face recognition data. However, since the entire face picture is encrypted, when performing face recognition on the server side, it is necessary to decrypt the entire face picture accordingly, which will increase the time consumption of the face recognition process and reduce the efficiency of face recognition. Summary of the Invention
[0004] In view of the problems in the prior art, embodiments of the present invention provide a face recognition method and device, which can at least partially solve the problems existing in the prior art.
[0005] In a first aspect, the present invention proposes a face recognition method, including:
[0006] Obtain a picture to be recognized;
[0007] Locate the face area in the picture to be recognized to obtain a single face picture;
[0008] Perform an interception operation on the single face picture to obtain a face key area picture and coordinate information, and perform a complement operation on the intercepted single face picture to obtain a complemented single face picture;
[0009] Encrypt the face key area picture to obtain face encryption information;
[0010] Send a face recognition request for face recognition, where the face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture.
[0011] In a second aspect, the present invention further provides a face recognition method, including:
[0012] Receive a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a complemented single face picture;
[0013] Decrypt the face encryption information to obtain a face key area picture;
[0014] Restore a single face image based on the face key area image, the coordinate information, and the completed single face image;
[0015] Perform face recognition on the single face image to obtain a face recognition result.
[0016] In a third aspect, the present invention provides a face recognition device, including:
[0017] An acquisition unit for acquiring an image to be recognized;
[0018] A positioning unit for positioning the face area of the image to be recognized to obtain a single face image;
[0019] A cropping unit for cropping the single face image to obtain a face key area image and coordinate information, and performing a completion operation on the cropped single face image to obtain a completed single face image;
[0020] An encryption unit for encrypting the face key area image to obtain face encryption information;
[0021] A sending unit for sending a face recognition request for face recognition, the face recognition request including the face encryption information, the coordinate information, and the completed single face image.
[0022] In a fourth aspect, the present invention further provides a face recognition device, including:
[0023] A receiving unit for receiving a face recognition request, the face recognition request including face encryption information, coordinate information, and a completed single face image;
[0024] A decryption unit for decrypting the face encryption information to obtain a face key area image;
[0025] A restoration unit for restoring a single face image based on the face key area image, the coordinate information, and the completed single face image;
[0026] An identification unit for performing face recognition on the single face image to obtain a face recognition result.
[0027] In a fifth aspect, the present invention provides an electronic device, including a first memory, a first processor, and a first computer program stored on the first memory and executable on the first processor. When the first processor executes the first computer program, the following face recognition method is implemented:
[0028] Obtain an image to be recognized;
[0029] Locate the face region of the image to be recognized to obtain a single face image;
[0030] Perform a cropping operation on the single face image to obtain a face key region image and coordinate information, and perform a completion operation on the cropped single face image to obtain a completed single face image;
[0031] Encrypt the face key region image to obtain face encryption information;
[0032] Send a face recognition request for face recognition. The face recognition request includes the face encryption information, the coordinate information, and the completed single face image.
[0033] In a sixth aspect, the present invention provides a computer-readable storage medium, on which a first computer program is stored. When the first computer program is executed by a first processor, the following face recognition method is implemented:
[0034] Obtain an image to be recognized;
[0035] Locate the face region of the image to be recognized to obtain a single face image;
[0036] Perform a cropping operation on the single face image to obtain a face key region image and coordinate information, and perform a completion operation on the cropped single face image to obtain a completed single face image;
[0037] Encrypt the face key region image to obtain face encryption information;
[0038] Send a face recognition request for face recognition. The face recognition request includes the face encryption information, the coordinate information, and the completed single face image.
[0039] In a seventh aspect, the present invention further provides an electronic device, including a second memory, a second processor, and a second computer program stored on the second memory and executable on the second processor. When the second processor executes the second computer program, the following face recognition method is implemented:
[0040] Receive a face recognition request, the face recognition request including face encryption information, coordinate information, and a completed single face image;
[0041] Decrypt the face encryption information to obtain a face key region image;
[0042] Restore a single face image according to the face key region image, the coordinate information, and the completed single face image;
[0043] Perform face recognition on the single face image to obtain a face recognition result.
[0044] In an eighth aspect, the present invention further provides a computer-readable storage medium, on which a second computer program is stored. When the second computer program is executed by a second processor, the following face recognition method is implemented:
[0045] Receive a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a single completed face image;
[0046] Decrypt the face encryption information to obtain a face key area image;
[0047] Restore a single face image according to the face key area image, the coordinate information, and the single completed face image;
[0048] Perform face recognition on the single face image to obtain a face recognition result.
[0049] The face recognition method and device provided by the embodiments of the present invention obtain an image to be recognized, perform face area positioning on the image to be recognized to obtain a single face image, perform a cropping operation on the single face image to obtain a face key area image and coordinate information, perform a completion operation on the cropped single face image to obtain a completed single face image, encrypt the face key area image to obtain face encryption information, and send a face recognition request. By obtaining and encrypting the face key area image, the security of information transmission during face recognition can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] 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 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 be obtained based on these drawings. In the drawings:
[0051] Figure 1 is a schematic structural diagram of a face recognition processing system provided by the first embodiment of the present invention.
[0052] Figure 2 is a schematic flowchart of a face recognition method provided by the second embodiment of the present invention.
[0053] Figure 3 is a schematic flowchart of a face recognition method provided by the third embodiment of the present invention.
[0054] Figure 4 is a schematic flowchart of a face recognition method provided by the fourth embodiment of the present invention.
[0055] Figure 5 It is a schematic flowchart of the face recognition method provided by the fifth embodiment of the present invention.
[0056] Figure 6 It is a schematic flowchart of the face recognition method provided by the sixth embodiment of the present invention.
[0057] Figure 7 It is a schematic flowchart of the face recognition method provided by the seventh embodiment of the present invention.
[0058] Figure 8 It is a schematic flowchart of the face recognition method provided by the eighth embodiment of the present invention.
[0059] Figure 9 It is a schematic flowchart of the face recognition method provided by the ninth embodiment of the present invention.
[0060] Figure 10 It is a schematic flowchart of the process of locating the face area in the picture to be recognized provided by the tenth embodiment of the present invention.
[0061] Figure 11 It is a schematic flowchart of the process of encrypting the picture of the key face area provided by the eleventh embodiment of the present invention.
[0062] Figure 12 It is a schematic flowchart of the face recognition method provided by the twelfth embodiment of the present invention.
[0063] Figure 13 It is a schematic flowchart of the process of decrypting the face encryption information provided by the thirteenth embodiment of the present invention.
[0064] Figure 14 It is a schematic structural diagram of the face recognition device provided by the fourteenth embodiment of the present invention.
[0065] Figure 15 It is a schematic structural diagram of the face recognition device provided by the fifteenth embodiment of the present invention.
[0066] Figure 16 It is a schematic physical structure diagram of the electronic device provided by the sixteenth embodiment of the present invention.
[0067] Figure 17 It is a schematic physical structure diagram of the electronic device provided by the seventeenth embodiment of the present invention. Detailed implementation manners
[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear and understandable, the following further elaborates on the embodiments of the present invention in conjunction with the accompanying drawings. Herein, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but not to limit the present invention. It should be noted that, without conflict, the embodiments in this application and the features in the embodiments can be arbitrarily combined with each other.
[0069] Figure 1 is a schematic structural diagram of a face recognition processing system provided by the first embodiment of the present invention. As Figure 1 shown, the face recognition processing system provided by the embodiments of the present invention includes a face acquisition terminal 1 and an identification server 2, where:
[0070] The face acquisition terminal 1 is communicatively connected to the identification server 2; among them, the face acquisition terminal 1 can obtain the picture to be recognized in real time through a camera or obtain the picture to be recognized from a video, which is set according to the actual situation and is not limited in the embodiments of the present invention. The face acquisition terminal 1 includes, but is not limited to, devices such as bank self-service terminals and desktop computers.
[0071] The face acquisition terminal 1 is used to process the picture to be recognized, obtain face encryption information, coordinate information, and a single completed face picture, and carry the face encryption information, the coordinate information, and the completed single face picture in a face recognition request and send it to the identification server 2.
[0072] The identification server 2 receives the face recognition request, decrypts the face encryption information, restores a single face picture and performs face recognition to obtain a face recognition result. The identification server 2 can return the face recognition result to the face acquisition terminal 1.
[0073] Figure 2 is a schematic flowchart of a face recognition method provided by the second embodiment of the present invention. As Figure 2 shown, the face recognition method provided by the embodiments of the present invention includes:
[0074] S201. Obtain a picture to be recognized;
[0075] Specifically, the face acquisition terminal can obtain the picture to be recognized. Among them, the picture to be recognized can be collected in real time by the face acquisition terminal through a camera or obtained by the face acquisition terminal from a video, which is set according to actual needs and is not limited in the embodiments of the present invention. Among them, the execution subject of the face recognition method provided by the embodiments of the present invention includes, but is not limited to, the face acquisition terminal.
[0076] For example, when a customer goes to a self-service device at a bank branch to handle business, the self-service device can collect the customer's face picture in real time through a camera as the picture to be recognized.
[0077] For example, when it is necessary to perform face recognition on a certain person who appears in the surveillance video, a frame of picture including the face of the above-mentioned person can be obtained from the surveillance video as the picture to be recognized.
[0078] S202. Locate the face area of the picture to be recognized to obtain a single face picture;
[0079] Specifically, after obtaining the picture to be recognized, the face acquisition terminal can locate the face area of the picture to be recognized and obtain a single face picture from it. It can be understood that if the face acquisition terminal fails to obtain a single face picture, then the face recognition ends.
[0080] S203. Perform a cropping operation on the single face picture to obtain a face key area picture and coordinate information, and perform a filling operation on the cropped single face picture to obtain a filled single face picture;
[0081] Specifically, after obtaining the single face picture, the face acquisition terminal performs a cropping operation on the single face picture to obtain a face key area picture and records the coordinates of the face key area picture on the single face picture as the coordinate information of the face key area picture. The coordinate information is used for subsequent restoration of the single face picture. After cropping the face key area picture, the face acquisition terminal performs a filling operation on the cropped single face picture, that is, fills the area where the original face key area picture was located on the cropped single face picture with color to make the cropped single face picture complete and obtains a filled single face picture. Among them, the face key area picture is the area in the single face picture that can affect face recognition. Without the face key area picture, face information cannot be recognized.
[0082] S204. Encrypt the face key area picture to obtain face encryption information;
[0083] Specifically, after obtaining the face key area picture, the face acquisition terminal encrypts the face key area picture to obtain face encryption information. Among them, the encryption method used to encrypt the face key area picture is set according to actual needs, and the embodiments of the present invention do not make limitations.
[0084] S205. Send a face recognition request to perform face recognition. The face recognition request includes the face encryption information, the coordinate information, and the filled single face picture.
[0085] Specifically, after obtaining the face encryption information, the face collection terminal may send a face recognition request to the server. The face recognition request may include the face encryption information, the coordinate information, and the completed single-face picture. After receiving the face recognition request, the server will perform face recognition processing to obtain a face recognition result. The server may return the face recognition result to the face collection terminal.
[0086] For example, the face collection terminal may send the face recognition request to the application background server, and then the application background server sends it to the recognition server. The recognition server performs face recognition based on the face encryption information, the coordinate information, and the completed single-face picture.
[0087] For example, the face collection terminal may directly send the face recognition request to the recognition server. The recognition server performs face recognition based on the face encryption information, the coordinate information, and the completed single-face picture.
[0088] The face recognition method provided by the embodiments of the present invention obtains a picture to be recognized, locates the face area of the picture to be recognized to obtain a single-face picture, performs a cropping operation on the single-face picture to obtain a face key area picture and coordinate information, performs a completion operation on the cropped single-face picture to obtain a completed single-face picture, encrypts the face key area picture to obtain face encryption information, and sends a face recognition request. By obtaining and encrypting the face key area picture, the security of information transmission during face recognition can be improved. In addition, since there is no need to encrypt the entire face picture, while improving the security of information transmission, the time-consuming of encryption and decryption is reduced, thereby improving the efficiency of face recognition.
[0089] Based on the above embodiments, further, the performing a cropping operation on the single-face picture to obtain a face key area picture and coordinate information includes:
[0090] Taking the center of the single-face picture as the center, obtaining a partial area of the single-face picture as the face key area picture; wherein, the partial area is a polygonal area.
[0091] Specifically, when the face collection terminal performs a cropping operation on the single-face picture, it may take the center of the single-face picture as the center and crop a partial area of the single-face picture as the face key area picture. The above partial area may be a polygonal area or a circular area. Among them, the size of the partial area is set according to actual needs, and the embodiments of the present invention do not make limitations.
[0092] Based on the above embodiments, further, the polygonal region is a rectangular region, the length of the rectangular region is 1 / 3 to 1 / 2 of the length of the single face picture, and the width of the rectangular region is 1 / 3 to 1 / 2 of the width of the single face picture.
[0093] For example, the face acquisition terminal takes the center of the single face picture as the center, takes half of the length of the single face picture as the length of the rectangular region, and takes half of the width of the single face picture as the width of the rectangular region, and intercepts a rectangular region from the single face picture as the face key region picture.
[0094] Figure 3 It is a schematic flowchart of the face recognition method provided by the third embodiment of the present invention. As Figure 3 shown, based on the above embodiments, further, the encrypting the face key region picture to obtain face encryption information includes:
[0095] S2041. Randomly generate a symmetric encryption key, and use the symmetric encryption key to encrypt the face key region picture to obtain a first ciphertext;
[0096] Specifically, for encrypting the face key region picture, the face acquisition terminal can randomly generate a symmetric encryption key and use the symmetric encryption key to encrypt the face key region picture to obtain a first ciphertext. Among them, the algorithm for generating the symmetric encryption key is set according to actual needs, and the embodiments of the present invention do not make limitations.
[0097] S2042. Use the asymmetric encryption public key to encrypt the symmetric encryption key to obtain a second ciphertext;
[0098] Specifically, the face acquisition terminal uses the asymmetric encryption public key to encrypt the symmetric encryption key to obtain a second ciphertext. Among them, the asymmetric encryption public key is preset. It can be understood that there is no sequential relationship between step S2041 and step S2042, and step S2041 can be executed first or step S2042 can be executed first.
[0099] S2043. Use the first ciphertext, the second ciphertext, and the asymmetric encryption public key as the face encryption information.
[0100] Specifically, after the face acquisition terminal obtains the first ciphertext and the second ciphertext, it uses the first ciphertext, the second ciphertext, and the asymmetric encryption public key as the face encryption information.
[0101] Figure 4 It is a schematic flowchart of the face recognition method provided by the fourth embodiment of the present invention. As Figure 4As shown, on the basis of the above embodiments, further, the method for locating a face region in the to-be-recognized picture to obtain a single face region picture includes:
[0102] S401. Locate all face regions and their respective position information in the to-be-recognized picture through a face location algorithm;
[0103] Specifically, the face acquisition terminal can locate all face regions and their respective position information in the to-be-recognized picture through a face location algorithm. It can be understood that if the face acquisition terminal does not detect face information in the to-be-recognized picture through the face location algorithm, subsequent face recognition processing will not be performed, and it can be prompted that there is no face information in the to-be-recognized picture. Among them, the face location algorithm is selected according to actual needs, and the embodiments of the present invention do not make limitations. The position information indicates the position of the corresponding face region in the to-be-recognized picture.
[0104] For example, the face region is a rectangular region, and the coordinates of the upper left corner of the rectangular region and the length and width of the rectangular region can be used as the position information corresponding to the rectangular region.
[0105] S402. If it is known that there is only one face region, obtain the single face picture based on the position information of the face region.
[0106] Specifically, if the face acquisition terminal knows that there is only one face region, that is, only one face region is detected through the face location algorithm, then the single face picture can be obtained based on the position information of the face region, that is, the picture of the face region in the to-be-recognized picture is used as the single face picture.
[0107] Figure 5 is a schematic flowchart of the face recognition method provided in the fifth embodiment of the present invention. As Figure 5 shown, on the basis of the above embodiments, further, the method for locating a face region in the to-be-recognized picture to obtain a single face region picture includes:
[0108] S501. Locate all face regions in the to-be-recognized picture through a face location algorithm;
[0109] Specifically, the face acquisition terminal can locate all face regions and their respective position information in the to-be-recognized picture through a face location algorithm. Among them, the specific implementation process of this step is similar to that of step S401, and will not be elaborated here.
[0110] S502. If it is known that there are N face regions and a preset parameter is enabled, then based on the position information of the largest face region among the N face regions, the single face picture is obtained; where N is a positive integer greater than or equal to 2.
[0111] Specifically, if the face acquisition terminal knows that there are N face regions and the preset parameter is enabled, then it can calculate the size of each face region among the N face regions, obtain the largest face region through comparison, and then based on the position information of the largest face region among the N face regions, obtain the single face picture. Where N is a positive integer and N is greater than or equal to 2. The preset parameter is preset and used to indicate the judgment of the largest face region.
[0112] Figure 6 It is a schematic flowchart of the face recognition method provided by the sixth embodiment of the present invention. As Figure 6 shown, on the basis of the above embodiments, further, the obtaining of the single face region picture by performing face region positioning on the picture to be recognized includes:
[0113] S601. Locate all face regions and their respective position information in the picture to be recognized through a face positioning algorithm;
[0114] Specifically, the face acquisition terminal can locate all face regions and their respective position information in the picture to be recognized through a face positioning algorithm. Among them, the specific implementation process of this step is similar to that of step S401, and will not be elaborated here.
[0115] S602. If it is known that there are N face regions and the preset parameter is not enabled, then according to the position information of each face region among the N face regions and the centered face judgment rule, determine the face region that satisfies the centered face judgment rule; where N is a positive integer greater than or equal to 2;
[0116] Specifically, if the face acquisition terminal knows that there are N face regions and the preset parameter is not enabled, then it can judge whether there is a face region that satisfies the centered face judgment rule according to the position information of each face region among the N face regions and the centered face judgment rule. If there is a face region that satisfies the centered face judgment rule, then the face region that satisfies the centered face judgment rule can be determined. Among them, the centered face judgment rule is used to determine a face region that is closest to the geometric center of gravity of the picture to be recognized from the N face regions, and is set according to actual needs, which is not limited in the embodiments of the present invention. N is a positive integer greater than or equal to 2.
[0117] For example, the rule for judging the centered face is to obtain the minimum distance between the geometric center of gravity of each face region and the geometric center of gravity of the image to be recognized, and the above minimum distance is less than a preset value. The face acquisition terminal can obtain the geometric center of gravity coordinates of each face region according to the position information of each face region in the N face regions, then calculate the distance between the geometric center of gravity coordinates of each face region and the geometric center of gravity of the image to be recognized, obtain the minimum distance from the N distances, and then compare the above minimum distance with the preset value. If the minimum distance is less than the preset value, then the face region corresponding to the above minimum distance is used as the face region that meets the centered face judgment rule. Among them, the preset value is set according to actual experience and is not limited in the embodiments of the present invention.
[0118] S603. Obtain the single-face image according to the position information of the face region that meets the centered face judgment rule.
[0119] Specifically, when the face acquisition terminal obtains the face region that meets the centered face judgment rule, it can obtain the single-face image according to the position information of the face region that meets the centered face judgment rule.
[0120] Based on the above embodiments, further, the obtaining of the single-face region image by performing face region positioning on the image to be recognized includes:
[0121] If each face region in the N face regions does not meet the centered face judgment rule, then obtain the single-face image based on the position information of the largest face region in the N face regions.
[0122] Specifically, if the face acquisition terminal knows that there are N face regions and the preset parameter is not enabled, then it can judge whether there is a face region that meets the centered face judgment rule according to the position information of each face region in the N face regions and the centered face judgment rule. If there is no face region that meets the centered face judgment rule, then it can calculate the size of each face region in the N face regions, obtain the largest face region through comparison, and then obtain the single-face image based on the position information of the largest face region in the N face regions.
[0123] For example, the rule for judging the centered face is to obtain the minimum distance between the geometric center of gravity of each face region and the geometric center of gravity of the picture to be recognized, and the above minimum distance is less than a preset value. The face acquisition terminal can obtain the geometric center of gravity coordinates of each face region according to the position information of each face region in the N face regions, then calculate the distance between the geometric center of gravity coordinates of each face region and the geometric center of gravity of the picture to be recognized, obtain the minimum distance from the N distances, and then compare the above minimum distance with the preset value. If the minimum distance is greater than or equal to the preset value, then each face region in the N face regions does not meet the centered face judgment rule. The face acquisition terminal can calculate the size of each face region in the N face regions, obtain the largest face region through comparison, and then obtain the single face picture based on the position information of the largest face region in the N face regions.
[0124] Based on the above embodiments, further, the operation of complementing the intercepted single face picture includes:
[0125] Add a solid color to the area of the original face key area picture on the intercepted single face picture to make the intercepted single face picture complete.
[0126] Specifically, after the face acquisition terminal intercepts the face key area picture from the single face picture, it can add a solid color to the area of the original face key area picture on the intercepted single face picture to make the intercepted single face picture complete, so as to avoid information errors of the intercepted single face picture caused by the incompleteness of the intercepted single face picture. Among them, the solid color is, for example, black, which is set according to actual needs and is not limited in the embodiments of the present invention.
[0127] Figure 7 It is a schematic flowchart of the face recognition method provided by the seventh embodiment of the present invention. As Figure 7 shown, the face recognition method provided by the embodiments of the present invention includes:
[0128] S701. Receive a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a complemented single face picture;
[0129] Specifically, the face acquisition terminal can send a face recognition request to the recognition server, and the face recognition request includes face encryption information, coordinate information, and a complemented single face picture. The recognition server will receive the face recognition request. Among them, the coordinate information indicates the position of the face key area picture in the single face picture.
[0130] S702. Decrypt the face encryption information to obtain a face key area picture;
[0131] Specifically, after receiving the face encryption information, the recognition server decrypts the face encryption information to obtain the face key area picture.
[0132] S703. Restore a single face picture according to the face key area picture, the coordinate information, and the completed single face picture;
[0133] Specifically, after obtaining the face key area picture, the recognition server can obtain a single face picture according to the face key area picture, the coordinate information, and the completed single face picture, that is, place the face key area picture into the completed single face picture according to the coordinate information to form a complete single face picture.
[0134] S704. Perform face recognition on the single face picture to obtain a face recognition result.
[0135] Specifically, after obtaining the single face picture, the recognition server can perform face recognition on the single face picture by using face recognition technology to obtain a face recognition result. The recognition server can return the face recognition result to the face collection terminal. Among them, the face recognition technology is selected according to the actual situation, and the embodiments of the present invention do not make any limitations.
[0136] The face recognition method provided by the embodiments of the present invention can receive a face recognition request, decrypt the face encryption information to obtain a face key area picture, restore a single face picture according to the face key area picture, the coordinate information, and the completed single face picture, perform face recognition on the single face picture to obtain a face recognition result, and can reduce the decryption time consumed due to face picture encryption, and improve the face recognition efficiency while ensuring the security of information transmission.
[0137] Figure 8 is a schematic flowchart of the face recognition method provided by the eighth embodiment of the present invention. As Figure 8 shown, on the basis of the above embodiments, further, the face encryption information includes a first ciphertext, a second ciphertext, and an asymmetric encryption public key; correspondingly, the decrypting the face encryption information to obtain a face key area picture includes:
[0138] S7021. Obtain the corresponding asymmetric encryption private key according to the asymmetric encryption public key;
[0139] Specifically, the face encryption information includes a first ciphertext, a second ciphertext, and an asymmetric encryption public key. The recognition server can query and obtain the asymmetric encryption private key corresponding to the asymmetric encryption public key according to the asymmetric encryption public key. Among them, the asymmetric encryption private key is pre-stored and corresponds to the asymmetric encryption public key.
[0140] S7022. Decrypt the second ciphertext according to the asymmetric encryption private key to obtain a symmetric encryption key;
[0141] Specifically, after obtaining the asymmetric encryption private key, the recognition server decrypts the second ciphertext according to the asymmetric encryption private key and can obtain a symmetric encryption key.
[0142] S7023. Decrypt the first ciphertext according to the symmetric encryption key to obtain the face key area picture.
[0143] Specifically, after obtaining the symmetric encryption key, the recognition server can decrypt the first ciphertext according to the symmetric encryption key to obtain the face key area picture.
[0144] Figure 9 is a schematic flowchart of the face recognition method provided by the ninth embodiment of the present invention. As Figure 9 shown, the flowchart of the face recognition method provided by the embodiment of the present invention is as follows:
[0145] The first step: Obtain a picture to be recognized. The face acquisition terminal can acquire a picture to be recognized in real time or obtain a picture to be recognized from a video.
[0146] The second step: Perform face area positioning. The face acquisition terminal performs face detection on the picture to be recognized through a face area positioning algorithm to detect the face area and the corresponding position information.
[0147] The third step: Determine whether a face is detected. If a face area is detected, then obtain a single face picture, and then enter the fourth step. If no face area is detected, then enter the eighth step.
[0148] The fourth step: Interception operation. The face acquisition terminal performs an interception operation on the single face picture to obtain a face key area picture and coordinate information, and performs a complement operation on the intercepted single face picture to obtain a complemented single face picture.
[0149] The fifth step: Encryption operation. The face acquisition terminal encrypts the face key area picture to obtain face encryption information.
[0150] Step 6: Determine whether the encryption is successful. If the face collection terminal obtains the face encryption information, the encryption is successful, and it proceeds to Step 7. If the face encryption information is not obtained, the encryption fails, and it proceeds to Step 8.
[0151] Step 7: Send a face recognition request. The face collection terminal sends a face recognition request to the recognition server. The face recognition request includes face encryption information, coordinate information, and the completed single-face image.
[0152] Step 8: End face recognition.
[0153] Figure 10 It is a schematic flowchart of face region localization for the picture to be recognized provided by the tenth embodiment of the present invention. As Figure 10 shown, the process of face region localization for the picture to be recognized provided by the embodiment of the present invention is as follows:
[0154] Step 1: Perform face region localization. The face collection terminal performs face detection on the picture to be recognized through a face region localization algorithm to detect the face region and the corresponding position information.
[0155] Step 2: Determine whether a face region is detected. If the face collection terminal detects a face region, it proceeds to Step 3. If no face region is detected, it proceeds to Step 10.
[0156] Step 3: Determine whether there are multiple face regions. The face collection terminal determines whether there are multiple face regions based on the detected face regions. If there are multiple face regions, it proceeds to Step 4; if there is only one face region, it proceeds to Step 9.
[0157] Step 4: Determine whether the preset parameter is enabled. The face collection terminal detects whether the preset parameter is enabled. If the preset parameter is enabled, it proceeds to Step 7; if the preset parameter is not enabled, it proceeds to Step 5.
[0158] Step 5: Determine whether there is a centered face. The face collection terminal determines whether there is a face region that meets the centered face judgment rule based on the position information of each face region in the N face regions and the centered face judgment rule. If there is a face region that meets the centered face judgment rule, it proceeds to Step 8; if there is no face region that meets the centered face judgment rule, it proceeds to Step 6. Here, N is a positive integer greater than or equal to 2.
[0159] Step 6: Locate the largest face region. The face collection terminal calculates the size of each face region in the N face regions and obtains the largest face region through comparison.
[0160] Step 7: Locate the absolute largest face region. The face acquisition terminal calculates the size of each face region among the N face regions and obtains the largest face region through comparison.
[0161] Step 8: Locate the centered face region. Based on the position information of each face region among the N face regions, the face acquisition terminal obtains the geometric centroid coordinates of each face region, then calculates the distance between the geometric centroid coordinates of each face region and the geometric centroid of the image to be recognized, obtains the minimum distance from the N distances, and then compares the minimum distance with a preset value. If the minimum distance is less than the preset value, then the face region corresponding to the minimum distance is used as the face region that meets the centered face judgment rule, and the positioning of the centered face region is completed.
[0162] Step 9: Obtain a single face image. Based on the position information of the face region, a single face image is obtained.
[0163] Step 10: End face recognition.
[0164] Figure 11 It is a schematic flowchart of the process for encrypting the key face region image provided by the eleventh embodiment of the present invention. As Figure 11 shown, the process for encrypting the key face region image provided by the embodiment of the present invention includes:
[0165] Step 1: Obtain the asymmetric encryption public key. The face acquisition terminal obtains the asymmetric encryption public key. Among them, the asymmetric encryption public key is preset.
[0166] Step 2: Determine whether the asymmetric encryption public key is obtained. If the face acquisition terminal obtains the asymmetric encryption public key, then proceed to Step 3; if the asymmetric encryption public key is not obtained, then proceed to Step 7.
[0167] Step 3: Generate a symmetric encryption key. The face acquisition terminal randomly generates a symmetric encryption key. Among them, the algorithm for generating the symmetric encryption key is set according to actual needs, and the embodiment of the present invention does not make any limitations.
[0168] Step 4: Encrypt using the symmetric encryption key. The face acquisition terminal encrypts the key face region image using the symmetric encryption key to obtain the first encrypted information.
[0169] Step 5: Encrypt using the asymmetric encryption public key. The face acquisition terminal encrypts the symmetric encryption key to obtain the second encrypted information.
[0170] Step 6: Obtain the data to be sent. The face acquisition terminal uses the first encrypted information, the second encrypted information, and the asymmetric encryption public key as the data to be sent, and the data to be sent will be carried in the face recognition request and sent to the recognition server.
[0171] Step 7, end the encryption process.
[0172] Figure 12 It is a schematic flowchart of the face recognition method provided by the twelfth embodiment of the present invention. As Figure 12 shown, the process of the face recognition method provided by the embodiment of the present invention is as follows:
[0173] Step 1, receive a face recognition request. The recognition server receives the face recognition request sent by the face collection terminal. The face recognition request includes face encryption information, coordinate information, and a single face image after completion.
[0174] Step 2, decrypt the face encryption information. The recognition server obtains the face encryption information from the face recognition request, and then decrypts the face encryption information to obtain the face key area image.
[0175] Step 3, determine whether the decryption is successful. If the recognition server obtains the face key area image, then proceed to Step 4; if the face key area image is not obtained, then proceed to Step 6.
[0176] Step 4, restore the single face image. The recognition server restores the single face image according to the face key area image, coordinate information, and the single face image after completion.
[0177] Step 5, perform face recognition. The recognition server uses face recognition technology to perform face recognition on the single face image to obtain a face recognition result.
[0178] Step 6, end face recognition.
[0179] Figure 13 It is a schematic flowchart of decrypting the face encryption information provided by the thirteenth embodiment of the present invention. As Figure 13 shown, the process of decrypting the face encryption information provided by the embodiment of the present invention is as follows:
[0180] Step 1, obtain the asymmetric encryption public key. The recognition server obtains the asymmetric encryption public key from the face encryption information. Among them, the face encryption information includes the first ciphertext, the second ciphertext, and the asymmetric encryption public key.
[0181] Step 2, obtain the asymmetric encryption private key. The recognition server queries and obtains the corresponding asymmetric encryption private key according to the asymmetric encryption public key. Among them, the asymmetric encryption private key is preset and corresponds to the asymmetric encryption public key.
[0182] Step 3, decrypt the second ciphertext. The recognition server decrypts the second ciphertext according to the asymmetric encryption private key to obtain the symmetric encryption key.
[0183] Step 4: Decrypt the first ciphertext. The recognition server decrypts the first ciphertext according to the symmetric encryption key to obtain the picture of the key face area.
[0184] The face recognition method provided by the embodiment of the present invention solves the problem of information transmission security in the current face recognition process, meets the requirements of transmission security, improves the security protection ability of the face recognition process, effectively reduces the encryption time consumption of transmission, solves the problem of the large length of the ciphertext after encryption, and also reduces the decryption time consumption of face recognition. While ensuring data security, the efficiency of face recognition is improved, and both security and usability are taken into account in the face recognition process.
[0185] Figure 14 It is a schematic structural diagram of a face recognition device provided by the fourteenth embodiment of the present invention. As Figure 14 shown, the face recognition device provided by the embodiment of the present invention includes an obtaining unit 1401, a positioning unit 1402, a cropping unit 1403, an encryption unit 1404, and a sending unit 1405, where:
[0186] The obtaining unit 1401 is used to obtain a picture to be recognized; the positioning unit 1402 is used to perform face area positioning on the picture to be recognized to obtain a single face picture; the cropping unit 1403 is used to perform a cropping operation on the single face picture to obtain a picture of the key face area and coordinate information, and perform a complement operation on the cropped single face picture to obtain a complemented single face picture; the encryption unit 1404 is used to encrypt the picture of the key face area to obtain face encryption information; the sending unit 1405 is used to send a face recognition request for face recognition, and the face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture.
[0187] Specifically, the obtaining unit 1401 can obtain a picture to be recognized. Among them, the picture to be recognized can be obtained by the obtaining unit 1401 through real-time capture by a camera, or can be obtained by the obtaining unit 1401 from a video, which is set according to actual needs and is not limited in the embodiment of the present invention.
[0188] After obtaining the picture to be recognized, the positioning unit 1402 can perform face area positioning on the picture to be recognized and obtain a single face picture therefrom. It can be understood that if the positioning unit 1402 fails to obtain a single face picture, then the face recognition ends.
[0189] After obtaining a single face image, the cropping unit 1403 performs a cropping operation on the single face image to obtain a face key area image and records the coordinates of the face key area image on the single face image as the coordinate information of the face key area image, and the coordinate information is used for subsequent restoration of the single face image. After cropping the face key area image, the face acquisition terminal performs a filling operation on the cropped single face image, that is, fills the area where the original face key area image was located on the cropped single face image with color to make the cropped single face image complete, and obtains a filled single face image. Among them, the face key area image is the area in the single face image that can affect face recognition. Without the face key area image, face information cannot be recognized.
[0190] After obtaining the face key area image, the encryption unit 1404 encrypts the face key area image to obtain face encryption information. Among them, the encryption method used to encrypt the face key area image is set according to actual needs, and is not limited in the embodiments of the present invention.
[0191] After obtaining the face encryption information, the sending unit 1405 can send a face recognition request to the recognition server. The face recognition request can include the face encryption information, the coordinate information, and the filled single face image. After receiving the face recognition request, the recognition server performs face recognition processing to obtain a face recognition result. The recognition server can return the face recognition result to the face acquisition terminal.
[0192] The face recognition device provided by the embodiments of the present invention obtains an image to be recognized, locates the face area of the image to be recognized to obtain a single face image, performs a cropping operation on the single face image to obtain a face key area image and coordinate information, performs a filling operation on the cropped single face image to obtain a filled single face image, encrypts the face key area image to obtain face encryption information, and sends a face recognition request. By obtaining the face key area image and encrypting it, the security of information transmission during face recognition can be improved. In addition, since there is no need to encrypt the entire face image, while improving the security of information transmission, the time-consuming of encryption and decryption is reduced, thereby improving the efficiency of face recognition.
[0193] Figure 15 It is a schematic structural diagram of the face recognition device provided by the fifteenth embodiment of the present invention. As Figure 15 shown, the face recognition device provided by the embodiments of the present invention includes a receiving unit 1501, a decryption unit 1502, a restoration unit 1503, and an identification unit 1504, where:
[0194] The receiving unit 1501 is configured to receive a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a single face picture after completion; the decryption unit 1502 is configured to decrypt the face encryption information to obtain a face key area picture; the restoration unit 1503 is configured to restore a single face picture according to the face key area picture, the coordinate information, and the single face picture after completion; and the recognition unit 1504 is configured to perform face recognition on the single face picture to obtain a face recognition result.
[0195] Specifically, a face acquisition terminal may send a face recognition request to the receiving unit 1501, where the face recognition request includes face encryption information, coordinate information, and a single face picture after completion. The receiving unit 1501 will receive the face recognition request. Among them, the coordinate information indicates the position of the face key area picture in the single face picture.
[0196] After receiving the face encryption information, the decryption unit 1502 decrypts the face encryption information to obtain the face key area picture.
[0197] After obtaining the face key area picture, the restoration unit 1503 can obtain a single face picture according to the face key area picture, the coordinate information, and the single face picture after completion, that is, place the face key area picture into the single face picture after completion according to the coordinate information to form a complete single face picture.
[0198] After obtaining the single face picture, the recognition unit 1504 can perform face recognition on the single face picture using face recognition technology to obtain a face recognition result. The recognition unit 1504 can return the face recognition result to the face acquisition terminal. Among them, the face recognition technology is selected according to the actual situation, and the embodiments of the present invention do not make any limitations.
[0199] The face recognition device provided by the embodiments of the present invention can receive a face recognition request, decrypt face encryption information to obtain a face key area picture, restore a single face picture according to the face key area picture, coordinate information, and a single face picture after completion, perform face recognition on the single face picture to obtain a face recognition result, and can reduce the decryption time-consuming caused by encrypting face pictures, improving the face recognition efficiency while ensuring the security of information transmission.
[0200] The embodiments of the device provided by the embodiments of the present invention can specifically be used to execute the processing procedures of the corresponding method embodiments above, and their functions will not be elaborated here. Reference can be made to the detailed descriptions of the corresponding method embodiments above.
[0201] Figure 16This is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. As Figure 16 shown, the electronic device may include: a first processor 1601, a first communication interface 1602, a first memory 1603, and a first communication bus 1604. Among them, the first processor 1601, the first communication interface 1602, and the first memory 1603 communicate with each other through the first communication bus 1604. The first processor 1601 may call logic instructions in the first memory 1603 to execute the following methods, for example, including: obtaining a picture to be recognized; performing face region positioning on the picture to be recognized to obtain a single face picture; performing a cropping operation on the single face picture to obtain a face key region picture and coordinate information, and performing a complementing operation on the cropped single face picture to obtain a complemented single face picture; encrypting the face key region picture to obtain face encryption information; sending a face recognition request for face recognition, where the face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture.
[0202] This embodiment discloses a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the following methods, for example, including: obtaining a picture to be recognized; performing face region positioning on the picture to be recognized to obtain a single face picture; performing a cropping operation on the single face picture to obtain a face key region picture and coordinate information, and performing a complementing operation on the cropped single face picture to obtain a complemented single face picture; encrypting the face key region picture to obtain face encryption information; sending a face recognition request for face recognition, where the face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture.
[0203] This embodiment provides a computer-readable storage medium. The computer-readable storage medium stores a first computer program. The first computer program causes the computer to execute the following methods, for example, including: obtaining a picture to be recognized; performing face region positioning on the picture to be recognized to obtain a single face picture; performing a cropping operation on the single face picture to obtain a face key region picture and coordinate information, and performing a complementing operation on the cropped single face picture to obtain a complemented single face picture; encrypting the face key region picture to obtain face encryption information; sending a face recognition request for face recognition, where the face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture.
[0204] Figure 17 is a schematic diagram of the physical structure of an electronic device provided by another embodiment of the present invention. As Figure 17 shown, the electronic device may include: a second processor 1701, a second communication interface 1702, a second memory 1703, and a second communication bus 1704. Among them, the second processor 1701, the second communication interface 1702, and the second memory 1703 complete mutual communication through the second communication bus 1704. The second processor 1701 may call logic instructions in the second memory 1703 to execute the following methods, for example, including: receiving a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a completed single face picture; decrypting the face encryption information to obtain a face key area picture; restoring the single face picture according to the face key area picture, the coordinate information, and the completed single face picture; performing face recognition on the single face picture to obtain a face recognition result.
[0205] This embodiment discloses a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the following methods, for example, including: receiving a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a completed single face picture; decrypting the face encryption information to obtain a face key area picture; restoring the single face picture according to the face key area picture, the coordinate information, and the completed single face picture; performing face recognition on the single face picture to obtain a face recognition result.
[0206] This embodiment provides a computer-readable storage medium. The computer-readable storage medium stores a second computer program. The second computer program causes the computer to execute the following methods, for example, including: receiving a face recognition request, where the face recognition request includes face encryption information, coordinate information, and a completed single face picture; decrypting the face encryption information to obtain a face key area picture; restoring the single face picture according to the face key area picture, the coordinate information, and the completed single face picture; performing face recognition on the single face picture to obtain a face recognition result.
[0207] In addition, when the logical instructions in the above-mentioned first memory 1603 and second memory 1703 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a device, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0208] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0209] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to 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 devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0210] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device 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 flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0211] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, causing a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one process or a plurality of processes and / or blocks Figure 1 one process or a plurality of processes and / or blocks Figure 1 steps for implementing the functions specified in one block or a plurality of blocks.
[0212] In the description of the present specification, descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In the present specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0213] The above-described specific embodiments have further elaborated on the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A face recognition method, characterized in that, Including: Obtain the picture to be recognized; Locate the face area of the picture to be recognized to obtain a single face picture; Perform a cropping operation on the single face picture to obtain a face key area picture and coordinate information, including: Locate all face areas and their respective position information in the picture to be recognized through a face localization algorithm; If it is known that there are N face areas and a preset parameter is not enabled, then according to each face area in the N face areas and the centered face judgment rule, obtain the face area that meets the centered face judgment rule; where N is a positive integer greater than or equal to 2; According to the position information of the face area that meets the centered face judgment rule, obtain the single face picture; where the centered face judgment rule is the face area with the smallest distance between the geometric center of gravity of the N face areas and the geometric center of gravity of the picture to be recognized, and the distance is less than a preset value; Perform a complement operation on the cropped single face picture to obtain a complemented single face picture; Encrypt the face key area picture to obtain face encryption information; Send a face recognition request to the server for the server to perform face recognition. The face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture. The server's face recognition includes: Receive the face recognition request; Decrypt the face encryption information to obtain the face key area picture; Restore the single face picture according to the face key area picture, the coordinate information, and the complemented single face picture; Perform face recognition on the single face picture to obtain a face recognition result.
2. The method according to claim 1, characterized in that, The performing a cropping operation on the single face picture to obtain a face key area picture and coordinate information includes: Taking the center of the single face picture as the center, obtain a partial area of the single face picture as the face key area picture; where the partial area is a polygonal area or a circular area.
3. The method according to claim 2, characterized in that, The polygonal area is a rectangular area, the length of the rectangular area is 1 / 3 to 1 / 2 of the length of the single face picture, and the width of the rectangular area is 1 / 3 to 1 / 2 of the width of the single face picture.
4. The method according to claim 1, characterized in that, The encrypting the face key area picture to obtain face encryption information includes: Randomly generate a symmetric encryption key, and use the symmetric encryption key to encrypt the face key area picture to obtain a first ciphertext; Use the asymmetric encryption public key to encrypt the symmetric encryption key to obtain a second ciphertext; Take the first ciphertext, the second ciphertext, and the asymmetric encryption public key as the face encryption information.
5. The method according to claim 1, characterized in that, The locating the face area of the picture to be recognized to obtain a single face area picture includes: If it is known that there is only one face area, then based on the position information of the face area, obtain the single face picture.
6. The method according to claim 1, characterized in that, The locating the face area of the picture to be recognized to obtain a single face area picture includes: If it is known that there are N face areas and a preset parameter is enabled, then based on the position information of the largest face area in the N face areas, obtain the single face picture; where N is a positive integer greater than or equal to 2.
7. The method according to claim 1, characterized in that, Performing face region localization on the to-be-recognized picture to obtain a single face region picture includes: If each face region in the N face regions does not meet the centered face judgment rule, based on the position information of the largest face region in the N face regions, the single face picture is obtained.
8. The method according to any one of claims 1 to 7, characterized in that, The operation of complementing the single face picture after cropping includes: Adding a solid color to the region of the original face key region picture on the single face picture after cropping to make the single face picture after cropping complete.
9. A face recognition method, characterized in that, Including: Receiving a face recognition request sent by the method according to any one of claims 1 to 8; Decrypting the face encryption information to obtain a face key region picture; Restoring the single face picture according to the face key region picture, the coordinate information, and the complemented single face picture; Performing face recognition on the single face picture to obtain a face recognition result.
10. The method according to claim 9, characterized in that, The face encryption information includes a first ciphertext, a second ciphertext, and an asymmetric encryption public key; correspondingly, decrypting the face encryption information to obtain a face key region picture includes: Obtaining the corresponding asymmetric encryption private key according to the asymmetric encryption public key; Decrypting the second ciphertext according to the asymmetric encryption private key to obtain a symmetric encryption key; Decrypting the first ciphertext according to the symmetric encryption key to obtain the face key region picture.
11. A face recognition device, characterized in that, Including: An obtaining unit, configured to obtain a to-be-recognized picture; A localization unit, configured to perform face region localization on the to-be-recognized picture to obtain a single face picture; A cropping unit, configured to perform a cropping operation on the single face picture to obtain a face key region picture and coordinate information, including: locating all face regions and their respective position information in the to-be-recognized picture through a face localization algorithm; if it is known that there are N face regions and a preset parameter is not enabled, according to each face region in the N face regions and the centered face judgment rule, obtaining a face region that meets the centered face judgment rule; where N is a positive integer greater than or equal to 2; according to the position information of the face region that meets the centered face judgment rule, obtaining the single face picture; where the centered face judgment rule is the face region with the smallest distance between the geometric centroid of the N face regions and the geometric centroid of the to-be-recognized image, and the distance is less than a preset value; It is also configured to perform a complementing operation on the single face picture after cropping to obtain a complemented single face picture; An encryption unit, configured to encrypt the face key region picture to obtain face encryption information; A sending unit, configured to send a face recognition request to a server for the server to perform face recognition. The face recognition request includes the face encryption information, the coordinate information, and the complemented single face picture. The server performing face recognition includes: Receiving a face recognition request; Decrypting the face encryption information to obtain a face key region picture; Restoring the single face picture according to the face key region picture, the coordinate information, and the complemented single face picture; Performing face recognition on the single face picture to obtain a face recognition result.
12. A face recognition device, characterized in that, Including: A receiving unit, configured to receive a face recognition request sent by the face recognition device according to claim 11; A decryption unit, configured to decrypt the face encryption information to obtain a face key area picture; A restoration unit, configured to restore a single face picture according to the face key area picture, the coordinate information, and the completed single face picture; An identification unit, configured to perform face recognition on the single face picture to obtain a face recognition result.
13. An electronic device, comprising a first memory, a first processor, and a first computer program stored on the first memory and executable on the first processor, characterized in that, When the first processor executes the first computer program, the method according to any one of claims 1 to 8 is implemented.
14. A computer-readable storage medium, on which a first computer program is stored, characterized in that, When the first computer program is executed by the first processor, the method according to any one of claims 1 to 8 is implemented.
15. An electronic device, comprising a second memory, a second processor, and a second computer program stored on the second memory and executable on the second processor, characterized in that, When the second processor executes the second computer program, the method according to claim 9 or 10 is implemented.
16. A computer-readable storage medium, on which a second computer program is stored, characterized in that, When the second computer program is executed by the second processor, the method according to claim 9 or 10 is implemented.
Citation Information
Patent Citations
Iris recognition method and iris recognition system
CN106096526A
Face identification equipment and method
CN108052878A
Video real-time face encryption and decryption method based on authorization authentication
CN111726345A
Face encryption method and device, face recognition method and device, electronic equipment and storage medium
CN111931145A