Facial skeleton binding information generation method and device, equipment, medium and product
The linear calculation method simplifies facial bone binding, solves the problems of high complexity and inefficiency caused by nonlinear calculation in the prior art, and achieves a more efficient bone binding effect.
Patent Information
- Application Number
- CN202411074817.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, the automatic binding of facial bones depends on nonlinear calculation, resulting in high computational complexity, low efficiency, and wasted computing resources.
The linear calculation method is used to solve the position of the bone joint node of the template model to the bone joint node of the role model. Through topological reconstruction and skin grid information, the local coordinates and binding information of the bone joint node are calculated to simplify the calculation complexity.
It significantly reduces the computational complexity, improves the efficiency and effect of facial bone binding, and saves computing resources.
Smart Images

Figure CN118967933A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device, equipment, medium and product for generating facial skeleton binding information. Background Art
[0002] At present, digital-related applications are becoming increasingly popular, and there are quite a lot of digital humans of different styles and sizes on the market. In order for digital humans to present realistic facial details in animation scenes, it is usually necessary to bind facial bones and skin.
[0003] However, the inventors found that the prior art has at least the following problems: the manual binding of facial bones is highly dependent on the professional skills and literacy requirements of professional artists, and requires high costs. In order to reduce the reliance on manual labor, an automatic binding method for facial bones is adopted. However, the prior art performs nonlinear calculations on the rotation matrix of the bones, which results in large amount of calculations, long solution time, and waste of computing resources. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method, device, equipment, medium and product for generating facial skeleton binding information, which uses a linear calculation method to solve the positions of the skeleton joint points of the template model to the skeleton joint points of the character model, significantly reducing the complexity of the calculation and improving the binding efficiency and binding effect of the facial skeleton of the character model.
[0005] To achieve the above object, an embodiment of the present invention provides a method for generating facial skeleton binding information, comprising:
[0006] Acquire a three-dimensional facial model and a preset template model matching the three-dimensional facial model;
[0007] Based on the three-dimensional facial model, topologically reconstructing the template model to obtain a character model to be processed;
[0008] According to the skin mesh of the character model and the binding information of the skeleton joint points of the template model, the positions of the skeleton joint points of the character model are linearly calculated to obtain the binding information of the skeleton joint points of the character model.
[0009] As an improvement of the above solution, the binding information includes the local coordinates of the skeletal joint points;
[0010] The step of performing linear calculation on the positions of the skeleton joint points of the character model according to the binding information of the skin mesh of the character model and the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model comprises:
[0011] Dividing the skeleton joint points of the character model into first skeleton joint points attached to the skin mesh of the character model and second skeleton joint points not attached to the skin mesh of the character model;
[0012] Calculate the world coordinates of the first skeletal joint point according to the skin mesh of the character model;
[0013] Determine the parent-child relationship triangle of each skeletal joint point in the character model, and calculate the world coordinates of the second skeletal joint point according to the parameter information corresponding to the parent-child relationship triangle on the template model;
[0014] The local coordinates of the skeleton joint points of the character model are calculated according to the world coordinates of the skeleton joint points of the character model.
[0015] As an improvement of the above scheme, the determining of the parent-child relationship triangle of each skeletal joint point in the character model and calculating the world coordinates of the second skeletal joint point according to the parameter information corresponding to the parent-child relationship triangle on the template model includes:
[0016] Determine a parent-child relationship triangle including at least one of the second skeletal joint points in each skeletal joint point of the character model; wherein the parent-child relationship triangle is formed by three skeletal joint points of the character model;
[0017] Determine the normal vector and parent-child angle corresponding to the parent-child relationship triangle on the template model according to the binding information of the skeleton joint points of the template model;
[0018] According to the normal vector and the parent-child angle, a Rodriguez rotation formula is calculated to obtain a linear relationship between the bone joint points in the parent-child relationship triangle;
[0019] According to the linear relationship, the world coordinates of the second skeletal joint point in the parent-child relationship triangle are calculated.
[0020] As an improvement of the above solution, the local coordinates of the skeletal joint points of the character model are calculated according to the world coordinates of the skeletal joint points of the character model, including:
[0021] Assigning the local rotation matrix of the skeleton joint points of the template model to the skeleton joint points of the character model;
[0022] The local coordinates of the skeletal joint points of the character model are calculated using forward kinematic equations according to the world coordinates of the skeletal joint points of the character model and the local rotation matrix.
[0023] As an improvement of the above solution, the step of calculating the world coordinates of the first skeletal joint point according to the skin mesh of the character model includes:
[0024] The first skeletal joint points are matched with points on the skin mesh of the character model, and the world coordinates of the corresponding first skeletal joint points are obtained according to the world coordinates of the points on the skin mesh of the character model.
[0025] As an improvement of the above solution, the binding information also includes the local rotation matrix, the scaling scale and the skin weight of the skeletal joint points;
[0026] The step of performing linear calculation on the positions of the skeleton joint points of the character model according to the binding information of the skin mesh of the character model and the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model further includes:
[0027] According to the local rotation matrix, scaling scale and skin weight of the skeleton joint points of the template model, the local rotation matrix, scaling scale and skin weight of the skeleton joint points of the character model are correspondingly determined.
[0028] The embodiment of the present invention also provides a device for generating facial skeleton binding information, comprising:
[0029] A template model matching module, used to obtain a three-dimensional facial model and a preset template model that matches the three-dimensional facial model;
[0030] A character model construction module, used to perform topological reconstruction on the template model based on the three-dimensional face model to obtain a character model to be processed;
[0031] The binding information generating module is used to perform linear calculation on the positions of the skeleton joint points of the character model according to the skin mesh of the character model and the binding information of the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model.
[0032] An embodiment of the present invention also provides a device for generating facial bone binding information, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating facial bone binding information as described in any one of the above items is implemented.
[0033] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for generating facial bone binding information as described above.
[0034] An embodiment of the present invention further provides a computer program product, which includes a computer program or computer instructions. When the computer program or the computer instructions are executed by a processor, the method for generating facial skeleton binding information as described in any one of the above is implemented.
[0035] Compared with the prior art, the method, device, equipment, medium and product for generating facial bone binding information disclosed in the present invention match the corresponding template model for the facial three-dimensional model, obtain the character model to be processed through topological reconstruction, and use a linear calculation method to solve the positions of the bone joint points of the template model to the bone joint points of the character model, thereby avoiding the efficiency problems caused by solving nonlinear problems, effectively simplifying the calculation complexity of the bone joint points, and significantly improving the calculation efficiency of the bone joint points of the character model, which can save computing resources and improve the binding efficiency and binding effect of the facial bones of the character model. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of a method for generating facial skeleton binding information provided by an embodiment of the present invention;
[0037] Figure 2 Schematic diagram of the principle of topological reconstruction of a model in an embodiment of the present invention;
[0038] Figure 3 It is a schematic diagram of the principle of constructing the parent-child relationship triangle of the skeletal joint points in an embodiment of the present invention;
[0039] Figure 4 It is a structural schematic diagram of a device for generating facial skeleton binding information provided by an embodiment of the present invention;
[0040] Figure 5 It is a structural schematic diagram of a facial skeleton binding information generation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] In the description of the present application, it should be understood that the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0043] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0044] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0045] See also Figure 1 , is a flow chart of a method for generating facial bone binding information provided by an embodiment of the present invention. The embodiment of the present invention provides a method for generating facial bone binding information, which is specifically performed by the following steps S11 to S13:
[0046] S11, acquiring a three-dimensional facial model and a preset template model matching the three-dimensional facial model;
[0047] S12, based on the three-dimensional facial model, topologically reconstructing the template model to obtain a character model to be processed;
[0048] S13. According to the skin mesh of the character model and the binding information of the skeleton joint points of the template model, linear calculation is performed on the positions of the skeleton joint points of the character model to obtain the binding information of the skeleton joint points of the character model.
[0049] In an embodiment of the present invention, a template model library is pre-constructed for storing a plurality of template models, the template models are prepared in advance by professionals, each of the template models includes skin mesh, transformation matrix information of facial bone joints and binding information such as skin weights, the transformation matrix information consists of three parts, including a 3×3 local rotation matrix, a 3-dimensional translation vector and a scaling scale represented by a positive real number.
[0050] In actual application, a facial three-dimensional model of a digital human character to be processed is obtained, wherein the facial three-dimensional model includes a skin mesh. The method for generating binding information in an embodiment of the present invention is intended to generate binding information between facial bone joint points and skin of the facial three-dimensional model, thereby completing the binding between the facial bone joint points and skin of the facial three-dimensional model.
[0051] Specifically, according to the facial feature information of the 3D face model to be processed, such as the face shape, a template model of the closest face shape is matched from the template model library as the template model for subsequent operations. The template model is topologically reconstructed to obtain a model consistent with the appearance of the 3D face model, and the transformed template model is used as the 3D face model for subsequent processing, which is recorded as the character model.
[0052] See also Figure 2 , is a schematic diagram of the principle of topological reconstruction of the model in an embodiment of the present invention. After obtaining the 3D facial model to be processed, the 3D facial model is first retopologically reconstructed, i.e., the wrapping process, by transforming the matching template model, and using the transformed template model as the character model for subsequent processing. In this way, the skeletal joint points of the character model can be mapped according to the skeletal joint points on the template model, and the binding information of these skeletal joint points of the character model needs to be calculated later.
[0053] Optionally, the topology reconstruction process is completed by using an ICP (Iterative Nearest Neighbor Point) algorithm to transform the appearance of the template model to be consistent with the character model.
[0054] Furthermore, according to the skin mesh of the character model and the binding information of the skeleton joints of the template model, the positions of the skeleton joints of the character model are solved by linear calculation, and then the binding information of the skeleton joints of the character model is calculated.
[0055] By adopting the technical means of the embodiment of the present invention, the facial three-dimensional model is matched with a corresponding template model, and then a character model to be processed is obtained through topological reconstruction, and a linear calculation method is used to solve the positions of the skeleton joint points of the template model to the skeleton joint points of the character model, thereby avoiding the efficiency problems caused by solving nonlinear problems, effectively simplifying the calculation complexity of the skeleton joint points, and significantly improving the calculation efficiency of the skeleton joint points of the character model, which can save computing resources and improve the binding efficiency and binding effect of the facial bones of the character model.
[0056] As a preferred embodiment, the binding information of the skeleton joints of the character model includes the transformation matrix information and skin weights of the skeleton joints, and the transformation matrix information includes the local rotation matrix, local coordinates and telescopic scale of the skeleton joints, and the local coordinates are also translation vectors. Then step S13 is specifically used to realize the generation of binding information such as the local rotation matrix, local coordinates, telescopic scale and skin weights of the skeleton joints of the character model.
[0057] Specifically, the linear calculation of the positions of the skeleton joint points of the character model according to the binding information of the skin mesh of the character model and the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model includes steps S131 to S134:
[0058] S131, determining the local rotation matrix, telescopic scale and skin weight of the skeleton joint points of the character model according to the local rotation matrix, telescopic scale and skin weight of the skeleton joint points of the template model;
[0059] S132, dividing the skeleton joint points of the character model into first skeleton joint points attached to the skin mesh of the character model and second skeleton joint points not attached to the skin mesh of the character model;
[0060] S133, calculating the world coordinates of the first skeletal joint point according to the skin mesh of the character model;
[0061] S134, determining the parent-child relationship triangle of each skeletal joint point in the character model, and calculating the world coordinates of the second skeletal joint point according to the parameter information corresponding to the parent-child relationship triangle on the template model;
[0062] S135. Calculate the local coordinates of the skeletal joint points of the character model according to the world coordinates of the skeletal joint points of the character model.
[0063] In an embodiment of the present invention, after obtaining the corresponding template model for matching the character model, the local rotation matrix, scaling scale and skin weights of the skeletal joints of the template model are directly used as the local rotation matrix, scaling scale and skin weights of the skeletal joints of the character model.
[0064] For the local coordinates of the skeletal joints of the character model, that is, the translation vector, it is necessary to further obtain the world coordinates through linear calculation, and then convert them to obtain the local coordinates on the character model. The embodiment of the present invention first divides the skeletal joints of the character model into two types, namely first skeletal joints and second skeletal joints, wherein the first skeletal joints refer to the skeletal joints attached to the skin mesh of the character model, and the second skeletal joints refer to the skeletal joints not attached to the skin mesh of the character model.
[0065] Remember index A ={i1, i2, ..., i q} is the index of all first bone joint points, index B ={i1, i2, ..., i p} is the index of all the second bone joint points. The embodiment of the present invention requires that any i belongs to index A and any i belongs to index B , we need to calculate the Joint i The world coordinates of Joint i Represents the bone joint point with index i, and the total number of bone joint points n=p+q.
[0066] For the first skeletal joint point, the world coordinates are directly calculated based on the skin mesh of the character model. Step S133, that is, calculating the world coordinates of the first skeletal joint point based on the skin mesh of the character model, includes:
[0067] The first skeletal joint points are matched with points on the skin mesh of the character model, and the world coordinates of the corresponding first skeletal joint points are obtained according to the world coordinates of the points on the skin mesh of the character model.
[0068] Specifically, calculate index A The first bone joint point position corresponding to the index in . After the topology reconstruction operation, the skin mesh of the character model is obtained. A The first bone joint point in is attached to the skin mesh, so the coordinates of the points on the attached skin mesh can be assigned to the corresponding first bone joint point to obtain the index A The world coordinates of the q first bone joint points in .
[0069] For the second skeletal joint point, its world coordinates are calculated using a conformal relationship based on triangles in space. Step S134, i.e., determining the parent-child relationship triangles of each skeletal joint point in the character model, and calculating the world coordinates of the second skeletal joint point according to the corresponding parameter information of the parent-child relationship triangles on the template model, includes:
[0070] Determine a parent-child relationship triangle including at least one of the second skeletal joint points in each skeletal joint point of the character model; wherein the parent-child relationship triangle is formed by three skeletal joint points of the character model;
[0071] Determine the normal vector and parent-child angle corresponding to the parent-child relationship triangle on the template model according to the binding information of the skeleton joint points of the template model;
[0072] According to the normal vector and the parent-child angle, a Rodriguez rotation formula is calculated to obtain a linear relationship between the bone joint points in the parent-child relationship triangle;
[0073] According to the linear relationship, the world coordinates of the second skeletal joint point in the parent-child relationship triangle are calculated.
[0074] Specifically, calculate index B The position of the p second bone joint points in . Note index B The p points in are all 3D vectors (x, y, z), totaling 3p unknowns. Suppose the coordinates of the p points on the character model are {xj[1], xj[2]...., xj[p]}, where each xj[k] has 3 components, totaling 3p unknowns. To solve these 3p unknowns, at least 3p independent linear equations are required. Suppose that on the template model, the world coordinates of the n=p+q skeletal joints are {m[1], m[2]...., m[n]}, and the world coordinates of the n skeletal joints on the template model are known.
[0075] See also Figure 3 , is a schematic diagram of the principle of constructing a parent-child relationship triangle of a bone joint point in an embodiment of the present invention. The embodiment of the present invention defines a parent-child relationship triangle and a parent-child angle. The parent-child relationship triangle is composed of a parent bone joint point and two child bone joint points. The angle between the line segments formed from the parent bone joint point to the two child bone joint points is the parent-child angle. For example Figure 3 If joint point A in the figure is the parent joint of joint points B and C, then ABC forms a "father-child relationship triangle", and angle BAC is the corresponding "father-child angle".
[0076] Assume that the indexes of the three points in the parent-child relationship triangle are {k0, k1, k2}, and the normal vector n and the parent-child angle theta of the parent-child relationship triangle on the character model are obtained through the normal vector and the parent-child angle of the triangle formed by the corresponding three skeletal joint points on the template model:
[0077]
[0078] According to the Rodriguez rotation formula, we can calculate:
[0079] Rot = Rodrigues(n, theta);
[0080] Thus, we get the linear relationship between x[k0], x[k1], and x[k2]:
[0081] Rot(x[k1]-x[k0])=x[k2]-x[k0];
[0082] From this we can get three linear equations about the unknowns {x[1], x[2]...., x[p]}, one equation for each component.
[0083] Select the parent-child relationship triangle of interest, that is, select the triangle whose three vertices at least one of which is the second bone joint point. For the second bone joint point, there are:
[0084] Rot(x[k1]-x[k0])=x[k2]-x[k0];
[0085] Among them, at least one of k0, k1, k2 belongs to index B Therefore, Rot(x[k1]-x[k0])=x[k2]-x[k0] is a linear equation about the unknowns {xj[1], xj[2]...., xj[p]}.
[0086] In a general skeletal system, the number of parent-child relationship triangles of interest is much greater than p, so far more than 3p linear equations can be formed. By solving the linear equations, we can obtain {xj[1], xj[2]...., xj[p]}, that is, the world coordinates of each of the second skeletal joint points.
[0087] Further, step S135, that is, calculating the local coordinates of the skeleton joint points of the character model according to the world coordinates of the skeleton joint points of the character model, includes:
[0088] Assigning the local rotation matrix of the skeleton joint points of the template model to the skeleton joint points of the character model;
[0089] The local coordinates of the skeletal joint points of the character model are calculated using forward kinematic equations according to the world coordinates of the skeletal joint points of the character model and the local rotation matrix.
[0090] Specifically, after calculating the world coordinates of all n skeletal joints of the character model {Joint1, Joint2...., Joint n}After that, the local coordinates {t1, t2...., t n}.
[0091] Assign the n local rotation matrices of the template model to the corresponding bone joint points {rot1, rot2...., rot n}, using the position of each bone joint point, find the relative coordinates of each joint point relative to the parent joint, and calculate the local coordinates of each bone joint point through the forward kinematics equation, where the relationship of forward kinematics is as follows:
[0092] Let {x0, x1, x2, ..., x k} is the parent-child chain from the root joint point to the k-level joint point, that is, x i All are x i-1 The child node of (0) , Rotation (1) ...., Rotation (k)}, and its corresponding local coordinates are {Translation (0) , Translation (1) ...., Translation (k)}, then at the local coordinates {x k}The corresponding world coordinate is x (k→w) , and its corresponding augmented vector is \hat{x} (k→w) =(x (k→w) , 1);
[0093]
[0094] in,
[0095]
[0096] Scal e ( i ) are all 1.
[0097] By (x (0→w) ,1)=(0,1)Translation (0) , we can get t(0) ;
[0098] By (x (1→w) ,1)=(0,1)Translation (1) Translation (0) , we can get t (1) ;
[0099] By analogy, all t can be calculated (k) .t (k) is the local coordinate of the i-level joint point in the i-1-level joint point.
[0100] By adopting the technical means of the embodiment of the present invention, the facial bone joints of the character model are classified according to whether they are attached to the skin mesh, and the coordinates of the first attached bone joints are obtained by obtaining the corresponding vertex coordinates on the skin mesh of the character model, without the need to additionally calculate the corresponding position of the first attached bone joints. For the non-attached second bone joints, the coordinates are calculated based on the conformal relationship of triangles in space. When performing conformal constraints in space, linear problems are processed, avoiding the efficiency problems caused by solving nonlinear problems, effectively simplifying the calculation complexity of the bone joints, and significantly improving the calculation efficiency of the bone joints of the character model. In addition, the embodiment of the present invention does not need to solve the binding information such as the rotation matrix and skin weight of the character model, which can save computing resources and improve the computing efficiency of the processing.
[0101] See also Figure 4 , is a schematic diagram of the structure of a device for generating facial bone binding information provided by an embodiment of the present invention. The embodiment of the present invention also provides a device 20 for generating facial bone binding information, including:
[0102] A template model matching module 21, used to obtain a facial 3D model and a preset template model matching the facial 3D model;
[0103] A character model construction module 22 is used to perform topological reconstruction on the template model based on the three-dimensional face model to obtain a character model to be processed;
[0104] The binding information generating module 23 is used to perform linear calculation on the positions of the skeleton joint points of the character model according to the skin mesh of the character model and the binding information of the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model.
[0105] As a preferred embodiment, the binding information includes the local coordinates of the skeletal joint points. The binding information generating module 23 is specifically used for:
[0106] Dividing the skeleton joint points of the character model into first skeleton joint points attached to the skin mesh of the character model and second skeleton joint points not attached to the skin mesh of the character model;
[0107] Calculate the world coordinates of the first skeletal joint point according to the skin mesh of the character model;
[0108] Determine the parent-child relationship triangle of each skeletal joint point in the character model, and calculate the world coordinates of the second skeletal joint point according to the parameter information corresponding to the parent-child relationship triangle on the template model;
[0109] The local coordinates of the skeleton joint points of the character model are calculated according to the world coordinates of the skeleton joint points of the character model.
[0110] As a preferred implementation, the determining of the parent-child relationship triangle of each skeletal joint point in the character model, and calculating the world coordinates of the second skeletal joint point according to the parameter information corresponding to the parent-child relationship triangle on the template model, includes:
[0111] Determine a parent-child relationship triangle including at least one of the second skeletal joint points in each skeletal joint point of the character model; wherein the parent-child relationship triangle is formed by three skeletal joint points of the character model;
[0112] Determine the normal vector and parent-child angle corresponding to the parent-child relationship triangle on the template model according to the binding information of the skeleton joint points of the template model;
[0113] According to the normal vector and the parent-child angle, a Rodriguez rotation formula is calculated to obtain a linear relationship between the bone joint points in the parent-child relationship triangle;
[0114] According to the linear relationship, the world coordinates of the second skeletal joint point in the parent-child relationship triangle are calculated.
[0115] As a preferred implementation, the calculating the local coordinates of the skeletal joint points of the character model according to the world coordinates of the skeletal joint points of the character model includes:
[0116] Assigning the local rotation matrix of the skeleton joint points of the template model to the skeleton joint points of the character model;
[0117] The local coordinates of the skeletal joint points of the character model are calculated using forward kinematic equations according to the world coordinates of the skeletal joint points of the character model and the local rotation matrix.
[0118] As a preferred implementation, the calculating the world coordinates of the first skeletal joint point according to the skin mesh of the character model includes:
[0119] The first skeletal joint points are matched with points on the skin mesh of the character model, and the world coordinates of the corresponding first skeletal joint points are obtained according to the world coordinates of the points on the skin mesh of the character model.
[0120] As a preferred embodiment, the binding information also includes the local rotation matrix, scaling scale and skin weight of the skeletal joints. The binding information generation module 23 is also used for:
[0121] According to the local rotation matrix, scaling scale and skin weight of the skeleton joint points of the template model, the local rotation matrix, scaling scale and skin weight of the skeleton joint points of the character model are correspondingly determined.
[0122] By adopting the technical means of the embodiment of the present invention, the facial bone joints of the character model are classified according to whether they are attached to the skin mesh, and the coordinates of the first attached bone joints are obtained by obtaining the corresponding vertex coordinates on the skin mesh of the character model, without the need to additionally calculate the corresponding position of the first attached bone joints. For the non-attached second bone joints, the coordinates are calculated based on the conformal relationship of triangles in space. When performing conformal constraints in space, linear problems are processed, avoiding the efficiency problems caused by solving nonlinear problems, effectively simplifying the calculation complexity of the bone joints, and significantly improving the calculation efficiency of the bone joints of the character model. In addition, the embodiment of the present invention does not need to solve the binding information such as the rotation matrix and skin weight of the character model, which can save computing resources and improve the computing efficiency of the processing.
[0123] It should be noted that the facial bone binding information generation device provided in an embodiment of the present invention is used to execute all the process steps of the facial bone binding information generation method of the above embodiment. The working principles and beneficial effects of the two correspond one to one, and thus will not be described in detail.
[0124] See also Figure 5 , is a structural diagram of a facial bone binding information generation device provided by an embodiment of the present invention. The embodiment of the present invention also provides a facial bone binding information generation device 30, including a processor 31, a memory 32, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the facial bone binding information generation method described in any one of the above embodiments.
[0125] An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for generating facial bone binding information as described in any one of the above embodiments.
[0126] An embodiment of the present invention further provides a computer program product, which includes a computer program or computer instructions. When the computer program or the computer instructions are executed by a processor, the method for generating facial skeleton binding information as described in any one of the above embodiments is implemented.
[0127] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0128] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for generating facial skeleton binding information, characterized in that: include: Acquire a three-dimensional facial model and a preset template model matching the three-dimensional facial model; Based on the three-dimensional facial model, topologically reconstructing the template model to obtain a character model to be processed; According to the binding information of the skin mesh of the character model and the skeleton joint points of the template model, the positions of the skeleton joint points of the character model are linearly calculated to obtain the binding information of the skeleton joint points of the character model.
2. The method for generating facial skeleton binding information according to claim 1, wherein: The binding information includes the local coordinates of the skeletal joint points; The step of performing linear calculation on the positions of the skeleton joint points of the character model according to the binding information of the skin mesh of the character model and the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model comprises: Dividing the skeleton joint points of the character model into first skeleton joint points attached to the skin mesh of the character model and second skeleton joint points not attached to the skin mesh of the character model; Calculate the world coordinates of the first skeletal joint point according to the skin mesh of the character model; Determine the parent-child relationship triangle of each skeletal joint point in the character model, and calculate the world coordinates of the second skeletal joint point according to the parameter information corresponding to the parent-child relationship triangle on the template model; The local coordinates of the skeletal joint points of the character model are calculated according to the world coordinates of the skeletal joint points of the character model.
3. The method for generating facial skeleton binding information as claimed in claim 2, characterized in that: The step of determining the parent-child relationship triangle of each skeletal joint point in the character model, and calculating the world coordinates of the second skeletal joint point according to parameter information corresponding to the parent-child relationship triangle on the template model, comprises: Determine a parent-child relationship triangle including at least one of the second skeletal joint points in each skeletal joint point of the character model; wherein the parent-child relationship triangle is formed by three skeletal joint points of the character model; Determine the normal vector and parent-child angle corresponding to the parent-child relationship triangle on the template model according to the binding information of the skeleton joint points of the template model; Calculate the Rodriguez rotation formula according to the normal vector and the parent-child angle to obtain the linear relationship between the bone joint points in the parent-child relationship triangle; According to the linear relationship, the world coordinates of the second bone joint point in the parent-child relationship triangle are calculated.
4. The method for generating facial skeleton binding information as claimed in claim 2, characterized in that: The step of calculating the local coordinates of the skeletal joint points of the character model according to the world coordinates of the skeletal joint points of the character model comprises: Assigning the local rotation matrix of the skeleton joint points of the template model to the skeleton joint points of the character model; The local coordinates of the skeletal joint points of the character model are calculated using forward kinematic equations according to the world coordinates of the skeletal joint points of the character model and the local rotation matrix.
5. The method for generating facial skeleton binding information as claimed in claim 2, characterized in that: The calculating the world coordinates of the first skeletal joint point according to the skin mesh of the character model includes: The first skeletal joint points are matched with points on the skin mesh of the character model, and the world coordinates of the corresponding first skeletal joint points are obtained according to the world coordinates of the points on the skin mesh of the character model.
6. The method for generating facial skeleton binding information according to any one of claims 2 to 5, characterized in that: The binding information also includes the local rotation matrix, scaling scale and skin weight of the skeletal joint points; The step of performing linear calculation on the positions of the skeleton joint points of the character model according to the binding information of the skin mesh of the character model and the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model further includes: According to the local rotation matrix, scaling scale and skin weight of the skeleton joint points of the template model, the local rotation matrix, scaling scale and skin weight of the skeleton joint points of the character model are correspondingly determined.
7. A device for generating facial skeleton binding information, characterized in that: include: A template model matching module, used to obtain a facial 3D model and a preset template model matching the facial 3D model; A character model construction module, used to perform topological reconstruction on the template model based on the three-dimensional face model to obtain a character model to be processed; The binding information generating module is used to perform linear calculation on the positions of the skeleton joint points of the character model according to the skin mesh of the character model and the binding information of the skeleton joint points of the template model to obtain the binding information of the skeleton joint points of the character model.
8. A device for generating facial skeleton binding information, characterized in that: The invention comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for generating facial skeleton binding information according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for generating facial skeleton binding information according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product includes a computer program or a computer instruction, and when the computer program or the computer instruction is executed by a processor, the method for generating facial skeleton binding information according to any one of claims 1 to 6 is implemented.
