Three-dimensional model skinning method, device, equipment and computer-readable storage medium

By generating three-dimensional bones and performing corresponding processing, the three-dimensional model is automatically, fast and accurate skinning, solving the problem of bone binding difficulties in the production process of virtual digital humans in the existing technology, reducing the production difficulty and cost.

CN113658305BActive Publication Date: 2025-04-18GUANGZHOU HUYA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110814927.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-19
Publication Date
2025-04-18
Estimated Expiration
2041-07-19

AI Technical Summary

Technical Problem

In the prior art, the skinning process of three-dimensional models requires a lot of manpower and material resources, which increases the threshold for virtual digital human production. Especially for ordinary users, it takes a lot of time to learn modeling software to bind bones.

Method used

By generating three-dimensional bones, normalizing and voxelizing, the weight coefficient of the bones is determined, and the impact range and weight coefficient are optimized to achieve automatic, fast and accurate skinning of the three-dimensional model.

Benefits of technology

It realizes the rapid binding of three-dimensional models and three-dimensional bones, can automatically and quickly give skinning results, reduces the difficulty and cost of making virtual digital people, and is suitable for handling complex three-dimensional models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113658305B_ABST
    Figure CN113658305B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and computer-readable storage medium for skinning a three-dimensional model, wherein the method for skinning a three-dimensional model comprises: generating a corresponding three-dimensional skeleton according to a pre-established three-dimensional model; normalizing the three-dimensional model and the three-dimensional skeleton; voxelizing the three-dimensional model to obtain a voxelized model; determining a weight coefficient of the three-dimensional skeleton based on the voxelized model; optimizing the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model. The above scheme can automatically, quickly and accurately perform skinning of a three-dimensional model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a three-dimensional model skinning method, device, equipment and computer-readable storage medium. Background Art

[0002] Since the outbreak of the epidemic, three-dimensional virtual digital has gradually been favored by all walks of life. Using virtual customer service to reduce contact between people and improve service quality and teaching level in non-contact scenarios is the focus of every field. The traditional clothing industry is also exploring how to combine virtual digital people with the service content in this field to create a unique virtual image and high-quality service experience. The replicability and customizability of virtual digital people have greatly improved the service level and business experience, simplified the service process, and thus reduced the cost of service. In the future, digital people can be used as a quick carrier to combine artificial intelligence and virtual reality technology to give the industry more personalized and intelligent service content. To create a virtual digital image, complex steps are required, such as modeling of three-dimensional virtual images, manual binding of three-dimensional skeletons, animation of three-dimensional characters, and planning and rendering of scenes. Among them, three-dimensional virtual image skeleton binding and animation are essential links in the production process of virtual digital people, and a lot of manpower and material resources are required to ensure the binding effect.

[0003] 3D skeleton binding is widely used in games, virtual reality and other fields because of its simplicity and small memory usage. There are many modeling software (such as Maya, Blender, etc.) on the market that can perform 3D skeleton binding. However, for ordinary users, it takes a lot of time to learn modeling software to perform skeleton binding, which increases the threshold for making virtual digital people. Even professional artists need to spend a lot of time and energy to deal with complex 3D models. Summary of the invention

[0004] The main technical problem solved by the present application is to provide a three-dimensional model skinning method, device, equipment and computer-readable storage medium, which can automatically, quickly and accurately perform three-dimensional model skinning.

[0005] In order to solve the above problems, the first aspect of the present application provides a three-dimensional model skinning method, the three-dimensional model skinning method comprising: generating a corresponding three-dimensional skeleton according to a pre-established three-dimensional model; normalizing the three-dimensional model and the three-dimensional skeleton; voxelizing the three-dimensional model to obtain a voxelized model; determining the weight coefficient of the three-dimensional skeleton based on the voxelized model; optimizing the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model.

[0006] In order to solve the above problems, the second aspect of the present application provides a skinning device for a three-dimensional model, and the skinning device for the three-dimensional model includes: a skeleton generation module, which is used to generate a corresponding three-dimensional skeleton according to a pre-established three-dimensional model; a normalization module, which is used to normalize the three-dimensional model and the three-dimensional skeleton; a voxelization module, which is used to voxelize the three-dimensional model to obtain a voxelized model; a weight determination module, which is used to determine the weight coefficient of the three-dimensional skeleton based on the voxelized model; and an optimization processing module, which is used to optimize the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model.

