Face model generation method and device, equipment and storage medium

By using face registration and texture mapping technology, realistic artificial face models are generated, solving the problems of privacy leakage and portrait rights infringement in the research and development of 3D face-related products. It is applicable to medical, industrial and commercial fields.

CN115471613BActive Publication Date: 2026-11-27SHINING 3D TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211170645.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-23
Publication Date
2026-11-27
Estimated Expiration
2042-09-23

AI Technical Summary

Technical Problem

Existing 3D face-related products are prone to privacy leaks and portrait rights violations during the research and development process, especially when using real facial data for testing or training.

Method used

By acquiring the real face model and template face model of the target user, a pre-set face registration algorithm is used for registration processing, and the target texture unfolding map is used for texture mapping. The texture color of the real face model is replaced with the texture color of the texture-mapped template face model to generate the target face model.

Benefits of technology

It enables the modification of textures from real human face models while preserving the same facial shape and expression, generating realistic artificial face models, avoiding privacy leaks and portrait rights violations, and meeting the needs of medical, industrial, and commercial applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115471613B_ABST
    Figure CN115471613B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a face model generation method, device and equipment and a storage medium. The method comprises: obtaining a real face model of a target user and obtaining a template face model; performing face registration processing on the template face model based on the real face model using a preset face registration algorithm to obtain a registered template face model; performing texture mapping processing on the registered template face model using a target texture unfolding graph to obtain a texture-mapped template face model; and replacing the texture color on the real face model with the texture color on the texture-mapped template face model to obtain a target face model. According to the embodiments of the present disclosure, an artificial face can be obtained by modifying the texture of the real face model. Thus, a series of problems such as privacy leakage and infringement of portrait rights caused by directly using the real face model can be avoided, and the use demand for the face model in the medical, industrial, commercial and other fields can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device, and storage medium for generating a face model. Background Technology

[0002] With the development of computer technology, products related to 3D faces, such as 3D facial scanners and 3D facial recognition access control systems, have emerged, promoting the transformation of face research from 2D space to 3D space.

[0003] However, during the research and development of products related to 3D faces, 3D face data is often used for testing or training, which can easily lead to a series of problems such as privacy leaks and infringement of portrait rights. Summary of the Invention

[0004] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, the present disclosure provides a method, apparatus, device and storage medium for generating a face model.

[0005] A first aspect of this disclosure provides a method for generating a face model, the method comprising:

[0006] Obtain the target user's real face model and obtain the template face model;

[0007] Based on a real face model, a preset face registration algorithm is used to perform face registration processing on the template face model to obtain the registered template face model;

[0008] The registered template face model is texture-mapped using the target texture unfolded map to obtain the texture-mapped template face model.

[0009] The target face model is obtained by replacing the texture color on the real face model with the texture color on the texture-mapped template face model.

[0010] A second aspect of this disclosure provides an apparatus for generating a face model, the apparatus comprising:

[0011] The first acquisition module is used to acquire the real face model of the target user and the template face model;

[0012] The face registration module is used to process the face registration of the template face model based on the real face model and using a preset face registration algorithm to obtain the registered template face model.

[0013] The texture mapping module is used to perform texture mapping on the registered template face model using the target texture unfolded map, so as to obtain the texture-mapped template face model.

[0014] The texture replacement module is used to replace the texture color on the real face model with the texture color on the texture-mapped template face model to obtain the target face model.

[0015] A third aspect of this disclosure provides an electronic device, the server comprising: a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the method of the first aspect described above.

[0016] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the method of the first aspect described above.

[0017] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0018] This embodiment of the disclosure can obtain a real face model of a target user and a template face model. Based on the real face model, a preset face registration algorithm is used to register the template face model, resulting in a registered template face model. Then, a target texture unfolding map is used to perform texture mapping on the registered template face model, resulting in a texture-mapped template face model. The texture color on the real face model is then replaced with the texture color on the texture-mapped template face model, thus obtaining the target face model. Using this technical solution, the texture of the real face model can be replaced to match the texture of the texture-mapped template face model, and the texture-replaced real face model can be used as the target face model. This achieves the goal of obtaining an artificial face by modifying the texture of the real face model. This avoids a series of problems such as privacy leaks and infringement of portrait rights caused by directly using real face models, and also meets the needs of face models in medical, industrial, and commercial fields. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of a method for generating a face model provided in an embodiment of this disclosure;

[0022] Figure 2 This is a schematic diagram of a realistic human face model provided in an embodiment of this disclosure;

[0023] Figure 3 This is a schematic diagram of a template face model provided in a disclosed embodiment;

