A virtual garment rendering method and apparatus

By obtaining the target position and normal direction of the vertices of the virtual clothing mesh, the wrinkle effect of the virtual clothing is rendered, which solves the problems of realism and computational load when the virtual clothing changes posture, and achieves efficient rendering.

CN115471595BActive Publication Date: 2026-01-13BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110648104.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-10
Publication Date
2026-01-13
Estimated Expiration
2041-07-11

AI Technical Summary

Technical Problem

In existing technologies, virtual clothing cannot generate dynamic wrinkles when following the user's posture changes using skeletal animation, resulting in poor realism. On the other hand, using physical simulation technology involves excessive computation and can easily cause device lag.

Method used

By acquiring the pose information of the target object, the target position and normal direction of each mesh vertex of the virtual clothing are calculated, and the wrinkle effect of the virtual clothing is rendered using the normal direction, thus reducing the amount of computation.

Benefits of technology

While maintaining the realism of virtual clothing, it reduces the amount of rendering computation, avoids device lag, and improves rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115471595B_ABST
    Figure CN115471595B_ABST
Patent Text Reader

Abstract

The method comprises: obtaining pose information of a target object; obtaining target positions of each mesh vertex of a virtual garment according to the pose information, wherein the target positions of each mesh vertex of the virtual garment comprise positions of each mesh vertex of the virtual garment after the virtual garment is deformed according to the pose information; obtaining normal directions of each position of the virtual garment according to the target positions of each mesh vertex of the virtual garment; rendering the virtual garment according to the normal directions of each position of the virtual garment, and outputting a rendering effect image of the virtual garment. The method provided in the embodiment of the present disclosure can reduce the amount of calculation of virtual garment rendering while making the virtual garment have a wrinkling effect that changes with the pose of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of graphics technology, and in particular to a virtual clothing rendering method and apparatus. Background Technology

[0002] Virtual clothing rendering has been widely applied in daily life. For example, virtual try-on based on virtual clothing rendering technology can capture the user's posture in real time through an image acquisition device and render virtual clothing onto the user, eliminating the need for users to perform tedious undressing and dressing operations, thus greatly improving the efficiency of trying on clothes.

[0003] To enhance the realism of rendered virtual clothing, the clothing needs to change in response to the user's posture. Existing technologies primarily employ two methods to achieve this: one uses skeletal animation to drive the virtual clothing's posture, and the other uses physical simulation technology. However, using skeletal animation only allows the overall posture of the virtual clothing to change with the user's posture; it cannot dynamically create the necessary wrinkles, resulting in a lack of realism. While physical simulation technology can create the necessary wrinkles, it involves excessive computation, placing high demands on device performance and easily leading to stuttering and other issues. Summary of the Invention

[0004] In view of this, the present disclosure provides a virtual clothing rendering method and apparatus, which reduces the computational load of virtual clothing rendering while enabling virtual clothing to produce a wrinkle effect according to the user's posture changes.

[0005] To achieve the above objectives, the present disclosure provides the following technical solutions:

[0006] In a first aspect, embodiments of this disclosure provide a virtual clothing rendering method, comprising:

[0007] Obtain the pose information of the target object;

[0008] The target positions of each grid vertex of the virtual garment are obtained based on the posture information. The target positions of each grid vertex of the virtual garment include the positions of each grid vertex of the virtual garment after the virtual garment is deformed based on the posture information.

[0009] The normal direction of each position of the virtual clothing is obtained based on the target position of each grid vertex of the virtual clothing.

[0010] Render the virtual clothes according to the normal direction of each position of the virtual clothes, and output a rendering effect image of the virtual clothes.

[0011] As an optional implementation of the embodiment of the present disclosure, the obtaining of the target position of each mesh vertex of the virtual clothes according to the pose information comprises:

[0012] The method further comprises:

[0013] The method further comprises:

[0014] As an optional implementation of the embodiment of the present disclosure, the obtaining of the target position of each mesh vertex of the virtual clothes according to the pose information comprises:

[0015] The method further comprises:

[0016] The method further comprises:

[0017] As an optional implementation of the embodiment of the present disclosure, the method further comprises, before the obtaining of the bone transformation matrix of the at least one bone in the skeletal model of the target object according to the pose information:

[0018] The method further comprises:

[0019] The method further comprises:

[0020] As an optional implementation of the embodiment of the present disclosure, the obtaining of the normal direction of each position of the virtual clothes according to the target position of each mesh vertex of the virtual clothes comprises:

[0021] According to the target position of each mesh vertex of the virtual clothes, the initial position of each mesh vertex of the virtual clothes, the target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and the initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, a compression rate and a compression direction of each mesh vertex of the virtual clothes are obtained;

[0022] According to the compression rate and the compression direction of each mesh vertex of the virtual clothes, a wrinkle height field formed by the virtual clothes is generated;

[0023] According to the wrinkle height field, a normal direction of each position of the virtual clothes is obtained.

[0024] As an optional implementation of an embodiment of the present disclosure, the obtaining of the compression rate and the compression direction of each mesh vertex of the virtual clothes according to the target position of each mesh vertex of the virtual clothes, the initial position of each mesh vertex of the virtual clothes, the target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and the initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes comprises:

[0025] A first position difference between each mesh vertex and each adjacent mesh vertex is obtained, and the first position difference between any mesh vertex and any adjacent mesh vertex is a difference between the target position of the adjacent mesh vertex and the target position of the mesh vertex;

[0026] A second position difference between each mesh vertex and each adjacent mesh vertex is obtained, and the second position difference between any mesh vertex and any adjacent mesh vertex is a difference between the initial position of the adjacent mesh vertex and the initial position of the mesh vertex;

[0027] A first matrix corresponding to each adjacent mesh vertex of each mesh vertex is obtained, and the first matrix corresponding to any adjacent mesh vertex of any mesh vertex is a tensor product of the first position difference and the second position difference between the mesh vertex and the adjacent mesh vertex;

[0028] A first feature matrix of each mesh vertex is obtained, and the first feature matrix of any mesh vertex is a sum of the first matrices corresponding to each adjacent mesh vertex of the mesh vertex;

[0029] A second matrix corresponding to each adjacent mesh vertex of each mesh vertex is obtained, and the second matrix corresponding to any adjacent mesh vertex of any mesh vertex is a tensor product of the second position difference and the second position difference between the mesh vertex and the adjacent mesh vertex;

[0030] A second feature matrix of each mesh vertex is obtained, and the second feature matrix of any mesh vertex is a sum of the second matrices corresponding to each adjacent mesh vertex of the mesh vertex;

[0031] obtaining a third feature matrix of each mesh vertex, the third feature matrix of any mesh vertex being a product of the first feature matrix of the mesh vertex and an inverse of the second feature matrix of the mesh vertex;

[0032] obtaining a fourth feature matrix of each mesh vertex, the fourth feature matrix of any mesh vertex being a product of a transpose of the third feature matrix of the mesh vertex and the third feature matrix of the mesh vertex;