[0007] In order to solve the above-mentioned problem, the third aspect of the present application provides an electronic device, comprising a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the three-dimensional model skinning method of the above-mentioned first aspect.

[0008] In order to solve the above-mentioned problem, the fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, and when the program instructions are executed by a processor, the three-dimensional model skinning method of the above-mentioned first aspect is implemented.

[0009] The beneficial effects of the present invention are as follows: Different from the prior art, the present application generates a corresponding three-dimensional skeleton based on a pre-established three-dimensional model, and then after normalizing the three-dimensional model and the three-dimensional skeleton, voxelizes the three-dimensional model to obtain a voxelized model, and then determines the weight coefficient of the three-dimensional skeleton based on the voxelized model, and optimizes the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model. The present application voxelizes the three-dimensional model to obtain a voxelized model, and determines the positional relationship between the skeleton points and the vertices of the three-dimensional model based on the voxelized model, determines the weight coefficient of the three-dimensional skeleton, and realizes the rapid binding of the three-dimensional model and the three-dimensional skeleton. Based on the three-dimensional model and the three-dimensional skeleton, the skinning result of the three-dimensional model to be bound is automatically and quickly given, and the skinning operation of complex three-dimensional models can be handled. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flow chart of an embodiment of a skinning method for a three-dimensional model of the present application;

[0011] Figure 2 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S11;

[0012] Figure 3 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S12;

[0013] Figure 4 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S13;

[0014] Figure 5 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S14;

[0015] Figure 6 yes Figure 1 A schematic diagram of a flow chart of an embodiment of step S15;

[0016] Figure 7a to Figure 7g It is a schematic diagram of the effect of the first application scenario of the skinning method of the three-dimensional model of the present application;

[0017] Figure 8 It is a schematic diagram of a framework of an embodiment of a skinning device of a three-dimensional model of the present application;

[0018] Fig. 9 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0019] Fig.10 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0020] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0021] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0022] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.

[0023] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a skinning method for a three-dimensional model of the present application. Specifically, the skinning method for a three-dimensional model in this embodiment may include the following steps:

[0024] Step S11: Generate a corresponding three-dimensional skeleton according to the pre-established three-dimensional model.

[0025] In the process of creating a virtual character, a three-dimensional model of the virtual character is first created, and the three-dimensional model is usually represented as a mesh data structure. Among them, the pre-established three-dimensional model refers to the model corresponding to the virtual character, which is mainly the appearance characteristics and external structure of the virtual character to be created, such as a humanoid character with clothing, an animal character with skin, etc. In animation, it is usually hoped that the three-dimensional model of the virtual character can show good deformation in different postures. The corresponding three-dimensional skeleton refers to the relevant data of the skeletal structure of the virtual character. The three-dimensional skeleton contains various bone points and bones between the bone points. The three-dimensional skeleton represents the internal entity structure of the virtual character, such as the internal skeleton of the virtual character.

[0026] Please combine Figure 2 , Figure 2 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S11 in FIG. 1. In one embodiment, the above step S11 may specifically include:

[0027] Step S111: adjust the position and orientation of the three-dimensional model.

[0028] Step S112: Generate the corresponding three-dimensional skeleton using a three-dimensional skeleton detection method based on deep learning or a manual addition method.

[0029] Step S113: Based on the adjacent relationship of the bones, the parent bone point of each bone point in the three-dimensional skeleton is determined, thereby determining the positional relationship of all bone pairs.

[0030] Through the three-dimensional skeleton detection method based on deep learning, a skeleton detection model can be constructed. For example, the skeleton detection model can be based on the OpenPose model and obtained by training through the deep learning framework TensorFlow, which can effectively identify the skeleton key points of the three-dimensional model. The skeleton detection model obtained by training through the deep learning framework TensorFlow can quickly detect the positional relationship between each skeleton key point of the three-dimensional model. Therefore, according to the three-dimensional model of the virtual character established in advance, the position and orientation of the three-dimensional model can be corrected, and then the corresponding three-dimensional skeleton can be generated by using the skeleton detection model constructed by the three-dimensional skeleton detection method based on deep learning. And, based on the adjacent relationship of the skeleton, the parent skeleton point of each skeleton point in the three-dimensional skeleton can be determined, so as to determine the positional relationship of all skeleton pairs; for example, one of the skeleton points of the three-dimensional skeleton can be selected as the root skeleton point, and then according to the spatial coordinates of the root skeleton point, the distance between each adjacent two skeleton points and the spatial pointing vector of each adjacent two skeleton points, according to the relationship between the parent skeleton point and the child skeleton point, the spatial coordinates of each skeleton point of the three-dimensional skeleton are calculated in turn, and then the positional relationship of all skeleton pairs can be determined.