[0024] Figure 4 This is a schematic diagram of a registered template face model provided in an embodiment of this disclosure;

[0025] Figure 5 This is a schematic diagram of the structure of a texture unfolded map provided in an embodiment of this disclosure;

[0026] Figure 6 It is a publicly provided logical diagram of a method for obtaining a target texture unfolded image;

[0027] Figure 7 This is a logical schematic diagram of texture mapping for a registered template face model provided in an embodiment of this disclosure;

[0028] Figure 8 This is a schematic diagram of a real face model and a texture-mapped template face model provided in an embodiment of this disclosure;

[0029] Figure 9 This is a schematic diagram of the structure of a face model generation device provided in an embodiment of this disclosure;

[0030] Figure 10 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. Detailed Implementation

[0031] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0032] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0033] Figure 1 This is a flowchart illustrating a method for generating a face model according to an embodiment of this disclosure. This method can be executed by an electronic device. The electronic device can be exemplarily understood as a device with page display capabilities, such as a mobile phone, tablet computer, laptop computer, desktop computer, or smart TV. Figure 1 As shown, the method provided in this embodiment includes the following steps:

[0034] S110, Obtain the real face model of the target user and obtain the template face model.

[0035] Specifically, the real face model is a three-dimensional face model obtained by performing a three-dimensional (3D) scan of the target user's real face. Therefore, the real face model is the user's real face model.

[0036] Specifically, the template face model is a 3D face model used in the subsequent target face model generation process. The template face model can be a real face model of a user different from the target user, an average face model of multiple sample face models, or a virtual face model designed by the designer, etc., without limitation here.

[0037] Specifically, the specific forms of representation of real face models and template face models may include, for example, 3D mesh models, but are not limited to these.

[0038] The following detailed explanation uses real human face models and template human face models as examples of 3D mesh models. A 3D mesh model typically includes multiple vertices, which are interconnected to form multiple meshes (patches) that constitute the surface of the 3D human face model. Therefore, a real human face model may include multiple second 3D vertices, while a template human face model may include multiple first 3D vertices.

[0039] In some embodiments, S110 may include: reading from a local device or receiving from another electronic device or from the cloud a real face model and a template face model of the target user. However, it is not limited to this.

[0040] Obtaining the target user's real face model and obtaining the template face model can be done simultaneously or at different times. The real face model and the template face model can be obtained from the same source or from different sources.

[0041] S120. Based on the real face model, a preset face registration algorithm is used to perform face registration processing on the template face model to obtain the registered template face model.

[0042] Specifically, the face registration process involves deforming multiple meshes in the template face model (i.e., moving the position of the first three-dimensional vertex) to make the deformed template face model (i.e., the registered template face model) fit the real face model.

[0043] Understandably, since the registered template face model fits perfectly with the real face model, for each second 3D vertex on the real face model, we can determine the specific location of the projection point when the second 3D vertex is vertically projected onto the surface of the registered template face model, given that the registered template face model and the real face model overlap. We can also determine the multiple first 3D vertices corresponding to the face containing the projection point. The specific location of the projection point can be obtained through interpolation of the multiple first 3D vertices corresponding to the face containing the projection point. Therefore, face registration processing can reveal the correspondence between the second 3D vertices on the real face model and the first 3D vertices on the registered template face model.

[0044] It's also understandable that facial model features typically include shape and texture. Shape includes face shape and expression. Face shape includes information representing facial plumpness, facial feature shape, and the spatial arrangement of facial features. Expression represents emotional information. Texture includes information representing skin tone, skin texture, eyebrow shape, whether there are double eyelids, whether there are glasses, and the color and shape of the glasses. Because the registered template facial model fits closely to the real facial model, the registered template facial model has the same face shape and expression as the real facial model (i.e., it has the same shape).

[0045] Specifically, the preset face registration algorithm may include, but is not limited to, non-rigid iterative closest point (NICP), point distribution model (PDM) algorithms, or Gaussian process morphable model (GPMM) algorithms.

[0046] For example, Figure 2 This is a schematic diagram of a realistic human face model provided in an embodiment of this disclosure. Figure 3 This is a schematic diagram of a template face model provided in a public embodiment. Figure 4 This is a schematic diagram of a registered template face model provided in an embodiment of this disclosure. See also... Figures 2 to 4 ,based on Figure 2 The real face model shown uses a preset face registration algorithm. Figure 3 The template face model shown is used for face registration processing to obtain... Figure 4 The template face model shown is the one after registration.

[0047] S130. Use the target texture unfolding map to perform texture mapping processing on the registered template face model to obtain the texture-mapped template face model.