[0033] obtaining a minimum eigenvalue and an eigenvector of the fourth feature matrix of each mesh vertex, and taking the minimum eigenvalue and the eigenvector as a compression rate and a compression direction of each mesh vertex respectively.

[0034] As an optional implementation of an embodiment of the present disclosure, the generating a wrinkle height field formed by the virtual garment according to the compression rate and the compression direction of each mesh vertex of the virtual garment comprises:

[0035] obtaining a height value of each mesh vertex of the virtual garment according to the compression rate of each mesh vertex of the virtual garment, the height value of any mesh vertex being a product of a first constant and a first calculation value corresponding to the mesh vertex, the first calculation value corresponding to any mesh vertex being a difference between a second constant and the compression rate of the mesh vertex;

[0036] obtaining an influence value of each position of the virtual garment, the influence value of any position comprising influence values of each mesh vertex of a mesh to which the position belongs to the position, the influence value of any mesh vertex to any position comprising a product of the height value of the mesh vertex and a corresponding height retention rate, the height retention rate of any position to any mesh vertex being a cosine value of a difference between the compression direction of the mesh vertex and the position, the position difference between any position and any mesh vertex being a position difference between the position and a target position of the mesh vertex;

[0037] obtaining a height of each position of the virtual garment according to the influence value of each position of the virtual garment;

[0038] obtaining a wrinkle height field formed by the virtual garment according to the height of each position on the virtual garment.

[0039] As an optional implementation of an embodiment of the present disclosure, the obtaining a normal direction of each position of the virtual garment according to the wrinkle height field comprises:

[0040] obtaining a gradient of each position of the virtual garment according to the wrinkle height field;

[0041] obtaining a normal direction of each position of the virtual garment by subtracting the initial normal direction of each position of the virtual garment from the gradient of each position of the virtual garment.

[0042] As an optional implementation of the embodiment of the present disclosure, before the target position of each mesh vertex of the virtual clothes is obtained according to the pose information, the method further comprises:

[0043] Merging mesh vertices with the same position in the mesh vertices of the virtual clothes to generate the virtual clothes with a topological structure completely connected.

[0044] In a second aspect, the embodiment of the present disclosure provides a virtual clothes rendering device, comprising:

[0045] An obtaining unit is configured to obtain pose information of a target object.

[0046] A driving unit is configured to obtain target positions of each mesh vertex of virtual clothes according to the pose information, wherein the target positions of each mesh vertex of the virtual clothes include positions of each mesh vertex of the virtual clothes after the virtual clothes are deformed according to the pose information.

[0047] A processing unit is configured to obtain normal directions of each position of the virtual clothes according to the target positions of each mesh vertex of the virtual clothes.

[0048] A rendering unit is configured to render the virtual clothes according to the normal directions of each position of the virtual clothes, and output a rendering effect image of the virtual clothes.

[0049] As an optional implementation of the embodiment of the present disclosure, the driving unit is specifically configured to obtain a bone transformation matrix of the at least one bone in a bone model of the target object according to the pose information, and calculate the target positions of each mesh vertex of the virtual clothes according to the bone transformation matrix of the at least one bone and skin information of the at least one bone.

[0050] The bone transformation matrix of any bone is a matrix for transforming the bone from an initial position to a position corresponding to the pose information, and the skin information of any bone includes an influence weight of the bone on each mesh vertex of the virtual clothes.

[0051] As an optional implementation of the embodiment of the present disclosure, the driving unit is specifically configured to obtain an influence value of each bone in the at least one bone on each mesh vertex of the virtual clothes, sum the influence values of each bone in the at least one bone on the same mesh vertex of the virtual clothes respectively, and obtain the target positions of each mesh vertex of the virtual clothes.

[0052] The influence value of any bone on any mesh vertex includes a product of an influence weight of the bone on the mesh vertex, a bone transformation matrix of the bone, and an initial position of the mesh vertex.

[0053] As an optional implementation of an embodiment of the present disclosure, the device further comprises:

[0054] The extraction unit is configured to, before the driving unit acquires the bone transformation matrix of the at least one bone in the skeletal model of the target object according to the posture information, acquire a target image, and extract the skeletal model of the target object according to the target image.

[0055] The target image includes the target object.

[0056] As an optional implementation of an embodiment of the present disclosure, the processing unit is specifically configured to acquire the compression rate and the compression direction of each mesh vertex of the virtual clothes according to the target position of each mesh vertex of the virtual clothes, the initial position of each mesh vertex of the virtual clothes, the target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and the initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes; generate a wrinkle height field formed by the virtual clothes according to the compression rate and the compression direction of each mesh vertex of the virtual clothes; and acquire the normal direction of each position of the virtual clothes according to the wrinkle height field.

[0057] As an optional implementation of the embodiment of the present disclosure, the processing unit is specifically configured to: obtain a first position difference between each mesh vertex and each adjacent mesh vertex, the first position difference between any mesh vertex and any adjacent mesh vertex being a difference between a target position of the adjacent mesh vertex and a target position of the mesh vertex; obtain a second position difference between each mesh vertex and each adjacent mesh vertex, the second position difference between any mesh vertex and any adjacent mesh vertex being a difference between an initial position of the adjacent mesh vertex and an initial position of the mesh vertex; obtain a first matrix corresponding to each adjacent mesh vertex of each mesh vertex, the first matrix corresponding to any mesh vertex and any adjacent mesh vertex being a tensor product of the first position difference and the second position difference between the mesh vertex and the adjacent mesh vertex; obtain a first feature matrix of each mesh vertex, the first feature matrix of any mesh vertex being a sum of the first matrix corresponding to each adjacent mesh vertex of the mesh vertex; obtain a second matrix corresponding to each adjacent mesh vertex of each mesh vertex, the second matrix corresponding to any mesh vertex and any adjacent mesh vertex being a tensor product of the second position difference and the second position difference between the mesh vertex and the adjacent mesh vertex; obtain a second feature matrix of each mesh vertex, the second feature matrix of any mesh vertex being a sum of the second matrix corresponding to each adjacent mesh vertex of the mesh vertex; obtain a third feature matrix of each mesh vertex, the third feature matrix of any mesh vertex being a product of an inverse matrix of the first feature matrix of the mesh vertex and the second feature matrix of the mesh vertex; obtain a fourth feature matrix of each mesh vertex, the fourth feature matrix of any mesh vertex being a product of a transpose matrix of the third feature matrix of the mesh vertex and the third feature matrix of the mesh vertex; and obtain a minimum eigenvalue and an eigenvector of the fourth feature matrix of each mesh vertex, and take the minimum eigenvalue and the eigenvector as a compression rate and a compression direction of each mesh vertex, respectively.

