Mask map generation method and device, electronic equipment and storage medium

By automatically processing the occlusion area and two-dimensional expansion map mask processing of the three-dimensional grid model, the problems of low efficiency and poor quality of soma mask map generation in the prior art are solved, and efficient and accurate soma mask map generation is achieved.

CN120279150APending Publication Date: 2025-07-08BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510336955.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the prior art, the process of generating three-dimensional virtual object body mask maps is inefficient and susceptible to human factors, resulting in poor generation quality.

Method used

The three-dimensional mesh model of the target virtual object is obtained through an automated method, and the area blocked by the clothing mesh model is determined, and the two-dimensional expansion diagram is used for masking to generate a body mask map to avoid manual operations and human influence.

Benefits of technology

It improves the efficiency and quality of body mask map generation, reduces human errors, and ensures no model penetration phenomenon during the rendering of three-dimensional virtual objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279150A_ABST
    Figure CN120279150A_ABST
Patent Text Reader

Abstract

The invention provides a mask map generation method and device, electronic equipment and a storage medium, relates to the technical field of artificial intelligence, in particular to the technical fields of computer vision, augmented reality and the like, and can be applied to scenes such as digital humans, meta universe, online games and the like. According to the specific implementation scheme, an initial three-dimensional grid model of a target virtual object is obtained; wherein the initial three-dimensional mesh model comprises an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial body mesh model is coated with the initial clothing mesh model; determining a first target area, shielded by the available garment mesh model, on the initial body mesh model; wherein the available clothing mesh model is obtained based on the initial clothing mesh model; obtaining a two-dimensional expansion graph of the initial body grid model; and carrying out mask processing on a second target area corresponding to the first target area in the two-dimensional expansion graph to obtain a body mask map for the initial body grid model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, particularly to technical fields such as computer vision and augmented reality, and can be applied to scenarios such as digital humans, the metaverse, online games, etc. Specifically, it relates to a method, device, electronic device and storage medium for generating a mask texture map. Background Art

[0002] Three-dimensional virtual objects (e.g., digital humans) are digital human representations created based on advanced computer graphics, artificial intelligence, and real-time rendering technologies. They can simulate the appearance and movements of real humans through high-precision three-dimensional modeling and animation technologies, and communicate and interact with users by combining machine learning and natural language processing technologies. Summary of the Invention

[0003] The present disclosure provides a method, device, electronic device and storage medium for generating a mask texture map.

[0004] According to a first aspect of the present disclosure, there is provided a method for generating a mask texture map, including:

[0005] Obtaining an initial three-dimensional mesh model of a target virtual object; wherein, the initial three-dimensional mesh model includes an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model covers the outside of the initial body mesh model;

[0006] Determining a first target area on the initial body mesh model that is blocked by an available clothing mesh model; wherein, the available clothing mesh model is obtained based on the initial clothing mesh model;

[0007] Obtaining a two-dimensional unfolded view of the initial body mesh model;

[0008] Performing mask processing on a second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model.

[0009] According to a second aspect of the present disclosure, there is provided a mask texture map generating device, including:

[0010] A model obtaining unit, configured to obtain an initial three-dimensional mesh model of a target virtual object; wherein, the initial three-dimensional mesh model includes an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model covers the outside of the initial body mesh model;

[0011] An area determining unit, configured to determine a first target area on the initial body mesh model that is blocked by an available clothing mesh model; wherein, the available clothing mesh model is obtained based on the initial clothing mesh model;

[0012] An unfolding diagram acquisition unit for acquiring a two-dimensional unfolding diagram of an initial body mesh model;

[0013] A mask processing unit for performing mask processing on a second target area corresponding to a first target area in the two-dimensional unfolding diagram to obtain a body mask texture map for the initial body mesh model.

[0014] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0015] At least one processor;

[0016] A memory communicatively connected to the at least one processor;

[0017] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method provided in the first aspect of the present disclosure.

[0018] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method provided in the first aspect of the present disclosure.

[0019] According to a fifth aspect of the present disclosure, there is provided a computer program product including a computer program, and the computer program implements the method provided in the first aspect of the present disclosure when executed by a processor.

[0020] Adopting the present disclosure can improve the generation efficiency and generation quality of the body mask texture map.

[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0023] Figure 1 is a schematic flowchart of a mask texture map generation method provided by an embodiment of the present disclosure;

[0024] Figure 2 is a schematic diagram of an initial clothing mesh model provided by an embodiment of the present disclosure;

[0025] Figure 3 is a schematic diagram of a multi-layer bounding box provided by an embodiment of the present disclosure;

[0026] Figure 4 is an explanatory diagram of a determination method of a countable ray provided by an embodiment of the present disclosure;

[0027] Figure 5 Schematic diagram of the complete process of a mask texture generation method provided by an embodiment of the present disclosure;

[0028] Figure 6 Schematic diagram of a target virtual object provided by an embodiment of the present disclosure;

[0029] Figure 7 A two-dimensional unfolding diagram provided by an embodiment of the present disclosure;

[0030] Figure 8 A body mask texture provided by an embodiment of the present disclosure;

[0031] Figure 9 A usable body mesh model provided by an embodiment of the present disclosure;

