Video-based 3D character general motion file generation method and system
By identifying target characters in video frame sequences, detecting 2D key points and converting them into 3D key points, applying bone length and physical constraints, and generating standard skeletal motion formats, this technology solves the problems of high cost and insufficient accuracy in acquiring 3D character motion resources in existing technologies, and achieves efficient and accurate generation of 3D character motion files.
Patent Information
- Application Number
- CN202611187732.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies are costly and time-consuming in acquiring 3D character motion resources. Furthermore, existing video motion extraction methods lack accuracy when dealing with complex scenes such as occlusion and rapid movement, resulting in physical inconsistencies in the reconstructed 3D motion, such as ground penetration, joint angle exceeding limits, and clipping, making them unsuitable for direct use in production environments.
By parsing video frame sequences to identify target characters, detecting 2D key points and converting them into 3D key points, applying constant bone length constraints and physical constraints, and generating a general motion file for 3D characters, including quality assessment and standard bone motion format conversion.
It enables automatic conversion from ordinary videos to production-grade 3D character motion data, eliminating physical inconsistencies such as bone stretching, joint over-limits, and ground penetration, ensuring that motion files can be directly used in game engines or animation tools without manual correction.
Smart Images

Figure CN123160738A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of virtual content creation technology, and in particular to a method and system for generating universal motion files for 3D characters based on video. Background Technology
[0002] In the virtual content industry, including games, film and television, virtual reality, and digital humans, the acquisition of high-quality 3D character motion resources mainly relies on three methods: professional motion capture, 2D pose estimation and 3D upscaling based on single-frame images, and AI-generated motion creation. Professional motion capture requires wearable markers, dedicated venues, and professional actors, resulting in high costs and long production cycles. 2D pose estimation and 3D upscaling based on single-frame images are processed independently frame by frame, lacking modeling of the temporal continuity of motion, leading to severe jitter, bone length fluctuations, and depth ambiguity in the reconstructed 3D motion, which cannot meet the quality requirements of production environments. AI-generated motion creation generates motion that does not originate from real performances, failing to retain the details and naturalness of real human movement in videos. Existing video motion extraction methods suffer from insufficient 2D pose estimation accuracy when handling complex scenes such as occlusion, rapid movement, and overlapping multiple people. The lack of temporal modeling in 2D-to-3D depth upscaling leads to severe inter-frame jitter and depth ambiguity, and the reconstructed 3D motion data has physical inconsistencies such as ground penetration, joint angle exceeding limits, and clipping, making it unsuitable for direct use in production environments without manual correction. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method and system for generating general motion files for 3D characters based on video, so as to improve the conversion efficiency from ordinary video to production-grade 3D character motion data without the need for manual correction.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for generating generic motion files for 3D characters based on video, comprising: The original video is parsed to obtain a video frame sequence, and the target person in the video frame sequence is identified; The coordinates of 2D key points of the target person in each frame of the video frame sequence are detected, and a 2D key point coordinate sequence is generated according to the time sequence. The 2D keypoint coordinate sequence is converted into a 3D keypoint coordinate sequence, and a constant bone length constraint and physical constraint are applied to the 3D keypoint coordinate sequence to obtain a 3D joint coordinate sequence. The 3D joint coordinate sequence is subjected to quality evaluation. Once the quality evaluation is passed, the 3D joint coordinate sequence is converted into a standard skeletal motion format to generate a 3D character universal motion file.
[0005] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is: a video-based 3D character universal motion file generation system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the various steps of the video-based 3D character universal motion file generation method described above.
[0006] The beneficial effects of this invention are as follows: By analyzing video and identifying target characters, this invention achieves automatic target character locking; by detecting the coordinates of 2D key points in each frame and generating a temporal coordinate sequence, it achieves structured extraction of human motion information; by converting the 2D coordinate sequence into a 3D coordinate sequence and applying constant bone length constraints and physical constraints, it achieves accurate mapping from 2D to 3D, effectively eliminating physical inconsistencies such as bone stretching, joint over-limits, and ground penetration; through quality assessment and exporting a standard bone motion format after passing the assessment, it achieves automated quality control of output, ensuring that the final generated 3D character universal motion file can be directly imported into the production environment without manual correction, thus improving the conversion efficiency from ordinary video to production-grade 3D character motion data. Attached Figure Description
[0007] Figure 1 This is a flowchart illustrating a method for generating universal motion files for 3D characters based on video, according to an embodiment of the present invention. Figure 2 This is a flowchart illustrating a method for generating general motion files for 3D characters based on video, according to an embodiment of the present invention. Figure 3 This is a flowchart of the video input and preprocessing process according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating the multi-stage 2D pose estimation and tracking process according to an embodiment of the present invention. Figure 5 This is a flowchart of the time-aware 2D-to-3D depth enhancement process according to an embodiment of the present invention; Figure 6 This is a flowchart illustrating the physical constraint correction and motion optimization process according to an embodiment of the present invention. Figure 7 This is a flowchart of motion quality assessment and anomaly marking according to an embodiment of the present invention; Figure 8 This is a flowchart of abnormal segment location and local reprocessing according to an embodiment of the present invention; Figure 9 This is a flowchart illustrating the action format conversion and export process according to an embodiment of the present invention. Figure 10 This is a schematic diagram of a video-based 3D character universal motion file generation system according to an embodiment of the present invention. Detailed Implementation
[0008] Definitions:
[0009] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0010] In existing technologies, 3D character motion resources are the fundamental data driving virtual character movement in the virtual content industry, including games, film and television, virtual reality, and digital humans. Traditional motion resource acquisition relies on professional motion capture equipment, which is costly and time-consuming. 2D pose estimation methods based on single-frame images lack temporal modeling, resulting in severe jitter and fluctuations in bone length in the reconstructed motion. AI-generated motion creation struggles to retain the natural details of realistic movement. Existing video motion extraction methods lack accuracy when handling complex scenes such as occlusion and rapid movement, and the reconstructed motion suffers from physical inconsistencies such as ground penetration, excessive joint angles, and limb clipping. The resulting motion data requires extensive manual correction before it can be used, severely restricting the production efficiency of virtual content.
[0011] To at least address the aforementioned issues, this invention provides a method for generating universal 3D character motion files based on video. By performing temporal detection and 3D conversion on the 2D key points of a target character in a video, and applying constant bone length constraints and physical constraints, a universal 3D character motion file is generated after quality assessment. This method automatically converts ordinary videos into production-grade universal 3D character motion files, eliminating physical anomalies such as ground penetration, joint overshoot, and limb clipping, and allows for direct use in game engines or animation tools without manual correction.
[0012] The following details a method for generating universal motion files for 3D characters based on video, as described in this invention. Please refer to [link / reference]. Figure 1 and Figure 2 The method 100 includes steps 101 to 104: Step 101: parse the original video to obtain a video frame sequence, and identify the target person in the video frame sequence.
[0013] To identify the target person in the video frame sequence, if there are user-specified identification conditions for the target person, the target person is detected and determined according to the identification conditions; otherwise, all people in each frame of the video frame sequence are detected, and the person with the largest size in each frame is taken as the target person.
[0014] Combination Figure 3Specifically, the user inputs a 30-second MP4 video of a dance performance, with a resolution of 1920×1080 and a frame rate of 30 frames per second. After reading the video file, the system parses its encoding format to confirm that it is a supported MP4 format. If the format is not supported, an error is returned and processing is terminated. The system extracts metadata such as the video's frame rate, resolution, and total number of frames, extracts video frames according to the target frame rate of 30 frames per second, obtaining a total of 900 frames, and adaptively adjusts the resolution according to subsequent processing requirements.
[0015] The system then determines whether the user has specified a target person. Since the video is a solo dance scene and the user has not specified the identification criteria for the target person, the system adopts the default strategy and detects all people in each frame. There is only one dancer in the video, so the system takes the dancer as the target person and generates the initial anchoring information for the person, including the appearance feature vector and the bounding box coordinates of the first frame. Finally, it outputs the standardized video frame sequence, video metadata, and target person anchoring results.
[0016] In this way, the system can automatically locate the target person whose actions are to be extracted, eliminating the need for manual frame-by-frame annotation and providing standardized input data for subsequent processing. By adaptively adjusting resolution and format verification, it ensures compatibility and processing stability with videos from different sources, reducing the risk of processing failures due to video format incompatibility.
[0017] Step 102: Detect the 2D key point coordinates of the target person in each frame of the video frame sequence, and generate a 2D key point coordinate sequence according to the time sequence.
[0018] The detection of 2D keypoint coordinates of the target person in each frame of the video frame sequence involves: using a pyramid feature network to extract features from each frame of the video frame sequence, obtaining different resolution levels based on the extracted features; detecting all 2D keypoints of the target person at each resolution level, obtaining the coordinates of all 2D keypoints, and calculating the confidence level of all 2D keypoints; if there is a target 2D keypoint with a confidence level lower than a preset confidence threshold, then using a preset bidirectional temporal attention mechanism, determining the target frame where the target 2D keypoint is located, and completing the coordinates of the target 2D keypoint based on the temporal context of the target 2D keypoint in adjacent frames of the target frame.
[0019] It also includes calculating an attenuation factor based on the actual number of context frames and the preset standard number of context frames of the boundary frames of the video frame sequence; multiplying the confidence of all 2D keypoints in the boundary frame by the attenuation factor to obtain an attenuation confidence; using the attenuation confidence as the confidence of the 2D keypoints in the boundary frame; if the attenuation factor is lower than a preset attenuation threshold, adding a single-frame detection marker to the boundary frame; otherwise, completing the coordinates of the 2D keypoints in the boundary frame whose confidence is lower than the preset confidence threshold; the boundary frame includes a start frame and an end frame.
[0020] Combination Figure 4 Specifically, the system loads a pre-trained pose estimation model, which uses HRNet as its backbone network and incorporates a pyramid feature network. For the 900 video frame sequence obtained in step 101, the system processes each frame. Taking one frame as an example, the system extracts feature maps at four resolution levels (1 / 4, 1 / 8, 1 / 16, 1 / 32) using the pyramid feature network (FPN). The features from each level are then fused to generate a heatmap. Each keypoint corresponds to a heatmap, and the peak position of the heatmap represents the 2D pixel coordinates of that keypoint. The peak response value is the confidence score of that keypoint, ranging from 0 to 1. The system detects 17 keypoints, including the nose, left and right eyes, left and right ears, left and right shoulders, left and right elbows, left and right wrists, left and right hips, left and right knees, and left and right ankles.
[0021] The system determines whether there are occluded keypoints with a confidence level below a preset confidence threshold. For example, during detection, if the confidence level of the dancer's left wrist keypoint is found to be below 0.3 in some frames, it is determined to be an occluded and invisible keypoint. At this point, the system activates a bidirectional temporal attention completion mechanism, constructing a temporal window of 11 frames, including the five frames before and after the current frame. The feature vector of the low-confidence keypoint is used as the query vector, and the feature vectors of the same keypoint in other frames within the temporal window are used as the key and value. Attention weights are calculated using a 4-head cross-attention mechanism (16 dimensions per head). The attention calculation formula is as follows: ; in, For attention, Q is the query vector, K is the key, V is the value, and W is the dimension, which is 16. This is the normalization function.
[0022] The system uses both forward and backward attention paths to generate predicted completion coordinates, and then fuses them using a confidence-weighted average to obtain the final completion coordinates. For keypoints with a confidence level below 0.3, the completion result is directly used for replacement. For keypoints with a confidence level between 0.3 and 0.6, the detection result and the completion result are fused using linear interpolation based on their confidence levels. For keypoints with a confidence level above 0.6, the detection result is directly retained. The fused keypoint coordinates for the current frame are then output. This embodiment is for a single-person scene; the system does not perform multi-person identity association tracking and assignment.
[0023] For a boundary frame at the beginning of the video, there are no usable context frames before it and 5 frames after it, resulting in 5 actual usable context frames and 10 standard context frames. Based on the attenuation factor calculation formula: Attenuation factor = Actual usable context frames / Standard context frames, the attenuation factor is calculated to be 0.5. The system multiplies the confidence of all keypoints in this boundary frame by 0.5 to obtain the attenuation confidence. Since the attenuation factor of 0.5 is higher than the preset attenuation threshold of 0.3, the system still performs temporal completion, but the confidence of the completion result is reduced accordingly.
[0024] For the first frame of the video, where the attenuation factor is less than 0.3, the system completely skips bidirectional temporal attention completion, directly uses the single-frame detection result, and adds a boundary frame single-frame detection marker.
[0025] The system iterates through all frames until all are processed. After all 900 frames are processed, the system outputs a complete 2D keypoint coordinate sequence with dimensions of 900×17×3 (number of frames × number of keypoints × [keypoint x-coordinate, keypoint y-coordinate, keypoint confidence]).
[0026] In this way, the system can utilize the temporal context of preceding and following frames to complete the coordinates of occluded key points in occluded scenes, improving the accuracy and completeness of key point detection and providing a high-quality 2D key point data foundation for subsequent 3D reconstruction. Simultaneously, through boundary frame attenuation factors and confidence reduction mechanisms, a smooth transition of temporal processing at the start and end points of the video is ensured, avoiding a sudden drop in detection quality at boundaries. Simplified identity tracking in single-person scenes further reduces unnecessary computational overhead and improves overall processing efficiency.
[0027] Step 103: Convert the 2D keypoint coordinate sequence into a 3D keypoint coordinate sequence, and apply constant bone length constraints and physical constraints to the 3D keypoint coordinate sequence to obtain a 3D joint coordinate sequence, including: Step 1031: Convert the 2D keypoint coordinate sequence into a 3D keypoint coordinate sequence.
[0028] Specifically, the 2D keypoint coordinate sequence is divided into multiple windows according to a preset sliding window length. The 2D keypoint coordinate sequence in each window is input into a preset temporal encoder to obtain the 3D coordinates and depth confidence of each 2D keypoint in each frame in each window. A 3D keypoint coordinate sequence is generated based on the 3D coordinates and depth confidence.
[0029] Combination Figure 5 Specifically, the system loads a pre-trained temporal Transformer 3D depth augmentation model, which contains a 4-layer encoder, each with 8 attention heads, a hidden dimension of 256, and initializes bone length estimation. The system processes the 2D keypoint coordinate sequence output in step 102 using a sliding window, with a window size of 16 frames before and after, for a total window length of 33 frames, and a sliding stride of 1 frame. For each window, the system maps the 51-dimensional vector of x-coordinates, y-coordinates, and confidence scores of 17 keypoints in each frame to 256 dimensions through the input projection layer, adds frame-level position encoding, and then feeds it into the Transformer encoder.
[0030] The encoder's global self-attention mechanism establishes direct attentional connections between 33 frames within a window, with eight attention heads focusing on motion patterns at different time scales. The encoder output is mapped to the x, y, and z coordinates of 17 keypoints per frame via an output projection layer, while a parallel confidence prediction head outputs 17-dimensional depth confidence. Subsequently, the system applies a bone length consistency constraint to the inference results and outputs the 3D joint coordinates of the current window.
[0031] After window processing is complete, overlapping frames are fused using a weighted average to eliminate boundary discontinuities. The system determines whether the current input contains multi-view video. In this embodiment, it is monocular video, so the system does not perform multi-view epipolar geometric fusion and uses pure temporal modeling. The system traverses all windows until all processing is complete, stitches the 3D joint coordinates of each window into the full sequence of 3D joint coordinates, and outputs the estimated bone length. Finally, it outputs a complete 3D keypoint coordinate sequence with dimensions of 900×17×3 (number of frames × number of keypoints × [x,y,z]).
[0032] In this way, the system utilizes the global self-attention mechanism of the temporal Transformer to model the motion trajectory of keypoints within the entire sliding window. It resolves the inherent depth ambiguity of monocular videos through motion continuity priors, while multi-frame joint inference naturally imposes inter-frame consistency constraints at the network level, effectively reducing inter-frame jitter caused by independent frame-by-frame processing. Furthermore, the weighted average fusion of overlapping frames within the sliding window further eliminates discontinuities at window boundaries, ensuring a smooth transition of the output 3D joint coordinates across the entire sequence and improving the temporal coherence of the motion data.
[0033] Step 1032: Apply a constant bone length constraint to the 3D keypoint coordinate sequence.
[0034] Specifically, each 3D keypoint in the 3D keypoint coordinate sequence corresponds to a joint, and the line connecting two adjacent 3D keypoints forms a bone segment. Each bone segment includes a parent joint and a child joint. The median length of each bone segment in all frames of the video frame sequence is calculated, and the median length is used as the reference length of the corresponding bone segment. Bone segments in each frame whose actual length deviates from the reference length by more than a preset deviation threshold are identified. Based on the coordinates of the parent joint of the bone segment, the direction vector of the bone segment, and the reference length, the corrected coordinates of the child joint are calculated, and the coordinates of the child joint are updated to the corrected coordinates to obtain the corrected bone segment data for each frame. Based on the corrected bone segment data for each frame, a skeletal constraint 3D joint coordinate sequence is generated.
[0035] Specifically, the system defines 16 bone segments based on 17 key points of the human body, including segments from shoulder to elbow, elbow to wrist, hip to knee, knee to ankle, and related segments of the trunk. Each bone segment is formed by a line connecting two adjacent key points, with the endpoint closer to the root of the body being the parent joint and the endpoint farther from the root being the child joint. The system calculates the length of each bone segment across all 900 frames output in step 1031, using the median as the reference length for that bone segment. Subsequently, the system checks the deviation between the actual length and the reference length frame by frame and bone segment by bone, setting a deviation threshold of 2% of the reference length.
[0036] Taking a bone segment from shoulder to elbow in a frame as an example, if the actual length of this bone segment in that frame is 35 cm, while the reference length is 33 cm, the deviation is approximately 6%, exceeding the 2% threshold. The system obtains the coordinates of the parent joint of this bone segment, i.e., the shoulder joint coordinates, calculates the direction vector from the parent to the child joint (i.e., the elbow joint coordinate minus the shoulder joint coordinate), and then uses the ratio of the reference length to the current actual length as a scaling factor (33 divided by 35). The direction vector of this bone segment is multiplied by this scaling factor and added to the parent joint coordinates to obtain the corrected coordinates of the child joint. The elbow joint coordinates are then updated to these corrected coordinates. After the update, the length of this bone segment is equal to the reference length of 33 cm. The system performs the above calculations sequentially on all bone segments exceeding the deviation threshold to obtain the corrected bone segment data for each frame, and then generates a 3D joint coordinate sequence of skeletal constraints.
[0037] In this way, the system eliminates inter-frame fluctuations in bone length, ensuring that the length of each bone segment of the same person remains consistent throughout the video sequence, thus satisfying the physiological constraint of constant human bone length. The application of this constraint is independent of specific action types or character shapes, making it universal and adaptable to different video inputs. The statistical method for calculating the median bone length reference effectively avoids interference from extreme frames on the constraint benchmark, guaranteeing the stability and robustness of the correction.
[0038] Step 1033: Apply physical constraints to the 3D key point coordinate sequence to obtain the 3D joint coordinate sequence.
[0039] Specifically, the gait cycle is determined based on the video frame sequence; the supporting foot in the gait cycle is determined based on the skeletal constraint 3D joint coordinate sequence; and the coordinates of the supporting foot are adjusted to a preset ground plane position to obtain a first correction sequence. Based on preset rotation angle ranges for each joint, it is detected whether there are any joints in the first correction sequence whose angles exceed the range. If so, the rotation angle of the joints exceeding the range is corrected to the boundary value of the corresponding angle range within each joint rotation angle range to obtain a second correction sequence. The joint angular velocity is calculated based on the second correction sequence, and the second correction sequence is smoothed based on the joint angular velocity to obtain a third correction sequence. It is detected whether there is a penetration phenomenon between bone segments formed by adjacent joints in the third correction sequence. If so, the penetration phenomenon between bone segments is eliminated through local posture adjustment to obtain the 3D joint coordinate sequence.
[0040] The joint angular velocities are calculated based on the second correction sequence. The second correction sequence is then smoothed based on the joint angular velocities to obtain a third correction sequence. Specifically, the angular velocities of all joints in each frame of the second correction sequence are calculated, and the maximum value of all joint angular velocities in each frame is used as the motion intensity index of each frame. The window size for smoothing is determined based on the motion intensity index, and the window size is negatively correlated with the motion intensity index. The second correction sequence is then smoothed based on the window size to obtain the third correction sequence.
[0041] Combination Figure 6 Specifically, the system sequentially performs four physical constraint corrections.
[0042] The system determines the support state in the gait cycle by detecting the positional relationship between key foot points (left and right ankles) and the ground plane frame by frame. For each frame, the system calculates the three-dimensional coordinates of the key points of the left and right ankles, obtains their height values (i.e., y-coordinates), and compares them with the preset ground plane positions. Simultaneously, it calculates the three-dimensional spatial displacement (Euclidean distance) of the same ankle between adjacent frames. When the height of an ankle is below the ground plane (i.e., the foot is sunk below the ground or just touching the ground) and the inter-frame displacement is less than the contact distance threshold (default 2 cm), the foot is determined to be the supporting foot in the current frame, and the frame is in the state where that foot supports the ground (i.e., the supporting foot is in contact with the ground). By observing the alternating states of the left and right feet as supporting feet in multiple consecutive frames, the system can infer the phase distribution of the gait cycle: for example, "left foot support → both feet support → right foot support → both feet support → left foot support" constitutes a complete gait cycle. For frames identified as supporting feet, the system uses a two-bone inverse kinematics solver to precisely position the supporting ankle on the ground plane. The solver's inputs are the hip joint position and the target ankle position, i.e., the projected position on the ground plane. The chain runs from the hip joint to the knee joint to the ankle joint, with simultaneous adjustment of the knee joint angle. The correction strength coefficient is 1.0, ensuring complete alignment with the ground. If both feet are simultaneously identified as supporting feet (i.e., both feet are in contact with the ground at the same time), anchoring correction is performed on both feet.
[0043] The second layer is joint angle limit correction. The system loads the anatomical rotation range parameters of each joint: knee flexion range 0-150 degrees, elbow flexion range 0-145 degrees, hip flexion range 0-125 degrees, shoulder flexion range 0-180 degrees, ankle dorsiflexion range 0-20 degrees, and plantar flexion range 0-50 degrees, etc. The system calculates the current rotation angle frame by frame and joint by joint, detecting whether there are any joints in the first correction sequence whose angles exceed the corresponding range. Taking a frame in this dance video as an example, if the dancer's left knee joint angle reaches 160 degrees, exceeding the legal range of 0-150 degrees, it is considered an upper boundary violation. The system corrects the rotation angle of this joint to the nearest boundary value of 150 degrees. After correction, linear transition interpolation is performed on the three frames before and after to avoid discontinuous jumps between the corrected frame and adjacent frames.
[0044] The third layer is adaptive smoothing. The system calculates the angular velocity of all joints in the body frame by frame and takes the maximum value as the motion intensity index for that frame. For fast motion segments with a motion intensity index higher than 8.0 radians per second, a small window of 3 frames is used for smoothing to preserve motion details to the greatest extent. For slow motion segments with a motion intensity index lower than 2.0 radians per second, a large window of 15 frames is used for smoothing to maximize noise reduction. For medium-speed motion segments with a motion intensity index between the two, the window size is linearly interpolated between 3 and 15 frames and the nearest odd value is taken. The system uses a Savitzky-Golay filter of order 3 to perform polynomial fitting smoothing on the joint trajectories within the window range near the frame under a determined window size.
[0045] The fourth layer is limb clipping correction. The system uses capsule collision detection to check for clipping between bone segments formed by adjacent joints in the third correction sequence. Each limb segment is composed of the line connecting the first and last joints and a radius. The radius is set proportionally to the length of the bone segment: the upper arm radius is 12% of the upper arm length, the forearm radius is 10% of the forearm length, the thigh radius is 15% of the thigh length, the lower leg radius is 12% of the lower leg length, and the torso radius is 20% of the torso length. If clipping between adjacent limb segments is detected, for example, the left forearm clipping through the torso, the system pushes the joints of the two clipping limb segments outward along the direction of the clipping to the nearest position where clipping no longer occurs. The amount of pushing is linearly transitioned within 3 frames before and after to maintain continuity.
[0046] After all four corrections are completed, the system outputs the corrected 3D joint coordinate sequence.
[0047] In this way, the system systematically eliminates physical anomalies such as ground penetration, excessive joint angles, inter-frame jitter, and limb clipping through a four-fold physical constraint correction system, ensuring that the reconstructed 3D motion data conforms to human anatomy and physics. The four corrections are progressively advanced, with the output of the previous correction serving as the input for the next. Each correction is based on the result of the previous one, avoiding the problem that a single correction method cannot cover multiple physical anomalies. At the same time, the generation of correction logs records the frame number, joint, correction type, and correction amount for each correction, providing a traceable basis for anomaly localization in subsequent quality assessments and facilitating users to review the rationality of the correction results.
[0048] Step 104: Perform a quality assessment on the 3D joint coordinate sequence. Once the quality assessment is passed, convert the 3D joint coordinate sequence into a standard skeletal motion format to generate a 3D character universal motion file.
[0049] The 3D joint coordinate sequence is subjected to quality assessment, specifically by calculating the joint position smoothness score, bone length consistency score, ground penetration rate score, and joint angle out-of-bounds rate score of the 3D joint coordinate sequence; a comprehensive score is calculated based on the joint position smoothness score, bone length consistency score, ground penetration rate score, joint angle out-of-bounds rate score, and a preset weighted average; if the comprehensive score is lower than the threshold, the quality assessment is deemed to have failed; when the quality assessment fails, the frame segment with the abnormal score in the 3D joint coordinate sequence is located and the anomaly type is determined; it is checked whether the number of times the physical constraint correction and the quality assessment are repeated exceeds a preset limit; if it exceeds the preset limit, the frame segment is marked as requiring manual confirmation; if it does not exceed the preset limit, the 3D joint coordinate subsequence of the frame segment is extracted, and a corresponding correction strategy is selected according to the anomaly type to perform local correction; the corrected 3D joint coordinate subsequence is merged back into the 3D joint coordinate sequence, the number of times is incremented by 1, and the physical constraint correction and the quality assessment are repeated.
[0050] Combination Figure 7 and Figure 8 Specifically, the system loading quality assessment threshold is configured, and the threshold for meeting the standard is set to 0.85.
[0051] The system calculates quality scores in four dimensions: For joint position smoothness, the system calculates the variance of the acceleration amplitude of each joint throughout the entire sequence, averages the variances of all joints, and converts them into a score of 0 to 1 using an inverse proportional mapping; the smaller the variance, the closer the score is to 1. For bone length consistency, the system calculates the average of the standard deviations of the lengths of all bone segments throughout the entire sequence and converts it into a score of 0 to 1 using an inverse proportional mapping. For ground penetration, the system calculates the proportion of frames where the supporting foot is more than 1 cm below the ground, subtracts this proportion from 1 to obtain the score. For joint angle out-of-bounds rate, the system calculates the proportion of joint frames where the joint angle exceeds the anatomical range, subtracts this proportion from 1 to obtain the score.
[0052] After calculation, the system scored the dance video as follows: smoothness 0.91, bone length consistency 0.87, ground penetration 0.0056 (ground penetration score 0.994), and joint angle violation rate 0.00078 (joint angle violation rate score 0.999). The weights for each dimension were: smoothness 0.25, bone length consistency 0.25, ground penetration 0.30, and joint angle violation rate 0.20. The overall score was 0.943, exceeding the threshold of 0.85. Therefore, the system deemed the quality assessment passed and output a quality assessment report, eliminating the need for reprocessing abnormal segments.
[0053] If the overall quality assessment score of the dance video is below the threshold of 0.85, the system will trigger an anomaly segment localization and reprocessing process. The system receives the quality assessment report and a list of anomaly segments, parses the list of anomaly segments, the time range of each segment, and the anomaly type, and sorts them by anomaly severity. The system first checks if the current reprocessing rounds exceed a preset limit, which defaults to 3 times. If the limit is not exceeded, the system extracts the 3D joint coordinate subsequences of the anomaly frames and selects the corresponding correction strategy based on the anomaly type.
[0054] If the anomaly type is insufficient smoothness, the system increases the filtering window and re-smooths the window. The new window size is the current window size plus 4 frames, but does not exceed the maximum window size of 21 frames.
[0055] If the anomaly type is ground penetration or suspension, the system adjusts the contact detection parameters and performs inverse kinematics correction again. When ground penetration occurs, the contact distance threshold is reduced to 0.5 times the original value, and when ground suspension occurs, the contact distance threshold is increased to 1.5 times the original value, and the inverse kinematics correction strength coefficient is adjusted to 0.8.
[0056] If the anomaly type is joint angle exceeding the limit, the system performs progressive projection correction. The first iteration corrects 40% of the excess, the second iteration corrects 80%, and the third iteration corrects 100%. During the correction, interpolation transition is performed on adjacent frames simultaneously.
[0057] If the anomaly type is limb clipping, the system expands the collision detection range. In each iteration, the radius of the capsule is increased by 20% of the original radius. After clipping is detected, it is eliminated through local posture adjustment.
[0058] After local correction is completed, the system merges the corrected 3D joint coordinate subsequence back into the full sequence, increments the reprocessing round count, returns to step 1033 to re-execute physical constraint correction, and then re-enters step 104 for quality assessment. If the number of reprocessing rounds exceeds the preset limit, the system selects the version with the highest comprehensive score from the initial correction result of round 0 and the reprocessing results of rounds 1 to 3 as the current optimal result output, marks the remaining substandard abnormal segments as requiring manual confirmation, and generates a manual review list, including the time range of the specific substandard abnormal segments, the abnormality type, the score change trend of each round, and the suggested direction for manual correction.
[0059] Combination Figure 9After the quality assessment is passed, the system converts the 3D joint coordinate sequence into a standard skeletal motion format. Based on the hierarchical skeletal structure, the system calculates the local rotation of each joint relative to its parent joint, starting from the root joint (hip center), and representing it as quaternions. The system constructs a standard skeletal motion structure, including the parent-child relationship definition of 17 joints, a T-shaped pose reference pose, the root joint world coordinates for each frame, and the quaternion sequence of local rotations for each joint. The system determines whether to export in multiple formats; the user selects FBX. The system loads the FBX format conversion plugin, serializing the standard skeletal motion structure into an FBX binary file, containing bone definitions, animation curves, and frame rate information. The system verifies the integrity of the output file, checking whether the file header identifier, number of bone nodes, and number of animation frames match expectations. Finally, it generates a 3D character universal motion file in FBX format and a processing report containing source video information, motion duration, frame count, keypoint count, quality score, etc. This FBX file can be directly imported into game engines or animation tools.
[0060] In this way, the system can perform multi-dimensional quantitative evaluation of reconstructed 3D motion data and automatically filter out data that meets quality standards. Export is only performed after the quality meets the standards, ensuring that the final output motion file meets the quality standards of the production environment without the need for manual frame-by-frame review. For segments that do not meet the quality standards, the system can automatically locate and repeatedly correct them, effectively improving the overall usability of the final output motion. Segments that exceed the automatic correction capability are clearly marked through a review checklist, making it easy for users to quickly locate and handle them, significantly reducing the workload of manual correction. The multi-dimensional scoring mechanism evaluates four independent dimensions: smoothness, bone length consistency, ground penetration rate, and joint angle overshoot rate. Each dimension does not interfere with the others, and the weighted comprehensive score can reflect the overall quality level of the motion data. Anomaly type classification and targeted reprocessing strategies avoid blind global retries and improve correction efficiency. The retry limit mechanism ensures finite convergence of the process. After exceeding the limit, the best historical result is selected for output, ensuring that the system can provide usable output results under any circumstances and will not get deadlocked due to infinite loops.
[0061] As described above, this embodiment can automatically convert ordinary 2D videos into standard 3D motion files that can be directly imported into game engines or animation tools, significantly reducing the cost and production cycle of 3D motion resources. By applying constant bone length constraints and physical constraints to the 3D coordinate sequence, physical inconsistencies such as bone stretching, joint angle exceeding limits, ground penetration, and limb clipping in the reconstructed motion are eliminated, ensuring the geometric accuracy and physical rationality of the output motion. Through multi-dimensional quality assessment and abnormal segment location and repeated correction, the overall usability of motion data is effectively improved. Segments exceeding the automatic correction range are clearly marked through a review list, facilitating quick location and processing by users and significantly reducing the workload of manual review and correction.
[0062] Please refer to Figure 10 An embodiment of the present invention provides a video-based 3D character universal motion file generation system 200, including a memory 201, a processor 202, and a computer program stored in the memory and executable on the processor. When the processor 202 executes the computer program, it implements the various steps of the video-based 3D character universal motion file generation method described above.
[0063] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for generating universal motion files for 3D characters based on video, characterized in that, include: The original video is parsed to obtain a video frame sequence, and the target person in the video frame sequence is identified; The coordinates of 2D key points of the target person in each frame of the video frame sequence are detected, and a 2D key point coordinate sequence is generated according to the time sequence. The 2D keypoint coordinate sequence is converted into a 3D keypoint coordinate sequence, and a constant bone length constraint and physical constraint are applied to the 3D keypoint coordinate sequence to obtain a 3D joint coordinate sequence. The 3D joint coordinate sequence is subjected to quality evaluation. Once the quality evaluation is passed, the 3D joint coordinate sequence is converted into a standard skeletal motion format to generate a 3D character universal motion file.
2. The method for generating a universal motion file for 3D characters based on video according to claim 1, characterized in that, Identifying target individuals in the video frame sequence includes: If there are user-specified identification criteria for a target person, the target person is detected and determined based on the identification criteria. Otherwise, detect all characters in each frame of the video frame sequence and take the largest character in each frame as the target character.
3. The method for generating a universal motion file for a 3D character based on video according to claim 1, characterized in that, Detecting the 2D keypoint coordinates of the target person in each frame of the video frame sequence includes: A pyramid feature network is used to extract features from each frame in the video frame sequence, and different resolution levels are obtained based on the extracted features. All 2D key points of the target person are detected at different resolution levels, the coordinates of all 2D key points are obtained, and the confidence of all 2D key points is calculated. If there is a target 2D key point with a confidence level lower than a preset confidence threshold, the target frame where the target 2D key point is located is determined through a preset bidirectional temporal attention mechanism, and the coordinates of the target 2D key point are completed according to the temporal context of the target 2D key point in the adjacent frames of the target frame.
4. The method for generating a universal motion file for a 3D character based on video according to claim 3, characterized in that, Also includes: The attenuation factor is calculated based on the actual number of context frames and the preset standard number of context frames of the boundary frames of the video frame sequence. The attenuation confidence is obtained by multiplying the confidence of all 2D key points in the boundary frames by the attenuation factor. The attenuation confidence level is used as the confidence level of 2D key points in the boundary frame; If the attenuation factor is lower than the preset attenuation threshold, add a single-frame detection marker to the boundary frame; Otherwise, complete the coordinates of 2D keypoints in the boundary frame whose confidence level is lower than the preset confidence threshold; The boundary frame includes a start frame and an end frame.
5. The method for generating a universal motion file for a 3D character based on video according to claim 1, characterized in that, Converting the 2D keypoint coordinate sequence into a 3D keypoint coordinate sequence includes: The 2D keypoint coordinate sequence is divided into multiple windows according to a preset sliding window length. The 2D keypoint coordinate sequence in each window is input into a preset temporal encoder to obtain the 3D coordinates and depth confidence of each 2D keypoint in each frame in each window. A 3D keypoint coordinate sequence is generated based on the 3D coordinates and depth confidence.
6. The method for generating a universal motion file for a 3D character based on video according to claim 1, characterized in that, Applying a constant bone length constraint to the 3D keypoint coordinate sequence includes: Each 3D keypoint in the 3D keypoint coordinate sequence corresponds to a joint, and the line connecting two adjacent 3D keypoints forms a bone segment. Each bone segment includes a parent joint and a child joint. Calculate the median length of each bone segment in all frames of the video frame sequence, and use the median length as the reference length of the corresponding bone segment; Identify bone segments in each frame whose actual length deviates from the reference length by more than a preset deviation threshold. Calculate the corrected coordinates of the child joints based on the coordinates of the parent joint of the bone segment, the direction vector of the bone segment, and the reference length. Update the coordinates of the child joints to the corrected coordinates to obtain the corrected bone segment data for each frame. Based on the corrected bone segment data for each frame, a 3D joint coordinate sequence of skeletal constraints is generated.
7. The method for generating a universal motion file for a 3D character based on video according to claim 6, characterized in that, Applying physical constraints to the 3D keypoint coordinate sequence yields a 3D joint coordinate sequence, including: The gait cycle is determined based on the video frame sequence, the supporting foot in the gait cycle is determined based on the skeletal constraint 3D joint coordinate sequence, and the coordinates of the supporting foot are adjusted to a preset ground plane position to obtain the first correction sequence; Based on the preset rotation angle range of each joint, detect whether there is an over-limit joint in the first correction sequence whose angle exceeds the range. If so, correct the rotation angle of the over-limit joint to the boundary value of the corresponding angle range in the rotation angle range of each joint to obtain the second correction sequence. The joint angular velocity is calculated based on the second correction sequence, and the second correction sequence is smoothed based on the joint angular velocity to obtain the third correction sequence; The system detects whether there is a penetration phenomenon between bone segments formed by adjacent joints in the third correction sequence. If so, it eliminates the penetration phenomenon between bone segments through local posture adjustment to obtain the 3D joint coordinate sequence.
8. The method for generating a universal motion file for a 3D character based on video according to claim 7, characterized in that, The joint angular velocity is calculated based on the second correction sequence, and the second correction sequence is smoothed based on the joint angular velocity to obtain a third correction sequence, including: Calculate the angular velocity of all joints in each frame of the second corrected sequence, and use the maximum value of the angular velocity of all joints in each frame as the motion intensity index of each frame. The window size for smoothing is determined based on the exercise intensity index, and the window size is negatively correlated with the exercise intensity index. The second correction sequence is smoothed according to the window size to obtain the third correction sequence.
9. The method for generating a universal motion file for a 3D character based on video according to claim 1, characterized in that, The quality assessment of the 3D joint coordinate sequence includes: Calculate the joint position smoothness score, bone length consistency score, ground penetration rate score, and joint angle out-of-bounds rate score of the 3D joint coordinate sequence; A comprehensive score is calculated based on the joint position smoothness score, the bone length consistency score, the ground penetration rate score, the joint angle overshoot rate score, and a preset weighted average. If the comprehensive score is lower than the threshold, the quality assessment is deemed to have failed. When the quality assessment fails, locate the frame segment with abnormal scoring in the 3D joint coordinate sequence and determine the type of abnormality; Check whether the number of times the physical constraint correction and the quality assessment are repeated exceeds the preset limit. If the preset limit is exceeded, mark the frame segment as requiring manual confirmation. If the preset upper limit is not exceeded, the 3D joint coordinate subsequence of the frame segment is extracted, the corresponding correction strategy is selected according to the anomaly type to perform local correction, the corrected 3D joint coordinate subsequence is merged back into the 3D joint coordinate sequence, the number is incremented by 1, and the physical constraint correction and quality assessment are performed again.
10. A video-based 3D character universal motion file generation system, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement each step of the video-based 3D character universal motion file generation method according to any one of claims 1 to 9.