[0058] As an optional implementation of the embodiment of the present disclosure, the processing unit is specifically configured to obtain the height value of each mesh vertex of the virtual garment according to the compression rate of each mesh vertex of the virtual garment, the height value of any mesh vertex being the product of a first constant and a first calculation value corresponding to the mesh vertex, the first calculation value corresponding to any mesh vertex being the difference between a second constant and the compression rate of the mesh vertex; obtain the influence value of each position of the virtual garment, the influence value of any position including the influence value of each mesh vertex of the grid to which the position belongs on the position, the influence value of any mesh vertex on any position including the product of the height value of the mesh vertex and the corresponding height retention rate, the height retention rate of any position on any mesh vertex being the cosine value of the compression direction of the mesh vertex and the position difference corresponding to the position, the position difference between any position and any mesh vertex being the position difference between the position and the target position of the mesh vertex; obtain the height of each position of the virtual garment according to the influence value of each position of the virtual garment; and obtain the wrinkle height field formed by the virtual garment according to the height of each position on the virtual garment.

[0059] As an optional implementation of the embodiment of the present disclosure, the processing unit is specifically configured to obtain the gradient of each position of the virtual garment according to the wrinkle height field.

[0060] The normal direction of each position of the virtual garment is obtained by subtracting the gradient of each position of the virtual garment from the initial normal direction of each position of the virtual garment.

[0061] As an optional implementation of the embodiment of the present disclosure, the device further comprises:

[0062] The generating unit is configured to, before the driving unit obtains the target position of each mesh vertex of the virtual garment according to the pose information, merge mesh vertices with the same position in the mesh vertices of the virtual garment to generate the virtual garment with a topologically completely connected topology.

[0063] In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program, so that the electronic device implements the virtual garment rendering method in any of the above embodiments.

[0064] In a fourth aspect, an embodiment of the present disclosure provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the virtual garment rendering method in any of the above embodiments.

[0065] In a fifth aspect, the present disclosure provides a computer program product, which, when executed on a computer, causes the computer to implement the virtual garment rendering method according to any one of the embodiments described above.

[0066] The virtual garment rendering method provided by the embodiments of the present disclosure can obtain the normal direction of each position of the virtual garment, and render and output the rendering effect image of the virtual garment according to the normal direction of each position of the virtual garment. On the one hand, since the normal direction of each position can affect the brightness of each position of the virtual garment, the embodiments of the present disclosure can render the shadow of the wrinkle of the virtual garment in the rendering effect image of the virtual garment, so that the virtual garment can produce a wrinkle effect with the change of the posture of the user, and thus the virtual garment is more realistic. On the other hand, since the embodiments of the present disclosure only control the brightness of each position of the virtual garment by using the normal direction of each position of the virtual garment, and do not generate actual wrinkles, the embodiments of the present disclosure can reduce the amount of calculation when rendering the virtual garment. In summary, the embodiments of the present disclosure can make the virtual garment produce a wrinkle effect with the change of the posture of the user, while reducing the amount of calculation when rendering the virtual garment. BRIEF DESCRIPTION OF DRAWINGS

[0067] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the present disclosure.

[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings required to be used in the embodiments or prior art description will be briefly introduced. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative labor.

[0069] Figure 1 One of the step flow charts of the virtual garment rendering method provided by the embodiments of the present disclosure;

[0070] Figure 2 The normal direction schematic diagram provided by the embodiments of the present disclosure;

[0071] Figure 3 The second step flow chart of the virtual garment rendering method provided by the embodiments of the present disclosure;

[0072] Figure 4 A schematic diagram of adjacent grid vertices provided by an embodiment of the present disclosure;

[0073] Figure 5 A normal direction diagram of a position on a virtual garment provided by an embodiment of the present disclosure;

[0074] Figure 6 A structural schematic diagram of a virtual garment rendering device provided by an embodiment of the present disclosure;

[0075] Figure 7 A structural schematic diagram of a virtual garment rendering device provided by an embodiment of the present disclosure;

[0076] Figure 8 A hardware structural schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0077] In order to enable a person skilled in the art to more clearly understand the above-mentioned purposes, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0078] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present disclosure, but the present disclosure can also be implemented in other manners different from those described herein; obviously, the embodiments described in the specification only constitute a part of the embodiments of the present disclosure, and not all the embodiments.

[0079] In the embodiments of the present disclosure, the words such as “exemplary” or “for example” are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present disclosure should not be interpreted as being more preferred or having more advantages than other embodiments or design schemes. Rather, the words such as “exemplary” or “for example” are used in the sense of facilitating a clear presentation of the relevant concept in a particular manner. In addition, in the description of the embodiments of the present disclosure, the meaning of “plurality” is two or more, unless otherwise specified.

[0080] The embodiments of the present disclosure provide a virtual garment rendering method, referring to FIG. 1, the virtual garment rendering method comprises the following steps: Figure 1

[0081] S11, obtaining pose information of a target object.

[0082] In some example embodiments, an image acquisition device can be used to acquire an image of the target object, and the target object can be identified in the acquired image, so as to obtain the pose information of the target object. Exemplarily, the pose information of the target object can include head movements, upper limb movements, lower limb movements, etc. of the target object.​

[0083] The target object in the embodiments of the present disclosure can include an object wearing a virtual garment in a generated virtual garment rendering effect image, and the target object can specifically include a person, an animal, a virtual model, a physical model, etc., and the specific type of the target object is not limited in the embodiments of the present disclosure.

[0084] S12, obtaining a target position of each mesh vertex of the virtual garment according to the pose information.

[0085] The target position of each mesh vertex of the virtual garment includes a position of each mesh vertex of the virtual garment after the virtual garment is deformed according to the pose information.

[0086] Specifically, the virtual garment in the present disclosure can refer to a mesh model that approximates a real garment by using a plurality of mutually connected polygons (meshes), and each mesh vertex of the virtual garment can refer to a vertex of each polygon in the mesh model that approximates the real garment. The polygon can include a triangle, a parallelogram, a rectangle, etc., and the mesh shape is not limited in the embodiments of the present disclosure.

[0087] Optionally, the process of obtaining the target position of each mesh vertex of the virtual garment according to the pose information can include: first transforming the pose of the skeleton model of the target object according to the pose information, obtaining the position information of each bone of the skeleton model of the target object after the transformation according to the pose information, and then driving the virtual garment to deform according to the position information of each bone of the skeleton model of the target object after the transformation according to the pose information, so as to obtain the target position of each mesh vertex of the virtual garment.

[0088] S13, obtaining a normal direction of each position of the virtual garment according to the target position of each mesh vertex of the virtual garment.

[0089] The normal direction of any position on the virtual garment in the embodiments of the present disclosure is a direction perpendicular to a tangent plane of the position on the virtual garment. For example, referring to FIG. 2, the tangent plane of the point 211 on the virtual garment 21 is the plane 22, and the direction F is perpendicular to the plane 22, so the normal direction of the position of the point 211 on the virtual garment 21 is F. Figure 2

[0090] S14, rendering the virtual garment according to the normal direction of each position of the virtual garment, and outputting a virtual garment rendering effect image.

[0091] ​Specifically, a normal map of the virtual clothes can be generated according to the normal directions of the positions of the virtual clothes, and the brightness changes of the positions of the virtual clothes due to the angles between the normal directions and the light source directions can be calculated according to the normal map of the virtual clothes, so that the virtual clothes surface has the rendering effect of wrinkle shadow distribution.