[0032] Figure 10 A usable three-dimensional mesh model provided by an embodiment of the present disclosure;

[0033] Figure 11 Another usable three-dimensional mesh model provided by an embodiment of the present disclosure;

[0034] Figure 12 Schematic diagram of an application scenario of a mask texture generation method provided by an embodiment of the present disclosure;

[0035] Figure 13 Schematic structural block diagram of a mask texture generation device provided by an embodiment of the present disclosure;

[0036] Figure 14 Schematic structural block diagram of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0037] The following makes an explanation of exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0038] In the process of modeling and rendering three-dimensional virtual objects, it is often necessary to process the target areas on the body mesh model of the three-dimensional virtual object that need to be blocked by the clothing mesh model through a body mask texture map (i.e., a mask texture map) to avoid the problem of penetration. Currently, the body mask texture map is usually generated by manual creation. This method requires a lot of time for texture drawing and manual adjustment. Therefore, there is a problem of low efficiency. Moreover, affected by human subjective factors, it is very easy to make mistakes, thus reducing the quality of the generated body mask texture map.

[0039] In view of the above problems, the embodiments of the present disclosure provide a method for generating a mask texture map, which can be applied to an electronic device. Among them, the electronic device can be a workbench, a mainframe computer, a conventional computer (such as a desktop computer, a laptop computer, a vehicle-mounted computer, etc.), a personal digital processor or other similar computing devices. Hereinafter, with reference to Figure 1 the following flow schematic diagram, a method for generating a mask texture map provided by the embodiments of the present disclosure will be described. It should be noted that although the logical order is shown in the flow schematic diagram, in some cases, the steps shown or described in the flowchart may also be executed in other orders.

[0040] Step S101, obtain an initial three-dimensional mesh model of a target virtual object.

[0041] Among them, the target virtual object can be a three-dimensional virtual object, such as a person, an animal, etc.

[0042] In the embodiments of the present disclosure, the initial three-dimensional mesh model may include an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model covers the outside of the initial body mesh model. Among them, the initial body mesh model can be a human model, an animal model, etc., which can be regarded as the body of the target virtual object; the initial clothing mesh model can be a clothes model, a pants model, a skirt model, etc., which can be regarded as the skin of the target virtual object.

[0043] In addition, it should be noted that in the embodiments of the present disclosure, the initial body mesh model may be composed of multiple body mesh faces, and the body mesh face may be a triangular patch, a quadrilateral patch or other polygon patches. Similarly, in the embodiments of the present disclosure, the initial clothing mesh model may be composed of multiple clothing mesh faces, and the clothing mesh face may be a triangular patch, a quadrilateral patch or other polygon patches.

[0044] Step S102, determine a first target area on the initial body mesh model blocked by the available clothing mesh model.

[0045] Among them, the available clothing mesh model can be determined based on the initial clothing mesh model. For example, the available clothing mesh model can be the initial clothing mesh model itself, or the clothing mesh model obtained after performing adjustment operations (such as size change, deletion of some clothing mesh surfaces, etc.) on the initial clothing mesh model.

[0046] After obtaining the available clothing mesh model, the first target area occluded by the available clothing mesh model can be determined from the initial body mesh model.

[0047] Step S103: Obtain the two-dimensional unfolded view of the initial body mesh model.

[0048] In one example, the two-dimensional unfolded view (also known as the UV unfolded view) of the initial body mesh model can be obtained from a preset unfolded view material library.

[0049] Step S104: Perform mask processing on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model.

[0050] Among them, the mask processing can be to set the opacity of all pixel points in the second target area to 0, that is, to adjust the second target area to a transparent effect.

[0051] By using the mask texture map generation method provided in the embodiments of the present disclosure, after obtaining the initial three-dimensional mesh model of the target virtual object (here, the initial three-dimensional mesh model includes the initial body mesh model and the initial clothing mesh model of the target virtual object, and the initial clothing mesh model covers the outside of the initial body mesh model), the first target area occluded by the available clothing mesh model obtained based on the initial clothing mesh model can be determined on the initial body mesh model, and the two-dimensional unfolded view of the initial body mesh model can be obtained, and then mask processing is performed on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model. In this process, neither the determination of the first target area nor the mask processing process involves any manual operations, and it is not necessary to spend a lot of time on texture map drawing and manual adjustment. Therefore, the generation efficiency of the body mask texture map can be improved, and moreover, it will not be affected by human subjective factors, which can also improve the generation quality of the body mask texture map.

[0052] In addition, as mentioned above, in the embodiments of the present disclosure, the available clothing mesh model can be the initial clothing mesh model itself, or the clothing mesh model obtained after performing adjustment operations (such as size change, deletion of some clothing mesh surfaces, etc.) on the initial clothing mesh model. Based on this, the mask texture map generation method provided in the embodiments of the present disclosure may further include:

[0053] In the case where there is a clothing mask texture map on the initial clothing mesh model, determine the target mesh faces on the initial clothing mesh model that are covered by the clothing mask texture map;

[0054] Delete the target mesh faces of the initial clothing mesh model to obtain an available clothing mesh model.

