Method for automatic bone binding of three-dimensional model and computer storage medium

By reading the vertex coordinates and data dimensionality reduction technology of the 3D model, the bone point coordinates of the three-dimensional model are automatically determined and the bvh tree file is constructed, which solves the problem of inefficient bone binding in the existing technology and realizes efficient and automated bone binding process.

CN116824039BActive Publication Date: 2024-12-17TIANXIANG RUIYI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310492864.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2024-12-17
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

In the prior art, the bone binding of three-dimensional models requires artificial operation, relying on software, inefficient efficiency, insufficient automation, and inefficient binding of bone information.

Method used

By reading the vertex coordinates in the obj file format of the 3D model, the vertex coordinate range set of bone points is determined based on the extreme points of the human body when standing in T-pose, and the bone points are fitted using data dimensionality reduction and singular value decomposition methods. The center coordinates of the BVH tree file is constructed to realize automated bone binding.

Benefits of technology

The automated bone binding of three-dimensional models is realized, which improves work efficiency and no longer depends on software. Each bone point does not need to be adjusted one by one, which improves the binding speed and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116824039B_ABST
    Figure CN116824039B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of data processing, and specifically discloses a method for automatic bone binding of a three-dimensional model and a computer storage medium, the method comprising: reading the vertex coordinates of the obj file format of the 3D model; finding the extreme points of the three-dimensional coordinates according to the model posture of the human body in a T-pose standing posture, and determining the vertex coordinate range set of the bone points in the three-dimensional space according to the model proportions of different characters; performing data dimensionality reduction in the three-dimensional space for all points in the vertex coordinate range set, fitting an approximate circle, and using the calculated center coordinates of the circle as the center coordinates of the corresponding bone points; constructing a bvh tree file representing the bone information of the three-dimensional model according to the center coordinates of each bone point. The present application solves the defects of low efficiency and insufficient automation in binding human bone information in traditional three-dimensional models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and specifically relates to a method for automatic bone binding of a three-dimensional model and a computer storage medium. Background Art

[0002] After the user has made a CG character model, if he wants to make the character model move, he needs to bind the bones of the CG character model first. The 3D point cloud model created by the 3D modeling equipment is an obj format file. The obj file contains the model vertex coordinates, mapping coordinates, and normal coordinates, but does not contain bone information. It needs to be manually bound using the model software.

[0003] At present, the skeleton binding of 3D models is mostly completed by 3DMAX or Blender (Auto Rig Pro). However, no matter which method is adopted, it is necessary to use 3D model software to find skeleton points through human observation and mouse movement. The current method has the following main defects: ① software dependence; ② each skeleton point needs to be adjusted one by one, which is not automated enough; ③ the movement method is mouse movement and keyboard arrow key movement, which are dependent on human observation and operation and are inefficient.

[0004] Therefore, how to design an automated and efficient method for binding human skeleton information using a three-dimensional model is a technical problem that needs to be solved at present. Summary of the invention

[0005] The purpose of this application is to provide a method that can automatically and efficiently bind human skeleton information using a three-dimensional model.

[0006] In a first aspect of the present application, a method for automatically binding bones of a three-dimensional model is provided, the method comprising: reading vertex coordinates of an obj file format of the 3D model;

[0007] According to the model posture of the human body in T-pose standing posture, find the extreme points of the three-dimensional coordinates, and determine the vertex coordinate range set of the skeleton points in the three-dimensional space according to the model proportions of different characters;

[0008] Perform data dimensionality reduction in three-dimensional space for all points within the vertex coordinate range set, fit an approximate circle, and use the calculated circle center coordinates as the center coordinates of the corresponding bone point;

[0009] Construct a bvh tree file representing the skeleton information of the three-dimensional model based on the central coordinates of each skeleton point.

[0010] Furthermore, the vertex coordinate range set of the skeleton point in the three-dimensional space is determined according to the proportion of the character model, including:

[0011] Determine the initial vertex coordinates of each key bone point based on the relative position of each bone point to the character's height;

[0012] Taking the initial vertex coordinates as the center, data supplementation is performed around them to obtain a vertex coordinate range set of the skeleton points, wherein the vertex coordinate range set is a non-standard circular ring structure in a three-dimensional space.

[0013] Furthermore, fitting an approximate circle in space for all points within the vertex coordinate range set includes:

[0014] The points in the non-standard circular ring structure are decomposed by a singular value decomposition method to obtain an approximate circle in a two-dimensional plane.

