A two-dimensional unfolding method, device, equipment and medium of a three-dimensional mesh model
By acquiring multi-channel rendered images and camera parameters of a 3D mesh model, and using a deep learning model to predict the probability map of 2D cutting lines and perform back projection, the problem of low cutting line quality in existing methods is solved, and more accurate 2D unfolding is achieved.
Patent Information
- Application Number
- CN202611209256.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-10
- Publication Date
- 2026-11-06
AI Technical Summary
Existing two-dimensional unfolding methods directly process cutting line decisions in three-dimensional mesh models, resulting in low cutting line quality and a lack of rendering visual information.
By acquiring multi-channel rendered images and camera parameters from multiple sampling points of a 3D mesh model, a deep learning model is used to predict a 2D cutting line probability map, and back-projection is performed to generate a set of cutting lines, which is then transformed into a semantic segmentation problem in 2D space, making full use of the rendered visual information.
The quality of the cutting lines has been improved, solving the problem of low cutting line quality in existing methods and achieving more accurate two-dimensional unfolding.
Smart Images

Figure CN123051668A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a two-dimensional unfolding method, apparatus, device, and medium for a three-dimensional mesh model. Background Technology
[0002] In the game art asset production process, 3D mesh models need to be unwrapped in 2D (UV unwrapping), and the quality of this unwrapping determines the sampling accuracy and visual performance of textures. Existing 2D unwrapping methods directly handle the decision-making problem of cutting lines in the 3D space of the 3D mesh model. Due to the irregularity, sparsity, and topological diversity of 3D mesh models, directly using the 3D data of the 3D mesh model as input to a deep learning model lacks rendering visual information, resulting in low-quality cutting lines. Summary of the Invention
[0003] This application provides a method, apparatus, device, and medium for two-dimensional unfolding of a three-dimensional mesh model, aiming to solve the problem of low quality of cutting lines obtained by existing two-dimensional unfolding methods.
[0004] Firstly, a two-dimensional unfolding method for a three-dimensional mesh model is provided, which includes the following steps: Acquire multi-channel rendered images and camera parameters of multiple sampling points of a 3D mesh model; Multiple two-dimensional cutting line probability maps are predicted based on multi-channel rendered images from multiple sampling points; A set of cutting lines is generated by back-projecting multiple 2D cutting line probability maps and camera parameters onto a 3D mesh model. The two-dimensional unfolded coordinates of the three-dimensional mesh model are determined based on the set of cutting lines.
[0005] In some embodiments, acquiring multi-channel rendered images and camera parameters of multiple sampling points of a 3D mesh model includes: The positions of multiple sampling points are determined based on the 3D mesh model, and the camera parameters for each sampling point are determined. At each sampling point, a multi-channel rendered image of the 3D mesh model is acquired. The multi-channel rendered image includes multi-channel information, which includes at least two of the following: a planar shading image, a mesh edge overlay image, a depth buffer image, a surface curvature image, and a triangular face ID image.
[0006] In some embodiments, after acquiring a multi-channel rendered image of the 3D mesh model at each sampling point, the method further includes: Determine the triangular face coverage of the 3D mesh model based on the multi-channel rendered image; When the triangle coverage exceeds a preset coverage threshold, output a multi-channel rendered image and camera parameters from multiple sampling points. If the triangular face coverage is less than the preset coverage threshold, increase the number of sampling points, redetermine the camera parameters for each sampling point, and acquire a multi-channel rendered image of the 3D mesh model at each sampling point.
[0007] In some embodiments, multiple two-dimensional cutting line probability maps are predicted based on a multi-channel rendered image of multiple sampling points, including: Based on the multi-channel rendered image with multiple sampling points, the corresponding two-dimensional cutting line probability map is predicted using a two-dimensional cutting line prediction network model. The two-dimensional cut-line prediction model includes an encoder, a bottleneck layer, a decoder, and an output head; The encoder is used to extract feature maps at multiple different scales from a multi-channel rendered image; The bottleneck layer is used to apply multi-head self-attention to cross-view information exchange in the feature map at the lowest scale, generating enhanced bottleneck features. The decoder is used to upsample feature maps at multiple different scales; The output header is used to map the feature map into a two-dimensional cutting line probability map through convolution and activation functions.
[0008] In some embodiments, multi-head self-attention is applied to the lowest-scale feature map for cross-view information exchange to generate enhanced bottleneck features, including: The feature coordinates of other sampling points are back-projected into 3D space through camera parameters, and then reprojected into the feature map of one of the sampling points to obtain the corresponding pixel coordinates. The visibility weight is determined based on the similarity between the pixel coordinates and the corresponding feature coordinates in the feature map of one of the sampling points; The pixel coordinates are aggregated based on visibility weights and fused with the feature map of one of the sampling points to generate enhanced bottleneck features.
[0009] In some embodiments, the two-dimensional cutting line probability map includes a plurality of pixels predicted as cutting lines; Based on multiple 2D cutting line probability maps and camera parameters, a back projection is performed on the 3D mesh model to generate a set of cutting lines, including: Based on ray casting, the pixels predicted as cutting lines in multiple two-dimensional cutting line probability maps are mapped back to the mesh surface of the three-dimensional mesh model, and the set of coordinates of the pixels on the mesh surface and the triangular face of each pixel are determined. Determine the coordinates of each pixel in the coordinate set and the nearest grid edge in the triangle face containing the pixel to obtain the candidate cutting edge set; The set of cutting edges is generated by weighted voting and fusion based on the set of candidate cutting edges.
[0010] In some embodiments, a set of cutting lines is generated by weighted voting fusion based on the candidate cutting edge set, including: The quality weight of the sampling point is determined based on the normal vector of the face containing each candidate cutting edge in the candidate cutting edge set and the camera parameters; the confidence score of each candidate cutting edge is determined based on the viewpoint quality weight of the sampling point; the viewpoint quality weight of the sampling point is obtained based on the average normal vector of the face containing the candidate cutting edge, the sampling direction of the sampling point, and the distance from the sampling point to the candidate cutting edge. Candidate cutting edges with confidence scores greater than a preset confidence threshold are selected as the cutting line set.
[0011] In some embodiments, before determining the two-dimensional unfolding coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines, the two-dimensional unfolding method further includes: Determine the validity status of the set of cutting lines; If the validity status of the cut line set indicates that the validity constraints are not met, perform topology repair on the cut line set to make the validity status of the cut line set meet the validity constraints.
[0012] In some embodiments, topology repair of the cut line set includes: Perform connected component analysis on the cut line set to remove noisy cut lines from the cut line set; If the set of cutting lines is not connected, the cost of each edge in the 3D mesh model is determined based on the set of cutting lines. The minimum cost path that connects the set of cutting lines and minimizes the sum of the costs of all edges is searched in the 3D mesh model. The edges on the minimum cost path are added to the set of cutting lines to make the set of cutting lines connected. If there are connected components in the set of cleavage lines with an Euler characteristic of not 1, find the shortest non-contractable cycle in the connected components and add the edge of the shortest non-contractable cycle to the set of cleavage lines so that the Euler characteristic of all connected components in the set of cleavage lines is 1. Remove redundant edges from the cut line set to obtain the topology-repaired cut line set.
[0013] In some embodiments, determining the two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines includes: Based on the set of cutting lines, multiple cutting meshes are generated on the 3D mesh model by cutting, and each cutting mesh is composed of multiple connected components. Each connected component is mapped to a two-dimensional parameter domain, generating a set of two-dimensional mesh coordinates of all vertices in the connected component in the two-dimensional parameter domain; Arrange the two-dimensional mesh coordinates of all connected components in texture space to generate two-dimensional unfolded coordinates in texture space; Calculate the distortion metric of the 2D unfolded coordinates to assess the quality of the 2D unfolded coordinates and generate a quality metric report.
[0014] In some embodiments, the two-dimensional unfolding method further includes: Calculate the overall quality score of the two-dimensional unfolded coordinates; When the overall quality score of the two-dimensional unfolded coordinates is less than the overall quality score threshold, a two-dimensional distortion heatmap is generated. By using the 2D distortion heatmap as an additional input channel in the multi-channel rendered image, the 2D cutting line probability map is re-predicted to iteratively update the 2D unfolded coordinates.
[0015] Secondly, embodiments of this application provide a two-dimensional unfolding device for a three-dimensional mesh model, the two-dimensional unfolding device comprising: The sampling module is used to acquire multi-channel rendered images and camera parameters from multiple sampling points of the 3D mesh model; The 2D cutting line probability map prediction module is used to predict multiple 2D cutting line probability maps based on a multi-channel rendered image with multiple sampling points. The back projection module is used to back-project the 3D mesh model based on multiple 2D cutting line probability maps and camera parameters to generate a set of cutting lines. The 2D unfolding module is used to determine the 2D unfolding coordinates of the 3D mesh model based on the set of cutting lines.
[0016] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps of the two-dimensional unfolding method as described in the first aspect.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps of the two-dimensional unfolding method as described in the first aspect.
[0018] This application obtains multi-channel rendered images of multiple sampling points of a 3D mesh model, predicts multiple 2D cutting line probability maps, and then performs back projection to generate a set of cutting lines. This transforms the cutting line placement problem of the 3D mesh model into a semantic segmentation problem in 2D space, making full use of the rendering visual information in the multi-channel rendered images to improve the quality of the cutting lines. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a two-dimensional unfolding method for a three-dimensional mesh model provided by an exemplary embodiment of this disclosure; Figure 2 This is a schematic diagram of the process of acquiring multi-channel rendered images for a two-dimensional unfolding method of a three-dimensional mesh model provided in an exemplary embodiment of this disclosure; Figure 3 This is a flowchart illustrating the operation of a two-dimensional cutting line prediction model for a two-dimensional unfolding method of a three-dimensional mesh model provided in an exemplary embodiment of this disclosure. Figure 4 This is a schematic flowchart of the back projection of a two-dimensional unfolding method for a three-dimensional mesh model provided in an exemplary embodiment of this disclosure; Figure 5 This is a schematic flowchart illustrating the topology repair of a set of cutting lines in a two-dimensional unfolding method for a three-dimensional mesh model provided by an exemplary embodiment of this disclosure. Figure 6 This is a flowchart illustrating the iterative update of the two-dimensional unfolded coordinates of a two-dimensional mesh model provided by an exemplary embodiment of this disclosure. Figure 7 This is a flowchart illustrating Embodiment 1 of a two-dimensional unfolding method for a three-dimensional mesh model provided by an exemplary embodiment of this disclosure; Figure 8 This is a flowchart illustrating Embodiment 2 of a two-dimensional unfolding method for a three-dimensional mesh model provided by an exemplary embodiment of this disclosure; Figure 9 This is a schematic diagram of the structure of a two-dimensional unfolding device for a three-dimensional mesh model provided in an exemplary embodiment of this disclosure; Figure 10 This is a schematic diagram of the operation flow of a two-dimensional unfolding device for a three-dimensional mesh model provided in an exemplary embodiment of this disclosure; Figure 11 This is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of this disclosure.
[0021] Explanation of icon numbers: 100. Two-dimensional unfolding device; 101. Sampling module; 102. Two-dimensional cutting line probability map prediction module; 103. Back projection module; 104. Cutting line optimization module; 105. Two-dimensional unfolding module; 106. Quality verification module; 200. Electronic equipment; 201. Processor; 202. Memory; 203. Touch screen; 204. Radio frequency circuit; 205. Audio circuit; 206. Input unit; 207. Power supply. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. At the same time, in the description of the embodiments of this application, the terms "first," "second," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0023] This application provides a method, apparatus, electronic device, and computer-readable storage medium for two-dimensional unfolding of a three-dimensional mesh model.
[0024] Specifically, this embodiment will be described from the perspective of a two-dimensional unfolding device for a three-dimensional mesh model. This two-dimensional unfolding device can be integrated into an electronic device, that is, the two-dimensional unfolding method of this application embodiment can be executed by an electronic device. Optionally, the electronic device may include a terminal device. The terminal device may be a mobile phone, tablet computer, smart Bluetooth device, laptop computer, game console, or personal computer (PC), etc.
[0025] The following detailed description is provided in conjunction with the accompanying drawings. In this embodiment, the execution subject is a terminal device as an example. It should be noted that the order of description in the following embodiments is not intended to limit the preferred order of the embodiments. Although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown in the accompanying drawings.
[0026] Firstly, this embodiment provides a two-dimensional unfolding method for a three-dimensional mesh model, such as... Figure 1 As shown, it includes the following steps: S101. Obtain multi-channel rendered images and camera parameters of multiple sampling points of the 3D mesh model.
[0027] Specifically, sampling points are used to place cameras, which acquire multi-channel rendered images of the 3D mesh model and record camera parameters during sampling. These parameters include the distance to the 3D mesh model, position coordinates, sampling posture, and camera intrinsic and extrinsic parameters.
[0028] Multi-channel rendered images are two-dimensional images captured by a camera, containing rendering information that facilitates subsequent processing using a deep learning model to obtain cutting lines. The arrangement of multiple sampling points aims to cover the three-dimensional mesh model as much as possible to ensure data accuracy.
[0029] S102. Based on the multi-channel rendered image of multiple sampling points, multiple two-dimensional cutting line probability maps are predicted.
[0030] Specifically, a multi-channel rendered image with multiple sampling points is used as input, and a deep learning model predicts a 2D cutting line probability map. The deep learning model can be a model using a U-Net encoder-decoder architecture to achieve pixel-level prediction of cutting lines in the multi-channel rendered image. The 2D cutting line probability map is a single-channel image with the same resolution as the multi-channel rendered image, where the pixel value of each pixel represents the confidence that the pixel belongs to a 2D cutting line; the higher the confidence, the greater the probability that the pixel is a 2D cutting line.
[0031] Using a two-dimensional multi-channel rendered image as input, a deep learning model is used to predict the probability map of two-dimensional cutting lines, avoiding the problems of low efficiency and insufficient prediction quality caused by directly using three-dimensional data as input in three-dimensional space, thus improving the accuracy of cutting line prediction.
[0032] S103. Based on multiple two-dimensional cutting line probability maps and camera parameters, back-projection is performed on the three-dimensional mesh model to generate a set of cutting lines.
[0033] Specifically, since the two-dimensional cutting line probability map represents the probability of cutting lines in two-dimensional space, it is necessary to back-project the cutting lines back to the three-dimensional space where the three-dimensional mesh model resides.
[0034] When acquiring multi-channel rendered images, the camera parameters at the time of capturing the multi-channel rendered images are recorded simultaneously. The camera parameters can be used to back-project pixels with a confidence level greater than the confidence threshold in the two-dimensional cutting line probability map onto the surface of the three-dimensional mesh model to obtain the cutting line set.
[0035] By converting the dense two-dimensional cutting line probability map into a set of cutting lines on a relatively sparse three-dimensional mesh model, the computational burden on the subsequent cutting line optimization module is reduced.
[0036] S104. Determine the two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines.
[0037] Specifically, the two-dimensional unfolded coordinates are the two-dimensional coordinates assigned to the vertices of the mesh in the three-dimensional mesh model, so that the three-dimensional surface can be correctly mapped onto the two-dimensional texture map.
[0038] By acquiring multi-channel rendered images of multiple sampling points of a 3D mesh model, multiple 2D cutting line probability maps are predicted, and then back-projection is performed to generate a set of cutting lines. This transforms the cutting line placement problem of the 3D mesh model into a semantic segmentation problem in 2D space, making full use of the rendering visual information in the multi-channel rendered images to improve the quality of the cutting lines.
[0039] In some embodiments, acquiring multi-channel rendered images and camera parameters of multiple sampling points of a 3D mesh model includes: determining the positions of multiple sampling points based on the 3D mesh model and determining the camera parameters of each sampling point; acquiring a multi-channel rendered image of the 3D mesh model at each sampling point, wherein the multi-channel rendered image includes multi-channel information.
[0040] Specifically, the location of sampling points can be determined based on sampling strategies such as uniform spherical sampling, geometric sampling, and random downsampling, so that each region of the surface of the 3D mesh model is within the image acquired by at least 2-3 sampling points.
[0041] In some examples, such as Figure 2 As shown, taking the uniform spherical sampling strategy as an example, after inputting a 3D mesh model, the multi-channel rendered image and camera parameters of multiple sampling points of the 3D mesh model are obtained, including the following steps: S201. Calculate the center and dimensions of the bounding box of the 3D mesh model.
[0042] The center of the bounding box of the 3D mesh model is The diagonal length of the bounding box is .
[0043] S202. Determine the spherical sampling radius.
[0044] Center of the bounding box Center of the sphere, radius Generate a sphere to place the sampling points.
[0045] S203, Uniform spherical sampling.
[0046] Sampling points are uniformly distributed on the surface of the sphere, and the number of sampling points is... , It can be 8, 12, 16, etc.
[0047] S204. Generate camera pose.
[0048] Set up a camera at each sampling point, for The camera viewpoints at each sampling point can be uniformly distributed using Fibonacci spherical sampling to obtain the observation directions: ; in It is the golden ratio.
[0049] No. The world coordinates of the camera are: ; The orientation vector of each camera points to the center of the 3D mesh model: ; upper vector Obtained by orthogonalization with the Z-axis of the world coordinate system: ; S205, Construct the view matrix.
[0050] The resulting view matrix is as follows: ; S206. Construct the projection matrix.
[0051] The projection matrix uses perspective projection, with a field of view (FOV) of 60 degrees and near-cut plane. , remote cutting surface : ; in The aspect ratio of the image, for example, using a resolution of 1024 × 1024. .
[0052] S207. Perform multi-channel rendering to obtain a multi-channel rendered image.
[0053] Multichannel information includes a flat shading image, a wireframe overlay, a depth buffer, a curvature map, and a face ID map.
[0054] The planar shading image uses a flat shading mode without lighting, making the geometric details of the model's surface clearly visible. Each triangle is mapped to color along its normal direction: ; in Triangular face The normal vector. Planar colored images ensure that subsequent deep learning models can perceive changes in surface orientation from the image.
[0055] The mesh edge overlay map overlays the mesh edge lines (wireframes) onto a planar shaded surface, with a line width of 1.5 pixels. This overlay map provides a visual reference for the mesh topology to subsequent deep learning models, allowing their predicted cut lines to naturally align with the mesh edges.
[0056] The depth buffer map records the normalized depth value from each pixel to the camera, which is used for subsequent back-projection calculations. The calculation formula is as follows: ; in For pixels The corresponding linear depth.
[0057] Surface curvature maps calculate the average curvature of the model surface. and Gaussian curvature This can be visualized as an auxiliary input channel. High curvature regions are often natural candidates for cut lines. ; in , The primary curvature is used. Curvature values are encoded into an image using a color map, with different colors representing different curvature regions; for example, high curvature regions are red, and low curvature regions are blue.
[0058] The triangular facet ID map encodes the triangular facet index corresponding to each pixel into an RGB (Red, Green, Blue) color value, and can support up to [number missing] [color values missing]. Ten thousand faces, used for precise location of the hit triangles during back projection, each face has a triangle ID as follows: ; in, , , These are the pixel values for the three channels.
[0059] By determining the location of sampling points to cover the 3D mesh model, multi-channel information of each sampling point is collected to form a multi-channel rendering image. The originally disordered 3D mesh model is transformed into a structured, information-rich, and geometrically accurate 2D multi-channel rendering image, which is convenient for subsequent processing by deep learning models. This avoids the problems of low efficiency and poor quality caused by traditional training directly using 3D mesh data.
[0060] In some embodiments, after acquiring a multi-channel rendered image of the 3D mesh model at each sampling point, the method further includes: determining the triangular face coverage of the 3D mesh model based on the multi-channel rendered image; if the triangular face coverage is greater than a preset coverage threshold, outputting the multi-channel rendered image of multiple sampling points and camera parameters; if the triangular face coverage is less than a preset coverage threshold, increasing the number of sampling points, re-determining the camera parameters of each sampling point, and acquiring a multi-channel rendered image of the 3D mesh model at each sampling point.
[0061] Specifically, the triangle coverage rate is the percentage of triangles in a 3D mesh model that are effectively observed by at least two sampling points out of the total number of triangles.
[0062] By using a coverage threshold, we can ensure that the triangles in each multi-channel rendered image are cross-validated from multi-channel rendered images collected from other sampling points during subsequent prediction steps, thereby improving the accuracy and robustness of the prediction.
[0063] In some examples, obtaining multi-channel rendered images and camera parameters from multiple sampling points of a 3D mesh model also includes the following steps: S208, Calculate coverage.
[0064] triangular facet At the sampling point The visibility function in is: ; The coverage of the triangle is defined as: ; in, The coverage threshold, This represents the total number of triangular faces.
[0065] Based on the triangle coverage rate and a preset coverage threshold, if the triangle coverage rate is greater than the preset coverage threshold, proceed to S209. If the triangle coverage rate is less than the preset coverage threshold, proceed to S210.
[0066] S209, Output multi-channel rendered image and corresponding camera parameters.
[0067] When the triangle coverage exceeds the preset coverage threshold, the multi-channel rendered image of multiple sampling points is directly output, along with the camera parameters when acquiring the multi-channel rendered image at each sampling point.
[0068] S210, Supplementary sampling point.
[0069] If the triangle coverage is less than a preset coverage threshold, the number of sampling points is increased. For example, if the coverage threshold is 98% and the initial number of sampling points is 12, the calculated triangle coverage value is less than 98%. In this case, low-coverage areas are searched, such as recessed or heavily occluded areas, and additional sampling points are added in these areas, bringing the total number of sampling points to 16. The camera parameters for each sampling point are then redefined, and a multi-channel rendered image of the 3D mesh model is acquired at each sampling point until the triangle coverage exceeds the coverage threshold.
[0070] In some embodiments, multiple two-dimensional cutting line probability maps are predicted based on multi-channel rendered images of multiple sampling points, including: predicting the corresponding two-dimensional cutting line probability maps based on a two-dimensional cutting line prediction network model of multi-channel rendered images of multiple sampling points.
[0071] Specifically, the 2D cutting line prediction network model adopts an improved U-Net encoder-decoder architecture, combining a multi-head self-attention mechanism and a cross-view feature aggregation step to achieve pixel-level prediction of cutting lines for multi-view input images.
[0072] The two-dimensional cut line prediction model includes an encoder, a bottleneck layer, a decoder, and an output head.
[0073] The encoder is used to extract feature maps at multiple different scales from a multi-channel rendered image. The encoder can use a pre-trained ResNet-50 as the backbone network to extract multi-scale features. The input is a multi-channel rendered image, which includes seven channels: a 3-channel planar shading image corresponding to RGB, a mesh edge overlay map, a depth buffer map, a surface curvature map, and a triangular facet ID map.
[0074] When the resolution of the multi-channel rendered image is 1024×1024, the encoder can output feature maps at four scales, namely: ; It has a 1 / 4 resolution and 256 channels. It has a 1 / 8 resolution and 512 channels. It has a resolution of 1 / 16 and 1024 channels. It has a 1 / 32 resolution and 2048 channels.
[0075] The encoder can extract features at different scales. High-resolution features retain fine spatial positions, making it easy to accurately locate the cutting line. Low-resolution features retain more semantic information, thus determining the meaning or object represented by the pixel, such as determining whether the pixel is a face or clothing.
[0076] The bottleneck layer is used to apply multi-head self-attention to cross-view information exchange in the lowest-scale feature map, generating enhanced bottleneck features. Enhanced bottleneck features are feature maps that fuse the visibility constraints of the same feature point from multiple sampling points. The resolution of enhanced bottleneck features is the same as that of the lowest-scale feature map. Each feature vector incorporates the visibility constraints of other sampling points on the same feature, preserving the semantic information of the original lowest-scale feature map while adding constraint information from other sampling points on the same feature. This ensures that the cutting lines predicted from different viewpoints are accurately aligned in 3D space.
[0077] The bottleneck layer applies multi-head self-attention (M&A) to the lowest resolution feature map. Head Self Attention (MHSA) enhances global context awareness, represented as: ; Each head for: ; In some examples, the number of attention heads is set. Dimensions of each head .
[0078] By applying multi-head self-attention to the lowest-scale feature map through the bottleneck layer, a score for each head is calculated, and enhanced bottleneck features are generated, so that each pixel can aggregate the contextual information of the whole image.
[0079] The decoder is used to upsample feature maps at multiple different scales. The decoder can employ a progressive upsampling structure, where each layer fuses features from the encoder at the corresponding scale via skip connections. ; Where ⊕ represents the concatenation operation along the channel dimension, and Upsample is the bilinear interpolation upsampling.
[0080] The decoder can restore resolution and refine extracted details, making the predicted cut lines more accurate and avoiding blurring.
[0081] The output header is used to map the feature map into a two-dimensional cutting line probability map through convolution and activation functions. The output header then passes the upsampled output from the decoder through... Convolution and the Sigmoid activation function produce a pixel-level cut-line probability map, calculated using the following formula: ; in Indicates sampling point Medium pixel This represents the predicted probability of the cutting line.
[0082] The 2D cutting line prediction model is pre-trained using a training dataset. The training dataset can be automatically extracted from existing high-quality UV mapping assets.
[0083] For each 3D mesh model that has already undergone 2D unfolding, mark the ground truth cutting lines and ground truth labels, and perform data augmentation to obtain the training dataset.
[0084] In a 3D mesh model, if the triangular faces on both sides of any edge are not adjacent in 2D space (i.e., their 2D coordinates are discontinuous), then that edge is a truth-value cutting line. The set of truth-value cutting lines is obtained by traversing all edges in the 3D mesh model. .
[0085] Obtain multi-channel rendered training images of the 3D mesh model. In the multi-channel rendered training images, the edges belonging to the ground truth cutting lines are labeled with preset values on the corresponding multi-channel rendered training images, thus generating multi-channel rendered training images with ground truth annotations. The preset value can be white, i.e., a value of 1.
[0086] Data augmentation of multi-channel rendered training images, such as random rotation (±15) of multi-channel rendered training images. Brightness jitter (±0.1), Gaussian noise ( Enhancement operations such as (e.g., = 0.02) can improve the robustness of the model.
[0087] In some examples, the training dataset can be generated by collecting 5,000 high-quality UV models from an internal game asset library, each with 12 views, resulting in a total of 60,000 training samples. The training configuration is shown below: The optimizer chosen is AdamW, and the learning rate is... Weight decay .
[0088] The learning rate scheduling strategy uses cosine annealing and sets a 5-epoch warmup phase.
[0089] Distributed training is employed, with 8 graphics processing units (GPUs) training in parallel. The batch size is set to 4 images per GPU, resulting in an equivalent batch size of 32.
[0090] The model training consists of 100 rounds, taking approximately 48 hours in total. The input resolution is 1024 × 1024. The inference time for a single sampling point is approximately 35ms, and for 12 sampling points, it is approximately 420ms.
[0091] The loss function of the two-dimensional cutting line prediction model includes weighted binary cross-entropy loss (Weighted BCELoss) and topological connectivity loss (Topology). Aware Loss and Dice Loss.
[0092] Since the cut-line pixels account for a very small percentage of the image, typically less than 5%, the weighted binary cross-entropy loss employs a positive sample weighting strategy. The calculation formula is: ; in, For positive samples, the weight can be 10; For negative sample weights, the value can be 1.
[0093] By using weighted binary cross-entropy loss, the 2D cut line prediction model focuses more on the pixels containing a smaller number of cut lines.
[0094] To avoid broken or isolated fragments in the predicted cutting lines, a topological connectivity loss is introduced, penalized based on connected component analysis. The predicted probability graph is then thresholded. Then, calculate the number of connected components. Based on the number of connected components Number of components compared to the actual cutting line Compare the number of connected components. The number of components greater than the actual cutting line This imposes a penalty, causing the network to predict continuous, complete cut paths rather than scattered fragments. (Topological connectivity loss) The calculation formula is: ; in, The number of connected components. This represents the number of actual cutting line components.
[0095] Dess loss is used to mitigate class imbalance and focuses on overall recall. The calculation formula is: ; in This is a probability map of the predicted two-dimensional cutting line. This is a diagram with actual cutting line annotations.
[0096] Assign corresponding weights to the weighted binary cross-entropy loss, topological connectivity loss, and Descein loss to obtain the total loss. The formula for calculating the total loss is as follows: ; in, , and These are the weight coefficients for the weighted binary cross-entropy loss, topological connectivity loss, and Descein loss, respectively. In one example, , and The value can be , and .
[0097] In some embodiments, multi-head self-attention is applied to the feature map at the lowest scale for cross-view information exchange to generate enhanced bottleneck features, including: back-projecting the feature coordinates in the feature maps of other sampling points to three-dimensional space through camera parameters, and then reprojecting them to the feature map of one of the sampling points to obtain the corresponding pixel coordinates; determining the visibility weight based on the similarity between the pixel coordinates and the corresponding feature coordinates in the feature map of one of the sampling points; aggregating the pixel coordinates based on the visibility weight and fusing them with the feature map of one of the sampling points to generate enhanced bottleneck features.
[0098] Specifically, for Bottleneck layer features of each sampling point Through Deformable Cross Attention Attention enables information exchange between viewpoints.
[0099] For any feature location of a sampling point, the 2D coordinates in the feature map can be back-projected to the 3D space of the 3D mesh model using camera parameters. Then, based on the camera parameters of another sampling point, the coordinates can be re-projected to the feature map of that other sampling point. The calculation formula is as follows: ; in, For pixels At the sampling point k The homogeneous coordinates in the data contain depth information.
[0100] Through the above transformation process, for any given feature map, the corresponding pixels in other feature maps are transformed into that feature map and then aggregated. The aggregation formula is as follows: ; in, Visibility weight.
[0101] Visibility weight The calculation formula is: ; in, For the current sampling point k The query vector, For the key vectors of other sampling points, Used to calculate the similarity between the two. For dimensions.
[0102] Visibility weights indicate that if a feature is also seen as a cutting line in other feature maps, its corresponding weight is increased in the current feature map; otherwise, its corresponding weight is decreased.
[0103] By performing cross-view coordinate mapping based on camera parameters, the pixel coordinates of a point in the middle of the 3D space can be accurately locked under different viewpoints, regardless of how the texture of the model changes. This eliminates feature drift, reduces the discrepancy between prediction results of the same point at different sampling points, and improves prediction accuracy by adjusting the importance of different sampling points through adaptive visibility weights.
[0104] In some examples, such as Figure 3 The diagram shows the operation flowchart of the two-dimensional cutting line prediction model, which includes the following steps: S301. Input the multi-channel rendered image into the encoder.
[0105] After inputting the 1024×1024 multi-channel rendered image into the ResNet-50 encoder, four feature maps of different scales are obtained, which are the feature maps. , , and .
[0106] S302. Input the lowest-scale feature map into the bottleneck layer and apply multi-head self-attention for cross-view information exchange.
[0107] Feature maps of other sampling points The feature coordinates in the image are back-projected to 3D space through camera parameters, and then reprojected to the feature map of one of the sampling points to obtain the corresponding pixel coordinates; the pixel coordinates are aggregated based on visibility weights and fused with the feature map of one of the sampling points to generate enhanced bottleneck features.
[0108] S303, Upsampling is performed through the decoder.
[0109] The decoding layer consists of four layers, with decoding layer 4 performing upsampling and skip connections. Decoding layer 3 performs upsampling and skip connections. Decoding layer 2 performs upsampling and skip connections. Decoding layer 1 performs upsampling and skip connections. .
[0110] S304. Output the cutting line probability map through the output head.
[0111] Through the output head Convolution and the Sigmoid activation function produce a 1024×1024 cut line probability map.
[0112] In some embodiments, a set of cutting lines is generated by back-projecting multiple two-dimensional cutting line probability maps and camera parameters onto a three-dimensional mesh model. This includes: mapping pixels predicted as cutting lines in the multiple two-dimensional cutting line probability maps back to the mesh surface of the three-dimensional mesh model based on ray projection; determining the set of coordinates of the pixels on the mesh surface and the triangular face where each pixel is located; determining the coordinates of each pixel in the coordinate set and the nearest mesh edge in the triangular face where the pixel is located to obtain a set of candidate cutting edges; and generating a set of cutting lines by weighted voting fusion based on the set of candidate cutting edges.
[0113] Specifically, the two-dimensional cutting line probability map includes multiple pixels that are predicted to be cutting lines, that is, pixels whose probability of being predicted as cutting lines is greater than a preset probability threshold.
[0114] Ray casting is a geometric calculation process that involves emitting an infinitely extending ray from the camera through each pixel predicted as a cutting line on the plane of the 2D cutting line probability map, and calculating the first intersection point of the ray with the surface of the 3D mesh model.
[0115] In some examples, such as Figure 4 As shown, a set of cutting lines is generated by back-projecting multiple 2D cutting line probability maps and camera parameters onto a 3D mesh model, including the following steps: S401, Obtain the pixels predicted as cutting lines.
[0116] Filter pixels in the 2D cutting line probability map that are predicted to be cutting lines with a probability greater than a preset probability threshold.
[0117] S402. Convert the pixels predicted as cutting lines to normalized coordinates.
[0118] The pixel coordinates of the pixels predicted as cutting lines are converted to normalized device coordinates (NDC). The calculation formula is as follows: ; Wherein, pixel coordinates are The width and height of the two-dimensional cutting line probability map are respectively and .
[0119] S403, Calculate the ray direction.
[0120] The ray direction is obtained by inverse transformation of the projection matrix and the view matrix. : ; The ray equation is: ; in, and For camera parameters, The origin of the camera. This is the distance to the camera origin.
[0121] S404. Calculate the intersection of the ray and the mesh.
[0122] The coordinates of each pixel on the mesh surface and the triangular face of each pixel are determined by ray casting. Then, for the ray... Determine the coordinates of a pixel and the nearest grid edge in the triangle containing the pixel.
[0123] Rayling using Bounding Volume Hierarchy (BVH) Triangle intersection test. For any triangle... The Moller-Trenberger method was adopted. The Trumbore (MT) algorithm is used to solve for corner points, and the calculation formula is as follows: ; in, , , Triangular face The coordinate vectors of the three sides, and These are the coordinates of the centroid.
[0124] Solve the system of linear equations: ; when , , and When the intersection point is valid, its three-dimensional coordinates are: ; S405. Determine whether the intersection point is inside the triangle.
[0125] If the intersection point is outside the range of the triangle, it may be noise and can be discarded. If the intersection point is within the range of the triangle, jump to S406; if the intersection point is outside the range of the triangle, jump to S412.
[0126] S406. Obtain the coordinates of the intersection point and the index of the triangular face.
[0127] If the intersection point is within the range of a triangle, record the index of the triangle containing the intersection point. and barycentric coordinates .
[0128] S407. Calculate the distances from the intersection point to the three sides of the triangle.
[0129] Three-dimensional intersection points obtained by ray projection When the intersection is located inside a triangular face, the effective cutting line must be located on the edge of the mesh. Therefore, the intersection needs to be snapped to the nearest mesh edge.
[0130] For hitting the triangle face The three sides , and Calculate the distance from the intersection point to each edge: ; in, , For the edge The two endpoints.
[0131] S408. Determine whether the minimum distance is less than the distance threshold.
[0132] Select the nearest edge as the candidate cutting line: Determine if the minimum distance is less than the distance threshold. If the minimum distance is less than the distance threshold, proceed to S409; if the minimum distance is less than the distance threshold, proceed to S413.
[0133] The distance threshold can be set based on the average length of all edges of the 3D mesh model, for example... , This represents the average length of all edges in the 3D mesh model.
[0134] S409. Snap the intersection point coordinates to the nearest edge.
[0135] The intersection coordinates are snapped to the nearest edge. If the intersection is close to the vertex of the triangle, that is, one of the components of the centroid coordinate is close to 1, all edges associated with the vertex are selected as candidates, and the edge that is most consistent with the predicted cutting line direction is snapped to.
[0136] S410. Gather all prediction results to obtain the cut edge set.
[0137] Calculate the nearest mesh edge in the triangle face of each pixel in the coordinate set to obtain candidate cutting edges. Summarize all cutting edges to obtain the candidate cutting edge set. S411, Weighted Voting Fusion.
[0138] The cutting edge may be observed and predicted in images acquired from multiple sampling points. Therefore, weighted voting fusion is required to generate a set of cutting lines, thereby eliminating noise and ambiguity caused by predictions from individual sampling points.
[0139] S412, Discard pixel coordinates.
[0140] If the intersection point extends beyond the triangle's surface, it may be noise and can be discarded. Therefore, when the intersection point extends beyond the triangle's surface, the pixel coordinates can be directly discarded.
[0141] S413, Discard the intersection coordinates.
[0142] If the distance from the intersection point to the edge is greater than the distance threshold, that is... If the intersection point is not considered noise, it will be discarded.
[0143] In some embodiments, a set of cutting lines is generated by weighted voting fusion based on a set of candidate cutting edges, including: determining the quality weight of sampling points based on the normal vector of the face where each candidate cutting edge is located and the camera parameters; determining the confidence score of each candidate cutting edge based on the viewpoint quality weight of the sampling points; and selecting candidate cutting edges with confidence scores greater than a preset confidence threshold as the set of cutting lines.
[0144] Specifically, the sampling point viewpoint quality weight is used to quantify the reliability of the sampling point's observation results of the candidate cutting edge, so that the frontal viewpoint and the closer distance have a higher voting weight. The sampling point viewpoint quality weight is obtained based on the average normal vector of the face containing the candidate cutting edge, the sampling direction of the sampling point, and the distance from the sampling point to the candidate cutting edge.
[0145] The confidence score is the probability value of each edge in the 3D mesh model being a cutting edge. Candidate cutting edges with a confidence score greater than a preset confidence threshold have a higher probability of becoming cutting lines. Therefore, candidate cutting edges with a confidence score greater than the preset confidence threshold are selected as the cutting line set.
[0146] Each candidate cutting edge in the candidate cutting edge set Its confidence score is defined as: ; in, Indicates candidate cutting edge At the sampling point Is it visible in the middle? Sampling points The probability of the cutting line for the corresponding pixel. The sampling point view quality weights.
[0147] Sampling point view quality weight The calculation formula is:
[0148] in Candidate cutting edge The average value of the normal vector of the surface. Sampling points The camera's observation direction, Candidate cutting edge Distance to the camera.
[0149] Calculate the confidence score for each candidate cutting edge, and select candidate cutting edges with confidence scores greater than a preset confidence threshold as the cutting line set. The calculation formula is as follows: ; In some examples, confidence threshold It can be 0.4, and in other examples, it can be set according to actual needs. This embodiment does not make specific limitations on the value of the confidence threshold.
[0150] By prioritizing candidate cutting edges with closer proximity and more accurate perspectives based on the sampling point's viewpoint quality weight, the final position snapped to the mesh edge achieves higher accuracy compared to direct mapping of a single sampling point, avoiding spatial drift caused by perspective projection. Simultaneously, confidence scores are used for filtering, reducing the computational complexity of subsequent steps and improving efficiency.
[0151] In some embodiments, before determining the two-dimensional unfolding coordinates and unfolding parameters corresponding to the three-dimensional mesh model based on the set of cutting lines, the two-dimensional unfolding method further includes: determining the validity state of the set of cutting lines; and performing topology repair on the set of cutting lines when the validity state of the set of cutting lines indicates that the validity constraints are not met, so that the validity state of the set of cutting lines meets the validity constraints.
[0152] Specifically, the validity state of the cut line set characterizes whether the set possesses the topological compliance conditions for unfolding. The validity state includes satisfying and not satisfying validity constraints. When the validity constraints are satisfied, the 2D unfolding algorithm can run successfully without numerical collapse. If the validity constraints are not satisfied, topological repair of the cut line set is required to ensure that the validity state of the cut line set satisfies the validity constraints, thus enabling successful 2D unfolding.
[0153] Validity constraints include connectivity constraints, expandability constraints, and integrity constraints.
[0154] The connectivity constraint requires that the set of cutting lines must form a connected subgraph, or a few connected components, each of which corresponds to the boundary of a UV island.
[0155] The expandability constraint requires that after cutting along the cleavage line set, each connected component must be homeomorphic to the disk topology, i.e., Euler's formula. This holds true for every connected component.
[0156] The integrity constraint applies to models of aspherical topologies, such as toruses, where the number of cut lines in the cut line set must be sufficient to break all topological loops (genus handles).
[0157] In some embodiments, topology repair of the cut line set includes: performing connected component analysis on the cut line set to remove noisy cut lines; if the cut line set is not connected, determining the cost of each edge in the 3D mesh model based on the cut line set, searching in the 3D mesh model for a minimum cost path that connects the cut line set and minimizes the sum of the costs of all edges, adding the edges on the minimum cost path to the cut line set to make the cut line set connected; if there are connected components in the cut line set with an Euler characteristic number not equal to 1, finding the shortest non-shrinkable cycle in the connected components, adding the edge of the shortest non-shrinkable cycle to the cut line set to make the Euler characteristic number of all connected components in the cut line set equal to 1; removing redundant edges from the cut line set to obtain the topology-repaired cut line set.
[0158] Specifically, connected component analysis treats the edges of triangular faces in a 3D mesh model as edges and determines whether several cutting lines in a set of cutting lines can form a whole by connecting them end-to-end through shared vertices, i.e., whether they can form a connected component. For example, a loop formed by cutting lines encircling the head can constitute a connected component.
[0159] A graph optimization algorithm is used to perform topology repair on the set of cutting lines, modeling the repair of cutting lines as a minimum cost cutting problem on a graph.
[0160] Let the set of all edges of the 3D mesh model be... Define a cost function for each edge: ; in, The confidence level of the predicted cutting line. Let be the side length. For the average side length, The dihedral angle is the angle at which the edge is located. The higher dihedral angle represents a sharp crease and is suitable for placing cutting lines. As visual importance weight, , , and This is the balance coefficient.
[0161] Visual importance weight Areas with rich texture details and facing the camera should be given higher weight and should be avoided from being cut.
[0162] The balance coefficient can take the following values: , , and .
[0163] Visual importance weight The calculation method can be: ; in The frontal view of the model can usually be set as the Z-axis. The texture detail density of the region where the edge is located can be estimated by analyzing the texture frequency of existing similar models.
[0164] In some examples, such as Figure 5 As shown, after selecting candidate cutting edges with confidence scores greater than a preset confidence threshold as the cutting line set, the topology repair of the cutting line set includes the following steps: S501, Remove isolated short segments.
[0165] Set of cutting lines By performing connected component analysis, if there are isolated short cutting segments, such as those with a length of less than three edges, they are considered noise and removed. This removes all noisy cutting lines from the cutting line set, reducing the search volume in subsequent steps and improving search efficiency.
[0166] S502. Determine if there is only one connected component.
[0167] If there is only one connected component, a direct cut can be performed. If there are two or more independent connected components, the cut network is not connected and cannot be completely split, requiring path completion. Therefore, if there is only one connected component, proceed directly to S504; if there are more than one connected component, proceed to S503.
[0168] S503, Minimum Cost Connectivity Path Completion.
[0169] When the set of cutting lines is not connected, Dijkstra's shortest path algorithm is used to find the minimum-cost path in the cost graph that connects the set of cutting lines. The minimum-cost path is the path that connects the set of cutting lines and has the minimum sum of the costs of all edges in the path. The formula is: ; Add the edges on the minimum cost path to the set of cutting lines to make the set of cutting lines connected, so that subsequent simulated cutting operations can be executed successfully.
[0170] S503. Merge the set of cutting lines into a connected cutting graph.
[0171] Merging the set of cutting lines yields a complete and uninterrupted connected cutting graph, ensuring that the cutting lines can completely divide the outer surface of the model.
[0172] S504. Simulate cutting a 3D mesh model along the cutting lines in the connected cutting graph.
[0173] Cut along the edges of the triangular faces of the 3D mesh model along the cutting lines in the connected cutting graph, and split the complete 3D mesh model into several independent connected components.
[0174] S505. Calculate the Euler characteristic number of each connected component.
[0175] Euler characteristic is a constant in topology that describes the structure of a surface. Euler characteristic is calculated as follows: ; in Let be an Euler characteristic. The number of vertices. Let be the number of sides. The number of faces.
[0176] S506. Determine whether the Euler characteristic of all connected components in the set of cutting lines is 1.
[0177] Only those that satisfy the Euler characteristic Only a curved surface can be flattened onto a two-dimensional rectangle without distortion through conformal mapping. Therefore, it is necessary to determine whether all connected components in the set of tangents have an Euler characteristic of 1. If such an Euler characteristic exists... Jump to S507; if all Euler characteristics Jump to S508.
[0178] S507. Find and add non-retractable rings.
[0179] Given a set of cleavage lines containing connected components with Euler characteristic not equal to 1, find the shortest non-contractable cycle (non-circular) among these connected components. To prevent contractible loops, add the shortest non-contractable loop edge to the secant set, such that the Euler characteristic of all connected components in the secant set is 1. S508, Trim redundant leaf edges.
[0180] Remove redundant edges from the cut line set. Redundant edges are those that do not affect the topology validity, such as leaf edges with a degree of 1, in order to minimize the total cut line length.
[0181] ; in, This is the set of cut lines after topology repair.
[0182] After pruning redundant leaf edges, the output is a topology-repaired set of cut lines. Topology repair of the cut line set ensures it meets the topological constraints for 2D unfolding, thus enabling successful 2D unfolding.
[0183] In some embodiments, determining the two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines includes: cutting the three-dimensional mesh model according to the set of cutting lines to generate multiple cutting meshes, each cutting mesh consisting of multiple connected components; mapping each connected component to a two-dimensional parameter domain to generate a set of two-dimensional mesh coordinates of all vertices in the connected component in the two-dimensional parameter domain; arranging the set of two-dimensional mesh coordinates of all connected components in texture space to generate two-dimensional unfolded coordinates in texture space; calculating the distortion metric of the two-dimensional unfolded coordinates to evaluate the quality of the two-dimensional unfolded coordinates and generating a quality metric report.
[0184] Specifically, a cut mesh is the mesh data obtained by cutting a 3D mesh model along a set of cut lines. Each cut mesh consists of multiple connected components (UV islands), and each connected component has a disk topology. For each edge on the cut line... = ( , The triangle is split into two edges, and the two triangles that originally shared the edge are no longer topologically adjacent.
[0185] Set the original mesh After cutting ,in That is, each vertex on the cutting line is copied. That is, the number of faces remains unchanged. The number of connected components is... ,in The number of vertices involved in the cutting line. This represents the number of connected components in the original mesh.
[0186] A two-dimensional parametric domain is a local two-dimensional planar space independent of each connected component. In a parametric domain, the connected components do not affect each other. A two-dimensional mesh coordinate set is the set of two-dimensional coordinates corresponding to all vertices after the connected components are mapped to the parametric domain.
[0187] The 3D mesh is mapped to a 2D parameter domain by performing parameterization on each connected component individually. In some examples, Scalable Locally Injective Mappings (SLIM) can be used, with the objective function being: ; in, Triangular face The parameterized Jacobian matrix. , Let be the singular values of the Jacobian matrix. Let be the three-dimensional area of the surface. The energy is at its minimum, corresponding to an isometric mapping.
[0188] The sparse linear recommendation algorithm solves the problem iteratively by alternating directions, and the calculation formula is as follows: ; in, For the current iteration The nearest rotation matrix can be obtained through Singular Value Decomposition (SVD).
[0189] Initialization employs a tutte embedding to achieve harmonic mapping under convex boundary constraints, ensuring no injection during initial parameterization. free): ; in, Cotangent weight: ; and For the edge The two corresponding diagonal angles.
[0190] After parameterization, the 2D mesh coordinates of all connected components need to be arranged in texture space to generate 2D unfolded coordinates in texture space, thereby maximizing space utilization. Texture space is the final output texture canvas.
[0191] A rotation-optimized rectangle packing algorithm can be used to calculate the minimum area bounding rectangle for each connected component, which can be obtained through a rotational caliper algorithm. All connected components are sorted in descending order of area, prioritizing the placement of connected components with larger areas, thus determining the layout skeleton. Bottom packing is then employed. The left heuristic algorithm places all connected components sequentially. For each connected component, it tries four rotations: 0°, 90°, 180°, and 270°, and selects the orientation with the highest utilization.
[0192] The space utilization rate of a connected component is defined as: ; According to industry standards, space utilization needs to be met. .
[0193] In addition, to avoid bleeding during texture sampling, a certain gap is maintained between adjacent connected components. For example, a 2-pixel gap is maintained for a 1024×1024 texture, or a 4-pixel gap is maintained for a 2048×2048 texture.
[0194] While obtaining the 2D unfolded coordinates, a distortion metric is also calculated to assess the quality of the 2D unfolded coordinates and generate a quality metric report. The distortion metric is used to quantify the degree to which the 2D unfold deviates from a perfect mapping.
[0195] Calculate the angular distortion, area distortion, and stretch metric (L2) for the two-dimensional unfolded coordinates.
[0196] Angular distortion is the average of the differences between the interior angles of the unfolded triangle and the original three-dimensional angles. The formula for calculation is: ; Area distortion is the relative deviation between the two-dimensional area proportion and the three-dimensional area proportion. The calculation formula is as follows: ; The stretch metric measures the proportion by which texture pixels are stretched during mapping, and is calculated using the following formula: ; Ideally, the stretch measurement This indicates no stretching. The target of the stretch measurement is... .
[0197] In this embodiment, by performing parameterization on each connected component individually, the difficult-to-calculate global parameterization is decomposed into multiple independent parameterizations, facilitating subsequent individual adjustment of texture precision in different regions. Mapping each connected component to a two-dimensional parameter domain results in low distortion and perfect fit to the model surface. Furthermore, there is no overlapping or self-intersection within each connected component, ensuring correct texture rendering. The arrangement in texture space effectively improves space utilization.
[0198] In some embodiments, the two-dimensional unfolding method further includes: calculating the overall quality score of the two-dimensional unfolded coordinates; generating a two-dimensional distortion heatmap if the overall quality score of the two-dimensional unfolded coordinates is less than the overall quality score threshold; and using the two-dimensional distortion heatmap as an additional input channel in a multi-channel rendered image to re-predict a two-dimensional cutting line probability map to iteratively update the two-dimensional unfolded coordinates.
[0199] Specifically, the overall mass score reflects the total mass of the two-dimensional unfolded product and is a scalar value between 0 and 1. The overall mass score is derived from the angle retention score, area retention score, seam visibility score, and packing efficiency score.
[0200] When the overall quality score of the two-dimensional unfolded coordinates is less than the overall quality score threshold, a two-dimensional distortion heatmap is generated. The two-dimensional distortion heatmap is a visualization data layer that maps the severity of distortion on the surface of the three-dimensional model to a two-dimensional image, and is used to provide feedback on prediction errors.
[0201] By using the 2D distortion heatmap as an additional input channel in the multi-channel rendered image, the 2D cutting line probability map is re-predicted to iteratively update the 2D unfolded coordinates. This allows the 2D cutting line prediction model to understand the current problems in the 2D unfolding and perform targeted iterative updates, thereby improving the accuracy of the 2D unfolded coordinates.
[0202] In some examples, such as Figure 6 As shown, the steps for iteratively updating the two-dimensional unfolded coordinates include: S601. Calculate the overall quality score.
[0203] Overall quality score The calculation formula is: ; Angle maintained for: ; in, Angle threshold, angle threshold .
[0204] Area remains divided for: ; in, Area threshold, area threshold .
[0205] Seam visibility for: ; in, The total length of the cutting line located in the visually important region. This represents the total length of the cutting line.
[0206] ; in, For space utilization.
[0207] , , , The weights are respectively for angle preservation score, area preservation score, seam visibility score, and packaging efficiency score. , , , The possible values for are: , , , .
[0208] S602. Determine whether the overall quality score is greater than the overall quality score threshold.
[0209] The overall quality score threshold is a preset passing score, which can be set to 0.8. If the overall quality score is greater than the threshold, it indicates that the requirements are met, and the result can be output directly. If the overall quality score is less than the threshold, proceed to step S603.
[0210] S603. Determine whether the current iteration count exceeds the maximum iteration count.
[0211] The maximum number of iterations is the maximum allowed number of iterations. If the maximum number of iterations is exceeded, the iteration can be stopped directly to avoid over-segmentation. Output the current best result and provide a warning. If the current number of iterations is less than the maximum number of iterations, jump to step S604.
[0212] S604, Render a two-dimensional distortion heatmap.
[0213] First, calculate the stretch factor for each triangular face. Then, the stretch factor is visualized as a color, and different colors are used to distinguish the severity of distortion. For example, blue, green and red represent no distortion, moderate distortion and severe distortion, respectively.
[0214] S605. The distorted heatmap is used as an additional input channel and fed back to the two-dimensional cutting line prediction model.
[0215] The distorted heatmap is used as an additional input channel and fed back into the 2D cutting line prediction model: ; The 2D cutting line prediction model understands the shortcomings of the current cutting scheme through conditional input and tends to add extra cutting lines in high-distortion regions to alleviate distortion. Iterative updates using 2D unfolded coordinates improve the accuracy of the 2D unfolded coordinates.
[0216] S606, Perform iterative updates.
[0217] The 2D cutting line prediction model re-predicts the 2D cutting line probability map, and then back-projects this probability map back onto the surface of the 3D mesh model to obtain a set of cutting lines. The newly obtained set of cutting lines is then joined with the previous set of cutting lines, and all cutting lines are retained.
[0218] After topological repair of the cutting line set, the two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model are determined, and the iteration counter is incremented by 1. Return to step S601 to calculate the overall quality score to determine if further iterations are needed.
[0219] The iterative formula is as follows:
[0220] Maximum number of iterations To avoid over-segmentation, the process stops when the quality score improvement between two adjacent iterations is less than the convergence threshold, which can be 0.02. Each iteration adds a new cutting line and takes the union of the previous result, without deleting already determined cutting lines. In the t-th iteration, the threshold of the 2D cutting line prediction model decreases to... This allows more candidate cutting edges to be considered, thus improving coverage.
[0221] The following uses a game character model as an example to illustrate Example 1 in detail.
[0222] A female character model in a game needs to be UV unwrapped. The model has the following characteristics: 28,432 triangles; 14,560 vertices, including multiple semantic regions such as the head (face + hair), torso (upper garment + lower garment), and limbs (two arms + two legs). The following problems arise when performing 2D unwrapping: The hand-applied UV coating showed noticeable stretching at the seams of the garment. Furthermore, the small size of the facial connectivity components (UV islands) results in insufficient texture resolution.
[0223] like Figure 7 As shown, the processing procedure includes the following steps: S701. Obtain a multi-channel rendered image with 12 sampling points.
[0224] Automatically calculate the model bounding box: center diagonal length Set the radius of the sphere. Fibonacci spherical sampling with 12 sampling points was used.
[0225] Each sampling point includes 4 frontal related views, covering the face, front of the torso, and front of the legs; 4 side related views, covering the arms and side profile; and 4 rear related views, covering the back of the hair, the back, and the buttocks. The overall coverage = 0.993 > 0.98, which meets the requirements.
[0226] Each viewpoint generates 5 channels of data, with a total data volume of approximately 240MB (12 × 5 × 1024 × 1024 × 4 bytes).
[0227] S702, the two-dimensional cutting line prediction network model predicts the corresponding two-dimensional cutting line probability map.
[0228] The planar shading image is split into three channels according to RGB, resulting in 12 sets of 7-channel data, which are used as input. These 12 sets of 7-channel input are then fed into a trained 2D cutting line prediction network model. The inference time is 12 × 35 ms = 420 ms.
[0229] The 2D cutting line prediction network model outputs 12 2D cutting line probability maps. Key prediction results of the 2D cutting line probability maps include: cutting lines in the facial region are distributed along the hairline, behind the ears, and jawline, with a probability >0.8; cutting lines in the torso region are distributed along clothing seams, which can be at the collar, cuffs, hem, etc.; cutting lines in the limb region are distributed along visually inconspicuous areas such as the inner sides of the arms and legs; and cutting lines in the hand region are distributed along the gaps between the fingers.
[0230] S703. Back-project the two-dimensional cutting line probability map to generate a cutting line set.
[0231] Raycasting was performed on pixels with a predicted probability greater than the preset confidence threshold of 0.4 from 12 viewpoints, with a total of approximately 45,000 rays, averaging 3,750 pixels per viewpoint. The construction time for the Bounding Volume Hierarchies (BVH) was 18ms, the ray intersection time was 120ms, and the edge snapping success rate was 89.3%, of which 10.7% were discarded because the distance exceeded the threshold.
[0232] After multi-view weighted voting, a total of 2,847 edges received non-zero confidence scores. After thresholding ( =0.4), 1203 edges were marked as the initial cutting lines.
[0233] S704, Perform topology repair.
[0234] Analysis of the initial cutting line yields 7 connected components, including 1 main cutting graph and 6 isolated short segments. After removing the short segments, 1 main connected component with 1156 edges is obtained.
[0235] Performing an Euler characteristic test, after cutting, eight connected components are generated. The Euler characteristic of six regions—the head, torso, left and right arms, and left and right legs—is determined. Euler characteristic of 2 regions = 0, cut lines need to be added. After adding 2 shortest non-scalable loops, all components satisfy the disk topology. After pruning 23 redundant leaf edges, the final cut graph contains 1198 edges.
[0236] S705. Parameterize the set of cut lines after topology repair.
[0237] The Sparse Linear Model (SLIM) parameterization was performed on each of the eight connected components. Initialization was performed using a centroid embedding (Tutte) for 15ms. The SLIM converged after 47 iterations, taking 380ms.
[0238] The final distortion metrics in the quality measurement report include angular distortion. Area distortion , stretching measurement .
[0239] The connected components (UV islands) are packed together. The packing algorithm takes 45ms and has a high space utilization rate. = 0.78, where the area of the facial connected component accounts for 18%, which is an improvement in texture resolution compared to the original 12%.
[0240] S706. Conduct a quality assessment.
[0241] Calculate the overall quality score and angle retention score. , , Of these, 12% of the cutting lines are located in visually important areas. Overall quality score , =0.847>0.8, which meets the quality threshold, so no iterative refining is needed.
[0242] The same female character model in Comparative Example 1 was manually unfolded in two dimensions, and the results are compared with those in Example 1, as shown in Table 1.
[0243] Table 1. Comparison of Experimental Results
[0244] As can be seen from Table 1, Example 1 is superior to Comparative Example 1 in all quality indicators, and the production time is reduced from 5.5 hours to 2.3 seconds, with a significant efficiency improvement of more than 8,000 times.
[0245] The following uses a game environment prop model as an example to illustrate Example 2 in detail.
[0246] A racing car model in a game needs to be unfolded in 2D for subsequent procedural texture generation. The model has the following characteristics: 85,216 triangles, 43,108 vertices, and topological features including a large number of hard edges, flat panels, cylindrical rims, and thin-shell windows. During the 2D unfolding process, the car body panels require large areas of continuous UVs to support decal placement, the rims require annular UVs to support rotational textures, and the windows require low-distortion UVs.
[0247] like Figure 8 As shown, the processing procedure includes the following steps: S801, Obtain multi-channel rendered image.
[0248] Automatically calculate the model bounding box: center diagonal length The racing car model is elongated, and after using 12 sampling points for Fibonacci spherical sampling, the coverage was only 0.96. The chassis area was obscured, so 4 additional sampling points were automatically added below the racing car, with the camera positioned at a low angle. After adding these additional sampling points, the coverage reached 0.99, and a multi-channel rendered image was acquired based on 16 sampling points.
[0249] The S802 two-dimensional cutting line prediction network model predicts the corresponding two-dimensional cutting line probability map.
[0250] The multi-channel rendered image collected from 16 sampling points was input into the two-dimensional cutting line prediction network model, and the inference time was 16 × 35 ms = 560 ms.
[0251] The 2D cutting line prediction network model outputs 16 2D cutting line probability maps. The prediction results include: cutting lines in the body panel area are accurately distributed along the panel seams, such as the door line, hood line, and trunk line; cutting lines in the wheel area are distributed along the outer rim and spoke edges; cutting lines in the window area are distributed along the window frame sealing strip; and cutting lines in the chassis area are distributed along the edges of structural components.
[0252] S803. Back-project the two-dimensional cutting line probability map to generate a cutting line set.
[0253] Raycasting was performed on pixels with a predicted probability greater than the preset confidence threshold of 0.4 from 16 viewpoints, resulting in approximately 128,000 rays. The edge snapping success rate was 92.1%, which is high due to the hard edge characteristics of the vehicle model, which are conducive to snapping. After thresholding, the marked cutting lines were 3,847 edges.
[0254] S804, Perform topology repair.
[0255] Analyzing the initial cut lines yields two connected components. Since the parts of the racing car model are relatively independent, the number of connected components is relatively large. After removing short segments, the cut paths are merged into five main cut paths. Path completion is then performed to form a cut network connecting the top and bottom of the car body. The number of connected components (UV islands) after topology verification is 15: one on each side of the car body, one on the roof, one on the hood, one in the trunk, one on each of the four wheel rims, one on each of the four windows, and one on the chassis.
[0256] S805. Parameterize the set of cut lines after topology repair.
[0257] Sparse Linear Model (SLIM) parameterization was performed on each of the 15 connected components, with 68 iterations and a processing time of 1.2 seconds. The stretching metric was 1.09, and the angular distortion was 6.8°. After parameterization, significant distortion was observed in the transition surface from the roof to the trunk, with a local stretching metric of 1.22. The calculated overall quality score... It needs to be iteratively refined.
[0258] S806, Iterative Refinement.
[0259] A distortion heatmap is generated, with the transition area of the roof marked in red to indicate high distortion. The heatmap is then fed back to the prediction network as an additional input channel.
[0260] The second prediction result is to add a cutting line at the longitudinal centerline of the roof with a probability of 0.72, which will divide the large connected component (UV island) of the roof into left and right halves.
[0261] The updated cut line set was reparameterized, resulting in a stretch metric of 1.04, an angular distortion of 4.1°, and a final overall quality score. It meets the quality threshold.
[0262] S807. Pack the connected components.
[0263] The final number of connected components (UV islands) is 16, with the roof divided into two on the left and right sides. The package utilization rate is 0.76, and the area ratio of the connected components on the body panel is 45%, ensuring the high-resolution requirements for decal placement.
[0264] In Comparative Example 2, the same racing car model was unfolded in two dimensions using the Angle-Based Flattening (ABF) algorithm, and the results are compared with those of Example 2 in Table 2.
[0265] Table 2. Comparison of Experimental Results
[0266] As can be seen from Table 2, Example 2, compared with Comparative Example 2, has the ability to process hard surface models and understand the structural semantics of racing car models, such as panel boundaries and part seams. The generated two-dimensional unfolding has significant advantages in both quality and practicality.
[0267] As can be seen from Examples 1 and 2, the 2D unfolding method has semantic awareness capabilities. Whether it's an organic model of a character or a hard-surface model of a race car, it can identify the semantic structural boundaries of the model and place the cutting lines at natural seams. The cutting lines automatically avoid visually important areas such as the face and the front of the car body, focusing on occluded areas such as behind the hairline, panel seams, and the inner side.
[0268] The simple model in Example 1 can pass quality verification on the first try, while the complex model in Example 2 can eliminate distortion by iteratively adding cutting lines. This method is more efficient than traditional two-dimensional unfolding methods.
[0269] Secondly, embodiments of this application provide a two-dimensional unfolding device for a three-dimensional mesh model, such as... Figure 9 As shown, the two-dimensional unfolding device 100 includes a sampling module 101, a two-dimensional cutting line probability map prediction module 102, a back projection module 103, and a two-dimensional unfolding module 105.
[0270] The sampling module 101 is used to acquire multi-channel rendered images and camera parameters of multiple sampling points of the 3D mesh model.
[0271] Specifically, sampling points are used to place cameras, which acquire multi-channel rendered images of the 3D mesh model and record camera parameters during sampling. These parameters include the distance to the 3D mesh model, position coordinates, sampling posture, and camera intrinsic and extrinsic parameters.
[0272] Multi-channel rendered images are two-dimensional images captured by a camera, containing rendering information that facilitates subsequent processing using a deep learning model to obtain cutting lines. The arrangement of multiple sampling points aims to cover the three-dimensional mesh model as much as possible to ensure data accuracy.
[0273] The two-dimensional cutting line probability map prediction module 102 is used to predict multiple two-dimensional cutting line probability maps based on a multi-channel rendered image with multiple sampling points.
[0274] Specifically, a multi-channel rendered image with multiple sampling points is used as input, and a deep learning model predicts a 2D cutting line probability map. The deep learning model can be a model using a U-Net encoder-decoder architecture to achieve pixel-level prediction of cutting lines in the multi-channel rendered image. The 2D cutting line probability map is a single-channel image with the same resolution as the multi-channel rendered image, where the pixel value of each pixel represents the confidence that the pixel belongs to a 2D cutting line; the higher the confidence, the greater the probability that the pixel is a 2D cutting line.
[0275] The back projection module 103 is used to back project onto a 3D mesh model based on multiple 2D cutting line probability maps and camera parameters to generate a set of cutting lines.
[0276] Specifically, since the two-dimensional cutting line probability map represents the probability of cutting lines in two-dimensional space, it is necessary to back-project the cutting lines back to the three-dimensional space where the three-dimensional mesh model resides.
[0277] When acquiring multi-channel rendered images, the camera parameters at the time of capturing the multi-channel rendered images are recorded simultaneously. The camera parameters can be used to back-project pixels with a confidence level greater than the confidence threshold in the two-dimensional cutting line probability map onto the surface of the three-dimensional mesh model to obtain the cutting line set.
[0278] By converting the dense two-dimensional cutting line probability map into a set of cutting lines on a relatively sparse three-dimensional mesh model, the computational burden on the subsequent cutting line optimization module is reduced.
[0279] The 2D unfolding module 105 is used to determine the 2D unfolding coordinates corresponding to the 3D mesh model based on the set of cutting lines.
[0280] Specifically, the two-dimensional unfolded coordinates are the two-dimensional coordinates assigned to the vertices of the mesh in the three-dimensional mesh model, so that the three-dimensional surface can be correctly mapped onto the two-dimensional texture map.
[0281] By acquiring multi-channel rendered images of multiple sampling points of a 3D mesh model, multiple 2D cutting line probability maps are predicted, and then back-projection is performed to generate a set of cutting lines. This transforms the cutting line placement problem of the 3D mesh model into a semantic segmentation problem in 2D space, making full use of the rendering visual information in the multi-channel rendered images to improve the quality of the cutting lines.
[0282] In some embodiments, the two-dimensional unfolding device 100 further includes a cutting line optimization module 104, which is used to determine the validity state of the cutting line set; when the validity state of the cutting line set indicates that the validity constraint is not met, the cutting line set is topologically repaired so that the validity state of the cutting line set meets the validity constraint.
[0283] Specifically, the validity state of the cut line set characterizes whether the set possesses the topological compliance conditions for unfolding. The validity state includes satisfying and not satisfying validity constraints. When the validity constraints are satisfied, the 2D unfolding algorithm can run successfully without numerical collapse. If the validity constraints are not satisfied, topological repair of the cut line set is required to ensure that the validity state of the cut line set satisfies the validity constraints, thus enabling successful 2D unfolding.
[0284] Validity constraints include connectivity constraints, expandability constraints, and integrity constraints.
[0285] The connectivity constraint requires that the set of cutting lines must form a connected subgraph, or a few connected components, each of which corresponds to the boundary of a UV island.
[0286] The expandability constraint requires that after cutting along the cleavage line set, each connected component must be homeomorphic to the disk topology, i.e., Euler's formula. This holds true for every connected component.
[0287] The integrity constraint applies to models of aspherical topologies, such as toruses, where the number of cut lines in the cut line set must be sufficient to break all topological loops (genus handles).
[0288] In some embodiments, the two-dimensional unfolding device 100 further includes a quality verification module 106, which is used to calculate the comprehensive quality score of the two-dimensional unfolded coordinates; generate a two-dimensional distortion heatmap when the comprehensive quality score of the two-dimensional unfolded coordinates is less than the comprehensive quality score threshold; and use the two-dimensional distortion heatmap as an additional input channel in the multi-channel rendered image to re-predict the two-dimensional cutting line probability map to iteratively update the two-dimensional unfolded coordinates.
[0289] Specifically, the overall mass score reflects the total mass of the two-dimensional unfolded product and is a scalar value between 0 and 1. The overall mass score is derived from the angle retention score, area retention score, seam visibility score, and packing efficiency score.
[0290] When the overall quality score of the two-dimensional unfolded coordinates is less than the overall quality score threshold, a two-dimensional distortion heatmap is generated. The two-dimensional distortion heatmap is a visualization data layer that maps the severity of distortion on the surface of the three-dimensional model to a two-dimensional image, and is used to provide feedback on prediction errors.
[0291] First, calculate the stretch factor for each triangular face. Then, the stretch factor is visualized as a color, and different colors are used to distinguish the severity of distortion. For example, blue, green and red represent no distortion, moderate distortion and severe distortion, respectively.
[0292] The distorted heatmap is used as an additional input channel and fed back into the 2D cutting line prediction model: ; The two-dimensional cutting line prediction model understands the shortcomings of the current cutting scheme through conditional input and tends to add additional cutting lines in high distortion regions to release distortion.
[0293] The accuracy of the two-dimensional unfolded coordinates is improved by iteratively updating them.
[0294] In some examples, the iterative formula is:
[0295] Maximum number of iterations To avoid over-segmentation, the process stops when the quality score improvement between two adjacent iterations is less than the convergence threshold, which can be 0.02. Each iteration adds a new cutting line and takes the union of the previous result, without deleting already determined cutting lines. In the t-th iteration, the threshold of the 2D cutting line prediction model decreases to... This allows more candidate cutting edges to be considered, thus improving coverage.
[0296] By using the 2D distortion heatmap as an additional input channel in the multi-channel rendered image, the 2D cutting line probability map is re-predicted to iteratively update the 2D unfolded coordinates. This allows the 2D cutting line prediction model to understand the current problems in the 2D unfolding and perform targeted iterative updates, thereby improving the accuracy of the 2D unfolded coordinates.
[0297] like Figure 10 The diagram shown is a flowchart of the operation of the two-dimensional unfolding device 100.
[0298] After inputting the 3D mesh model, the sampling module 101 collects multi-channel rendered images of multiple sampling points and corresponding camera parameters. These multi-channel rendered images are then input into the 2D cutting line probability map prediction module 102, which predicts the 2D cutting line probability map. The back-projection module 103 back-projects the 2D cutting line probability map back onto the surface of the 3D mesh model, obtaining a set of cutting lines. The cutting line optimization module 104 performs topology repair on the cutting line set. The 2D unfolding module 105 determines the 2D unfolded coordinates corresponding to the 3D mesh model. Finally, the quality verification module 106 verifies the overall quality score of the 2D unfolded coordinates. If the overall quality score is greater than a preset overall quality score threshold, the result is directly output. If the overall quality score is less than the threshold, a distortion heatmap is generated and returned as an additional channel to the 2D cutting line prediction model 102 for iterative updates until the overall quality score exceeds the preset overall quality score threshold.
[0299] Thirdly, embodiments of this application provide an electronic device, which can be a terminal, such as a smartphone, tablet computer, laptop computer, touch screen, game console, personal computer (PC), personal digital assistant (PDA), or other terminal device. Alternatively, the electronic device can be a server.
[0300] like Figure 11 As shown, Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 200 includes a processor 201 with one or more processing cores, a memory 202 with one or more computer-readable storage media, and a computer program stored in the memory 202 and executable on the processor. The processor 201 and the memory 202 are electrically connected. Those skilled in the art will understand that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0301] The processor 201 is the control center of the electronic device 200. It connects various parts of the electronic device 200 via various interfaces and lines. By running or loading software programs and / or units stored in the memory 202, and by calling data stored in the memory 202, it executes various functions of the electronic device 200 and processes data, thereby providing overall monitoring of the electronic device 200. The processor 201 can be a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc., and can implement or execute the methods, steps, and logic diagrams disclosed in the embodiments of this application.
[0302] In this embodiment, the processor 201 in the electronic device 200 loads the instructions corresponding to the processes of one or more applications into the memory 202 according to the following steps, and the processor 201 runs the applications stored in the memory 202 to realize various functions, such as: Acquire multi-channel rendered images and camera parameters of multiple sampling points of a 3D mesh model; Multiple two-dimensional cutting line probability maps are predicted based on multi-channel rendered images from multiple sampling points; A set of cutting lines is generated by back-projecting multiple 2D cutting line probability maps and camera parameters onto a 3D mesh model. The two-dimensional unfolded coordinates of the three-dimensional mesh model are determined based on the set of cutting lines.
[0303] This embodiment acquires multi-channel rendered images of multiple sampling points of a 3D mesh model, predicts multiple 2D cutting line probability maps, and then performs back projection to generate a set of cutting lines. This transforms the cutting line placement problem of the 3D mesh model into a semantic segmentation problem in 2D space, making full use of the rendering visual information in the multi-channel rendered images to improve the quality of the cutting lines.
[0304] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0305] Optional, such as Figure 4 As shown, the electronic device 200 also includes: a touch display screen 203, a radio frequency circuit 204, an audio circuit 205, an input unit 206, and a power supply 507. The processor 201 is electrically connected to the touch display screen 203, the radio frequency circuit 204, the audio circuit 205, the input unit 206, and the power supply 507. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0306] The touch display screen 203 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 203 may include a display panel and a touch panel. The display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, video, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), organic light-emitting diode (OLED), or other similar technologies. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include a touch retrieval device and a touch controller. The touch retrieval device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch retrieval device, converts it into touch point coordinates, and sends it to the processor 201. It can also receive and execute commands from the processor 201. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 201 to determine the type of touch event. Subsequently, the processor 201 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 203 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 203 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 203 can also be used as part of the input unit 206 to achieve input functions.
[0307] The radio frequency circuit 204 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other electronic devices, and to transmit and receive signals with network devices or other electronic devices.
[0308] Audio circuitry 205 can be used to provide an audio interface between a user and an electronic device via a speaker and microphone. Audio circuitry 205 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 205, converted back into audio data, and then processed by processor 201 before being transmitted via radio frequency circuitry 204 to, for example, another electronic device, or output to memory 202 for further processing. Audio circuitry 205 may also include an earphone jack to facilitate communication between peripheral headphones and electronic devices.
[0309] The input unit 206 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
[0310] Power supply 507 is used to supply power to various components of electronic device 200. Optionally, power supply 507 can be logically connected to processor 201 through power supply 507 management system, thereby enabling functions such as charging, discharging, and power consumption management through power supply 507 management system. Power supply 507 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0311] although Figure 11 As not shown in the diagram, the electronic device 200 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.
[0312] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0313] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0314] Therefore, embodiments of this application provide a computer-readable storage medium storing multiple computer programs that can be loaded by a processor to execute any of the two-dimensional unfolding methods for a three-dimensional mesh model provided in this application. The computer program can execute the steps of a two-dimensional unfolding method for a three-dimensional mesh model as follows: Acquire multi-channel rendered images and camera parameters of multiple sampling points of a 3D mesh model; Multiple two-dimensional cutting line probability maps are predicted based on multi-channel rendered images from multiple sampling points; A set of cutting lines is generated by back-projecting multiple 2D cutting line probability maps and camera parameters onto a 3D mesh model. The two-dimensional unfolded coordinates of the three-dimensional mesh model are determined based on the set of cutting lines.
[0315] This embodiment acquires multi-channel rendered images of multiple sampling points of a 3D mesh model, predicts multiple 2D cutting line probability maps, and then performs back projection to generate a set of cutting lines. This transforms the cutting line placement problem of the 3D mesh model into a semantic segmentation problem in 2D space, making full use of the rendering visual information in the multi-channel rendered images to improve the quality of the cutting lines.
[0316] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0317] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0318] Since the computer program stored in the computer-readable storage medium can execute any of the two-dimensional unfolding methods of the three-dimensional mesh model provided in the embodiments of this application, the beneficial effects that the two-dimensional unfolding methods of the three-dimensional mesh model provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0319] According to one aspect of this application, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the methods provided in the various optional implementations of the above embodiments.
[0320] In the above embodiments of a two-dimensional unfolding device, computer-readable storage medium, electronic device, and computer program product for a three-dimensional mesh model, the descriptions of each embodiment have different focuses. For parts not described in detail in a particular embodiment, please refer to the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process and beneficial effects of the two-dimensional unfolding device, computer-readable storage medium, computer program product, electronic device, and their corresponding units described above can be referred to the description of a two-dimensional unfolding method for a three-dimensional mesh model in the above embodiments, and will not be repeated here.
[0321] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0322] The foregoing has provided a detailed description of a two-dimensional unfolding method, apparatus, device, and medium for a three-dimensional mesh model provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A two-dimensional unfolding method for a three-dimensional mesh model, characterized in that, The two-dimensional unfolding method includes the following steps: Acquire multi-channel rendered images and camera parameters of multiple sampling points of a 3D mesh model; Multiple two-dimensional cutting line probability maps are predicted based on the multi-channel rendered images of multiple sampling points; A set of cutting lines is generated by back-projecting multiple two-dimensional cutting line probability maps and camera parameters into the three-dimensional mesh model. The two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model are determined based on the set of cutting lines.
2. The two-dimensional unfolding method according to claim 1, characterized in that, Obtain multi-channel rendered images and camera parameters of multiple sampling points of the 3D mesh model, including: The positions of multiple sampling points are determined based on the three-dimensional mesh model, and the camera parameters for each sampling point are determined accordingly. At each sampling point, a multi-channel rendered image of the three-dimensional mesh model is acquired. The multi-channel rendered image includes multi-channel information, which includes at least two of the following: a planar shading image, a mesh edge overlay image, a depth buffer image, a surface curvature image, and a triangular face ID image.
3. The two-dimensional unfolding method according to claim 2, characterized in that, After acquiring a multi-channel rendered image of the 3D mesh model at each sampling point, the process further includes: The triangular face coverage of the 3D mesh model is determined based on the multi-channel rendered image; If the coverage of the triangle is greater than a preset coverage threshold, output the multi-channel rendered image and camera parameters of the plurality of sampling points; If the coverage of the triangle is less than the preset coverage threshold, the number of sampling points is increased, the camera parameters of each sampling point are redefined, and a multi-channel rendered image of the 3D mesh model is acquired at each sampling point.
4. The two-dimensional unfolding method according to claim 2, characterized in that, Multiple two-dimensional cutting line probability maps are predicted based on the multi-channel rendered images of multiple sampling points, including: Based on the multi-channel rendered image of multiple sampling points, the corresponding two-dimensional cutting line probability map is predicted using a two-dimensional cutting line prediction network model. The two-dimensional cutting line prediction model includes an encoder, a bottleneck layer, a decoder, and an output head; The encoder is used to extract feature maps of multiple different scales from the multi-channel rendered image; The bottleneck layer is used to apply multi-head self-attention to cross-view information exchange in the feature map at the lowest scale, thereby generating enhanced bottleneck features. The decoder is used to upsample the feature maps at multiple different scales; The output head is used to map the feature map into the two-dimensional cutting line probability map through convolution and activation functions.
5. The two-dimensional unfolding method according to claim 4, characterized in that, Multi-head self-attention is applied to the lowest-scale feature map for cross-view information exchange, generating enhanced bottleneck features, including: The feature coordinates of the feature maps of the other sampling points are back-projected to the three-dimensional space through camera parameters, and then reprojected onto the feature map of one of the sampling points to obtain the corresponding pixel coordinates. The visibility weight is determined based on the similarity between the pixel coordinates and the corresponding feature coordinates in the feature map of one of the sampling points; The pixel coordinates are aggregated based on the visibility weights and fused with the feature map of one of the sampling points to generate an enhanced bottleneck feature.
6. The two-dimensional unfolding method according to claim 1, characterized in that, The two-dimensional cutting line probability map includes multiple pixels that are predicted to be cutting lines; Based on the multiple two-dimensional cutting line probability maps and the camera parameters, a cutting line set is generated by back-projection into the three-dimensional mesh model, including: Based on ray casting, the pixels predicted as cutting lines in the multiple two-dimensional cutting line probability maps are mapped back to the mesh surface of the three-dimensional mesh model, and the coordinate set of the pixels on the mesh surface and the triangular face where each pixel is located are determined. Determine the coordinates of each pixel in the coordinate set and the nearest grid edge in the triangle face where the pixel is located to obtain a candidate cutting edge set; The set of cutting lines is generated by weighted voting and fusion of the candidate cutting edge set.
7. The two-dimensional unfolding method according to claim 6, characterized in that, The set of cutting lines is generated by weighted voting fusion based on the candidate cutting edge set, including: The sampling point quality weight is determined based on the normal vector of the face containing each candidate cutting edge in the candidate cutting edge set and the camera parameters; the confidence score of each candidate cutting edge is determined based on the sampling point view quality weight; the sampling point view quality weight is obtained based on the average normal vector of the face containing the candidate cutting edge, the sampling direction of the sampling point, and the distance from the sampling point to the candidate cutting edge; Candidate cutting edges whose confidence scores are greater than a preset confidence threshold are selected as the cutting line set.
8. The two-dimensional unfolding method according to claim 1, characterized in that, Before determining the two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines, the two-dimensional unfolding method further includes: Determine the validity status of the set of cutting lines; If the validity status of the cut line set indicates that the validity constraint is not met, topology repair is performed on the cut line set to make the validity status of the cut line set meet the validity constraint.
9. The two-dimensional unfolding method according to claim 8, characterized in that, Topology repair of the cut line set includes: Perform connected component analysis on the cut line set to remove noisy cut lines from the cut line set; If the set of cutting lines is not connected, the cost of each edge in the 3D mesh model is determined based on the set of cutting lines. The minimum cost path that connects the set of cutting lines and minimizes the sum of the costs of all edges is searched in the 3D mesh model. The edges on the minimum cost path are added to the set of cutting lines to make the set of cutting lines connected. If there are connected components in the set of cut lines with an Euler characteristic of not 1, find the shortest non-contractable cycle in the connected components and add the edge of the shortest non-contractable cycle to the set of cut lines so that the Euler characteristic of all the connected components in the set of cut lines is 1. Redundant edges are removed from the set of cutting lines to obtain the topology-repaired set of cutting lines.
10. The two-dimensional unfolding method according to claim 1, characterized in that, Determining the two-dimensional unfolded coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines includes: The cutting lines are used to cut the three-dimensional mesh model to generate multiple cutting meshes, each of which is composed of multiple connected components. Each of the connected components is mapped to a two-dimensional parameter domain to generate a set of two-dimensional mesh coordinates of all vertices in the connected component in the two-dimensional parameter domain. Arrange the two-dimensional mesh coordinates of all the connected components in the texture space to generate two-dimensional unfolded coordinates in the texture space; Calculate the distortion metric of the two-dimensional unfolded coordinates to assess the quality of the two-dimensional unfolded coordinates and generate a quality metric report.
11. The two-dimensional unfolding method according to claim 1, characterized in that, The two-dimensional unfolding method further includes: Calculate the overall quality score of the two-dimensional unfolded coordinates; When the overall quality score of the two-dimensional unfolded coordinates is less than the overall quality score threshold, a two-dimensional distortion heatmap is generated. The two-dimensional distortion heatmap is used as an additional input channel in the multi-channel rendered image to re-predict the two-dimensional cutting line probability map, thereby iteratively updating the two-dimensional unfolded coordinates.
12. A two-dimensional unfolding device for a three-dimensional mesh model, characterized in that, The two-dimensional unfolding device includes: The sampling module is used to acquire multi-channel rendered images and camera parameters from multiple sampling points of the 3D mesh model; The two-dimensional cutting line probability map prediction module is used to predict multiple two-dimensional cutting line probability maps based on the multi-channel rendered image of multiple sampling points; The back projection module is used to back project the data into the three-dimensional mesh model based on the multiple two-dimensional cutting line probability maps and the camera parameters to generate a cutting line set. The two-dimensional unfolding module is used to determine the two-dimensional unfolding coordinates corresponding to the three-dimensional mesh model based on the set of cutting lines.
13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing multiple instructions; the processor loads instructions from the memory to perform the steps of the two-dimensional unfolding method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the two-dimensional unfolding method as described in any one of claims 1 to 11.
