Virtual character blink animation generation method and device, electronic equipment and storage medium

By generating a sequence of blink coefficients in the target eyelid state, the problem of virtual characters being unable to express their original emotions when blinking is solved, and the facial expression performance effect of virtual characters is improved.

CN119068084APending Publication Date: 2024-12-03SHANGHAI KAITUO HUANYU TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310637965.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The existing virtual character blink animation generation method will cover the original eyelid state, resulting in the inability to express the original emotions of the virtual character when blinking, resulting in poor facial expression performance.

Method used

By generating a sequence of blink coefficients in the target eyelid state, adjusting the coefficient values ​​in the intermediate coefficient sequence, ensuring that the virtual character retains the original eyelid state when blinking, thereby generating a blink animation that can express emotions.

Benefits of technology

It realizes the realization of retaining the original emotions while the virtual character blinks, making the facial expression more vivid and improving the facial expression performance of the virtual character.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068084A_ABST
    Figure CN119068084A_ABST
Patent Text Reader

Abstract

The invention relates to a virtual character blinking animation generation method and device, electronic equipment and a storage medium. The method comprises the steps that preset parameters are acquired; based on preset parameters, an initial coefficient sequence is generated, a corresponding intermediate coefficient sequence when the virtual character executes the blinking action is determined from the initial coefficient sequence, the initial coefficient sequence is a sequence composed of coefficients in the target eyelid state, and the initial coefficient sequence comprises at least one intermediate coefficient sequence; according to the coefficient value of the coefficient in the target eyelid state and a preset parameter, adjusting the coefficient value of the coefficient in the intermediate coefficient sequence to obtain a blink coefficient sequence; and generating a blinking animation of the virtual character in the target eyelid state based on the blinking coefficient sequence. Therefore, the original emotion of the virtual character can be reserved while the virtual character blinking is performed, so that the facial expression of the virtual character is more vivid, and the expression effect of the facial expression of the virtual character is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of animation production technology, and in particular to a method, device, electronic device and storage medium for generating a virtual character blinking animation. Background Art

[0002] In animation production, in order to make virtual characters simulate real human facial expressions, it is usually necessary to set blinking actions for virtual characters. However, the existing blinking animation generation method is usually to manually set the blinking coefficient of the key frame in the animation, which will cause the original eyelid state of the virtual character to be covered, and it is impossible to express the original emotions of the virtual character, such as sadness, happiness, etc., while blinking, resulting in poor facial expression of the virtual character. Therefore, how to express the original emotions of the virtual character while blinking has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] The present application provides a coefficient sequence corresponding to a virtual character blinking a character while retaining the target eyelid state to perform a blinking action;

[0004] Based on the blink coefficient sequence, a blink animation of the virtual character in the target eyelid state is generated.

[0005] Optionally, the preset parameters include blinking time interval, frame rate and number of frames of blinking action duration;

[0006] The step of determining, from the initial coefficient sequence, an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, comprises:

[0007] Determine, according to the blinking time interval and the frame rate, a first video frame corresponding to the maximum eye closure moment of the virtual character in the blinking action;

[0008] Determine, according to the number of frames of the blinking action and the first video frame, a second video frame corresponding to the start moment of the blinking of the virtual character and a third video frame corresponding to the end moment of the blinking, wherein the first video frame is between the second video frame and the third video frame;

[0009] The intermediate coefficient sequence is determined from the initial coefficient sequence according to the positions of the coefficients corresponding to the second video frame and the coefficients corresponding to the third video frame in the initial coefficient sequence respectively.

[0010] Optionally, the number of frames between the first video frame and the second video frame is equal to the number of frames between the first video frame and the third video frame.

[0011] Optionally, the preset parameters also include coefficient values ​​in a maximum eye-closing state;

[0012] The step of adjusting the coefficient values ​​of the coefficients in the intermediate coefficient sequence according to the coefficient values ​​of the coefficients in the target eyelid state and the preset parameters to obtain a blink coefficient sequence includes:

[0013] Keep the coefficient values ​​of the coefficients corresponding to the second video frame and the coefficient values ​​of the coefficients corresponding to the third video frame as the coefficient values ​​of the coefficients in the target eyelid state, and adjust the coefficient values ​​of the coefficients corresponding to the first video frame to the coefficient values ​​in the maximum eye closure state;

[0014] According to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame and the adjusted coefficient value of the coefficient corresponding to the first video frame, interpolation calculation is performed on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence respectively to obtain an interpolation calculation result, wherein the intermediate coefficient sequence includes the first subsequence and the second subsequence, the first subsequence refers to a coefficient sequence with the coefficient corresponding to the second video frame and the coefficient corresponding to the first video frame as a boundary, and the second subsequence refers to a coefficient sequence with the coefficient corresponding to the first video frame and the coefficient corresponding to the third video frame as a boundary;

[0015] According to the interpolation calculation result, the coefficient values ​​of the coefficients in the first subsequence and the second subsequence are adjusted respectively to obtain the blink coefficient sequence.