[0031] It is understandable that, in other implementations, the corresponding three-dimensional skeleton may also be generated by artificial addition based on the three-dimensional model of the virtual character.

[0032] Step S12: normalizing the three-dimensional model and the three-dimensional skeleton.

[0033] By normalizing the three-dimensional model and the three-dimensional skeleton and mapping the height of the three-dimensional model and the three-dimensional skeleton to between 0 and 1, the three-dimensional model skinning method of the present application is applicable to virtual characters of any height, which can enhance the versatility of the three-dimensional model skinning method.

[0034] Please combine Figure 3 , Figure 3 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S12 in FIG. 1. In one embodiment, the above step S12 may specifically include:

[0035] Step S121: Calculate the bounding box of the three-dimensional model and determine scaling and translation parameters.

[0036] Step S122: using the scaling and translation parameters, normalizing the three-dimensional model and the corresponding three-dimensional skeleton.

[0037] Using a geometric body (i.e., a bounding box) that is slightly larger in volume and has simple characteristics, it is possible to approximately replace complex geometric objects, including AABB bounding boxes, bounding spheres, and directional bounding boxes OBB, etc. Taking the AABB bounding box as an example, it is the smallest hexahedron that contains a three-dimensional model and whose sides are parallel to the coordinate axis. Therefore, after determining the three-dimensional model of the virtual character, the bounding box of the three-dimensional model can be calculated. Since the height of the three-dimensional model and the three-dimensional skeleton needs to be mapped to between 0 and 1, after calculating the bounding box of the three-dimensional model, the corresponding scaling and translation parameters can be determined, and then the scaling and translation parameters are used to normalize the three-dimensional model and the corresponding three-dimensional skeleton.

[0038] Step S13: voxelize the three-dimensional model to obtain a voxelized model.

[0039] Voxelization is the process of converting the geometric representation of an object into a voxel representation that is closest to the object. The voxelized model not only contains the surface information of the model, but also describes the internal properties of the model. Voxelization of a three-dimensional model can simplify the model and obtain a uniform grid, which is well applied in the process of finding the geodesic of the model. Regarding the generation of the voxelized model, the three-dimensional model can be voxelized through a 2D-CNN encoding network, a 3D convolutional LSTM network, or a 3D decoding neural network to generate a voxelized model.

[0040] Please combine Figure 4 , Figure 4 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S13 in FIG. 1. In one embodiment, the above step S13 may specifically include:

[0041] Step S131: Calculate the model view projection matrix of the three-dimensional model in several different directions.

[0042] Step S132: Based on the model view projection matrix, using frame buffer technology to obtain depth images in the plurality of different directions.

[0043] Step S133: using the depth image to determine the voxel range of the three-dimensional model in the plurality of different directions.

[0044] Step S134: voxelizing the three-dimensional model based on the voxel ranges in the plurality of different directions to obtain a voxelized model.

[0045] Specifically, based on the bounding box of the 3D model, the model view projection matrix of the 3D model in the six directions of front, back, top, bottom, left and right can be calculated. The function of the model view projection matrix is ​​to transform the vertices from the local coordinate system to the canonical cube. Model view projection matrix = projection matrix * view matrix * model matrix. The model matrix transforms the vertices from the local coordinate system to the world coordinate system, the view matrix transforms the vertices from the world coordinate system to the view coordinate system, and the projection matrix transforms the vertices from the view coordinate system to the canonical cube.