[0015] Furthermore, place the character model in the center of the coordinate system, take the maximum value in the y direction as the head vertex, the minimum value in the x direction as the fingertips of the character model's right hand, the maximum value in the x direction as the fingertips of the character model's left hand, the minimum value of y in the negative x direction as the right foot of the character model, the minimum value of y in the positive x direction as the left foot of the character model, and the midpoint of the line connecting the two feet as the origin of the coordinate system of the character model.

[0016] Furthermore, the key skeleton points of the character model selected and measured include head, neck, waist, hip, knee, ankle, shoulder, elbow, and wrist.

[0017] Furthermore, after obtaining the coordinates of a key bone point, the coordinates of other bone points are calculated according to the joint ratio.

[0018] Furthermore, with the initial vertex coordinates as the center, data expansion is performed around them to obtain a vertex coordinate range set of the model, including: according to the position of the key bone point in the three-dimensional coordinate system, vertex data in the corresponding direction is supplemented based on the position, and the corresponding direction is a single x-direction, y-direction, z-direction, or a combination of multiple directions.

[0019] A method for automatically binding bones of a three-dimensional model provided by the present application utilizes the three-dimensional spatial information of the character model file itself and combines it with a data dimensionality reduction method to automatically obtain the coordinates of each bone point. This method does not require reliance on software and does not require each point to be slowly moved with a mouse, thereby improving the work efficiency of bone binding. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Schematic diagram of the process of the method for automatic bone binding of a three-dimensional model in this embodiment.

[0021] Figure 2 It is a schematic diagram of the relationship between character modeling and coordinate system position in this embodiment.

[0022] Figure 3Schematic diagram of the approximate circular ring structure in this embodiment.

[0023] Figure 4 This is a three-dimensional circular stereoscopic display effect diagram of the vertex coordinate range set in this embodiment.

[0024] Figure 5 This is a display effect diagram of converting the vertex coordinates in this embodiment into a two-dimensional circle. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0026] It should be noted that the illustrations provided in this embodiment are only used to schematically illustrate the basic concept of the present invention.

[0027] The structures, proportions, sizes, etc. illustrated in the drawings in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with this technology, and are not used to limit the conditions under which the present invention can be implemented. Any structural modification, change in proportion or adjustment of size should still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0028] Reference Figure 1 to Figure 3 As shown, the first embodiment of the present application provides a method for automatically binding bones of a three-dimensional model, the method comprising:

[0029] Step S1, reading the vertex coordinates of the obj file format of the 3D model;

[0030] Specifically, the obj file is parsed and the vertex coordinates are read. The obj file is a format for recording three-dimensional models, which can be directly opened and edited with txt text. It includes four types of data, namely: v (xyz position coordinates of the vertex), vt (vertex texture coordinates, corresponding to the coordinate position on the map, horizontal direction is U, vertical direction is V range 0-1), vn (vertex normal vector), and f (face, three vertices form a triangular face).

[0031] Step S2: according to the model posture of the human body in the T-pose standing posture, find the extreme value points of the three-dimensional coordinates, and determine the vertex coordinate range set of the skeleton points in the three-dimensional space according to the model proportions of different characters.

[0032] Specifically, we first agree on the character's standing posture, that is, the standard T-pose standing posture, to facilitate the subsequent establishment of the coordinate system. When modeling, we also need to consider the relative position of the human body model and the world space. Figure 2 As shown, when modeling a character, the model is in the middle of the three-dimensional coordinate system, and the 0, 0, 0 point of the spatial coordinate system is the middle. This application sets the center point of the two feet on the same axis to be in the center of the space, and the human body model is in the middle of the spatial position, so as to determine the direction of the top of the head, the soles of the feet, the left and right fingertips in the spatial coordinate system, and determine the position of the back bones. The extreme points here are the highest, lowest, and most edge positions of the human body model. The maximum value in the y direction is the top of the head, the minimum value in the x direction is the right fingertips of the character model in the figure, the maximum value in the x direction is the left fingertips of the character model in the figure, the minimum value of y in the negative x direction is the right foot of the character model, and the minimum value of y in the positive x direction is the left foot of the character model. The midpoint of the line connecting the two feet is the root point of the human body, that is, the origin of the coordinate system.

[0033] Among them, the vertex coordinate range set of the skeleton point in the three-dimensional space determined according to the proportion of the character model includes:

[0034] According to the approximate position of each bone point in the body and its relative height, determine the initial vertex coordinates of each key bone point; Figure 2 For example, Figure 2 In the character model, the length of the left arm: the length of the shoulder: the length of the right arm ≈ 6:4:6. For example, the elbow is approximately at one-half of the arm, the waist is approximately at one-half of the height, and the key bone points such as the head, neck, waist, hip, knee, ankle, etc. are similar. It can be seen that the height, weight, and thinness of the character model are different. The corresponding proportions are set according to the corresponding character height. The position points of the key bone parts of different characters are different in height. By setting the proportions according to the character height, the correctness of the initial vertex coordinates of different bone key points is guaranteed. It should be noted that in this embodiment, unless otherwise specified, the vertex coordinates here specifically refer to the three vertex positions of the triangular face in obj (or other three-dimensional model formats).