[0048] Specifically, the target texture unfolded map is a texture unfolded map used for texture mapping of the registered template face model. The texture unfolded map can be understood as the result of unfolding the texture map corresponding to the 3D model in 2D. For example, Figure 5 This is a schematic diagram of the structure of a texture unfolded map provided in an embodiment of this disclosure, such as... Figure 5 The texture unfolded diagram shown is the result of unfolding the texture map corresponding to a 3D face model.

[0049] Specifically, texture mapping processing maps the texture colors on the target texture unfolded map onto the registered template face model, so that the registered template face model has the texture feature.

[0050] Those skilled in the art can use any possible texture mapping algorithm to perform texture mapping processing on the registered template face model, and there are no limitations here.

[0051] S140. Replace the texture color on the real face model with the texture color on the texture-mapped template face model to obtain the target face model.

[0052] Specifically, the texture colors on the real face model are detextured to obtain a detextured real face model. The texture colors on the texture-mapped template face model are then transferred to the detextured real face model, so that the texture of the texture-transferred real face model (i.e., the target face model) is consistent with the texture on the texture-mapped template face model. In this way, the texture of the real face model can be modified.

[0053] Those skilled in the art can use any possible texture transfer technique to transfer the texture colors from the texture-mapped template face model to the detextured real face model; no limitation is made here. For example, face registration technology can be used, but it is not limited to this.

[0054] It is understandable that the target face model differs in texture from the real face model. Therefore, the target face model is not a real face model, but an artificial face model, which can be legally used in medical, industrial, or commercial fields to achieve the effect of desensitization. When storing or transmitting these 3D face models to other devices via the network, the leakage of sensitive user information in the files can be avoided. Furthermore, since the modification of the texture of the real face model is fully automated in this embodiment, no manual intervention is required, thus improving efficiency and saving labor costs. Moreover, since the target face model and the real face model have the same face shape and expression, differing only in texture, this artificial face model can be made to resemble a real face model more closely, i.e., more realistic, retaining some features of a real face. Thus, it can provide artificial 3D face models for products related to 3D face models in fields such as 3D face animation, orthodontics, reconstructive surgery, plastic surgery, smile design, and face recognition. These 3D face models can be used for model training or testing. Moreover, because these 3D face models are more realistic and retain some features of real faces, they are more valuable for training or testing, thus improving the accuracy of model training or testing.

[0055] This method can also be used to expand the training or testing sample library.

[0056] This embodiment of the disclosure can obtain a real face model of a target user and a template face model. Based on the real face model, a preset face registration algorithm is used to register the template face model, resulting in a registered template face model. Then, a target texture unfolding map is used to perform texture mapping on the registered template face model, resulting in a texture-mapped template face model. The texture color on the real face model is then replaced with the texture color on the texture-mapped template face model, thus obtaining the target face model. Using this technical solution, the texture of the real face model can be replaced to match the texture of the texture-mapped template face model, and the texture-replaced real face model can be used as the target face model. This achieves the goal of obtaining an artificial face by modifying the texture of the real face model. This avoids a series of problems such as privacy leaks and infringement of portrait rights caused by directly using real face models, and also meets the needs of face models in medical, industrial, and commercial fields.

[0057] In another embodiment of this disclosure, obtaining a template face model includes: S111, obtaining multiple sample face models of multiple sample users; S112, processing the multiple sample face models to obtain a template face model.

[0058] Specifically, the sample face model is a three-dimensional face model obtained by 3D scanning the real face of the sample user.

[0059] The specific form of the sample face model may include, for example, a 3D mesh model, but is not limited to this.

[0060] Specifically, an average face model can be obtained by averaging multiple sample face models, and then the average face model can be used as a template face model.

[0061] The average face model of multiple sample face models can be calculated using any possible face averaging algorithm. For example, the 3D Morphable Models (3DMM) algorithm can be used to calculate the average face model of multiple sample face models, but it is not limited to this.

[0062] Understandably, by averaging multiple sample face models to obtain a template face model, the acquisition of the template face model can be simplified, and the template face model can be made more like a real face model, that is, more realistic.

[0063] In another embodiment of this disclosure, a texture mapping process is performed on the registered template face model using a target texture unfolded map to obtain a texture-mapped template face model, including:

[0064] S131. Obtain the target texture unfolded map, which includes multiple texture coordinates.

[0065] In some embodiments, the target texture unfolded map is a virtual texture unfolded map designed by the designer.