[0092] The virtual clothes rendering method provided by the embodiments of the present disclosure can obtain the normal directions of the positions of the virtual clothes, and render and output the rendering effect image of the virtual clothes according to the normal directions of the positions of the virtual clothes. On the one hand, since the normal directions of the positions of the virtual clothes can affect the brightness of the positions of the virtual clothes, the embodiments of the present disclosure can render the shadow of the wrinkle of the virtual clothes in the rendering effect image of the virtual clothes, so that the virtual clothes can have the wrinkle effect with the change of the posture of the user, and the virtual clothes are more realistic. On the other hand, since the embodiments of the present disclosure only control the brightness of the positions of the virtual clothes by using the normal directions of the positions of the virtual clothes, and do not generate actual wrinkles, the embodiments of the present disclosure can reduce the calculation amount of the virtual clothes rendering. In summary, the embodiments of the present disclosure can make the virtual clothes have the wrinkle effect with the change of the posture of the user, and reduce the calculation amount of the virtual clothes rendering.

[0093] As an extension and refinement of the above-mentioned embodiments, the embodiments of the present disclosure provide another virtual clothes rendering method, which is described with reference to FIG. 8. Figure 3 The virtual clothes rendering method includes the following steps:

[0094] S301, obtaining a target image.

[0095] The target image includes a target object.

[0096] That is, the target object is image sampled to obtain a target image including the target object. The image can be a plane image or a depth image containing depth information.

[0097] S302, extracting a skeletal model of the target object according to the target image.

[0098] Specifically, the implementation manner of extracting the skeleton model of the target object according to the target image can include: first obtaining a pre-established skeleton model according to the type of the target object, and then correcting the pre-established skeleton model according to the position information of each key point of the target object to obtain the skeleton model of the target object. For example, when the target object is a human, first obtain a pre-established human skeleton model, and then correct the length of each bone, the number of bones and other information of the pre-established human skeleton model according to the position information of each key point (elbow, wrist, knee, shoulder, etc.) of the target object, so as to obtain the skeleton model of the target object.

[0099] To realize the rendering of the virtual clothes, after obtaining the skeleton model of the target object, the virtual clothes also need to be generated, and in the embodiment of the present application, the generation of the virtual clothes can be realized through the following step S303.

[0100] S303, merging the grid vertices with the same position in the grid vertices of the virtual clothes to generate a virtual clothes with a completely connected topology.

[0101] Specifically, the virtual clothes can be a 3D grid model composed of a plurality of polygons, and the plurality of polygons are independent of each other, and many vertices of many polygons are located at the same position. In order to facilitate subsequent processing, the grid vertices with the same position can be merged to generate a virtual clothes with a completely connected topology.

[0102] It should be noted that the order of extracting the skeleton model of the target object (steps S301 and S302) and generating the virtual clothes with a completely connected topology (step S303) is not limited in the embodiment of the present application. The skeleton model of the target object can be extracted first, and then the virtual clothes with a completely connected topology can be generated. The virtual clothes with a completely connected topology can be generated first, and then the skeleton model of the target object can be extracted. The two can also be performed simultaneously.

[0103] S304, obtaining the pose information of the target object.

[0104] As described above, the image of the target object can be obtained by image acquisition equipment for image acquisition of the target object, and the pose information of the target object can be obtained by identifying the target object in the obtained image.

[0105] S305, obtaining the skeleton transform matrix of the at least one bone in the skeleton model of the target object according to the pose information.

[0106] The skeleton transform matrix of any bone is a matrix for transforming the bone from an initial position to a position corresponding to the pose information.

[0107] Specifically, the position and orientation of each bone in the skeleton model extracted in the pose information updating step S302 can be updated to obtain a bone transformation matrix of the at least one bone in the skeleton model of the target object.

[0108] In S306, a target position of each mesh vertex of the virtual garment is calculated according to the bone transformation matrix of the at least one bone and the skinning information of the at least one bone.

[0109] The skinning information of any bone includes an influence weight of the bone on each mesh vertex of the virtual garment.

[0110] Specifically, each mesh vertex of the virtual garment can be bound to at least one bone in the skeleton model of the target object, and the influence weight of the bone on each mesh vertex can be configured to generate the skinning information of the at least one bone in the skeleton model. In the embodiment of the present disclosure, the virtual garment can be bound to each bone in the skeleton model of the target object.

[0111] Optionally, the implementation of calculating the target position of each mesh vertex of the virtual garment according to the bone transformation matrix of the at least one bone and the skinning information of the at least one bone can include steps 306a and 306b.

[0112] In step 306a, an influence value of each bone in the at least one bone on each mesh vertex of the virtual garment is obtained.

[0113] The influence value of any bone on any mesh vertex includes the product of the influence weight of the bone on the mesh vertex, the bone transformation matrix of the bone, and the initial position of the mesh vertex.

[0114] Let the bone transformation matrix of bone k be T k , the influence weight of bone k on mesh vertex i be The initial position of mesh vertex i be The influence value of bone k on mesh vertex i be Then we have:

[0115]

[0116] In step 306b, the influence values of each bone in the at least one bone on the same mesh vertex of the virtual garment are summed up to obtain the target position of each mesh vertex of the virtual garment.

[0117] Let the target position of mesh vertex i be x i , and the at least one bone include n bones, then we have:

[0118]

[0119] S307, according to the target position of each mesh vertex of the virtual clothes, the initial position of each mesh vertex of the virtual clothes, the target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and the initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, the compression rate and the compression direction of each mesh vertex of the virtual clothes are obtained.

[0120] Specifically, the adjacent mesh vertices of any mesh vertex in the embodiments of the present disclosure refer to the mesh vertices belonging to the same mesh as the mesh vertex, or in other words, for any two mesh vertices, if the two mesh vertices have mesh lines connected to each other, the two mesh vertices are adjacent mesh vertices, and if the two mesh vertices do not have mesh lines connected to each other, the two mesh vertices are not adjacent mesh vertices. Referring to Figure 4 As shown in the figure, the mesh vertices belonging to the same mesh as the mesh vertex A (i.e., having mesh lines connected to each other with the mesh vertex A) include mesh vertex B, mesh vertex C, mesh vertex D, mesh vertex E, mesh vertex F, and mesh vertex G, so the adjacent mesh vertices of the mesh vertex A include mesh vertex B, mesh vertex C, mesh vertex D, mesh vertex E, mesh vertex F, and mesh vertex G.

[0121] In the embodiments of the present disclosure, the adjacent mesh vertices of each mesh vertex can be obtained in advance in the above step S303 (generating a virtual clothes with topologically completely connected meshes), and the indexes of the adjacent mesh vertices of each mesh vertex are stored in a preset position, so that the adjacent mesh vertices of the mesh vertex are directly read in step S307.

[0122] Further, the compression rate of any mesh vertex is used to represent the ratio of the average area of the mesh with the mesh vertex as the vertex before and after the deformation of the virtual clothes.

