Three-dimensional cartoon face generation method, device, electronic device and storage medium

Through the three-dimensional cartoon face generation method based on two-dimensional real face images, the geometric generation neural network and texture generation network model is used to solve the problem of single style of three-dimensional cartoon face generation in the existing technology, and the personalized characteristics are realized Three-dimensional cartoon face generation improves the user experience.

CN114299206BActive Publication Date: 2025-02-18TSINGHUA UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111672607.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-02-18
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The prior art is difficult to effectively generate three-dimensional cartoon faces with personalized characteristics, and the traditional method has a single style and cannot meet the personalized needs of users.

Method used

By obtaining three-dimensional cartoon face grid model and texture map based on two-dimensional real face images, combining geometric generation neural networks and texture generation network models, we generate three-dimensional cartoon faces with personalized characteristics.

Benefits of technology

It realizes the generation of three-dimensional cartoon faces with obvious personalized characteristics based on real face images, which improves the user experience and provides beautiful texture maps for the generated three-dimensional cartoon faces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299206B_ABST
    Figure CN114299206B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and storage medium for generating a three-dimensional cartoon face, and relates to the technical field of computer graphics. The method comprises: obtaining a three-dimensional cartoon face mesh model according to a two-dimensional real face image; obtaining a three-dimensional cartoon face texture map according to the two-dimensional real face image; obtaining a three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map. The method realizes the ability to generate a three-dimensional cartoon face according to a real face image, so that the generated three-dimensional cartoon face has obvious personalized features of the input face, and generates a corresponding texture map for the three-dimensional cartoon face, so that the generated three-dimensional cartoon face is more beautiful, improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer graphics, and more specifically, to a method, device, electronic device and storage medium for generating a three-dimensional cartoon face. Background Art

[0002] With the rise of entertainment applications such as games, movies, and virtual costumes, the demand for customizing 3D cartoon faces for ordinary users has increased. The traditional method based on manual production by animators cannot meet the existing demand. However, related automated solutions mostly require users to select one from several fixed candidate 3D models for production. The 3D cartoon faces produced in this way have a single style and cannot reflect personalized features, which affects the user experience. Summary of the invention

[0003] The present application proposes a three-dimensional cartoon face generation method, device, electronic device and storage medium to improve the above-mentioned problems.

[0004] In a first aspect, an embodiment of the present application provides a method for generating a three-dimensional cartoon face, the method comprising: obtaining a three-dimensional cartoon face mesh model based on a two-dimensional real face image; obtaining a three-dimensional cartoon face texture map based on the two-dimensional real face image; and obtaining a three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map.

[0005] In a second aspect, an embodiment of the present application provides a three-dimensional cartoon face generation device, the device comprising: a mesh model acquisition module, used to acquire a three-dimensional cartoon face mesh model based on a two-dimensional real face image; a texture map acquisition module, used to acquire a three-dimensional cartoon face texture map based on the two-dimensional real face image; a three-dimensional cartoon face acquisition module, used to acquire a three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map.

[0006] In a third aspect, an embodiment of the present application provides an electronic device comprising: one or more processors and a memory; one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the three-dimensional cartoon face generation method provided in the first aspect above.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, wherein when the program code is executed by a processor, the three-dimensional cartoon face generation method provided in the first aspect is executed.

[0008] The present application provides a method, device, electronic device and storage medium for generating a 3D cartoon face, which obtains a 3D cartoon face mesh model based on a 2D real face image; then obtains a 3D cartoon face texture map based on the 2D real face image; and then obtains a 3D cartoon face based on the 3D cartoon face mesh model and the 3D cartoon face texture map. Thus, the above method can realize the generation of a 3D cartoon face based on a real face image, so that the generated 3D cartoon face has obvious personalized features of the input face, and a corresponding texture map is generated for the 3D cartoon face, so that the generated 3D cartoon face is more beautiful, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A flowchart of a method for generating a three-dimensional cartoon face provided in an embodiment of the present application is shown.

[0011] Figure 2 A schematic diagram of the process of obtaining a 3D cartoon face based on a 3D cartoon face mesh model and a 3D cartoon face texture map provided by this embodiment is shown.

[0012] Figure 3 A flowchart of a method for generating a three-dimensional cartoon face provided by another embodiment of the present application is shown.