[0046] Regarding frame buffer technology, the graphics drawn on the screen are composed of pixels, and each pixel has a fixed color or other information with corresponding points, such as depth, etc.; therefore, when drawing graphics, the memory must evenly store data for each pixel. This memory area that stores data for all pixels is called a buffer, also called a cache; different caches may contain different numbers of data for each pixel, but in a given cache, each pixel is assigned the same number of data. All caches in the system are collectively called frame buffers, and these different caches can be used for color setting, hidden surface elimination, scene anti-aliasing, and template operations. The OpenGL frame buffer consists of a color buffer, a depth buffer, a template buffer, and a cumulative buffer. Among them, the depth buffer stores the depth value of each pixel. The depth is usually measured by the distance from the viewpoint to the object, so that pixels with larger depth values ​​will be replaced by pixels with smaller depth values, that is, distant objects are blocked by nearby objects.

[0047] Since the coordinates of the vertex can be directly obtained by multiplying the model view projection matrix by the model view projection matrix, the depth image of the three-dimensional model in the six directions of front, back, up, down, left and right can be obtained by using the frame buffer technology. Therefore, using the depth image of the three-dimensional model in the six directions, the voxel range of the three-dimensional model in the six directions of front, back, up, down, left and right can be determined. Then, combined with the voxel range in the six directions of front, back, up, down, left and right, the voxel coordinates corresponding to each vertex of the three-dimensional model are determined, and the three-dimensional model is voxelized to obtain a voxelized model.

[0048] Step S14: Determine the weight coefficient of the three-dimensional skeleton based on the voxelized model.

[0049] The present application converts the three-dimensional model into a voxelized model so that the distance between the vertices and bones of the three-dimensional model can be determined by the distance between voxels, thereby determining the weight coefficient of the three-dimensional bone based on the voxelized model.

[0050] Specifically, please combine Figure 5 , Figure 5 yes Figure 1 The above step S14 may specifically include:

[0051] Step S141: determining the position of each vertex of the three-dimensional model in the voxelized model.

[0052] Step S142: Determine the distance between each vertex of the three-dimensional model and the three-dimensional bone in the voxelized model according to the positional relationship of all bone pairs and the adjacent relationship between voxels in the voxelized model.

[0053] Step S143: Determine the weight coefficient of the three-dimensional skeleton according to the distance between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model.

[0054] It is understandable that the existing skinning method of the three-dimensional model can determine the distance characteristics corresponding to the vertex and the bone by calculating the Euclidean distance between the vertex of the three-dimensional model and the bone, so as to obtain the skin weight between the vertex of the three-dimensional model and the three-dimensional bone. However, in practical applications involving curved surfaces, the Euclidean distance cannot accurately represent the distance between the bone and the vertex on the three-dimensional model, which leads to the final skin weight setting being not accurate enough. For example, when the three-dimensional human clothing model stands naturally, the bone structure where the elbow joint is located may be placed close to the ribs. At this time, the Euclidean distance between the determined elbow joint and the vertex of the sub-rib area is small, so that the skin weight between the vertex of the sub-rib area and the elbow joint is finally determined to be large, that is, the vertex of the sub-rib area is greatly affected by the elbow joint, while in actual conditions, the vertex of the sub-rib area should be less or even not affected by the elbow joint. In this way, when the three-dimensional human clothing model moves with the bone structure, the three-dimensional human clothing model may produce abnormal conditions such as severe deformation and interlacing of the face piece, thereby reducing the accuracy of the skin weight.

[0055] The present application can determine the position of each vertex of the three-dimensional model in the voxelized model by converting the three-dimensional model into a voxelized model. According to the positional relationship of all the bone pairs, the position of each bone and the bone point of the three-dimensional skeleton in the voxelized model can be determined. Therefore, according to the position of each vertex of the three-dimensional model in the voxelized model, and the position of each bone and the bone point in the voxelized model, the distance between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model can be determined. At this time, the distance between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model is affected by the adjacent relationship between voxels in the voxelized model. The distance between any vertex and any bone point in the voxelized model needs to be calculated along the voxel point. Therefore, the weight coefficient of the three-dimensional skeleton determined according to the distance between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model is more accurate.

[0056] Step S15: Optimizing the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model.

