3D face model texture reconstruction method and device based on single image
By extracting 2D feature points in the face image and 3D feature points in the prefabricated texture image, non-rigid deformation and texture mapping are performed, which solves the similarity and detail problems of texture synthesis in single image reconstruction and improves the accuracy of the 3D face model. Texture realism and precision.
Patent Information
- Application Number
- CN202210918308.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-01
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-08-01
AI Technical Summary
Existing 3D face model texture reconstruction methods based on a single image have problems such as low texture synthesis similarity, serious loss of details and local misalignment of textures, making it difficult to ensure the integrity, authenticity and accuracy of textures.
By acquiring the frontal face image and prefabricated texture image, extract 2D feature points and determine the target global projection matrix, correct the color value of the texture image, perform non-rigid deformation, and finally use the target global projection matrix for texture mapping to generate the target texture image to improve the texture. authenticity and accuracy.
It improves the authenticity and accuracy of the texture of the 3D face model, solves the problem of local texture misalignment, ensures the integrity and detail retention of the texture, and enhances the user experience.
Smart Images

Figure CN115082640B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional reconstruction of human faces, and provides a method and device for reconstructing the texture of a 3D human face model based on a single image. Background Art
[0002] With the rise of the concept of the metaverse, obtaining personalized virtual digital humans has attracted more interest. As the human face is one of the main focuses of virtual digital humans, generating realistic 3D face models has become the research focus of virtual digital humans.
[0003] A 3D face model refers to a three-dimensional spatial expression that has both a geometric model and a texture map. Compared with two-dimensional images, it has stronger expressiveness and is therefore widely used in movies, games, virtual social networking and other fields.
[0004] At present, image-based face 3D reconstruction supports the reconstruction of 3D face models based on a single image. Among them, there are two main solutions for reconstructing face texture based on a single image 3D face model: the first solution is to construct a texture basis space based on a large number of data sets, and then obtain a texture similar to the user by linearly combining the basis vectors; the second solution is to directly obtain texture fragments from the input original face image, and perform texture mapping after estimating the projection matrix. However, the first solution is obtained by combining existing textures in the database. Therefore, there are problems such as low similarity between the synthesized texture and the user's real texture and serious loss of details. Although the second solution directly obtains the texture from the original face image and ensures the texture similarity, because the original face image is generally only a frontal image, it cannot provide a complete texture. In addition, since the estimated projection matrix during texture mapping is a global optimal solution, it cannot guarantee that it can be absolutely aligned with the facial features in every local area, and there is a problem of local texture misalignment.
[0005] Therefore, improving the integrity, authenticity and accuracy of facial texture reconstruction is an urgent problem to be solved in the field of virtual digital humans. Summary of the invention
[0006] The present application provides a method and device for reconstructing the texture of a 3D face model based on a single image, which are used to improve the texture reconstruction accuracy, authenticity and integrity of the 3D face model.
[0007] On the one hand, the present application provides a 3D face model texture reconstruction method based on a single image, comprising:
[0008] Acquire a frontal face image and a prefabricated texture image, and extract multiple 2D feature points in the frontal face image;
[0009] Determine a target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the pre-generated parameterized geometric model to obtain the target geometric model;
[0010] Correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image;
[0011] Determine a frontal face image after non-rigid deformation according to a mapping relationship between a plurality of 2D feature points and corresponding 3D feature points;
[0012] According to the target global projection matrix, the color values of the pixels in the deformed frontal face image are assigned to the pixels in the initial texture image to obtain a target texture image for texture mapping of the target geometric model.
[0013] On the other hand, the present application provides a reconstruction device, comprising a processor and a memory, wherein the memory and the processor are connected via a bus;
[0014] The memory stores a computer program, and the processor performs the following operations according to the computer program:
[0015] Acquire a frontal face image and a prefabricated texture image, and extract multiple 2D feature points in the frontal face image;
[0016] Determine a target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the pre-generated parameterized geometric model to obtain the target geometric model;
[0017] Correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image;
[0018] Determine a frontal face image after non-rigid deformation according to a mapping relationship between a plurality of 2D feature points and corresponding 3D feature points;
[0019] According to the target global projection matrix, the color values of the pixels in the deformed frontal face image are assigned to the pixels in the initial texture image to obtain a target texture image for texture mapping of the target geometric model.
[0020] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer device to execute the 3D face model texture reconstruction method based on a single image provided in an embodiment of the present application.
[0021] In the single-image-based 3D face model texture reconstruction method and device provided in the present application, a prefabricated texture image corresponding to a pre-generated parameterized geometric model is obtained. Since the prefabricated texture image contains a complete face texture, but has a low similarity to the real texture and cannot be directly texture mapped, the color value of the prefabricated texture image is corrected using the obtained front face image, thereby improving the authenticity of the texture while retaining the complete face texture; the target global projection matrix is determined based on the image coordinates of multiple 2D feature points extracted from the front face image and the three-dimensional coordinates of the corresponding 3D feature points in the parameterized geometric model. When texture mapping is performed based on the target global projection matrix, texture misalignment may occur at local positions such as the corners of the eyes and the corners of the mouth. Therefore, based on the mapping relationship between the multiple 2D feature points and the corresponding 3D feature points, the non-rigidly deformed front face image is determined, and the deformed front face image is used for texture mapping to obtain the target texture image, thereby solving the problem of local texture misalignment and improving the accuracy of texture reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0023] Figure 1 A flow chart of a method for generating a parameterized geometric model and a prefabricated texture image provided in an embodiment of the present application;
[0024] Figure 2 A diagram showing the effects of different shape parameters and expression parameters on a parameterized geometric model provided in an embodiment of the present application;
[0025] Figure 3A A schematic diagram of a prefabricated texture image provided in an embodiment of the present application;
[0026] Figure 3B This is the effect diagram after the prefabricated texture image is mapped according to the embodiment of the present application;
[0027] Figure 4 A structural diagram of a 3D face model texture reconstruction method based on a single image provided in an embodiment of the present application;
[0028] Figure 5 A flow chart of a 3D face model texture reconstruction method based on a single image provided in an embodiment of the present application;
[0029] Figure 6 A schematic diagram of 68 2D feature points extracted from a frontal face image provided in an embodiment of the present application;
[0030] Figure 7 A flow chart of a method for generating a personalized target geometric model provided in an embodiment of the present application;
[0031] Figure 8 A flow chart of a method for generating an initial texture image provided in an embodiment of the present application;
[0032] Fig. 9 A schematic diagram of semantic segmentation of a frontal face image provided in an embodiment of the present application;
[0033] Fig.10 A projection effect diagram of 2D feature points and corresponding 3D feature points in the original frontal face image provided by the embodiment of the present application;
[0034] Fig.11 A flow chart of a method for performing non-rigid deformation on a frontal face image provided in an embodiment of the present application;
[0035] Fig.12 A schematic diagram of segmenting a frontal face image provided in an embodiment of the present application;
[0036] Fig.13 A schematic diagram of splitting a blank image provided in an embodiment of the present application;
[0037] Fig.14 A schematic diagram of a filling process of a triangular area provided in an embodiment of the present application;
[0038] Fig.15 A relationship diagram of the geometric model space, texture space and RGB image space provided in the embodiment of the present application;
[0039] Fig.16 Flowchart of a method for generating a target texture image provided by an embodiment of the present application;
[0040] Fig.17 A hardware structure diagram of a reconstruction device provided in an embodiment of the present application;
[0041] Fig.18 This is a functional structure diagram of the reconstruction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.
[0043] At present, in the field of 3D reconstruction of virtual digital human faces, the methods for obtaining 3D face models mainly include reconstruction based on point clouds acquired by 3D scanning equipment and restoration of 3D face models based on 2D face images. Among them, the model of 3D face reconstruction using 3D scanning equipment is highly accurate and detailed, but because 3D scanning equipment is relatively expensive and inconvenient to carry, and reconstruction is required after scanning is completed, the speed is relatively slow. Relatively speaking, the method of face reconstruction based on 2D face images can be completed using an ordinary camera, which is low-cost and has a wider range of application scenarios.
[0044] The three-dimensional reconstruction of the face based on 2D face images includes: three-dimensional reconstruction of face images based on multi-viewpoints and three-dimensional reconstruction of face images based on single-viewpoints. In the three-dimensional reconstruction process based on multiple face images, the coordinates of the three-dimensional points are restored by matching the feature points between adjacent images to complete the dense face point cloud reconstruction. The final 3D geometric model is similar to the 3D geometric model reconstructed based on the 3D scanning device, with a large number of vertices and facets, and the details can be better maintained. After obtaining the 3D geometric model, the image with the best viewing angle is selected for texture mapping through perspective projection relationship, thereby obtaining a textured 3D face model. However, in order to obtain a good reconstruction effect, this method usually requires the collection of 10-20 face images from different angles, and the head must remain motionless during the collection. The subsequent processing and reconstruction of the collected images is also time-consuming, which limits the use of this method.
[0045] Since the 3D reconstruction method based on a single face image has low time cost and low degree of limitation, it has become the research focus in the field of 3D face reconstruction. However, when reconstructing the texture of a 3D face model based on a single face image, most of the existing methods combine or deform the texture extracted from the face image and the template texture from a linear space, resulting in poor texture synthesis similarity. In addition, the texture obtained from a single face image is incomplete and cannot cover the entire head, so it cannot be used directly.
[0046] In view of this, an embodiment of the present application provides a method and device for reconstructing the texture of a 3D face model based on a single image. Considering that a frontal face image contains rich details, the single image used is a frontal face image. In the method and device, a personalized target geometric model is generated based on a face image and a constructed parameterized geometric model, and a prefabricated texture image corresponding to the parameterized geometric model is obtained. The pixel color values of each area after semantic segmentation of the face image are corrected to the prefabricated texture image to obtain an initial texture image. Since the prefabricated texture image contains a complete face texture, the integrity of the texture is guaranteed, and after correction with the pixel color of the face image, the authenticity of the texture is improved; then, based on the 2D feature points extracted from the face image and the 3D feature points of the target geometric model, a global projection matrix is determined, and the 2D feature points are locally moved through the 3D feature points to cause a non-rigid deformation of the face image, thereby solving the projection error problem existing in a single global projection matrix and ensuring the local accuracy of the texture map; finally, a skin color migration and texture mapping method is used to fuse the non-rigidly deformed face image and the initial texture image to obtain a target texture image, further ensuring the consistency of the texture style with the real texture.
[0047] The reconstruction of a 3D face model based on a single face image can be roughly divided into two parts: geometric reconstruction and texture reconstruction. Geometric reconstruction mainly relies on a parameterized geometric model with the same topology. According to the feature points extracted from the face image, the parameterized geometric model is adjusted to make the model have the biological features of the input face image; texture reconstruction is to "rasterize" the input face image into the texture space of the parameterized geometric model through a projection relationship.
[0048] Considering that a single face image cannot provide the face depth information, this becomes a "pathological" problem in recovering the 3D face information from a 2D face image. To this end, when reconstructing the texture of a 3D face model based on a single face image, the embodiment of the present application pre-generates a 3D parametric geometric model representing the average characteristics of most faces based on an existing head data set, as well as a prefabricated texture image corresponding to the model. Among them, a fixed number of points is used to express the face in the general parametric geometric model. The generation process is: using the principal component analysis (PCA) method, the vectors after dimensionality reduction decomposition of hundreds of real face images collected are used as the basis space, and the parametric geometric model of the face is obtained by linearly combining the basis vectors. In this way, the problem of three-dimensional reconstruction of the face is transformed into a low-dimensional problem of estimating the coefficients of linear combinations. In addition to the fact that the geometric part can be represented by the basis space, the same method can also be used to construct the basis space of the texture.
[0049] Assuming that the existing human head dataset contains 500 human head images collected by high-precision 3D scanning equipment, the specific generation process of the parameterized geometric model and prefabricated texture image can be found in Figure 1 , mainly includes the following steps:
[0050] S101: extracting 3D feature point cloud data from 500 human head images respectively, and fusing the 3D feature point cloud data extracted from each image to obtain a target point cloud data set.
[0051] S102: downsample 5000 points from the target point cloud dataset.
[0052] S103: Using the Poisson reconstruction method, the 5000 points are reconstructed into a parametric geometric model with patches.
[0053] The parameterized geometry model represents the average geometry model of 500 human heads.
[0054] S104: Using the PCA algorithm, 50 principal component vectors are obtained from the 5000 points through dimensionality reduction. The 50 principal component vectors are used to characterize the shape of the face.
[0055] S105: adding the 50 principal component vectors to the average parameterized geometric model using different coefficients respectively, so that the shape of the face in the parameterized geometric model changes differently, and obtaining a universal parameterized geometric model.
[0056] Among them, the effects of different face shape parameters on the parameterized geometric model are as follows: Figure 2 As shown in (a) in .
[0057] S106: Using the 3D modeling software, 30 expression parameters are added to the glasses, mouth and other parts of the parametric geometric model through the Blend Shape option.
[0058] By controlling the changes in facial expression parameters, the parametric geometric model can generate rich expressions, further increasing the personalized expression space of the 3D face model. Figure 2 (b) in FIG. 1 is a diagram showing the effect of different face expression parameters on the parameterized geometric model.
[0059] When generating a parametric geometric model, the triangle patch index for texture mapping is predefined and saved.
[0060] S107: Using three-dimensional modeling software, generating a prefabricated texture image for texture mapping of the parameterized geometric model.
[0061] In the process of generating prefabricated texture images, the prefabricated texture images and their geometric UV coordinate expansion methods in the texture space are saved for use in texture mapping. Figure 2 As shown in (c), it is the effect image after the parametric geometric model texture mapping corresponding to different shape parameters and expression parameters based on the prefabricated texture image.
[0062] Optionally, the above-mentioned 3D model software can be Maya, 3DsMax, etc., and the embodiments of the present application do not make any restrictive requirements or restrictions.
[0063] In the process of generating a parametric geometric model in the embodiment of the present application, 5000 points obtained by downsampling from the 3D feature point cloud data extracted from 500 head images are used as the basis for expressing a general parametric geometric model, and 50 shape parameters are obtained by performing PCA on the 5000 points, which are denoted as S={S 1 , S 2 , S 3 , …, S 50}, and 30 expression parameters are obtained through 3D modeling software, denoted as E = {E 1 , E 2 , E 3 , …, E 30}, through the linear combination of 50 shape parameters and 30 expression parameters, the passed parametric geometric model can be changed to become a personalized face geometric model. After obtaining the general parametric geometric model, a prefabricated texture image is generated through 3D modeling software, such as Figure 3A As shown in FIG. 1 , the prefabricated texture image can be used as a template texture for subsequent texture mapping. At this point, the 3D face model with template texture obtained after texture mapping is as follows: Figure 3B shown.
[0064] Based on the above pre-generated parameterized geometric model and pre-made texture image, the present application provides a 3D face model texture reconstruction method based on a single image, such as Figure 4 As shown in FIG. 1 , it is the overall structure diagram of the method. The entire texture reconstruction process mainly includes the following modules: generating a personalized target geometric model, semantic segmentation of frontal face images, skin color migration, non-rigid deformation of frontal face images, texture mapping and texture fusion.
[0065] The specific implementation of each module is described in detail below in conjunction with specific embodiments.
[0066] See also Figure 5 , a flowchart of a 3D face model texture reconstruction method based on a single image is provided for an embodiment of the present application, and the process mainly includes the following steps:
[0067] S501: Acquire a frontal face image and a prefabricated texture image, and extract multiple 2D feature points in the frontal face image.
[0068] Since the frontal face image contains the richest details, in S501, when using a single image to reconstruct the texture of the 3D face model, the frontal face image is used, and an open source facial feature point detection library is used to extract multiple 2D feature points from the real frontal face image.
[0069] Taking the dlib library as an example, 68 2D feature points can be extracted and expressed in pixel coordinates (i.e. image coordinates):
[0070]
[0071] Among them, (u i , v i ) respectively represent the row and column numbers of the i-th (i=1, 2, ..., 68) 2D feature point in the frontal face image.
[0072] like Figure 6 As shown in FIG. 1 , a schematic diagram of 68 2D feature points extracted from a frontal face image is shown in FIG. Figure 6 As shown, 68 feature points are numbered in order, and each feature point represents a biological feature somewhere on the face, such as the corner of the eye, the corner of the mouth, etc.
[0073] S502: Determine a target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the pre-generated parameterized geometric model to obtain a target geometric model.
[0074] It can be seen from the generation process of the parameterized geometric model that the parameterized geometric model is obtained based on the linear combination of 50 shape parameters and 30 expression parameters. By estimating the 50 shape parameters and 30 expression parameters that meet the facial features of the target object through a real frontal face image, a personalized target geometric model of the target object can be obtained.
[0075] In S502, in the process of obtaining the personalized target geometric model, according to the biological feature sequence defined by the 68 2D feature points extracted from the frontal face image, 68 3D feature points are also defined in the parameterized geometric model. The positions of these 68 feature points in the parameterized geometric model are expressed in three-dimensional coordinates as follows:
[0076]
[0077] In S502, after obtaining the image coordinates of 68 2D feature points and the three-dimensional coordinates of 68 3D feature points, the global projection matrix between 2D and 3D is determined according to the correspondence between the 2D feature points and the 3D feature points, and the projection error and the projection error between 2D and 3D are calculated according to the global projection matrix. The values of 50 shape parameters and 30 expression parameters are continuously updated through at least one iterative optimization. When the projection error drops to a preset error range, the target geometric model is obtained.
[0078] Among them, the formula of the global projection matrix between 2D and 3D is as follows:
[0079]
[0080] In Formula 3, M is a global projection matrix of 2 rows and 3 columns, and (u, v) and (x, y, z) represent the image coordinates of the 2D feature points and the three-dimensional coordinates of the 3D feature points, respectively.
[0081] Since the initial multiple 3D feature points are obtained from a universal parametric geometric model, and considering that there may be errors between the universal parametric geometric model and the biological features of the target object, if the parametric geometric model is directly used as the personalized geometric model of the target object to calculate the global projection matrix, there may also be errors. Therefore, a linear equation system can be constructed through 68 2D-3D feature point pairs, and a more accurate global projection matrix M can be obtained by using the least squares method, so that ||P 68 -MX 68 The value of || is the smallest, thus obtaining a personalized target geometric model with the biometric characteristics of the target object.
[0082] For the specific implementation process of the target geometric model, see Figure 7 , mainly includes the following steps:
[0083] S5021: Determine an initial global projection matrix according to the image coordinates of multiple 2D feature points and the three-dimensional coordinates of corresponding 3D feature points.
[0084] In S5021, the 3D points obtained from the parameterized geometric model and corresponding to the multiple 2D feature points can be used as initial 3D points to calculate the initial global projection matrix between the 2D image and the 3D model.
[0085] S5022: According to the initial global projection matrix, shape parameters and expression parameters of the parameterized geometric model are optimized to reduce the projection error, and the three-dimensional coordinates of the 3D feature points corresponding to the multiple 2D feature points are updated.
[0086] In S5022, the initial global projection matrix optimizes the shape parameters S of the parameterized geometric model = {S 1 , S 2 , S3 , …, S 50} and expression parameter E={E 1 , E 2 , E 3 , …, E 30}, as the shape parameters and expression parameters change, the three-dimensional coordinates (i.e., positions) of multiple 3D feature points of the face also change, thereby reducing the projection error || P 68 -MX 68 The value of ||.
[0087] S5023: recalculating the global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D points after update, and stopping the optimization when the projection errors between the plurality of 2D feature points and the corresponding 3D feature points are within a preset error range.
[0088] In S5023, after one round of optimization, the global projection matrix is recalculated using the updated three-dimensional coordinates of the plurality of 3D feature points and the image coordinates of the corresponding 2D feature points, and the shape parameters S = {S 1 , S 2 , S 3 , …, S 50} and expression parameter E={E 1 , E 2 , E 3 , …, E 30}, recalculate the projection error between multiple 2D feature points and the corresponding 3D points || P 68 -MX 68 || value. Each time a projection error is obtained, it is determined whether the value of the projection error is within the preset error range. If not, the shape parameters and expression parameters are continuously optimized. If so, the optimization is stopped.
[0089] S5024: Taking the global projection matrix with the smallest projection error as the target global projection matrix, and obtaining the target geometric model according to the shape parameters and expression parameters corresponding to the target global projection matrix.
[0090] By continuously optimizing the shape parameters and expression parameters of the parametric geometric model, the projection error ||P 68 -MX 68 The value of || is minimized, and the global projection matrix corresponding to the minimum projection error is used as the target global projection matrix. According to the shape parameters and expression parameters corresponding to the target global projection matrix, the target geometric model that meets the biological characteristics of the target object is obtained.
[0091] S503: Correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image.
[0092] In the embodiment of the present application, the prefabricated texture image contains the complete texture of the entire head, including the face and hair, and can provide reference data for texture reconstruction. However, when generating the parameterized geometric model and the prefabricated texture image, the geometric part and the texture part are both represented based on the basis space, and the dimension of the basis space is limited by using PCA dimensionality reduction and linear combination. This inevitably leads to a low similarity between the final generated prefabricated texture image and the real texture of the target object, and a loss of facial detail information.
[0093] In order to improve the texture effect of the 3D face model, in some related technologies, based on the global projection matrix, the real front face image is directly mapped pixel by pixel to the target geometric model for texture mapping. Because the color value of the texture image is directly obtained from the front face image, the texture image restores the detailed information of the face texture to the greatest extent and ensures the authenticity of the texture. However, there are two problems with this method: First, the global projection matrix is estimated through the correspondence relationship of sparse feature points, and there is a certain estimation error. Moreover, using a single global projection matrix cannot align the facial details of each part, so that the texture image of the mapping has a certain deviation, which affects the user's perception; second, a single front face image can only provide the texture of the front face area, and the texture of the side and back is still missing. The 3D face model after mapping cannot be used directly.
[0094] Therefore, in S503, the embodiment of the present application uses the real frontal face image to perform color correction on the prefabricated texture image, thereby transferring the real skin color in the frontal face image to the prefabricated texture image to obtain the initial texture image. In this way, the initial texture image can not only ensure the integrity of the texture based on the prefabricated texture image, but also retain the texture details in the frontal face image, and has a high authenticity. For details on the generation process of the initial texture image, see Figure 8 , mainly includes the following steps:
[0095] S5031: Perform semantic segmentation on the frontal face image and determine the color mean of the pixels in each segmented area.
[0096] In S5031, a deep learning model may be used to perform semantic segmentation on the face. Fig. 9 , which is a schematic diagram of the result of face semantic segmentation based on the BiSeNet network provided in the embodiment of the present application. At present, face semantic segmentation technology is relatively mature, which is not the focus of this case and will not be described in detail here.
[0097] After obtaining each segmented area after semantic segmentation, the color mean of the pixel points in each skin color area is calculated, wherein each skin color area is the skin area excluding the image background, eyes, eyebrows, etc.
[0098] Through face semantic segmentation, we can accurately locate the face, nose, mouth, eyes, hair and other areas of a person. In this way, when reconstructing the texture, on the one hand, we can avoid the influence of non-skin color areas such as hair and eyes on the average skin color. On the other hand, when mapping the texture, we only need to use the skin color area for texture mapping to prevent the image background and hair from being mistakenly pasted on the initial texture image.
[0099] S5032: Correcting the color mean of each skin color area in the prefabricated texture image using the color mean of each skin color area to obtain an initial texture image.
[0100] In S5032, it is assumed that the color mean of each skin color area is The average color of each skin color area in the prefabricated texture image is First, calculate the color mean of each skin color area in the frontal face image The color mean of each skin color area in the prefabricated texture image The average skin color difference is denoted as Then, for each pixel in each skin color area in the prefabricated texture image, the color value of the pixel is added to the average skin color difference, so that the skin color distribution of the initial texture image is close to the actual skin color distribution of the target object, laying a good foundation for subsequent texture mapping and texture fusion.
[0101] S504: Determine a frontal face image after non-rigid deformation according to a mapping relationship between the plurality of 2D feature points and the corresponding 3D feature points.
[0102] In the process of generating a personalized target geometric model, the least squares method is used to obtain the target global projection matrix between the 2D image and the 3D model. The target global projection matrix makes the projection error between the 68 3D feature points on the target geometric model and the 68 2D feature points in the frontal face image || P 68 -MX 68 Since the least squares method is the global optimal solution, it ensures that the sum of the projection errors of the 68 feature point pairs is minimized, but when it comes to a specific feature point pair, there may be pixel-level deviations.
[0103] For example, Fig.10 As shown in the figure, the solid circles are the 68 2D feature points obtained from the frontal face image, and the solid triangles are the projection points of the 68 3D feature points on the target geometric model under the target global projection matrix M. It can be seen that there is a pixel error for each pair of solid circles and solid triangles. The existence of this error will cause the key features such as the corners of the eyes and mouth to be misaligned in the final texture map, which significantly affects the appearance of the final 3D face model.
[0104] Therefore, if the original frontal face image is directly used for texture mapping, the local features cannot be accurately aligned, affecting the appearance of the 3D face model. In order to solve this problem, in S504, the embodiment of the present application locally moves multiple 2D feature points based on the mapping relationship between multiple 2D feature points in the frontal face image and the corresponding 3D feature points in the target geometric model, so that the positions of the projection points of the multiple 2D feature points and the corresponding 3D feature points in the target geometric model coincide, and the frontal face image is driven to undergo non-rigid deformation, so that when the non-rigidly deformed frontal face image is used for texture mapping, the mapping accuracy of the facial feature points on the target geometric model can be improved, and the problem of local texture misalignment can be solved.
[0105] The non-rigid deformation process can be seen in Fig.11 , mainly includes the following steps:
[0106] S5041: Projecting the multiple 3D feature points onto a blank image having the same resolution and size as the frontal face image.
[0107] In S5041, the resolution of the blank image is the same as that of the frontal face image, which can ensure the consistency of the projection of the 3D feature points onto the frontal face image and the blank image.
[0108] S5042: Divide the frontal face image into multiple triangles according to multiple 2D feature points and the four corner points and four side midpoints of the frontal face image; and divide the blank image into multiple triangles according to the projection points of multiple 3D feature points on the blank image and the four corner points and four side midpoints of the blank image.
[0109] In S5042, for the frontal face image, the extracted 68 2D feature points, four corner points and four side midpoints, a total of 76 points, are used as mesh vertices. According to certain rules, the frontal face image is divided into multiple three-level shapes using these 76 mesh vertices.
[0110] For example, Figure 6 The three 2D feature points numbered {18, 19, 37} form a triangle, and the three 2D feature points numbered {19, 37, 38} form another triangle.
[0111] The embodiment of the present application does not impose any restrictive requirements on the order of the subdivision rules, but the multiple triangles obtained by the final subdivision need to occupy the entire image without overlapping each other. Fig.12 , which is a schematic diagram of the segmentation of a frontal facial image provided in an embodiment of the present application.
[0112] At the same time, for the blank image, the projection points of the 68 3D feature points on the blank image, the four corner points and the four side midpoints, a total of 76 points, are used as mesh vertices. According to the segmentation rules and order of the frontal face image, these 76 mesh vertices are used to segment the blank image into multiple three-level shapes. Fig.13 , which is a schematic diagram of the segmentation of a blank image provided in an embodiment of the present application.
[0113] S5043: Calculate the local affine transformation matrix between each triangle in the frontal face image and the corresponding triangle in the blank image.
[0114] For the convenience of description, the triangle obtained by subdividing the frontal face image is recorded as the first triangle, and the triangle obtained by subdividing the blank image is recorded as the second triangle.
[0115] In S5043, each first triangle obtained by decomposing the frontal face image is traversed, and for each traversed first triangle, the following operations are performed: the second triangle corresponding to the first triangle in the blank image is determined, and a local affine transformation matrix is uniquely solved based on the correspondence between the three mesh vertices of the first triangle and the three mesh vertices of the second triangle.
[0116] S5044: According to each local affine transformation matrix, fill the image area of the corresponding triangle in the front face image into the triangle of the blank image to obtain the front face image after non-rigid deformation.
[0117] In S5044, for each local affine transformation matrix, the first triangle corresponding to the local affine transformation matrix is cut out from the frontal face image, and the cut out first triangle is deformed into the shape of the corresponding second triangle in the blank image through the local affine transformation matrix, and the image area of the deformed first triangle is filled into the corresponding second triangle. Fig.14 , a schematic diagram of a filling process of a triangular area provided in an embodiment of the present application.
[0118] The above operation is performed on each pair of triangles in the subdivision of the frontal face image and the blank image until the blank image is filled, thereby obtaining a frontal face image after non-rigid deformation.
[0119] By performing non-rigid deformation on the frontal face image, the position of each 2D feature point on the frontal face image can be accurately aligned with the projection point position of the corresponding 3D feature point. Therefore, when the non-rigidly deformed frontal face image is used for texture mapping, the key part features on the texture map can be completely aligned with the target geometric model, thus solving the problem of texture misalignment.
[0120] S505: According to the target global projection matrix, the color values of the pixels in the deformed frontal face image are assigned to the pixels in the initial texture image to obtain a target texture image for texture mapping of the target geometric model.
[0121] In the embodiment of the present application, texture mapping can be performed between the front face image after non-rigid deformation and the prefabricated texture image based on the target global projection matrix. Texture mapping refers to assigning the color value of the front face image to the texture space of the 3D face model according to the pixel-by-pixel interpolation method, so that the 3D face model has the same texture information as the target object, and the 3D face model has the skin detail information of the target object to the greatest extent.
[0122] Texture mapping involves geometric model space, RGB image space and texture space. The relationship between the three spaces is as follows: Fig.15 As shown. Based on the target global projection matrix, the conversion between the geometric model space and the RGB image space is realized. Based on the predefined geometric UV coordinate display method when generating the parameterized geometric model and the prefabricated texture image, the conversion between the geometric model space and the texture space is realized. Thus, with the help of the geometric model space, the conversion between the RGB image space and the texture space is realized.
[0123] Usually, the outer surface of the target geometric model is composed of a plurality of triangular patches, and each triangular patch corresponds to an index. In S505, each triangular patch in the face region of the target geometric model is traversed through the patch index, and based on the relationship between the geometric model space, the RGB image space, and the texture space, the color value of each pixel in the front face image after non-rigid deformation is mapped to the prefabricated texture image, thereby obtaining a target texture image for texture mapping the target geometric model.
[0124] See also Fig.16 , for each triangular patch in the face area of the target geometric model, perform the following operations:
[0125] S5051: Determine the texture points corresponding to the vertices contained in the triangular patch in the initial texture image.
[0126] like Fig.15 As shown, assuming that the three vertices of the triangle patch are represented by X 1 , X 2 , X 3 Indicates that the three vertices X of the triangular patch are obtained based on the predefined geometric UV coordinate display method when generating the parametric geometric model and the prefabricated texture image. 1 , X 2 , X 3 The corresponding texture point in the prefabricated texture image (i.e., texture space) is denoted as T 1 、T2 、T 3 .
[0127] S5052: Determine the two-dimensional projection points of the vertices included in the triangular face in the deformed frontal face image according to the target global projection matrix.
[0128] When generating the target geometric model, the target global projection matrix M of the 3D geometric model space and RGB space is calculated through the least squares optimization algorithm. The three vertices X contained in the triangle patch can be calculated through the target global projection matrix M. 1 , X 2 , X 3 The two-dimensional projection point in the RGB space (i.e., the frontal face image after non-rigid deformation) is as follows: Fig.15 As shown, they are denoted as P 1 , P 2 , P 3 , the formula is as follows:
[0129]
[0130] S5053: Calculate the centroid coordinates of each pixel point in the first triangular area composed of three texture points in the first triangular area, determine the pixel point corresponding to the centroid coordinate in the second triangular area composed of three two-dimensional projection points, and assign the color value of the pixel point in the second triangular area to the corresponding pixel point in the first triangular area.
[0131] In S5053, for the first triangular area ΔT composed of three texture points corresponding to the vertices contained in the triangular patch, 1 T 2 T 3 Each pixel in (t x , t y ), first, calculate the pixel point in the first triangular area ΔT 1 T 2 T 3 The barycentric coordinates in are recorded as (α, β, γ), where α+β+γ=1. Then, in the second triangular area ΔP composed of the three two-dimensional projection points corresponding to the vertices contained in the triangular facet, 1 P 2 P 3 In the example, the pixel point corresponding to the centroid coordinates (α, β, γ) is determined. Finally, the second triangular area ΔP 1 P 2 P 3 The color value of the pixel in the first triangle area (i.e., texture space) is assigned to the pixel (t x , t v ).
[0132] In some embodiments, considering that the centroid coordinates are not necessarily integers, there may be no corresponding pixel point in the second triangular area composed of the three two-dimensional projection points. At this time, first obtain the pixel points around the corresponding position point of the centroid coordinate in the second triangular area, and then perform bilinear interpolation on the color values of the pixel points around the corresponding position point to obtain the target color value, and finally assign the target color value to the pixel point corresponding to the centroid coordinate in the first triangular area.
[0133] The above color value assignment process is called "rasterization" in computer graphics. In the process of continuous "rasterization", the color values of some pixels in the prefabricated texture image will gradually be replaced by the color values of the corresponding pixels in the front face image after non-rigid deformation, so that the target texture image for texture mapping of the target geometric model has the real skin detail information of the target object.
[0134] In order to ensure that the reconstructed 3D face model has complete texture, the embodiment of the present application uses a pre-generated prefabricated texture image, and then adopts the "rasterization" method to replace the color values of some pixels in the prefabricated texture image. In the "rasterization" process, only the texture corresponding to the triangular patch index of the face area saved when the parameterized geometric model is generated will be replaced. Although the prefabricated texture image is color corrected using the color mean of each skin color area in the real frontal face image, there will inevitably be obvious boundary marks between the replaced texture and the non-replaced texture after "rasterization".
[0135] To solve the above problem, in some embodiments, after obtaining the target texture image, the following is further performed: the texture area in the target texture image that is replaced by the color value of the pixel points in the frontal face image is used as the foreground, and the texture area in the target texture image that is not replaced by the color value of the pixel points in the frontal face image is used as the background, and the foreground and background are merged using the Poisson Editing algorithm to smooth the color of the boundary part in the target texture image, thereby eliminating the problem of uneven boundary color transition in the target texture image after "rasterization", and obtaining a complete texture with color consistency and real skin details.
[0136] In the single-image-based 3D face model texture reconstruction method provided in the present application, a prefabricated texture image corresponding to a pre-generated parameterized geometric model is obtained, and the color value of the preset texture image is corrected by using the color mean of each skin color area in the real frontal face image through semantic segmentation of the frontal face image, thereby improving the authenticity of the texture while retaining the complete face texture; at the same time, according to the mapping relationship between multiple 2D feature points and corresponding 3D feature points, a non-rigidly deformed frontal face image is obtained, so that when the target global projection matrix is determined according to the image coordinates of the multiple 2D feature points extracted from the frontal face image and the three-dimensional coordinates of the corresponding 3D feature points in the parameterized geometric model for texture mapping, the problem of local texture misalignment is solved and the accuracy of texture reconstruction is improved; and after obtaining the complete target texture image with real skin details, the foreground and background are fused, thereby eliminating the problem of uneven boundary color transition in the target texture image after "rasterization", and improving the color consistency of the target texture image.
[0137] Based on the same technical concept, the embodiment of the present application provides a reconstruction device, which can be a client such as a laptop computer, desktop computer, smart phone, tablet, VR glasses, AR glasses, etc. with data processing capabilities, and can also be a server for implementing the interactive process, including but not limited to a micro server, cloud server, server cluster, etc. The reconstruction device can implement the steps of the 3D face model texture reconstruction method for a single image in the above embodiment, and can achieve the same technical effect.
[0138] See also Fig.17 , the reconstruction device includes a processor 1701 and a memory 1702, wherein the memory 1702 and the processor 1701 are connected via a bus 1703;
[0139] The memory 1702 stores a computer program, and the processor 1701 performs the following operations according to the computer program:
[0140] Acquire a frontal face image and a prefabricated texture image, and extract multiple 2D feature points in the frontal face image;
[0141] Determine a target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the pre-generated parameterized geometric model to obtain the target geometric model;
[0142] Correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image;
[0143] Determine a frontal face image after non-rigid deformation according to a mapping relationship between a plurality of 2D feature points and corresponding 3D feature points;
[0144] According to the target global projection matrix, the color values of the pixels in the deformed frontal face image are assigned to the pixels in the initial texture image to obtain a target texture image for texture mapping of the target geometric model.
[0145] Optionally, the processor 1701 corrects the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image, and the specific operation is:
[0146] Performing semantic segmentation on the frontal face image and determining the color mean of the pixel points in each skin color area;
[0147] The color mean values of the skin color areas in the prefabricated texture image are used to correct the color mean values of the skin color areas to obtain an initial texture image.
[0148] Optionally, the processor 1701 determines the frontal face image after non-rigid deformation according to the mapping relationship between the multiple 2D feature points and the corresponding 3D feature points, and the specific operation is:
[0149] Projecting the multiple 3D feature points onto a blank image having the same resolution and size as the frontal face image;
[0150] Dividing the front face image into a plurality of triangles according to a plurality of 2D feature points and four corner points and four side midpoints of the front face image, and dividing the blank image into a plurality of triangles according to projection points of a plurality of 3D feature points on the blank image and four corner points and four side midpoints of the blank image;
[0151] Calculating a local affine change matrix between each triangle in the frontal face image and a corresponding triangle in the blank image;
[0152] According to each local affine change matrix, the image area of the corresponding triangle in the front face image is filled into the triangle of the blank image to obtain the front face image after non-rigid deformation.
[0153] Optionally, the processor 1701 assigns the color values of the pixels in the deformed frontal face image to the pixels in the initial texture image according to the target global projection matrix to obtain a target texture image for texture mapping the target geometric model, and the specific operation is:
[0154] For each triangular patch in the face region of the target geometric model, the following operations are performed to obtain a target texture image for texture mapping of the target geometric model:
[0155] Determine the texture points corresponding to the vertices included in the triangular patch in the initial texture image;
[0156] Determining two-dimensional projection points of vertices included in the triangular face patch in the deformed frontal face image according to the target global projection matrix;
[0157] Calculate the centroid coordinates of each pixel point in the first triangular area composed of three texture points, determine the pixel point corresponding to the centroid coordinate in the second triangular area composed of three two-dimensional projection points, and assign the color value of the pixel point in the second triangular area to the corresponding pixel point in the first triangular area.
[0158] Optionally, when the barycentric coordinates have no corresponding pixel point within the second triangular area formed by the three two-dimensional projection points, the processor 1701 further executes:
[0159] Obtaining each pixel point around the corresponding position point of the center of gravity coordinate in the second triangular area;
[0160] Perform bilinear interpolation on the color values of each pixel point around the corresponding position point to obtain the target color value;
[0161] The target color value is assigned to the pixel point corresponding to the centroid coordinate within the first triangular area.
[0162] Optionally, after obtaining the target texture image, the processor 1701 further executes:
[0163] Taking the texture area in the target texture image that is replaced by the color value of the pixel point in the front face image as the foreground;
[0164] Using the texture area in the target texture image that is not replaced by the color value of the pixel point in the front face image as the background;
[0165] The foreground and the background are merged by using a Poisson editing algorithm to smooth the color of the boundary part in the target texture image.
[0166] Optionally, the processor 1701 determines the target global projection matrix to obtain the target geometric model according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the pre-generated parameterized geometric model, and the specific operation is:
[0167] Determine an initial global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points;
[0168] According to the initial global projection matrix, shape parameters and expression parameters of the parameterized geometric model are optimized to reduce projection errors, and three-dimensional coordinates of 3D feature points corresponding to the updated plurality of 2D feature points are obtained;
[0169] Recalculate the global projection matrix according to the image coordinates of the multiple 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points after update, and stop the optimization when the projection errors between the multiple 2D feature points and the corresponding 3D feature points are within a preset error range;
[0170] The global projection matrix with the smallest projection error is used as the target global projection matrix, and the target geometric model is obtained according to the shape parameters and expression parameters corresponding to the target global projection matrix.
[0171] It should be noted that Fig.17 This is just an example, and provides the necessary hardware for the reconstruction device to implement the steps of the method for fusing the human body model and the clothing model provided in the embodiment of the present application. Optionally, the reconstruction device also includes a display screen, a microphone, a speaker, a power supply, a communication interface, etc.
[0172] Embodiments of the present application Fig.17 The processor involved may be a central processing unit (CPU), a general-purpose processor, a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0173] See also Fig.18 , is a functional structure diagram of a reconstruction device provided in an embodiment of the present application, the reconstruction device mainly includes an image acquisition module 1801, a geometric reconstruction module 1802, a texture correction module 1803, an image deformation module 1804 and a color assignment module 1805, wherein:
[0174] The image acquisition module 1801 is used to acquire a frontal face image and a prefabricated texture image, and extract a plurality of 2D feature points in the frontal face image;
[0175] A geometry reconstruction module 1802 is used to determine a target global projection matrix to obtain a target geometry model according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the pre-generated parameterized geometry model;
[0176] The texture correction module 1803 is used to correct the color value of the prefabricated texture image according to the front face image to obtain an initial texture image;
[0177] An image deformation module 1804 is used to determine a frontal face image after non-rigid deformation according to a mapping relationship between a plurality of 2D feature points and corresponding 3D feature points;
[0178] The color assignment module 1805 is used to assign the color values of the pixels in the deformed frontal face image to the pixels in the initial texture image according to the target global projection matrix, so as to obtain a target texture image for texture mapping of the target geometric model.
[0179] The specific implementation of the above-mentioned functional modules can be found in the above-mentioned embodiments, and will not be described again here.
[0180] An embodiment of the present application also provides a computer-readable storage medium for storing some instructions. When these instructions are executed, a 3D face model texture reconstruction method based on a single image in the aforementioned embodiment can be completed.
[0181] An embodiment of the present application also provides a computer program product for storing a computer program, wherein the computer program is used to execute a 3D face model texture reconstruction method based on a single image in the aforementioned embodiment.
[0182] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0183] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0184] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0185] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0186] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A 3D face model texture reconstruction method based on a single image, characterized in that: include: Acquire a frontal face image and a prefabricated texture image, and extract multiple 2D feature points in the frontal face image; The prefabricated texture image is used to perform texture mapping on the parameterized geometric model; the parameterized geometric model is a 3D parameterized geometric model that is pre-generated based on an existing human head data set and represents the average characteristics of most human faces; the prefabricated texture image includes a complete human face texture; Determine a target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the parameterized geometric model, and obtain a target geometric model according to shape parameters and expression parameters corresponding to the target global projection matrix; Correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image; Based on the mapping relationship between the plurality of 2D feature points and the corresponding 3D feature points in the target geometric model, the plurality of 2D feature points are locally moved so that the positions of the projection points of the plurality of 2D feature points and the corresponding 3D feature points in the target geometric model coincide with each other, the frontal face image is driven to undergo non-rigid deformation, and the frontal face image after the non-rigid deformation is determined; According to the target global projection matrix, the color values of the pixels in the deformed frontal face image are assigned to the pixels in the initial texture image to obtain a target texture image for texture mapping of the target geometric model.
2. The method according to claim 1, characterized in that The step of correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image includes: Performing semantic segmentation on the frontal face image and determining the color mean of the pixel points in each skin color area; The color mean values of the skin color areas in the prefabricated texture image are used to correct the color mean values of the skin color areas to obtain an initial texture image.
3. The method according to claim 1, characterized in that The method of locally moving the plurality of 2D feature points based on the mapping relationship between the plurality of 2D feature points and the corresponding 3D feature points in the target geometric model so that the positions of the projection points of the plurality of 2D feature points and the corresponding 3D feature points in the target geometric model coincide with each other, driving the front face image to undergo non-rigid deformation, and determining the front face image after the non-rigid deformation, comprises: Projecting the multiple 3D feature points onto a blank image having the same resolution and size as the frontal face image; Dividing the front face image into a plurality of triangles according to a plurality of 2D feature points and four corner points and four side midpoints of the front face image, and dividing the blank image into a plurality of triangles according to projection points of a plurality of 3D feature points on the blank image and four corner points and four side midpoints of the blank image; Calculating a local affine change matrix between each triangle in the frontal face image and a corresponding triangle in the blank image; According to each local affine change matrix, the image area of the corresponding triangle in the front face image is filled into the triangle of the blank image to obtain the front face image after non-rigid deformation.
4. The method according to claim 1, characterized in that The step of assigning the color values of the pixels in the deformed frontal face image to the pixels in the initial texture image according to the target global projection matrix to obtain a target texture image for texture mapping the target geometric model includes: For each triangular patch in the face region of the target geometric model, the following operations are performed to obtain a target texture image for texture mapping of the target geometric model: Determine the texture points corresponding to the vertices included in the triangular patch in the initial texture image; Determining two-dimensional projection points of vertices included in the triangular face patch in the deformed frontal face image according to the target global projection matrix; Calculate the centroid coordinates of each pixel point in the first triangular area composed of three texture points, determine the pixel point corresponding to the centroid coordinate in the second triangular area composed of three two-dimensional projection points, and assign the color value of the pixel point in the second triangular area to the corresponding pixel point in the first triangular area.
5. The method according to claim 4, characterized in that When the barycentric coordinates have no corresponding pixel point in the second triangular area formed by the three two-dimensional projection points; Obtaining each pixel point around the corresponding position point of the center of gravity coordinate in the second triangular area; Perform bilinear interpolation on the color values of each pixel point around the corresponding position point to obtain the target color value; The target color value is assigned to the pixel point corresponding to the centroid coordinate within the first triangular area.
6. The method according to claim 1, characterized in that After obtaining the target texture image, the method further includes: Taking the texture area in the target texture image that is replaced by the color value of the pixel point in the front face image as the foreground; Using the texture area in the target texture image that is not replaced by the color value of the pixel point in the front face image as the background; The foreground and the background are merged by using a Poisson editing algorithm to smooth the color of the boundary part in the target texture image.
7. The method according to any one of claims 1 to 6, characterized in that Determining the target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the parameterized geometric model includes: Determine an initial global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points; According to the initial global projection matrix, shape parameters and expression parameters of the parameterized geometric model are optimized to reduce projection errors, and three-dimensional coordinates of 3D feature points corresponding to the updated plurality of 2D feature points are obtained; Recalculate the global projection matrix according to the image coordinates of the multiple 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points after update, and stop the optimization when the projection errors between the multiple 2D feature points and the corresponding 3D feature points are within the preset error range; The global projection matrix with the smallest projection error is used as the target global projection matrix.
8. A reconstruction device, characterized in that comprising a processor and a memory, wherein the memory and the processor are connected via a bus; The memory stores a computer program, and the processor performs the following operations according to the computer program: Obtain a frontal face image and a prefabricated texture image, and extract multiple 2D feature points in the frontal face image; the prefabricated texture image is used to perform texture mapping on a parameterized geometric model; the parameterized geometric model is a 3D parameterized geometric model pre-generated based on an existing head data set and representing average characteristics of most human faces; the prefabricated texture image includes a complete face texture; Determine a target global projection matrix according to the image coordinates of the plurality of 2D feature points and the three-dimensional coordinates of the corresponding 3D feature points in the parameterized geometric model, and obtain a target geometric model according to shape parameters and expression parameters corresponding to the target global projection matrix; Correcting the color value of the prefabricated texture image according to the frontal face image to obtain an initial texture image; Based on the mapping relationship between the plurality of 2D feature points and the corresponding 3D feature points in the target geometric model, the plurality of 2D feature points are locally moved so that the positions of the projection points of the plurality of 2D feature points and the corresponding 3D feature points in the target geometric model coincide with each other, the frontal face image is driven to undergo non-rigid deformation, and the frontal face image after the non-rigid deformation is determined; According to the target global projection matrix, the color values of the pixels in the deformed frontal face image are assigned to the pixels in the initial texture image to obtain a target texture image for texture mapping of the target geometric model.
9. The reconstruction device according to claim 8, characterized in that The processor corrects the color value of the prefabricated texture image according to the front face image to obtain an initial texture image, and the specific operation is: Performing semantic segmentation on the frontal face image and determining the color mean of the pixel points in each skin color area; The color mean values of the skin color areas in the prefabricated texture image are used to correct the color mean values of the skin color areas to obtain an initial texture image.
10. The reconstruction device according to claim 8, characterized in that The processor locally moves the multiple 2D feature points based on the mapping relationship between the multiple 2D feature points and the corresponding 3D feature points in the target geometric model, so that the positions of the projection points of the multiple 2D feature points and the corresponding 3D feature points in the target geometric model coincide, drives the front face image to undergo non-rigid deformation, and determines the front face image after the non-rigid deformation, and the specific operations are: Projecting the multiple 3D feature points onto a blank image having the same resolution and size as the frontal face image; Dividing the front face image into a plurality of triangles according to a plurality of 2D feature points and four corner points and four side midpoints of the front face image, and dividing the blank image into a plurality of triangles according to projection points of a plurality of 3D feature points on the blank image and four corner points and four side midpoints of the blank image; Calculating a local affine change matrix between each triangle in the frontal face image and a corresponding triangle in the blank image; According to each local affine change matrix, the image area of the corresponding triangle in the front face image is filled into the triangle of the blank image to obtain the front face image after non-rigid deformation.