[0066] In other embodiments, S131 may include: randomly selecting a texture coefficient from multiple texture coefficients in a face texture database as a target texture coefficient; and using a three-dimensional deformable face model algorithm to generate a target texture unfolded map corresponding to the target texture coefficient.

[0067] Specifically, the target texture coefficients are texture coefficients used to generate the target texture unfolded map, where the texture coefficients are used to characterize the texture of the face model.

[0068] Specifically, the face texture database includes multiple texture coefficients.

[0069] There are various methods for constructing a face texture database. The following will illustrate typical examples, but these do not constitute a limitation of this application.

[0070] Optionally, a 3DMM algorithm can be used to construct a face texture database. In this case, the construction process of the face texture database is as follows: For each sample face model in multiple sample face models, a 3D deformable face model algorithm is used to determine the sample texture function used to represent the sample face model; the texture coefficients in the sample texture function are extracted to obtain multiple sample texture coefficients corresponding to multiple sample face models; the probability distribution followed by the multiple sample texture coefficients is determined, and the probability distribution is used as the face texture database.

[0071] Specifically, the number of sample face models can be set by those skilled in the art according to the actual situation, and is not limited here. For example, it may be greater than or equal to 200, but it is not limited to this.

[0072] Specifically, the sample texture function is a texture function that represents the texture of the sample face model.

[0073] Specifically, 3DMM, or 3D deformable face model, is a general 3D face model that represents the texture of any 3D face model using a texture function, as shown in formula (1):

[0074] T model =T′+Tβ Formula (1)

[0075] Where T′ is the average texture of multiple sample face models, T is the matrix formed by the principal component directions of multiple sample face models, β is the texture coefficient controlling the texture color, and T model This represents the final generated texture, where T′ and T can be obtained (i.e., known) by analyzing multiple sample face models using the 3DMM algorithm.

[0076] Specifically, for each sample face model, the texture of that sample face model is substituted into T in formula (1). model This allows us to obtain the texture coefficients (i.e., sample texture coefficients) corresponding to the texture of the sample face model, thereby obtaining multiple sample texture coefficients corresponding to multiple sample face models.

[0077] Furthermore, any possible algorithm can be used to calculate the probability distribution that the texture coefficients of multiple samples follow, and this probability distribution can serve as a face texture database. In this way, each time a face model is generated, only one texture coefficient needs to be randomly sampled from this probability distribution as the target texture coefficient.

[0078] It is understandable that by randomly sampling a texture coefficient from this probability distribution as the target texture coefficient, the target texture coefficient can be made to belong to the same probability distribution as the texture coefficient of the real face model. This makes the edited template face model obtained by subsequent editing based on the target texture coefficient more like the real face model, and thus makes the target face model with the same texture as the edited template face model more like the real face model, thereby obtaining a more realistic target face model.

[0079] Of course, those skilled in the art can also use deep learning 3D geometry generation techniques such as Generative Adversarial Network (GAN) or Variational Auto-Encoder (VAE) to construct a face shape database, but are not limited to these.

[0080] For example, Figure 6 This is a publicly provided logical diagram illustrating a method for obtaining a target texture unfolded image. See also... Figure 6 The target texture coefficients are randomly selected from the face texture database 610 and substituted into formula (1) to obtain the target texture unfolded image 620.

[0081] Understandably, by substituting the target texture coefficients into the texture function to obtain the target unfolded map, the method of obtaining the target unfolded map can be simplified and easy to implement, which is beneficial to improving the generation efficiency of the target face model.

[0082] S132. Map the registered template face model to the parameterized space to obtain the corresponding template face unfolded graph. The template face unfolded graph includes multiple two-dimensional vertices, and the registered template face model includes multiple first three-dimensional vertices. The multiple two-dimensional vertices and the multiple first three-dimensional vertices correspond one-to-one.

[0083] Specifically, the mesh mapped onto the registered template face model in the parameterized space is unfolded in two dimensions, and the unfolded result is the template face unfolded image.

[0084] Those skilled in the art can use any possible parameterization algorithm to map the registered template face model to the parameterization space. There are no limitations here. For example, conformal parameterization, fixed boundary parameterization, etc. can be used, but it is not limited to these.

[0085] For example, Figure 7 This is a logical schematic diagram illustrating texture mapping of a registered template face model according to an embodiment of this disclosure. See also... Figure 7The registered template face model 710 is mapped to the parameterized space to obtain the corresponding template face unfolded image 720. The template face unfolded image includes multiple meshes, each corresponding to multiple two-dimensional vertices. The registered template face model 710 also includes multiple meshes. Figure 7 (not shown in the image), the multiple grids correspond to multiple first three-dimensional vertices, and the multiple two-dimensional vertices and the multiple first three-dimensional vertices correspond one-to-one.

