A virtual human posture correction method, device, equipment and storage medium
By extracting key point information in the human body image, using the template model and posture model to adjust the virtual human model, and combining the convolutional neural network and the visual converter, the existing technology solves the problems of long time consumption and poor accuracy in human posture capture, and achieves It achieves real-time, precise capture and vivid driving effects of upper body movements.
Patent Information
- Application Number
- CN202411026269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Existing technologies include time-consuming optimization methods and neural network methods with poor prediction accuracy in human posture capture. They also lack designs for the upper body and cannot accurately capture the details of human body movements in real time.
By obtaining the character's body image, extracting key point position information, using the template model and posture model to adjust the posture, combined with the convolutional neural network and visual converter training, the key point heat map and posture parameters are generated, and the posture deviation data is calculated to correct the virtual human model to achieve accurate capture of upper body movements.
It achieves real-time and accurate capture of human upper body movements, vivid and reasonable driving effects, and effectively retains the details of hand interaction in the original movements.
Smart Images

Figure CN118570432B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision, and in particular to a method, device, equipment and storage medium for correcting a virtual human posture. Background Art
[0002] Human motion capture and digital human driving technology are important research directions in the field of computer vision and graphics, and have been widely used in the animation, film and television, and game industries. Traditional methods rely on expensive hardware equipment, such as optical motion capture devices based on multiple cameras and wearable inertial measurement unit (IMU) devices. In recent years, methods based only on monocular color mode (RGB color mode, RGB) video have greatly reduced the cost of using this technology. The current mainstream methods can be divided into: (1) Optimization-based methods This type of method is based on a pre-built parametric body model, generally based on the image's planar graphic (2D) clues (such as 2D key points, masks, etc.), and through iterative optimization, the body model is made consistent with the 2D clues. Since the detector at the 2D image level is relatively mature, the optimized results are usually highly consistent with the image. However, this type of method is generally time-consuming and cannot be applied to real-time applications. (2) Neural network regression-based methods This type of method relies on large-scale, high-quality data sets, and uses neural network modeling to model the mapping relationship between the image and the three-dimensional (3D) representation of the human body, and directly regresses the 3D posture of the human body from the image. Such methods usually do not have time-consuming iterative optimization steps, and the single inference time is in milliseconds, which can support real-time applications. However, their prediction accuracy and the degree of consistency between the model posture and the image are relatively poor. At the same time, existing methods generally focus on the posture estimation and driving of the whole body, and lack targeted design for the upper body. Summary of the invention
[0003] The present disclosure provides a virtual human posture correction method, device, equipment and storage medium to at least solve the above technical problems existing in the prior art.
[0004] According to a first aspect of the present disclosure, a method for correcting a virtual human posture is provided, comprising:
[0005] Acquire a body image of a person, and extract at least one key point position information of the person based on the body image;
[0006] Selecting a first key point of a first part and a second key point of a second part in the at least one key point position information as key anchor points, unifying at least one key point position corresponding to the position information into a template model based on the key anchor points, and calculating state information of the at least one key point position based on an analytical solver;
[0007] Positioning key points of a three-dimensional virtual human model, and adjusting the posture of the three-dimensional virtual human model based on the positioning and the state information to obtain a first virtual human posture model;
[0008] The posture deviation data of the virtual human posture model is calculated based on the first virtual human posture model and the at least one key point position information, and the virtual human posture model is adjusted based on the posture deviation data.
[0009] In one possible implementation, before obtaining a body image of a person and extracting at least one key point position information of the person based on the body image, the method further includes:
[0010] Acquire a motion capture data set, wherein the motion capture data set is divided into image data and posture data;
[0011] Cutting and filtering the image data based on the posture data and the three-dimensional virtual human model to obtain training sample data;
[0012] Based on the training sample data and the convolutional neural network, a first posture model is obtained by training, and based on the training sample data and the visual converter, a second posture model is obtained by training.
[0013] In one possible implementation, extracting at least one key point position information of the person based on the body image includes:
[0014] inputting the body image into the first posture model and the second posture model respectively;
[0015] Generate a key point heat map based on the first posture model, and acquire three-dimensional key point position information and two-dimensional key point position information based on the key point heat map;
[0016] Output second posture model parameters based on the second posture model, and acquire three-dimensional key point position information of the first part, three-dimensional key point position information of the second part, two-dimensional key point position information of the first part, and two-dimensional key point position information of the second part by using forward kinematics and camera projection based on the second posture model parameters;
[0017] The three-dimensional key point position information, the two-dimensional key point position information, the three-dimensional key point position information of the first part, the three-dimensional key point position information of the second part, the two-dimensional key point position information of the first part and the two-dimensional key point position information of the second part are combined into the at least one key point position information.
[0018] In one embodiment, the method further comprises:
[0019] Annotating the body image based on the at least one key point position information to obtain a posture-corrected image containing two-dimensional feature key points;
[0020] Projecting the position of at least one key point in the template model onto the posture-corrected image to obtain a three-dimensional feature key point;
[0021] The three-dimensional feature key point is aligned with the two-dimensional feature key point, and the aligned position information is saved in the at least one key point position information.
[0022] In one possible implementation, calculating the posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information includes:
[0023] Based on the at least one key point position information, acquiring three-dimensional coordinate information corresponding to all key points in the first part and the second part, including anchor point coordinate information corresponding to the key anchor point;
[0024] Calculate model size information and image size information of the first part and the second part respectively based on the three-dimensional virtual human model and the body image;
[0025] Calculate vector data corresponding to all key points between the first part and the second part based on the three-dimensional coordinate information corresponding to all key points, the anchor point coordinate information, the model size information and the image size information;
[0026] Acquire template coordinate information of the first part and the second part in the template model based on the three-dimensional coordinate information, and calculate a normalized matrix of key points of the first part and the second part of the template model based on the template coordinate information and the image size information;
[0027] A weight matrix is calculated based on the normalization matrix and the scaling coefficient, and posture deviation data of the virtual human posture model is calculated based on the weight matrix and the vector data.
[0028] In one possible implementation, adjusting the virtual human posture model based on the posture deviation data includes:
[0029] Correcting the relative position of the first part and the second part in the virtual human posture model based on the posture deviation data;
[0030] The relative position is fixed, posture information of the remaining parts in the virtual human posture model is calculated based on the state information, and the virtual human posture model is adjusted based on the posture information.
[0031] According to a second aspect of the present disclosure, there is provided a virtual human posture correction device, comprising:
[0032] A detection and positioning unit, used to obtain a body image of a person, and extract at least one key point position information of the person based on the body image;
[0033] a posture processing unit, configured to select a first key point of a first part and a second key point of a second part in the at least one key point position information as key anchor points, unify the at least one key point position into a template model based on the key anchor points, and calculate state information of the at least one key point position based on an analytical solver;
[0034] an action orientation unit, configured to locate key points of a three-dimensional virtual human model, and adjust the posture of the three-dimensional virtual human model based on the location and the state information to obtain a first virtual human posture model;
[0035] A posture correction unit is used to calculate the posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information, and adjust the virtual human posture model based on the posture deviation data.
[0036] In one embodiment, the device further comprises:
[0037] The model training unit is used to obtain a motion capture data set, wherein the motion capture data set is divided into image data and posture data; based on the posture data and the three-dimensional virtual human model, the image data is cut and screened to obtain training sample data; based on the training sample data and a convolutional neural network, a first posture model is trained, and based on the training sample data and a visual converter, a second posture model is trained;
[0038] A position alignment unit is used to annotate the body image based on the at least one key point position information to obtain a posture-corrected image containing two-dimensional feature key points; project the at least one key point position in the template model into the posture-corrected image to obtain three-dimensional feature key points; align the three-dimensional feature key points with the two-dimensional feature key points, and save the aligned alignment position information into the at least one key point position information.
[0039] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0040] at least one processor; and
[0041] a memory communicatively connected to the at least one processor; wherein,
[0042] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the present disclosure.
[0043] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the present disclosure.
[0044] The disclosed virtual human posture correction method, device, equipment and storage medium collect human body images, use motion capture data in a database for training in advance, establish two different posture models for processing the collected human body images, obtain key points in the image, use the key points to adjust the posture of the virtual human, and through point alignment and motion correction operations, can capture the movement details of the upper body of the human body in real time and accurately. The final driving effect is vivid and reasonable, which can accurately reflect the upper body limb movements of the actor in the video and effectively retain the details of the two-hand interaction in the original movement.
[0045] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, in which:
[0047] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.
[0048] Figure 1 The schematic diagram shows the implementation process of a virtual human posture correction method according to the embodiment of the present disclosure. Figure 1 ;
[0049] Figure 2 The schematic diagram shows the implementation process of a virtual human posture correction method according to the embodiment of the present disclosure. Figure 2 ;
[0050] Figure 3 A schematic diagram showing the flow of a method for training an upper body posture detection model and a hand posture detection model according to an embodiment of the present disclosure;
[0051] Figure 4 A schematic diagram of a virtual human posture correction device according to an embodiment of the present disclosure is shown;
[0052] Figure 5A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0053] In order to make the purpose, features, and advantages of the present disclosure more obvious and easy to understand, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0054] Figure 1 The schematic diagram shows the implementation process of a virtual human posture correction method according to the embodiment of the present disclosure. Figure 1 ,like Figure 1 As shown, a method for correcting a virtual human posture according to an embodiment of the present disclosure includes the following steps:
[0055] Step 101: Acquire a body image of a person, and extract at least one key point position information of the person based on the body image.
[0056] In the disclosed embodiment, before step 101, it is necessary to use a motion capture data set to perform model training to obtain a first posture model and a second posture model, wherein the first posture model is an upper body posture detection model, and the second posture model is a hand posture detection model. Specifically: obtain a motion capture data set, the motion capture data set is divided into image data and posture data, wherein the image data is an RGB image, and the posture data is a human posture label, including the 3D (metric space) and 2D (image space) positions of several key points in a specific body area; based on the posture data and the three-dimensional virtual human model, the image data is cut and filtered to obtain training sample data; based on the training sample data and Convolutional Neural Networks (CNN), the first posture model is trained, and based on the training sample data and Vision Transformer (ViT), the second posture model is trained.
[0057] In the disclosed embodiment, the body image of the person is an image captured from the video. Preferably, the image after the video is disassembled frame by frame is used as the body image of the person. The body image is input into the first posture model and the second posture model respectively; a key point heat map is generated based on the first posture model, and three-dimensional key point position information and two-dimensional key point position information are obtained based on the key point heat map; a second posture model parameter is output based on the second posture model, wherein the second posture model parameter is a hand model parameter, and based on the second posture model parameter, forward kinematics and camera projection are used to obtain the three-dimensional key point position information of the first part, the three-dimensional key point position information of the second part, the two-dimensional key point position information of the first part, and the two-dimensional key point position information of the second part, wherein the first part is the left hand and the second part is the right hand; the three-dimensional key point position information, the two-dimensional key point position information, the three-dimensional key point position information of the first part, the three-dimensional key point position information of the second part, the two-dimensional key point position information of the first part, and the two-dimensional key point position information of the second part are combined into the at least one key point position information.
[0058] Step 102: Select a first key point of a first part and a second key point of a second part in the at least one key point position information as key anchor points, unify at least one key point position corresponding to the position information into a template model based on the key anchor points, and calculate state information of the at least one key point position based on an analytical solver.
[0059] In the disclosed embodiment, the first key point is the left wrist key point, and the second key point is the right wrist key point. The template model is in the same 3D space, the analytical solver can be a predefined analytical solver, and the state information is the rotation state of each joint in the template model, expressed in quaternion form.
[0060] In the disclosed embodiment, after obtaining the state information, step 102 further includes: annotating the body image based on the at least one key point position information to obtain a posture correction image containing two-dimensional feature key points; projecting the at least one key point position in the template model into the posture correction image to obtain three-dimensional feature key points; aligning the three-dimensional feature key points with the two-dimensional feature key points, and saving the aligned alignment position information to the at least one key point position information. Finally, by using a low-pass filter on the rotation state of each joint, the action is made smooth and natural.
[0061] Step 103: Position key points of the three-dimensional virtual human model, and adjust the posture of the three-dimensional virtual human model based on the positioning and the state information to obtain a first virtual human posture model.
[0062] In the disclosed embodiment, the posture of the three-dimensional virtual human model is adjusted based on the positioning and the state information. Specifically, each joint of the three-dimensional virtual human model is adjusted according to the corresponding rotation state in the state information to achieve posture alignment. Among them, if the joint in the three-dimensional virtual human model has no corresponding relationship with the state information collected in the template model, the local rotation of the joint is set to 0 (in quaternion).
[0063] Step 104: Calculate posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information, and adjust the virtual human posture model based on the posture deviation data.
[0064] In an embodiment of the present disclosure, three-dimensional coordinate information corresponding to all key points in the first part and the second part is obtained based on the at least one key point position information, including the anchor point coordinate information corresponding to the key anchor point; model size information and image size information of the first part and the second part are respectively calculated based on the three-dimensional coordinate information corresponding to all key points, the anchor point coordinate information, the model size information and the image size information; vector data corresponding to all key points between the first part and the second part are calculated based on the three-dimensional coordinate information, the anchor point coordinate information, the model size information and the image size information; template coordinate information of the first part and the second part in the template model is obtained based on the three-dimensional coordinate information, and a normalized matrix of the key points of the first part and the key points of the second part of the template model is calculated based on the template coordinate information and the image size information; a weight matrix is calculated based on the normalized matrix and a scaling factor, wherein the scaling factor can be preset based on experience and adjusted based on the calculation result, and posture deviation data of the virtual human posture model is calculated based on the weight matrix and the vector data.
[0065] In the disclosed embodiment, the relative position of the first part and the second part in the virtual human posture model is corrected based on the posture deviation data; the relative position is fixed, and based on the state information, i.e., the rotation state of the remaining joints, the posture information of the remaining parts in the virtual human posture model is solved using inverse kinematics, and the virtual human posture model is adjusted based on the posture information.
[0066] Figure 2 The schematic diagram shows the implementation process of a virtual human posture correction method according to the embodiment of the present disclosure. Figure 2 ,like Figure 2 As shown, a method for correcting a virtual human posture according to an embodiment of the present disclosure includes the following steps:
[0067] Step 201, upper body and hands detection and positioning.
[0068] In the disclosed embodiment, the current moment image is input, and the position and range of the upper body and hands in the original image are determined using the human body and hand object detectors, and the image of the corresponding body area is cropped accordingly. The body area is required to be roughly in the center of the cropped image (in the cropped image of the upper body, the chest is in the center of the image; in the cropped image of the hand, the palm is in the center of the image), and the cropped image needs to completely contain the corresponding body area.
[0069] Step 202, 2D and 3D posture estimation of the upper body and both hands.
[0070] In the embodiment of the present disclosure, a cropped image of a body region is input, and the pre-trained upper body and hand posture detection models are used for inference to obtain the 2D and 3D key point positions of the upper body and hands. The training method of the pre-trained upper body posture detection model and the hand posture detection model is as follows: Figure 3 shown.
[0071] Figure 3 The flowchart of the training method of the upper body posture detection model and the hand posture detection model in the embodiment of the present disclosure is shown. Figure 3 As shown, the training method of the upper body posture detection model and the hand posture detection model in the embodiment of the present disclosure includes the following steps:
[0072] Step 301: data collection.
[0073] In the disclosed embodiment, the focus is on upper body motion capture and driving, so two neural networks for upper body posture and hand posture are trained specifically.
[0074] In the disclosed embodiment, the training data is partly from open source datasets and partly from professional motion capture equipment. Each set of data consists of two parts: RGB images and human posture labels. The human posture labels contain the 3D (metric space) and 2D (image space) positions of several key points in a specific body area. For the upper body posture model, the key points are located above the waist, including the spine, neck, shoulders, elbows, wrists and other joints. For the hand posture model, the key points usually include finger joints, fingertips, and wrists.
[0075] Step 302: data preprocessing.
[0076] In the disclosed embodiment, the collected data needs to be cleaned and cropped to ensure that the corresponding body parts are in the field of view and approximately located in the center of the image. For the upper body posture detection model, the center of the image is located at the chest. For the hand posture detection model, the center of the image is located between the middle finger and the palm. In addition, to ensure the effectiveness of the model in difficult scenarios, the samples in the hand posture data where both hands are in the frame at the same time and are mutually occluded must meet a certain ratio requirement.
[0077] Step 303: constructing a data set.
[0078] In the disclosed embodiment, the data is randomly sorted and divided into a training set, a validation set, and a test set according to a certain ratio. For the training set, the following random augmentation processes are used: scaling, translation, rotation, color change, and noise pollution.
[0079] Step 304: model training.
[0080] In the disclosed embodiment, different network structures are designed for the upper body posture detection model and the hand posture detection model. The upper body posture detection model uses a convolutional neural network (CNN) to extract features, and then obtains 3D and 2D key point heat maps through a 1×1 convolution layer, respectively, to regress the 3D key points at the metric scale and the 2D key points at the image scale. The hand posture detection model uses a ViT network to extract features, and then regresses the hand model parameters of a parameterized 3D hand model (hand Model with Articulated and Non-rigid deformations, MANO) through a fully connected layer, and finally obtains the 3D and 2D key point positions through forward kinematics (FK) and camera projection. During training, the upper body posture detection model and the hand posture detection model use similar loss functions:
[0081] (Formula 1)
[0082] (Formula 2)
[0083] (Formula 3)
[0084] (Formula 4)
[0085] The three loss terms in Formula 1 , , They are 3D key point loss, reprojection loss, and 2D key point loss, where w1, w2, and w3 are loss weights. 3d 、x 2d Indicates the true value of 3D and 2D key point annotation, y 3d ,y 2d represents the 3D and 2D key point positions predicted by the neural network, ∏ cam represents the weak perspective camera projection function. All loss functions use L1 distance loss.
[0086] Step 203: model posture calculation and post-calculation processing.
[0087] In the disclosed embodiment, the 3D key points of each body region inferred by the posture model are merged, and the complete posture of the upper body is obtained by solving. When merging, the wrist key points of the left and right hands are used as anchors to unify the hand key points and the upper body key points into the same 3D space. Then, the local rotation state of each joint of the template human body model (expressed in quaternion form) is solved through a predefined analytical solver. Next, the 3D position of the wrists of both hands is corrected so that their posture and image are better matched. Specifically, the 3D position of the wrist of the upper body posture is corrected so that the 3D key points of both hands are aligned with the 2D key points of their image space as much as possible after projection. The corrected 3D position of the wrist will be used in the subsequent action redirection step to ensure that the interaction details of the two hands can be retained. Finally, a low-pass filter is used for the rotation state of each joint to make the action smooth and natural.
[0088] Step 204: Model action redirection.
[0089] In the disclosed embodiment, the action redirection from the template model to the target digital human model is completed by simply "copying" the rotation state between the paired joints. Before redirection, the target digital human is required to complete the posture alignment process with the template model in advance and record the semantically consistent joint pairs between the two models. During the redirection process, all joints of the target digital human are traversed. If there is a template model joint with the same semantics, its local rotation quaternion is directly "copied" to the current joint. If there is no mapping relationship, the local rotation of the current joint is set to 0 (unit quaternion).
[0090] Step 205: Correct the posture of the hands and arms of the model.
[0091] In the disclosed embodiment, since the target digital human model has different bone length and body proportions from the template model, the action redirection cannot ensure that the two-hand interaction information of the original action is preserved. Therefore, additional corrections are made to the wrist position and arm posture of the target digital human model on this basis.
[0092] In the disclosed embodiment, without changing the wrist and finger postures, the 3D position of the wrist corrected by the template model is used as the basis to correct and calculate the relative displacement of the hands of the target digital human in the 3D space to ensure that the details of the two-hand interaction are consistent with the original action. A method for calculating the relative displacement of the hands based on the key point distance weight is used here:
[0093] (Formula 5)
[0094] (Formula 6)
[0095] (Formula 7)
[0096] (Formula 8)
[0097] In the above formula, M offset is an N×N×3 tensor (N is the number of key points of each hand, which is 21), where each element M offset (i, j) is a 3D vector representing the relative displacement of the two hands estimated based on the i-th key point of the left hand and the j-th key point of the right hand. i src,left 、x i src,right 、x i tgt,left 、x i tgt,right Respectively represent the 3D coordinates of the i-th key point of the template model left hand, template model right hand, target model left hand, and target model right hand. wrist Indicates the position of the wrist key point of the hand, and it is also the position anchor point of the hand. src , l tgt is the size of the hand of the template model and the target model, calculated by their average bone length. dist and M weight The shape is N×N, representing the normalized distance matrix and weight matrix between the key points of the left and right hands respectively. The softmax function ensures that the sum of the weight matrix is 1, and k is the scaling factor. offset is the final calculated relative displacement of both hands (left wrist points to right wrist), where “ ” represents the Hadamard product, and sum represents the sum of matrix elements.
[0098] In the embodiment of the present disclosure, the above calculation method estimates a reasonable relative position of both hands (wrists) for each pair of key points of both hands and stores them in M offset And construct the weight M according to the distance of each pair of key points weight , and finally determine the final relative position of the hands by weighted averaging. Then, the hands with determined relative positions are taken as a whole and "placed" in the appropriate position in the 3D space: the midpoints of the lines connecting the hands before and after correction coincide. At this point, the absolute positions of the hands in the 3D space are determined, and the wrist positions are also determined accordingly. Finally, with the determined wrist position as the target, the rotation states of the joints of the two arms (each arm includes two joints, the shoulder and the elbow) are solved separately through inverse kinematics (IK). In this step, the disclosed embodiment uses a pseudo-inverse Jacobian matrix method with a damping term for IK solution of the arm joints.
[0099] Figure 4A schematic diagram of a virtual human posture correction device according to an embodiment of the present disclosure is shown. Figure 4 As shown, a virtual human posture correction device according to an embodiment of the present disclosure includes:
[0100] The detection and positioning unit 401 is used to obtain a body image of a person, and extract at least one key point position information of the person based on the body image.
[0101] The detection and positioning unit 401 is also used to input the body image into the first posture model and the second posture model respectively; generate a key point heat map based on the first posture model, and obtain three-dimensional key point position information and two-dimensional key point position information based on the key point heat map; output second posture model parameters based on the second posture model, and obtain three-dimensional key point position information of the first part, three-dimensional key point position information of the second part, two-dimensional key point position information of the first part and two-dimensional key point position information of the second part based on the second posture model parameters by using forward kinematics and camera projection; merge the three-dimensional key point position information, the two-dimensional key point position information, the three-dimensional key point position information of the first part, the three-dimensional key point position information of the second part, the two-dimensional key point position information of the first part and the two-dimensional key point position information of the second part into the at least one key point position information.
[0102] The posture processing unit 402 is used to select the first key point of the first part and the second key point of the second part in the at least one key point position information as key anchor points, unify the at least one key point position into the template model based on the key anchor points, and calculate the state information of the at least one key point position based on the analytical solver.
[0103] The action orientation unit 403 is used to locate the key points of the three-dimensional virtual human model, and adjust the posture of the three-dimensional virtual human model based on the location and the state information to obtain a first virtual human posture model.
[0104] The posture correction unit 404 is used to calculate the posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information, and adjust the virtual human posture model based on the posture deviation data.
[0105] The posture correction unit 404 is also used to obtain the three-dimensional coordinate information corresponding to all the key points in the first part and the second part based on the at least one key point position information, including the anchor point coordinate information corresponding to the key anchor point; calculate the model size information and image size information of the first part based on the three-dimensional virtual human model and the body image; calculate the vector data corresponding to all the key points between the first part and the second part based on the three-dimensional coordinate information corresponding to all the key points, the anchor point coordinate information, the model size information and the image size information; obtain the template coordinate information of the first part and the second part in the template model based on the three-dimensional coordinate information, calculate the normalized matrix of the key points of the first part and the key points of the second part of the template model based on the template coordinate information and the image size information; calculate the weight matrix based on the normalized matrix and the scaling coefficient, and calculate the posture deviation data of the virtual human posture model based on the weight matrix and the vector data. Correct the relative position of the first part and the second part in the virtual human posture model based on the posture deviation data; fix the relative position, solve the posture information of the remaining parts in the virtual human posture model based on the state information, and adjust the virtual human posture model based on the posture information.
[0106] The model training unit 405 is used to obtain a motion capture data set, which is divided into image data and posture data; based on the posture data and the three-dimensional virtual human model, the image data is cut and screened to obtain training sample data; based on the training sample data and the convolutional neural network, a first posture model is trained, and based on the training sample data and the visual converter, a second posture model is trained.
[0107] The position alignment unit 406 is used to annotate the body image based on the at least one key point position information to obtain a posture-corrected image containing two-dimensional feature key points; project the at least one key point position in the template model into the posture-corrected image to obtain three-dimensional feature key points; align the three-dimensional feature key points with the two-dimensional feature key points, and save the aligned alignment position information into the at least one key point position information.
[0108] In an exemplary embodiment, the detection and positioning unit 401, the posture processing unit 402, the motion orientation unit 403, the posture correction unit 404, the model training unit 405, the position alignment unit 406, etc. can be implemented by one or more central processing units (CPU, Central Processing Unit), graphics processing units (GPU, Graphics Processing Unit), application specific integrated circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic devices (PLD, Programmable Logic Device), complex programmable logic devices (CPLD, Complex Programmable Logic Device), field programmable gate arrays (FPGA, Field-Programmable Gate Array), general processors, controllers, microcontrollers (MCU, Micro Controller Unit), microprocessors (Microprocessors), or other electronic components.
[0109] Regarding the device in the above embodiment, the specific manner in which each module and unit performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0110] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0111] Figure 5 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0112] like Figure 5As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 to a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0113] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0114] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a virtual human posture correction method. For example, in some embodiments, a virtual human posture correction method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of a virtual human posture correction method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform a virtual human posture correction method in any other appropriate manner (e.g., by means of firmware).
[0115] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0119] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0120] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0121] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0122] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0123] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for correcting a virtual human posture, characterized in that: The method comprises: Acquire a body image of a person, and extract at least one key point position information of the person based on the body image; Selecting a first key point of a first part and a second key point of a second part in the at least one key point position information as key anchor points, unifying at least one key point position corresponding to the position information into a template model based on the key anchor points, and calculating state information of the at least one key point position based on an analytical solver; Positioning key points of a three-dimensional virtual human model, and adjusting the posture of the three-dimensional virtual human model based on the positioning and the state information to obtain a first virtual human posture model; Calculating posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information, and adjusting the virtual human posture model based on the posture deviation data; Wherein, obtaining a motion capture data set, wherein the motion capture data set is divided into image data and posture data; Cutting and filtering the image data based on the posture data and the three-dimensional virtual human model to obtain training sample data; Based on the training sample data and the convolutional neural network, a first posture model is obtained by training, and based on the training sample data and the visual converter, a second posture model is obtained by training; wherein the body image is input into the first posture model and the second posture model respectively; Generate a key point heat map based on the first posture training, and obtain three-dimensional key point position information and two-dimensional key point position information based on the key point heat map; Output second posture model parameters based on the second posture model, and acquire three-dimensional key point position information of the first part, three-dimensional key point position information of the second part, two-dimensional key point position information of the first part, and two-dimensional key point position information of the second part by using forward kinematics and camera projection based on the second posture model parameters; The three-dimensional key point position information, the two-dimensional key point position information, the three-dimensional key point position information of the first part, the three-dimensional key point position information of the second part, the two-dimensional key point position information of the first part and the two-dimensional key point position information of the second part are combined into the at least one key point position information.
2. The method according to claim 1, characterized in that The method further comprises: Annotating the body image based on the at least one key point position information to obtain a posture-corrected image containing two-dimensional feature key points; Projecting the position of at least one key point in the template model onto the posture-corrected image to obtain a three-dimensional feature key point; The three-dimensional feature key point is aligned with the two-dimensional feature key point, and the aligned position information is saved in the at least one key point position information.
3. The method according to claim 1, characterized in that The step of calculating the posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information includes: Based on the at least one key point position information, acquiring three-dimensional coordinate information corresponding to all key points in the first part and the second part, including anchor point coordinate information corresponding to the key anchor point; Calculate model size information and image size information of the first part and the second part respectively based on the three-dimensional virtual human model and the body image; Calculate vector data corresponding to all key points between the first part and the second part based on the three-dimensional coordinate information corresponding to all key points, the anchor point coordinate information, the model size information and the image size information; Acquire template coordinate information of the first part and the second part in the template model based on the three-dimensional coordinate information, and calculate a normalized matrix of key points of the first part and the second part of the template model based on the template coordinate information and the image size information; A weight matrix is calculated based on the normalization matrix and the scaling coefficient, and posture deviation data of the virtual human posture model is calculated based on the weight matrix and the vector data.
4. The method according to claim 1, characterized in that: The adjusting the virtual human posture model based on the posture deviation data comprises: Correcting the relative position of the first part and the second part in the virtual human posture model based on the posture deviation data; The relative position is fixed, posture information of the remaining parts in the virtual human posture model is calculated based on the state information, and the virtual human posture model is adjusted based on the posture information.
5. A virtual human posture correction device, characterized in that: The device comprises: A detection and positioning unit, used to obtain a body image of a person, and extract at least one key point position information of the person based on the body image; a posture processing unit, configured to select a first key point of a first part and a second key point of a second part in the at least one key point position information as key anchor points, unify the at least one key point position corresponding to the position information into a template model based on the key anchor points, and calculate the state information of the at least one key point position based on an analytical solver; an action orientation unit, configured to locate key points of a three-dimensional virtual human model, and adjust the posture of the three-dimensional virtual human model based on the location and the state information to obtain a first virtual human posture model; a posture correction unit, configured to calculate posture deviation data of the virtual human posture model based on the first virtual human posture model and the at least one key point position information, and adjust the virtual human posture model based on the posture deviation data; The model training unit is used to obtain a motion capture data set, wherein the motion capture data set is divided into image data and posture data; based on the posture data and the three-dimensional virtual human model, the image data is cut and screened to obtain training sample data; based on the training sample data and a convolutional neural network, a first posture model is trained, and based on the training sample data and a visual converter, a second posture model is trained; The detection and positioning unit is also used to input the body image into the first posture model and the second posture model respectively; generate a key point heat map based on the first posture training model, and obtain three-dimensional key point position information and two-dimensional key point position information based on the key point heat map; output second posture model parameters based on the second posture model, and obtain three-dimensional key point position information of the first part, three-dimensional key point position information of the second part, two-dimensional key point position information of the first part and two-dimensional key point position information of the second part by using forward kinematics and camera projection based on the second posture model parameters; merge the three-dimensional key point position information, the two-dimensional key point position information, the three-dimensional key point position information of the first part, the three-dimensional key point position information of the second part, the two-dimensional key point position information of the first part and the two-dimensional key point position information of the second part into the at least one key point position information.
6. The device according to claim 5, characterized in that The device also includes: A position alignment unit is used to annotate the body image based on the at least one key point position information to obtain a posture-corrected image containing two-dimensional feature key points; project the at least one key point position in the template model into the posture-corrected image to obtain three-dimensional feature key points; align the three-dimensional feature key points with the two-dimensional feature key points, and save the aligned alignment position information into the at least one key point position information.
7. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-4.
Citation Information
Patent Citations
Virtual character model control method and device and electronic equipment
CN114527873A
Attitude redirection method and device based on joint grid deformation, equipment and medium
CN117710468A