[0057] It is understandable that there is a parent-child relationship between the skeleton points, and the parent skeleton point will control the child skeleton point, so that some parent skeleton points can affect the movement of a certain area even though they do not control the area. The reason is that the child skeleton point controlled by the parent skeleton point has an impact on the area, and the impact of the child skeleton point is transmitted by the parent skeleton point. In addition, the weight coefficient of the three-dimensional skeleton can be characterized as the degree of influence of the skeleton point on the vertex of the three-dimensional model. The greater the influence of the skeleton point on the vertex, the greater the change in the position of the skeleton point. Therefore, by adjusting the influence range and weight coefficient of the three-dimensional skeleton, the actions of different parts of the virtual character can be flexibly adjusted, thereby achieving richer animation effects.

[0058] The above scheme generates a corresponding three-dimensional skeleton through a pre-established three-dimensional model, and then after normalizing the three-dimensional model and the three-dimensional skeleton, voxelizes the three-dimensional model to obtain a voxelized model, and then determines the weight coefficient of the three-dimensional skeleton based on the voxelized model, and optimizes the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model. The present application voxelizes the three-dimensional model to obtain a voxelized model, and determines the positional relationship between the skeleton points and the vertices of the three-dimensional model based on the voxelized model, determines the weight coefficient of the three-dimensional skeleton, and realizes the rapid binding of the three-dimensional model and the three-dimensional skeleton. Based on the three-dimensional model and the three-dimensional skeleton, the skinning result of the bound three-dimensional model is automatically and quickly given, and the skinning operation of complex three-dimensional models can be handled.

[0059] Please combine Figure 6 , Figure 6 yes Figure 1 FIG. 1 is a flow chart of an embodiment of step S15 in FIG. 1. In one embodiment, the above step S15 may specifically include:

[0060] Step S151: Delineating the influence range of the three-dimensional skeleton.

[0061] By adjusting the influence range of the bones, the size and position of the bones are matched with the motion area of ​​the three-dimensional model controlled by them. Specifically, the above step S151 may include: determining all the connected vertices according to the topological connection relationship between the vertices of the pre-bound three-dimensional model of all bones and the voxelized model; then calculating the shortest distance between all the connected vertices, merging all the connected vertices whose shortest distance is less than the preset distance threshold, and obtaining several connected vertex sets after division; retaining the largest connected vertex set, and clearing the weight coefficients of all vertices of other connected vertex sets. Therefore, by first merging all the connected vertices with a closer distance, and then retaining only the connected vertex set with the largest influence range, and clearing the weight coefficients of all vertices of the connected vertex set with a smaller influence range, the final bone influence range is determined to ensure that the topological structure of the retained bones is optimal.

[0062] Step S152: Smoothing the weight coefficient of the three-dimensional skeleton based on the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton.

[0063] By calculating the geodesic distance between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model, the influence of the skeleton on the deformation of the three-dimensional model vertices can be calculated based on the distance of the geodesic, and then the weight coefficient of the three-dimensional skeleton can be smoothed based on the influence obtained by the geodesic, thereby improving the smoothness of the skin.

[0064] Specifically, the above step S152 may include: determining the positional relationship between the vertices that have not been cleared and the vertices that have been cleared based on the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton; calculating the weight coefficients of the vertices that have not been cleared using the weight coefficients of the nearest and adjacent vertices; and smoothing the weight coefficients of all vertices based on the topological connection relationship between the vertices of the pre-bound three-dimensional model of all bones and the voxelized model. Therefore, by calculating the distance of the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton, the positional relationship between the vertices that have not been cleared and the vertices that have been cleared can be determined, and then the weight coefficients of the vertices that have not been cleared, that is, the weight coefficients of the influence of the vertices obtained according to the distance of the geodesics, are calculated; then, based on the topological connection relationship between the vertices of the pre-bound three-dimensional model of all bones and the voxelized model, the weight coefficients of all vertices obtained in step S14 are smoothed using the weight coefficients of the influence of the vertices obtained according to the distance of the geodesics to improve the smoothness of the skin.

[0065] Step S153: performing a skinning operation using the weight coefficient of the smoothed three-dimensional skeleton to bind the three-dimensional model to the three-dimensional skeleton.

[0066] After determining the weight coefficient of the 3D skeleton, the 3D model of the virtual character can be bound to the 3D skeleton to complete the skinning operation of the virtual character. Specifically, the weight coefficient of the 3D skeleton represents the degree to which each vertex is affected by each skeleton point. For each vertex, the skeleton point with the greatest influence can be selected as its binding point. When performing the skinning operation, one vertex corresponds to one binding point. Binding the 3D model to the 3D skeleton completes the skinning operation of the virtual character.