[0055] It should be noted that in the process of modeling and rendering three-dimensional virtual objects, in order to achieve diversification of clothing mesh models, texture mapping processing is usually used to adjust the configuration of the initial clothing mesh model. Please refer to Figure 2 , for example, in the case where the initial clothing mesh model is a clothing model, specifically a long-sleeved clothing model, a clothing mask texture map can be used to perform texture mapping processing on the initial clothing mesh model to achieve configuration adjustment of the initial clothing mesh model and obtain a short-sleeved clothing model. Among them, the opacity of all pixel points of the clothing mask texture map can be 0, that is, the clothing mask texture map can show a transparent effect.

[0056] Based on the above background, in the embodiments of the present disclosure, when there is no clothing mask texture map on the initial clothing mesh model, the initial clothing mesh model itself can be used as the available clothing mesh model; or, when there is a clothing mask texture map on the initial clothing mesh model, determine the target mesh faces on the initial clothing mesh model that are covered by the clothing mask texture map, and delete the target mesh faces of the initial clothing mesh model to obtain an available clothing mesh model.

[0057] In the above manner, in the embodiments of the present disclosure, when there is a clothing mask texture map on the initial clothing mesh model, the target mesh faces on the initial clothing mesh model that are covered by the clothing mask texture map can be determined, and the target mesh faces of the initial clothing mesh model can be deleted to obtain an available clothing mesh model. In this way, when performing step S102, that is, "determine the first target area on the initial body mesh model that is blocked by the available clothing mesh model", the part corresponding to the clothing mask texture map will not be wrongly determined as the first target area, thereby improving the accuracy of the first target area and further improving the generation quality of the body mask texture map.

[0058] In some optional embodiments, step S102, that is, "determine the first target area on the initial body mesh model that is blocked by the available clothing mesh model" may include:

[0059] Step S102-1: Take each body mesh face on the initial body mesh model as the current mesh face, and emit the first number of detection rays from the current mesh face.

[0060] Among them, the first number can be set according to actual application requirements. For example, it can be set to 16, and the embodiments of the present disclosure do not limit this.

[0061] In one example, a first number of probing rays can be emitted from the current mesh surface in different randomly determined directions. Specifically, the center point of the current mesh surface can be used as the center of a sphere to construct a hemisphere with the current mesh surface as the base and facing away from the initial body mesh model. Then, a first number of different directions are randomly determined on the hemisphere, and probing rays are emitted in these directions respectively.

[0062] Step S102-2: When it is determined that at least a second number of the first number of probing rays are blocked by the available clothing mesh model, the current mesh surface is determined as the occluded mesh surface.

[0063] Wherein, the second number is less than or equal to the first number. Here, the second number can also be set according to actual application requirements. For example, when the first number is set to 16, the second number can be set to 8, and the embodiments of the present disclosure do not limit this.

[0064] In one example, the following method can be used to determine that at least a second number of the first number of probing rays are blocked by the available clothing mesh model:

[0065] (1) Construct a multi-layer bounding box for the available clothing mesh model.

[0066] That is to say, in the embodiments of the present disclosure, a bounding volume hierarchy (BVH) for the available clothing mesh model will be constructed. Among them, the BVH can include multiple layers of bounding boxes (the specific number of bounding box layers can be set according to actual application requirements, and the embodiments of the present disclosure do not limit this). Each layer of the multiple layers of bounding boxes is used to enclose at least part of the clothing mesh surfaces in the available clothing mesh model, and as the bounding box hierarchy sinks and progresses, the number of clothing mesh surfaces enclosed by the multiple layers of bounding boxes gradually decreases. In addition, it should be noted that in the embodiments of the present disclosure, the same layer of bounding boxes can enclose the same or similar number of clothing mesh surfaces.

[0067] It should also be noted that in the embodiments of the present disclosure, each layer of the multiple layers of bounding boxes can be any one of an axis-aligned bounding box (AABB), an oriented bounding box (OBB), a bounding sphere, a bounding capsule, and a convex hull; the multiple layers of bounding boxes can also be multiple layers of bounding boxes, and the embodiments of the present disclosure do not limit this.

[0068] Please combine Figure 3, Exemplarily, the multi-layer bounding boxes for the available clothing mesh model include a root bounding box (i.e., the topmost bounding box), a middle-layer bounding box located below the root bounding box, and a sub-bounding box located below the middle-layer bounding box (i.e., the bottommost bounding box). Here, it should be noted that to ensure the simplicity of the drawings, Figure 3 only some of the bounding boxes in the multi-layer bounding boxes for the available clothing mesh model are shown in

[0069] (2) Take each of the first number of detection rays as the current ray. When determining that the current ray is blocked by the bottommost bounding box in the multi-layer bounding boxes in the way of sinking-layer-by-layer detection, take the current ray as a countable ray.

[0070] That is to say, in the embodiments of the present disclosure, the detection order can be from the topmost bounding box to the bottommost bounding box layer by layer. Each bounding box of each layer is taken as the current bounding box in turn, and it is determined whether the current ray is blocked by the current bounding box. Then, when it is determined that the current ray is not blocked by the current bounding box, stop the downward detection of this detection line; when it is determined that the current ray is blocked by the current bounding box, take each lower-level bounding box in the current bounding box as the new current bounding box and continue the downward detection until the downward detection of this detection line is stopped, or when it is determined that the current ray is blocked by a certain bottommost bounding box, take the current ray as a countable ray.