[0123] For example, referring to Figure 4 As shown in the figure, Figure 4 In the figure, the meshes with the mesh vertex A as the vertex are taken as triangles, which include △ABC, △ACD, △ADE, △AEF, △AFG, and △AGB. If before the deformation of the virtual clothes, △ABC, △ACD, △ADE, △AEF, △AFG, and △AGB are S11, S12, S13, S14, S15, and S16 respectively, and after the deformation of the virtual clothes, △ABC, △ACD, △ADE, △AEF, △AFG, and △AGB are S21, S22, S23, S24, S25, and S26 respectively, then the compression rate Cr of the mesh vertex A can be represented by the calculation result of the following formula:

[0124] Cr = (21 + S22 + S23 + S24 + S25 + S26) / (S11 + S12 + S13 + S14 + S15 + S16)

[0125] Optionally, the step S307 of obtaining the compression rate and the compression direction of each mesh vertex of the virtual clothes according to the target position of each mesh vertex of the virtual clothes, the initial position of each mesh vertex of the virtual clothes, the target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and the initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes can include the following steps 307a to 307i:

[0126] Step 307a, obtaining the first position difference between each mesh vertex and each adjacent mesh vertex.

[0127] Wherein, the first position difference between any mesh vertex and any adjacent mesh vertex is the difference between the target position of the adjacent mesh vertex and the target position of the mesh vertex.

[0128] Suppose: the target position of mesh vertex j is x j , the target position of the adjacent mesh vertex n of mesh vertex j is x n , and the first position difference between mesh vertex j and the adjacent mesh vertex n of mesh vertex j is e jn , then:

[0129] e jn = x jn - x j

[0130] Step 307b, obtaining the second position difference between each mesh vertex and each adjacent mesh vertex.

[0131] Wherein, the second position difference between any mesh vertex and any adjacent mesh vertex is the difference between the initial position of the adjacent mesh vertex and the initial position of the mesh vertex.

[0132] Suppose: the initial position of mesh vertex j is , the target position of the adjacent mesh vertex n of mesh vertex j is , and the second position difference between mesh vertex j and the adjacent mesh vertex n of mesh vertex j is , then:

[0133]

[0134] Step 307c, obtaining the first matrix corresponding to each adjacent mesh vertex of each mesh vertex.

[0135] The first matrix corresponding to any adjacent grid vertex of any grid vertex is the tensor product of the first position difference and the second position difference between the grid vertex and the adjacent grid vertex.

[0136] Suppose that the first matrix corresponding to adjacent grid vertex n of grid vertex j is P jn Then, we have:

[0137]

[0138] Step 307d, obtaining the first feature matrix of each grid vertex.

[0139] The first feature matrix of any grid vertex is the sum of the first matrices corresponding to each adjacent grid vertex of the grid vertex.

[0140] Suppose that grid vertex j has m adjacent grid vertices, and the first feature matrix of grid vertex j is Q j Then, we have:

[0141]

[0142] Step 307e, obtaining the second matrix corresponding to each adjacent grid vertex of each grid vertex.

[0143] The second matrix corresponding to any adjacent grid vertex of any grid vertex is the tensor product of the second position difference and the second position difference between the grid vertex and the adjacent grid vertex.

[0144] Suppose that the second matrix corresponding to adjacent grid vertex n of grid vertex j is X jn Then, we have:

[0145]

[0146] Step 307f, obtaining the second feature matrix of each grid vertex.

[0147] The second feature matrix of any grid vertex is the sum of the second matrices corresponding to each adjacent grid vertex of the grid vertex.

[0148] Suppose that grid vertex j has m adjacent grid vertices, and the second feature matrix of grid vertex j is Y j Then, we have:

[0149]

[0150] Step 307g, obtaining the third feature matrix of each grid vertex.

[0151] The third feature matrix of any grid vertex is the product of the first feature matrix of the grid vertex and the inverse matrix of the second feature matrix of the grid vertex.

[0152] Let the third feature matrix of the grid vertex j be M j Then, we have:

[0153]

[0154] Step 307h, obtaining the fourth feature matrix of each grid vertex.

[0155] Wherein, the fourth feature matrix of any grid vertex is the product of the transpose matrix of the third feature matrix of the grid vertex and the third feature matrix of the grid vertex.

[0156] Let the third feature matrix of the grid vertex j be A j Then, we have:

[0157]

[0158] Step 307i, obtaining the minimum eigenvalue and eigenvector of the fourth feature matrix of each grid vertex, and taking the minimum eigenvalue and eigenvector as the compression rate and compression direction of each grid vertex, respectively.

[0159] That is, obtaining the minimum eigenvalue of the second matrix corresponding to each grid vertex as the compression rate corresponding to each grid vertex, and obtaining the eigenvector corresponding to the minimum eigenvalue of the second matrix corresponding to each grid vertex as the compression direction corresponding to each grid vertex.

[0160] S308, generating a wrinkle height field formed by the virtual garment according to the compression rate and compression direction of each grid vertex of the virtual garment.

[0161] Optionally, the implementation manner of the above step S308 (generating a wrinkle height field formed by the virtual garment according to the compression rate and compression direction of each grid vertex of the virtual garment) can include the following steps 308a to 308d:

[0162] Step 308a, obtaining the height value of each grid vertex of the virtual garment according to the compression rate of each grid vertex of the virtual garment.

[0163] Wherein, the height value of any grid vertex is the product of a first constant and the first calculation value corresponding to the grid vertex, and the first calculation value corresponding to any grid vertex is the difference between a second constant and the compression rate of the grid vertex.

[0164] Let the compression rate of the grid vertex k be c k , the first constant be a, the second constant be b, the first calculation value corresponding to the grid vertex k be l k , and the height value of the grid vertex k be h k Then, we have:

[0165] h k = a k = a(b-c k )

[0166] For example, the second constant can be 1.

[0167] Step 308b, obtaining the influence value of each position of the virtual clothing.

[0168] Wherein, the influence value of any position includes the influence value of each grid vertex of the grid to which the position belongs to the position, the influence value of any grid vertex to any position includes the product of the height value of the grid vertex and the corresponding height retention rate, the height retention rate of any position to any grid vertex is the cosine value of the compression direction of the grid vertex and the corresponding position difference, and the position difference of any position and any grid vertex is the position difference between the position and the target position of the grid vertex.

[0169] Let the compression direction of grid vertex k be d k , the position coordinates of position q be Y, the target position of grid vertex k be x k , and the height retention rate of position D to grid vertex k be H kq , then:

[0170] H kq = cos[d k ·(Y-x k )]

[0171] For example, the following describes the implementation of step 308b by taking the influence value of position D located in the triangular grid ABC of the virtual clothing as an example. Since the influence value of any position includes the influence value of each grid vertex of the grid to which the position belongs to the position, the influence value of position D includes the influence value of grid vertex A to position D, the influence value of grid vertex B to position D, and the influence value of grid vertex C to position D.