[0013] Figure 4 Shows Figure 3 Flow chart of the method for step S210 in .

[0014] Figure 5 A schematic diagram of the network training process provided in an embodiment of the present application is shown.

[0015] Figure 6 An example diagram of a generated result of a three-dimensional cartoon face provided by an embodiment of the present application is shown.

[0016] Figure 7 Another example diagram of the generation result of a three-dimensional cartoon face provided by an embodiment of the present application is shown.

[0017] Figure 8 Another example diagram of the generation result of a three-dimensional cartoon face provided in an embodiment of the present application is shown.

[0018] Fig. 9A structural block diagram of a three-dimensional cartoon face generation device provided in an embodiment of the present application is shown.

[0019] Fig.10 A structural block diagram of an electronic device provided in an embodiment of the present application is shown.

[0020] Fig.11 A storage unit for storing or carrying program codes for implementing the method for generating a three-dimensional cartoon face according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0022] With the rise of entertainment applications such as games, movies, and virtual costumes, the application scope of 3D cartoon faces has been further expanded, and many applications require real-time generation of 3D cartoon faces. Generating 3D cartoon faces from 2D real faces currently relies mainly on manual production by animators, or directly providing fixed cartoon faces for users to choose from. In this way, cartoon faces usually cannot truly reflect the user's facial contours, and there are fewer types of cartoon faces to choose from, which affects the user experience.

[0023] With the development of related technologies, some automatic methods for generating 3D stylized faces have emerged. Most of these methods are based on exaggerating the features of the 3D model corresponding to the real face. The disadvantages of these methods are that the style of the cartoon face is artificially defined, which may not match the actual cartoon face, and the real face needs to be reconstructed in 3D first, which is time-consuming and may cause error accumulation.

[0024] In order to solve the above problems, the inventors have found through long-term research that a 3D cartoon face mesh model can be obtained through a 2D real face image; then a 3D cartoon face texture map can be obtained based on the 2D real face image; and then a 3D cartoon face can be obtained based on the 3D cartoon face mesh model and the 3D cartoon face texture map. Thus, the above method can realize the generation of a 3D cartoon face based on a real face image, so that the generated 3D cartoon face has obvious personalized features of the input face, and a corresponding texture map is generated for the 3D cartoon face, so that the generated 3D cartoon face is more beautiful, improving the user experience.

[0025] Therefore, in order to improve the above-mentioned problems, the inventors proposed the 3D cartoon face generation method, device, electronic device and storage medium provided in the present application, which can generate a 3D cartoon face based on a real face image, so that the generated 3D cartoon face has obvious personalized features of the input face, and generates a corresponding texture map for the 3D cartoon face, so that the generated 3D cartoon face is more beautiful, thereby improving the user experience.

[0026] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0027] See also Figure 1 , shows a flow chart of a method for generating a 3D cartoon face provided by an embodiment of the present application. This embodiment provides a method for generating a 3D cartoon face, which can be applied to electronic devices. The electronic devices in the embodiments of the present application can be mobile communication devices with network connection functions such as mobile phones, computers, tablets, and televisions. The method includes:

[0028] Step S110: obtaining a three-dimensional cartoon face mesh model according to the two-dimensional real face image.

[0029] In this embodiment, the two-dimensional real face image represents a face image corresponding to a real face in a two-dimensional space. The real face can be taken by a camera or downloaded from the Internet (for example, the real face can be from a public face dataset FFHQ (Flickr-Faces-High-Quality)). The gender, age, and skin color of the real face are not limited.

[0030] The three-dimensional cartoon face is a three-dimensional face similar to a two-dimensional real face and having a cartoon style, wherein the similarity between the three-dimensional cartoon face and the two-dimensional real face may not be limited, for example, the similarity may be 50%, 75%, 90%, or even 100%. The three-dimensional cartoon face mesh model may be understood as a three-dimensional model of the outline of the three-dimensional cartoon face, and the outline is also equivalent to a three-dimensional representation of the outline of the two-dimensional real face, that is, the face outline of the three-dimensional cartoon face is the same as the face outline of the two-dimensional real face, and the three-dimensional cartoon face mesh model includes multiple point coordinates. Alternatively, the three-dimensional cartoon face mesh model may be understood as a triangular patch model of the cartoon face, and the triangular patch model includes the coordinates of each point of the cartoon face in the three-dimensional space, the topological relationship between the point and the patch, and the connection relationship between the patches.

