A method for obtaining high-quality face image sample sets
By obtaining mask UV texture maps and PRNet networks, combined with the z-buffer algorithm, a high-quality mask-wearing face image sample set is generated, which solves the problem of glasses attribute loss in the existing technology, and improves the training effect and recognition accuracy of the face recognition model.
Patent Information
- Application Number
- CN202310968861.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-08-03
AI Technical Summary
The prior art fails to effectively retain glasses attributes when generating face image training samples with masks, resulting in poor recognition effects and uneven quality of existing image synthesis methods, which affects the recognition effect of the face recognition model.
By obtaining the mask UV texture map and face samples without wearing masks, combining the PRNet network and the z-buffer algorithm, the mask image and face images are accurately superimposed to ensure that the glasses area is not obstructed, and a high-quality mask-wearing face image sample set is generated.
The generated high-quality face image sample set can effectively improve the training effect of face detection, attribute recognition and key point detection models, reduce false alarm rates, and improve the recognition accuracy of faces wearing masks.
Smart Images

Figure CN117238012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a method for obtaining a high-quality face image sample set. Background Art
[0002] In the field of computer vision, face recognition is a biometric technology that identifies people based on their facial features. It mainly uses cameras to capture images or video streams containing faces, and automatically detects and tracks faces in images, and then performs a series of related technologies on facial recognition of the detected faces. It is also commonly called portrait recognition or facial recognition, and is widely used in various fields of human society.
[0003] Due to the large number of people in public places, viruses can easily enter the human body through the human mouth and nose. We must wear masks to establish a protective barrier for the upper respiratory tract, prevent contamination by respiratory microorganisms and droplets, stop the spread of body fluids and secretions, and reduce the risk of viral infection.
[0004] However, the training samples used by the face recognition models currently used in public places are almost all faces without masks, such as Figure 1 shown.
[0005] Wearing a mask on a person's face will cause the computer to lose a large number of the original facial features when performing face recognition. This will directly lead to a large number of missed detections and false detections due to the lack of key facial features. In order to improve the computer's recognition accuracy of faces wearing masks, it is necessary to retrain the face recognition model with a large number of training samples of people wearing masks. The quality of the training samples also directly affects the overall face recognition system's recognition effect on faces wearing masks.
[0006] However, it is time-consuming and laborious to manually screen out training samples that meet the requirements in quantity and quality from the massive samples collected by the camera. Therefore, image synthesis technology is usually used to quickly generate training samples using a computer. For example, the invention patent with publication number CN111914629A "Method, device, equipment and storage medium for generating training data for face recognition" discloses a method for generating training data for face recognition. The method first obtains a face image of a person without a mask and obtains a mask image, then calculates the spatial offset angle of the face image of the person without a mask, and rotates the mask image according to the spatial offset angle so that the mask image and the face image of the person without a mask are spatially consistent, and finally the rotated mask image is fused with the face image of the person without a mask to generate a face image of a person wearing a mask.
[0007] However, this image synthesis method simply merges two two-dimensional images together without considering the degree of fit between the images according to actual needs, resulting in poor recognition effect of the fused "face wearing a mask" image, and even causing the loss of facial feature attributes of many faces. Such uneven quality face images are used as training samples for face recognition models, which will greatly affect the recognition effect of the face recognition model on faces wearing masks, such as Figure 2 In particular, when the processed two-dimensional image is a face image of a person wearing glasses but not wearing a mask (such as Figure 3 As shown in ), directly merging the mask image onto the face image, the glasses area will be blocked by the mask, and the glasses attribute of the face image will be lost during the image merging process (as shown in Figure 4 As shown in ), the training samples obtained do not conform to the actual situation (the actual situation should be to superimpose the glasses on the mask so that the glasses area is not blocked by the mask, ensuring that the glasses attribute of the face image is not lost during the processing, as shown in Figure 5 shown).
[0008] The training samples obtained by the above-mentioned image synthesis method have poor image quality. Even if they are used for training face recognition models, they greatly reduce the recognition effect of the entire face recognition system on faces wearing masks. There is an urgent need for a method to obtain high-quality training samples so that the obtained training samples are consistent with the actual situation, so as to improve the recognition effect of the entire face recognition system on faces wearing masks. Summary of the Invention
[0009] The purpose of the present invention is to address the shortcomings of the existing technology and provide a method for obtaining a high-quality facial image sample set. When processing facial images of people wearing glasses but not wearing masks, after the "face image wearing glasses" is superimposed with the mask image, the mask image does not cover the glasses portion of the facial image, and the glasses attributes of the face are not lost. This allows the facial image that originally did not have the mask attributes to remain consistent while adding the mask attributes. This eliminates ambiguity during model training and achieves good network optimization results. The high-quality facial image sample set of "mask-wearing" obtained by the method of the present invention can be used for training face detection models, face attribute recognition models, face recognition models, and face key point detection models, greatly improving the effect of model training and reducing the false alarm rate.
[0010] The object of the present invention is to achieve the following: a method for obtaining a high-quality face image sample set, comprising the following steps:
[0011] 1) Obtaining a mask sample set, wherein the mask sample set includes a plurality of different mask UV texture mapping images;
[0012] 2) obtaining a sample set of faces not wearing masks, wherein the sample set includes a plurality of two-dimensional face images of people not wearing masks;
[0013] 3) Randomly select a 2D face image of a person without a mask from the sample set of faces without masks, and determine whether the face in the 2D image is wearing glasses:
[0014] If the glasses are not worn, the two-dimensional image is directly converted into the corresponding face UV texture map;
[0015] If the person is wearing glasses, obtain the corresponding glasses area mask map, remove the glasses on the face in the two-dimensional image, and then convert the two-dimensional image into the corresponding face UV texture map;
[0016] 4) Randomly select a mask UV texture map from the mask sample set and add it to the face UV texture map pixel to obtain the UV texture map of the face after wearing the mask;
[0017] 5) Determine whether the glasses area mask image was obtained in step 3):
[0018] If the eyeglass area mask image is not obtained in step 3), convert the UV texture map of the face after wearing the mask into a two-dimensional face image after wearing the mask, and go to step 6);
[0019] If the glasses area mask is obtained in step 3), then obtain the two-dimensional face image after wearing the mask and glasses based on the glasses area mask, and then go to step 6);
[0020] 6) Repeat steps 3) to 5) several times to obtain a sample set of face images after wearing a mask.
[0021] Preferably, the specific method of obtaining the mask UV texture mapping map is as follows:
[0022] 1-1) Randomly select a face image wearing a mask and use the PRNet network to obtain the UV texture map of the image;
[0023] 1-2) Use the image processing tool Photoshop to process the UV texture map obtained in step 1-1) to obtain the mask UV texture map. The specific steps are as follows:
[0024] Select the image part of the mask in the UV texture map, add an alpha channel and save it as the mask UV texture map, and use the image processing tool Photoshop to adjust the local color parameters and local lighting parameters of the mask UV texture map.
[0025] Preferably, a glasses classifier is used to determine whether the face in the image is wearing glasses.
[0026] Preferably, a glasses segmentation network is used to obtain a glasses region mask map.
[0027] Preferably, the StyleFlow algorithm is used to remove the glasses on the face of the person in the two-dimensional image.
[0028] Preferably, the two-dimensional image is converted into a corresponding face UV texture map through a PRNet network.
[0029] Preferably, when the PRNet network converts a two-dimensional image, if the image size of the two-dimensional image is larger than the input size of the PRNet network, a face super-resolution model is used to perform face super-resolution processing on the two-dimensional image so that the size of the processed two-dimensional image is equal to the size of the input image of the PRNet network.
[0030] Preferably, the samples of the face sample set without mask in step 2) are all obtained using a face detection network.
[0031] Preferably, if the eyeglass area mask image is not obtained in step 3), the UV texture map of the face after wearing the mask is converted into a two-dimensional face image after wearing the mask according to the following steps:
[0032] (1) The face mask image is obtained by using the z-buffer algorithm based on the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network is converted into the two-dimensional image;
[0033] ⑵ Based on the UV texture map of the face after wearing the mask, and the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the UV texture map of the face after wearing the mask is rendered using the z-buffer algorithm to obtain the image of the face area after wearing the mask;
[0034] ⑶ Superimpose the face area image after wearing a mask with the two-dimensional face image without a mask according to the following formula to obtain the two-dimensional face image after wearing a mask:
[0035] tmp_A=image_A (1 - face_mask) + new_face_A
[0036] Where tmp_A is the two-dimensional face image after wearing a mask, new_face_A is the face area image without glasses and only wearing a mask, face_mask is the face mask image, and image_A is the two-dimensional face image without glasses and a mask.
[0037] Preferably, if the glasses region mask image is obtained in step 3), the following steps are performed to obtain a two-dimensional face image after wearing a mask and glasses based on the glasses region mask image:
[0038] ①According to the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the face mask image is obtained using the z-buffer algorithm;
[0039] ② Based on the UV texture map of the face after wearing the mask, and the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the UV texture map of the face after wearing the mask is rendered using the z-buffer algorithm to obtain the image of the face area after wearing the mask;
[0040] ③ According to the following formula, the glasses area mask is superimposed on the face area image after wearing a mask to obtain the face area image after wearing a mask and glasses:
[0041] new_face_B=new_face (1-glasses_mask)+image_B glasses_mask
[0042] Where new_face_B is the face image after wearing a mask and glasses, new_face is the face image after removing glasses and wearing a mask, glasses_mask is the mask image of the glasses area, and image_B is the two-dimensional face image of the person wearing glasses but not wearing a mask;
[0043] ④ According to the following formula, the face area image after wearing a mask and glasses is superimposed with the two-dimensional face image without a mask to obtain the two-dimensional face image after wearing a mask and glasses:
[0044] tmp_B=image_B (1 - face_mask) + new_face_B
[0045] Where tmp_B is the two-dimensional face image after wearing a mask and glasses, new_face_B is the face area image after wearing a mask and glasses, face_mask is the face mask image, and image_B is the two-dimensional face image wearing glasses but not wearing a mask.
[0046] The advantages of the present invention are the following three points:
[0047] ① The UV texture mapping of the mask is simple to make, and a large number of mask samples of different styles, materials, and sizes can be obtained quickly and easily, making the samples in the mask sample set diverse and representative;
[0048] ② This invention combines the advantages of both 2D mapping and 3D models to obtain high-quality two-dimensional images of faces "wearing masks", which greatly improves the training effect of face recognition models;
[0049] ③ When the method of the present invention processes a face image of a person wearing glasses but not wearing a mask, after the "face image wearing glasses" is superimposed with the mask image, the mask image does not cover the glasses portion of the face image, and the glasses attribute of the face is not lost. This allows the face image that originally did not have the mask attribute to be added while the original attribute information of the face image remains consistent, thus avoiding ambiguity during the model training process and achieving good network optimization effect;
[0050] ④ The high-quality face image sample set of "wearing a mask" obtained by the method described in the present invention can be used for training face detection models, face attribute recognition models, face recognition models, and face key point detection models, which greatly improves the effect of model training. That is, the face recognition model trained with the high-quality face image sample set of "wearing a mask" obtained by the method described in the present invention has better face recognition effect and lower false alarm rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 The face image of a person not wearing a mask as described in the present invention;
[0052] Figure 2 These are training samples with poor image quality;
[0053] Figure 3 This is a face image of a person wearing glasses but not a mask;
[0054] Figure 4 The face image is missing the glasses attribute;
[0055] Figure 5 The training samples are those that have not lost the attributes of the glasses after being processed according to the method of the present invention;
[0056] Figure 6 The training samples are obtained by processing the face images of people who are not wearing masks or glasses according to the method of the present invention;
[0057] Figure 7 This is a schematic diagram of the process of Example 1 of the present invention;
[0058] Figure 8 This is a schematic diagram of the process of Example 2 of the present invention;
[0059] Figure 9 Flowchart of the present invention. DETAILED DESCRIPTION
[0060] like Figure 9 As shown, a method for obtaining a high-quality face image sample set includes the following steps:
[0061] 1) Obtaining a mask sample set, wherein the mask sample set includes a plurality of different mask UV texture mapping images;
[0062] In this embodiment, the specific method of obtaining the mask UV texture mapping map is as follows:
[0063] 1-1) Randomly select a face image wearing a mask and use the PRNet network to obtain the UV texture map of the image;
[0064] 1-2) Use the image processing tool Photoshop to process the UV texture map obtained in step 1-1) to obtain the mask UV texture map. The specific steps are as follows:
[0065] Select the image part of the mask in the UV texture map, add an alpha channel and save it as the mask UV texture map, and use the image processing tool Photoshop to adjust the local color parameters and local lighting parameters of the mask UV texture map.
[0066] 2) obtaining a sample set of faces not wearing masks, wherein the sample set includes a plurality of two-dimensional face images of people not wearing masks;
[0067] The samples of the sample set of faces not wearing masks are all obtained by using a face detection network, that is, the two-dimensional face images of people not wearing masks are all obtained by using a face detection network.
[0068] In this embodiment, the face detection network is retinaface.
[0069] 3) Randomly select a 2D face image of a person without a mask from the sample set of faces without masks, and use the glasses classifier to determine whether the face in the 2D image is wearing glasses:
[0070] If the glasses are not worn, the two-dimensional image is directly converted into the corresponding face UV texture map;
[0071] If the person is wearing glasses, the glasses segmentation network is used to obtain the corresponding glasses area mask map, and the StyleFlow algorithm is used to remove the glasses on the face in the two-dimensional image, and then the two-dimensional image is converted into the corresponding face UV texture map;
[0072] In this embodiment, the StyleFlow algorithm is Attribute-conditioned Exploration of StyleGAN-Generated Images using Conditional Continuous Normalizing Flows.
[0073] The glasses classifier is mobilenetv2.
[0074] The glasses segmentation network is PSPNet.
[0075] 4) Randomly select a mask UV texture map from the mask sample set and add it to the face UV texture map pixel to obtain the UV texture map of the face after wearing the mask;
[0076] 5) Determine whether the glasses area mask image was obtained in step 3):
[0077] If the glasses area mask is not obtained in step 3), the image sample to be processed is as follows Figure 7 As shown in A,
[0078] Follow the steps below to perform Example 1 to convert the UV texture map of a face wearing a mask into a two-dimensional face image of the face wearing the mask:
[0079] ⑴ According to the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the face mask image is obtained using the z-buffer algorithm, such as Figure 7 As shown in B;
[0080] ⑵ According to the UV texture map of the face after wearing a mask, and the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the UV texture map of the face after wearing a mask is rendered using the z-buffer algorithm to obtain the face area image after wearing a mask, as shown in Figure 7 As shown in C;
[0081] ⑶ Superimpose the face area image after wearing a mask with the two-dimensional face image without a mask according to the following formula to obtain the two-dimensional face image after wearing a mask:
[0082] tmp_A=image_A (1 - face_mask) + new_face_A
[0083] Where tmp_A is the two-dimensional face image after wearing a mask, new_face_A is the face area image without glasses and only wearing a mask, face_mask is the face mask image, and image_A is the two-dimensional face image without glasses and a mask.
[0084] In this embodiment, according to the formula image_A (1 - face_mask) is obtained by removing the face mask image area from the two-dimensional face image without glasses or masks. Figure 7 The two-dimensional image outside the face mask image area in A, such as Figure 7 As shown in D;
[0085] The face area image new_face_A of the person who is not wearing glasses and only wearing a mask is superimposed with the two-dimensional face image of the person who is not wearing a mask (in fact, it is superimposed with Figure 7 D is overlapped and superimposed by adding pixels), and a two-dimensional face image after wearing a mask is obtained, such as Figure 7 As shown in E;
[0086] If the glasses area mask is obtained in step 3), the image sample to be processed is as follows Figure 8 As shown in Figure A, perform Example 2 by following the steps below to obtain a two-dimensional face image of a person wearing a mask and glasses based on the glasses area mask map:
[0087] ① According to the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the face mask image is obtained using the z-buffer algorithm, such as Figure 8 As shown in B;
[0088] ② Based on the UV texture map of the face after wearing the mask, and the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the UV texture map of the face after wearing the mask is rendered using the z-buffer algorithm to obtain the image of the face area after wearing the mask;
[0089] ③ According to the following formula, the glasses area mask is superimposed on the face area image after wearing a mask to obtain the face area image after wearing a mask and glasses:
[0090] new_face_B=new_face (1-glasses_mask)+image_B glasses_mask
[0091] Where new_face_B is the face image after wearing a mask and glasses, new_face is the face image after removing glasses and wearing a mask, glasses_mask is the mask image of the glasses area, and image_B is the two-dimensional face image of the person wearing glasses but not wearing a mask;
[0092] In this embodiment, the StyleFlow algorithm is used to Figure 8 After removing the glasses from the face of person A, the obtained two-dimensional face image without glasses and mask is as follows Figure 8 As shown in C, the glasses area mask obtained by the glasses segmentation network is as follows Figure 8 As shown in D, according to the formula image_B glasses_mask obtains an image of the glasses area in a two-dimensional face image of a person wearing glasses but not wearing a mask, such as Figure 8 As shown in E;
[0093] The two-dimensional face image without glasses and mask can be obtained by the method described in Example 1 to obtain the face area image new_face of the person wearing a mask after removing the glasses in this embodiment, as shown in FIG. Figure 8 As shown in F, the glasses area mask image glasses_mask is used to obtain the face area image after wearing a mask and glasses, as shown in Figure 8 As shown in G;
[0094] ④ According to the following formula, the face area image after wearing a mask and glasses is superimposed with the two-dimensional face image without a mask to obtain the two-dimensional face image after wearing a mask and glasses:
[0095] tmp_B=image_B (1 - face_mask) + new_face_B
[0096] Where tmp_B is the two-dimensional face image after wearing a mask and glasses, new_face_B is the face area image after wearing a mask and glasses, face_mask is the face mask image, and image_B is the two-dimensional face image wearing glasses but not wearing a mask.
[0097] In this embodiment, the face mask image face_mask is as follows: Figure 8 As shown in B, according to the formula image_B (1 - face_mask) is obtained by removing the face mask image area from the two-dimensional face image of the person wearing glasses but not wearing a mask. Figure 8 The two-dimensional image outside the face mask image area in A, such as Figure 8 As shown in H;
[0098] The face area image new_face_B after wearing a mask and glasses is superimposed with the two-dimensional face image of the person wearing glasses but not wearing a mask (actually with Figure 8 H is overlapped and superimposed by adding pixels), and a two-dimensional face image with a mask and glasses is obtained, such as Figure 8 As shown in K.
[0099] According to the above two embodiments, after all samples in the sample set of faces not wearing masks are processed according to actual conditions, the obtained processed sample images can form a sample set of face images of faces wearing masks.
[0100] It is worth noting that in Examples 1 and 2, all two-dimensional images are converted into corresponding face UV texture maps through the PRNet network.
[0101] When the PRNet network converts a two-dimensional image, if the image size of the two-dimensional image is larger than the input size of the PRNet network, it is necessary to first use the face super-resolution model to perform face super-resolution processing on the two-dimensional image so that the size of the processed two-dimensional image is equal to the image input size required by the PRNet network. Then, the PRNet network is used to convert the two-dimensional image processed by the face super-resolution model into the corresponding face UV texture map.
[0102] If the image size of the two-dimensional image is less than or equal to the input size of the PRNet network, the two-dimensional image can be directly converted into the corresponding face UV texture map through the PRNet network.
[0103] In this embodiment, the face super-resolution model is GLEAN: Generative Latent Bank for Large-Factor Image Super-Resolution, or GCFSR (a Generative and Controllable Face Super Resolution Method Without Facial and GAN Priors)
[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications made to the present invention by those skilled in the art without departing from the spirit of the present invention shall fall within the scope of protection of the present invention.
Claims
1. A method for obtaining a high-quality face image sample set, characterized in that: The following steps are involved: 1) Obtaining a mask sample set, wherein the mask sample set includes a plurality of different mask UV texture maps; 2) obtaining a sample set of faces not wearing masks, wherein the sample set of faces not wearing masks comprises a plurality of two-dimensional face images of people not wearing masks; 3) Randomly select a 2D face image of a person without a mask from the sample set of faces without masks, and determine whether the face in the 2D image is wearing glasses: If the glasses are not worn, the two-dimensional image is directly converted into the corresponding face UV texture map; If the person is wearing glasses, obtain the corresponding glasses area mask map, remove the glasses on the face in the two-dimensional image, and then convert the two-dimensional image into the corresponding face UV texture map; 4) Randomly select a mask UV texture map from the mask sample set and add it to the face UV texture map pixel to obtain the UV texture map of the face after wearing the mask; 5) Determine whether the glasses area mask image was obtained in step 3): If the eyeglass area mask image is not obtained in step 3), convert the UV texture map of the face after wearing the mask into a two-dimensional face image after wearing the mask, and go to step 6); If the glasses area mask is obtained in step 3), then obtain the two-dimensional face image after wearing the mask and glasses based on the glasses area mask, and then go to step 6); 6) Repeat steps 3) to 5) several times to obtain a sample set of face images after wearing a mask.
2. The method according to claim 1, characterized in that The specific method of obtaining the mask UV texture mapping map is as follows: 1-1) Randomly select a face image wearing a mask and use the PRNet network to obtain the UV texture map of the image; 1-2) Use the image processing tool Photoshop to process the UV texture map obtained in step 1-1) to obtain the mask UV texture map. The specific steps are as follows: Select the image part of the mask in the UV texture map, add an alpha channel and save it as the mask UV texture map, and use the image processing tool Photoshop to adjust the local color parameters and local lighting parameters of the mask UV texture map.
3. The method according to claim 1, characterized in that Use the glasses classifier to determine whether the face in the image is wearing glasses.
4. The method according to claim 1, wherein The glasses segmentation network is used to obtain the glasses area mask map.
5. The method according to claim 1, wherein The StyleFlow algorithm is used to remove glasses from faces in two-dimensional images.
6. The method according to claim 1, characterized in that The two-dimensional image is converted into a corresponding face UV texture map through the PRNet network.
7. The method according to claim 6, characterized in that When the PRNet network converts a two-dimensional image, if the image size of the two-dimensional image is larger than the input size of the PRNet network, the face super-resolution model is used to perform face super-resolution processing on the two-dimensional image so that the size of the processed two-dimensional image is equal to the size of the input image of the PRNet network.
8. The method according to claim 1, characterized in that In step 2), the samples of the face sample set of people who are not wearing masks are all obtained using a face detection network.
9. The method according to claim 1, characterized in that If the eyeglass area mask is not obtained in step 3), follow the steps below to convert the UV texture map of the face with the mask on to a 2D face image with the mask on: (1) The face mask image is obtained by using the z-buffer algorithm based on the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network is converted into the two-dimensional image; ⑵ Based on the UV texture map of the face after wearing the mask, and the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the UV texture map of the face after wearing the mask is rendered using the z-buffer algorithm to obtain the image of the face area after wearing the mask; ⑶ Superimpose the face area image after wearing a mask with the two-dimensional face image without a mask according to the following formula to obtain the two-dimensional face image after wearing a mask: tmp_A=image_A (1 - face_mask) + new_face_A Where tmp_A is the two-dimensional face image after wearing a mask, new_face_A is the face area image without glasses and only wearing a mask, face_mask is the face mask image, and image_A is the two-dimensional face image without glasses and a mask.
10. The method according to claim 1, characterized in that If the glasses area mask is obtained in step 3), follow the steps below to obtain a 2D face image of the person wearing a mask and glasses based on the glasses area mask: ① According to the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the face mask image is obtained using the z-buffer algorithm; ② Based on the UV texture map of the face after wearing the mask, and the triangle vertex coordinates and point cloud coordinates corresponding to the face in the two-dimensional image obtained when the PRNet network converts the two-dimensional image, the UV texture map of the face after wearing the mask is rendered using the z-buffer algorithm to obtain the image of the face area after wearing the mask; ③ According to the following formula, the glasses area mask is superimposed on the face area image after wearing a mask to obtain the face area image after wearing a mask and glasses: new_face_B=new_face (1-glasses_mask)+image_B glasses_mask Where new_face_B is the face image after wearing a mask and glasses, new_face is the face image after removing glasses and wearing a mask, glasses_mask is the mask image of the glasses area, and image_B is the two-dimensional face image of the person wearing glasses but not wearing a mask; ④ According to the following formula, the face area image after wearing a mask and glasses is superimposed with the two-dimensional face image without a mask to obtain the two-dimensional face image after wearing a mask and glasses: tmp_B=image_B (1 - face_mask) + new_face_B Where tmp_B is the two-dimensional face image after wearing a mask and glasses, new_face_B is the face area image after wearing a mask and glasses, face_mask is the face mask image, and image_B is the two-dimensional face image wearing glasses but not wearing a mask.
Citation Information
Patent Citations
Method and device for generating training data for facial recognition, equipment and storage medium
CN111914629A
Method of hiding an object in an image or video and associated augmented reality process
US20180005448A1
Face recognition method and terminal device
WO2020015477A1