[0172] Let the position coordinates of position D be Y, the influence value of grid vertex A to position D be H AD , the influence value of grid vertex A to position D be H BD , the influence value of grid vertex C to position D be H CD , the height value of grid vertex A be h A , the height value of grid vertex B be h B , the height value of grid vertex C be h C , the compression direction of grid vertex A be d A , the compression direction of grid vertex B be d B , and the compression direction of grid vertex C be d CThe target position of grid vertex A is x A The target position of grid vertex B is x B The target position of grid vertex C is x C Then:

[0173] H AD = h A *cos[d A ·(Y-x A )]

[0174] H BD = h B *cos[d B ·(Y-x B )]

[0175] H CD = h D *cos[d C ·(Y-x C )]

[0176] Step 308c, obtaining the height of each position of the virtual garment according to the influence value of each position of the virtual garment.

[0177] As mentioned above, the height of position D of the virtual garment is obtained according to H AD , H BD and H CD .

[0178] Illustratively, obtaining the height of each position of the virtual garment according to the influence value of each position of the virtual garment can include: linearly interpolating the influence value of the grid vertex according to the relative position of each position in the grid, to obtain the height of each position of the virtual garment.

[0179] Step 308d, obtaining a wrinkle height field formed by the virtual garment according to the height of each position on the virtual garment.

[0180] S309, obtaining the normal direction of each position of the virtual garment according to the wrinkle height field.

[0181] Optionally, the above step S309 of obtaining the normal direction of each position of the virtual garment according to the wrinkle height field includes steps S309a and S309b as follows:

[0182] Step S309a, obtaining the gradient of each position of the virtual garment according to the wrinkle height field.

[0183] Let the position coordinate of position Y be y, the height of position Y be H(y), and the gradient of position Y be H Y Then:

[0184]

[0185] Step S309b, difference between the initial normal direction of each position of the virtual clothes and the gradient of each position of the virtual clothes, obtains the normal direction of each position of the virtual clothes.

[0186] Suppose that the initial normal direction of position Y is The normal direction of position Y is N Y Then, there is:

[0187]

[0188] Specifically, the normal direction of any position on the virtual clothes is the direction perpendicular to the tangent plane of the position. For example, as shown in FIG. 4A, the direction perpendicular to the tangent plane of position A on the virtual clothes is FA, and the direction perpendicular to the tangent plane of position B on the virtual clothes is FB, so the normal direction of position A on the virtual clothes is FA, and the normal direction of position A on the virtual clothes is FB. Figure 5

[0189] S310, rendering the virtual clothes according to the normal direction of each position of the virtual clothes, and outputting the rendering effect image of the virtual clothes.

[0190] The virtual clothes rendering method provided by the embodiment of the present disclosure can obtain the posture information of the target object, then obtain the target position of each mesh vertex of the virtual clothes after the virtual clothes are deformed according to the posture information, then obtain the normal direction of each position of the virtual clothes according to the target position of each mesh vertex of the virtual clothes, and then render and output the rendering effect image of the virtual clothes according to the normal direction of each position of the virtual clothes. On the one hand, since the embodiment of the present disclosure can obtain the normal direction of each position of the virtual clothes, and render and output the rendering effect image of the virtual clothes according to the normal direction of each position of the virtual clothes, and the normal direction of each position can affect the brightness of each position of the virtual clothes, the embodiment of the present disclosure can render the shadow of the wrinkle of the virtual clothes in the rendering effect image of the virtual clothes, so that the virtual clothes can produce the wrinkle effect with the change of the posture of the user, and further make the virtual clothes more realistic. On the other hand, since the embodiment of the present disclosure only controls the brightness of each position on the virtual clothes by using the normal direction of each position on the virtual clothes, and does not generate actual wrinkles, the embodiment of the present disclosure can reduce the calculation amount of the virtual clothes rendering. In summary, the embodiment of the present disclosure can make the virtual clothes produce the wrinkle effect with the change of the posture of the user, while reducing the calculation amount of the virtual clothes rendering.

[0191] ​Based on the same inventive concept, as an implementation of the method, the embodiment of the disclosure also provides a virtual clothes rendering device. The device embodiment corresponds to the foregoing method embodiment, and for the sake of reading, the details of the foregoing method embodiment will not be described one by one, but it should be clear that the virtual clothes rendering device in the embodiment can correspondingly implement all the contents in the foregoing method embodiment.

[0192] The embodiment of the disclosure provides a virtual clothes rendering device. Figure 6 A structural schematic diagram of the virtual clothes rendering device is shown as Figure 6 The virtual clothes rendering device 600 comprises:

[0193] The acquisition unit 61 is configured to acquire pose information of a target object.

[0194] The driving unit 62 is configured to acquire target positions of each mesh vertex of a virtual clothes according to the pose information, wherein the target positions of each mesh vertex of the virtual clothes comprise positions of each mesh vertex of the virtual clothes after the virtual clothes is deformed according to the pose information.

[0195] The processing unit 63 is configured to acquire normal directions of each position of the virtual clothes according to the target positions of each mesh vertex of the virtual clothes.

[0196] The rendering unit 64 is configured to render the virtual clothes according to the normal directions of each position of the virtual clothes, and output a rendering effect image of the virtual clothes.

[0197] As an optional implementation of the embodiment of the disclosure, the driving unit 62 is specifically configured to acquire a bone transformation matrix of the at least one bone in a bone model of the target object according to the pose information, and calculate the target positions of each mesh vertex of the virtual clothes according to the bone transformation matrix of the at least one bone and skin information of the at least one bone.

[0198] The bone transformation matrix of any bone is a matrix for transforming the bone from an initial position to a position corresponding to the pose information, and the skin information of any bone comprises an influence weight of the bone on each mesh vertex of the virtual clothes.

[0199] As an optional implementation of the embodiment of the disclosure, the driving unit 62 is specifically configured to acquire an influence value of each bone in the at least one bone on each mesh vertex of the virtual clothes, sum the influence values of each bone in the at least one bone on the same mesh vertex of the virtual clothes respectively, and acquire the target positions of each mesh vertex of the virtual clothes.

[0200] The influence value of any bone on any mesh vertex includes a product of an influence weight of the bone on the mesh vertex, a bone transformation matrix of the bone, and an initial position of the mesh vertex.

[0201] As an optional implementation of an embodiment of the present disclosure, referring to Figure 7 As shown in FIG. 6, the virtual clothes rendering device 600 further includes:

[0202] The extraction unit 65 is configured to, before the driving unit acquires the bone transformation matrix of the at least one bone in the skeletal model of the target object according to the pose information, acquire a target image, and extract the skeletal model of the target object according to the target image.

[0203] The target image includes the target object.

[0204] As an optional implementation of an embodiment of the present disclosure, the processing unit 63 is specifically configured to: acquire a compression rate and a compression direction of each mesh vertex of the virtual clothes according to a target position of each mesh vertex of the virtual clothes, an initial position of each mesh vertex of the virtual clothes, a target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and an initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes; generate a wrinkle height field formed by the virtual clothes according to the compression rate and the compression direction of each mesh vertex of the virtual clothes; and acquire a normal direction of each position of the virtual clothes according to the wrinkle height field.