[0031] In order to accurately obtain the personalized geometric features of a two-dimensional real face (the geometric features can be understood as shape features, and the shape can include the facial contour and the facial features), a three-dimensional cartoon face mesh model can be obtained based on the two-dimensional real face image. As an implementation method, the two-dimensional real face image can be input into a geometric generative neural network, and the geometric generative neural network can be used to output a three-dimensional cartoon face mesh model; then the three-dimensional cartoon face mesh model output by the geometric generative neural network is obtained. Among them, the geometric generative neural network is obtained by training a convolutional neural network model.

[0032] The geometric generative neural network includes an encoder and a decoder. When a two-dimensional real face image is input into the geometric generative neural network, the encoder can first extract the shape features of the two-dimensional real face, and then transmit the extracted shape features to the decoder. The decoder decodes the shape features to obtain the three-dimensional coordinates of each point of the three-dimensional animated face, thereby obtaining a three-dimensional cartoon face mesh model.

[0033] In this embodiment, during the process of outputting the three-dimensional cartoon face mesh model, the geometric generation neural network can also analyze the three-dimensional cartoon face mesh model to obtain the geometric information of the three-dimensional cartoon face (for example, the width of the forehead, the distance between the eyebrows and eyes, etc.) and the normal information (for example, the angle between the nose wing and the corner of the eye, the angle between the nose wing and the end of the eye, the vector length between the end of the eye and the end of the eyebrow, etc.) of the three-dimensional cartoon face, thereby obtaining the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information output by the geometric generation neural network.

[0034] Step S120: obtaining a three-dimensional cartoon face texture map according to the two-dimensional real face image.

[0035] In order to make the similarity between the generated 3D cartoon face model and the original input 2D real face more obvious, and to improve the aesthetics of the generated 3D cartoon face model, a 3D cartoon face texture map can be obtained based on the 2D real face image, the 3D cartoon face geometry information and the 3D cartoon face normal information. The 3D cartoon face texture map represents the map of the 3D cartoon face mesh model, and the texture map may include texture features such as wrinkles that are reflected by color, or may include other texture features that can reflect the skin color, age, and gender characteristics of the cartoon face and other personalized information.

[0036] In one implementation, a 2D real face image, 3D cartoon face geometry information, and 3D cartoon face normal information can be input into a texture generation network model, and the texture generation network model is used to output a 3D cartoon face texture map; and then the 3D cartoon face texture map output by the texture generation network model is obtained. The texture generation network model is obtained by training a generative adversarial network.

[0037] The texture generation network model is configured with an encoder. When a two-dimensional real face image, three-dimensional cartoon face geometric information and three-dimensional cartoon face normal information are input into the texture generation network model, the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information can be first transmitted to the encoder, and the encoder encodes the features of the input two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information, and transmits the encoded result to the generative adversarial network so that it can generate a three-dimensional cartoon face texture map.

[0038] It should be noted that, in order to more accurately reflect the personalized features of the two-dimensional real face, before the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information are input into the texture generation network model, the three-dimensional cartoon face geometric information can be converted into the three-dimensional cartoon face normal information. The specific conversion implementation process is not repeated here. In this way, inputting the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information into the texture generation network model includes: inputting the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information (including the three-dimensional cartoon face normal information output by the geometric generation neural network and the three-dimensional cartoon face normal information converted from the result output by the geometric generation neural network) into the texture generation network model.

[0039] Step S130: Acquire a three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map.

[0040] As a method, after obtaining a 3D cartoon face mesh model and a 3D cartoon face texture map, the 3D cartoon face texture map can be set (configured) on the 3D cartoon face mesh model to obtain a 3D cartoon face. For example, the 3D cartoon face texture map can be pasted on the 3D cartoon face mesh model, and the 3D cartoon face mesh model with the 3D cartoon face texture map can be used as a 3D cartoon face.

[0041] In a specific application scenario, see Figure 2 , shows a schematic diagram of the process of obtaining a 3D cartoon face based on a 3D cartoon face mesh model and a 3D cartoon face texture map provided in this embodiment, such as Figure 2 As shown, the 3D cartoon face texture map output by the texture generation network can be pasted on the 3D cartoon face mesh model output by the geometry generation neural network to obtain a map of the 3D cartoon face model, that is, a 3D cartoon face.