[0016] Optionally, performing interpolation calculation on coefficient values ​​of coefficients in the first subsequence and the second subsequence respectively according to coefficient values ​​of coefficients corresponding to the second video frame, coefficient values ​​of coefficients corresponding to the third video frame, and adjusted coefficient values ​​of coefficients corresponding to the first video frame to obtain interpolation calculation results includes:

[0017] A first interpolation step length and a second interpolation step length are calculated according to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame, and the adjusted coefficient value of the coefficient corresponding to the first video frame, wherein the first interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the second video frame and the first video frame, and the second interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the first video frame and the third video frame;

[0018] Interpolation calculation is performed on the first subsequence according to the first interpolation step length, and interpolation calculation is performed on the second subsequence according to the second interpolation step length to obtain the interpolation calculation result.

[0019] Optionally, the preset parameters also include coefficient values ​​of the coefficients under the target eyelid state;

[0020] Before generating the initial coefficient sequence based on the preset parameters, the method further includes:

[0021] Obtaining the total number of video frames corresponding to the original video animation associated with the virtual character;

[0022] The generating an initial coefficient sequence based on the preset parameters comprises:

[0023] The coefficient values ​​corresponding to the same number of coefficients as the total number of video frames are set as the coefficient values ​​of the coefficients under the target eyelid state, so as to generate the initial coefficient sequence.

[0024] Optionally, the target eyelid state is an eyelid state corresponding to any emotion of the virtual character.

[0025] In a second aspect, an embodiment of the present application further provides a device for generating a virtual character blinking animation, the device comprising:

[0026] A first acquisition module, used to acquire preset parameters, wherein the preset parameters are relevant parameters required for the virtual character to perform a blinking action;

[0027] A determination module, configured to generate an initial coefficient sequence based on the preset parameters, and determine from the initial coefficient sequence an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, wherein the initial coefficient sequence is a sequence composed of coefficients under a target eyelid state, and the initial coefficient sequence includes at least one of the intermediate coefficient sequences;

[0028] An adjustment module, configured to adjust the coefficient values ​​of the coefficients in the intermediate coefficient sequence according to the coefficient values ​​of the coefficients in the target eyelid state and the preset parameters, to obtain a blink coefficient sequence, wherein the blink coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blink action while retaining the target eyelid state;

[0029] A generating module is used to generate a blinking animation of the virtual character in the target eyelid state based on the blink coefficient sequence.

[0030] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0031] Memory, used to store computer programs;

[0032] The processor is used to implement the steps of the method for generating a virtual character blinking animation as described in any one of the embodiments of the first aspect when executing the program stored in the memory.

[0033] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for generating a virtual character blinking animation as described in any embodiment of the first aspect are implemented.

[0034] In an embodiment of the present application, preset parameters are obtained, wherein the preset parameters are relevant parameters required for a virtual character to perform a blinking action; an initial coefficient sequence is generated based on the preset parameters, and an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action is determined from the initial coefficient sequence, wherein the initial coefficient sequence is a sequence composed of coefficients under a target eyelid state, and the initial coefficient sequence includes at least one intermediate coefficient sequence; according to the coefficient values ​​of the coefficients under the target eyelid state and the preset parameters, the coefficient values ​​of the coefficients in the intermediate coefficient sequence are adjusted to obtain a blinking coefficient sequence, wherein the blinking coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blinking action while retaining the target eyelid state; based on the blinking coefficient sequence, a blinking animation of the virtual character under the target eyelid state is generated. Through the above method, the coefficients and preset parameters under the target eyelid state can be used to adjust the coefficient values ​​of the coefficients in the intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, so as to obtain a blink coefficient sequence. In this way, the blinking animation generated based on the blink coefficient sequence can retain the original emotions of the virtual character while the virtual character blinks, making the facial expressions of the virtual character more vivid and vivid, thereby improving the performance of the facial expressions of the virtual character. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0037] Figure 1 A schematic diagram of a flow chart of a method for generating a virtual character blinking animation provided in an embodiment of the present application;

[0038] Figure 2 A schematic diagram of the position of an intermediate coefficient sequence in an initial coefficient sequence provided in an embodiment of the present application;

[0039] Figure 3A comparison diagram of coefficient values ​​of coefficients in an intermediate coefficient sequence before and after calculation provided in an embodiment of the present application;

[0040] Figure 4 One of the schematic diagrams of the eyelid state of the virtual character provided in the embodiment of the present application;

[0041] Figure 5 The second schematic diagram of the eyelid state of the virtual character provided in the embodiment of the present application;

[0042] Figure 6 The third schematic diagram of the eyelid state of the virtual character provided in the embodiment of the present application;

[0043] Figure 7 The fourth schematic diagram of the eyelid state of the virtual character provided in the embodiment of the present application;

[0044] Figure 8 The fifth schematic diagram of the eyelid state of the virtual character provided in the embodiment of the present application;

[0045] Fig. 9 A schematic diagram of the structure of a virtual character blinking animation generating device provided in an embodiment of the present application;