[0205] As an optional implementation of the embodiment of the present disclosure, the processing unit 63 is specifically configured to: obtain a first position difference between each mesh vertex and each adjacent mesh vertex, the first position difference between any mesh vertex and any adjacent mesh vertex being a difference between a target position of the adjacent mesh vertex and a target position of the mesh vertex; obtain a second position difference between each mesh vertex and each adjacent mesh vertex, the second position difference between any mesh vertex and any adjacent mesh vertex being a difference between an initial position of the adjacent mesh vertex and an initial position of the mesh vertex; obtain a first matrix corresponding to each adjacent mesh vertex of each mesh vertex, the first matrix corresponding to any mesh vertex and any adjacent mesh vertex being a tensor product of the first position difference and the second position difference between the mesh vertex and the adjacent mesh vertex; obtain a first feature matrix of each mesh vertex, the first feature matrix of any mesh vertex being a sum of the first matrix corresponding to each adjacent mesh vertex of the mesh vertex; obtain a second matrix corresponding to each adjacent mesh vertex of each mesh vertex, the second matrix corresponding to any mesh vertex and any adjacent mesh vertex being a tensor product of the second position difference and the second position difference between the mesh vertex and the adjacent mesh vertex; obtain a second feature matrix of each mesh vertex, the second feature matrix of any mesh vertex being a sum of the second matrix corresponding to each adjacent mesh vertex of the mesh vertex; obtain a third feature matrix of each mesh vertex, the third feature matrix of any mesh vertex being a product of an inverse matrix of the first feature matrix of the mesh vertex and the second feature matrix of the mesh vertex; obtain a fourth feature matrix of each mesh vertex, the fourth feature matrix of any mesh vertex being a product of a transpose matrix of the third feature matrix of the mesh vertex and the third feature matrix of the mesh vertex; and obtain a minimum eigenvalue and an eigenvector of the fourth feature matrix of each mesh vertex, and take the minimum eigenvalue and the eigenvector as a compression rate and a compression direction of each mesh vertex, respectively.

[0206] As an optional implementation of the embodiment of the present disclosure, the processing unit 63 is specifically configured to obtain the height value of each mesh vertex of the virtual garment according to the compression rate of each mesh vertex of the virtual garment, the height value of any mesh vertex being the product of a first constant and a first calculation value corresponding to the mesh vertex, the first calculation value corresponding to any mesh vertex being the difference between a second constant and the compression rate of the mesh vertex; obtain the influence value of each position of the virtual garment, the influence value of any position including the influence value of each mesh vertex of the grid to which the position belongs on the position, the influence value of any mesh vertex on any position including the product of the height value of the mesh vertex and the corresponding height retention rate, the height retention rate of any position on any mesh vertex being the cosine value of the compression direction of the mesh vertex and the position difference corresponding to the position, the position difference between any position and any mesh vertex being the position difference between the position and the target position of the mesh vertex; obtain the height of each position of the virtual garment according to the influence value of each position of the virtual garment; and obtain the wrinkle height field formed by the virtual garment according to the height of each position on the virtual garment.

[0207] As an optional implementation of the embodiment of the present disclosure, the processing unit 63 is specifically configured to obtain the gradient of each position of the virtual garment according to the wrinkle height field.

[0208] The difference between the initial normal direction of each position of the virtual garment and the gradient of each position of the virtual garment is obtained to obtain the normal direction of each position of the virtual garment.

[0209] As an optional implementation of the embodiment of the present disclosure, referring to Figure 7 As shown in FIG. 6, the virtual garment rendering device 600 further includes:

[0210] The generating unit 66 is configured to, before the driving unit 62 obtains the target position of each mesh vertex of the virtual garment according to the pose information, merge mesh vertices with the same position in the mesh vertices of the virtual garment to generate the virtual garment with a completely connected topology.

[0211] The virtual garment rendering device provided by the embodiment of the present disclosure can perform all the contents of the virtual garment rendering method provided by the above-mentioned embodiment, and can achieve similar technical effects to the above-mentioned virtual garment rendering method.

[0212] Based on the same inventive concept, the present disclosure also provides an electronic device. Figure 8 The structural schematic diagram of the electronic device provided by the embodiment of the present disclosure is shown in Figure 8As shown, the electronic device provided by the embodiment includes a memory 81 and a processor 82, the memory 81 is used for storing a computer program, and the processor 82 is used for enabling the electronic device to implement the virtual clothes rendering method provided by the above embodiment when the computer program is executed.

[0213] The embodiment of the present disclosure further provides a computer readable storage medium, and the computer readable storage medium stores a computer program. When the computer program is executed by a computing device, the computing device implements the virtual clothes rendering method provided by the above embodiment.

[0214] The embodiment of the present disclosure further provides a computer program product, and when the computer program product runs on a computer, the computer implements the virtual clothes rendering method provided by the above embodiment.

[0215] Those skilled in the art will appreciate that the embodiments of the present disclosure can be provided as a method, a system, or a computer program product. Therefore, the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied in the medium.

[0216] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0217] The memory can include non-persistent memory in computer readable media, random access memory (RAM), and / or non-volatile memory, etc. in the form of read-only memory (ROM) or flash memory (flash RAM). The memory is an example of the computer readable medium.

[0218] Computer-readable media includes permanent and non-permanent, movable and non-movable storage media. The storage medium can be implemented by any method or technology to store information, and the information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0219] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present disclosure, and not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present disclosure.

Claims

1. A method of virtual garment rendering, the method comprising: The method comprises: obtaining pose information of a target object; obtaining target positions of each mesh vertex of a virtual garment according to the pose information, wherein the target positions of each mesh vertex of the virtual garment include positions of each mesh vertex of the virtual garment after the virtual garment is deformed according to the pose information; obtaining normal directions of each position of the virtual garment according to the target positions of each mesh vertex of the virtual garment; rendering the virtual garment according to the normal directions of each position of the virtual garment, and outputting a rendered image of the virtual garment; the step of obtaining the normal directions of each position of the virtual garment according to the target positions of each mesh vertex of the virtual garment comprises: obtaining a compression rate and a compression direction of each mesh vertex of the virtual garment according to the target positions of each mesh vertex of the virtual garment, initial positions of each mesh vertex of the virtual garment, target positions of each adjacent mesh vertex of each mesh vertex of the virtual garment, and initial positions of each adjacent mesh vertex of each mesh vertex of the virtual garment; the compression rate of any mesh vertex is used to represent a ratio of average areas of a mesh with the mesh vertex as a vertex before and after deformation of the virtual garment; generating a wrinkle height field formed by the virtual garment according to the compression rate and the compression direction of each mesh vertex of the virtual garment; obtaining the normal directions of each position of the virtual garment according to the wrinkle height field.