[0067] See also Figure 7a to Figure 7g , Figure 7a to Figure 7g This is a schematic diagram of the effect of the first application scenario of the skinning method of the three-dimensional model of the present application. Figure 7a The three-dimensional model of the virtual character is shown. Figure 7a A three-dimensional model can be generated Figure 7b The three-dimensional skeleton shown in the figure is then bound to the three-dimensional skeleton and the three-dimensional model according to the skinning method of the three-dimensional model of the present application to obtain Figure 7c The fusion effect is shown in the figure. After the skinning operation is completed, the virtual character is as follows Figure 7d to Figure 7g , can show good deformation effects in different postures, and also has good display effects for virtual characters with multi-layer tight clothing.

[0068] See also Figure 8 , Figure 8 It is a schematic diagram of a framework of an embodiment of a skinning device for a three-dimensional model of the present application. The skinning device 80 for a three-dimensional model includes: a skeleton generation module 800, the skeleton generation module 800 is used to generate a corresponding three-dimensional skeleton according to a pre-established three-dimensional model; a normalization module 802, the normalization module 802 is used to normalize the three-dimensional model and the three-dimensional skeleton; a voxelization module 804, the voxelization module 804 is used to voxelize the three-dimensional model to obtain a voxelized model; a weight determination module 806, the weight determination module 806 is used to determine the weight coefficient of the three-dimensional skeleton based on the voxelized model; an optimization processing module 808, the optimization processing module 808 is used to optimize the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model.

[0069] In some embodiments, the skeleton generation module 800 executes the steps of generating corresponding three-dimensional skeletons according to a pre-established three-dimensional model, including: correcting the position and orientation of the three-dimensional model; generating corresponding three-dimensional skeletons by using a three-dimensional skeleton detection method based on deep learning or manual addition; determining the parent bone point of each bone point in the three-dimensional skeleton based on the adjacent relationship of the bones, thereby determining the positional relationship of all bone pairs.

[0070] In some embodiments, the normalization module 802 performs steps of normalizing the three-dimensional model and the three-dimensional skeleton, including: calculating the bounding box of the three-dimensional model and determining the scaling and translation parameters; and using the scaling and translation parameters to normalize the three-dimensional model and the corresponding three-dimensional skeleton.

[0071] In some embodiments, the voxelization module 804 performs voxelization processing on the three-dimensional model to obtain a voxelized model, including: calculating a model view projection matrix of the three-dimensional model in several different directions; based on the model view projection matrix, using frame buffer technology to obtain depth images in the several different directions; using the depth image to determine the voxel range of the three-dimensional model in the several different directions; and voxelizing the three-dimensional model in combination with the voxel ranges in the several different directions to obtain a voxelized model.

[0072] In some embodiments, the weight determination module 806 performs the steps of determining the weight coefficient of the three-dimensional bone based on the voxelized model, including: determining the position of each vertex of the three-dimensional model in the voxelized model; determining the distance between each vertex of the three-dimensional model and the three-dimensional bone in the voxelized model based on the position relationship of all bone pairs and the adjacent relationship between voxels in the voxelized model; determining the weight coefficient of the three-dimensional bone based on the distance between each vertex of the three-dimensional model and the three-dimensional bone in the voxelized model.

[0073] In some embodiments, the optimization processing module 808 performs optimization processing on the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning step of the three-dimensional model, including: defining the influence range of the three-dimensional skeleton; smoothing the weight coefficient of the three-dimensional skeleton based on the geodesics between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model; and performing skinning operation using the weight coefficient of the smoothed three-dimensional skeleton to bind the three-dimensional model to the three-dimensional skeleton.

[0074] In some embodiments, the optimization processing module 808 executes the step of defining the influence range of the three-dimensional skeleton, including: determining all connected vertices based on the topological connection relationship between the vertices of the pre-bound three-dimensional model of all bones and the voxelized model; calculating the shortest distance between all connected vertices, merging all connected vertices whose shortest distance is less than a preset distance threshold to obtain several connected vertex sets after division; retaining the largest connected vertex set, and clearing the weight coefficients of all vertices of other connected vertex sets.