[0046] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, 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. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0048] See also Figure 1 , Figure 1 The following is a flow chart of a method for generating a virtual character blinking animation provided in an embodiment of the present application. Figure 1 As shown, the method for generating a virtual character blinking animation may include the following steps:

[0049] Step 101: Obtain preset parameters, wherein the preset parameters are relevant parameters required for the virtual character to perform a blinking action.

[0050] Specifically, the above preset parameters are parameters pre-set by the user, and the preset parameters are related parameters required for the virtual character to perform the blinking action, which may include but are not limited to blinking time interval, frame rate, number of frames for blinking action, coefficient value in the maximum closed eye state, and coefficient value of the coefficient in the target eyelid state, etc. As an optional implementation, the preset parameters may include blinking time interval freq, frame rate fps, number of frames for blinking action duration width, coefficient value top in the maximum closed eye state, and coefficient value bottom in the target eyelid state, wherein freq=3 (indicates that a blinking action will be performed every 3 seconds), fps=25 (indicates that 25 video frames are played per second), width=6 (indicates that each blinking action lasts for 6 frames), top=0.95 (indicates that the coefficient value in the maximum closed eye state is 0.95), and bottom=e0 (indicates that the target eyelid state to be maintained by the virtual character is e0).

[0051] It should be noted that the coefficient value e0 of the coefficient in the target eyelid state here is a value in the range of 0 to 1. The larger the value, the greater the degree of eye closure of the virtual character rendered based on the value; the smaller the value, the smaller the degree of eye closure of the virtual character rendered based on the value, so the coefficient value of the coefficient in the target eyelid state can be used in the embodiment of the present application to represent the emotional expression of the virtual character in the target eyelid state.

[0052] Step 102: Generate an initial coefficient sequence based on preset parameters, and determine from the initial coefficient sequence an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, wherein the initial coefficient sequence is a sequence composed of coefficients under the target eyelid state, and the initial coefficient sequence includes at least one intermediate coefficient sequence.

[0053] Specifically, the above-mentioned initial coefficient sequence is a sequence composed of coefficients under the target eyelid state. For example, assuming that the coefficient under the target eyelid state is 0.5, the initial coefficient sequence is a sequence composed of N 0.5s, N is any integer greater than 1, and N represents the length of the initial coefficient sequence. The above-mentioned intermediate coefficient sequence refers to the coefficient sequence corresponding to the time period when the virtual character performs the blinking action. For example, assuming that the length N of the initial coefficient sequence is 200 (200 coefficients correspond to 200 video frames), the virtual character performs a blinking action every 75 frames, and each blinking action lasts for 6 frames, then the initial coefficient sequence may include 2 intermediate coefficient sequences, each of which includes 6 coefficients (i.e., 6 coefficients corresponding to each blinking action lasting 6 frames).

[0054] In this step, after obtaining the preset parameters, an initial coefficient sequence can be generated based on the coefficient values ​​of the coefficients under the target eyelid state in the preset parameters, and then based on the blinking time interval, frame rate and number of frames of blinking action in the preset parameters, an intermediate coefficient sequence corresponding to the virtual character when performing the blinking action can be determined from the initial coefficient sequence.

[0055] Step 103: According to the coefficient values ​​of the coefficients in the target eyelid state and the preset parameters, the coefficient values ​​of the coefficients in the intermediate coefficient sequence are adjusted to obtain a blink coefficient sequence, wherein the blink coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blink action while retaining the target eyelid state.

[0056] In this step, after determining the intermediate coefficient sequence from the initial coefficient sequence, the coefficient values ​​of each coefficient in the intermediate coefficient sequence can be adjusted according to the coefficient value of the coefficient under the target eyelid state and the coefficient value under the maximum closed eye state in the preset parameters to obtain the coefficient sequence after the initial coefficient sequence is adjusted, that is, the blink coefficient sequence.

[0057] Step 104: Generate a blinking animation of the virtual character in the target eyelid state based on the blink coefficient sequence.

[0058] In this step, since the generated blink coefficient sequence can reflect not only the target eyelid state of the virtual character but also the blinking action of the virtual character, a blink animation of the virtual character in the target eyelid state can be generated based on the blink coefficient sequence.

[0059] In this embodiment, the coefficients in the target eyelid state and preset parameters can be used to adjust the coefficient values ​​of the coefficients in the intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, so as to obtain a blink coefficient sequence. In this way, the blinking animation generated based on the blink coefficient sequence can retain the original emotions of the virtual character (i.e., the emotions corresponding to the target eyelid state) while the virtual character blinks, making the facial expressions of the virtual character more vivid and vivid, thereby improving the performance of the facial expressions of the virtual character.

[0060] Furthermore, the preset parameters include blinking time interval, frame rate and number of frames of blinking action duration;

[0061] The above step 102, determining from the initial coefficient sequence the intermediate coefficient sequence corresponding to the virtual character when performing the blinking action, specifically includes:

