CN112884868B - Three-dimensional mesh vertex feature determination method, skeleton covering method and related device - Google Patents
Three-dimensional mesh vertex feature determination method, skeleton covering method and related device Download PDFInfo
- Publication number
- CN112884868B CN112884868B CN202110484068.1A CN202110484068A CN112884868B CN 112884868 B CN112884868 B CN 112884868B CN 202110484068 A CN202110484068 A CN 202110484068A CN 112884868 B CN112884868 B CN 112884868B
- Authority
- CN
- China
- Prior art keywords
- vertex
- target
- representative
- joint
- mesh
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 155
- 210000000988 bone and bone Anatomy 0.000 claims abstract description 255
- 238000005070 sampling Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 12
- 238000004422 calculation algorithm Methods 0.000 claims description 11
- 239000013598 vector Substances 0.000 claims description 6
- 238000013473 artificial intelligence Methods 0.000 abstract description 7
- 230000000694 effects Effects 0.000 description 24
- 238000010586 diagram Methods 0.000 description 19
- 230000008569 process Effects 0.000 description 18
- 238000012545 processing Methods 0.000 description 11
- 238000011160 research Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 210000002478 hand joint Anatomy 0.000 description 6
- 239000011159 matrix material Substances 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000005259 measurement Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 238000003062 neural network model Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 241001465754 Metazoa Species 0.000 description 1
- 230000001174 ascending effect Effects 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000000547 structure data Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T13/00—Animation
- G06T13/20—3D [Three Dimensional] animation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
- G06T17/20—Finite element generation, e.g. wire-frame surface description, tesselation
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the application discloses a three-dimensional grid vertex feature determination method, a skeleton covering method and a related device in the field of artificial intelligence, wherein the three-dimensional grid vertex feature determination method comprises the following steps: aiming at each joint in a target skeleton structure, searching a representative vertex corresponding to the joint in a graph topological structure of a target three-dimensional grid to form a vertex representative cluster corresponding to the joint; aiming at each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in a non-European space according to the position of the target vertex, the vertex representative cluster corresponding to each joint and the position of each joint, and taking the distance as the non-European space distance characteristic between the target vertex and the target bone structure; and determining the non-Europe space distance characteristic between the target three-dimensional mesh and the target bone structure according to the non-Europe space distance characteristic between each target vertex and the target bone structure. The method can construct reasonable three-dimensional grid vertex characteristics.
Description
Technical Field
The present application relates to the technical field of Artificial Intelligence (AI), and in particular, to a method for determining vertex characteristics of a three-dimensional mesh, a method for skinning a bone, and a related apparatus.
Background
Bone skinning is a technique used to bind vertices on a three-dimensional Mesh (3D Mesh) in a three-dimensional animated model to bone joints. Since the vertices on the 3D Mesh are usually controlled by a plurality of different joints to different degrees, joint weights are required to be configured for the vertices on the 3D Mesh by using a bone covering technique, and the joint weights are used for determining the degree of influence of actions of the different joints on the vertices on the 3D Mesh.
Currently, in the industrial art chain, most of the 3D Mesh bone skinning needs to be performed by the craft technicians according to their own experience. Specifically, an art designer and technician needs to manually configure joint weights for each vertex on the 3D Mesh according to experience cognition of the art designer and technician, and further, observe the running deformation of the 3D Mesh after the skeleton skin is combined with the skeleton animation, and manually adjust the joint weights of the vertices on the 3D Mesh according to the running deformation; in this way, the joint weights of the vertices are repeatedly adjusted in the above manner until the entire 3D Mesh deformation can be naturally smoothed even in a large motion posture.
Because the manual bone skinning mode usually consumes a lot of time and is low in configuration efficiency, a deep learning algorithm is adopted in some research attempts to design and train a network model to learn the data characteristics of the 3D Mesh, so that the network model can predict the joint weight of the top point on the 3D Mesh based on the given input characteristics. Whether the joint weight predicted by the network model is accurate depends on the input characteristics of the network model, namely the vertex characteristics of the 3D Mesh, so that how to construct reasonable vertex characteristics of the 3D Mesh as the input of the network model becomes a problem to be solved urgently at present.
Disclosure of Invention
The embodiment of the application provides a three-dimensional Mesh vertex feature determination method, a bone skinning method and a related device, which can be used for constructing a reasonable 3D Mesh vertex feature, and can be used for skinning bones based on the 3D Mesh vertex feature through a network model, so that a better skinning effect can be obtained.
In view of the above, a first aspect of the present application provides a method for determining vertex features of a three-dimensional mesh, where the method includes:
aiming at each joint in a target skeleton structure, searching a representative vertex corresponding to the joint in a graph topological structure of a target three-dimensional grid to form a vertex representative cluster corresponding to the joint;
for each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in the target bone structure under a non-European space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure and the position of each joint in the target bone structure, wherein the distance is used as a non-European space distance characteristic between the target vertex and the target bone structure;
and determining the non-Euro-space distance characteristics between the target three-dimensional mesh and the target bone structure according to the non-Euro-space distance characteristics between each target vertex in the graph topological structure and the target bone structure.
A second aspect of the present application provides a method of bone skinning, the method comprising:
acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: determining a non-Euclidean distance characteristic between the target three-dimensional mesh and a target bone structure by the three-dimensional mesh vertex characteristic determination method of the first aspect;
and configuring joint weight for each vertex in the target three-dimensional grid through a skeleton skin model according to the vertex characteristics of the three-dimensional grid.
A third aspect of the present application provides a three-dimensional mesh vertex feature determination apparatus, the apparatus comprising:
the vertex representative cluster determining module is used for searching a representative vertex corresponding to each joint in a graph topological structure of a target three-dimensional grid aiming at each joint in a target skeleton structure to form a vertex representative cluster corresponding to each joint;
a non-European space distance determining module, configured to determine, for each target vertex in the graph topology structure, a distance from the target vertex to each joint in the target bone structure in a non-European space according to a position of the target vertex, a position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure, and a position of each joint in the target bone structure, as a non-European space distance feature between the target vertex and the target bone structure;
and the grid vertex characteristic determining module is used for determining the non-European space distance characteristic between the target three-dimensional grid and the target bone structure according to the non-European space distance characteristic between each target vertex in the graph topological structure and the target bone structure.
The present application provides in a fourth aspect a bone skinning device, the device comprising:
the characteristic acquisition module is used for acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: determining a non-Euclidean distance characteristic between the target three-dimensional mesh and a target bone structure by the three-dimensional mesh vertex characteristic determination method of the first aspect;
and the skeleton covering module is used for configuring joint weight for each vertex in the target three-dimensional mesh according to the vertex characteristics of the three-dimensional mesh through a skeleton covering model.
A fifth aspect of the present application provides an electronic device, the device comprising a processor and a memory:
the memory is used for storing a computer program;
the processor is configured to execute the steps of the method for determining three-dimensional mesh vertex features according to the first aspect or the steps of the method for skinning bone according to the second aspect according to the computer program.
A sixth aspect of the present application provides a computer-readable storage medium for storing a computer program for performing the steps of the method for determining three-dimensional mesh vertex features of the first aspect described above or the steps of the method for bone skinning of the second aspect described above.
A seventh aspect of the present application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions are read by a processor of a computer device from a computer readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps of the three-dimensional mesh vertex feature determination method of the first aspect or the steps of the bone skinning method of the second aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides a three-dimensional mesh vertex feature determination method which innovatively provides a scheme for determining non-European space distances between vertices and bone joints in a three-dimensional mesh. In the method for determining the three-dimensional grid vertex characteristics, vertex representative clusters corresponding to joints in a target skeleton structure can be searched in a graph topological structure of a target three-dimensional grid; then, aiming at each target vertex in the target three-dimensional grid, determining the distance between the target vertex and each joint in the target skeleton structure in a non-European space based on the vertex representative cluster corresponding to each joint in the target skeleton structure; and then, constructing a non-Euro-space distance feature between the target three-dimensional mesh and the target bone structure based on the above. The method comprises the steps of describing the distance relationship between vertexes in the three-dimensional grid and bone joints in a non-European space by introducing a graph topological structure of the three-dimensional grid; compared with Euclidean space distance characteristics, the non-Europe space distance characteristics between the three-dimensional grid and the skeleton structure can more accurately reflect the position relation between the vertexes and the skeleton joints in the three-dimensional grid, correspondingly, the non-Europe space distance characteristics between the three-dimensional grid and the skeleton structure are introduced in the process of predicting the joint weight of the vertexes in the three-dimensional grid by using the network model, the control relation of the skeleton joints to the vertexes in the three-dimensional grid can be more accurately predicted by the network model, the situation that the vertexes and the skeleton joints in the three-dimensional grid are wrongly bound is avoided, the accuracy of the joint weight configured aiming at the vertexes is effectively improved, a better skeleton covering effect is obtained, and the three-dimensional grid is smoother and more natural in the process of the motion deformation of the bones bound by the three-dimensional.
Drawings
FIG. 1 is a diagram of the effect of a 3D Mesh on bone skinning using the prior art;
fig. 2 is a schematic view of an application scenario of a three-dimensional mesh vertex feature determination method and a bone skinning method provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of a method for determining vertex features of a three-dimensional mesh according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a bone skinning effect of a 3D game skin provided by an embodiment of the present application;
FIG. 5 is a schematic flow chart of a method for skinning a bone according to an embodiment of the present disclosure;
FIG. 6 is a diagram illustrating a 3D Mesh bone skinning effect obtained by a method according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a first apparatus for determining vertex features of a three-dimensional mesh according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a second apparatus for determining vertex features of three-dimensional meshes according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a third apparatus for determining vertex characteristics of three-dimensional meshes according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a fourth apparatus for determining vertex features of three-dimensional meshes according to an embodiment of the present application;
FIG. 11 is a schematic structural view of a bone skinning device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
Computer Vision technology (CV) is a science for researching how to make a machine "see", and further refers to that a camera and a Computer are used to replace human eyes to perform machine Vision such as identification, tracking and measurement on a target, and further image processing is performed, so that the Computer processing becomes an image more suitable for human eyes to observe or is transmitted to an instrument to detect. As a scientific discipline, computer vision research-related theories and techniques attempt to build artificial intelligence systems that can capture information from images or multidimensional data. Computer vision technologies generally include image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content/behavior recognition, three-dimensional object reconstruction, 3D technologies, virtual reality, augmented reality, synchronous positioning, map construction, and other technologies, and also include common biometric technologies such as face recognition and fingerprint recognition.
The scheme provided by the embodiment of the application relates to a computer vision technology in the field of artificial intelligence, and is specifically explained by the following embodiment:
currently, some academic researches begin to try to design and train an end-to-end network model for bone skinning of a 3D Mesh by using a deep learning algorithm, so as to automatically configure joint weights for vertices in the 3D Mesh by using the network model. How to improve the accuracy of the joint weight configured by the network model for the vertex in the 3D Mesh to obtain a better bone skinning effect is always a great challenge for the industry to apply the automatic bone skinning scheme in a floor-to-floor manner. For the research on the automatic bone skinning scheme, currently, the focus is generally on the optimization of the network model structure, that is, the main research direction is still to improve the bone skinning effect of the network model by optimizing the structure of the network model.
However, through research of the inventor of the application, the improvement of the input characteristics of the network model also produces a remarkable optimization effect on the bone covering effect obtained by the network model. Specifically, the inventor of the present application finds that the input features of the current network model for bone skinning mainly include the positions of the vertices in the 3D Mesh, normal vectors of the vertices in the 3D Mesh, and euclidean distances from the vertices in the 3D Mesh to the bone joints, and these input features can only express the spatial positions of the vertices in the 3D Mesh and the euclidean distances from the vertices to the bone joints, but ignore the distance measurement between the vertices in the 3D Mesh and the bone joints in the non-euclidean space, which easily causes the situation that the edge vertices in the 3D Mesh and the vertices with smaller euclidean distances from the bone joints to be mistakenly bound to the bone joints. If the vertex in the 3D Mesh is wrongly bound with the bone joint, the 3D Mesh is irregularly stretched and interpenetrated in the bound bone motion process, and the overall effect of the bone covering is greatly influenced.
In order to facilitate understanding of the defects of the above-mentioned scheme which does not consider the non-euro-spatial distance characteristics between the vertices and the bone joints in the 3D Mesh, the following description is provided with reference to the 3D Mesh bone skinning effect diagram shown in fig. 1. In fig. 1, (a) is a 3D Mesh standing still in a posture (a-pos), (a) a vertex a in (a) is very close to a left hand joint in european space, and a vertex B in (a) is very close to a right hand joint in european space, the vertex a and the vertex B are both relatively far from a pelvic joint in european space, and without considering a non-european space distance characteristic between the vertex in 3D Mesh and a skeletal joint, a network model for skeletal skinning binds the vertex a and the left hand joint, the vertex B and the right hand joint, and not binds the vertex a and the vertex B and the pelvic joint according to the distance between the vertex and the skeletal joint in european space; after the bone covering treatment, the deformation stretching effect of the 3D Mesh moving along with the bound bone joints is shown in (B) in fig. 1, and it can be seen from (B) that the vertex A and the vertex B are obviously and wrongly bound to the hand joints, and the bone covering effect of the 3D Mesh is poor.
In view of the problems in the related art, the embodiments of the present application provide a method for determining vertex features of a three-dimensional mesh and a method for skinning a bone. The three-dimensional Mesh vertex characteristic determination method can construct non-European space distance characteristics between a vertex in the 3D Mesh and a bone joint; the bone skinning method can apply the constructed non-euro-spatial distance features to an automated bone skinning scheme, thereby enhancing the bone skinning effect.
Specifically, in the method for determining the vertex characteristics of the three-dimensional mesh provided in the embodiment of the present application, for each joint in a target bone structure, a representative vertex corresponding to the joint is searched in a graph topology structure of the target three-dimensional mesh, and a vertex representative cluster corresponding to the joint is formed; then, for each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in the target bone structure under the non-European space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure and the position of each joint in the target bone structure, and taking the distance as the non-European space distance characteristic between the target vertex and the target bone structure; and further, according to the non-Europe space distance characteristics between each target vertex and the target bone structure in the graph topological structure, determining the non-Europe space distance characteristics between the target three-dimensional mesh and the target bone structure.
In the bone skinning method provided by the embodiment of the application, three-dimensional mesh vertex characteristics corresponding to a target three-dimensional mesh to be skinned are obtained, and the three-dimensional mesh vertex characteristics at least include: determining the non-Europe space distance characteristic between the target three-dimensional mesh and the target skeleton structure by the three-dimensional mesh vertex characteristic determination method; and then, configuring corresponding joint weights for all vertexes in the target three-dimensional mesh according to the acquired vertex characteristics of the three-dimensional mesh through a pre-trained bone skin model.
The method for determining the vertex characteristics of the three-dimensional grid creatively provides a scheme for determining the non-European space distance between the vertex in the three-dimensional grid and the bone joint, and the distance relationship between the vertex in the three-dimensional grid and the bone joint in the non-European space is described by introducing a graph topological structure of the three-dimensional grid; compared with the Euclidean space distance characteristics, the non-Europe space distance characteristics between the three-dimensional mesh and the bone structure can more accurately reflect the position relation between the vertexes in the three-dimensional mesh and the bone joints. Correspondingly, in the process of predicting the joint weight of the vertex in the three-dimensional grid by using the bone covering model, the non-Europe space distance characteristic between the three-dimensional grid and the bone structure is introduced, so that the network model can be helped to more accurately predict the control relation of the bone joint to the vertex in the three-dimensional grid, the condition that the vertex in the three-dimensional grid and the bone joint are wrongly bound is avoided, the accuracy of the joint weight configured aiming at the vertex is effectively improved, a better bone covering effect is obtained, and the three-dimensional grid is smoother and more natural in the process of the motion deformation of the bound bone.
It should be understood that the three-dimensional mesh vertex feature determination method and the bone skinning method provided in the embodiments of the present application may be applied to a device with three-dimensional image processing capability, such as a terminal device or a server. The terminal device may be a smart phone, a computer, a tablet computer, a Personal Digital Assistant (PDA), a vehicle-mounted terminal, or the like; the server may specifically be an application server or a Web server, and in actual deployment, the server may be an independent server, or may also be a cluster server or a cloud server. According to the three-dimensional mesh vertex feature determination method and the skeleton covering method disclosed by the application, the graph topological structure of the involved three-dimensional mesh, the three-dimensional mesh vertex feature data and the like can be stored on the block chain.
In order to facilitate understanding of the three-dimensional mesh vertex feature determination method and the bone skinning method provided in the embodiments of the present application, taking an execution subject of the three-dimensional mesh vertex feature determination method and an execution subject of the bone skinning method as an example of the same terminal device, application scenarios of the three-dimensional mesh vertex feature determination method and the bone skinning method are exemplarily described below.
Referring to fig. 2, fig. 2 is a schematic view of an application scenario of the three-dimensional mesh vertex feature determination method and the bone skinning method provided in the embodiment of the present application. As shown in fig. 2, the application scenario includes a terminal device 210 and a database 220; the terminal device 210 may retrieve the required data from the database 220 via the network, or the database 220 may be integrated in the terminal device 210. The database 220 is used for storing the 3D Mesh to be skinned; the terminal device 210 is configured to execute the three-dimensional mesh vertex feature determination method and the bone skinning method provided by the embodiment of the present application.
In practical application, the terminal device 210 may first execute the method for determining the three-dimensional Mesh vertex characteristics provided in the embodiment of the present application, and determine the non-european space distance characteristics between the target 3D Mesh to be skinned and the target bone structure.
Specifically, the terminal device 210 may first retrieve a target 3D Mesh to be skinned from the database 220, and construct a graph topology corresponding to the 3D Mesh, where the graph topology is used to represent the target 3D Mesh in a data form. For example, the graph topology of the target 3D Mesh may be represented as(ii) a Wherein, V represents each vertex in the target 3D Mesh;representing an edge in the target 3D Mesh; a is a vertex adjacency matrix composed of 0 and 1 and used for representing connectivity between all vertexes in the target 3D Mesh, and if the target 3D Mesh comprises N vertexes, the size of A is equal to that of the vertex adjacency matrixWhere a (i, j) =1 denotes that a connection edge exists between vertex i and vertex j in the target 3D Mesh, and a (i, j) =0 denotes that a connection edge exists between vertex i and vertex j in the target 3D MeshThere is no connecting edge.
Then, the terminal device 210 may find, for each joint in the target bone structure, a representative vertex corresponding to the joint in the graph topology structure of the target 3D Mesh, and form the associated corresponding vertex representative cluster by using the representative vertex corresponding to the joint, where the vertex representative cluster corresponding to the joint can reflect a corresponding position of the joint on the target 3D Mesh. Then, the terminal device 210 may determine, for each target vertex in the graph topology structure of the target 3D Mesh, a distance between the target vertex and each joint in the target bone structure in the non-european space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure, and the position of each joint in the target bone structure, and use the distance as a non-european space distance feature between the target vertex and each joint in the target bone structure. Finally, the terminal device 210 may construct a non-euclidean distance feature between the target 3D Mesh and the target bone structure according to the non-euclidean distance feature between each target vertex and the target bone structure in the graph topology result of the target 3D Mesh.
After determining the non-european space distance characteristic between the target 3D Mesh and the target bone structure by the terminal device 210 in the above manner, the bone skinning method provided in the embodiment of the present application may be further performed, the target 3D Mesh is bound to the target bone structure, and a corresponding joint weight is configured for each vertex in the target 3D Mesh, so that the target 3D Mesh may be correspondingly stretched and deformed along with the movement of the target bone structure.
Specifically, the terminal device 210 may call a bone skin model trained in advance, and configure a corresponding joint weight for each vertex in the target 3D Mesh according to the three-dimensional Mesh vertex feature corresponding to the target 3D Mesh. Here, the three-dimensional Mesh vertex features corresponding to the target 3D Mesh at least include: the previously determined non-european space distance feature between the target 3D Mesh and the target bone structure of the terminal device 210, and the three-dimensional Mesh vertex feature corresponding to the target 3D Mesh may further include: the positions of all vertexes in the target 3D Mesh, normal vectors of all vertexes in the target 3D Mesh and Euclidean distances from all vertexes in the target 3D Mesh to all joints in the target skeleton structure.
It should be understood that the application scenario shown in fig. 1 is only an example, and in practical applications, the terminal device 210 may also independently create the target 3D Mesh to be skinned, without retrieving the target 3D Mesh to be skinned from the database 220. In addition, the three-dimensional mesh vertex feature determination method and the skeleton covering method provided by the embodiment of the application can be executed by a server; alternatively, the three-dimensional mesh vertex feature determination method and the bone skinning method provided in the embodiments of the present application may also be executed by different execution subjects, for example, the three-dimensional mesh vertex feature determination method provided in the embodiments of the present application is executed by a terminal device, and the bone skinning method provided in the embodiments of the present application is executed by a server. The application scenarios of the three-dimensional mesh vertex feature determination method and the bone skinning method provided in the embodiments of the present application are not limited at all.
The method for determining the vertex characteristics of the three-dimensional mesh provided by the present application is first described in detail through an embodiment of the method.
Referring to fig. 3, fig. 3 is a schematic flowchart of a method for determining vertex features of a three-dimensional mesh according to an embodiment of the present application. For convenience of description, the following embodiments are still introduced by taking the main implementation body of the three-dimensional mesh vertex feature determination method as an example of a terminal device. As shown in fig. 3, the method comprises the steps of:
step 301: and aiming at each joint in the target skeleton structure, searching a representative vertex corresponding to the joint in a graph topological structure of a target three-dimensional grid, and forming a vertex representative cluster corresponding to the joint.
When the terminal device determines the non-European space distance characteristic between the terminal device and the target bone structure according to the target 3D Mesh, it needs to search a representative vertex corresponding to each joint in the target bone structure from all vertices included in the target 3D Mesh, and form a vertex representative cluster corresponding to the joint by using the searched representative vertices.
It should be noted that the target 3D Mesh is a three-dimensional Mesh model structure to be skinned, and the target skeleton structure is a binding object of the target 3D Mesh. The bone skinning method provided by the embodiment of the application aims to bind the target 3D Mesh with the target bone structure, so that the target 3D Mesh can naturally stretch and deform along with the movement of the target bone structure.
Taking a scene that the skeleton skinning method provided by the embodiment of the application is applied to skeleton skinning for a 3D game skin as an example, the target 3D Mesh is a 3D game skin to be skinned, and the target skeleton structure is a game virtual character applicable to the 3D game skin. Generally, standard skeleton structures are generally bound on skins of different roles and the same Mesh precision in a game, the size and the height of the standard skeleton structures can basically determine the position and the coordinates of each part area in a 3D Mesh to be bound, and in the process of carrying out skeleton skinning on the 3D Mesh, the 3D Mesh to be skinned is usually in an a-pos standing posture, so that the standard skeleton structures are more beneficial to feature distribution of network model learning data for the skeleton skinning.
Fig. 4 is a schematic diagram illustrating the effect of bone skinning on an exemplary 3D game skin. Fig. 4 (a) shows a 3D Mesh game skin in an a-position standing posture. Fig. 4 (b) shows a standard human skeleton structure to which the 3D Mesh game skin needs to be bound, which uses 67 joints to represent the skeleton structure of the human body. The bone skinning method provided by the embodiment of the application aims to configure joint weights for each vertex in the 3D Mesh game skin shown in the step (a) so as to bind the 3D Mesh game skin with a standard human body bone structure, and therefore the effect that each part area in the 3D Mesh game skin can generate corresponding deformation and stretching under the action of different joint weights when the bound human body bone structure moves is achieved. Fig. 4 (c) shows the overall skin expression effect of the 3D Mesh game skin after the trunk (spine) joint in the human skeleton structure rotates by 45 °, and it can be seen from (c) that the peripheral region of the trunk joint in the 3D Mesh game skin is obviously stretched and deformed.
It should be understood that, in the embodiment of the present application, the target 3D Mesh may be a 3D Mesh game skin to be skinned in a game scene, may also be a 3D Mesh virtual character to be skinned in the game scene, and may also be a 3D Mesh to be skinned in other application scenes, such as a 3D Mesh of a 3D character in a 3D video or a 3D motion picture, and the present application does not limit the target 3D Mesh at all. In addition, the target bone structure in the embodiment of the present application may be a standard human bone structure, a human bone structure presenting a specific posture, or a bone structure of another object (such as an animal), and the present application does not limit the target bone structure at all.
In order to facilitate the construction of the 3D Mesh vertex feature, the terminal device may abstract the target 3D Mesh into a corresponding graph topology structure, and the graph topology structure may represent the structure of the target 3D Mesh in a data form. For example, assuming that the target 3D Mesh includes N vertices, the terminal device may abstract the target 3D Mesh as a graph topology(ii) a Wherein V represents a vertex in the target 3D Mesh;representing edges in the target 3D Mesh; a is a vertex adjacency matrix composed of 0 and 1 and used for representing connectivity between each vertex in the target 3D Mesh, and the size of A is equal toA (i, j) =1 indicates that a connection edge exists between vertex i and vertex j in the target 3D Mesh, and a (i, j) =0 indicates that a connection edge does not exist between vertex i and vertex j in the target 3D Mesh.
It should be understood that the graph topology structure of the target 3D Mesh is only an example, in practical application, the terminal device may also construct other forms of graph topology structures according to actual requirements to represent the target 3D Mesh, and the form of the graph topology structure of the target 3D Mesh is not limited in this application.
In a possible implementation manner, in order to ensure that the determined vertex representative cluster corresponding to the joint can accurately represent the corresponding position of the joint on the target 3D Mesh, the terminal device may search a representative vertex corresponding to a certain joint in a target bone structure in a graph topology structure of the target 3D Mesh in the following manner, and form the vertex representative cluster corresponding to the joint by using the searched representative vertex: searching n (n is an integer larger than 1) candidate representative vertexes in a graph topological structure of the target 3D Mesh to form a candidate representative vertex set corresponding to the joint, wherein the Euclidean distance between the candidate representative vertexes and the joint meets a preset Euclidean distance condition; furthermore, k representative vertexes (k is an integer which is greater than 1 and less than or equal to n) are collected from the candidate representative vertex set corresponding to the joint based on a target sampling strategy, and a vertex representative cluster corresponding to the joint is formed.
Specifically, when the terminal device determines the vertex representative cluster corresponding to the joint bi, n candidate representative vertices close to the joint bi in distance may be found from the target 3D Mesh according to the distance between each vertex in the target 3D Mesh and the joint bi, so as to form a candidate representative vertex set corresponding to the joint bi. Furthermore, a target sampling strategy, such as a vertex farthest sampling (Furthest Point Sample) strategy, is adopted to collect k candidate representative vertices surrounding the joint bi in the three-dimensional space from the candidate representative vertex set corresponding to the joint bi, and the k candidate representative vertices are used as the representative vertices corresponding to the joint bi to form a vertex representative cluster corresponding to the joint bi.
As an example, the terminal device may determine the candidate representative vertex set corresponding to a certain joint by any one of the following manners:
in the first mode, the Euclidean distance between each vertex in a graph topological structure of a target 3D Mesh and the joint is determined, and according to the Euclidean distance between each vertex in the graph topological structure and the joint, n vertexes with smaller Euclidean distances to the joint are selected from the graph topological structure to serve as candidate representative vertexes to form a candidate representative vertex set corresponding to the joint. Illustratively, when the terminal device determines the candidate representative vertex set corresponding to the joint bi, the terminal device may determine the candidate representative vertex set corresponding to the joint biFirstly, the Euclidean distances between each vertex and the joint bi in the graph topological structure of the target 3D Mesh are calculated, then the Euclidean distances between each vertex and the joint bi are sorted in an ascending order, and then the vertices corresponding to n Euclidean distances which are sorted in the front are selected to form a candidate representative vertex set S = { v } corresponding to the joint bii1,vi2,…,vin}。
And in the second mode, determining Euclidean distances between each vertex in a graph topological structure of the target 3D Mesh and the joint, further determining a vertex of which the Euclidean distance between the graph topological structure and the joint is within a preset Euclidean distance threshold value as a candidate representative vertex, and forming a candidate representative vertex set corresponding to the joint. For example, when the terminal device determines the candidate representative vertex set corresponding to the joint bi, it may first calculate the euclidean distance between each vertex in the graph topology structure of the target 3D Mesh and the joint bi, then use the vertices, whose euclidean distances from the graph topology structure to the joint bi are within the preset euclidean distance threshold, as candidate representative vertices, and use these candidate representative vertices to form the candidate representative vertex set S = { v } corresponding to the joint bii1,vi2,…,vin}; it should be understood that the preset euclidean distance threshold herein may be set according to actual requirements, and the preset euclidean distance threshold is not specifically limited herein.
The candidate representative vertex set corresponding to the joint is determined in the above manner, and the preliminarily searched candidate representative vertices can be ensured to have certain relevance with the joint, so that a better data basis is provided for subsequently determining the vertex representative cluster corresponding to the joint, and the accuracy of the determined vertex representative cluster corresponding to the joint is preliminarily ensured. It should be understood that the above manner for determining the candidate representative vertex set corresponding to the joint is only an example, and in practical applications, the terminal device may also determine the candidate representative vertex set corresponding to the joint in other manners according to actual requirements.
As an example, the terminal device may adopt a vertex farthest sampling strategy to collect k representative vertices from a candidate representative vertex set corresponding to a joint, so as to form a vertex representative cluster corresponding to the joint. Namely, the terminal device may select a representative vertex from the candidate representative vertex set, and migrate to the vertex representative cluster; then, aiming at each candidate representative vertex remaining in the candidate point vertex set, determining the Euclidean distance between the candidate representative vertex and the vertex representative cluster according to the Euclidean distance between the candidate representative vertex and each representative vertex in the vertex representative cluster; and then selecting representative vertexes from the remaining candidate representative vertexes in the candidate representative vertex set according to Euclidean distances between the remaining candidate representative vertexes in the candidate representative vertex set and the vertex representative cluster, and transferring the representative vertexes to the vertex representative cluster.
Illustratively, the terminal device may incrementally select representative vertices from the candidate representative vertex set, which are to be added to the vertex representative cluster. Assuming that a candidate representative vertex set corresponding to a joint bi is a, which includes n candidate representative vertices, and a vertex representative cluster corresponding to the joint bi that needs to be determined by the terminal device is B, which includes k representative vertices, the terminal device may obtain a vertex representative cluster B by:
firstly, a candidate representative vertex vi is randomly selected from a candidate representative vertex set A as an initial representative vertex, and the initial representative vertex is migrated from the candidate representative vertex set A to a vertex representative cluster B, namely B = { vi }. Then, calculating the Euclidean distance from the candidate representative vertex to a representative vertex vi included in a vertex representative cluster B as the Euclidean distance from the candidate representative vertex to the vertex representative cluster B aiming at each candidate representative vertex in the remaining n-1 candidate representative vertices in the candidate representative vertex set A; furthermore, from the n-1 candidate representative vertices, the candidate representative vertex vj with the largest Euclidean distance to the vertex representative cluster B is selected as the representative vertex, and the representative vertex is migrated from the candidate representative vertex set A to the vertex representative cluster B, namely B = { vi, vj }. Furthermore, calculating the Euclidean distance from the candidate representative vertex to the representative vertex vi included in the vertex representative cluster B and the Euclidean distance from the candidate representative vertex to the representative vertex vj for each candidate representative vertex in the remaining n-2 candidate representative vertices in the candidate representative vertex set A, and taking the smaller Euclidean distance as the Euclidean distance from the candidate representative vertex to the vertex representative cluster B; furthermore, from the n-2 candidate representative vertices, the candidate representative vertex vk with the largest euclidean distance to the vertex representative cluster B is selected as the representative vertex, and is migrated from the candidate representative vertex set a to the vertex representative cluster B, that is, B = { vi, vj, vk }. Thus, the above steps are repeatedly performed until the number of representative vertices included in the vertex representative cluster B reaches k.
It should be understood that, in practical application, when the terminal device selects the initial representative vertex from the candidate representative vertex set, in addition to selecting only one initial representative vertex to migrate to the vertex representative cluster, a plurality of initial representative vertices may also be simultaneously selected to migrate to the vertex representative cluster, and the number of the selected initial representative vertices is not limited herein. In addition, when the terminal device migrates the representative vertex from the candidate representative vertex set to the vertex representative cluster each time, in addition to only one representative vertex, a plurality of representative vertices may also be migrated, and the number of representative vertices migrated at each time is not limited in this application.
The vertex representing cluster corresponding to the joint is determined by adopting the vertex farthest sampling strategy through the mode, and the vertex included in the determined vertex representing cluster can be better ensured to surround the joint in the three-dimensional space, so that the determined vertex representing cluster can accurately represent the corresponding position of the joint on the target 3D Mesh, and the method is favorable for accurately determining the distance between the vertex on the target 3D Mesh and the joint in the non-European space. It should be understood that, in practical application, the terminal device may also adopt other sampling strategies to collect representative vertices corresponding to the joints from the candidate representative vertex set according to actual requirements to form vertex representative clusters corresponding to the joints, and the sampling strategy adopted when collecting the representative vertices corresponding to the joints is not limited in any way in this application.
Step 302: and for each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in the target bone structure under a non-European space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure and the position of each joint in the target bone structure, wherein the distance is used as a non-European space distance characteristic between the target vertex and the target bone structure.
After the terminal device determines the vertex representative cluster corresponding to each joint in the target skeleton structure, the non-European space distance characteristic between each target vertex in the target 3D Mesh and the target skeleton structure can be further determined. Specifically, for each target vertex in the graph topology structure of the target 3D Mesh, the terminal device may determine a distance between the target vertex and each joint in the target bone structure in the non-european space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure, and the position of each joint in the target bone structure, and use the distance between the target vertex and each joint in the target bone structure in the non-european space as a non-european space distance feature between the target vertex and the target bone structure.
It should be noted that the target vertex in the target 3D Mesh may be any vertex in the target 3D Mesh, or may be a specific vertex in the target 3D Mesh, and the application does not make any limitation on the target vertex in the target 3D Mesh.
In one possible implementation, the terminal device may determine the distance of the target vertex to each joint in the target bone structure in non-european space by: determining a target representative vertex corresponding to the target vertex in the vertex representative cluster corresponding to the joint, and determining a geodesic distance between the target vertex and the target representative vertex on a graph topological structure of the target 3D Mesh; then, determining the Euclidean distance between the target representative vertex and the joint; and further determining the distance from the target vertex to the joint in the non-European space according to the geodesic distance between the target vertex and the target representative vertex and the Euclidean distance between the target representative vertex and the joint.
Illustratively, the terminal device determines the target vertex vi in the target 3D Mesh to the joint bj in the target bone structure under the non-european spaceDuring distance measurement, a target representative vertex sk corresponding to a target vertex vi in a vertex representative cluster corresponding to a joint bj may be determined, and a geodesic distance g between the target vertex vi and the target representative vertex sk on the target 3D Mesh may be determinedik. Then, the terminal device needs to calculate the euclidean distance e between the target representative vertex sk and the joint bjjk. Finally, the terminal device can calculate the graph geodesic distance gikDistance e from EuclideanjkAs the distance of the target vertex vi to the joint bj in the non-european space; in addition, the terminal device may also have a preset weight value, and further, the map-to-ground distance g may be measured according to the weight valueikDistance e from EuclideanjkAnd carrying out weighted summation processing to obtain the distance from the target vertex vi to the joint bj in the non-Europe space.
Therefore, the distance from the target vertex in the target 3D Mesh to the joint in the target skeleton structure in the non-European space is determined through the method, the determined distance can be guaranteed to reflect the position relation between the target vertex and the joint in the non-European space more accurately, and further, the non-European space distance feature which can reflect the position relation between the target vertex and each joint in the target skeleton structure more accurately is constructed.
As an example, the terminal device may determine the target representative vertex corresponding to the target vertex in the vertex representative cluster corresponding to the joint by: determining a geodesic distance between the representative vertex and the target vertex according to a graph topological structure of the target 3D Mesh and aiming at each representative vertex in the vertex representative cluster corresponding to the joint, wherein the geodesic distance is used as the geodesic distance corresponding to the representative vertex; and determining the representative vertex with the minimum graph geodesic distance as the target representative vertex corresponding to the target vertex according to the graph geodesic distance corresponding to each representative vertex in the vertex representative cluster corresponding to the joint.
Specifically, considering that the graph topology structure of the target 3D Mesh can represent the structure of the target 3D Mesh in the form of data, including data representation of vertex positions in the target 3D Mesh and representation of connecting edges between vertices in the target 3D Mesh, based on this, a specific graph path distance algorithm (such as dijkstra algorithm) may be adopted to calculate a graph path distance, i.e., a graph geodesic distance, between any two vertices on the target 3D Mesh according to the graph topology structure of the target 3D Mesh.
In this embodiment of the present application, when the terminal device determines a target representative vertex corresponding to a target vertex vi in a vertex representative cluster corresponding to a joint bj, it may calculate a graph path distance between each representative vertex in the vertex representative cluster corresponding to the joint bj and the target vertex vi, and finally, select a representative vertex sk with a smallest graph path distance between the target vertex vi and the target vertex sk from the vertex representative cluster as the target representative vertex corresponding to the target vertex vi, and obtain a graph path distance between the target vertex vi and the target representative vertex sk as a graph geodesic distance between the target vertex vi and the vertex representative cluster corresponding to the joint bj, where the graph path distance is used for subsequently calculating a distance between the target vertex vi and the joint bj in a non-european space.
Therefore, the target representative vertex corresponding to the target vertex is determined in the vertex representative cluster corresponding to the joint in the mode, the position relation between the determined target representative vertex and the target vertex can be ensured, the position relation between the target vertex and the joint can be accurately reflected to a certain degree, and accurate data support is further provided for determining the distance between the target vertex and the joint in the non-European space.
Optionally, in order to ensure that the determined geodesic distance between the vertices in the target 3D Mesh is more accurate, in the embodiment of the present application, a graph topology structure with distance weight may be introduced to measure the geodesic distance between the vertices in the target 3D Mesh. That is, the terminal device may calculate, for each vertex in the graph topology of the target 3D Mesh, an euclidean distance between the vertex and its neighboring vertex as a distance weight of the graph topology; and determining the geodesic distance between the representative vertex in the vertex representative cluster corresponding to the joint and the target vertex according to the graph topological structure and the distance weight of the graph topological structure by the Dijj Tesla algorithm.
Specifically, the terminal device may calculate, based on a graph topology structure of the target 3D Mesh, a euclidean distance between each vertex and its neighboring vertex in the graph topology structure as a distance weight of the graph topology structure, where the distance weight is substantially a distance weight corresponding to a connection edge in the graph topology structure. It should be noted that, a neighbor vertex of a vertex refers to a vertex having an edge directly connected to the vertex; for example, if vertex a and vertex B are directly connected through a connecting edge, vertex B and vertex C are directly connected through a connecting edge, and there is no directly connected edge between vertex a and vertex C, vertex a and vertex B are each a neighbor vertex, vertex B and vertex C are each a neighbor vertex, and vertex a and vertex C are not a neighbor vertex; in other words, when the graph topology structure of the 3D Mesh includes the vertex adjacency matrix a composed of 0 and 1, if the connection value a (i, j) =1 between the vertex i and the vertex j, it is described that the vertex i and the vertex j are neighboring vertices, whereas if the connection value a (i, j) =0 between the vertex i and the vertex j, it is described that the vertex i and the vertex j are not neighboring vertices.
The terminal device calculates Euclidean distances between each vertex and adjacent vertices in the graph topological structure, and after the distance weight of the graph topological structure is obtained, the graph path distance between each representative vertex and a target vertex in a vertex representative cluster corresponding to the joint, namely the graph geodesic distance between each representative vertex and the target vertex, can be calculated by adopting Dijkstra algorithm based on the graph topological structure with the distance weight.
It should be understood that in practical application, the terminal device may calculate the geodesic distance between the representative vertex and the target vertex by using dijkstra algorithm, and may also calculate the geodesic distance between the representative vertex and the target vertex by using other distance calculation methods according to practical requirements; the method for calculating the geodesic distance of the adopted map is not limited at all in the application.
Therefore, a graph topological structure with distance weight is introduced to measure the graph geodesic distance between the vertexes in the target 3D Mesh, the computed graph geodesic distance can be ensured to be more accurate, and the position relation between the target vertexes and the joints in the target 3D Mesh can be more accurately reflected.
In practical applications, many vertices in the 3D Mesh are not all graph-connected, and may be composed of multiple independently-connected subgraphs, which is more common in the 3D Mesh of apparel, for example, the 3D Mesh of apparel may include many independently-connected subgraphs corresponding to accessories; for the vertex of the unconnected area in the 3D Mesh, it is difficult to measure the geodesic distance from the vertex to the corresponding vertex representing cluster of the joint through the topological structure of the graph.
In order to solve the problems, the graph topological structure of the 3D Mesh is used for measuring the graph geodesic distance from the vertex of the non-connected area in the 3D Mesh to the vertex representing cluster corresponding to the joint. That is, before determining the non-european space distance feature between the target vertex and the target bone structure in the graph topology structure, the terminal device may set, for the vertex to be expanded in the graph topology structure, vertices in the expansion range corresponding to the vertex to be expanded in the graph topology structure as neighbor vertices of the vertex to be expanded, and construct a connecting edge between the vertex to be expanded and the neighbor vertices thereof.
For example, the terminal device may regard each vertex in the target 3D Mesh as a vertex to be expanded; furthermore, for each vertex in the target 3D Mesh, a spherical range is constructed in a three-dimensional space with the vertex as a center and Mcm as a radius, and as an extended range corresponding to the vertex, each vertex in the extended range may be used as a neighboring vertex corresponding to the vertex, and a connecting edge between the vertex and its neighboring vertex is constructed.
It should be understood that, in practical applications, the terminal device may also select a part of vertices in the target 3D Mesh as vertices to be extended, for example, select vertices located at edges of the sub-connected graph as vertices to be extended, where the application does not make any limitation on the vertices to be extended in the graph topology structure of the target 3D Mesh. In addition, the extension range corresponding to the vertex to be extended is also only an example, and the terminal device may also set other types of extension ranges for the vertex to be extended, and the application does not make any limitation on the extension range corresponding to the vertex to be extended.
Therefore, through the neighbor vertex expansion mode, the terminal equipment can expand the connection edges between the neighbor vertices and the vertices aiming at the vertices of the disconnected regions in the target 3D Mesh, so that the vertices of the disconnected regions in the target 3D Mesh are connected, and the overall connectivity of the graph topological structure of the target 3D Mesh is improved.
Step 303: and determining the non-Euro-space distance characteristics between the target three-dimensional mesh and the target bone structure according to the non-Euro-space distance characteristics between each target vertex in the graph topological structure and the target bone structure.
After determining the non-european space distance features between each target vertex in the target 3D Mesh and the target bone structure through step 302, the terminal device may further combine the non-european space distance features between each target vertex in the target 3D Mesh and the target bone structure, so as to obtain the non-european space distance features between the target 3D Mesh and the target bone structure.
For example, assuming that a target 3D Mesh includes N target vertices, a target bone structure to be bound by the target 3D Mesh is a standard human bone structure including 67 joints; the size of the non-european-space distance feature between each target vertex and the target bone structure determined by the terminal device in step 302 should be 1 x 67 dimensions, wherein each dimension corresponds to the distance between the target vertex and one joint in the target bone structure in the non-european space; the terminal equipment combines non-European space distance characteristics between each of the N target vertexes and the target bone structure, and obtains the non-European space distance characteristics with dimension of N x 67, wherein the non-European space distance characteristics are the non-European space distance characteristics between the target 3D Mesh and the target bone structure.
The method for determining the vertex characteristics of the three-dimensional grid creatively provides a scheme for determining the non-European space distance between the vertex in the three-dimensional grid and the bone joint, and the distance relationship between the vertex in the three-dimensional grid and the bone joint in the non-European space is described by introducing a graph topological structure of the three-dimensional grid; compared with the Euclidean space distance characteristics, the non-Europe space distance characteristics between the three-dimensional mesh and the bone structure can more accurately reflect the position relation between the vertexes in the three-dimensional mesh and the bone joints. Correspondingly, in the process of predicting the joint weight of the vertex in the three-dimensional grid by using the bone covering model, the characteristic of the non-Europe space distance between the three-dimensional grid and the bone structure is introduced, so that the network model can be helped to more accurately predict the control relation of the bone joint to the vertex in the three-dimensional grid, the condition that the vertex in the three-dimensional grid and the bone joint are wrongly bound is avoided, the accuracy of the joint weight configured aiming at the vertex is effectively improved, a better bone covering effect is obtained, and the three-dimensional grid is smoother and more natural in the process of the motion deformation of the bound bone.
In the following, a scheme for performing automatic bone skinning using the non-european space distance characteristic between the target 3D Mesh and the target bone structure determined by the method shown in fig. 3 is described by an embodiment of the method, that is, a bone skinning method provided in the present application is described in detail.
Referring to fig. 5, fig. 5 is a schematic flow chart of a bone skinning method according to an embodiment of the present application. For convenience of description, the following embodiments are still described by taking the execution subject of the bone covering method as an example of the terminal device. As shown in fig. 5, the method comprises the steps of:
step 501: acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: the non-Euclidean distance feature between the target three-dimensional mesh and the target bone structure is determined by the three-dimensional mesh vertex feature determination method shown in FIG. 3.
When the terminal equipment carries out bone skinning on the target 3D Mesh based on the target bone structure, the vertex characteristics of the 3D Mesh corresponding to the target 3D Mesh need to be acquired. The 3D Mesh vertex features corresponding to the target 3D Mesh obtained here at least include: the non-euclidean distance between the target 3D Mesh and the target bone structure is characterized by the embodiment illustrated in figure 3 above.
In addition, in order to describe the position characteristics of the vertex in the target 3D Mesh more accurately, the acquired 3D Mesh vertex characteristics corresponding to the target 3D Mesh may further include: at least one of the position of each vertex in the target 3D Mesh and the normal vector of each vertex in the target 3D Mesh. Considering the euclidean distance from the vertex in the target 3D Mesh to the joint in the target bone structure, the euclidean distance also has a certain reference value when bone skinning is performed on the target 3D Mesh, and therefore, the obtained 3D Mesh vertex features corresponding to the target 3D Mesh may further include: euclidean distances from each vertex in the target 3D Mesh to each joint in the target bone structure.
It should be understood that, in practical application, the 3D Mesh vertex feature corresponding to the target 3D Mesh acquired by the terminal device is not limited to the above feature, and other features related to a vertex in the target 3D Mesh may also be acquired according to an actual requirement.
Step 502: and configuring joint weight for each vertex in the target three-dimensional grid through a skeleton skin model according to the vertex characteristics of the three-dimensional grid.
After the terminal equipment acquires the 3D Mesh vertex characteristics corresponding to the target 3D Mesh, a pre-trained skeleton skin model can be called; and then inputting the acquired vertex characteristics of the 3D Mesh into the skeleton skin model, and outputting the joint weight corresponding to each vertex in the target 3D Mesh after the skeleton skin model correspondingly analyzes and processes the input vertex characteristics of the 3D Mesh.
It should be noted that the above-mentioned bone covering model may be a pre-trained end-to-end neural network model for configuring joint weights for vertices in the 3D Mesh. The skeleton skin model can determine the control relation and the control degree of each joint in the skeleton structure to be bound to each vertex in the 3D Mesh by analyzing and processing the input vertex characteristics of the 3D Mesh, and further outputs the weight of the joint configured for each vertex in the 3D Mesh. The bone covering model may be a neural network model of any structure, and the structure of the bone covering model is not specifically limited herein.
According to the bone skinning method, in the process of predicting the joint weight of the vertex in the three-dimensional grid by using the bone skinning model, the non-Europe space distance characteristic between the three-dimensional grid and the bone structure is introduced, so that the network model can be helped to more accurately predict the control relation of the bone joint to the vertex in the three-dimensional grid, the situation that the vertex in the three-dimensional grid and the bone joint are wrongly bound is avoided, the accuracy of the joint weight configured aiming at the vertex is effectively improved, a better bone skinning effect is obtained, and the three-dimensional grid is smoother and more natural in the process of the motion deformation of the bound bone.
In order to further understand the technical solutions provided by the embodiments of the present application, the method provided by the embodiments of the present application is used for bone skinning for 3D Mesh of 3D game skin as an example, and the method provided by the embodiments of the present application is introduced in an overall exemplary manner.
Before bone skinning is performed on a 3D Mesh of a 3D game skin by a terminal device, the vertex characteristic of the 3D Mesh of the 3D game skin needs to be determined.
Specifically, when joint weights of each vertex in the 3D Mesh are predicted by using a deep learning algorithm, the 3D Mesh generally needs to be abstracted into a graph topology, that is, the 3D Mesh of the 3D game skin is represented in a data form. Assuming that the 3D Mesh of the 3D game skin comprises N vertexes, and the target skeleton structure to be bound by the 3D Mesh of the 3D game skin comprises B joints; the terminal device can abstract and express the 3D Mesh of the 3D game skin as graph topological structure data(ii) a Wherein V represents a vertex in a 3D Mesh of a 3D game skin;edges in a 3D Mesh representing 3D game skins; a is a vertex adjacency matrix composed of 0 and 1 and used for representing connectivity between each vertex in the 3D Mesh of the 3D game skin, and the size of A is equal to,a(i,j)=1Indicating that a connecting edge exists between vertex i and vertex j in the 3D Mesh, and a (i, j) =0 indicating that a connecting edge does not exist between vertex i and vertex j in the 3D Mesh. For vertex vi in the 3D Mesh of the 3D game skin, its set of neighbor vertices can be represented by Ni.
Since the vertices in the 3D Mesh of the 3D game skin are two independent parts from the joints in the skeletal structure to which they are bound, it is difficult to accurately measure the distances from the vertices in the 3D Mesh to the respective joints in non-european space. Therefore, the distance relationship between the vertex in the 3D Mesh of the 3D game skin and the joint in the skeleton structure under the non-Euro space is approximately described by introducing the graph topological structure of the 3D Mesh. The specific idea is that a vertex representative cluster corresponding to a joint in a skeleton structure is found in a graph topological structure of a 3D Mesh, and the vertex representative cluster corresponding to the joint approximately depicts the position of the joint in the graph topological structure of the 3D Mesh, so that the graph geodesic distance from the vertex in the 3D Mesh to the vertex representative cluster corresponding to the joint can be determined by using the graph topological structure of the 3D Mesh, and the distance from the vertex in the 3D Mesh to the joint in the skeleton structure in a non-European space can be expressed.
The method for determining the distance from the vertex in the 3D Mesh of the 3D game skin to the joint in the skeleton structure under the non-European space based on the vertex representative cluster corresponding to the joint mainly comprises the following steps:
(1) for each joint in the skeleton structure, a group of vertexes around the joint is found in the graph topology structure of the 3D Mesh of the 3D game skin, and a vertex representative cluster corresponding to the joint is formed.
(2) By constructing neighbor vertexes in the graph topological structure of the 3D Mesh of the 3D game skin, connecting edges among the vertexes in the 3D Mesh are increased, and therefore connectivity of the graph topological structure of the 3D Mesh is improved.
(3) Based on the graph topological structure of the 3D Mesh of the 3D game skin, the graph geodesic distance from the vertex on the 3D Mesh to the vertex representative cluster corresponding to the joint is calculated, the Euclidean distance between the target representative vertex corresponding to the vertex in the vertex representative cluster and the joint is calculated, and the distance representation from the vertex to the joint in the non-Euro space is obtained by combining the graph geodesic distance from the vertex to the vertex representative cluster and the Euclidean distance between the target representative vertex and the joint.
These three steps are described in detail one by one.
First, the determination of the vertex-representative cluster corresponding to the joint is described. The method for determining the vertex representative cluster corresponding to the joint mainly comprises the following two steps:
the first step is to calculate the Euclidean distance from the joint bi to each vertex on the 3D Mesh of the 3D game skin, select n vertices with smaller Euclidean distance from the calculated Euclidean distances, and form a candidate representative vertex set S = { v } corresponding to the joint bii1,vi2,…,vinAnd the step is to search n candidate representative vertexes which are close to the joints on the 3D Mesh.
Secondly, collecting k representative vertexes from a candidate representative vertex set corresponding to the joint bi by adopting a vertex farthest sampling strategy to form a vertex representative cluster R = { v = corresponding to the joint bii1,vi2,…,vik}. The purpose of adopting the vertex farthest sampling strategy in the step is to collect representative vertexes surrounding the joint in a three-dimensional space, so that the generated vertex representative cluster corresponding to the joint is more reasonable.
The main idea of the vertex farthest sampling strategy is to sample k representative vertices with the largest vertex distance from the candidate representative vertex set S. Assuming that the candidate representative vertex set S includes n candidate representative vertices, a vertex representative cluster B is obtained by using a vertex farthest sampling strategy, where the vertex representative cluster B includes k representative vertices, and the vertex farthest sampling strategy includes the following specific implementation steps:
firstly, a candidate representative vertex vi is randomly selected from a candidate representative vertex set S as an initial representative vertex, and is migrated from the candidate representative vertex set S to a vertex representative cluster B, i.e., B = { vi }. Then, calculating the Euclidean distance from each candidate representative vertex in the remaining n-1 candidate representative vertices in the candidate representative vertex set S to a representative vertex vi included in a vertex representative cluster B, and taking the Euclidean distance as the Euclidean distance from the candidate representative vertex to the vertex representative cluster B; furthermore, from the n-1 candidate representative vertices, the candidate representative vertex vj with the largest Euclidean distance to the vertex representative cluster B is selected as the representative vertex, and is migrated from the candidate representative vertex set S to the vertex representative cluster B, that is, B = { vi, vj }. Further, calculating the Euclidean distance from the candidate representative vertex to the representative vertex vi included in the vertex representative cluster B and the Euclidean distance from the candidate representative vertex to the representative vertex vj for each candidate representative vertex in the remaining n-2 candidate representative vertices in the candidate representative vertex set S, and taking the smaller Euclidean distance as the Euclidean distance from the candidate representative vertex to the vertex representative cluster B; further, from the n-2 candidate representative vertices, the candidate representative vertex vk having the largest euclidean distance to the vertex representative cluster B is selected as the representative vertex, and is migrated from the candidate representative vertex set S to the vertex representative cluster B, that is, B = { vi, vj, vk }. Thus, the above steps are repeatedly performed until the number of representative vertices included in the vertex representative cluster B reaches k.
Next, an implementation of extending neighbor vertices and connecting edges is introduced.
Since all vertices in the 3D Mesh of the 3D game skin are not usually graph-connected but are composed of a plurality of connected subgraphs, for example, the 3D Mesh of the 3D game garment may include a large number of accessories of independent connected subgraphs, and it is difficult to measure the graph-measuring geodesic distance from the vertices corresponding to the joints to the cluster represented by the vertices corresponding to the joints by the graph topology structure for the vertices of the unconnected areas in the 3D Mesh. Aiming at the problem that vertices of unconnected areas exist in the 3D Mesh, the embodiment of the application provides an implementation mode capable of improving connectivity between vertices in the 3D Mesh from the perspective of expanding connecting edges between neighboring vertices and vertices.
The specific implementation mode is as follows: and aiming at each vertex in the 3D Mesh of the 3D game skin, constructing a spherical range in a three-dimensional space by taking the vertex as a center and Mcm as a radius, wherein the spherical range is used as an expansion range corresponding to the vertex, and all vertexes in the expansion range can share a neighbor vertex. By the mode, the vertex of the disconnected region in the 3D Mesh of the 3D game skin is expanded with the connecting edge between the neighboring vertex and the vertex, so that the vertices of the disconnected region in the 3D Mesh can be effectively connected, and the overall connectivity of the graph topological structure of the 3D Mesh is improved.
Finally, the way to calculate the distance of the vertices in the 3D Mesh to the joint in non-european space is described.
When the distance from a vertex in the 3D Mesh to a joint in a non-European space is calculated, the graph topological structure of the 3D Mesh with the distance weight is introduced for measurement, and the specific implementation mode is as follows:
firstly, by using a graph topological structure of 3D Mesh of 3D game skin, calculating Euclidean distances between each vertex and adjacent vertexes thereof, and taking the Euclidean distances as distance weights of the graph topological structure, namely, the distance weights are configured on connecting edges between the vertexes. Then, based on a graph topological structure with distance weight, calculating graph path distances between each representative vertex in a vertex representative cluster corresponding to a joint bj and a vertex vi in the 3D Mesh through a Dijjack Tesla algorithm, selecting a representative vertex sk with the shortest graph path distance between the vertices vi from the vertex representative cluster corresponding to the joint bj, taking the representative vertex sk as a target representative vertex corresponding to the vertex vi in the vertex representative cluster corresponding to the joint bj, and taking the graph path distance between the target representative vertex sk and the vertex vi as a graph geodesic line distance g from the vertex vi to the vertex representative cluster corresponding to the joint bjik. Further, the euclidean distance e between the target representative vertex sk and the joint bj can be calculatedij. Finally, calculating the geodesic distance g of the vertex from the vertex vi to the vertex representing cluster corresponding to the joint bjikAnd Euclidean distance e between the target representative vertex sk and the joint bjijIs taken as the distance of the vertex vi to the joint bj in non-european space.
In this way, the distance from each vertex in the 3D Mesh of the 3D game skin in the non-european space to each joint in the bone structure to be bound is calculated in the above manner, and the non-european space distance feature between the 3D Mesh of the 3D game skin and the bone structure is formed by using the calculated distance in each non-european space.
Furthermore, the terminal device may utilize a bone skinning model trained in advance, and perform bone skinning on the 3D Mesh of the 3D game skin according to a non-european space distance characteristic between the 3D Mesh of the 3D game skin and a bone structure to be bound, a position of each vertex in the 3D Mesh of the 3D game skin, a normal vector of each vertex in the 3D Mesh of the 3D game skin, and a european space distance characteristic between the 3D Mesh of the 3D game skin and the bone structure to be bound, that is, configuring a corresponding joint weight for each vertex in the 3D Mesh of the 3D game skin, so that the 3D game skin may generate corresponding stretching and deformation along with the motion of the bound bone structure.
By using the method provided by the embodiment of the application, the 3D Mesh shown in (a) in fig. 1 is subjected to bone skinning, and the obtained bone skinning effect is shown in fig. 6. As can be seen from the schematic diagram of the bone covering effect shown in fig. 6, when the 3D Mesh lifts the hand, the vertex of the skirt edge is not deformed, that is, the vertex of the skirt edge is not bound to the hand joint by mistake, which also verifies that the method provided by the embodiment of the present application can effectively improve the accuracy of the joint weight of the bone covering model predicted for the vertex on the 3D Mesh, and can significantly improve the bone covering effect.
Aiming at the three-dimensional mesh vertex feature determination method and the bone covering method, the application also provides a corresponding three-dimensional mesh vertex feature determination device and a corresponding bone covering device, so that the three-dimensional mesh vertex feature determination method and the bone covering method are applied and realized in practice.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a three-dimensional mesh vertex feature determination apparatus 700 corresponding to the three-dimensional mesh vertex feature determination method shown in fig. 3. As shown in fig. 7, the three-dimensional mesh vertex feature determination apparatus 700 includes:
a vertex representative cluster determining module 701, configured to, for each joint in a target bone structure, search a representative vertex corresponding to the joint in a graph topology structure of a target three-dimensional mesh to form a vertex representative cluster corresponding to the joint;
a non-european space distance determining module 702, configured to determine, for each target vertex in the graph topology structure, a distance from the target vertex to each joint in the target bone structure in a non-european space according to a position of the target vertex, a position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure, and a position of each joint in the target bone structure, as a non-european space distance feature between the target vertex and the target bone structure;
a mesh vertex feature determining module 703, configured to determine, according to a non-euclidean distance feature between each target vertex in the graph topology and the target bone structure, a non-euclidean distance feature between the target three-dimensional mesh and the target bone structure.
Optionally, on the basis of the three-dimensional mesh vertex feature determination apparatus 700 shown in fig. 7, referring to fig. 8, fig. 8 is a schematic structural diagram of another three-dimensional mesh vertex feature determination apparatus 800 provided in this embodiment of the present application. As shown in fig. 8, the vertex representative cluster determining module 701 includes:
a candidate representative vertex searching sub-module 801, configured to search n candidate representative vertices in the graph topology structure, and form a candidate representative vertex set corresponding to the joint; the Euclidean distance between the candidate representative vertex and the joint meets a preset Euclidean distance condition; n is an integer greater than 1;
a representative vertex collecting sub-module 802, configured to collect k representative vertices from a candidate representative vertex set corresponding to the joint based on a target sampling policy, so as to form a vertex representative cluster corresponding to the joint; the target sampling strategy is used for controlling the k representative vertexes acquired from the candidate representative vertex set to surround the joint in a three-dimensional space; and k is an integer greater than 1 and less than or equal to n.
Optionally, on the basis of the three-dimensional mesh vertex feature determining apparatus 800 shown in fig. 8, the representative vertex collecting sub-module 802 is specifically configured to:
selecting representative vertexes from the candidate representative vertex set, and transferring to the vertex representative cluster;
determining the Euclidean distance between the candidate representative vertex and the vertex representative cluster according to the Euclidean distance between the candidate representative vertex and each representative vertex in the vertex representative cluster aiming at each remaining candidate representative vertex in the candidate representative vertex set;
and selecting representative vertexes from the remaining candidate representative vertexes in the candidate representative vertex set according to Euclidean distances between the remaining candidate representative vertexes in the candidate representative vertex set and the vertex representative cluster, and transferring the representative vertexes to the vertex representative cluster.
Optionally, on the basis of the apparatus 800 for determining vertex features of a three-dimensional mesh shown in fig. 8, the candidate vertex search sub-module 801 is specifically configured to:
determining Euclidean distances between each vertex in the graph topology and the joint; according to the Euclidean distance between each vertex in the graph topological structure and the joint, selecting n vertexes with smaller Euclidean distances between the n vertexes and the joint from the graph topological structure as candidate representative vertexes to form a candidate representative vertex set;
or determining Euclidean distances between each vertex in the graph topology and the joint; and determining vertexes, within a preset Euclidean distance threshold, of the graph topological structure and between the graph topological structure and the joints as candidate representative vertexes to form the candidate representative vertex set.
Alternatively, on the basis of the three-dimensional mesh vertex feature determination apparatus 700 shown in fig. 7, referring to fig. 9, fig. 9 is a schematic structural diagram of another three-dimensional mesh vertex feature determination apparatus 900 provided in this embodiment of the present application. As shown in fig. 9, the non-euclidean distance determining module 702 includes:
a map geodesic distance determining submodule 901, configured to determine a target representative vertex corresponding to the target vertex in the vertex representative cluster corresponding to the joint; and determining a geodesic distance between the target vertex and the target representative vertex on the graph topology;
a euclidean distance determining submodule 902 for determining a euclidean distance between the target representative vertex and the joint;
a non-european space distance determining submodule 903, configured to determine, according to a geodesic distance between the target vertex and the target representative vertex, and an euclidean distance between the target representative vertex and the joint, a distance between the target vertex and the joint in the non-european space.
Optionally, on the basis of the three-dimensional mesh vertex feature determining apparatus 900 shown in fig. 9, the map geodesic distance determining submodule 901 is specifically configured to:
determining a geodesic distance between the representative vertex and the target vertex according to the graph topological structure for each representative vertex in the vertex representative cluster corresponding to the joint, wherein the geodesic distance is used as the geodesic distance corresponding to the representative vertex;
and determining the representative vertex with the minimum graph geodesic distance as the target representative vertex corresponding to the target vertex according to the graph geodesic distance corresponding to each representative vertex in the vertex representative cluster corresponding to the joint.
Optionally, on the basis of the three-dimensional mesh vertex feature determining apparatus 900 shown in fig. 9, the map geodesic distance determining submodule 901 is specifically configured to:
calculating Euclidean distances between each vertex in the graph topological structure and the adjacent vertex as distance weights of the graph topological structure;
determining, by dijkstra's algorithm, a geodesic distance between the representative vertex and the target vertex from the graph topology and a distance weight of the graph topology.
Optionally, on the basis of the three-dimensional mesh vertex feature determination apparatus 700 shown in fig. 7, referring to fig. 10, fig. 10 is a schematic structural diagram of another three-dimensional mesh vertex feature determination apparatus 1000 according to an embodiment of the present application. As shown in fig. 10, the apparatus further includes:
and the neighbor vertex extension module 1001 is configured to set, for a vertex to be extended in the graph topology structure, a vertex located in an extension range corresponding to the vertex to be extended in the graph topology structure as a neighbor vertex of the vertex to be extended, and construct a connecting edge between the vertex to be extended and the neighbor vertex.
Referring to fig. 11, fig. 11 is a schematic structural view of a bone skinning device 1100 corresponding to the bone skinning method described above in fig. 5. As shown in fig. 11, the bone skinning device 1100 comprises:
the feature acquisition module 1101 is configured to acquire three-dimensional mesh vertex features corresponding to a target three-dimensional mesh to be skinned; the three-dimensional mesh vertex features at least comprise: determining a non-Euclidean distance feature between the target three-dimensional mesh and a target bone structure by the three-dimensional mesh vertex feature determination method shown in FIG. 3;
and a bone skinning module 1102, configured to configure, through a bone skinning model, a joint weight for each vertex in the target three-dimensional mesh according to the three-dimensional mesh vertex characteristics.
Optionally, the three-dimensional mesh vertex feature further includes: the positions of all vertexes in the target three-dimensional grid, normal vectors of all vertexes in the target three-dimensional grid, and Euclidean distances from all vertexes in the target three-dimensional grid to all joints in the target skeleton structure.
The device for determining the vertex characteristics of the three-dimensional grid creatively provides a scheme for determining the non-European space distance between the vertex in the three-dimensional grid and the bone joint, and the distance relationship between the vertex in the three-dimensional grid and the bone joint in the non-European space is described by introducing a graph topological structure of the three-dimensional grid; compared with the Euclidean space distance characteristics, the non-Europe space distance characteristics between the three-dimensional mesh and the bone structure can more accurately reflect the position relation between the vertexes in the three-dimensional mesh and the bone joints. Correspondingly, in the process of predicting the joint weight of the vertex in the three-dimensional grid by using the bone covering model, the non-Europe space distance characteristic between the three-dimensional grid and the bone structure is introduced, so that the network model can be helped to more accurately predict the control relation of the bone joint to the vertex in the three-dimensional grid, the condition that the vertex in the three-dimensional grid and the bone joint are wrongly bound is avoided, the accuracy of the joint weight configured aiming at the vertex is effectively improved, a better bone covering effect is obtained, and the three-dimensional grid is smoother and more natural in the process of the motion deformation of the bound bone.
The embodiment of the present application further provides a device for determining a three-dimensional mesh vertex feature and a bone skin, where the device may specifically be a terminal device or a server, and the terminal device and the server provided in the embodiment of the present application will be described in terms of hardware implementation.
Referring to fig. 12, fig. 12 is a schematic structural diagram of a terminal device provided in an embodiment of the present application. As shown in fig. 12, for convenience of explanation, only the portions related to the embodiments of the present application are shown, and details of the specific techniques are not disclosed, please refer to the method portion of the embodiments of the present application. The terminal may be any terminal device including a mobile phone, a tablet computer, a Personal Digital Assistant (PDA, abbreviated as "Personal Digital Assistant"), a Sales terminal (POS, abbreviated as "Point of Sales"), a vehicle-mounted computer, and the like, taking the terminal as a computer as an example:
fig. 12 is a block diagram showing a partial structure of a computer related to a terminal provided in an embodiment of the present application. Referring to fig. 12, the computer includes: radio Frequency (RF) circuit 1210, memory 1220, input unit 1230 (including touch panel 1231 and other input devices 1232), display unit 1240 (including display panel 1241), sensor 1250, audio circuit 1260 (which may be connected to speaker 1261 and microphone 1262), wireless fidelity (WiFi) module 1270, processor 1280, and power supply 1290. Those skilled in the art will appreciate that the computer architecture shown in FIG. 12 is not intended to be limiting of computers, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
The memory 1220 may be used to store software programs and modules, and the processor 1280 performs various functional applications of the computer and data processing by operating the software programs and modules stored in the memory 1220. The memory 1220 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the computer, etc. Further, the memory 1220 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 1280 is a control center of the computer, connects various parts of the entire computer using various interfaces and lines, performs various functions of the computer and processes data by running or executing software programs and/or modules stored in the memory 1220 and calling data stored in the memory 1220, thereby monitoring the entire computer. Optionally, processor 1280 may include one or more processing units; preferably, the processor 1280 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into the processor 1280.
In this embodiment, the processor 1280 included in the terminal further has the following functions:
aiming at each joint in a target skeleton structure, searching a representative vertex corresponding to the joint in a graph topological structure of a target three-dimensional grid to form a vertex representative cluster corresponding to the joint;
for each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in the target bone structure under a non-European space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure and the position of each joint in the target bone structure, wherein the distance is used as a non-European space distance characteristic between the target vertex and the target bone structure;
and determining the non-Euro-space distance characteristics between the target three-dimensional mesh and the target bone structure according to the non-Euro-space distance characteristics between each target vertex in the graph topological structure and the target bone structure.
Or,
acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: determining a non-Euclidean distance feature between the target three-dimensional mesh and a target bone structure by the three-dimensional mesh vertex feature determination method shown in FIG. 3;
and configuring joint weight for each vertex in the target three-dimensional grid through a skeleton skin model according to the vertex characteristics of the three-dimensional grid.
Optionally, the processor 1280 is further configured to execute the steps of any one implementation manner of the three-dimensional mesh vertex feature determination method and the bone covering method provided in the embodiments of the present application.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a server 1300 according to an embodiment of the present disclosure. The server 1300 may vary widely in configuration or performance and may include one or more Central Processing Units (CPUs) 1322 (e.g., one or more processors) and memory 1332, one or more storage media 1330 (e.g., one or more mass storage devices) storing applications 1342 or data 1344. Memory 1332 and storage medium 1330 may be, among other things, transitory or persistent storage. The program stored on the storage medium 1330 may include one or more modules (not shown), each of which may include a sequence of instructions operating on a server. Still further, the central processor 1322 may be arranged in communication with the storage medium 1330, executing a sequence of instruction operations in the storage medium 1330 on the server 1300.
The server 1300 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input-output interfaces 1358, and/or one or more operating systems, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The steps performed by the server in the above embodiment may be based on the server structure shown in fig. 13.
aiming at each joint in a target skeleton structure, searching a representative vertex corresponding to the joint in a graph topological structure of a target three-dimensional grid to form a vertex representative cluster corresponding to the joint;
for each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in the target bone structure under a non-European space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure and the position of each joint in the target bone structure, wherein the distance is used as a non-European space distance characteristic between the target vertex and the target bone structure;
and determining the non-Euro-space distance characteristics between the target three-dimensional mesh and the target bone structure according to the non-Euro-space distance characteristics between each target vertex in the graph topological structure and the target bone structure.
Or,
acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: determining a non-Euclidean distance feature between the target three-dimensional mesh and a target bone structure by the three-dimensional mesh vertex feature determination method shown in FIG. 3;
and configuring joint weight for each vertex in the target three-dimensional grid through a skeleton skin model according to the vertex characteristics of the three-dimensional grid.
Optionally, CPU 1322 may also be configured to perform the steps of any one implementation of the three-dimensional mesh vertex feature determination method and the bone skinning method provided in the embodiments of the present application.
The embodiments of the present application further provide a computer-readable storage medium for storing a computer program for executing any one of the embodiments of the three-dimensional mesh vertex feature determination method and the bone skinning method described in the foregoing embodiments.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute any one of the three-dimensional mesh vertex feature determination method and the bone skinning method described in the foregoing embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing computer programs.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.
Claims (14)
1. A method for determining vertex features of a three-dimensional mesh, the method comprising:
aiming at each joint in a target skeleton structure, searching a representative vertex corresponding to the joint in a graph topological structure of a target three-dimensional grid to form a vertex representative cluster corresponding to the joint;
for each target vertex in the graph topological structure, determining the distance from the target vertex to each joint in the target bone structure under a non-European space according to the position of the target vertex, the position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure and the position of each joint in the target bone structure, wherein the distance is used as a non-European space distance characteristic between the target vertex and the target bone structure;
determining non-Euclidean distance features between the target three-dimensional mesh and the target bone structure according to the non-Euclidean distance features between each target vertex in the graph topological structure and the target bone structure;
determining a distance of the target vertex to each joint in the target bone structure in non-Euro space by:
determining a target representative vertex corresponding to the target vertex in the vertex representative cluster corresponding to the joint; and determining a geodesic distance between the target vertex and the target representative vertex on the graph topology;
determining Euclidean distance between the target representative vertex and the joint;
and determining the distance from the target vertex to the joint in the non-European space according to the geodesic distance between the target vertex and the target representative vertex and the Euclidean distance between the target representative vertex and the joint.
2. The method according to claim 1, wherein the finding representative vertices corresponding to the joints in the graph topology of the target three-dimensional mesh to form representative clusters of vertices corresponding to the joints comprises:
searching n candidate representative vertexes in the graph topological structure to form a candidate representative vertex set corresponding to the joint; the Euclidean distance between the candidate representative vertex and the joint meets a preset Euclidean distance condition; n is an integer greater than 1;
collecting k representative vertexes from a candidate representative vertex set corresponding to the joint based on a target sampling strategy to form a vertex representative cluster corresponding to the joint; the target sampling strategy is used for controlling the k representative vertexes acquired from the candidate representative vertex set to surround the joint in a three-dimensional space; and k is an integer greater than 1 and less than or equal to n.
3. The method according to claim 2, wherein the collecting k representative vertices from the candidate representative vertex set corresponding to the joint based on the target sampling strategy to form the representative vertex cluster corresponding to the joint comprises:
selecting representative vertexes from the candidate representative vertex set, and transferring to the vertex representative cluster;
determining the Euclidean distance between the candidate representative vertex and the vertex representative cluster according to the Euclidean distance between the candidate representative vertex and each representative vertex in the vertex representative cluster aiming at each remaining candidate representative vertex in the candidate representative vertex set;
and selecting representative vertexes from the remaining candidate representative vertexes in the candidate representative vertex set according to Euclidean distances between the remaining candidate representative vertexes in the candidate representative vertex set and the vertex representative cluster, and transferring the representative vertexes to the vertex representative cluster.
4. The method according to claim 2, wherein the step of finding n candidate representative vertices in the graph topology to form a set of candidate representative vertices corresponding to the joints comprises any one of:
determining Euclidean distances between each vertex in the graph topology and the joint; according to the Euclidean distance between each vertex in the graph topological structure and the joint, selecting n vertexes with smaller Euclidean distances between the n vertexes and the joint from the graph topological structure as candidate representative vertexes to form a candidate representative vertex set;
determining Euclidean distances between each vertex in the graph topology and the joint; and determining vertexes, within a preset Euclidean distance threshold, of the graph topological structure and between the graph topological structure and the joints as candidate representative vertexes to form the candidate representative vertex set.
5. The method of claim 1, wherein the determining a target representative vertex in the representative cluster of vertices corresponding to the joint that corresponds to the target vertex comprises:
determining a geodesic distance between the representative vertex and the target vertex according to the graph topological structure for each representative vertex in the vertex representative cluster corresponding to the joint, wherein the geodesic distance is used as the geodesic distance corresponding to the representative vertex;
and determining the representative vertex with the minimum graph geodesic distance as the target representative vertex corresponding to the target vertex according to the graph geodesic distance corresponding to each representative vertex in the vertex representative cluster corresponding to the joint.
6. The method of claim 5, wherein determining the geodesic distance between the representative vertex and the target vertex from the graph topology comprises:
calculating Euclidean distances between each vertex in the graph topological structure and the adjacent vertex as distance weights of the graph topological structure;
determining, by dijkstra's algorithm, a geodesic distance between the representative vertex and the target vertex from the graph topology and a distance weight of the graph topology.
7. The method of claim 1, further comprising:
and aiming at the vertex to be expanded in the graph topological structure, setting the vertex positioned in the expansion range corresponding to the vertex to be expanded in the graph topological structure as the neighbor vertex of the vertex to be expanded, and constructing a connecting edge between the vertex to be expanded and the neighbor vertex.
8. A method of bone skinning, comprising:
acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: a non-Euclidean distance feature between the target three-dimensional mesh and a target bone structure determined by the three-dimensional mesh vertex feature determination method of any one of claims 1 to 7;
and configuring joint weight for each vertex in the target three-dimensional grid through a skeleton skin model according to the vertex characteristics of the three-dimensional grid.
9. The method of claim 8, wherein the three-dimensional mesh vertex feature further comprises: the positions of all vertexes in the target three-dimensional grid, normal vectors of all vertexes in the target three-dimensional grid, and Euclidean distances from all vertexes in the target three-dimensional grid to all joints in the target skeleton structure.
10. An apparatus for determining vertex features of a three-dimensional mesh, the apparatus comprising:
the vertex representative cluster determining module is used for searching a representative vertex corresponding to each joint in a graph topological structure of a target three-dimensional grid aiming at each joint in a target skeleton structure to form a vertex representative cluster corresponding to each joint;
a non-European space distance determining module, configured to determine, for each target vertex in the graph topology structure, a distance from the target vertex to each joint in the target bone structure in a non-European space according to a position of the target vertex, a position of a representative vertex included in a vertex representative cluster corresponding to each joint in the target bone structure, and a position of each joint in the target bone structure, as a non-European space distance feature between the target vertex and the target bone structure;
the mesh vertex characteristic determining module is used for determining the non-European space distance characteristic between the target three-dimensional mesh and the target bone structure according to the non-European space distance characteristic between each target vertex in the graph topological structure and the target bone structure;
the non-euclidean distance determining module is specifically configured to:
determining a target representative vertex corresponding to the target vertex in the vertex representative cluster corresponding to the joint; and determining a geodesic distance between the target vertex and the target representative vertex on the graph topology;
determining Euclidean distance between the target representative vertex and the joint;
and determining the distance from the target vertex to the joint in the non-European space according to the geodesic distance between the target vertex and the target representative vertex and the Euclidean distance between the target representative vertex and the joint.
11. The apparatus of claim 10, wherein the vertex representative cluster determining module comprises:
the candidate representative vertex searching submodule is used for searching n candidate representative vertexes in the graph topological structure to form a candidate representative vertex set corresponding to the joint; the Euclidean distance between the candidate representative vertex and the joint meets a preset Euclidean distance condition; n is an integer greater than 1;
a representative vertex acquisition submodule, configured to acquire k representative vertices from a candidate representative vertex set corresponding to the joint based on a target sampling policy, and form a vertex representative cluster corresponding to the joint; the target sampling strategy is used for controlling the k representative vertexes acquired from the candidate representative vertex set to surround the joint in a three-dimensional space; and k is an integer greater than 1 and less than or equal to n.
12. A bone skinning device, characterized in that it comprises:
the characteristic acquisition module is used for acquiring three-dimensional grid vertex characteristics corresponding to a target three-dimensional grid to be skinned; the three-dimensional mesh vertex features at least comprise: a non-Euclidean distance feature between the target three-dimensional mesh and a target bone structure determined by the three-dimensional mesh vertex feature determination method of any one of claims 1 to 7;
and the skeleton covering module is used for configuring joint weight for each vertex in the target three-dimensional mesh according to the vertex characteristics of the three-dimensional mesh through a skeleton covering model.
13. An electronic device, comprising a processor and a memory;
the memory is used for storing a computer program;
the processor is configured to perform the three-dimensional mesh vertex feature determination method of any one of claims 1 to 7 or the bone skinning method of any one of claims 8 to 9 in accordance with the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium is configured to store a computer program for performing the method for three-dimensional mesh vertex feature determination of any of claims 1 to 7 or the method for bone skinning of any of claims 8 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110484068.1A CN112884868B (en) | 2021-04-30 | 2021-04-30 | Three-dimensional mesh vertex feature determination method, skeleton covering method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110484068.1A CN112884868B (en) | 2021-04-30 | 2021-04-30 | Three-dimensional mesh vertex feature determination method, skeleton covering method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112884868A CN112884868A (en) | 2021-06-01 |
CN112884868B true CN112884868B (en) | 2021-07-13 |
Family
ID=76040274
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110484068.1A Active CN112884868B (en) | 2021-04-30 | 2021-04-30 | Three-dimensional mesh vertex feature determination method, skeleton covering method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112884868B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113658309B (en) * | 2021-08-25 | 2023-08-01 | 北京百度网讯科技有限公司 | Three-dimensional reconstruction method, device, equipment and storage medium |
CN114241100B (en) * | 2022-02-25 | 2022-06-03 | 腾讯科技(深圳)有限公司 | Skinning method, skinning device, skinning apparatus, skinning medium, and program product for virtual object |
CN115409924A (en) * | 2022-11-02 | 2022-11-29 | 广州美术学院 | Method for automatically setting weight of skeleton skin for animation modeling |
CN117978937B (en) * | 2024-03-28 | 2024-06-25 | 之江实验室 | Video generation method and device, storage medium and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018011336A1 (en) * | 2016-07-13 | 2018-01-18 | Naked Labs Austria Gmbh | Skeleton estimation from body mesh |
CN109993819A (en) * | 2019-04-09 | 2019-07-09 | 网易(杭州)网络有限公司 | Skinning method and device, the electronic equipment of virtual role |
CN111598980A (en) * | 2020-05-14 | 2020-08-28 | 北京华严互娱科技有限公司 | Skin weight automatic calculation method and calculation system |
CN111714885A (en) * | 2020-06-22 | 2020-09-29 | 网易(杭州)网络有限公司 | Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium |
CN112598773A (en) * | 2020-12-31 | 2021-04-02 | 珠海金山网络游戏科技有限公司 | Method and device for realizing skeleton skin animation |
CN112712578A (en) * | 2020-12-31 | 2021-04-27 | 魔珐(上海)信息科技有限公司 | Virtual character model creating method and device, electronic equipment and storage medium |
-
2021
- 2021-04-30 CN CN202110484068.1A patent/CN112884868B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018011336A1 (en) * | 2016-07-13 | 2018-01-18 | Naked Labs Austria Gmbh | Skeleton estimation from body mesh |
CN109993819A (en) * | 2019-04-09 | 2019-07-09 | 网易(杭州)网络有限公司 | Skinning method and device, the electronic equipment of virtual role |
CN111598980A (en) * | 2020-05-14 | 2020-08-28 | 北京华严互娱科技有限公司 | Skin weight automatic calculation method and calculation system |
CN111714885A (en) * | 2020-06-22 | 2020-09-29 | 网易(杭州)网络有限公司 | Game role model generation method, game role model generation device, game role adjustment device and game role adjustment medium |
CN112598773A (en) * | 2020-12-31 | 2021-04-02 | 珠海金山网络游戏科技有限公司 | Method and device for realizing skeleton skin animation |
CN112712578A (en) * | 2020-12-31 | 2021-04-27 | 魔珐(上海)信息科技有限公司 | Virtual character model creating method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
DualConvMesh-Net:Joint Geodesic and Euclidean Convolutions on 3D Meshes;Jonas Schult 等;《2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)》;20201231;第8609-8616页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112884868A (en) | 2021-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112884868B (en) | Three-dimensional mesh vertex feature determination method, skeleton covering method and related device | |
CN111626218B (en) | Image generation method, device, equipment and storage medium based on artificial intelligence | |
Nibali et al. | 3d human pose estimation with 2d marginal heatmaps | |
CN113496507B (en) | Human body three-dimensional model reconstruction method | |
CN111325846B (en) | Expression base determination method, avatar driving method, device and medium | |
US9020250B2 (en) | Methods and systems for building a universal dress style learner | |
CN112991502B (en) | Model training method, device, equipment and storage medium | |
CN111444828A (en) | Model training method, target detection method, device and storage medium | |
CN111931764B (en) | Target detection method, target detection frame and related equipment | |
CN112991503B (en) | Model training method, device, equipment and medium based on skin weight | |
CN109815776B (en) | Action prompting method and device, storage medium and electronic device | |
CN110852942B (en) | Model training method, and media information synthesis method and device | |
CN111191599A (en) | Gesture recognition method, device, equipment and storage medium | |
CN113902876B (en) | Bone skinning method, bone skinning device, computer equipment and storage medium | |
CN112827168B (en) | Target tracking method, device and storage medium | |
CN113822254B (en) | Model training method and related device | |
CN112699832B (en) | Target detection method, device, equipment and storage medium | |
CN113808277B (en) | Image processing method and related device | |
CN113238972A (en) | Image detection method, device, equipment and storage medium | |
CN114998490B (en) | Virtual object generation method, device, equipment and storage medium | |
CN115083015A (en) | 3D human body posture estimation data labeling mode and corresponding model construction method | |
CN111291611A (en) | Pedestrian re-identification method and device based on Bayesian query expansion | |
CN112991501B (en) | Data processing method, device and computer readable storage medium | |
CN115861572A (en) | Three-dimensional modeling method, device, equipment and storage medium | |
CN117009878A (en) | Hypergraph-based classification method, hypergraph-based classification device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40046385 Country of ref document: HK |