[0071] Please refer to Figure 4, Exemplarily, when the lowermost bounding box A1 is used as the current bounding box, it is determined that the current ray B1B2 is blocked by the current bounding box. Therefore, each lower-level bounding box in the current bounding box is used as a new current bounding box. Taking the middle bounding box A2 as the new bounding box as an example, when continuing the downward detection, it is determined that the current ray B1B2 is blocked by the new current bounding box. Therefore, each lower-level bounding box in the new current bounding box is used as another new current bounding box. Taking the lowermost bounding box A3 as another new bounding box as an example, when continuing the downward detection, it is determined that the current ray B1B2 is blocked by this new current bounding box. Since this new current bounding box belongs to the lowermost bounding box, the current ray B1B2 can be used as a countable ray; when the lowermost bounding box A1 is used as the current bounding box, it is determined that the current ray B1B3 is blocked by the current bounding box. Therefore, each lower-level bounding box in the current bounding box is used as a new current bounding box. Taking the middle bounding box A2 as the new bounding box as an example, when continuing the downward detection, it is determined that the current ray B1B3 is blocked by the new current bounding box. Therefore, each lower-level bounding box in the new current bounding box is used as another new current bounding box. Taking the lowermost bounding box A3 as another new bounding box as an example, when continuing the downward detection, it is determined that the current ray B1B3 is not blocked by this new current bounding box. Similarly, it can be determined that the current ray B1B3 is not blocked by other lowermost bounding boxes that are on the same layer as the lowermost bounding box A3 and are also located in the middle bounding box A2. Therefore, there is no need to use the current ray B1B3 as a countable ray.

[0072] (3) In the case where the number of countable rays is greater than or equal to the second number, it is determined that at least the second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model.

[0073] Step S102-3, based on the occluded mesh surfaces, determine the first target area.

[0074] For example, the overall occluded area composed of all the occluded mesh surfaces in the initial body mesh model can be determined as the first target area.

[0075] In the above manner, in the embodiments of the present disclosure, step S102, that is, "determining a first target area on the initial body mesh model blocked by the available clothing mesh model" may include: taking each body mesh face on the initial body mesh model as the current mesh face, and emitting a first number of detection rays from the current mesh face; in the case where it is determined that at least a second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model, determining the current mesh face as the blocked mesh face; and determining the first target area based on the blocked mesh face. This process does not involve complex data processing (such as data calculation and conversion) procedures, which can not only further improve the accuracy of the first target area, but also improve the determination efficiency of the first target area.

[0076] Moreover, when emitting the first number of detection rays from the current mesh face, the first number of detection rays can be emitted from the current mesh face in randomly determined different directions. This can not only improve the applicability of step S102, but also further simplify the data processing procedure of step S102, thereby further improving the determination efficiency of the first target area.

[0077] Furthermore, in the above manner, in the embodiments of the present disclosure, the manner of determining that at least a second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model can be: constructing a multi-layer bounding box for the available clothing mesh model, and taking each detection ray among the first number of detection rays as the current ray. In the case where it is determined that the current ray is blocked by the lowermost bounding box in the multi-layer bounding box in a sinking layer-by-layer detection manner, taking the current ray as a countable ray, and then in the case where the number of countable rays is greater than or equal to the second number, determining that at least a second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model. That is to say, in the embodiments of the present disclosure, the available clothing mesh model can be converted into a BVH to utilize the detection algorithm based on BVH to determine that at least a second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model, thereby further improving the determination efficiency of the first target area.

[0078] In some alternative embodiments, step S104, that is, "performing a masking process on a second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model" may include:

[0079] Performing a masking process on a second target area corresponding to the first target area in the two-dimensional unfolded view to obtain an initial mask texture map for the initial body mesh model;

[0080] Obtaining edge optimization parameters;

[0081] Based on the edge optimization parameters, perform edge optimization processing on the initial mask texture map to obtain a body mask texture map.

[0082] Among them, the mask processing may be to set the opacity of all pixel points in the second target area to 0, that is, to adjust the second target area to a transparent effect; the edge optimization parameters may be length parameters and can be set according to actual application requirements, and the embodiments of the present disclosure do not limit this.

[0083] After obtaining the initial mask texture map and the edge optimization parameters, the inner contraction size can be determined based on the edge optimization parameters, and at least part of the edge area of the initial mask texture map can be contracted according to the inner contraction size to obtain a body mask texture map. Specifically, the inner contraction size can be determined based on the edge optimization parameters, and at least part of the edge area of the initial mask texture map can be contracted according to the inner contraction size to obtain an intermediate mask texture map, and then the intermediate mask texture map can be smoothed to obtain a body mask texture map.

[0084] In the above manner, in the embodiments of the present disclosure, mask processing can be performed on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain an initial mask texture map for the initial body mesh model, and edge optimization parameters can be obtained, and based on the edge optimization parameters, edge optimization processing is performed on the initial mask texture map to obtain a body mask texture map, thereby improving the generation quality of the body mask texture map.