[0086] S133. For each first three-dimensional vertex, the texture coordinates of the corresponding two-dimensional vertex are used as the texture coordinates of the first three-dimensional vertex, thereby obtaining the mapping relationship between the first three-dimensional vertex and the texture coordinates.

[0087] Specifically, when the target texture unfolded image and the template face unfolded image are of the same size, they are overlapped. Then, for each 2D vertex, it is vertically projected onto the target texture unfolded image. The coordinates of the projected point are the texture coordinates of that 2D vertex. This provides the mapping relationship between 2D vertices and texture coordinates. Since multiple 2D vertices correspond one-to-one with multiple first 3D vertices, for each first 3D vertex, the texture coordinates of the corresponding 2D vertex are used as the texture coordinates of that first 3D vertex, thus obtaining the mapping relationship between first 3D vertices and texture coordinates.

[0088] For example, see [link to example]. Figure 7 The two-dimensional unfolding result of the mesh circled in the rectangle on the registered template face model 710 is the mesh circled in the rectangle on the template face unfolded image 720. The two-dimensional vertices of the mesh circled in the rectangle on the template face unfolded image 720 correspond to the texture coordinates in the rectangle circled part of the target texture unfolded image 730. Therefore, the three-dimensional coordinates of the mesh circled in the rectangle on the registered template face model 710 correspond to the texture coordinates in the rectangle circled part of the target texture unfolded image 730.

[0089] S134. Based on the mapping relationship between the first three-dimensional vertex and the texture coordinates, the texture color on the target texture unfolded map is mapped onto the registered template face model to obtain the texture-mapped template face model.

[0090] For example, see [link to example]. Figure 7 Based on the mapping relationship between the first three-dimensional vertex and the texture coordinates, the texture color of the part circled in the rectangle on the target texture unfolded image 730 is mapped to the part circled in the rectangle on the registered template face model 710, so as to realize the texture mapping of the part circled in the rectangle on the registered template face model 710. The same applies to other parts, which will not be elaborated here.

[0091] It is understandable that by mapping the registered template face model to the parameterized space, it is easier to obtain the mapping relationship between the first 3D vertex on the registered template face model and the texture coordinates in the target texture unfolding diagram. This helps to improve the efficiency of texture mapping of the registered template face model, thereby improving the generation efficiency of the target face model.

[0092] In another embodiment of this disclosure, the texture color on the real face model is replaced with the texture color on the texture-mapped template face model to obtain the target face model, including:

[0093] S141. For each second three-dimensional vertex on the real face model, based on the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex on the template face model after texture mapping, determine the texture coordinates of the second three-dimensional vertex, thereby obtaining the mapping relationship between the second three-dimensional vertex and the texture coordinates.

[0094] Specifically, as mentioned above, the face registration process can reveal the correspondence between the second three-dimensional vertices on the real face model and the first three-dimensional vertices on the registered template face model (referred to as the first correspondence). Texture mapping, on the other hand, adds textures without changing the position of the first three-dimensional vertices. Therefore, the correspondence between the second three-dimensional vertices on the real face model and the first three-dimensional vertices on the texture-mapped template face model (referred to as the second correspondence) is the same as the first correspondence. The second correspondence records multiple first three-dimensional vertices corresponding to each second three-dimensional vertex.

[0095] For example, Figure 8 This is a schematic diagram of a real face model and a texture-mapped template face model provided in an embodiment of this disclosure. The darker mesh is the mesh on the real face model, and the lighter mesh is the mesh on the texture-mapped template face model. The second three-dimensional vertex P on the real face model corresponds to the three first three-dimensional vertices on the texture-mapped template face model. The three first three-dimensional vertices are t1, t2, and t3, respectively. At this time, the texture coordinates of P can be determined based on the texture coordinates of t1, t2, and t3.

[0096] In some embodiments, S141 may include: processing the texture coordinates of a plurality of first three-dimensional vertices corresponding to the second three-dimensional vertex to obtain the texture coordinates of the second three-dimensional vertex.

[0097] Specifically, the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex can be averaged to obtain the texture coordinates of the second three-dimensional vertex.

[0098] For example, see [link to example]. Figure 8If the texture coordinates of t1 are (u1, v1), the texture coordinates of t2 are (u2, v2), and the texture coordinates of t3 are (u3, v3), then the average value of (u1, v1), (u2, v2), and (u3, v3) is taken to obtain the texture coordinates of P ((u1+u2+u3) / 3, (v1+v2+v3) / 3).