[0042] The 3D cartoon face generation method provided in this embodiment obtains a 3D cartoon face mesh model based on a 2D real face image; then obtains a 3D cartoon face texture map based on the 2D real face image; and then obtains a 3D cartoon face based on the 3D cartoon face mesh model and the 3D cartoon face texture map. Thus, the 3D cartoon face can be generated based on the real face image, so that the generated 3D cartoon face has obvious personalized features of the input face, and a corresponding texture map is generated for the 3D cartoon face, so that the generated 3D cartoon face is more beautiful, improving the user experience.

[0043] See also Figure 3 , shows a flow chart of a method for generating a 3D cartoon face provided by another embodiment of the present application. This embodiment provides a method for generating a 3D cartoon face, the method comprising:

[0044] Step S210: Acquire a training data set, where the training data set includes a two-dimensional real human face and a three-dimensional cartoon face mesh model corresponding to the two-dimensional real human face.

[0045] The 3D cartoon face mesh model corresponding to the 2D real face is constructed based on the contour, shape and other features of the 2D real face. The training dataset is used to train the convolutional neural network and the generative adversarial network. The process of obtaining the training dataset is described as follows:

[0046] See also Figure 4 As one approach, step S210 may include:

[0047] Step S211: Acquire a two-dimensional real human face.

[0048] In this embodiment, the two-dimensional real face can be a face taken by the user, or a face downloaded from the Internet, and the specific source of the two-dimensional real face may not be limited.

[0049] Step S212: performing a first processing on the two-dimensional real human face to obtain a two-dimensional cartoon human face.

[0050] The first processing represents the filter processing. For example, the first processing may be the ToonMe processing from the web application. ToonMe is a Disney cartoon-style filter camera APP (Application). Through ToonMe, players can turn real-life photos into Disney-style cartoon character photos with one click, that is, they can quickly convert photos into cartoon avatars, allowing users to experience more interesting shooting experiences at any time. Or the first processing may be other filter processing that can convert a two-dimensional real face image into a cartoon-style face image, and the specific filter processing type may not be limited.

[0051] As one method, the electronic device may input the acquired two-dimensional real human face into ToonMe, and use the cartoon face image output by ToonMe as the two-dimensional cartoon face.

[0052] In this embodiment, in order to improve the accuracy of generating three-dimensional cartoon faces, two-dimensional cartoon faces can be used for evaluation in the actual application stage. For example, a three-dimensional cartoon face mesh model can be obtained through a geometric generation network model, and a texture map of the three-dimensional cartoon face can be obtained using a texture generation neural network. The three-dimensional cartoon face mesh model is then combined with the three-dimensional cartoon face texture map to obtain a three-dimensional cartoon face, and the three-dimensional cartoon face is compared with the two-dimensional cartoon faces in the training data set (at this time, it is necessary to satisfy that the three-dimensional cartoon face and the two-dimensional cartoon face correspond to the same two-dimensional real face. If not, the three-dimensional cartoon face is re-acquired until it is satisfied).

[0053] Step S213: performing a rigidity-preserving deformation on the two-dimensional cartoon face based on a standard three-dimensional face template to obtain a three-dimensional cartoon face mesh model corresponding to the two-dimensional real face.

[0054] In this embodiment, the two-dimensional real human faces, the two-dimensional cartoon human faces, and the three-dimensional cartoon human face mesh models corresponding to the two-dimensional real human faces in the training data set are stored in the form of data pairs.

[0055] As a method, a 2D cartoon face can be deformed to maintain rigidity (ARAP (as rigid as possible) deformation) based on a standard 3D face template to obtain a 3D cartoon face mesh model corresponding to a 2D real face. During ARAP deformation, the main constraint is the coordinates of the key points of the face.

[0056] Among them, the acquisition of facial key point coordinates can use the automatic labeling results of the neural network as the initial labeling, combined with manual correction and automatic encryption interpolation methods, specifically including correction of the initial results (for example, modifying incorrect labels) and encryption (for example, encrypting previously sparse points through curve fitting methods), and then obtaining the facial key point coordinates. The specific implementation process of ARAP deformation and automatic encryption interpolation will not be elaborated here.

[0057] Step S220: training a convolutional neural network model based on the two-dimensional real human face and the three-dimensional cartoon face mesh model corresponding to the two-dimensional real human face to obtain the geometric generative neural network.