[0085] Further, in the embodiments of the present disclosure, after obtaining the body mask texture map, the mask texture map generation method may further include:

[0086] Use the body mask texture map to perform texture mapping on the initial body mesh model to obtain an available body mesh model;

[0087] Wrap the available clothing mesh model outside the available body mesh model to obtain an available three-dimensional mesh model of the target virtual object.

[0088] In one example, according to a preset correspondence relationship, the body mask texture map can be used to perform texture mapping on the initial body mesh model to obtain an available body mesh model, and the available clothing mesh model can be wrapped outside the available body mesh model to obtain an available three-dimensional mesh model of the target virtual object. Here, it can also be understood that the available body mesh model is rendered using the available clothing mesh model to obtain an available three-dimensional mesh model of the target virtual object.

[0089] Since the body mask texture map masks the second target area corresponding to the first target area in the two-dimensional unfolded view of the initial body mesh model, and the first target area is determined on the initial body mesh model after obtaining the initial three-dimensional mesh model of the target virtual object (here, the initial three-dimensional mesh model includes the initial body mesh model and the initial clothing mesh model of the target virtual object, and the initial clothing mesh model is wrapped outside the initial body mesh model) as the area blocked by the available clothing mesh model obtained based on the initial clothing mesh model, therefore, by using the body mask texture map to perform texture mapping on the initial body mesh model, the area blocked by the available clothing mesh model in the obtained available body mesh model will show a transparent effect. Then, after wrapping the available clothing mesh model outside the available body mesh model to obtain the available three-dimensional mesh model of the target virtual object, even when the target virtual object is in a moving state, there will be no problem of model penetration.

[0090] Next, combined with Figure 5 , the complete process of a mask texture map generation method provided by the embodiments of the present disclosure will be described.

[0091] Step S501, import the initial body mesh model and the initial clothing mesh model of the target virtual object into modeling software, and wrap the initial clothing mesh model outside the initial body mesh model to obtain the initial three-dimensional mesh model of the target virtual object.

[0092] In an example, the initial body mesh model can be obtained from a preset body mesh model material library and imported into modeling software; similarly, the initial clothing mesh model can be obtained from a preset clothing mesh model material library and imported into modeling software. The target virtual object can be a three-dimensional virtual object, for example, a person, an animal, etc. That is, the initial body mesh model can be a person model, an animal model, etc., which can be regarded as the body of the target virtual object; the initial clothing mesh model can be a clothing model, a pants model, a skirt model, etc., which can be regarded as the skin of the target virtual object; the modeling software can be Maya.

[0093] It should be noted that in the embodiments of the present disclosure, the initial body mesh model can be composed of multiple body mesh surfaces, and the body mesh surface can be a triangular patch, a quadrilateral patch or other polygon patches. Similarly, in the embodiments of the present disclosure, the initial clothing mesh model can be composed of multiple clothing mesh surfaces, and the clothing mesh surface can be a triangular patch, a quadrilateral patch or other polygon patches.

[0094] Step S502, when there is a clothing mask texture on the initial clothing mesh model, determine the target mesh faces on the initial clothing mesh model covered by the clothing mask texture, and delete the target mesh faces of the initial clothing mesh model to obtain an available clothing mesh model.

[0095] Please combine Figure 6 , the initial 3D mesh model of the target virtual object includes the initial body mesh model and the initial clothing mesh model of the target virtual object, and the initial clothing mesh model covers the outside of the initial body mesh model. Among them, there is no clothing mask texture on the initial clothing mesh model. Therefore, the initial clothing mesh model itself can be used as the available clothing mesh model.

[0096] Step S503, take each body mesh face on the initial body mesh model as the current mesh face, and emit the first number of detection rays from the current mesh face.

[0097] Among them, the first number can be set according to actual application requirements. For example, it can be set to 16, and the embodiments of the present disclosure do not limit this.

[0098] In one example, the first number of detection rays can be emitted from the current mesh face in randomly determined different directions. Specifically, the center point of the current mesh face can be used as the center of the sphere to construct a hemisphere with the current mesh face as the bottom surface and facing away from the initial body mesh model, and randomly determine the first number of different directions on the hemisphere, and then emit detection rays in these directions respectively.

[0099] Step S504, when it is determined that at least the second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model, determine the current mesh face as the occluded mesh face.

[0100] Among them, the second number is less than or equal to the first number. Here, the second number can also be set according to actual application requirements. For example, when the first number is set to 16, the second number can be set to 8, and the embodiments of the present disclosure do not limit this.

[0101] In one example, the following method can be used to determine that at least the second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model:

[0102] (1) Construct a multi-layer bounding box for the available clothing mesh model.

[0103] That is to say, in the embodiments of the present disclosure, a BVH for the available clothing mesh model will be constructed. Among them, the BVH may include multiple layers of bounding boxes (the specific number of bounding box layers is set according to actual application requirements, and the embodiments of the present disclosure do not limit this), and each layer of bounding box in the multiple layers of bounding boxes is used to enclose at least part of the clothing mesh surfaces in the available clothing mesh model, and as the bounding box level sinks progressively, the number of clothing mesh surfaces enclosed by the multiple layers of bounding boxes gradually decreases. In addition, it should be noted that in the embodiments of the present disclosure, the same layer of bounding boxes can enclose the same or similar number of clothing mesh surfaces.