[0075] In some embodiments, the optimization processing module 808 performs a step of smoothing the weight coefficient of the three-dimensional skeleton based on the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton, including: determining the positional relationship between the vertices that have not been cleared and the vertices that have been cleared based on the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton; calculating the weight coefficients of the vertices that have not been cleared using the weight coefficients of the nearest and adjacent vertices; and smoothing the weight coefficients of all vertices based on the topological connection relationship between the vertices of the three-dimensional model pre-bound to all bones and the voxelized model.

[0076] See also Fig. 9 , Fig. 9 1 is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 90 includes a memory 901 and a processor 902 coupled to each other, and the processor 902 is used to execute program instructions stored in the memory 901 to implement the steps of any one of the above-mentioned three-dimensional model skinning method embodiments. In a specific implementation scenario, the electronic device 90 may include but is not limited to: a microcomputer, a server.

[0077] Specifically, the processor 902 is used to control itself and the memory 901 to implement the steps of any one of the above-mentioned three-dimensional model skinning method embodiments. The processor 902 can also be called a CPU (Central Processing Unit). The processor 902 may be an integrated circuit chip with signal processing capabilities. The processor 902 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 902 can be implemented by an integrated circuit chip.

[0078] See also Fig.10 , Fig.10 The computer-readable storage medium 100 stores program instructions 1000 that can be executed by a processor, and the program instructions 1000 are used to implement the steps of any one of the above-mentioned three-dimensional model skinning method embodiments.

[0079] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0080] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0081] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0082] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A skinning method for a three-dimensional model, characterized in that: The skinning method of the three-dimensional model comprises: Generate a corresponding three-dimensional skeleton according to the pre-established three-dimensional model; Normalizing the three-dimensional model and the three-dimensional skeleton; Performing voxel processing on the three-dimensional model to obtain a voxelized model; Determine a weight coefficient of the three-dimensional skeleton based on the voxelized model, wherein the weight coefficient of the three-dimensional skeleton is used to characterize the influence of each skeleton point on each three-dimensional model vertex; Optimizing the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model; The step of optimizing the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model includes: Delimiting the influence range of the three-dimensional skeleton, including: determining all connected vertices according to the topological connection relationship between the vertices of the three-dimensional model pre-bound to all bones and the voxelized model, calculating the shortest distance between all connected vertices, merging all connected vertices whose shortest distance is less than a preset distance threshold, obtaining a plurality of connected vertex sets after division, retaining the largest connected vertex set, and clearing the weight coefficients of all vertices of other connected vertex sets; Based on the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton, determining the influence of the three-dimensional skeleton on the deformation of the vertex of the three-dimensional model, and smoothing the weight coefficient of the three-dimensional skeleton according to the influence of the three-dimensional skeleton on the deformation of the vertex of the three-dimensional model, including: based on the geodesics between each vertex of the three-dimensional model in the voxelized model and the three-dimensional skeleton, determining the positional relationship between the vertices that have not been cleared and the vertices that have been cleared, using the weight coefficients of the nearest and adjacent vertices, and smoothing the weight coefficients of all vertices based on the topological connection relationship between the vertices of the three-dimensional model pre-bound to all bones and the voxelized model; The skinning operation is performed using the weight coefficient of the smoothed three-dimensional skeleton, and each vertex on the three-dimensional model is bound to the bone point on the three-dimensional skeleton that has the greatest influence on each vertex, so that the three-dimensional model is bound to the three-dimensional skeleton; wherein one vertex is bound to one bone point.

2. The skinning method of a three-dimensional model according to claim 1, characterized in that: The generating of the corresponding three-dimensional skeleton according to the pre-established three-dimensional model includes: Correcting the position and orientation of the three-dimensional model; Generate the corresponding three-dimensional skeleton by using a three-dimensional skeleton detection method based on deep learning or an artificial addition method; Based on the adjacent relationship of the bones, the parent bone point of each bone point in the three-dimensional skeleton is determined, thereby determining the positional relationship of all bone pairs.

3. The skinning method of a three-dimensional model according to claim 1, characterized in that: The normalizing process of the three-dimensional model and the three-dimensional skeleton includes: Calculating the bounding box of the three-dimensional model and determining scaling and translation parameters; The three-dimensional model and the corresponding three-dimensional skeleton are normalized using the scaling and translation parameters.