[0058] As a method, when a three-dimensional cartoon face mesh model corresponding to a two-dimensional real face is obtained, the three-dimensional cartoon face mesh model can be used as a convergence condition (which can also be understood as a training target), and the two-dimensional real face can be input as training data into the convolutional neural network model to train the convolutional neural network model.

[0059] The convolutional neural network model in this embodiment is a lightweight neural network model that can be deployed on a PC. Through the geometric generative neural network trained by this embodiment, the mesh model generation time of each three-dimensional cartoon face can be 0.01 seconds.

[0060] Step S230: training a generative adversarial network model based on the two-dimensional real face, the three-dimensional cartoon face geometric information, and the three-dimensional cartoon face normal information to obtain the texture generation network model.

[0061] Similarly, a real cartoon face map obtained by pasting a two-dimensional cartoon face on a three-dimensional cartoon face model can be used as a training target, and the two-dimensional real face, three-dimensional cartoon face geometric information and three-dimensional cartoon face normal information can be input into the generative adversarial network model to train the generative adversarial network model.

[0062] In a specific application scenario, see Figure 5 , which shows a schematic diagram of the network training process provided by this embodiment, such as Figure 5 As shown, by inputting a two-dimensional real face into the convolutional neural network model, and taking the three-dimensional cartoon face mesh model corresponding to the two-dimensional real face as the training target, the convolutional neural network model can be trained. In the model training stage, when the three-dimensional cartoon face output by the model is similar or identical to the three-dimensional cartoon face mesh model, the model training ends, and the geometric generation neural network can be obtained. By inputting the two-dimensional real face, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information into the generative adversarial network model, and taking the real cartoon face map obtained by pasting the two-dimensional cartoon face on the three-dimensional cartoon face model as the training target, the generative adversarial network model can be trained to obtain a texture generation network model.

[0063] Step S240: Obtain a three-dimensional cartoon face mesh model based on the two-dimensional real face image.

[0064] Step S250: obtaining a three-dimensional cartoon face texture map according to the two-dimensional real face image.

[0065] Step S260: Acquire a three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map.