[0099] It is understandable that obtaining the texture coordinates of the second three-dimensional vertex through averaging makes the acquisition of the texture coordinates of the second three-dimensional vertex simple and easy to implement, which is beneficial to improving the efficiency of obtaining the texture coordinates of the second three-dimensional vertex.

[0100] In other embodiments, S141 may include: determining multiple weight values ​​corresponding to the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex; and performing weighted summation on the texture coordinates of the multiple first three-dimensional vertices corresponding to the second three-dimensional vertex based on the multiple weight values ​​to obtain the texture coordinates of the second three-dimensional vertex.

[0101] Specifically, when the texture-mapped template face model overlaps with the real face model, for each second 3D vertex, when the second 3D vertex is vertically projected onto the surface of the texture-mapped template face model, the projection point is located within the mesh composed of its corresponding multiple first 3D vertices. The centroid coordinates of the projection point of the second 3D vertex within the corresponding mesh (patch) are calculated. Multiple components in the centroid coordinates can be used as multiple weight values ​​corresponding to the texture coordinates of the multiple first 3D vertices corresponding to the second 3D vertex. Then, the texture coordinates of the second 3D vertex are obtained by interpolation based on the centroid coordinates. In this way, the mapping relationship between the second 3D vertex and the texture coordinates can be obtained.

[0102] For example, see [link to example]. Figure 8 If the centroid coordinates of P within the triangular patch formed by t1, t2, and t3 are (O1, O2, O3), the texture coordinates of t1 are (u1, v1) with a corresponding weight of O1, the texture coordinates of t2 are (u2, v2) with a corresponding weight of O2, and the texture coordinates of t3 are (u3, v3) with a corresponding weight of O3, then the weights of (u1, v1), (u2, v2), and (u3, v3) are summed to obtain the texture coordinates of P as (u1*O1+u2*O2+u3*O3, v1*O1+v2*O2+v3*O3).

[0103] It is understandable that by weighting and summing the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex, the texture coordinates of the second three-dimensional vertex can be obtained, making the texture coordinates of the second three-dimensional vertex more accurate. This improves the accuracy of texture transfer to the detextured real face model, which in turn helps to make the texture of the target face model more like the texture on the real face model, i.e., more realistic.

[0104] S142. Perform texture removal processing on the real face model to obtain the texture-removed real face model.

[0105] S143. Based on the mapping relationship between the second three-dimensional vertex and the texture coordinates, the texture color on the target texture unfolded map is mapped onto the registered template face model to obtain the texture-mapped template face model.

[0106] It is understandable that by mapping the detextured real face model to the parameterized space, it is easier to obtain the mapping relationship between the second 3D vertices on the detextured real face model and the texture coordinates in the target texture unfolded graph. This helps to improve the efficiency of texture mapping on the detextured real face model, thereby improving the generation efficiency of the target face model.

[0107] Figure 9 This is a schematic diagram of a face model generation device provided in an embodiment of this disclosure. This face model generation device can be understood as the aforementioned electronic device or a functional module within the aforementioned electronic device. For example... Figure 9 As shown, the face model generation device 900 includes:

[0108] The first acquisition module 910 is used to acquire the real face model of the target user and the template face model;

[0109] The face registration module 920 is used to perform face registration processing on the template face model based on the real face model and using a preset face registration algorithm to obtain the registered template face model.

[0110] The texture mapping module 930 is used to perform texture mapping processing on the registered template face model using the target texture unfolded map to obtain the texture-mapped template face model.

[0111] The texture replacement module 940 is used to replace the texture color on the real face model with the texture color on the texture-mapped template face model to obtain the target face model.

[0112] In another embodiment of this disclosure, the first acquisition module 910 may include a first acquisition submodule for acquiring a template face model, the first acquisition submodule including:

[0113] The first acquisition unit is used to acquire multiple sample face models of multiple sample users;

[0114] The first processing unit is used to process multiple sample face models to obtain template face models.

[0115] In yet another embodiment of this disclosure, the texture mapping module 930 may include:

[0116] The second acquisition submodule is used to acquire the target texture unfolded map, wherein the target texture unfolded map includes multiple texture coordinates;

[0117] The parameterization submodule is used to map the registered template face model to the parameterization space to obtain the corresponding template face unfolded image. The template face unfolded image includes multiple two-dimensional vertices, and the registered template face model includes multiple first three-dimensional vertices. The multiple two-dimensional vertices and the multiple first three-dimensional vertices correspond one-to-one.