[0104] It should also be noted that in the embodiments of the present disclosure, each layer in the multiple layers of bounding boxes can be any one of AABB, OBB, spherical bounding box, capsule bounding box, convex polyhedron bounding box; the multiple layers of bounding boxes can also be multiple layers of bounding boxes, and the embodiments of the present disclosure do not limit this.

[0105] For examples of the above part, reference can be made to Figure 3 and the corresponding textual description.

[0106] (2) Take each detection ray in the first number of detection rays as the current ray. When it is determined that the current ray is blocked by the lowermost bounding box in the multiple layers of bounding boxes in the way of detecting layer by layer in a sinking manner, take the current ray as a countable ray.

[0107] That is to say, in the embodiments of the present disclosure, in the order of detecting layer by layer from the uppermost bounding box to the lowermost bounding box, each bounding box of each layer can be taken as the current bounding box in turn, and it is determined whether the current ray is blocked by the current bounding box. Then, when it is determined that the current ray is not blocked by the current bounding box, stop the downward detection of this detection line; when it is determined that the current ray is blocked by the current bounding box, take each lower-level bounding box in the current bounding box as the new current bounding box and continue the downward detection until the downward detection of this detection line is stopped, or when it is determined that the current ray is blocked by the lowermost bounding box, take the current ray as a countable ray.

[0108] For examples of the above part, reference can be made to Figure 4 and the corresponding textual description.

[0109] (3) When the number of countable rays is greater than or equal to the second number, determine that at least the second number of detection rays in the first number of detection rays are blocked by the available clothing mesh model.

[0110] Step S505, determine the first target area based on the occluded mesh surfaces.

[0111] For example, the area composed of all the occluded mesh surfaces in the initial body mesh model can be determined as the first target area.

[0112] Step S506: Obtain the two-dimensional unfolded view of the initial body mesh model.

[0113] In one example, the two-dimensional unfolded view (also known as the UV unfolded view) of the initial body mesh model can be obtained from a preset unfolded view material library, specifically as Figure 7 shown.

[0114] Step S507: Perform masking processing on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model.

[0115] Among them, the masking processing can be to set the opacity of all pixel points in the second target area to 0, that is, adjust the second target area to a transparent effect. Specifically, as Figure 8 shown, that is, Figure 8 the second target area in

[0116] will actually show a transparent effect. After obtaining the body mask texture map, the initial body mesh model can be texture-mapped using the body mask texture map to obtain an available body mesh model as shown in Figure 9 shown, and the available clothing mesh model is wrapped around the outside of the available body mesh model to obtain an available three-dimensional mesh model of the target virtual object, specifically as Figure 10 shown. Since Figure 10 the available three-dimensional mesh model shown in

[0117] has edge defects. Specifically, part of the body mask texture map is not wrapped by the available clothing mesh model. Based on this, to avoid edge defects, in one example, "performing masking processing on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model" can include:

[0118] Perform masking processing on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain an initial mask texture map for the initial body mesh model;

[0119] Obtain edge optimization parameters;

[0120] Based on the edge optimization parameters, perform edge optimization processing on the initial mask texture map to obtain a body mask texture map.

[0121] After obtaining the initial mask texture map and acquiring the edge optimization parameters, based on the edge optimization parameters, the shrinking size can be determined, and at least a partial edge region of the initial mask texture map can be shrunk according to the shrinking size to obtain a body mask texture map. Specifically, based on the edge optimization parameters, the shrinking size can be determined, and at least a partial edge region of the initial mask texture map can be shrunk according to the shrinking size to obtain an intermediate mask texture map, and then the intermediate mask texture map can be smoothed to obtain a body mask texture map. After obtaining the body mask texture map, the initial body mesh model can be textured using the body mask texture map to obtain an available body mesh model, and the available clothing mesh model can be wrapped around the outside of the available body mesh model to obtain an available three-dimensional mesh model of the target virtual object, specifically as Figure 11 shown.

[0122] Please refer to Figure 12 , which is a schematic diagram of an application scenario of a mask texture map generation method provided by an embodiment of the present disclosure.

[0123] The mask texture map generation method provided by an embodiment of the present disclosure is applied to an electronic device. Among them, the electronic device can be a workbench, a mainframe computer, a conventional computer (such as a desktop computer, a laptop computer, a vehicle-mounted computer, etc.), a personal digital processor or other similar computing devices.

[0124] Here, the electronic device is used for:

[0125] acquiring an initial three-dimensional mesh model of a target virtual object; wherein, the initial three-dimensional mesh model includes an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model is wrapped around the outside of the initial body mesh model;

[0126] determining a first target region on the initial body mesh model that is blocked by the available clothing mesh model; wherein, the available clothing mesh model is obtained based on the initial clothing mesh model;

[0127] acquiring a two-dimensional unfolded view of the initial body mesh model;

[0128] performing mask processing on a second target region corresponding to the first target region in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model.

[0129] It should be noted that in the embodiments of the present disclosure, Figure 12 the shown schematic diagram of the application scenario is only illustrative and not restrictive. Those skilled in the art can make various obvious changes and / or substitutions based on Figure 12 the examples, and the obtained technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.