[0062] Determine, according to the blinking time interval and the frame rate, a first video frame corresponding to the maximum eye closure moment of the virtual character in the blinking action;

[0063] According to the number of frames of the blinking action and the first video frame, determining a second video frame corresponding to the start time of the blinking of the virtual character and a third video frame corresponding to the end time of the blinking, wherein the first video frame is between the second video frame and the third video frame;

[0064] According to the positions of the coefficients corresponding to the second video frame and the coefficients corresponding to the third video frame in the initial coefficient sequence, an intermediate coefficient sequence is determined from the initial coefficient sequence.

[0065] In one embodiment, the preset parameters may include a blinking time interval, a frame rate, and a number of frames for blinking action, wherein the blinking time interval refers to the time interval between two adjacent blinking actions, that is, the length of time between the end moment of the blinking of the previous blinking action and the start moment of the blinking of the current blinking action; the frame rate refers to the number of video frames played per second; the number of frames for blinking action refers to the number of video frames that each blinking action needs to last. When determining the intermediate coefficient sequence from the initial coefficient sequence, the first video frame corresponding to the maximum eye closure moment of the virtual character in the blinking action can be determined according to the blinking time interval and the frame rate, and then the second video frame corresponding to the start moment of the blinking action and the third video frame corresponding to the end moment of the blinking action of the virtual character can be determined according to the number of frames for blinking action and the first video frame, and finally the intermediate coefficient sequence is determined from the initial coefficient sequence according to the positions of the coefficients corresponding to the second video frame and the third video frame in the initial coefficient sequence. It should be noted that the number of the intermediate coefficient sequences can be one or more, and the embodiment of the present application does not make specific restrictions. When there are multiple intermediate coefficient sequences, the adjustment method of the coefficient values ​​of the coefficients in each intermediate coefficient sequence can be the same.

[0066] For example, assuming that the blinking time interval is 3 seconds, the frame rate is 25 frames / second, and the blinking action lasts for 6 frames, then according to the blinking time interval and the frame rate, it can be determined that the first video frame of the blinking action can be the 75th frame, the 150th frame, or the 225th frame, etc., and the second video frame and the third video frame of the first blinking action are respectively video frames around the 75th frame, and the second video frame differs from the third video frame by 6 frames. Similarly, the second video frame and the third video frame of the second blinking action are video frames around the 150th frame, and the second video frame differs from the third video frame by 6 frames; the second video frame and the third video frame of the third blinking action are video frames around the 225th frame, and the second video frame differs from the third video frame by 6 frames, etc. It should be noted that, within the number of frames of each blinking action, the number of frames between the first video frame and the second video frame may be equal to the number of frames between the first video frame and the third video frame, such as the second video frame of the first blinking action is the 72nd frame, and the third video frame of the first blinking action is the 78th frame; the number of frames between the first video frame and the second video frame may also not be equal to the number of frames between the first video frame and the third video frame, such as the second video frame of the first blinking action is the 73rd frame, and the third video frame of the first blinking action is the 79th frame, etc.

[0067] In this embodiment, the intermediate coefficient sequence can be accurately determined from the initial coefficient sequence based on the blinking time interval, frame rate and the number of frames of the blinking action, so as to facilitate the subsequent adjustment of the coefficient values ​​of the coefficients in the intermediate coefficient sequence to obtain the blinking coefficient sequence, thereby improving the accuracy of the blinking coefficient sequence.

[0068] Further, the number of frames between the first video frame and the second video frame is equal to the number of frames between the first video frame and the third video frame.

[0069] In one embodiment, within each blink action duration frame number, the number of frames between the first video frame and the second video frame is equal to the number of frames between the first video frame and the third video frame. Specifically, assuming that the blink time interval is freq, the frame rate is fps, and the blink action duration frame number is width, then the number of frames of the first video frame of the i-th blink action is center=freq*fps*i, the number of frames of the second video frame is left=center-width / 2, and the number of frames of the third video frame is right=center+width / 2, where i represents the i-th blink action, and i is a positive integer greater than or equal to 1. Continuing with the above example, assuming that the blinking time interval is 3 seconds, the frame rate is 25 frames / second, and the blinking action lasts for 6 frames, the first video frame of the first blinking action is the 75th frame, the second video frame is the 72nd frame, and the third video frame is the 78th frame; the first video frame of the second blinking action is the 150th frame, the second video frame is the 147th frame, and the third video frame is the 153rd frame; the first video frame of the third blinking action is the 225th frame, the second video frame is the 222nd frame, and the third video frame is the 228th frame; and so on, the intermediate coefficient sequences corresponding to multiple blinking actions can be obtained, such as Figure 2 By the above method, it can be ensured that the time length from the start of each blink to the maximum eye closure time is the same as the time length from the maximum eye closure time to the end of each blink, thereby making each blink of the virtual character more natural.

[0070] Furthermore, the preset parameters also include coefficient values ​​in the maximum eye-closing state;

