Method, device and communication equipment for processing skeletal animation data
Through the combination of deep learning models and pre- and post-processing, the problem that traditional algorithms cannot guarantee the naturalness and authenticity of skeletal animation is solved, more natural and realistic joint movements are achieved, and calculation efficiency and visual effects are improved.
Patent Information
- Application Number
- CN202011618347.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-12-31
AI Technical Summary
Traditional geometric algorithms cannot guarantee the naturalness and authenticity of skeletal animation. In particular, human body dynamics constraints are ignored in the calculation of joint rotation matrices, resulting in joint movements that do not conform to human body dynamics.
Using a target neural network model based on deep learning, the unit direction vector of the human skeleton is input into the model to obtain the global rotation of the joints, and is corrected through pre-processing and post-processing to ensure that the virtual character's skeletal motion complies with human dynamics constraints.
It achieves more natural and realistic skeletal animation movements, reduces the solution space through the fitting capabilities of the deep learning model and preprocessed data, and improves computing efficiency and visual effects.
Smart Images

Figure CN112686976B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a method and device for processing skeletal animation data and communication equipment. Background Art
[0002] In the current field of animation technology, driving animation characters to imitate movements based on real-person postures is a research direction. One important step is to convert the 3D coordinates obtained from real-person joints into the rotation matrix of the corresponding joints, and then apply it to the animation characters to drive the model's limbs to move. The traditional geometric algorithm directly calculates the rotation matrix between vectors, but ignores the fact that each joint of the animation person should have certain human body dynamics constraints, and cannot guarantee its naturalness and authenticity. Some researchers have also tried to use kinematic methods to impose constraints on each joint, but it is cumbersome to manually set the constraints for each joint, and manual labeling cannot determine the most suitable constraints for each joint.
[0003] In other words, the existing technical methods for driving virtual human movements based on real human postures usually focus on extracting the 3D coordinates of real human joints, but use a relatively simple method of calculating the rotation matrix between vectors in the conversion of 3D to animated human joint rotation data. This can easily lead to the joints not conforming to human body dynamics. For example, when the right forearm is at a 90-degree angle to the right upper arm toward the outside of the body, the upper arm can remain stationary, but has a certain amount of rotation. The rotation of the upper arm cannot be calculated using the traditional vector rotation method.
[0004] An existing solution for satisfying the angle constraints of human joints is inverse kinematics. Based on the target position of the end joint, the rotation of the intermediate joint can be continuously adjusted, so that the end joint is closest to the target position. During the adjustment process, partial constraints can also be imposed on the intermediate joint to satisfy human body dynamics. However, the cumbersomeness of this type of technology lies in the fact that the imposed constraints must be statistically derived from the observation of a large amount of real data in order to cover as many solutions as possible. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method, device and communication equipment for processing skeletal animation data to solve the problem that traditional geometric algorithms cannot guarantee the naturalness and authenticity of each joint.
[0006] In order to solve the above problem, an embodiment of the present invention provides a method for processing skeletal animation data, comprising:
[0007] Inputting the unit direction vector of each bone of the human body into the target neural network model, and obtaining the first global rotation amount of each joint of the human body output by the target neural network model;
[0008] According to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body, position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character are obtained; wherein the three-dimensional coordinates of the root joint of the human body are extracted from the motion capture data;
[0009] The virtual character skeleton is driven to move according to the position information of the virtual character root joint and the second global rotation amount of each joint of the virtual character.
[0010] The step of driving the skeleton of the virtual character to move according to the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character includes:
[0011] Correcting the second global rotation amount by using the additional rotation amount corresponding to each joint;
[0012] The virtual character skeleton is driven to move according to the position information of the virtual character root joint and the corrected second global rotation amount.
[0013] Wherein, the target neural network model is obtained by the following method:
[0014] According to the motion capture data, a unit direction vector of each bone of the human body is obtained;
[0015] Perform deep learning training on the unit direction vectors of each bone of the human body to obtain the target neural network model
[0016] Among them, according to the motion capture data, the unit direction vector of each bone of the human body is obtained, including:
[0017] Aligning the real person skeleton and the virtual character skeleton extracted from the motion capture data;
[0018] Determine the global coordinates of each joint of the human body according to the three-dimensional coordinates of the root joint of the human body, the initial offset of each joint of the human body relative to the parent joint, and the local rotation of each joint of the human body;
[0019] According to the global coordinates of each joint, determine the unit vector of each bone in the human body;
[0020] The unit direction vector of the bone is corrected according to the rotation amount of the root joint of the human body to obtain the unit direction vector of each bone of the human body.
[0021] The unit direction vectors of the human bones are input into the target neural network model, and the first global rotation amount of each joint of the human body output by the target neural network model is obtained, including:
[0022] According to the local rotation of each joint of the human body and the joint chain from each joint of the human body to the root joint, the fourth global rotation of each joint of the human body is calculated;
[0023] The fourth global rotation amount of each joint of the human body is oriented and corrected according to the rotation amount of the root joint of the human body to obtain the first global rotation amount of each joint of the human body.
[0024] Wherein, according to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body, the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character are obtained, including:
[0025] Determine the position information of the root joint of the virtual character according to the three-dimensional coordinates of the root joint of the human body and the scaling factor; the scaling factor is the ratio coefficient of the bone length of the real person and the virtual character;
[0026] According to the global rotation of each joint of the human body and the rotation matrix of the root joint used in the preprocessing process, the second global rotation of each joint of the virtual character is determined.
[0027] Wherein, if the joint is an elbow joint, the method further comprises:
[0028] A second global rotation of the elbow joint is determined according to the global rotation of the elbow joint, the rotation of the root joint used in the preprocessing process, and the rotation used to correct the elbow joint rotation.
[0029] The embodiment of the present invention further provides a device for processing skeletal animation data, comprising:
[0030] A first determination module is used to obtain a unit direction vector of each bone of the human body according to the motion capture data;
[0031] A first acquisition module is used to input the unit direction vector of each bone of the human body into the target neural network model to obtain the first global rotation amount of each joint of the human body output by the target neural network model;
[0032] A second determination module is used to obtain the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body; wherein the three-dimensional coordinates of the root joint of the human body are extracted from the motion capture data;
[0033] The driving module is used to drive the skeleton movement of the virtual character according to the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character.
[0034] An embodiment of the present invention further provides a communication device, comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for processing skeletal animation data when executing the program.
[0035] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps in the method for processing skeletal animation data as described above are implemented.
[0036] The above technical solution of the present invention has at least the following beneficial effects:
[0037] In the processing method, device and communication equipment of skeletal animation data of the embodiments of the present invention, a target neural network model determined based on deep learning is used to realize the mapping of the three-dimensional coordinates of the human skeleton to the global rotation amount. At the same time, in order to make deep learning more efficient, the solution space is narrowed by preprocessing; and the problem of unstable deep learning prediction results is further corrected by post-processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic flow chart showing the steps of a method for processing skeletal animation data provided by an embodiment of the present invention;
[0039] Figure 2 A network schematic diagram showing a target neural network model in a method for processing skeletal animation data provided by an embodiment of the present invention;
[0040] Figure 3 A schematic diagram showing the structure of a device for processing skeletal animation data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0042] Skeletal animation is a kind of motion data with a highly complex structure, and its authenticity usually directly affects the visual effects of digital humans in videos or games. Usually, each joint in the skeleton has different rotational degrees of freedom, and there are different angle constraints between the degrees of freedom. There is also a hinge structure between adjacent bones. Changes in the root joint usually cause the existing state of all sub-joints. Therefore, traditional algorithms usually use an iterative method to repeatedly adjust the rotation of each joint in the constraint space, so that each joint reaches the target position and produces better visual effects. However, different algorithms have different time consumption and effectiveness, which leads to the need to weigh the cost balance that different solutions can bring in different application scenarios.
[0043] At least one embodiment of the present invention constructs a method for calculating the global rotation amount of the three-dimensional coordinates of each joint of the human body more quickly and with better visual effects. It is mainly based on the powerful fitting ability of the deep learning model and the mapping relationship between the three-dimensional coordinates and the global rotation amount in the motion capture data. It uses deep learning to extract the data distribution and uses appropriate parameter operations to approximate the mapping function with complex constraints between the global rotation amount and the three-dimensional coordinate position.
[0044] like Figure 1 As shown, an embodiment of the present invention provides a method for processing skeletal animation data, comprising:
[0045] Step 101, obtaining the unit direction vector of each bone of the human body according to the motion capture data;
[0046] Step 102, inputting the unit direction vector of each bone of the human body into the target neural network model, and obtaining the first global rotation amount of each joint of the human body output by the target neural network model;
[0047] Step 103, obtaining the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body; wherein the three-dimensional coordinates of the root joint of the human body are extracted from the motion capture data;
[0048] Step 104 , driving the skeleton of the virtual character to move according to the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character.
[0049] Among them, step 101 can be called "preprocessing", step 102 can be called "neural network model inference", step 103 can be called "anti-preprocessing", and step 104 can be called "driving".
[0050] In other words, before extracting the three-dimensional coordinates from the real person's key points and predicting the first global rotation amount through the target neural network model, preprocessing is required, and the preprocessed data is input into the target neural network model, and the target neural network model infers the corresponding first global rotation amount, and then enters the reverse preprocessing.
[0051] As an optional embodiment, step 104 includes:
[0052] The second global rotation is corrected using the additional rotation corresponding to each joint; this step may be referred to as "post-processing";
[0053] The virtual character skeleton is driven to move according to the position information of the virtual character root joint and the corrected second global rotation amount.
[0054] Post-processing is to further correct the human posture and make it closer to the human posture represented by three-dimensional coordinates. Usually, the neural network model can only preliminarily generate joint rotations that are close to the human posture and meet the human kinematic constraints, and cannot accurately make the posture generated by the rotation exactly the same as the three-dimensional coordinate posture. There are two reasons:
[0055] First, the preprocessing stage only minimizes the diversity of data, and cannot make a certain posture have only one corresponding solution. For example, the change in rotation caused by the rotation of the joint does not cause the change of the joint coordinates. For example, when the forearm rotates, the position of the wrist does not change, but the local rotation of the elbow joint changes. To address this type of problem, this technology uses the normal vector of the plane composed of the upper arm and forearm as the palm direction, and uses the rotation of the elbow joint to stabilize the palm in the direction of this normal vector; accordingly, the feet do not need to be specially processed because the rotation range of the soles of the feet is relatively limited and is usually not as flexible as the palms. The palm orientation can be stabilized by multiplying the elbow joint rotation used for this correction by the global elbow joint rotation predicted by the neural network.
[0056] Second, deep learning has a common problem of instability. Even the most accurate model may produce deviations. In the field of skeletal animation, it is usually manifested as a certain deviation between the bone direction calculated by the rotation data and the bone direction of the original input data. However, this deviation will not be too large, so a simple rotation can be used for correction. The correction process is to calculate the bone direction vectors calculated by the rotation data and the bone direction vectors extracted from the original input three-dimensional coordinates, and use the normal vector of the plane composed of the two data corresponding to the bone direction vectors as the rotation axis, and correct the former to the same direction as the latter. Then, the joint rotation used for this correction is left-multiplied by the joint rotation after the first step of post-processing correction.
[0057] Therefore, in the embodiment of the present invention, the second global rotation is further corrected by post-processing. For example, the additional rotation used by each joint for post-processing correction is R3, and the corrected second global rotation of each joint used to drive the virtual character's skeletal animation is:
[0058]
[0059] Finally, in the engine (such as Ogre, Unity, etc.), load the virtual character skeleton and use the root joint coordinates calculated above and the global rotation Just assign it to each joint, and the local rotation amount of the virtual human joints that have no corresponding joints with real human joints can remain the built-in local rotation amount.
[0060] The speed of the neural network model inference stage is greatly affected by the model parameters, the width of each layer of neurons and the depth of the entire network structure. The more model parameters, the more complex the structure, and the more complex problems that can be solved. In order to meet the requirements of fast reasoning, an embodiment of the present invention proposes a data preprocessing method to align each frame of skeleton data, so that the distribution range of the three-dimensional coordinates and the global rotation amount (also referred to as Euler angle data) in the training set can be reduced as much as possible, so as to achieve the purpose of reducing the solution space, and then make it possible to fit the mapping between the two with a small parameter model. Correspondingly, the target neural network model is obtained by the following method:
[0061] According to the motion capture data, a unit direction vector of each bone of the human body is obtained;
[0062] The unit direction vectors of each bone of the human body are subjected to deep learning training to obtain the target neural network model.
[0063] The preprocessing process in the embodiment of the present invention can eliminate the problem that different postures have the same solution due to the difference in the absolute position and orientation of the skeleton, thereby reducing the possible solution space, and then a small model can be used to fit this data set (i.e., the motion capture data set). For example, the embodiment of the present invention uses a simple four-layer fully connected neural network to automatically learn various human body dynamic constraints in the conversion relationship from 3D key points of skeleton animation to global rotation. One example network structure is as follows Figure 2 As shown:
[0064] The input of the target neural network model is the unit direction vector of each bone after preprocessing. After bone alignment, it usually has 11 to 20 bones, that is, the number of neurons is between 33 and 60; the number of neurons in the first hidden layer and the second hidden layer is usually defined as 100 to 150; the output layer includes the Euler angle data (also called global rotation data) used to drive the skeleton animation. Depending on the number of bones, the number of neurons can be determined to be between 36 and 63. Since the preprocessing minimizes the parameter space corresponding to the input and output to a certain range, it is feasible to use such a shallow neural network to fit the mapping relationship. At the same time, the shallow neural network also ensures that the time consumption is low when the corresponding rotation information is inferred from the three-dimensional coordinates during the model use stage, and supports real-time solution.
[0065] As an optional embodiment, the unit direction vector of each bone of the human body is obtained according to the motion capture data, including:
[0066] Aligning the real person skeleton and the virtual character skeleton extracted from the motion capture data;
[0067] Determine the global coordinates of each joint of the human body according to the three-dimensional coordinates of the root joint of the human body, the initial offset of each joint of the human body relative to the parent joint, and the local rotation of each joint of the human body;
[0068] According to the global coordinates of each joint, determine the unit vector of each bone in the human body;
[0069] The unit direction vector of the bone is corrected according to the rotation amount of the root joint of the human body to obtain the unit direction vector of each bone of the human body.
[0070] In the embodiment of the present invention, the skeletons included are divided into real skeletons whose 3D coordinates of real joints are predicted from real pictures, and skeletons of virtual character models; real skeletons are usually much more complex than virtual character skeletons, and the two types of skeletons must be aligned when doing data processing, because the goal is to convert the 3D coordinates of real skeletons into the rotation amounts of each joint of the virtual character skeleton, and the motion capture data set is usually based on the virtual character skeleton as a reference model, and then drives its action. In the alignment process, considering the chain structure of the skeleton, when streamlining the skeleton of the animation model, the local rotation amounts of the redundant skeletons can be accumulated into the local rotation amounts of its direct child joints. For example, the three joints a, b, and c are in a chain-like parent-child relationship, and their rotation amounts are r1, r2, and r3 respectively. A is the parent joint of b, and b is the parent joint of c. If you want to eliminate the a joint, you only need to set the rotation amount of the b joint to r1·r2, and the c joint rotation amount remains unchanged.
[0071] For example, starting from the root joint, using the predefined bone structure of different motion capture devices, the parent-child relationship between joints, and the initial offset of each joint relative to the parent joint O = (o1, o2, ... o n ), based on the local rotation matrix M of each joint of the human body collected in each action frame = (m1, m2, ..., m n ), calculate the global coordinates of each joint P = (p1, p2, ..., p n ). Assuming that the path from the i-th joint to the root joint of the skeleton passes through the (i, i′, i″, 1) joints in sequence, the calculation method of the global coordinates of the i-th joint is: i =m1m i″ m i′ m i o i .
[0072] In order to eliminate the diversity caused by the same posture in different positions in the world coordinate system, the absolute coordinates of the joints at both ends of the bone can be used to calculate the direction vector of the bone in the world coordinate system, which can eliminate the influence of different absolute positions of the same posture in the world coordinate system. At the same time, considering that different motion capture data may come from different motion capture actors, their bone lengths will have certain differences, so the bone direction vector can be normalized, and the unit vector of each bone direction is recorded as V = (v1, v2, ..., v n-1 ), if the joint indexes connecting the two ends of the i-th bone are i' and i", then the unit vector of the i-th bone is:
[0073]
[0074] In addition, when the frame animation of the same posture is in the same position but in different directions, it will also cause the problem of having the same local rotation data of the joints in different postures and orientations, resulting in a certain ambiguity in the data. To solve this problem, the direction of the unit direction vector of the bone can be corrected by using the direction of the root joint. Suppose the rotation of the root joint in the current frame is the rotation matrix M root , then the unit direction vector of each bone of the human body (i.e. the input data of the target neural network model) is:
[0075]
[0076] Accordingly, in at least one embodiment of the present invention, step 102 includes:
[0077] According to the local rotation of each joint of the human body and the joint chain from each joint of the human body to the root joint, the fourth global rotation of each joint of the human body is calculated;
[0078] The fourth global rotation amount of each joint of the human body is oriented and corrected according to the rotation amount of the root joint of the human body to obtain the first global rotation amount of each joint of the human body.
[0079] In an embodiment of the present invention, when the direction vectors of the bones in the world coordinate system are different, they may have the same local rotation amount. For example, in two different postures, but the angle between the upper arm and the forearm is fixed, then the local rotation data of the elbow joint is likely to be the same. Therefore, in order to eliminate this difference, the target output of the target neural network model adopts the world coordinate system. Since the influence of the position and direction of the root joint is eliminated when calculating the input, after the global rotation information of each joint in the world coordinate system is calculated using the skeletal chain structure, the global rotation information of each joint is corrected again using the rotation amount of the root joint. Specifically: According to the local coordinates of each joint and the joint chain to the root joint, the fourth global rotation amount of each joint can be calculated r = (r1.r2, ..., r n ), if the joints traversed from the i-th joint to the root joint are J = (j1, j2, ..., ji ),but
[0080]
[0081] The re-corrected global rotation information, that is, the first global rotation of each joint of the human body output by the model is:
[0082] o=M root ·r
[0083] In the embodiment of the present invention, the problem of having the same solution in different postures due to the differences in the absolute positions and orientations of the skeleton is eliminated during data preprocessing, thereby narrowing the possible solution space, and a small model can be used to fit the motion capture data set.
[0084] As an optional embodiment, step 103 includes:
[0085] Determine the position information of the root joint of the virtual character according to the three-dimensional coordinates of the root joint of the human body and the scaling factor; the scaling factor is the ratio coefficient of the bone length of the real person and the virtual character;
[0086] According to the global rotation of each joint of the human body and the rotation matrix of the root joint used in the preprocessing process, the second global rotation of each joint of the virtual character is determined.
[0087] Wherein, if the joint is an elbow joint, the method further comprises:
[0088] A second global rotation of the elbow joint is determined according to the global rotation of the elbow joint, the rotation of the root joint used in the preprocessing process, and the rotation used to correct the elbow joint rotation.
[0089] Inverse preprocessing is the reverse process of preprocessing, which is to restore the human body orientation and position changes of the original input skeleton. For position changes, it is only necessary to multiply the inverse of the rotation used to correct the skeleton to the front in the preprocessing stage by the global rotation of the root joint of the predicted result. For position changes, it is considered that the 3D key points come from the real scene, while the animation skeleton comes from the virtual scene. The scales are different, which may cause different displacements caused by the same action in the two scenes. Therefore, it is only necessary to calculate the corresponding scaling factor based on the length of the bone (such as the left leg) and limit the offset of the root joint to minimize the sliding phenomenon of the virtual human movement caused by different scales.
[0090] For example, let the three-dimensional coordinate of the root joint of the human body be d, the scaling factor of the bone length between the real person and the virtual person be ratio, and the first global rotation of each joint inferred by the neural network model is B = (b1, b2, ..., b n), the rotation amount used to correct the real person's position to the front in the preprocessing stage is R1, and the rotation amount used to correct the elbow joint rotation is R2, then:
[0091] The corresponding virtual character root joint position is:
[0092]
[0093] The second global rotation of each joint of the virtual character is:
[0094]
[0095] For the elbow joint, after correcting the rotation, its second global rotation is:
[0096]
[0097] In summary, the embodiments of the present invention take into account the powerful feature extraction and fitting capabilities of deep learning, as well as the fact that there are a lot of reusable high-quality motion capture data in the current era of big data, so that the neural network can automatically learn the solution space from three-dimensional coordinates to global rotation quantities that satisfies human kinematic constraints, thereby achieving the effect of simplifying the complex. At the same time, in order to make deep learning more effective, the solution space is also reduced by preprocessing; and the problem of unstable prediction results of deep learning is further corrected by post-processing.
[0098] like Figure 3 As shown, an embodiment of the present invention further provides a device for processing skeletal animation data, comprising:
[0099] A first determination module 301 is used to obtain a unit direction vector of each bone of the human body according to the motion capture data;
[0100] A first acquisition module 302 is used to input the unit direction vector of each bone of the human body into the target neural network model to obtain the first global rotation amount of each joint of the human body output by the target neural network model;
[0101] The second determination module 303 is used to obtain the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body; wherein the three-dimensional coordinates of the root joint of the human body are extracted from the motion capture data;
[0102] The driving module 304 is used to drive the skeleton of the virtual character to move according to the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character.
[0103] As an optional embodiment, the driving module 304 includes:
[0104] A correction submodule, used for correcting the second global rotation amount by using the additional rotation amount corresponding to each joint;
[0105] The driving submodule is used to drive the skeleton movement of the virtual character according to the position information of the root joint of the virtual character and the corrected second global rotation amount.
[0106] As an optional embodiment, the device further includes:
[0107] A training preprocessing module, used for obtaining the unit direction vector of each bone of the human body according to the motion capture data;
[0108] The model training module is used to perform deep learning training on the unit direction vectors of each bone of the human body to obtain the target neural network model.
[0109] As an optional embodiment, the first determining module includes:
[0110] A skeleton alignment submodule, used for aligning the skeleton of a real person and the skeleton of a virtual character extracted from the motion capture data;
[0111] The first submodule is used to determine the global coordinates of each joint of the human body according to the three-dimensional coordinates of the root joint of the human body, the initial offset of each joint of the human body relative to the parent joint, and the local rotation of each joint of the human body;
[0112] The second submodule is used to determine the unit vector of each bone of the human body according to the global coordinates of each joint;
[0113] The third submodule is used to correct the direction of the unit direction vector of the bone according to the rotation amount of the root joint of the human body, so as to obtain the unit direction vector of each bone of the human body.
[0114] As an optional embodiment, the first acquisition module includes:
[0115] The fourth submodule is used to calculate the fourth global rotation of each joint of the human body according to the local rotation of each joint of the human body and the joint chain from each joint of the human body to the root joint;
[0116] The fifth submodule is used to perform orientation correction on the fourth global rotation amount of each joint of the human body according to the rotation amount of the root joint of the human body, so as to obtain the first global rotation amount of each joint of the human body.
[0117] As an optional embodiment, the second determining module includes:
[0118] The sixth submodule is used to determine the position information of the root joint of the virtual character according to the three-dimensional coordinates of the root joint of the human body and the scaling factor; the scaling factor is the ratio coefficient of the bone length of the real person and the virtual character;
[0119] The seventh submodule is used to determine the second global rotation amount of each joint of the virtual character according to the global rotation amount of each joint of the human body and the rotation matrix of the root joint used in the preprocessing process.
[0120] As an optional embodiment, if the joint is an elbow joint, the device further comprises:
[0121] The eighth submodule is used to determine the second global rotation of the elbow joint according to the global rotation of the elbow joint, the rotation of the root joint used in the preprocessing process, and the rotation used to correct the elbow joint rotation.
[0122] The embodiment of the present invention takes into account the powerful feature extraction and fitting capabilities of deep learning, as well as the fact that there are a lot of reusable high-quality motion capture data in the current era of big data, and allows the neural network to automatically learn the solution space from three-dimensional coordinates to global rotation quantities that satisfies human kinematic constraints, thereby achieving the effect of simplifying the complex. At the same time, in order to make deep learning more effective, the solution space is also reduced by preprocessing; and the problem of unstable prediction results of deep learning is further corrected by post-processing.
[0123] It should be noted that the skeletal animation data processing device provided in the embodiment of the present invention is a device capable of executing the above-mentioned skeletal animation data processing method. All embodiments of the above-mentioned skeletal animation data processing method are applicable to the device and can achieve the same or similar beneficial effects.
[0124] An embodiment of the present invention further provides a communication device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, each process in the embodiment of the method for processing skeletal animation data as described above is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0125] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned process is realized. The various processes in the embodiment of the method for processing skeletal animation data can achieve the same technical effect, and are not repeated here to avoid repetition. Among them, the computer-readable storage medium is such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0126] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0127] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A device that specifies functions in one or more processes and / or one or more blocks.
[0128] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable storage medium produce a paper product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0129] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that the computer or other programmable device executes a series of operating steps to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0130] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing skeletal animation data, characterized in that: include: According to the motion capture data, the unit direction vector of each bone of the human body is obtained; Inputting the unit direction vector of each bone of the human body into the target neural network model, and obtaining the first global rotation amount of each joint of the human body output by the target neural network model; According to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body, position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character are obtained; wherein the three-dimensional coordinates of the root joint of the human body are extracted from the motion capture data; Driving the skeleton of the virtual character to move according to the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character; Among them, according to the motion capture data, the unit direction vector of each bone of the human body is obtained, including: Aligning the real person skeleton and the virtual character skeleton extracted from the motion capture data; Determine the global coordinates of each joint of the human body according to the three-dimensional coordinates of the root joint of the human body, the initial offset of each joint of the human body relative to the parent joint, and the local rotation of each joint of the human body; According to the global coordinates of each joint, determine the unit vector of each bone in the human body; The unit direction vector of the bone is corrected according to the rotation amount of the root joint of the human body to obtain the unit direction vector of each bone of the human body; According to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body, the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character are obtained, including: Determine the position information of the root joint of the virtual character according to the three-dimensional coordinates of the root joint of the human body and the scaling factor; the scaling factor is the ratio coefficient of the bone length of the real person and the virtual character; Determining a second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the rotation amount of the root joint of the human body; Wherein, determining the second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the rotation amount of the root joint of the human body includes: The second global rotation amount of each joint of the virtual character is determined as: the first global rotation amount of each joint of the human body multiplied by the inverse of the rotation amount of the human body root joint.
2. The method according to claim 1, characterized in that: The step of driving the virtual character skeleton to move according to the position information of the virtual character root joint and the second global rotation amount of each joint of the virtual character comprises: Correcting the second global rotation amount by using the additional rotation amount corresponding to each joint; The virtual character skeleton is driven to move according to the position information of the virtual character root joint and the corrected second global rotation amount.
3. The method according to claim 1, characterized in that: The target neural network model is obtained by the following method: According to the motion capture data, a unit direction vector of each bone of the human body is obtained; The unit direction vectors of each bone of the human body are subjected to deep learning training to obtain the target neural network model.
4. The method according to claim 1, characterized in that: Inputting the unit direction vector of each bone of the human body into the target neural network model, and obtaining the first global rotation amount of each joint of the human body output by the target neural network model, including: According to the local rotation of each joint of the human body and the joint chain from each joint of the human body to the root joint, the fourth global rotation of each joint of the human body is calculated; The fourth global rotation amount of each joint of the human body is oriented and corrected according to the rotation amount of the root joint of the human body to obtain the first global rotation amount of each joint of the human body.
5. The method according to claim 1, characterized in that If the joint is an elbow joint, the method further comprises: Determine a second global rotation amount of the elbow joint according to the first global rotation amount of the elbow joint, the rotation amount of the human body root joint and the rotation amount of the corrected elbow joint rotation; Wherein, determining the second global rotation amount of the elbow joint according to the first global rotation amount of the elbow joint, the rotation amount of the human body root joint and the rotation amount of the corrected elbow joint rotation comprises: The second global rotation of the elbow joint is determined as follows: the first global rotation of the elbow joint is dot-wise multiplied by the rotation of the human body root joint and dot-wise multiplied by the rotation of the corrected elbow joint rotation.
6. A skeletal animation data processing device, characterized in that: include: A first determination module is used to obtain a unit direction vector of each bone of the human body according to the motion capture data; A first acquisition module is used to input the unit direction vector of each bone of the human body into the target neural network model to obtain the first global rotation amount of each joint of the human body output by the target neural network model; A second determination module is used to obtain the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the three-dimensional coordinates of the root joint of the human body; wherein the three-dimensional coordinates of the root joint of the human body are extracted from the motion capture data; A driving module, used for driving the skeleton movement of the virtual character according to the position information of the root joint of the virtual character and the second global rotation amount of each joint of the virtual character; Wherein, the first determining module includes: A skeleton alignment submodule, used for aligning the skeleton of a real person and the skeleton of a virtual character extracted from the motion capture data; The first submodule is used to determine the global coordinates of each joint of the human body according to the three-dimensional coordinates of the root joint of the human body, the initial offset of each joint of the human body relative to the parent joint, and the local rotation of each joint of the human body; The second submodule is used to determine the unit vector of each bone of the human body according to the global coordinates of each joint; The third submodule is used to correct the direction of the unit direction vector of the bone according to the rotation amount of the root joint of the human body, so as to obtain the unit direction vector of each bone of the human body; The second determining module comprises: The sixth submodule is used to determine the position information of the root joint of the virtual character according to the three-dimensional coordinates of the root joint of the human body and the scaling factor; the scaling factor is the ratio coefficient of the bone length of the real person and the virtual character; A seventh submodule is used to determine a second global rotation amount of each joint of the virtual character according to the first global rotation amount of each joint of the human body and the rotation amount of the root joint of the human body; The seventh submodule is further used to determine the second global rotation of each joint of the virtual character as: the first global rotation of each joint of the human body multiplied by the inverse of the rotation of the human body root joint.
7. A communication device, comprising a memory, a processor, and a program stored in the memory and executable on the processor; characterized in that: When the processor executes the program, the method for processing skeletal animation data according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method for processing skeletal animation data as claimed in any one of claims 1 to 5 are implemented.