[0130] To better implement the mask texture generation method, an embodiment of the present disclosure also provides a mask texture generation device, which can be integrated into an electronic device. Among them, the electronic device can be a workbench, a mainframe computer, a conventional computer (e.g., a desktop computer, a laptop computer, an in-vehicle computer, etc.), a personal digital assistant, or other similar computing devices. Hereinafter, with reference to Figure 13 the schematic structural block diagram shown in, a mask texture generation device 1300 provided by an embodiment of the present disclosure will be described.

[0131] The mask texture generation device 1300 includes:

[0132] A model acquisition unit 1301, configured to acquire an initial three-dimensional mesh model of a target virtual object; wherein, the initial three-dimensional mesh model includes an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model is wrapped outside the initial body mesh model;

[0133] An area determination unit 1302, configured to determine a first target area on the initial body mesh model that is blocked by an available clothing mesh model; wherein, the available clothing mesh model is obtained based on the initial clothing mesh model;

[0134] An unfolding diagram acquisition unit 1303, configured to acquire a two-dimensional unfolding diagram of the initial body mesh model;

[0135] A mask processing unit 1304, configured to perform mask processing on a second target area corresponding to the first target area in the two-dimensional unfolding diagram to obtain a body mask texture map for the initial body mesh model.

[0136] In some optional implementation manners, the area determination unit 1302 is configured to:

[0137] Take each body mesh face on the initial body mesh model as the current mesh face, and emit a first number of detection rays from the current mesh face;

[0138] In the case of determining that at least a second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model, determine the current mesh face as an occluded mesh face; wherein, the second number is less than or equal to the first number;

[0139] Determine the first target area based on the occluded mesh faces.

[0140] In some optional implementation manners, the area determination unit 1302 is configured to:

[0141] Emit a first number of detection rays from the current mesh face in randomly determined different directions.

[0142] In some optional implementation manners, the area determination unit 1302 is configured to:

[0143] Construct a multi-layer bounding box for the available clothing mesh model; wherein, each layer of the multi-layer bounding box is used to enclose at least part of the clothing mesh surfaces in the available clothing mesh model, and as the bounding box level sinks step by step, the number of clothing mesh surfaces enclosed by the multi-layer bounding box gradually decreases;

[0144] Take each of the first number of detection rays as the current ray. When it is determined that the current ray is blocked by the lowermost bounding box in the multi-layer bounding box in the way of layer-by-layer detection in the sinking manner, take the current ray as a countable ray;

[0145] When the number of countable rays is greater than or equal to the second number, determine that at least the second number of detection rays among the first number of detection rays are blocked by the available clothing mesh model.

[0146] In some alternative embodiments, the mask processing unit 1304 is configured to:

[0147] Perform mask processing on the second target area corresponding to the first target area in the two-dimensional unfolded view to obtain an initial mask map for the initial body mesh model;

[0148] Obtain edge optimization parameters;

[0149] Based on the edge optimization parameters, perform edge optimization processing on the initial mask map to obtain a body mask map.

[0150] In some alternative embodiments, the mask map generation device 1300 further includes:

[0151] A mesh surface determination unit, configured to determine the target mesh surfaces covered by the clothing mask map on the initial clothing mesh model when there is a clothing mask map on the initial clothing mesh model;

[0152] A mesh surface deletion unit, configured to delete the target mesh surfaces of the initial clothing mesh model to obtain an available clothing mesh model.

[0153] In some alternative embodiments, the mask map generation device 1300 further includes:

[0154] A first post-processing unit, configured to perform map processing on the initial body mesh model by using the body mask map to obtain an available body mesh model;

[0155] A second post-processing unit, configured to wrap the available clothing mesh model outside the available body mesh model to obtain an available three-dimensional mesh model of the target virtual object.

[0156] In the embodiments of the present disclosure, for the specific functions and examples of each unit in the mask map generation device 1300, reference may be made to the relevant descriptions of the corresponding steps in the embodiments of the mask map generation method, which will not be elaborated herein.

[0157] In the technical solution of the present disclosure, the acquisition, storage, and application of the user's personal information involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0158] According to the embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0159] Figure 14 FIG. shows a schematic structural block diagram of an exemplary electronic device 1400 that can be used to implement the embodiments of the present disclosure. The electronic device 1400 is intended to represent various forms of digital computers, such as in-vehicle computing devices, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 1400 can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0160] As Figure 14 shown, the electronic device 1400 includes a computing unit 1401, which can execute various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1402 or a computer program loaded from a storage unit 1408 into a random access memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the electronic device 1400 can also be stored. The computing unit 1401, the ROM 1402, and the RAM 1403 are connected to each other through a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.