[0118] The first determining submodule is used to take the texture coordinates of the corresponding two-dimensional vertex of the first three-dimensional vertex as the texture coordinates of the first three-dimensional vertex for each first three-dimensional vertex, thereby obtaining the mapping relationship between the first three-dimensional vertex and the texture coordinates.

[0119] The first mapping submodule is used to map the texture color on the target texture unfolded map to the registered template face model based on the mapping relationship between the first three-dimensional vertex and the texture coordinates, so as to obtain the texture-mapped template face model.

[0120] In another embodiment of this disclosure, the second acquisition submodule may include:

[0121] The selection unit is used to randomly select one texture coefficient from multiple texture coefficients in the face texture database as the target texture coefficient.

[0122] The generation unit is used to generate a target texture unfolded map corresponding to the target texture coefficient using a 3D deformable face model algorithm.

[0123] In another embodiment of this disclosure, the apparatus further includes a construction module for constructing a face texture database, the construction module including:

[0124] The second determination submodule is used to determine the sample texture function used to characterize the sample face model for each sample face model in multiple sample face models using a three-dimensional deformable face model algorithm.

[0125] The third determination submodule is used to extract the texture coefficients in the sample texture function, thereby obtaining multiple sample texture coefficients corresponding to multiple sample face models.

[0126] The fourth determination submodule is used to determine the probability distribution that the texture coefficients of multiple samples follow, and to use the probability distribution as a face texture database.

[0127] In another embodiment of this disclosure, the texture replacement module 940 may include:

[0128] The fifth determination submodule is used to determine the texture coordinates of the second three-dimensional vertex for each second three-dimensional vertex on the real face model, based on the texture coordinates of multiple first three-dimensional vertices on the template face model corresponding to the second three-dimensional vertex after texture mapping, so as to obtain the mapping relationship between the second three-dimensional vertex and the texture coordinates.

[0129] The detexturing submodule is used to detexturize a real face model to obtain a detextured real face model;

[0130] The second mapping submodule is used to map the texture color on the target texture unfolded map to the registered template face model based on the mapping relationship between the second three-dimensional vertex and the texture coordinates, so as to obtain the texture-mapped template face model.

[0131] In another embodiment of this disclosure, the fifth determining submodule may include:

[0132] The second processing unit is used to process the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex to obtain the texture coordinates of the second three-dimensional vertex.

[0133] In another embodiment of this disclosure, the fifth determining submodule may include:

[0134] A determining unit is used to determine multiple weight values ​​corresponding to the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex;

[0135] The weighted summation unit is used to perform weighted summation of the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex based on multiple weight values, so as to obtain the texture coordinates of the second three-dimensional vertex.

[0136] The apparatus provided in this embodiment can execute the methods of any of the above embodiments, and its execution method and beneficial effects are similar, so they will not be described again here.

[0137] This disclosure also provides an electronic device, which includes: a memory storing a computer program; and a processor for executing the computer program, wherein when the computer program is executed by the processor, it can implement the methods of any of the above embodiments.

[0138] Example, Figure 10 This is a schematic diagram of the structure of an electronic device according to an embodiment of this disclosure. See below for details. Figure 10The diagram illustrates a structural schematic suitable for implementing the electronic device 1000 in the embodiments of this disclosure. The electronic device 1000 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0139] like Figure 10 As shown, the electronic device 1000 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the electronic device 1000. The processing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0140] Typically, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1008 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic device 1000 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 10 An electronic device 1000 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0141] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1008, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.

[0142] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0143] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0144] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0145] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:

[0146] Obtain the target user's real face model and obtain the template face model;

[0147] Based on a real face model, a preset face registration algorithm is used to perform face registration processing on the template face model to obtain the registered template face model;

[0148] The registered template face model is texture-mapped using the target texture unfolded map to obtain the texture-mapped template face model.

[0149] The target face model is obtained by replacing the texture color on the real face model with the texture color on the texture-mapped template face model.

[0150] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0151] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0152] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0153] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0154] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0155] This disclosure also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the methods of any of the above embodiments. The execution method and beneficial effects are similar, and will not be described again here.

[0156] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0157] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating a face model, characterized in that, include: Obtain the target user's real face model and obtain the template face model; Based on the real face model, a preset face registration algorithm is used to perform face registration processing on the template face model to obtain a registered template face model. The face registration processing involves deforming multiple grids in the template face model, and the registered template face model fits the real face model. The registered template face model is texture-mapped using the target texture unfolded map to obtain the texture-mapped template face model. The target texture unfolded map is generated by the target texture coefficients through a three-dimensional deformable face model algorithm. The target texture coefficients are randomly selected from multiple texture coefficients in the face texture database. The texture color on the real face model is replaced with the texture color on the texture-mapped template face model to obtain the target face model, the texture of which is different from that of the real face model.