[0071] The above step 103, adjusting the coefficient values ​​of the coefficients in the intermediate coefficient sequence according to the coefficient values ​​of the coefficients under the target eyelid state and the preset parameters to obtain the blink coefficient sequence, specifically includes:

[0072] Keep the coefficient values ​​of the coefficients corresponding to the second video frame and the third video frame as the coefficient values ​​of the coefficients in the target eyelid state, and adjust the coefficient value of the coefficient corresponding to the first video frame to the coefficient value in the maximum eye closure state;

[0073] According to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame and the adjusted coefficient value of the coefficient corresponding to the first video frame, interpolation calculation is performed on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence respectively to obtain an interpolation calculation result, wherein the intermediate coefficient sequence includes the first subsequence and the second subsequence, the first subsequence refers to a coefficient sequence with the coefficient corresponding to the second video frame and the coefficient corresponding to the first video frame as boundaries, and the second subsequence refers to a coefficient sequence with the coefficient corresponding to the first video frame and the coefficient corresponding to the third video frame as boundaries;

[0074] According to the interpolation calculation result, the coefficient values ​​of the coefficients in the first subsequence and the second subsequence are adjusted respectively to obtain a blink coefficient sequence.

[0075] In one embodiment, the preset parameters may also include coefficient values ​​in the maximum eye closure state, wherein the coefficient values ​​in the maximum eye closure state refer to the coefficient values ​​when the virtual character is in the maximum eye closure state when performing a blinking action. When adjusting the coefficient values ​​of the coefficients in the intermediate coefficient sequence, the coefficient values ​​of the coefficients corresponding to the second video frame and the coefficients corresponding to the third video frame may be maintained as the coefficient values ​​of the coefficients in the target eyelid state, and the coefficient values ​​of the coefficients corresponding to the first video frame may be adjusted to the coefficient values ​​in the maximum eye closure state. Then, interpolation calculations are performed on the coefficient values ​​of the coefficients in the first subsequence and the second subseries, respectively, to obtain interpolation calculation results. Finally, according to the interpolation calculation results, the coefficient values ​​of the coefficients in the first subsequence and the second subseries are adjusted, respectively, to obtain a blink coefficient sequence. Figure 2 Take the intermediate coefficient series shown as an example to illustrate, assuming that the coefficient value e0 of the coefficient in the target eyelid state is 0.5, and the coefficient value top in the maximum closed eye state is 0.95, then the coefficient values ​​of the coefficients corresponding to the second video frame and the third video frame are both 0.5, and the coefficient value of the coefficient corresponding to the first video frame is 0.95. At this time, the coefficient values ​​of each coefficient in the first subsequence and the second subsequence can be interpolated to obtain the adjusted coefficient values ​​of each coefficient in the first subsequence and the second subsequence, so as to obtain the blink coefficient sequence, such as Figure 3 As shown (the dotted line represents the coefficient value of the coefficient in the initial coefficient sequence, and the solid line represents the coefficient value of the coefficient in the blink coefficient sequence).

[0076] Through the above method, the eyelid state of the virtual character at the start and end of blinking can be in the target eyelid state, and a blinking action can be completed between the start and end of blinking, that is, the virtual character can retain the target eyelid state while performing the blinking action, thereby making the virtual character's blinking animation more vivid.

[0077] Furthermore, the above step, according to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame and the adjusted coefficient value of the coefficient corresponding to the first video frame, respectively performs interpolation calculation on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence to obtain the interpolation calculation result, specifically includes:

[0078] A first interpolation step length and a second interpolation step length are calculated according to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame, and the adjusted coefficient value of the coefficient corresponding to the first video frame, wherein the first interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the second video frame and the first video frame, and the second interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the first video frame and the third video frame;

[0079] An interpolation calculation is performed on the first subsequence according to a first interpolation step length, and an interpolation calculation is performed on the second subsequence according to a second interpolation step length to obtain an interpolation calculation result.

[0080] In one embodiment, when performing interpolation calculation on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence, the following interpolation algorithm may be used:

[0081] interpolate(result,start,end,e_start,e_end);

[0082] Among them, the parameter result represents the sequence to be interpolated, such as the first subsequence or the second subsequence; the parameter start represents the starting index of the sequence result; the parameter end represents the ending index of the sequence result; the parameter e_start represents the coefficient corresponding to the starting index; and the parameter e_end represents the coefficient corresponding to the ending index.

[0083] The above interpolation algorithm can be used to interpolate the values ​​in the interval from the start index start to the end index end in the sequence result. During the interpolation calculation process, the following formula can also be used to calculate the interpolation step length step of the sequence result:

[0084] step=(e_end–e_start) / (end–start);

[0085] Among them, the parameter start represents the starting index of the sequence result; the parameter end represents the ending index of the sequence result; the parameter e_start represents the coefficient corresponding to the starting index; and the parameter e_end represents the coefficient corresponding to the ending index.