[0161] A plurality of components in the electronic device 1400 are connected to the I / O interface 1405, including: an input unit 1406, such as a keyboard, a mouse, etc.; an output unit 1407, such as various types of renderers, speakers, etc.; a storage unit 1408, such as a disk, an optical disc, etc.; and a communication unit 1409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1409 allows the electronic device 1400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0162] The computing unit 1401 may be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1401 executes the various methods and processes described above, such as the mask map generation method. For example, in some embodiments, the mask map generation method may be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 1408. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 1400 via the ROM 1402 and / or the communication unit 1409. When the computer program is loaded into the RAM 1403 and executed by the computing unit 1401, one or more steps of the mask map generation method described above may be executed. Alternatively, in other embodiments, the computing unit 1401 may be configured as the mask map generation method by any other suitable means (e.g., by means of firmware).

[0163] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on chip (SOC) systems, complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.

[0164] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on the remote machine or server.

[0165] In the context of this disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0166] To provide for interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD)) for rendering information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide for interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic, speech, or tactile input).

[0167] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of a communication network include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0168] A computer system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is generated by computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, or a server of a distributed system, or a server incorporating a blockchain.

[0169] Embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute a mask map generation method.

[0170] Embodiments of the present disclosure also provide a computer program product, including a computer program which, when executed by a processor, implements a mask map generation method.

[0171] It should be understood that various forms of the processes shown above can be used, steps can be reordered, added or deleted. For example, the steps recited in the present disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, and this is not limited herein. In addition, in the present disclosure, relational terms such as "first", "second", "third", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, in the present disclosure, "a plurality" can be understood as at least two.

[0172] The foregoing specific embodiments do not limit the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the principles of the present disclosure shall be included within the protection scope of the present disclosure.

Claims

1. A method for generating a mask texture map, comprising: Obtaining an initial three-dimensional mesh model of a target virtual object; wherein, the initial three-dimensional mesh model includes an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model covers the outside of the initial body mesh model; Determining a first target area on the initial body mesh model that is blocked by an available clothing mesh model; wherein, the available clothing mesh model is obtained based on the initial clothing mesh model; Obtaining a two-dimensional unfolded view of the initial body mesh model; Performing mask processing on a second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model.

2. The method according to claim 1, wherein, The determining the first target area on the initial body mesh model that is blocked by the available clothing mesh model includes: Regarding each body mesh face on the initial body mesh model as a current mesh face, and emitting a first number of detection rays from the current mesh face; In the case where it is determined that at least a second number of the first number of detection rays are blocked by the available clothing mesh model, determining the current mesh face as an occluded mesh face; wherein, the second number is less than or equal to the first number; Based on the occluded mesh faces, determining the first target area.

3. The method according to claim 2, wherein The emitting a first number of detection rays from the current mesh face includes: Emitting a first number of detection rays from the current mesh face in randomly determined different directions.

4. The method according to claim 2, wherein, The determining that at least a second number of the first number of detection rays are blocked by the available clothing mesh model includes: Constructing a multi-layer bounding box for the available clothing mesh model; wherein, each layer of the bounding box in the multi-layer bounding box is used to enclose at least part of the clothing mesh faces in the available clothing mesh model, and as the bounding box level sinks and progresses, the number of clothing mesh faces enclosed by the multi-layer bounding box gradually decreases; Regarding each of the first number of detection rays as a current ray, and in the case of determining that the current ray is blocked by the lowermost bounding box in the multi-layer bounding box in a way of detecting layer by layer in a sinking manner, regarding the current ray as a countable ray; In the case where the number of countable rays is greater than or equal to the second number, determining that at least a second number of the first number of detection rays are blocked by the available clothing mesh model.

5. The method according to claim 1, wherein The performing mask processing on a second target area corresponding to the first target area in the two-dimensional unfolded view to obtain a body mask texture map for the initial body mesh model includes: Performing mask processing on a second target area corresponding to the first target area in the two-dimensional unfolded view to obtain an initial mask texture map for the initial body mesh model; Obtaining edge optimization parameters; Based on the edge optimization parameters, performing edge optimization processing on the initial mask texture map to obtain the body mask texture map.

6. The method according to any one of claims 1 to 5, further comprising: When there is a clothing mask texture map on the initial clothing mesh model, determine the target mesh faces on the initial clothing mesh model covered by the clothing mask texture map; Delete the target mesh faces of the initial clothing mesh model to obtain the available clothing mesh model.

7. The method according to any one of claims 1 to 5, further comprising: Using the body mask texture map, perform texture mapping on the initial body mesh model to obtain an available body mesh model; Wrap the available clothing mesh model outside the available body mesh model to obtain the available three-dimensional mesh model of the target virtual object.

8. A mask texture map generation device, comprising: A model acquisition unit, configured to acquire an initial three-dimensional mesh model of a target virtual object; wherein, the initial three-dimensional mesh model includes an initial body mesh model and an initial clothing mesh model of the target virtual object, and the initial clothing mesh model is wrapped outside the initial body mesh model; A region determination unit, configured to determine a first target region on the initial body mesh model blocked by the available clothing mesh model; wherein, the available clothing mesh model is obtained based on the initial clothing mesh model; An unfolding diagram acquisition unit, configured to acquire a two-dimensional unfolding diagram of the initial body mesh model; A mask processing unit, configured to perform mask processing on a second target region corresponding to the first target region in the two-dimensional unfolding diagram to obtain a body mask texture map for the initial body mesh model.

9. An electronic device, comprising: At least one processor; A memory communicatively connected to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, where the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.