Expression generation method and device, electronic equipment and computer readable storage medium
By dividing facial parts in the character facial model and selecting multiple target expression controllers to determine their parameters, the problem of unnatural facial expressions in the existing technology is solved and more natural and diverse facial expression generation is achieved.
Patent Information
- Application Number
- CN202310267089.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2024-09-20
AI Technical Summary
In the existing technology, when multiple part expression channels are selected from bound facial part expression channels, the multiple part expression channels usually belong to the same facial part, resulting in an unnatural facial expression.
By obtaining a character facial model bound to multiple expression controllers, dividing the facial parts, selecting the expression controller of the target facial part from each facial part, selecting the second target expression controller, and determining the expression from its expression parameter range Parameters that control the character facial model to generate facial expressions to ensure that the expressions of each target facial part are included.
It avoids the problem of unnatural facial expressions caused by the selected expression controllers all belonging to the same facial part, and the generated facial expressions are more natural and diverse.
Smart Images

Figure CN118674835A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an expression generation method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the development of deep learning, facial expression transfer technology based on deep learning has also made great progress, but it still faces challenges in how to obtain large amounts of rich and diverse expression training data.
[0003] In the prior art, a plurality of part expression channels can be arbitrarily selected from the part expression channels bound to the character facial model, and the character facial model can be driven to make corresponding character facial expressions according to the channel parameters of the selected part expression channels.
[0004] However, in the prior art, when multiple part expression channels are arbitrarily selected from bound part expression channels, there is a situation where the selected multiple part expression channels all belong to the same facial part, resulting in unnatural facial expressions being generated in the end. Summary of the invention
[0005] The present application provides an expression generation method, device, electronic device and computer-readable storage medium to solve the problem that the facial expressions of characters generated in the prior art are mostly unnatural.
[0006] In a first aspect, an embodiment of the present application provides a method for generating a replacement file theme expression, the method comprising:
[0007] Acquire a character facial model bound with a plurality of expression controllers, wherein different expression controllers are used to control expressions of different parts of the face, and each facial part corresponds to at least one expression controller;
[0008] Selecting, from the expression controllers corresponding to the facial parts, the first target expression controllers corresponding to at least one target facial part;
[0009] Selecting at least one second target expression controller from each of the first target expression controllers corresponding to the target facial part;
[0010] Determine a corresponding expression parameter for each of the second target expression controllers from the expression parameter range corresponding to the second target expression controller;
[0011] According to the expression parameters corresponding to the second target expression controller, the character facial model is controlled to generate facial expressions through the second target expression controller.
[0012] In a second aspect, an embodiment of the present application provides an expression generation device, the device comprising:
[0013] An acquisition module, used for acquiring a character face model bound with a plurality of expression controllers, wherein different expression controllers are used for controlling expressions of different parts, and each facial part corresponds to at least one expression controller;
[0014] A first determination module is used to select the first target expression controllers corresponding to at least one target facial part from the expression controllers corresponding to the facial parts;
[0015] A second determination module, configured to select at least one second target expression controller from each of the first target expression controllers corresponding to the target facial part;
[0016] A processing module, configured to determine a corresponding expression parameter for each of the second target expression controllers from a range of expression parameters corresponding to the second target expression controllers;
[0017] The control module is used to control the character facial model to generate facial expressions through the second target expression controller according to the expression parameters corresponding to the second target expression controller.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0019] A memory and a processor, wherein the memory and the processor are coupled;
[0020] The memory is used to store one or more computer instructions;
[0021] The processor is used to execute the one or more computer instructions to implement the expression generation method described in any one of the first aspects above.
[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having one or more computer instructions stored thereon, characterized in that the instruction is executed by a processor to implement the expression generation method described in any one of the first aspects above.
[0023] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the expression generation method described in any one of the first aspects above.
[0024] Compared with the prior art, this application has the following advantages:
[0025] The expression generation method provided by the present application obtains a character facial model bound to multiple expression controllers, where different expression controllers are used to control expressions of different parts, and each facial part corresponds to at least one expression controller; from the expression controllers corresponding to the facial parts, at least one first target expression controller corresponding to the target facial part is selected; from the first target expression controllers corresponding to the target facial part, at least one second target expression controller is selected; from the expression parameter range corresponding to the second target expression controller, corresponding expression parameters are determined for each second target expression controller; and according to the expression parameters corresponding to the second target expression controller, the character facial model is controlled to generate facial expressions through the second target expression controller.
[0026] Compared with the prior art, the present application divides multiple expression controllers in the character facial model according to facial parts, selects a certain number of target facial parts from the divided multiple facial parts, and then selects a second target expression controller from the first target expression controller corresponding to each target facial part, and controls the character facial model to generate facial expressions according to the expression parameters determined for each second target expression controller. In this way, it can be ensured that the generated facial expressions contain the expressions of each target facial part, thereby avoiding the situation where unnatural facial expressions are generated because the selected multiple expression controllers all belong to the same facial part. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0028] Figure 1 It is a schematic diagram of a deformed expression provided by this application;
[0029] Figure 2 This is a flowchart of the expression generation method provided in the first embodiment of the present application;
[0030] Figure 3 A schematic diagram of an expressionless character facial model provided in the first embodiment of the present application;
[0031] Figure 4 The second flowchart of the expression generation method provided in the first embodiment of the present application;
[0032] Figure 5 A schematic diagram of the structure of an expression generating device provided in the second embodiment of the present application;
[0033] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in the third embodiment of the present application.
[0034] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0035] In order to make the purpose, advantages and features of the present application clearer, the present application is described clearly and completely below in conjunction with the accompanying drawings and specific embodiments. In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments, and all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0036] It should be noted that, in the description of the present application, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance, and a specific order or sequence. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, the term "multiple" refers to two or more. The term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship. The terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] In order to facilitate understanding of the technical solution of the present application, the relevant concepts involved in the present application are first introduced.
[0038] Through observation and biofeedback, researchers have described the correspondence between different facial muscle movements and different expressions, and thus created the Facial Action Coding System (FACS). Based on the anatomical characteristics of the human face, the Facial Action Coding System divides facial muscles into several independent yet interconnected motor units, analyzes the movement characteristics of these motor units, namely the main areas they control and the expressions associated with them, and provides a large number of photo illustrations.
[0039] The underlying facial binding is mainly divided into two types: bone binding and blend shape.
[0040] As the name suggests, bone binding is to set up a set of bones in the model. The displacement and rotation of each bone drive the vertices of the mesh on the nearby surface to move synchronously, and the mesh vertices at the joints will be affected by the nearby bones at the same time. Therefore, the core work of bone binding is to determine the weight relationship of each vertex affected by each bone. This process is also called skinning.
[0041] Blend deformation is the main means to solve non-rigid deformation. Taking facial expressions as an example, facial expressions are usually decomposed into several facial motion units, such as closing the left eye, raising the right eyebrow, raising the left corner of the mouth, etc. Each facial motion unit will pinch out the corresponding expression model at the mesh level like modeling, and based on the expressionless neutral face, record the relative vertices of these expression faces uniquely, and linearly approximate this movement process, assigning a coefficient between 0 and 1 to express the intermediate state.
[0042] In the actual production process, it is inefficient to directly adjust the underlying bones and blend deformations. Therefore, based on these underlying bindings, controllers are made to make expressions more efficient. The essence of a controller is a driving relationship. A controller can connect several bones or blend deformations to control their attribute values with a certain weight. The purpose of introducing a controller is to efficiently produce animations. For example, a controller can be bound to set the eye closure with one click, thus saving time in adjusting the coordination of eye closure.
[0043] As an important part of character animation, facial expression animation expresses the character's emotions and personality through rich facial expressions and movements, reflecting the spirituality and vitality of animation. Facial expression animation requires the establishment of an expression control system based on animation controllers through character assembly to achieve fine-tuning of facial expressions.
[0044] Below, the prior art involved in this application and the problems existing in the prior art are described:
[0045] Facial expression transfer technology can be used to generate facial expressions for game or animation characters, which can greatly improve the efficiency of game animation production. With the development of deep learning, facial expression transfer technology based on deep learning has also made great progress, but it still faces challenges in how to obtain a large amount of rich and diverse expression training data.
[0046] In the prior art, a plurality of part expression channels can be arbitrarily selected from the part expression channels bound to the character facial model, and the character facial model can be driven to make corresponding character facial expressions according to the channel parameters of the selected part expression channels.
[0047] However, in the prior art, when multiple part expression channels are arbitrarily selected from bound part expression channels, there is a situation where the selected multiple part expression channels all belong to the same facial part, resulting in unnatural facial expressions being generated in the end.
[0048] In order to solve the above problems, the present application provides an expression generation method, an expression generation device corresponding to the method, an electronic device that can implement the expression generation method, and a computer-readable storage medium. The following embodiments are provided to describe the above method, device, electronic device, and computer-readable storage medium in detail.
[0049] In order to make the purpose and technical solution of the present application clearer and more intuitive, the method provided by the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It is understood that the following embodiments may exist separately, and the following embodiments and features in the embodiments may be combined with each other when there is no conflict between the embodiments provided in the present application, and the same or similar content will not be repeated in different embodiments. In addition, the step sequence in the following method embodiments is only an example, not a strict limitation, and in some cases, the steps shown or described may be performed in a different order from this.
[0050] The present application provides an expression generation method, device, electronic device and computer storage medium. Specifically, the expression generation method of one embodiment of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer, a personal digital assistant, etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and basic cloud computing services such as big data and artificial intelligence platforms.
[0051] It should be noted that in the following description of the technical solution provided by the present application, the server is used as an example for the description. In other possible implementations, the technical solution provided by the present application can also be executed by a control device provided in the server as an execution subject, and the embodiment of the present application does not limit the type of execution subject. Optionally, the control device can be implemented by software or by a combination of software and hardware.
[0052] Next, combine Figure 2 , the expression generation method provided in the first embodiment of the present application is described, Figure 2 This is one of the flowchart diagrams of the expression generation method provided in the first embodiment of the present application.
[0053] like Figure 2 As shown, the expression generation method includes:
[0054] S201. Acquire a character facial model bound with a plurality of expression controllers, wherein different expression controllers are used to control expressions of different parts of the face, and each facial part corresponds to at least one expression controller.
[0055] In the embodiment of the present application, the character face model may be a three-dimensional deformable model (3D Morphable Models, 3DMM), and the initial character face model presents an expressionless neutral face such as Figure 3 As shown, Figure 3 A schematic diagram of an expressionless character face provided for the first embodiment of the present application. Among them, 3DMM is a parametric model of human face, and a three-dimensional character face model with a specific expression can be generated by adjusting the parameters of each expression controller. Common human face 3DMM models include large-scale human face models, Basel human face models, etc.
[0056] Select a suitable 3DMM model, use the facial expression binding algorithm, and bind the required expression controllers corresponding to various parts of the expression to the three-dimensional deformation model. Among them. The expression can be inner eyebrow raising, outer eyebrow raising, inner eyebrow pressing, inner eyebrow retraction, eyes open, eyes closed, wrinkled nose bridge, relaxed nose bridge, upper lip raising, mouth corner lifting, mouth corner smiling, mouth corner pulling, mouth corner twitching, mouth corner twitching and other fine expressions. The expression controller corresponding to each part of the expression has a corresponding parameter range, indicating the degree of change of each part of the expression. After binding the part of the expression, the character facial model can control the facial expression presented by the character facial model as a whole by adjusting the parameters of the expression controller corresponding to each part of the expression.
[0057] In the embodiment of the present application, each fine local facial expression corresponds to an expression controller.
[0058] Optionally, the face of the character facial model is divided into a first number of facial parts.
[0059] Optionally, the face of the character face model is divided into five facial parts: eyebrow part, eye part, mouth part, nose part, and chin part. Figure 4 As shown, Figure 4 A schematic diagram of facial area partitioning provided in the first embodiment of the present application.
[0060] In the embodiment of the present application, each facial part corresponds to at least one expression controller. It should be noted that the same facial part can present a variety of different expressions, so all expression controllers corresponding to the same facial part are used to control the facial part to present different expressions.
[0061] For example, the character's facial area is partitioned according to the eyebrow area, eye area, mouth area, nose area, and chin area, and at least one expression controller corresponding to each facial area can be shown in Table 1.
[0062] Table 1
[0063]
[0064] As shown in Table 1, some facial parts include symmetrical parts, such as the left eyebrow and the right eyebrow in the eyebrow part are symmetrical parts, the left eye and the right eye in the eye part are symmetrical parts, the left nose wing and the right nose wing in the nose part are symmetrical parts, and the left corner of the mouth and the right corner of the mouth are symmetrical parts.
[0065] Taking the eyebrow part as an example, the eyebrow part includes a symmetrically arranged left eyebrow and a right eyebrow, and the same expression controller is set for the left eyebrow and the right eyebrow. For example, the following expression controllers are set for the left eyebrow and the right eyebrow: eyebrow raising controller, inner eyebrow raising controller, inner eyebrow pressing controller, inner eyebrow retraction controller, outer eyebrow raising controller, and outer eyebrow pressing controller. Specifically, the expression controllers for the left eyebrow include: left eyebrow raising controller, left inner eyebrow raising controller, left inner eyebrow pressing controller, left inner eyebrow retraction controller, left outer eyebrow raising controller, and left outer eyebrow pressing controller; the expression controllers for the right eyebrow include: right eyebrow raising controller, right inner eyebrow raising controller, right inner eyebrow pressing controller, right inner eyebrow retraction controller, right outer eyebrow raising controller, and right outer eyebrow pressing controller. For another example, the chin part does not involve a symmetrical part, and the chin part includes a chin raising controller and a chin pulling controller.
[0066] The controllers of other facial parts are shown in Table 1, and so on, which will not be repeated here. It should be noted that Table 1 is only an example of the controllers included in each facial part, and the embodiment of the present application does not impose any restrictions on the controllers included in each facial part, and can be set according to actual needs.
[0067] S202: Select first target expression controllers corresponding to at least one target facial part from the expression controllers corresponding to the facial parts.
[0068] In the embodiment of the present application, the character facial model bound with multiple expression controllers obtained in step S201 has an initial facial expression of no expression.
[0069] In an embodiment of the present application, the expressions of several or all facial parts in a neutral face showing no expression are adjusted so that the character facial model is converted from an expressionless character facial model to an expressive character facial model.
[0070] Optionally, first determine a second number of target facial parts, select the second number of target facial parts from the facial parts corresponding to the character facial model, and determine the expression controllers corresponding to the target facial parts as the first target expression controllers corresponding to the target facial parts.
[0071] The above optional implementation is exemplarily described below in combination with Table 1 and a specific example.
[0072] For example, as shown in Table 1, the facial expression binding area divides the facial area into the following five facial parts, namely, eyebrow part, eye part, mouth part, nose part, and chin part. Assume that first, it is determined that three (i.e., the second number is 3) target facial parts need to be selected, and then three target facial parts are selected from the five facial parts, such as the selected three target facial parts are: eyebrow part, nose part, and eye part.
[0073] As shown in Table 1, the expression controllers corresponding to the eyebrow parts include: left eyebrow raising controller, left inner eyebrow raising controller, left inner eyebrow pressing controller, left inner eyebrow retraction controller, left outer eyebrow raising controller, left outer eyebrow pressing controller, right eyebrow raising controller, right inner eyebrow raising controller, right inner eyebrow pressing controller, right inner eyebrow retraction controller, right outer eyebrow raising controller, and right outer eyebrow pressing controller.
[0074] That is to say, when the eyebrow part is selected as the target facial part, all expression controllers corresponding to the eyebrow part are the first target controllers corresponding to the eyebrow part. Therefore, the first target controller corresponding to the eyebrow part includes: inner eyebrow lifting controller, inner eyebrow pressing controller, inner eyebrow retraction controller, outer eyebrow lifting controller, and outer eyebrow pressing controller. Similarly, when the nose part is selected as the target facial part, the expression controller corresponding to the nose part is the first target controller corresponding to the nose part. Therefore, the first target controller corresponding to the nose part is: wrinkle nose bridge controller. Similarly, when the eye part is selected as the target facial part, the expression controller corresponding to the eye part is the first target controller corresponding to the eye part. The first target controller corresponding to the eye part includes: eye opening controller and eye closing controller.
[0075] S203: Select at least one second target expression controller from each first target expression controller corresponding to the target facial part.
[0076] Based on the above step S202, after the first target expression controllers corresponding to the target facial parts are determined, at least one second target expression controller is selected from the first target expression controllers corresponding to the target facial parts.
[0077] Optionally, first, for each target facial part, a third number corresponding to each target facial part is determined. The third number is the number of first target expression controllers selected from the first target expression controllers corresponding to the target facial part. Then, for each target facial part, a third number of first target expression controllers are selected from the first target expression controllers corresponding to the target facial part, and the selected first target expression controllers are determined as second target expression controllers.
[0078] The above optional implementation methods are exemplarily described below with reference to specific examples.
[0079] For example, taking the target facial part as the eyebrow part, two (i.e., the third number is 2) first target expression controllers are selected from the five first target expression controllers corresponding to the eyebrow part. Then, two first target expression controllers are randomly selected from the five first target controllers corresponding to the eyebrow part: the inner eyebrow raising controller, the inner eyebrow pressing controller, the inner eyebrow retraction controller, the outer eyebrow raising controller, and the outer eyebrow pressing controller. If the two selected first target expression controllers are the inner eyebrow raising controller and the outer eyebrow pressing controller, respectively, the inner eyebrow raising controller and the outer eyebrow pressing controller are determined as the second target expression controllers corresponding to the eyebrow part.
[0080] S204: Determine corresponding expression parameters for each second target expression controller from the expression parameter range corresponding to the second target expression controller.
[0081] In an embodiment of the present application, each expression controller corresponding to the character's facial model is set with a certain expression parameter range. Different parameters are selected from the expression parameter range corresponding to the expression controller, and the expression controller will control the expression to different degrees. For example, taking the eye opening controller as an example, the expression parameter range corresponding to the eye opening controller corresponds to the degree of control of the size of the eye opening. For example, the expression parameter range corresponding to the eye opening controller is [0.2, 2]. Among them, when the parameter is 0.2, the size of the eye opening is the minimum degree of opening that the eye can be opened; when the parameter is 2, the size of the eye opening is the maximum degree of opening that the eye can be opened.
[0082] Taking the target facial part as the eye part and the second target expression controller as the eye-opening controller as an example, a random value is taken from the expression parameter range [0.2, 2] corresponding to the eye-opening controller, for example, the value is 1.2, and 1.2 is used as the expression parameter corresponding to the eye-opening controller.
[0083] Optionally, based on the expressions presented by the parameters of each second target expression controller, an optional range of expression parameters is determined for each second target expression controller. For example, taking the left eyebrow outer eyebrow downward pressure controller corresponding to the eyebrow part as an example, if the parameter range corresponding to the left eyebrow outer eyebrow downward pressure controller in the facial character model is [-2, 3]. In order to avoid sampling the expression of the target facial part that is too exaggerated or too large in amplitude, it is necessary to select a part of the parameters from the parameter range corresponding to the left eyebrow outer eyebrow downward pressure controller [-2, 3] as the expression parameter optional range corresponding to the left eyebrow outer eyebrow downward pressure controller. For example, the determined expression parameter optional range is [-1, 2]. It should be noted that the parameters in the optional range of expression parameters can be selected from discrete parameter points in the parameter range in the second target expression controller, or a continuous parameter range can be selected. The embodiment of the present application does not impose any restrictions on the comparison, as long as the parameters in the optional range of expression parameters are all derived from the parameter range corresponding to the second target expression controller.
[0084] In the embodiment of the present application, by determining the optional range of expression parameters corresponding to each second target expression controller, it is possible to avoid the occurrence of unexpected part expressions. In addition, the parameter value range of each second target expression controller is limited to its valid value range, which can avoid the second target expression controller from taking abnormal expression parameters that exceed the optional range of expression parameters. These abnormal expression parameters often lead to deformed facial expressions or make facial expressions appear unnatural.
[0085] Optionally, after determining the optional range of expression parameters for each second target expression controller, the corresponding expression parameters are determined for each second target expression controller from the optional range of expression parameters corresponding to the second target expression controller. For example, in the facial character model, taking the left eyebrow outer eyebrow pressing controller as the second target controller as an example, assuming that the original expression parameter range corresponding to the left eyebrow outer eyebrow pressing controller is [-2, 3], and the optional range of expression parameters corresponding to the left eyebrow outer eyebrow pressing controller is [-1, 2], then selecting the expression parameter "1" from the expression parameter optional range [-1, 2], and determining "1" as the expression parameter corresponding to the left eyebrow outer eyebrow pressing controller.
[0086] S205. According to the expression parameters corresponding to the second target expression controller, the character facial model is controlled to generate facial expressions through the second target expression controller.
[0087] Based on the above step S204, expression parameters are determined for each second target expression controller. Next, the corresponding expression parameters are input into the second target expression controller corresponding to the character facial model, so that the character facial model is controlled to generate facial expressions through each second target expression controller with expression parameters.
[0088] Below, an exemplary description is given with reference to a specific example.
[0089] For example, the determined target facial parts are the eyebrow part and the eye part. From each first target controller corresponding to the eyebrow part, the inner eyebrow raising controller and the outer eyebrow pressing controller are selected as the second target expression controller; from each first target controller corresponding to the eye part, the eye opening controller is selected as the second target expression controller. For each second target expression controller, the determined expression parameters are shown in Table 2.
[0090] Table 2
[0091]
[0092] As shown in Table 2, the second target expression controller corresponding to the eyebrow part is the left inner eyebrow raising controller and the right outer eyebrow pressing controller. Among them, the parameter range corresponding to the left inner eyebrow raising controller is [0, 2], and the expression parameter determined for the left inner eyebrow raising controller from the parameter range [0, 2] corresponding to the left inner eyebrow raising controller is 1. The parameter range corresponding to the right outer eyebrow pressing controller is [0, 1], and the expression parameter determined for the right outer eyebrow pressing controller from the parameter range [0, 1] corresponding to the right outer eyebrow pressing controller is 0.8. The second target expression controller corresponding to the eye part is the left eye opening controller and the right eye opening controller. Among them, the parameter ranges corresponding to the left eye opening controller and the right eye opening controller are both [0.2, 2]. The expression parameter "1.5" is selected from the parameter range [0.2, 2] corresponding to the left eye opening controller as the expression parameter of the left eye opening controller; the expression parameter "1.3" is selected from the parameter range [0.2, 2] corresponding to the right eye opening controller as the expression parameter of the right eye opening controller.
[0093] According to the left inner eyebrow raising controller with an expression parameter of 1, the right outer eyebrow pressing controller with an expression parameter of 0.8, the left eye opening controller with an expression parameter of 1.5, and the right eye opening controller with an expression parameter of 1.5, the character face model is controlled to generate facial expressions. It can be understood that in the facial expression generated by the character face model, the left inner eyebrow presents an upward expression and the degree of upward raising of the left inner eyebrow is the upward degree corresponding to the inner eyebrow raising expression parameter of 1; the right outer eyebrow presents a downward expression and the degree of downward pressing of the right outer eyebrow is the downward degree corresponding to the right outer eyebrow pressing expression parameter of 0.8; the left and right eyes in the facial expression generated by the character face model present an open expression and the degree of opening of the left and right eyes is the degree of opening of the eyes corresponding to the eye opening expression parameters of 1.5 and 1.3, respectively.
[0094] Optionally, a screenshot operation is performed on the character facial model for generating facial expressions to obtain a character facial expression picture.
[0095] In the expression generation method provided in the embodiment of the present application, a character facial model bound with multiple expression controllers is obtained, and different expression controllers are used to control and realize different expressions of different parts, and each facial part corresponds to at least one expression controller. From the expression controllers corresponding to the facial parts, select the first target expression controllers corresponding to at least one target facial part. Select at least one second target expression controller from the first target expression controllers corresponding to the target facial part. From the expression parameter range corresponding to the second target expression controller, determine the corresponding expression parameters for each second target expression controller. According to the expression parameters corresponding to the second target expression controller, control the character facial model to generate facial expressions through the second target expression controller. Determine the target facial part from each facial part, and select the second target expression controller from the multiple first target expression controllers corresponding to the target facial part. Take the expression parameters for each second target expression controller, and control the character facial model to generate facial expressions through the second target expression controller according to the expression parameters corresponding to the second target expression controller.
[0096] Compared with the prior art, the present application divides multiple expression controllers in the character facial model according to facial parts, selects a certain number of target facial parts from the divided multiple facial parts, and then selects second target expression controllers from the first target expression controllers corresponding to each target facial part, and controls the character facial model to generate facial expressions according to the expression parameters determined for each second target expression controller. In this way, it can be ensured that the generated facial expressions contain the expressions corresponding to each target facial part, thereby avoiding the situation where unnatural facial expressions are generated because the selected multiple expression controllers all belong to the same facial part.
[0097] On the basis of the above embodiment, the expression generation method provided in the embodiment of the present application may further include steps S501 to S503, wherein:
[0098] S501. For each second target expression controller, determine whether there is a third target expression controller symmetrical to the second target expression controller among multiple expression controllers.
[0099] S502: Determine expression parameters of a third target expression controller using expression parameters of the second target expression controller.
[0100] In the embodiment of the present application, for each second target expression controller, a third target expression controller symmetrical to the second target expression controller is determined from a plurality of expression controllers.
[0101] For example, if the second target expression controller is a left eyebrow raising controller, the third target expression controller with the same expression based on the facial part and taking the vertical center of the face as the symmetry axis is a right eyebrow raising controller.
[0102] Parameters symmetrical to the expression parameters of the second target expression controller are determined as expression parameters of the third target expression controller.
[0103] Optionally, the expression parameters of the second target expression controller are used to determine the expression parameters of the third target expression controller.
[0104] S503: Control the character's facial model to generate facial expressions through the second target expression controller and the third target expression controller.
[0105] In the embodiment of the present application, by setting parameters symmetrical to the expression parameters of the second target expression controllers for the third target expression controller that is symmetrical to each second target expression controller, it can be ensured that mutually symmetrical parts in the same part present symmetrical part expressions, for example, the left eyebrow presents a raised inner eyebrow, and the right eyebrow presents a raised inner eyebrow. This avoids the occurrence of facial parts that are symmetrical to the same facial organs presenting different and greatly different expressions, resulting in unnatural facial expressions.
[0106] Based on the above embodiment, the implementation of step S202 may include steps S601 and S602, wherein:
[0107] S601. Determine a second number, where the second number is an integer greater than 1 and less than or equal to the first number.
[0108] In the embodiment of the present application, the character face model includes a first number of facial parts.
[0109] Optionally, the value of the second number is determined randomly.
[0110] S602: Select a second number of target facial parts from the first number of facial parts.
[0111] In the embodiment of the present application, the second number is randomly selected, which can ensure that the expression generation method is executed multiple times, thereby improving the diversity of facial expressions.
[0112] Based on the above embodiment, the implementation of step S203 may include steps S701 and S702, wherein:
[0113] S701. For each target facial part, determine a third number corresponding to the target facial part, where the third number corresponding to the target facial part is less than or equal to the total number of first target expression controllers corresponding to the target facial part.
[0114] S702: For each target facial part, select a third number of second target expression controllers from the first target expression controllers corresponding to the target facial part.
[0115] In the embodiment of the present application, in the embodiment of the present application, the third number is randomly selected, so that the expression generation method can be executed multiple times, which can improve the diversity of facial expressions.
[0116] The expression generation device provided in the present application is described below. The expression generation device described below and the expression generation method described above can be referenced to each other.
[0117] Figure 5 This is a schematic diagram of the structure of the expression generation device provided in the second embodiment of the present application. Figure 5 As shown, the expression generating device includes: an acquisition module 501 , a first determination module 502 , a second determination module 503 , a processing module 504 , and a control module 505 .
[0118] An acquisition module, used for acquiring a character face model bound with a plurality of expression controllers, wherein different expression controllers are used for controlling expressions of different parts, and each facial part corresponds to at least one expression controller;
[0119] A first determination module is used to select the first target expression controllers corresponding to at least one target facial part from the expression controllers corresponding to the facial parts;
[0120] A second determination module, configured to select at least one second target expression controller from each of the first target expression controllers corresponding to the target facial part;
[0121] A processing module, configured to determine a corresponding expression parameter for each of the second target expression controllers from a range of expression parameters corresponding to the second target expression controllers;
[0122] The control module is used to control the character facial model to generate facial expressions through the second target expression controller according to the expression parameters corresponding to the second target expression controller.
[0123] Optionally, the control module is specifically used for:
[0124] For each of the second target expression controllers, determining whether there is a third target expression controller symmetrical to the second target expression controller among the plurality of expression controllers;
[0125] Determine the expression parameters of the third target expression controller by using the expression parameters of the second target expression controller;
[0126] The facial expression model of the character is controlled to generate facial expressions by the second target expression controller and the third target expression controller. Optionally, the facial model of the character includes a first number of facial parts; and the first determination module is specifically used to:
[0127] determining a second number, the second number being less than or equal to the first number;
[0128] The second number of target facial parts is selected from the first number of facial parts.
[0129] Optionally, the second determining module is specifically configured to:
[0130] For each of the target facial parts, determining a third number corresponding to the target facial part, wherein the third number corresponding to the target facial part is less than or equal to the total number of the first target expression controllers corresponding to the target facial part;
[0131] For each of the target facial parts, the third number of second target expression controllers are selected from the first target expression controllers corresponding to the target facial part.
[0132] For each of the expression controllers, determining an optional range of expression parameters of the expression controller according to the expression parameter range of the expression controller;
[0133] For each of the expression controllers, a corresponding expression parameter is determined for the second target expression controller according to the optional range of the expression parameter of the expression controller.
[0134] Optionally, the device further includes a second processing module, wherein the second processing module is specifically configured to:
[0135] A screenshot operation is performed on the character facial model for generating facial expressions to obtain a character facial expression picture.
[0136] Optionally, the facial parts include at least one of the following: eyebrow parts, eye parts, nose parts, mouth parts, and chin parts.
[0137] Optionally, the device further includes a third determining module, and the third determining module is specifically configured to:
[0138] The expression generation device provided in this embodiment can be used to execute the technical solution of the above-mentioned expression generation method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0139] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in the third embodiment of the present application is shown in FIG. Figure 6 As shown, the electronic device 600 of this embodiment includes: a processor 601 and a memory 602;
[0140] Memory 602, used to store computer-executable instructions;
[0141] The processor 601 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the expression generation method in the above embodiment. For details, please refer to the relevant description in the above method embodiment.
[0142] Optionally, the memory 602 may be independent or integrated with the processor 601 .
[0143] When the memory 602 is independently provided, the electronic device further includes a bus 603 for connecting the memory 602 and the processor 601 .
[0144] The fourth embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the technical solution corresponding to the expression generation method in any of the above embodiments executed by the above electronic device is implemented.
[0145] The fifth embodiment of the present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the technical solution corresponding to the expression generation method in any of the above embodiments.
[0146] It should be noted that for the detailed description of the devices, electronic devices, computer-readable storage media, and computer program products provided in the second, third, fourth, and fifth embodiments of the present application, reference can be made to the relevant description of the second embodiment of the present application, and no further details will be given here.
[0147] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0148] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0149] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.
[0150] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0151] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0152] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0153] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0154] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0155] 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 replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating an expression, characterized in that: The method comprises: Acquire a character facial model bound with a plurality of expression controllers, wherein different expression controllers are used to control expressions of different parts of the face, and each facial part corresponds to at least one expression controller; Selecting, from the expression controllers corresponding to the facial parts, the first target expression controllers corresponding to at least one target facial part; Selecting at least one second target expression controller from each of the first target expression controllers corresponding to the target facial part; Determine a corresponding expression parameter for each of the second target expression controllers from the expression parameter range corresponding to the second target expression controller; According to the expression parameters corresponding to the second target expression controller, the character facial model is controlled to generate facial expressions through the second target expression controller.
2. The method according to claim 1, characterized in that The step of controlling the character facial model to generate facial expressions through the second target expression controller according to the expression parameters corresponding to the second target expression controller includes: For each of the second target expression controllers, determining whether there is a third target expression controller symmetrical to the second target expression controller among the plurality of expression controllers; Determine the expression parameters of the third target expression controller by using the expression parameters of the second target expression controller; The character facial model is controlled to generate facial expressions through the second target expression controller and the third target expression controller.
3. The method according to claim 1, characterized in that The character face model includes a first number of face parts; the selecting, from the expression controllers corresponding to the face parts, the first target expression controllers corresponding to at least one target face part includes: Determine a second number, where the second number is an integer greater than 1 and less than or equal to the first number; The second number of target facial parts is selected from the first number of facial parts.
4. The method according to claim 1, characterized in that: The selecting at least one second target expression controller from each of the first target expression controllers corresponding to the target facial part comprises: For each of the target facial parts, determining a third number corresponding to the target facial part, wherein the third number corresponding to the target facial part is less than or equal to the total number of the first target expression controllers corresponding to the target facial part; For each of the target facial parts, the third number of second target expression controllers are selected from the first target expression controllers corresponding to the target facial part.
5. The method according to claim 1, characterized in that The step of determining a corresponding expression parameter for each of the second target expression controllers from the expression parameter range corresponding to the second target expression controller comprises: For each of the expression controllers, determining an optional range of expression parameters of the expression controller according to the expression parameter range of the expression controller; For each of the expression controllers, a corresponding expression parameter is determined for the second target expression controller according to the optional range of the expression parameter of the expression controller.
6. The method according to claim 1, characterized in that The method further comprises: A screenshot operation is performed on the character facial model for generating facial expressions to obtain a character facial expression picture.
7. The method according to claim 1, characterized in that The facial part includes at least one of the following: an eyebrow part, an eye part, a nose part, a mouth part, and a chin part.
8. An expression generating device, characterized in that: The device comprises: An acquisition module, used for acquiring a character face model bound with a plurality of expression controllers, wherein different expression controllers are used for controlling expressions of different parts, and each facial part corresponds to at least one expression controller; A first determination module is used to select the first target expression controllers corresponding to at least one target facial part from the expression controllers corresponding to the facial parts; A second determination module, configured to select at least one second target expression controller from each of the first target expression controllers corresponding to the target facial part; A processing module, configured to determine a corresponding expression parameter for each of the second target expression controllers from a range of expression parameters corresponding to the second target expression controllers; The control module is used to control the character facial model to generate facial expressions through the second target expression controller according to the expression parameters corresponding to the second target expression controller.
9. An electronic device, characterized in that: The electronic device comprises: Processor; and The memory is used to store a data processing program. After the electronic device is powered on and the program is run by the processor, the expression generation method according to any one of claims 1 to 7 is executed.
10. A computer-readable storage medium, characterized in that: A data processing program is stored, and the program is run by a processor to execute the expression generation method as described in any one of claims 1-7.