[0086] In this way, each index index in the sequence result can be assigned result[index]=e_start+step*(index–start), so as to obtain the interpolation calculation results of the coefficient values ​​of each coefficient in the first subsequence and the second subsequence. In this way, the coefficient values ​​in the process from the start of the blink to the maximum eye closure time, and the coefficient values ​​in the process from the maximum eye closure time to the end of the blink can be obtained to realize the blinking action.

[0087] Furthermore, the preset parameters also include coefficient values ​​of the coefficients under the target eyelid state;

[0088] Before the above step 102, generating the initial coefficient sequence based on the preset parameters, the method further includes:

[0089] Obtain the total number of video frames corresponding to the original video animation associated with the virtual character;

[0090] The above step 102, generating an initial coefficient sequence based on preset parameters, includes:

[0091] The coefficient values ​​corresponding to the same number of coefficients as the total number of video frames are set as the coefficient values ​​of the coefficients under the target eyelid state, and an initial coefficient sequence is generated.

[0092] In one embodiment, the preset parameters may also include coefficient values ​​of coefficients in the target eyelid state, wherein the coefficient values ​​of the coefficients in the target eyelid state refer to the coefficient values ​​of the eyelid state corresponding to any emotion of the virtual character such as happiness, surprise, sadness, etc. When generating the initial coefficient sequence, it is necessary to first obtain the total number of video frames corresponding to the original video animation associated with the virtual character, and then set the coefficient values ​​corresponding to the same number of coefficients as the total number of video frames as the coefficient values ​​of the coefficients in the target eyelid state to generate the initial coefficient sequence. For example, assuming that the total number of video frames N obtained is 200, and the coefficient value of the coefficient in the target eyelid state is 0.5, then the generated initial coefficient sequence is a sequence with a value of 0.5 and a length of 200.

[0093] It should be noted that when obtaining the total number of video frames corresponding to the original video animation associated with the virtual character, an ARKit coefficient sequence corresponding to the original video animation associated with the virtual character input by the user can be received, and then the total number of coefficients can be obtained from the ARKit coefficient sequence, and then the total number of video frames can be obtained. Of course, other methods can also be used to obtain, which is not limited in the embodiments of the present application.

[0094] In this embodiment, an initial coefficient sequence can be generated based on the total number of video frames corresponding to the original video animation and the coefficient values ​​of the coefficients under the target eyelid state, so as to facilitate the subsequent acquisition of a blinking coefficient sequence based on the initial coefficient sequence and generate a blinking animation of the virtual character under the target eyelid state.

[0095] Furthermore, the target eyelid state is the eyelid state corresponding to the virtual character under any emotion.

[0096] It should be noted that the above-mentioned target eyelid state can be the eyelid state corresponding to the virtual character under any emotion, such as the eyelid state corresponding to the virtual character under any emotion such as happiness, surprise, sadness, etc. Before generating the virtual character's blinking animation, the target eyelid state of the virtual character can be determined according to the emotion that the virtual character wants to express, and then the coefficient value of the coefficient in the initial coefficient sequence can be determined. Based on the ARKit standard, the smaller the coefficient value, the less the virtual character's eyes are closed; the larger the coefficient value, the more the virtual character's eyes are closed. Figure 4 To Figure 8 As shown, the coefficient values ​​corresponding to the eyelid states of the virtual character are 0.00, 0.25, 0.5, 0.75 and 1.00 respectively.

[0097] In this way, the target eyelid state can be flexibly selected according to actual needs to accurately express the emotions that the virtual character wants to express.

[0098] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a virtual character blinking animation generating device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the device 900 includes:

[0099] A first acquisition module 901 is used to acquire preset parameters, wherein the preset parameters are relevant parameters required for the virtual character to perform a blinking action;

[0100] A determination module 902 is used to generate an initial coefficient sequence based on preset parameters, and determine an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action from the initial coefficient sequence, wherein the initial coefficient sequence is a sequence composed of coefficients under the target eyelid state, and the initial coefficient sequence includes at least one intermediate coefficient sequence;

[0101] An adjustment module 903 is used to adjust the coefficient values ​​of the coefficients in the intermediate coefficient sequence according to the coefficient values ​​of the coefficients in the target eyelid state and preset parameters to obtain a blink coefficient sequence, wherein the blink coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blink action while retaining the target eyelid state;

[0102] The generating module 904 is used to generate a blinking animation of the virtual character in a target eyelid state based on the blink coefficient sequence.

[0103] Furthermore, the preset parameters include blinking time interval, frame rate and number of frames of blinking action duration;

[0104] The determination module 902 includes:

[0105] A first determination submodule is used to determine, according to the blinking time interval and the frame rate, a first video frame corresponding to the maximum eye closing moment of the virtual character in the blinking action;

[0106] A second determining submodule is used to determine, according to the number of frames of the blinking action and the first video frame, a second video frame corresponding to the start time of the blinking of the virtual character and a third video frame corresponding to the end time of the blinking, wherein the first video frame is between the second video frame and the third video frame;