[0035] After obtaining the vertex coordinates of a key bone point according to the proportion, the vertex coordinates of the model are extracted, and the data is supplemented around the initial vertex coordinates to obtain the vertex coordinate range set of the bone point, wherein the vertex coordinate range set finally obtained is a non-standard ring structure in a three-dimensional space. Specifically, based on the position of the key bone point in the three-dimensional coordinate system, the data points in the corresponding direction are supplemented based on the position, and the corresponding direction is a single x direction, y direction, z direction, or a combination of multiple directions. For example, taking the wrist point as an example, the wrist of the right hand of the character in the figure is located in the negative direction of the x axis, with the x value as the center, only a little expansion of the range in the x axis direction, so as to obtain more vertex data, y, z are not constrained, that is, all model vertices with x values ​​within the range are taken, and the coordinates of the wrist point finally formed are ((xn, x+n), y, z), n is a point within the extended distance range, of course, for the bone points in different coordinate system positions, the data supplement is not limited to a single direction, but can also be multiple directions. Finally, a set of key skeleton points is obtained, and the set of points constitutes an approximate, non-standard three-dimensional ring structure, such as Figure 3 As shown, Figure 3 What is shown is a partial structure of a cut-off three-dimensional circular ring, which can also be understood as the visual effect formed by observing the circular ring from a certain direction.

[0036] Step S3: perform data dimensionality reduction in three-dimensional space for all points within the vertex coordinate range set, fit an approximate circle, and use the calculated center coordinates of the circle as the center coordinates of the corresponding skeleton point.

[0037] Specifically, in this embodiment, the three-dimensional data is reduced to two-dimensional data, and the three-dimensional space is mapped to the two-dimensional space, so as to facilitate the determination of the center coordinate point of the skeleton. For the points in the non-standard circular ring structure, the singular value decomposition method is used to decompose an approximate circle in the two-dimensional plane, and then the coordinates of the center point of the circle are obtained. Data dimensionality reduction refers to projecting the original data in the high-dimensional space to the low-dimensional space through linear or nonlinear mapping, and this low-dimensional representation is a compact and meaningful representation of the original data. By seeking a low-dimensional representation, the rules hidden behind the high-dimensional data can be discovered as much as possible. Singular value decomposition, the full name is Singular Value Decomposition, referred to as SVD. It is a matrix factorization. By calculating the number of singular values ​​and singular vectors, an approximate matrix that can replace the original matrix is ​​generated, and the singular value representation of the data set is arranged according to importance, and unimportant eigenvectors are discarded, which can be used to achieve the purpose of dimensionality reduction, thereby finding the main components in the data. Of course, those skilled in the art should be able to understand that in this application, singular value decomposition is used to reduce the dimensionality of the position coordinates of the key points of the skeleton contained in the three-dimensional circular ring structure to a two-dimensional space, but it is not limited to this method. Independent component analysis (ICA), principal component analysis PCA, factor analysis FA, linear discriminant analysis LDA, local linear embedding (LLE), kernel principal component analysis (KernelPCA), etc. can also be used.

[0038] like Figure 4 , Figure 5 As shown in the figure, the two-dimensional circle obtained by singular value decomposition. The center of the circle is considered to be the center of the wrist, that is, the coordinates of the wrist bone point.

[0039] Step S4: construct a bvh tree file representing the skeleton information of the three-dimensional model according to the central coordinates of each skeleton point.

[0040] Skeleton points generally include human joints such as head, neck, waist, hip, knee, ankle, shoulder, elbow, wrist, etc. Generally, head, neck, waist, knee, ankle, elbow, wrist can be obtained through the method steps of the embodiment of the present application, and the remaining points can be obtained by calculating the proportion of each joint.