2. The method according to claim 1, characterized in that, The process of obtaining the template face model includes: Obtain multiple sample face models from multiple sample users; The multiple sample face models are processed to obtain the template face model.

3. The method according to claim 2, characterized in that, The step of using the target texture unfolded map to perform texture mapping processing on the registered template face model to obtain the texture-mapped template face model includes: Obtain a target texture unfolded map, wherein the target texture unfolded map includes multiple texture coordinates; The registered template face model is mapped to the parameterized space to obtain the corresponding template face unfolded image, wherein the template face unfolded image includes multiple two-dimensional vertices, and the registered template face model includes multiple first three-dimensional vertices, and the multiple two-dimensional vertices and the multiple first three-dimensional vertices correspond one-to-one. For each first three-dimensional vertex, the texture coordinates of the corresponding two-dimensional vertex are used as the texture coordinates of the first three-dimensional vertex, thereby obtaining the mapping relationship between the first three-dimensional vertex and the texture coordinates; Based on the mapping relationship between the first three-dimensional vertex and texture coordinates, the texture color on the target texture unfolded map is mapped onto the registered template face model to obtain the texture-mapped template face model.

4. The method according to claim 1, characterized in that, The process of constructing the face texture database is as follows: For each sample face model in a plurality of sample face models, the three-dimensional deformable face model algorithm is used to determine the sample texture function used to characterize the sample face model; Extract the texture coefficients from the sample texture function to obtain multiple sample texture coefficients corresponding to the multiple sample face models; Determine the probability distribution that the multiple sample texture coefficients follow, and use the probability distribution as the face texture database.

5. The method according to claim 1, characterized in that, The step of replacing the texture color on the real face model with the texture color on the texture-mapped template face model to obtain the target face model includes: For each second three-dimensional vertex on the real face model, based on the texture coordinates of multiple first three-dimensional vertices on the template face model after texture mapping, the texture coordinates of the second three-dimensional vertex are determined, thereby obtaining the mapping relationship between the second three-dimensional vertex and the texture coordinates. The real face model is subjected to detexturization processing to obtain a detexturized real face model; Based on the mapping relationship between the second three-dimensional vertex and the texture coordinates, the texture color on the target texture unfolded map is mapped onto the registered template face model to obtain the texture-mapped template face model.

6. The method according to claim 5, characterized in that, The determination of the texture coordinates of the second three-dimensional vertex based on the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex on the template face model after texture mapping includes: The texture coordinates of the multiple first three-dimensional vertices corresponding to the second three-dimensional vertex are processed to obtain the texture coordinates of the second three-dimensional vertex.

7. The method according to claim 5, characterized in that, The determination of the texture coordinates of the second three-dimensional vertex based on the texture coordinates of multiple first three-dimensional vertices corresponding to the second three-dimensional vertex on the template face model after texture mapping includes: Determine multiple weight values ​​corresponding to the texture coordinates of multiple first three-dimensional vertices that correspond to the second three-dimensional vertex; Based on the multiple weight values, the texture coordinates of the multiple first three-dimensional vertices corresponding to the second three-dimensional vertex are weighted and summed to obtain the texture coordinates of the second three-dimensional vertex.

8. A device for generating a human face model, characterized in that, include: The first acquisition module is used to acquire the real face model of the target user and the template face model; The face registration module is used to perform face registration processing on the template face model based on the real face model using a preset face registration algorithm to obtain a registered template face model. The face registration processing involves deforming multiple grids in the template face model, and the registered template face model fits the real face model. The texture mapping module is used to perform texture mapping processing on the registered template face model using the target texture unfolded map to obtain the texture-mapped template face model. The target texture unfolded map is generated by the target texture coefficients through a three-dimensional deformable face model algorithm. The target texture coefficients are randomly selected from multiple texture coefficients in the face texture database. The texture replacement module is used to replace the texture color on the real face model with the texture color on the texture-mapped template face model to obtain a target face model, wherein the texture of the target face model is different from that of the real face model.

9. An electronic device, characterized in that, include: A processor and a memory, wherein the memory stores a computer program that, when executed by the processor, performs the method of any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Face skin replacement method and device and computer equipment

    CN108682030A

  • An irregular three-dimensional face mesh texture method based on template face approximation

    CN108986221A

  • Texture map generation method and device, texture map rendering method and device, equipment and storage medium

    CN112785674A