A method for converting 3D bone point data into BVH data
Through the optimized data processing flow and modular method, the complexity of converting 3D bone point data into BVH data is solved, and simple operational conversion on multiple data sources and low-performance platforms is realized, which is suitable for multi-platform applications.
Patent Information
- Application Number
- CN202210731287.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2042-06-24
AI Technical Summary
In the prior art, the process of converting 3D bone point data into BVH data is complicated, and the technically restored operation is not strong, making it difficult to apply on multi-data sources and low-performance platforms.
Five modules are adopted, including BVH template import and bone tree definition, data import and preprocessing, skeleton matching and three-dimensional vectorization, association vector and coordinate system generation, and BVH data generation and export. Through data processing, ergonomics, image processing and other technologies, data is optimized and BVH data is generated.
It realizes the conversion of 3D bone point data with simple computing and strong operability on multi-data sources and low-performance platforms to BVH data, meeting the needs of multi-platform applications.
Smart Images

Figure CN115098460B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for converting 3D bone point data into BVH (BioVision Motion Capture) data, and in particular to a method for converting 3D bone point data into universal skeleton drive data, belonging to the field of 3D virtual anthropomorphic image motion capture. Background Art
[0002] BVH (BioVision Motion Capture) is a human motion capture file format developed by BioVision. This file uses nodes as its core elements and records the motion of the human skeleton over several consecutive frames. With the advancement and application of sensing technology and machine learning, the application of real-time human motion capture is becoming increasingly common. An increasing number of manufacturers are adopting real-time skeletal drive technology in applications such as digital virtual humans, gesture control, and digital anchors, making rendered characters more three-dimensional and vivid, and the interactive process more humane and intelligent.
[0003] In the prior art, there are two main data acquisition methods for robot motion capture, one is inertial motion capture using a dedicated motion operating device, and the other is video motion capture using a video collector based on machine learning. However, both methods have problems such as a complex conversion process and poor technical restoration operability. To this end, those skilled in the art have conducted relevant research on this. For example, CN104680570B discloses a video-based motion capture system and method, which involves a complete motion capture process based on a video stream, but the conversion process from 3D vertex data to BVH data is complex, and the technical restoration also lacks operability. Another example is a motion data conversion method based on a structural decomposition method disclosed in CN102842146B, which involves an optimization algorithm for converting vectors to bone rotation angles. Since it does not involve the data preprocessing process, it does not involve the engineering implementation process of BVH, and cannot achieve a complete conversion of 3D bone point data to BVH.
[0004] In summary, in the 3D bone point data conversion BVH, how to provide a method with simple calculation and strong operability to meet the characteristics of multiple data sources and low-performance platform applications is a problem to be solved by those skilled in the art. Summary of the Invention
[0005] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method for converting 3D bone point data into BVH data, that is, to solve the problems of the existing complex conversion process and poor technical restoration operability in the process of converting 3D bone point data into universal skeleton drive data.
[0006] The present invention provides a method for converting 3D bone point data into BVH data, which comprises five modules: BVH template import and skeleton tree definition, data import and preprocessing, skeleton matching and three-dimensional vectorization, association vector and coordinate system generation, and BVH data generation and export. The method performs the following steps:
[0007] S1. Import 3D bone point data into the BVH template to generate a template tree. Combined with the output data requirements, the template tree is parsed to generate a predefined BVH tree. The BVH predefined frame rate and data accuracy are set.
[0008] S2. Importing the human bone point data collected by the processing system into the data import and preprocessing module, and performing validity screening, waveform screening and prediction, time curve smoothing on the imported data, filling in missing data according to the BVH structure, and generating usable preprocessed data;
[0009] S3. According to the BVH tree definition, the processed data points are associated with the skeleton nodes, and the bone point data of all associated relationships are vectorized to generate a one-to-one key vector corresponding to the skeleton data;
[0010] S4. Determine the key vector coordinate system tree according to the BVH tree, determine the base vectors of all coordinate system trees according to the human body structure and historical data, modify the base vectors, and construct the coordinate system tree according to the generated base vectors;
[0011] S5. Determine the reference displacement coordinates based on the 3D preprocessed data, reversely restore the coordinate system tree to a rotation Euler tree, write the reference coordinates and the rotation coordinate tree into the BVH template, and then export the data.
[0012] Furthermore, the step S1 also includes: the original BVH template file bm can be generated by deleting the data entity part based on the standard BVH file, and the node name and node structure in bm can be customized and trimmed according to the requirements of the skeleton object to be driven to reduce the data volume.
[0013] Furthermore, step S2 also includes: having 3D bone point estimation data imported by the user through inertial motion capture or generated by machine learning, screening, filtering, deburring, smoothing and other processing on the data through a data preprocessing module to generate raw data to be converted.
[0014] Furthermore, step S4 also includes: vectorizing the original data to be converted to generate vector data according to the skeleton definition, structuring the human body structure and BVH tree definition, generating a node coordinate system, restoring the Euler angle of the child coordinate system rotation in the parent coordinate system, and finally importing the BVH template to generate BVH data.
[0015] The present invention also provides an application of the BVH data converted by the method of the present invention, which is applied to 3D bone point data conversion of multiple data sources and low-performance platforms.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] 1. The present invention uses data processing, human body engineering, image processing and other related technologies, through data optimization, screening, vertex vectorization, skeleton matching, endpoint data construction and BVH template import, to achieve functions such as BVH target generation. According to the 3D skeleton point data collected by video acquisition or inertial motion compensation, it is converted into skeleton-driven data BVH. It has the characteristics of simple calculation and strong operability, and can meet the application of multiple data sources and low-performance platforms.
[0018] 2. The present invention provides a practical conversion method from 3D bone point data to BVH data. The method includes the following steps: a user imports 3D bone point estimation data generated by inertial motion capture or machine learning, and performs screening, filtering, deburring, smoothing and other processing on the data through a data preprocessing module to generate raw data to be converted; the raw data to be converted is then vectorized to generate vector data according to the bone definition, the human body structure and BVH tree definition are constructed, a node coordinate system is generated, the Euler angle of the child coordinate system rotation is restored in the parent coordinate system, and finally the BVH template is imported to generate BVH data.
[0019] 3. This invention implements a comprehensive, cross-programmable, and engineerable method for converting 3D bone sequence data into BVH data. This method balances ease of implementation with a lightweight algorithm, achieving an effective balance between final results and timeliness. With a short conversion time, the corresponding function can be implemented on multiple platforms, including car computers, mobile phones, and PCs. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a module diagram for converting 3D bone point data into BVH data in the present invention;
[0021] Figure 2 Flowchart of the method for converting 3D bone point data into BVH data of the present invention;
[0022] Figure 3 Flow chart of data preprocessing in the method of the present invention;
[0023] Figure 4 A schematic diagram of vertex vector construction in the method of the present invention;
[0024] Figure 5 A sequence diagram for constructing three-dimensionalization in the method of the present invention;
[0025] Figure 6 It is a data flow diagram in the method of the present invention;
[0026] Figure 7 Schematic diagram of node data completion in the method of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention are further clearly and completely described below in conjunction with the embodiments and drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0028] The main terms in this invention are explained as follows:
[0029]
[0030]
[0031]
[0032] Example 1:
[0033] See also Figure 1 and Figure 2 A method for converting 3D bone point data into BVH data consists of five modules (programs): BVH template import and skeleton tree definition, data import and preprocessing, skeleton matching and 3D vectorization, association vector and coordinate system generation, and BVH data generation and export. The following steps are performed:
[0034] S1. BVH template import and skeleton tree definition: import 3D bone point data into the BVH template to generate a template tree, parse and generate a predefined BVH tree from the template tree based on the output data requirements, and set the BVH predefined frame rate and data accuracy;
[0035] S2. Data import and preprocessing: The human bone point data collected by the processing system is imported into the data import and preprocessing module, and the imported data is screened for validity, waveform screening and prediction, time curve smoothing is performed, missing data is supplemented according to the BVH structure, and usable preprocessed data is generated;
[0036] S3. Skeleton matching and 3D vectorization: According to the BVH tree definition, the processed data points are associated with the skeleton nodes, and the bone point data of all associated relationships are vectorized to generate a one-to-one key vector corresponding to the skeleton data;
[0037] S4. Generate associated vectors and coordinate systems: Determine the key vector coordinate system tree based on the BVH tree, determine the base vectors of all coordinate system trees based on the human body structure and historical data, modify the base vectors, and construct the coordinate system tree based on the generated base vectors;
[0038] S5. BVH data generation and export: Determine the reference displacement coordinates based on the 3D preprocessed data, reversely restore the coordinate system tree to a rotated Euler tree, write the reference coordinates and the rotated coordinate tree into the BVH template, and then export the data.
[0039] The five modules work together, where S1 defines the input and output formats, S2 performs raw data input and preprocessing, S3 and S4 are the core calculation processes, and the 3D point data processed by S2 is three-dimensionalized. S5 normalizes the generated data and outputs it to the target format for application by relevant parties.
[0040] Furthermore, the method of converting 3D bone point data into BVH data of the present invention comprises the following steps:
[0041] S1. BVH template import and skeleton tree definition module:
[0042] S11, import the original BVH template file bm from the storage system or data stream into the system, deserialize and parse it, read the accuracy, frame rate, and effective channels, and generate the original BVH tree b0 in the system;
[0043] S12, clone b0 to generate a new operational BVH record tree bt;
[0044] S13. According to actual needs, analyze the differences between the record tree bt and the required skeleton nodes, add or remove nodes from the operable BVH tree bt, adjust the node structure, and rename it so that the new BVH structure covers the requirements;
[0045] S14. Determine the precision dd of the generated object based on the actual required data, record the frame rate dr, and the valid channels dt. Record the determined data into the operational BVH record tree bt, and clone bt to the read-only target BVH tree b1.
[0046] S15. Define the required data point structure d3d_s based on the read-only target BVH tree b1.
[0047] S2. Data import and preprocessing module:
[0048] See also Figure 3 ,Data preprocessing flow chart, data enters from acquisition data, output to conversion process.
[0049] S21, access the bone point data collected from the data acquisition device in the form of data stream or file, push it into the original 3D point data queue d3d_o_q in chronological order, and import the data acquisition structure definition d3d_o_s;
[0050] S22. Pop candidate data d3d_o from the original 3D point data queue d3d_o_q, determine the number of invalid data in d3d_o, and discard the data if the initial frame number is less than the predicted reference frame number threshold fdn and the number of invalid data is greater than 0. If the initial frame number is greater than the predicted reference frame number threshold fdn and the number of invalid data is greater than or equal to the invalid data discarding threshold edn, discard the data. If neither of the above two conditions is met, the data validity verification passes, and the data to be corrected d3d_p1 is generated.
[0051] S23. Using the predicted reference frame number threshold fdn as the base frame number, median filtering is performed on the fdn number of frames and historical data, and the resulting value t1 is taken to remove data glitches. Using the predicted reference frame number threshold fdn as the base frame number, Kalman filtering is performed on the fdn number of frames and historical data, and the resulting value t2 is taken to reduce data jitter. All combinations of t2 are combined to form the data to be repaired d3d_p2;
[0052] S24. According to the read-only target BVH tree b1, the required data point structure d3d_s is compared with the data collection data point structure d3d_o_s, d3d_p2 is rearranged, and the missing data points are supplemented to generate the data to be beautified d3d_p3.
[0053] S25. The data to be beautified d3d_p3 is taken as the prediction reference frame number threshold fdn, and the median filter is applied to the historical data of the number fdn frames. The result value t3 is taken and the data to be beautified is smoothed according to the historical data. The available data d3d_l is obtained.
[0054] S26. Create a new vertex tree ptree based on the read-only target BVH tree b1 and the required data point structure d3d_s. The child node structure of the tree corresponds to the node structure of b1. Each node stores the rotation root data point of the bone corresponding to the node in b1. If a node has no corresponding vertex data, the value is set to null.
[0055] S3, skull matching and 3D vectorization module:
[0056] S31. Create a new vector tree vtree based on the data point structure d3d_s. The storage content is to select the relevant nodes of ptree to construct the vector structure v3d_o. The nodes store the vector starting point d3d_s_bp1 and the end point d3d_s_bp2.
[0057] S32. Traverse ptree and construct vectors for node data, with the bone starting point d3d_s_bp1 as the vector starting point and the bone end point d3d_s_bp2 as the vector end point.
[0058] See also Figure 4 The vector construction criteria shown, where the circles represent the 3D positions of the skeleton nodes after optimization, and the arrows represent the generated vectors (including the starting point, end point, and direction);
[0059] S4, correlation vector and coordinate system generation module:
[0060] S41. Construct a coordinate system tree ctree based on the read-only target BVH tree b1, ptree, and vtree. The node structure is consistent with that of b1. Storage content 1 is the coordinate system object bc_w of the node bone corresponding to b1 with the world coordinate system as the parent coordinate system. Storage content 2 is the local coordinate system object bc_p of the parent node coordinate system of the node bone corresponding to b1.
[0061] See also Figure 5 The main process of the three-dimensional construction sequence is to start from the center of gravity and move towards the limbs.
[0062] S42. Traverse ctree. When the node is not empty, calculate and determine the three basis vectors (cx, cy, cz) of each coordinate system bc_w of ctree based on ergonomics and the initial BVH pose type, and take the starting point of the node vector corresponding to ptree as the starting point of bc_w.
[0063] S43. Traverse ctree and complete the content of empty nodes: When the child nodes of a node are empty, search downward until the child nodes are non-empty, interpolate the three basis vectors of the current node bc_w with the number of empty nodes, fill them with empty nodes bc_w respectively, and calculate the starting coordinates of each empty node by the average.
[0064] S44, traverse ctree, take the predicted reference frame number threshold fdn as the base frame number, apply median filtering to the historical data of the bc_w basis vector with the same position as the fdn frame number, and take the result value to correct the bcw basis vector.
[0065] S45. Traverse ctree. When the node is not empty, normalize the basis vector of the node bc_w. At the same time, bc_w is converted into a vector of the coordinate system constructed based on the non-empty parent node bc_w of the node based on the three basis vectors of the world coordinate system, forming the three basis vectors (cx1, cy1, cz1) of the local coordinate system bc_p of the node. The starting point of bc_w is converted to the coordinate point of the coordinate system constructed by the non-empty parent node bc_w of the node as the starting point of bc_p.
[0066] S5. BVH data generation and export module:
[0067] S51. Construct a rotation tree rtree based on the read-only target BVH tree b1 to record the Euler angles of the corresponding nodes of the read-only target BVH tree b1.
[0068] S52. Traverse the ctree and convert all parentless nodes bc_p into quaternion angles aq, convert aq into Euler angles ao. Write the corresponding nodes in the rtree. Convert the root node bw_p into quaternion angles aq1, and convert aq into Euler angles ao1.
[0069] S53 , extract the data of the ptree root node d3d_s_bp1 , which is the target data root node position data p0 .
[0070] S54. Traverse ctree and subtract the initial offset of the corresponding node in the read-only target BVH tree b1 from the starting data of node bc_p to obtain the target child node offset data pn.
[0071] S55, traverse rtree, and rotate the data of all nodes to the read-only target BVH tree b1 target child node rotation data rn.
[0072] S56 , write the root node position data p0 , the child node offset data pn , and the child node rotation data rn into the operable BVH record tree bt .
[0073] S57. Build a BVH recorder t_recorder.
[0074] S58. Serialize the target BVH tree bt through t_recorder and export the BVH data file.
[0075] See also Figure 6 , which describes the data objects, data flows and association relationships generated by all operation processes in the entire embodiment 1.
[0076] Example 2:
[0077] In step S1 of the present invention, the original BVH template file bm can be generated by deleting the data entity portion from a standard BVH file. The node names and node structures within bm can be customized and trimmed to reduce the data volume based on the requirements of the skeletal object to be driven. The template data accuracy can be customized based on the performance of the operating platform of the object to be driven to improve the platform's operating efficiency.
[0078] The present invention applies a large amount of 3D mathematics-related knowledge in its implementation. Therefore, a basic 3D mathematics library can be implemented before the implementation process S21. Its content includes the abstraction of vectors, matrices, coordinate systems, quaternions, and 3D operations. According to the implementation language characteristics, it can be abstracted into classes or structures. The same applies to the addition, subtraction, multiplication, division, and conversion operations involved. These two can greatly improve the operating efficiency.
[0079] Example 3:
[0080] Based on Example 1, in step S21, the original 3D point data queue d3d_o_q can be implemented using a queue or asynchronous queue data structure. Here, multiple threads can be opened for batch processing based on language characteristics, which can significantly speed up the program execution.
[0081] In step S22, a larger value for the predicted reference frame number threshold, fdn, results in smoother data and greater computational pressure. A smaller value, fdn, results in poorer prediction smoothing and less computational pressure. Testing has shown that an fdn of no less than 5 and no greater than 7 achieves a balance between performance and effectiveness on mobile platforms. A smaller value for the invalid data discard threshold, edn, in S22 results in lower data cropping quality but higher data error rates. A higher edn value results in higher data cropping quality but lower data retention, potentially causing jitter in output data. Testing has shown that an edn value of approximately 25% of the total collected data volume achieves a relatively good balance.
[0082] The vertex tree ptree, vector tree vtree, coordinate tree ctree, and rotation tree rtree are based on the read-only target BVH tree b1 structure. When initially filling in data, due to inconsistent data structures, they can be filled with empty data. In the subsequent processing, see Figure 7 As shown in the figure, according to the actual needs and the difference between the collected data, the missing data are supplemented with virtual data and the corresponding nodes are filled in with virtual data.
[0083] Example 4:
[0084] Based on Examples 1, 2 or 3, in S58, the BVH recorder t_recorder can have two data output modes. Mode 1 is to write batch-processed data and skeleton definitions as a complete BVH file. Mode 2 is to input the conversion data of each frame in array form based on the original data of each frame, and drive the 3D character to perform actions in real time.
[0085] The method for converting 3D bone point data into BVH data of the present invention comprises a BVH template import and skeleton tree definition module, a data import and preprocessing module, a skeleton matching and three-dimensional vectorization module, an associated vector and coordinate system generation module, and a BVH data generation and export module. Through data processing, human body engineering, image processing and other related technologies, data optimization, screening, vertex vectorization, skeleton matching, endpoint data construction and BVH template import are performed to achieve functions such as BVH target generation. Among them, the present invention is a practical conversion method from 3D bone point data to BVH, which has the following features: a user imports 3D bone point estimation data generated by inertial motion capture or machine learning, and the data is screened, filtered, deburred, smoothed and other processes are performed on the data by the data preprocessing module to generate raw data to be converted; the raw data to be converted is then vectorized according to the skeleton definition to generate vector data, the human body structure and BVH tree definition are constructed, a node coordinate system is generated, the child coordinate system is restored in the parent coordinate system to rotate the Euler angle, and finally the BVH template is imported to generate BVH data.
[0086] The present invention converts 3D skeleton point data collected by video capture or inertial motion compensation into skeleton drive data BVH, has the characteristics of simple calculation and strong operability, and can meet the application of multiple data sources and low-performance platforms.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit the technical solutions. Those skilled in the art should understand that modifications or equivalent replacements of the technical solutions of the present invention that do not depart from the purpose and scope of the technical solutions of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for converting 3D bone point data into BVH data, characterized in that: The following steps are performed by five modules: BVH template import and skeleton tree definition, data import and preprocessing, skeleton matching and 3D vectorization, association vector and coordinate system generation, and BVH data generation and export: S1. Import 3D bone point data into the BVH template to generate a template tree. Combined with the output data requirements, the template tree is parsed to generate a predefined BVH tree. The BVH predefined frame rate and data accuracy are set. S2. Importing the human bone point data collected by the processing system into the data import and preprocessing module, and performing validity screening, waveform screening and prediction, time curve smoothing on the imported data, filling in missing data according to the BVH tree, and generating usable preprocessed data; S3. According to the BVH tree definition, the processed data points are associated with the skeleton nodes, and the bone point data of all associated relationships are vectorized to generate a one-to-one key vector corresponding to the skeleton data; S4. Determine the key vector coordinate system tree according to the BVH tree, determine the base vectors of all coordinate system trees according to the human body structure and historical data, modify the base vectors, and construct the coordinate system tree according to the generated base vectors; S5. Determine the reference displacement coordinates based on the 3D preprocessed data, reversely restore the coordinate system tree to a rotation Euler tree, write the reference coordinates and the rotation coordinate tree into the BVH template, and then export the data.
2. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S1 specifically includes: S11, import the original BVH template file bm from the storage system or data stream into the BVH template import and skeleton tree definition module, perform deserialization analysis, read the accuracy, frame rate and effective channels, and generate the original BVH tree b0 in the system; S12, clone b0 to generate a new operational BVH record tree bt; S13. According to actual needs, analyze the differences between the record tree bt and the required skeleton nodes, add or remove nodes from the operable BVH tree bt, adjust the node structure, and rename it so that the new BVH structure covers the requirements; S14. Determine the precision dd of the generated object based on the actual required data, record the frame rate dr, and the effective channel dt; record the determined data into the operable BVH record tree bt, and clone bt to the read-only target BVH tree b1; S15. Define the required data point structure d3d_s based on the read-only target BVH tree b1.
3. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S2 specifically includes: S21, access the 3D bone point data collected from the data acquisition device in the form of data stream or file, push it into the original 3D point data queue d3d_o_q in chronological order, and import the data acquisition structure definition d3d_o_s; S22. Extract candidate data d3d_o from the original 3D point data queue d3d_o_q in the order they were queued, determine the number of invalid data in d3d_o, and discard the data if the initial frame number is less than the predicted reference frame number threshold fdn and the number of invalid data is greater than 0. If the initial frame number is greater than the predicted reference frame number threshold fdn and the number of invalid data is greater than or equal to the invalid data discarding threshold edn, discard the data. If neither of the above two conditions is met, the data validity verification passes, and the data to be corrected d3d_p1 is generated. S23. Using the predicted reference frame number threshold fdn as the base frame number, median filtering is performed on the historical data with the number of frames fdn being collocated, and the result value t1 is obtained to remove data burrs. Using the predicted reference frame number threshold fdn as the base frame number, Kalman filtering is performed on the historical data with the number of frames fdn being collocated with the number t1 being collocated, and the result value t2 is obtained to reduce data jitter. All t2 combinations are taken to form the data to be repaired d3d_p2. S24. Compare the required data point structure d3d_s and the data collection data point structure d3d_o_s according to the read-only target BVH tree b1, rearrange d3d_p2, fill in the missing data points and generate the data to be beautified d3d_p3; S25, taking the predicted reference frame number threshold fdn as the basic frame number, the data to be beautified d3d_p3 is subjected to median filtering on the historical data of the number of frames fdn, and the result value t3 is obtained, and the data to be beautified is smoothed according to the historical data; and the available data d3d_l is obtained; S26. Create a new vertex tree ptree based on the read-only target BVH tree b1 and the required data point structure d3d_s. The child node structure of the tree corresponds to the b1 node structure. Each node stores the rotation root data point of the bone corresponding to the node b1. When a node has no corresponding vertex data, the value is assigned to be empty.
4. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S3 specifically includes: S31. Create a new vector tree vtree based on the data point structure d3d_s. The storage content is to select the relevant nodes of ptree to construct the vector structure v3d_o. The nodes store the vector starting point d3d_s_bp1 and the end point d3d_s_bp2. S32. Traverse ptree and construct vectors for node data, with the bone starting point d3d_s_bp1 as the vector starting point and the bone end point d3d_s_bp2 as the vector end point.
5. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S4 specifically includes: S41. Construct a coordinate system tree ctree based on the read-only target BVH tree b1, ptree, and vtree. The node structure is consistent with that of b1. Storage content 1 is the coordinate system object bc_w of the node bone corresponding to b1 with the world coordinate system as the parent coordinate system. Storage content 2 is the local coordinate system object bc_p of the parent node coordinate system of the node bone corresponding to b1. S42. Traverse the ctree. When the node is not empty, calculate and determine the three basis vectors (cx, cy, cz) of each coordinate system bc_w in the ctree based on ergonomics and the initial BVH pose type. Take the starting point of the vector corresponding to the ptree node as the starting point of bc_w. The three basis vectors (cx, cy, cz) are vector expressions of the x, y, and z axes of the node coordinate system based on the world coordinate system. S43. Traverse ctree and complete the content of empty nodes: when the child nodes of a node are empty, search downward until the child nodes are non-empty, interpolate the three basis vectors of the current node bc_w with the number of empty nodes, fill them with empty nodes bc_w respectively, and calculate the starting coordinates of each empty node by the mean; S44, traverse ctree, take the predicted reference frame number threshold fdn as the basic frame number, apply median filtering to the historical data of the bc_w basis vector of the fdn number of frames, and take the result value to correct the bcw basis vector; S45. Traverse ctree. When the node is not empty, normalize the basis vector of the node bc_w. At the same time, bc_w is converted into a vector of the coordinate system constructed based on the non-empty parent node bc_w of the node based on the three basis vectors of the world coordinate system, forming the three basis vectors (cx1, cy1, cz1) of the local coordinate system bc_p of the node. The starting point of bc_w is converted to the coordinate point of the coordinate system constructed by the non-empty parent node bc_w of the node as the starting point of bc_p. Among them, the three basis vectors (cx1, cy1, cz1) are the vector expressions of the x, y, and z axes of the node coordinate system based on the world coordinate system of the parent node.
6. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S5 specifically includes: S51. Construct a rotation tree rtree based on the read-only target BVH tree b1, and record the Euler angles of the corresponding nodes of the read-only target BVH tree b1; S52. Traverse ctree, convert all parentless nodes bc_p into quaternion angle aq, convert aq into Euler angle ao; write to the corresponding node of rtree; convert the root node bw_p into quaternion angle aq1, and convert aq into Euler angle ao1; S53, extract the ptree root node d3d_s_bp1 data, which is the target data root node position data p0; S54, traverse ctree, subtract the initial offset of the corresponding node in the read-only target BVH tree b1 from the starting data of node bc_p, and get the target child node offset data pn; S55, traverse rtree, and rotate all nodes to read-only target BVH tree b1 target child node rotation data rn; S56, write the root node position data p0, the child node offset data pn, and the child node rotation data rn into the operable BVH record tree bt; S57, build BVH recorder t_recorder; S58. Serialize the target BVH tree bt through t_recorder and export the BVH data file.
7. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S2 also includes: having the 3D bone point estimation data imported by the user through inertial motion capture or generated by machine learning, screening, filtering, deburring, smoothing and other processing on the data through a data preprocessing module to generate raw data to be converted.
8. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S4 also includes: vectorizing the original data to be converted to generate vector data according to the skeleton definition, structuring the human body structure and BVH tree definition, generating a node coordinate system, restoring the Euler angle of the child coordinate system in the parent coordinate system, and finally importing the BVH template to generate BVH data.
9. The method for converting 3D bone point data into BVH data according to claim 1, characterized in that: The step S1 further includes: generating an original BVH template file bm by deleting the data entity part on the basis of the standard BVH file, and customizing and trimming the node names and node structures in bm according to the requirements of the skeletal object to be driven.
10. The method for converting 3D bone point data into BVH data according to claim 3, characterized in that: In step S21 , the original 3D point data queue d3d_o_q is implemented using a queue or asynchronous queue data structure.
11. The method for converting 3D bone point data into BVH data according to claim 3, characterized in that: In step S22, the larger the value of the predicted reference frame number threshold fdn, the smoother the data and the greater the calculation pressure. The smaller the fdn, the worse the prediction smoothing effect and the smaller the calculation pressure. According to tests, when fdn is not less than 5 and not greater than 7, a balance between performance and effect can be achieved on the mobile platform.
12. The method for converting 3D bone point data into BVH data according to claim 6, characterized in that: In S58, the BVH recorder t_recorder has two data output modes. Mode 1 is to write the batch processed data and skeleton definitions into a complete BVH file; Mode 2 is to input the conversion data of each frame in array form based on the original data of each frame, and drive the 3D character to perform actions in real time.
13. An application of a method for converting 3D bone point data into BVH data, characterized in that: The BVH data obtained by conversion using the method described in any one of claims 1 to 12 is applied to 3D bone point data conversion of multiple data sources and low-performance platforms.
Citation Information
Patent Citations
Motion data conversion method based on structure decomposition method
CN102842146B
A video-based motion capture system and method
CN104680570B
A human motion description method based on an inertial sensor
CN109741371A