4. The skinning method of a three-dimensional model according to claim 1, characterized in that: The voxelization process is performed on the three-dimensional model to obtain a voxelized model, including: Calculating a model view projection matrix of the three-dimensional model in a plurality of different directions; Based on the model view projection matrix, using frame buffer technology to obtain depth images in the plurality of different directions; Determining voxel ranges of the three-dimensional model in the plurality of different directions using the depth image; The three-dimensional model is voxelized by combining the voxel ranges in the plurality of different directions to obtain a voxelized model.

5. The skinning method of a three-dimensional model according to claim 1, characterized in that: The step of determining the weight coefficient of the three-dimensional skeleton based on the voxelized model comprises: Determining the position of each vertex of the three-dimensional model in the voxelized model; Determine the distance between each vertex of the three-dimensional model and the three-dimensional bone in the voxelized model according to the positional relationship of all bone pairs and the adjacent relationship between voxels in the voxelized model; The weight coefficient of the three-dimensional bone is determined according to the distance between each vertex of the three-dimensional model and the three-dimensional bone in the voxelized model.

6. A skinning device for a three-dimensional model, characterized in that: The skinning device of the three-dimensional model comprises: A skeleton generation module, wherein the skeleton generation module is used to generate a corresponding three-dimensional skeleton according to a pre-established three-dimensional model; A normalization module, the normalization module is used to perform normalization processing on the three-dimensional model and the three-dimensional skeleton; A voxelization module, wherein the voxelization module is used to perform voxelization processing on the three-dimensional model to obtain a voxelized model; A weight determination module, the weight determination module is used to determine the weight coefficient of the three-dimensional skeleton based on the voxelized model, and the weight coefficient of the three-dimensional skeleton is used to characterize the influence of the skeleton point on the vertex of the three-dimensional model; An optimization processing module, the optimization processing module is used to optimize the influence range and weight coefficient of the three-dimensional skeleton to complete the skinning of the three-dimensional model, including: delineating the influence range of the three-dimensional skeleton, determining the influence degree of the three-dimensional skeleton on the deformation of the three-dimensional model vertices based on the geodesic between each vertex of the three-dimensional model and the three-dimensional skeleton in the voxelized model, smoothing the weight coefficient of the three-dimensional skeleton according to the influence degree of the three-dimensional skeleton on the deformation of the three-dimensional model vertices, and performing skinning operation using the weight coefficient of the smoothed three-dimensional skeleton, binding each vertex on the three-dimensional model to the bone point on the three-dimensional skeleton that has the greatest influence on each vertex, so that the three-dimensional model is bound to the three-dimensional skeleton; wherein one vertex is bound to one bone point; The delimiting of the influence range of the three-dimensional skeleton includes: determining all connected vertices according to the topological connection relationship between the vertices of the three-dimensional model pre-bound to all bones and the voxelized model, calculating the shortest distance between all connected vertices, merging all connected vertices whose shortest distance is less than a preset distance threshold, obtaining a plurality of connected vertex sets after division, retaining the largest connected vertex set, and clearing the weight coefficients of all vertices of other connected vertex sets; The method determines the influence of the three-dimensional skeleton on the deformation of the three-dimensional model vertices based on the geodesics between the three-dimensional skeleton and each vertex of the three-dimensional model in the voxelized model, and smoothes the weight coefficient of the three-dimensional skeleton according to the influence of the three-dimensional skeleton on the deformation of the three-dimensional model vertices, including: determining the positional relationship between vertices that have not been cleared and vertices that have been cleared based on the geodesics between the three-dimensional skeleton and each vertex of the three-dimensional model in the voxelized model, calculating the weight coefficient of the vertex that has not been cleared using the weight coefficients of the nearest and adjacent vertices, and smoothing the weight coefficients of all vertices based on the topological connection relationship between the vertices of the three-dimensional model pre-bound to all bones and the voxelized model.

7. An electronic device, characterized in that: It comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the skinning method of a three-dimensional model as claimed in any one of claims 1 to 5.

8. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the skinning method of the three-dimensional model described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Skinning method and device for virtual characters and electronic equipment

    CN109993819A

  • Model training method and device based on skin weight, equipment and medium

    CN112991503A