[0066] In a specific application scenario, see Figure 6 , Figure 7 as well as Figure 8 , shows an example diagram of the generation result of the three-dimensional cartoon face provided by this embodiment, such as Figure 6 As shown in the figure, the 3D cartoon face mesh model with texture retains the shape features of the 2D real face (facial contour, facial features, etc.) and has the style features of the cartoon face ( Figure 7 , Figure 8 The same is true), so that the generated 3D cartoon face (i.e. Figure 6 , Figure 7 , Figure 8 The 3D cartoon face mesh model with texture as shown in the figure has obvious personalized features of the input face and style features of the cartoon face; at the same time, by generating corresponding texture maps for the 3D cartoon face model, the generated 3D cartoon face is more beautiful, which can meet the needs of practical applications and improve the user experience.

[0067] The 3D cartoon face generation method provided in this embodiment trains the model so that the model can more accurately output features similar to real faces. At the same time, the method can generate 3D cartoon faces based on real face images, so that the generated 3D cartoon faces have obvious personalized features of the input face, and generate corresponding texture maps for the 3D cartoon faces, so that the generated 3D cartoon faces are more beautiful, improving the user experience.

[0068] See also Fig. 9 , is a structural block diagram of a 3D cartoon face generation device provided in an embodiment of the present application. This embodiment provides a 3D cartoon face generation device 300, which can be run on an electronic device. The device 300 includes: a mesh model acquisition module 310, a texture map acquisition module 320 and a 3D cartoon face acquisition module 330:

[0069] The mesh model acquisition module 310 is used to acquire a three-dimensional cartoon face mesh model according to a two-dimensional real face image.

[0070] As a method, the mesh model acquisition module 310 can be specifically used to input a two-dimensional real face image into a geometric generative neural network, and the geometric generative neural network is used to output a three-dimensional cartoon face mesh model; and obtain the three-dimensional cartoon face mesh model output by the geometric generative neural network.

[0071] The device 300 may further include an information acquisition module for acquiring the three-dimensional cartoon face geometry information and the three-dimensional cartoon face normal information output by the geometry generation neural network, and such information will be used by the texture generation module.

[0072] In this embodiment, the device 300 may also include a data set preparation module and a model training module, wherein the data set preparation module is used to obtain a training data set before obtaining a three-dimensional cartoon face mesh model based on a two-dimensional real face image, and the training data set includes a two-dimensional real face and a three-dimensional cartoon face mesh model corresponding to the two-dimensional real face; the model training module is used to train a convolutional neural network model based on the two-dimensional real face and the three-dimensional cartoon face mesh model corresponding to the two-dimensional real face to obtain the geometric generative neural network; the model training module is also used to train a generative adversarial network model based on the two-dimensional real face, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information to obtain the texture generative network model.

[0073] Among them, obtaining a training data set may include: obtaining a two-dimensional real human face; performing a first processing on the two-dimensional real human face to obtain a two-dimensional cartoon human face; performing a rigidity-preserving deformation on the two-dimensional cartoon human face based on a standard three-dimensional face template to obtain a three-dimensional cartoon human face mesh model corresponding to the two-dimensional real human face.

[0074] The texture map acquisition module 320 is used to acquire a three-dimensional cartoon face texture map according to the two-dimensional real face image.

[0075] As a method, the texture map acquisition module 320 can be specifically used to acquire a 3D cartoon face texture map according to the 2D real face image, the 3D cartoon face geometric information and the 3D cartoon face normal information.

[0076] In this embodiment, the method of obtaining a three-dimensional cartoon face texture map based on the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information includes: inputting the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information into a texture generation network model, the texture generation network model is used to output a three-dimensional cartoon face texture map; and obtaining the three-dimensional cartoon face texture map output by the texture generation network model.

[0077] The 3D cartoon face acquisition module 330 is used to acquire the 3D cartoon face based on the 3D cartoon face mesh model and the 3D cartoon face texture map.

[0078] As a method, the 3D cartoon face acquisition module 330 can be specifically used to set the 3D cartoon face texture map on the 3D cartoon face mesh model to obtain a 3D cartoon face.

[0079] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.

[0080] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.

[0081] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.

[0082] See also Fig.10 Based on the above-mentioned 3D cartoon face generation method and device, the embodiment of the present application also provides an electronic device 100 that can execute the above-mentioned 3D cartoon face generation method. The electronic device 100 includes a memory 102 and one or more (only one is shown in the figure) processors 104 coupled to each other, and the memory 102 and the processor 104 are connected by a communication line. The memory 102 stores a program that can execute the content of the above-mentioned embodiment, and the processor 104 can execute the program stored in the memory 102.

[0083] Among them, the processor 104 may include one or more processing cores. The processor 104 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 102, and calling data stored in the memory 102. Optionally, the processor 104 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 104 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 104, but may be implemented separately through a communication chip.

[0084] The memory 102 may include a random access memory (RAM) or a read-only memory (ROM). The memory 102 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 102 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the aforementioned embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.

[0085] Please refer to Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 400 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0086] The computer readable storage medium 400 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 400 includes a non-transitory computer-readable storage medium. The computer readable storage medium 400 has storage space for program code 410 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 410 can be compressed, for example, in an appropriate form.

[0087] In summary, the embodiment of the present application provides a method, device, electronic device and storage medium for generating a 3D cartoon face, which obtains a 3D cartoon face mesh model based on a 2D real face image; then obtains a 3D cartoon face texture map based on the 2D real face image; and then obtains a 3D cartoon face based on the 3D cartoon face mesh model and the 3D cartoon face texture map. Thus, the above method can realize the generation of a 3D cartoon face based on a real face image, so that the generated 3D cartoon face has obvious personalized features of the input face, and a corresponding texture map is generated for the 3D cartoon face, so that the generated 3D cartoon face is more beautiful, improving the user experience.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating a three-dimensional cartoon face, characterized in that: The method comprises: Acquire a three-dimensional cartoon face mesh model according to a two-dimensional real face image, wherein the three-dimensional cartoon face mesh model is acquired according to the two-dimensional real face image, comprising: inputting the two-dimensional real face image into a geometric generative neural network, wherein the geometric generative neural network is used to output a three-dimensional cartoon face mesh model; and acquiring the three-dimensional cartoon face mesh model output by the geometric generative neural network; Acquire a 3D cartoon face texture map according to the 2D real face image. Before acquiring the 3D cartoon face texture map according to the 2D real face image, the method further comprises: acquiring 3D cartoon face geometry information and 3D cartoon face normal information output by the geometry generation neural network, wherein the 3D cartoon face geometry information comprises the width of the forehead and the distance between the eyebrows and eyes, and the 3D cartoon face normal information comprises the angle between the nose wing and the corner of the eye, the angle between the nose wing and the end of the eye, and the vector length between the end of the eye and the end of the eyebrow; The obtaining of a three-dimensional cartoon face texture map according to the two-dimensional real face image comprises: obtaining a three-dimensional cartoon face texture map according to the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information, wherein the three-dimensional cartoon face texture map comprises texture features reflected by color, and the texture features reflected by color comprise wrinkles; A three-dimensional cartoon face is obtained based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map.