[0107] The third determination submodule is used to determine an intermediate coefficient sequence from the initial coefficient sequence according to the positions of the coefficients corresponding to the second video frame and the coefficients corresponding to the third video frame in the initial coefficient sequence.

[0108] Further, the number of frames between the first video frame and the second video frame is equal to the number of frames between the first video frame and the third video frame.

[0109] Furthermore, the preset parameters also include coefficient values ​​in the maximum eye-closing state;

[0110] The adjustment module 903 includes:

[0111] A first adjustment submodule, used to keep the coefficient values ​​of the coefficients corresponding to the second video frame and the coefficients corresponding to the third video frame as the coefficient values ​​of the coefficients in the target eyelid state, and adjust the coefficient value of the coefficient corresponding to the first video frame to the coefficient value in the maximum eye closure state;

[0112] An interpolation calculation submodule, used to perform interpolation calculation on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence respectively according to the coefficient values ​​of the coefficients corresponding to the second video frame, the coefficient values ​​of the coefficients corresponding to the third video frame and the adjusted coefficient values ​​of the coefficients corresponding to the first video frame, to obtain an interpolation calculation result, wherein the intermediate coefficient sequence includes the first subsequence and the second subsequence, the first subsequence refers to a coefficient sequence with the coefficients corresponding to the second video frame and the coefficients corresponding to the first video frame as boundaries, and the second subsequence refers to a coefficient sequence with the coefficients corresponding to the first video frame and the coefficients corresponding to the third video frame as boundaries;

[0113] The second adjustment submodule is used to adjust the coefficient values ​​of the coefficients in the first subsequence and the second subsequence respectively according to the interpolation calculation result to obtain a blink coefficient sequence.

[0114] Furthermore, the interpolation calculation submodule includes:

[0115] A first calculation unit is used to calculate a first interpolation step length and a second interpolation step length according to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame, and the adjusted coefficient value of the coefficient corresponding to the first video frame, wherein the first interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the second video frame and the first video frame, and the second interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the first video frame and the third video frame;

[0116] The second calculation unit is used to perform interpolation calculation on the first subsequence according to the first interpolation step length, and to perform interpolation calculation on the second subsequence according to the second interpolation step length to obtain an interpolation calculation result.

[0117] Furthermore, the preset parameters also include coefficient values ​​of the coefficients under the target eyelid state;

[0118] The device 900 further includes:

[0119] A second acquisition module is used to acquire the total number of video frames corresponding to the original video animation associated with the virtual character;

[0120] The determination module 902 is further used to set the coefficient values ​​corresponding to the same number of coefficients as the total number of video frames as the coefficient values ​​of the coefficients under the target eyelid state, so as to generate an initial coefficient sequence.

[0121] Furthermore, the target eyelid state is the eyelid state corresponding to the virtual character under any emotion.

[0122] It should be noted that the device 900 can implement the steps of the virtual character blinking animation generation method provided in any of the aforementioned method embodiments, and can achieve the same technical effects, which will not be described one by one here.

[0123] like Fig.10 As shown, the embodiment of the present application further provides an electronic device, including a processor 1011, a communication interface 1012, a memory 1013 and a communication bus 1014, wherein the processor 1011, the communication interface 1012, and the memory 1013 communicate with each other through the communication bus 1014.

[0124] Memory 1013, used for storing computer programs;

[0125] In one embodiment of the present application, the processor 1011 is used to execute the program stored in the memory 1013 to implement the method for generating a virtual character blinking animation provided by any of the aforementioned method embodiments, including:

[0126] Obtaining preset parameters, wherein the preset parameters are relevant parameters required for the virtual character to perform a blinking action;

[0127] Based on preset parameters, an initial coefficient sequence is generated, and an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action is determined from the initial coefficient sequence, wherein the initial coefficient sequence is a sequence composed of coefficients under the target eyelid state, and the initial coefficient sequence includes at least one intermediate coefficient sequence;

[0128] According to the coefficient values ​​of the coefficients in the target eyelid state and the preset parameters, the coefficient values ​​of the coefficients in the intermediate coefficient sequence are adjusted to obtain a blink coefficient sequence, wherein the blink coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blink action while retaining the target eyelid state;

[0129] Based on the blink coefficient sequence, the blink animation of the virtual character in the target eyelid state is generated.

[0130] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for generating a virtual character blinking animation as provided in any of the aforementioned method embodiments are implemented.

[0131] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0132] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for generating a virtual character blinking animation, characterized in that: The method comprises: Acquire preset parameters, wherein the preset parameters are relevant parameters required for the virtual character to perform a blinking action; Based on the preset parameters, an initial coefficient sequence is generated, and an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action is determined from the initial coefficient sequence, wherein the initial coefficient sequence is a sequence composed of coefficients under the target eyelid state, and the initial coefficient sequence includes at least one of the intermediate coefficient sequences; According to the coefficient value of the coefficient in the target eyelid state and the preset parameter, the coefficient value of the coefficient in the intermediate coefficient sequence is adjusted to obtain a blink coefficient sequence, wherein the blink coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blink action while retaining the target eyelid state; Based on the blink coefficient sequence, a blink animation of the virtual character in the target eyelid state is generated.