2. The method of claim 1, wherein, the step of obtaining the target positions of each mesh vertex of the virtual garment according to the pose information comprises: obtaining a bone transformation matrix of at least one bone in a skeletal model of the target object according to the pose information; the bone transformation matrix of any bone is a matrix for transforming the bone from an initial position to a position corresponding to the pose information; calculating the target positions of each mesh vertex of the virtual garment according to the bone transformation matrix of the at least one bone and skin information of the at least one bone; the skin information of any bone includes an influence weight of the bone on each mesh vertex of the virtual garment.

3. The method of claim 2, wherein, the step of calculating the target positions of each mesh vertex of the virtual garment according to the bone transformation matrix of the at least one bone and the skin information of the at least one bone comprises: obtaining an influence value of each bone in the at least one bone on each mesh vertex of the virtual garment; the influence value of any bone on any mesh vertex includes a product of an influence weight of the bone on the mesh vertex, the bone transformation matrix of the bone, and an initial position of the mesh vertex; summing up the influence values of each bone in the at least one bone on the same mesh vertex of the virtual garment respectively to obtain the target positions of each mesh vertex of the virtual garment.

4. The method of claim 2, wherein, Before the step of obtaining the bone transformation matrix of the at least one bone in the skeletal model of the target object according to the pose information, the method further comprises: obtaining a target image, wherein the target image includes the target object; extracting a skeletal model of the target object according to the target image.

5. The method of claim 1, wherein, The method comprises the following steps: obtaining a first position difference between each mesh vertex and each adjacent mesh vertex, wherein the first position difference between any mesh vertex and any adjacent mesh vertex is a difference between the target position of the adjacent mesh vertex and the target position of the mesh vertex; obtaining a second position difference between each mesh vertex and each adjacent mesh vertex, wherein the second position difference between any mesh vertex and any adjacent mesh vertex is a difference between the initial position of the adjacent mesh vertex and the initial position of the mesh vertex; obtaining a first matrix corresponding to each adjacent mesh vertex of each mesh vertex, wherein the first matrix corresponding to any adjacent mesh vertex of any mesh vertex is a tensor product of the first position difference and the second position difference between the mesh vertex and the adjacent mesh vertex; obtaining a first feature matrix of each mesh vertex, wherein the first feature matrix of any mesh vertex is a sum of the first matrices corresponding to each adjacent mesh vertex of the mesh vertex; obtaining a second matrix corresponding to each adjacent mesh vertex of each mesh vertex, wherein the second matrix corresponding to any adjacent mesh vertex of any mesh vertex is a tensor product of the second position difference and the second position difference between the mesh vertex and the adjacent mesh vertex; obtaining a second feature matrix of each mesh vertex, wherein the second feature matrix of any mesh vertex is a sum of the second matrices corresponding to each adjacent mesh vertex of the mesh vertex; obtaining a third feature matrix of each mesh vertex, wherein the third feature matrix of any mesh vertex is a product of the inverse matrix of the first feature matrix of the mesh vertex and the second feature matrix of the mesh vertex; obtaining a fourth feature matrix of each mesh vertex, wherein the fourth feature matrix of any mesh vertex is a product of the transpose matrix of the third feature matrix of the mesh vertex and the third feature matrix of the mesh vertex; obtaining a minimum eigenvalue and an eigenvector of the fourth feature matrix of each mesh vertex, and taking the minimum eigenvalue and the eigenvector as the compression rate and the compression direction of each mesh vertex, respectively.

6. The method of claim 1, wherein, The method comprises the following steps: obtaining a height value of each mesh vertex of the virtual garment according to the compression rate of each mesh vertex of the virtual garment, wherein the height value of any mesh vertex is a product of a first constant and a first calculation value corresponding to the mesh vertex, and the first calculation value corresponding to any mesh vertex is a difference between a second constant and the compression rate of the mesh vertex; and generating a wrinkle height field formed by the virtual garment according to the compression rate and the compression direction of each mesh vertex of the virtual garment. obtaining an influence value of each position of the virtual clothes, the influence value of any position including influence values of each mesh vertex of a mesh to which the position belongs to the position, the influence value of any mesh vertex to any position including a product of a height value of the mesh vertex and a corresponding height retention rate, the height retention rate of any position to any mesh vertex being a cosine value of a compression direction of the mesh vertex and a corresponding position difference, the position difference of any position and any mesh vertex being a position difference between the position and a target position of the mesh vertex; obtaining a height of each position of the virtual clothes according to the influence value of each position of the virtual clothes; obtaining a wrinkle height field formed by the virtual clothes according to the height of each position on the virtual clothes.

7. The method of claim 1, wherein, the normal direction of each position of the virtual clothes is obtained according to the wrinkle height field, including: a gradient of each position of the virtual clothes is obtained according to the wrinkle height field; the normal direction of each position of the virtual clothes is obtained by subtracting the initial normal direction of each position of the virtual clothes from the gradient of each position of the virtual clothes.

8. The method according to any one of claims 1 to 7, characterized in that, Before obtaining the target position of each mesh vertex of the virtual clothes according to the pose information, the method further includes: merging mesh vertices of the virtual clothes with the same position to generate the virtual clothes with a completely connected topology.

9. A virtual garment rendering apparatus, characterized by, including: an obtaining unit configured to obtain pose information of a target object; a driving unit configured to obtain a target position of each mesh vertex of virtual clothes according to the pose information, the target position of each mesh vertex of the virtual clothes including a position of each mesh vertex of the virtual clothes after the virtual clothes are deformed according to the pose information; a processing unit configured to obtain a normal direction of each position of the virtual clothes according to the target position of each mesh vertex of the virtual clothes; a rendering unit configured to render the virtual clothes according to the normal direction of each position of the virtual clothes and output a rendering effect image of the virtual clothes; the processing unit is specifically configured to obtain a compression rate and a compression direction of each mesh vertex of the virtual clothes according to the target position of each mesh vertex of the virtual clothes, an initial position of each mesh vertex of the virtual clothes, a target position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, and an initial position of each adjacent mesh vertex of each mesh vertex of the virtual clothes, generate a wrinkle height field formed by the virtual clothes according to the compression rate and the compression direction of each mesh vertex of the virtual clothes, and obtain the normal direction of each position of the virtual clothes according to the wrinkle height field. The compression rate of any mesh vertex is used to represent a ratio of average areas of a mesh with the mesh vertex as a vertex before and after deformation of the virtual clothes.

10. An electronic device, comprising: including: a memory and a processor, the memory being configured to store a computer program, and the processor being configured to, when executing the computer program, enable the electronic device to implement the virtual clothes rendering method in any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and when the computer program is executed by a computing device, the computing device implements the virtual clothes rendering method in any one of claims 1-8.

12. A computer program product, characterised in that, The computer program product, when running on a computer, causes the computer to implement the virtual clothes rendering method in any one of claims 1-8.

Citation Information

Patent Citations

  • Device, program and method for simulating clothing

    JP2005011027A

  • Simulating garment with wrinkles based on physics based cloth simulator and machine learning model

    US10909744B1