2. The method according to claim 1, characterized in that The method of obtaining a 3D cartoon face texture map according to the 2D real face image, the 3D cartoon face geometry information and the 3D cartoon face normal information comprises: Inputting the two-dimensional real face image, the three-dimensional cartoon face geometry information and the three-dimensional cartoon face normal information into a texture generation network model, wherein the texture generation network model is used to output a three-dimensional cartoon face texture map; Obtain a three-dimensional cartoon face texture map output by the texture generation network model.

3. The method according to any one of claims 1 to 2, characterized in that: The obtaining of a three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map comprises: The three-dimensional cartoon face texture map is set on the three-dimensional cartoon face mesh model to obtain a three-dimensional cartoon face.

4. The method according to claim 2, characterized in that: Before obtaining the three-dimensional cartoon face mesh model according to the two-dimensional real face image, the method further includes: Acquire a training data set, the training data set comprising a two-dimensional real human face and a three-dimensional cartoon human face mesh model corresponding to the two-dimensional real human face; Training a convolutional neural network model based on the two-dimensional real human face and a three-dimensional cartoon face mesh model corresponding to the two-dimensional real human face to obtain the geometric generative neural network; The generative adversarial network model is trained based on the two-dimensional real face, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information to obtain the texture generation network model.

5. The method according to claim 4, characterized in that The step of obtaining a training data set includes: Get a 2D real face; Performing a first processing on the two-dimensional real human face to obtain a two-dimensional cartoon human face; The two-dimensional cartoon face is deformed in a rigidity-preserving manner based on a standard three-dimensional face template to obtain a three-dimensional cartoon face mesh model corresponding to the two-dimensional real face.

6. A three-dimensional cartoon face generation device, characterized in that: The device comprises: A mesh model acquisition module is used to acquire a three-dimensional cartoon face mesh model according to a two-dimensional real face image, wherein the three-dimensional cartoon face mesh model is acquired according to the two-dimensional real face image, comprising: inputting the two-dimensional real face image into a geometric generative neural network, wherein the geometric generative neural network is used to output a three-dimensional cartoon face mesh model; and acquiring the three-dimensional cartoon face mesh model output by the geometric generative neural network. An information acquisition module, used to acquire the 3D cartoon face geometry information and the 3D cartoon face normal information output by the geometry generation neural network, wherein the 3D cartoon face geometry information includes the width of the forehead and the distance between the eyebrows and eyes on the face, and the 3D cartoon face normal information includes the angle between the nose wing and the corner of the eye, the angle between the nose wing and the end of the eye, and the vector length between the end of the eye and the end of the eyebrow on the face; A texture map acquisition module, used for acquiring a three-dimensional cartoon face texture map according to the two-dimensional real face image, wherein the acquiring of the three-dimensional cartoon face texture map according to the two-dimensional real face image comprises: acquiring the three-dimensional cartoon face texture map according to the two-dimensional real face image, the three-dimensional cartoon face geometric information and the three-dimensional cartoon face normal information, wherein the three-dimensional cartoon face texture map comprises texture features reflected by color, and the texture features reflected by color comprise wrinkles; The three-dimensional cartoon face acquisition module is used to acquire the three-dimensional cartoon face based on the three-dimensional cartoon face mesh model and the three-dimensional cartoon face texture map.

7. An electronic device, characterized in that: including one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 5 is executed.

Citation Information

Patent Citations

  • Stylized face three-dimensional model automatic generation method based on single image

    CN109978930A

  • Three-dimensional face reconstruction method and device, electronic equipment and storage medium

    CN112819947A