[0041] After obtaining the coordinates of the key points of the whole body, a bvh tree file is constructed. The bvh tree file records the connection and parent-child relationship of the bones. This bvh file is the skeleton file of the model. Specifically, the bvh file contains the character's bone and limb joint rotation data. Bvh is a common human feature animation file format. Nodes represent joints, lines represent trunks, and the various parts of the body form a subtree. The first part of the bvh file defines the joint tree and the name of each joint point, the number of channels, and the relative position between joints, that is, the bone length of each part of the human body is defined. Due to the differences in the human body, people of different ages and different body proportions can be distinguished by changing the relative position value. For each joint, there are three rotation parameters (rotation angles relative to the X, Y, and Z axes) to describe the motion information. As the root joint point of the entire human body, the Hips joint point also contains three-dimensional spatial position parameters, thereby completing a complete description of the human body's motion. The second part of the bvh file records the motion data, defines the duration of the action data (i.e., the number of frames) and the time interval between each frame. Each frame of data is provided according to the joint sequence defined in the first part, recording the position and rotation information of each joint node in each frame. The 3D human body model can reproduce the actions performed by the actor during motion capture by establishing corresponding bone nodes and reading bvh space data, thus realizing the realistic actions of the anime characters in various 3D movie animations.

[0042] This application utilizes the three-dimensional spatial information of the model file itself, and then uses a data dimensionality reduction method to automatically obtain the required bone point coordinates. This method does not require reliance on software, and does not require each point to be slowly moved with a mouse, thereby improving the efficiency of three-dimensional model bone binding.

[0043] Embodiment 2

[0044] Embodiment 2 of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned method for automatically binding bones of a three-dimensional model. The steps of the method for automatically binding bones of a three-dimensional model here can be the steps in the method for automatically binding bones of a three-dimensional model in each of the above-mentioned embodiments: reading the vertex coordinates of the obj file format of the 3D model; finding the extreme points of the three-dimensional coordinates according to the model posture of the human body in a T-pose standing posture, and determining the vertex coordinate range set of the bone points in the three-dimensional space according to the model proportions of different characters; performing data dimensionality reduction in the three-dimensional space for all points in the vertex coordinate range set, fitting an approximate circle, and using the calculated center coordinates of the circle as the center coordinates of the corresponding bone point; and constructing a bvh tree file representing the bone information of the three-dimensional model according to the center coordinates of each bone point.

[0045] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0046] It should be noted that, in the description of this application, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0047] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0048] It should be understood that each part of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be stored in a memory and executed by a suitable instruction execution system. A person skilled in the art can understand that all or part of the steps carried by the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0049] For example, if implemented in hardware, as in another embodiment, it can be implemented using any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0050] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0051] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0052] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0053] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for automatically binding bones of a three-dimensional model, characterized in that: The method comprises: Read the vertex coordinates of the obj file format of the 3D model; According to the model posture of the human body in the T-pose standing posture, find the extreme points of the three-dimensional coordinates, and determine the vertex coordinate range set of the skeleton points in the three-dimensional space according to the model proportions of different characters. The extreme points are the highest, lowest and most edge positions of the human body model; Perform data dimensionality reduction in three-dimensional space for all points within the vertex coordinate range set, fit an approximate circle, and use the calculated circle center coordinates as the center coordinates of the corresponding bone point; Construct a bvh tree file representing the skeleton information of the three-dimensional model according to the central coordinates of each skeleton point; Wherein, determining the vertex coordinate range set of the skeleton points in the three-dimensional space according to the proportion of the character model includes: determining the initial vertex coordinates of each key skeleton point based on the proportional position of each skeleton point relative to the height of the character; taking the initial vertex coordinate as the center, performing data supplementation around it to obtain the vertex coordinate range set of the skeleton point, wherein the vertex coordinate range set is a non-standard ring structure in the three-dimensional space; The step of fitting an approximate circle in space for all points in the vertex coordinate range set includes: decomposing the points in the non-standard circular ring structure by a singular value decomposition method to obtain an approximate circle in a two-dimensional plane; Among them, taking the initial vertex coordinates as the center, data expansion is performed around it to obtain the vertex coordinate range set of the model, including: according to the position of the key bone point in the three-dimensional coordinate system, vertex data in the corresponding direction is supplemented based on the position, and the corresponding direction is a single x-direction, y-direction, z-direction, or a combination of multiple directions.

2. The method for automatic bone binding of a three-dimensional model according to claim 1, characterized in that: Place the character model in the center of the coordinate system, take the maximum value in the y direction as the head vertex, the minimum value in the x direction as the fingertips of the character model's right hand, the maximum value in the x direction as the fingertips of the character model's left hand, the minimum value in the y direction in the negative x direction as the right foot of the character model, the minimum value in the y direction in the positive x direction as the left foot of the character model, and the midpoint of the line connecting the two feet as the origin of the character model's coordinate system.

3. The method for automatic bone binding of a three-dimensional model according to claim 1, characterized in that: The key bone points of the character model selected and measured include head, neck, waist, hip, knee, ankle, shoulder, elbow and wrist.

4. The method for automatic bone binding of a three-dimensional model according to claim 3, characterized in that: After obtaining the coordinates of a key bone point, the coordinates of other bone points are calculated based on the joint ratio.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.