2. The method according to claim 1, characterized in that The preset parameters include blinking time interval, frame rate and the number of frames of blinking action; The step of determining, from the initial coefficient sequence, an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, comprises: Determine, according to the blinking time interval and the frame rate, a first video frame corresponding to the maximum eye closure moment of the virtual character in the blinking action; Determine, according to the number of frames of the blinking action and the first video frame, a second video frame corresponding to the start moment of the blinking of the virtual character and a third video frame corresponding to the end moment of the blinking, wherein the first video frame is between the second video frame and the third video frame; The intermediate coefficient sequence is determined from the initial coefficient sequence according to the positions of the coefficients corresponding to the second video frame and the coefficients corresponding to the third video frame in the initial coefficient sequence respectively.

3. The method according to claim 2, characterized in that The number of frames between the first video frame and the second video frame is equal to the number of frames between the first video frame and the third video frame.

4. The method according to claim 2, characterized in that: The preset parameters also include coefficient values ​​in the maximum eye-closing state; The step of adjusting the coefficient values ​​of the coefficients in the intermediate coefficient sequence according to the coefficient values ​​of the coefficients in the target eyelid state and the preset parameters to obtain a blink coefficient sequence includes: Keep the coefficient values ​​of the coefficients corresponding to the second video frame and the coefficient values ​​of the coefficients corresponding to the third video frame as the coefficient values ​​of the coefficients in the target eyelid state, and adjust the coefficient values ​​of the coefficients corresponding to the first video frame to the coefficient values ​​in the maximum eye closure state; According to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame and the adjusted coefficient value of the coefficient corresponding to the first video frame, interpolation calculation is performed on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence respectively to obtain an interpolation calculation result, wherein the intermediate coefficient sequence includes the first subsequence and the second subsequence, the first subsequence refers to a coefficient sequence with the coefficient corresponding to the second video frame and the coefficient corresponding to the first video frame as a boundary, and the second subsequence refers to a coefficient sequence with the coefficient corresponding to the first video frame and the coefficient corresponding to the third video frame as a boundary; According to the interpolation calculation result, the coefficient values ​​of the coefficients in the first subsequence and the second subsequence are adjusted respectively to obtain the blink coefficient sequence.

5. The method according to claim 4, characterized in that The interpolation calculation is performed on the coefficient values ​​of the coefficients in the first subsequence and the second subsequence respectively according to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame, and the adjusted coefficient value of the coefficient corresponding to the first video frame to obtain the interpolation calculation result, including: A first interpolation step length and a second interpolation step length are calculated according to the coefficient value of the coefficient corresponding to the second video frame, the coefficient value of the coefficient corresponding to the third video frame, and the adjusted coefficient value of the coefficient corresponding to the first video frame, wherein the first interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the second video frame and the first video frame, and the second interpolation step length is used to represent the coefficient value difference of the coefficient corresponding to any two adjacent video frames between the first video frame and the third video frame; Interpolation calculation is performed on the first subsequence according to the first interpolation step length, and interpolation calculation is performed on the second subsequence according to the second interpolation step length to obtain the interpolation calculation result.

6. The method according to claim 1, characterized in that The preset parameters also include the coefficient value of the coefficient under the target eyelid state; Before generating the initial coefficient sequence based on the preset parameters, the method further includes: Obtaining the total number of video frames corresponding to the original video animation associated with the virtual character; The generating an initial coefficient sequence based on the preset parameters comprises: The coefficient values ​​corresponding to the same number of coefficients as the total number of video frames are set as the coefficient values ​​of the coefficients under the target eyelid state, so as to generate the initial coefficient sequence.

7. The method according to claim 1, characterized in that The target eyelid state is the eyelid state corresponding to the virtual character under any emotion.

8. A virtual character blinking animation generating device, characterized in that: The device comprises: A first acquisition module, used to acquire preset parameters, wherein the preset parameters are relevant parameters required for the virtual character to perform a blinking action; A determination module, configured to generate an initial coefficient sequence based on the preset parameters, and determine from the initial coefficient sequence an intermediate coefficient sequence corresponding to the virtual character when performing a blinking action, wherein the initial coefficient sequence is a sequence composed of coefficients under a target eyelid state, and the initial coefficient sequence includes at least one of the intermediate coefficient sequences; An adjustment module, configured to adjust the coefficient values ​​of the coefficients in the intermediate coefficient sequence according to the coefficient values ​​of the coefficients in the target eyelid state and the preset parameters, to obtain a blink coefficient sequence, wherein the blink coefficient sequence is a coefficient sequence corresponding to the virtual character performing a blink action while retaining the target eyelid state; A generating module is used to generate a blinking animation of the virtual character in the target eyelid state based on the blink coefficient sequence.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the method for generating a virtual character blinking animation as described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a virtual character blinking animation according to any one of claims 1 to 7 are implemented.