Processing method of three-dimensional grid model, computer equipment, readable storage medium and program product
By voxelizing the 3D mesh model and selecting target voxels, the problem that mesh models cannot be directly used for deep learning is solved, and the accuracy of 3D model generation is improved.
Patent Information
- Application Number
- CN202511480169.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-30
AI Technical Summary
In existing technologies, 3D mesh models cannot be directly used for training deep learning networks, and traditional methods of projecting meshes onto 2D images for optimization result in the loss of 3D structural information, leading to low accuracy in 3D model generation.
By voxelizing the 3D mesh model of the target object, determining the visibility value and positional relationship label of the voxels, filtering out the target voxels, and determining the model representation parameters based on the spatial information of the target voxels, the generation accuracy of the 3D model is improved.
By transforming meshes that cannot be directly used for training deep learning networks into structured voxels, meaningless invisible voxels are accurately identified, and useless internal structures are removed, thereby improving the generation accuracy and geometric quality of 3D models.
Smart Images

Figure CN121437801A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of three-dimensional modeling, in particular to a three-dimensional mesh model processing method, a computer device, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the rapid development of information technology, three-dimensional object (3D object) generation technology has been widely used in virtual reality, augmented reality, game development, special effects and product design. Traditional 3D modeling methods usually rely on professional software and manual operation, which is time-consuming, laborious and costly.
[0003] With the progress of deep learning technology, automatic or semi-automatic 3D object model generation methods have gradually become a research hotspot, especially the technology based on image to 3D model conversion, which can recover the three-dimensional structure of the object from a single or multiple perspective images. However, the main form of 3D model is mesh, and the form of mesh cannot be directly used for deep learning network training, therefore, it is necessary to vectorize the mesh, both to ensure that the features after vectorization can be used for network training, and to minimize the accuracy loss when restoring the original mesh from the feature vector. With the development of large model structure and the growth of three-dimensional data to millions, the demand for "direct representation of mesh" by large models is increasingly urgent. If the mesh can be directly converted into features that can be used for large model training, the geometric quality and details of the three-dimensional model generated by the large model can be significantly improved.
[0004] In traditional technology, three-dimensional generation methods can be through normal map or depth map to directly perform differentiable optimization of mesh, such as rendering and projecting mesh to two-dimensional image, and combining various image generation algorithms to generate three-dimensional, however, this method will cause loss of three-dimensional structure information when projecting mesh to two-dimensional image for optimization, resulting in low generation accuracy of three-dimensional model. SUMMARY
[0005] Therefore, it is necessary to provide a three-dimensional mesh model processing method, device, computer equipment, computer readable storage medium and computer program product capable of improving the generation accuracy of three-dimensional model to solve the above technical problems.
[0006] In a first aspect, the present application provides a three-dimensional mesh model processing method, comprising:
[0007] Voxelizing the three-dimensional mesh model of the target object to obtain a plurality of voxels corresponding to the target object in a preset reference space;
[0008] According to the projection information of the voxels under the preset camera perspective, determining the visibility value of the voxels;
[0009] Based on the connectivity between the voxel and the reference point in the preset reference space, determine the positional relationship label of the voxel relative to the reference point;
[0010] Based on the visibility value and positional relationship label of the voxels, the target voxels are selected from each voxel;
[0011] Based on the spatial information of the target voxel in the three-dimensional mesh model, the model representation parameters of the three-dimensional mesh model are determined.
[0012] In one embodiment, the voxelization of the three-dimensional mesh model of the target object to obtain multiple voxels corresponding to the target object in a preset reference space includes:
[0013] The three-dimensional mesh model of the target object is voxelized to obtain the original voxel structure of the target object in the preset reference space; the original voxel structure includes multiple original voxels.
[0014] A morphological closing operation is performed on the original voxel structure to obtain a closed voxel structure; the closed voxel structure includes the original voxel and new voxels filled by the morphological closing operation.
[0015] Based on the difference in the number of voxels between the voxel structure after the closing operation and the original voxel structure, a target voxel structure is determined from the voxel structure after the closing operation and the original voxel structure, and multiple voxels corresponding to the target voxel structure are obtained in the preset reference space.
[0016] In one embodiment, the preset reference space is a cubic space, and the reference point includes the vertex of the cubic space; determining the positional relationship label of the voxel relative to the reference point based on the connectivity between the voxel and the reference point in the preset reference space includes:
[0017] Determine a first spatial point that starts from the vertex of the cube space and slides in an orthogonal direction. If the first spatial point intersects with a voxel during the sliding process, then the positional relationship label of the intersecting voxel is determined as an external voxel.
[0018] Determine a second spatial point that starts from the interior of any voxel and slides in orthogonal directions. If the second spatial point can contact other voxels during the sliding process in each set of orthogonal directions, then the positional relationship label of any voxel is determined as the middle voxel.
[0019] The positional relationship labels of the voxels other than the outer voxel and the middle voxel among the plurality of voxels are determined as the inner voxels.
[0020] In one embodiment, determining the visibility value of the voxel based on its projection information under a preset camera view includes:
[0021] Based on the projection coordinates and projection depth of the voxel under the preset camera view, determine the relative depth of the voxel relative to the surface of the three-dimensional mesh model under the preset camera view;
[0022] The visibility value of the voxel is determined based on the minimum relative depth of the voxel under each preset camera viewpoint.
[0023] In one embodiment, determining the model representation parameters of the three-dimensional mesh model based on the spatial information of the target voxel in the three-dimensional mesh model includes:
[0024] Based on the nearest distance between the vertex of the target voxel and the surface of the 3D mesh model, determine the undirected distance field and the directed distance field of the vertex;
[0025] The displacement vector of the vertex is determined based on the gradient of the undirected distance field of the vertex; the displacement vector is used to characterize the vector by which the vertex is displaced to the surface of the three-dimensional mesh model.
[0026] The model representation parameters of the three-dimensional mesh model are determined based on the undirected distance field, the directed distance field, and the displacement vector.
[0027] In one embodiment, after determining the model representation parameters of the three-dimensional mesh model based on the spatial information of the target voxel in the three-dimensional mesh model, the method further includes:
[0028] Based on the model representation parameters, construct the reconstruction model corresponding to the three-dimensional mesh model;
[0029] The loss is calculated based on the difference between the projected feature maps corresponding to the restored model and the three-dimensional mesh model, and the model representation parameters are optimized based on the loss to obtain the optimized parameters.
[0030] In one embodiment, the projection feature map includes a normal map and a depth map obtained by projecting the reconstructed model and the 3D mesh model onto the camera, respectively; the step of calculating the loss based on the difference between the projection feature maps corresponding to the reconstructed model and the 3D mesh model includes:
[0031] The loss is calculated based on the differences between the normal maps corresponding to the restored model and the 3D mesh model, the differences between the depth maps, and the effective computational region.
[0032] Specifically, for the outermost region of the restored model and the 3D mesh model, the effective calculation region is the image region that the camera can capture; for the second outermost region relative to the outermost region, the effective calculation region is the region in the second outermost region where the difference in projection depth under the camera is less than a depth threshold.
[0033] Secondly, this application also provides a three-dimensional mesh model processing apparatus, comprising:
[0034] The voxel module is used to voxelize the three-dimensional mesh model of the target object to obtain multiple voxels corresponding to the target object in a preset reference space.
[0035] The projection module is used to determine the visibility value of the voxel based on the projection information of the voxel under the preset camera view.
[0036] The tag module is used to determine the positional relationship tag of the voxel relative to the reference point based on the connectivity relationship between the voxel and the reference point in the preset reference space.
[0037] The filtering module is used to filter out target voxels from the voxels based on their visibility values and positional relationship labels.
[0038] The characterization module is used to determine the model characterization parameters of the three-dimensional mesh model based on the spatial information of the target voxel in the three-dimensional mesh model.
[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0042] The aforementioned method, apparatus, computer equipment, computer-readable storage medium, and computer program product for processing 3D mesh models, by voxelizing the 3D mesh model of the target object, obtains multiple voxels corresponding to the target object within a preset reference space. This transforms mesh forms that cannot be directly used for deep learning network training into structured voxels. Next, based on voxel projection information from a preset camera viewpoint, visibility values are determined to accurately identify invisible voxels that are meaningless for representing the 3D model. Simultaneously, positional relationship labels are determined by combining the connectivity between voxels and reference points in the preset reference space, further clarifying the relative positional attributes of voxels in space. Target voxels can be accurately screened using visibility values and positional relationship labels, efficiently removing useless internal structures. Finally, model representation parameters are determined based on the spatial information of the target voxels. These model representation parameters can be used to directly train the generation of 3D models from large models, improving the geometric quality and detail of the generated 3D models, thereby increasing the accuracy of 3D model generation. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is an application environment diagram of a three-dimensional mesh model processing method in one embodiment;
[0045] Figure 2 This is a flowchart illustrating a method for processing a three-dimensional mesh model in one embodiment;
[0046] Figure 3 This is a schematic diagram of a normal map and an effective calculation region in one embodiment;
[0047] Figure 4 This is a logic diagram of a method for processing a three-dimensional mesh model in one embodiment;
[0048] Figure 5 This is a structural block diagram of a three-dimensional mesh model processing device in one embodiment;
[0049] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] In related technologies, the 3DShape2VecSet-based method samples a point cloud from a mesh, then combines the point cloud with a positional code and inputs it into a shape encoder to convert it into a latent space vector. This vector is then passed through a shape decoder to obtain the Sign Distance Field (SDF) based on the sampled positions in space, and finally, the mesh is reconstructed using Marching Cubes (MC). However, this method heavily relies on the point cloud sampling algorithm; the sampled point cloud must be sufficiently representative of the mesh's surface structure. The decoding process also depends on a large amount of point cloud sampling, and high-precision mesh generation relies on high-density SDF computation, resulting in high computational costs. Furthermore, the encoder and decoder of this algorithm are deep learning network structures that require training, necessitating a large amount of data to train the encoding network system, making it impossible to encode individual models. Since manually created 3D models may have numerous internal component structures, it is not conducive for 3D model generation algorithms to learn these invisible parts. The method based on 3DShape2VecSet also cannot avoid encoding these components into the feature vector.
[0052] Flexicube, as an efficient 3D model representation method, can be used for gradient backpropagation to optimize parameters. It optimizes parameters through differentiable rendering and other methods, representing a mesh as a parameter vector, from which the mesh can be extracted. However, this method, by parameterizing a mesh, represents the 3D space as N*N*N features and learns parameters through gradient backpropagation, allowing the final parameters to extract the shape of the original mesh. Typically, a network is used to predict 3D spatial features. However, due to its use of dense features and random parameter initialization, it cannot be applied to high-precision mesh representation tasks requiring millions of pixels in terms of memory and computation time.
[0053] TRELLIS extracts image features by combining RGB multi-view rendering of the mesh with a feature extractor. Therefore, it directly fuses (and averages) the mesh shape information from the 2D rendered image into sparse voxels, then converts it into a latent space vector using a feature encoder, and finally obtains the Flexicube parameters through a feature decoder network to reconstruct the mesh. The feature decoder requires extensive training. Another method directly fuses the rendered projection features of the 3D mesh into sparse voxels and then trains a decoder to obtain the Flexicube parameters, resulting in relatively low training costs. However, 3D model projection cannot fully represent the model's structure and is ineffective in cases where the mesh is invisible from external views or has significant occlusion.
[0054] The method for processing three-dimensional mesh models provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Terminal 102 voxels the 3D mesh model of the target object, obtaining multiple voxels corresponding to the target object within a preset reference space; terminal 102 determines the visibility value of the voxels based on their projection information from a preset camera viewpoint; terminal 102 determines the positional relationship label of the voxels relative to the reference points based on the connectivity between the voxels and the reference points in the preset reference space; based on the voxel visibility value and positional relationship label, target voxels are selected from the voxels; and based on the spatial information of the target voxels in the 3D mesh model, the model representation parameters of the 3D mesh model are determined. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0055] In one exemplary embodiment, such as Figure 2 As shown, a method for processing three-dimensional mesh models is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes:
[0056] Step S202: Voxelize the three-dimensional mesh model of the target object to obtain multiple voxels corresponding to the target object in the preset reference space.
[0057] The primary form of the 3D mesh model is the mesh itself, which cannot be directly used for training deep learning networks. 3D mesh models can be used to represent the 3D geometry of a target object. The target object can be any object, such as a vehicle or an airplane. Optionally, the 3D mesh model can be generated using the Flexicube 3D mesh generation technology.
[0058] Voxelization, which is the process of converting a continuous 3D mesh model into a discrete set of voxels, is a key operation for converting unstructured meshes into structured feature representations, providing a unified discrete spatial computing unit for the subsequent determination of positional relationship labels and visibility values.
[0059] The preset reference space can be a pre-defined standardized 3D space used to unify the spatial scale of 3D mesh models of different sizes and coordinate systems, providing a fixed spatial boundary for voxelization. Optionally, the preset reference space can be a unit cube.
[0060] A voxel is a basic unit used to represent an object or scene in three-dimensional space, similar to a pixel in a two-dimensional image. A voxel is a regular small cube unit in a three-dimensional mesh, usually with a fixed spatial resolution, and can contain attribute information such as density, color, and material. Each voxel indicates whether the spatial region is occupied by an object (binarized representation).
[0061] In practical applications, the resolution parameter Resolution(R) can be set. A larger R value represents more structural details, but also increases the number of parameters. The mesh in the 3D mesh model can be normalized to a unit cube, and then voxelized. Each voxel is 1 / R in size. The position of each voxel is represented by an XYZ integer, i.e., coord_cube, with each value ranging from [0, R-1]. If conversion to a [0, 1] floating-point representation is needed, it can be obtained by dividing coord_cube by R.
[0062] Step S204: Determine the visibility value of the voxel based on the projection information of the voxel under the preset camera view.
[0063] Among them, the preset camera viewpoint can be a set of pre-set camera positions surrounding the 3D mesh model of the target object. It can obtain the projection information of voxels from multiple angles, avoid the visibility judgment bias caused by a single viewpoint, and provide multi-dimensional data support for accurate calculation of voxel visibility by covering different observation angles of the target object.
[0064] The projection information can be a set of voxel-related information generated from a single preset camera viewpoint using rasterization technology. Specifically, it includes the projection depth map of the 3D mesh model from that viewpoint, the projection coordinates of the voxels on the 2D projection plane, and the relative depth of the voxels relative to the visible surface of the mesh model. Projection information is the core data for determining whether a voxel is within the visible region.
[0065] The visibility value can be a numerical value used to quantify the visibility of a voxel relative to the outermost surface of the mesh model. Optionally, the visibility value can be the minimum relative depth of the voxel under all preset camera views. For example, a positive visibility value indicates that the depth of the voxel is greater than the depth of the visible surface of the mesh model at any viewpoint, and its visibility is low; for example, it may belong to a useless structure inside the mesh. A negative visibility value indicates that the voxel is closer to the camera at least at some viewpoint and has some visibility.
[0066] In practical applications, meshes may contain numerous internal structures that are meaningless for 3D model generation and consume significant computational resources. Removing invisible structures at the mesh level is extremely difficult and easily damages the mesh surface. To accurately determine the model representation parameters of the 3D mesh model, the corresponding feature information can be directly removed by eliminating voxel points near the corresponding internal structures. Therefore, it is necessary to first calculate the visibility of each voxel point relative to the outermost surface of the mesh.
[0067] In the specific implementation, a set of surrounding cameras is preset, and rasterization is used to obtain the projected depth map of the Mesh from the perspective of a single camera. At the same time, the projected coordinates and projected depth of each voxel are calculated to obtain the relative depth D of each voxel relative to the visible surface of the Mesh from that perspective. i A value less than 0 indicates that the voxel is closer to the camera, meaning it is outside the camera. The final visibility value for each voxel is D = min(D1, D2, ..., D...). Nc The value Nc represents the number of voxels surrounding the camera. A positive voxel indicates that, from any viewpoint, the depth of that voxel relative to the camera is greater than the depth of the mesh relative to the camera. Such points have low visibility and are likely located inside the mesh, belonging to completely invisible voxels. Otherwise, they are located in highly occluded areas. It should be noted that highly occluded areas may be highly invisible areas, but they are not necessarily completely invisible voxels.
[0068] Step S206: Determine the positional relationship label of the voxel relative to the reference point based on the connectivity between the voxel and the reference point in the preset reference space.
[0069] In practical applications, the definition of the inner and outer spaces of any mesh in the dataset is unclear unless the mesh itself is watertight (i.e., its surface is free of holes), especially when the mesh surface structure is complex. The creation of 3D models typically differs from the creation process of real-world objects. For example, the surface of a 3D model can have arbitrary intersections, holes, and surfaces with no thickness, structures that do not exist in real objects. Therefore, this application does not directly force the mesh to be watertight to calculate whether the voxel position in space is inside or outside relative to the mesh surface. Instead, it directly calculates the inner and outer values of the extracted voxel points relative to themselves, thus avoiding the problem of unclear inner and outer labels caused by unpredictable structures of different meshes.
[0070] In this context, reference points in the preset reference space can be used as reference points to determine the positions of other voxel spaces. For example, a reference point can be a vertex in the preset reference space; assuming the preset reference space is a unit cube, then the reference points can be the eight vertices of the unit cube. Reference points can be used as external points to avoid confusion in the internal and external definitions caused by the Mesh's own structure (such as non-watertightness or holes).
[0071] The connectivity relationship refers to whether a voxel and a reference point can be connected through "space not occupied by voxels". Specifically, the connectivity relationship between a voxel and a reference point in a preset reference space can be determined by sliding a 3D point. The sliding rule for this 3D point is: starting from the reference point, without passing through 3D coordinates (coord_vert) already occupied by voxels, and moving through the spatial paths of six adjacent points (front, back, left, right, up, down), the voxels that intersect with the 3D point during the sliding process are identified as having a connectivity relationship with the reference point; otherwise, they are not connected.
[0072] The positional relationship label is used to mark the spatial attributes of a voxel relative to a reference point (external point) in a preset reference space. Positional relationship labels can also be called internal / external labels, and can include external voxels, middle voxels, and internal voxels. External voxels are voxels that are connected to the reference point; middle voxels are voxels that can contact other voxels in all six directions when a 3D point is slid within a voxel; internal voxels are the voxels remaining after excluding external and middle voxels.
[0073] In practical applications, assuming the preset reference space is a cube space, and the reference points are the eight vertices of the cube space, then assuming the coordinates of all eight vertices of the cube space are defined as the exterior, by sliding a 3D point from the exterior, this 3D point cannot pass through the 3D coordinates (coord_vert) already occupied by voxels. The six adjacent points of this 3D point (front, back, left, right, up, down) can be used as symbols for identification. During the sliding process, the points that intersect with voxels can be defined as exterior voxels, and the points connected to the regions of the eight vertices are exterior points. Then, the definition of the middle voxel is similar: a point that slides within a voxel and touches the voxel in all six directions is defined as the middle point. After determining the exterior and middle voxels, the remaining voxels are the interior voxels.
[0074] Step S208: Select the target voxel from each voxel based on the voxel's visibility value and positional relationship label.
[0075] In the specific implementation, based on the voxel's visibility value and positional relationship label, voxels with a positional relationship label of "inner voxel" and a negative visibility value can be deleted. Then, voxels with a positional relationship label of "outer voxel" but a negative visibility value are retained as target voxels, because such voxels can only belong to highly invisible areas, not completely invisible inner voxels.
[0076] The target voxels may include a set of voxels that are retained after being filtered by both visibility value and positional relationship label, including voxels that remove redundant structures inside the mesh and contain only external effective regions, surface transition regions and highly occluded key regions.
[0077] Step S210: Determine the model representation parameters of the three-dimensional mesh model based on the spatial information of the target voxel in the three-dimensional mesh model.
[0078] The spatial information of the target voxel in the 3D mesh model can be the geometric attribute data of the target voxel in 3D space related to the original mesh model, including the spatial coordinates of the target voxel vertex (in the same coordinate system as the original 3D mesh model), the distance from the target voxel vertex to the surface of the original mesh and the distance gradient (used to quantify the spatial position association between the vertex and the mesh).
[0079] The model representation parameters may include a sparse parameter set that can accurately represent the geometric features of the 3D mesh model and can be directly used for training large deep learning models. For example, the model representation parameters may include the vertex coordinates, vertex displacement vectors, and vertex symbolic distance values of voxels. Specifically, the voxel vertex coordinates (coord_vert), with dimensions [N,3], where N is the number of vertices in the target voxel, record the position of the vertex in 3D space; the vertex displacement vector (v_deform), with dimensions [N,3], records the direction and magnitude of the displacement of the vertex towards the mesh surface, used to improve representation accuracy; and the vertex symbolic distance value (v_sdf), with dimensions [N,1], records the directed distance field from the vertex to the mesh surface, with positive values indicating the vertex is outside the mesh and negative values indicating it is inside, reflecting the spatial relationship between the vertex and the mesh.
[0080] In practical applications, assuming the 3D mesh model is generated using the Flexicube 3D mesh generation technology, directly using the random initialization parameters of Flexicube as the model representation parameters for the 3D mesh model and then proceeding with subsequent parameter optimization would be extremely time-consuming. Therefore, a more precise parameter initialization can be obtained through direct computation and used as the model representation parameters. Specifically, a simplified Flexicube sparse representation can be used, utilizing only the vertex displacement vector parameter v_deform (dimension [N,3]) and the signed distance value v_sdf (dimension [N,1]). The SDF vector typically reflects the distance (not the actual distance) from a discrete location in space to the surface of the 3D mesh model, where positive values represent the outside of the 3D mesh model and negative values represent the inside of the 3D mesh model. Furthermore, since a sparse representation is used, the coordinates of each sparse point are discretized to represent the xyz coordinates of the voxel in space as coord_cube, where each value represents the position of the bottom-left vertex of a cube. Since the parameters of Flexicube are based on the positions of the eight vertices of the cube, the vertex coordinates of coord_cub can be calculated to represent coord_vert. The following explanation will focus solely on coord_vert. Each vertex (vert) stores a 3D spatial displacement from that vertex to the mesh and its SDF value. Therefore, assuming the dimension of coord_vert after extraction from the 3D mesh model is [N, 3], the dimension of its trainable parameters is [N, 4], and the coordinates of the vertex to which the parameters belong are coord_vert. coord_vert, v_deform, and v_sdf constitute a set of Flexicube sparse feature vector parameters for the 3D mesh model, i.e., model representation parameters. This set of parameters can reconstruct the shape of the 3D mesh model and ensure a small reconstruction error. Furthermore, by sparsifying the representation parameters using coord_vert, v_deform, and v_sdf, high-precision predicted parameters can be obtained, greatly reducing the number of iterations for optimizing model representation parameters. This can be used to process the data required for training massive 3D models.
[0081] In the above-mentioned method for processing 3D mesh models, voxelization is performed on the 3D mesh model of the target object to obtain multiple voxels corresponding to the target object in a preset reference space. This transforms the mesh form, which cannot be directly used for training deep learning networks, into structured voxels. Then, based on the voxel projection information under the preset camera view, the visibility value is determined, which can accurately identify invisible voxels that are meaningless to the 3D model representation. At the same time, the positional relationship label is determined by combining the connectivity relationship between the voxel and the reference point of the preset reference space, further clarifying the relative positional attributes of the voxel in space. The target voxels can be accurately screened through the visibility value and positional relationship label, and useless internal structures can be efficiently removed. Finally, the model representation parameters are determined based on the spatial information of the target voxels. These model representation parameters can be used to directly train the generation of 3D models from large models, improving the geometric quality and detail of the generated 3D models, thereby improving the generation accuracy of the 3D models.
[0082] In another embodiment, the three-dimensional mesh model of the target object is voxelized to obtain multiple voxels corresponding to the target object in a preset reference space. This includes: voxelizing the three-dimensional mesh model of the target object to obtain the original voxel structure of the target object in the preset reference space; the original voxel structure includes multiple original voxels; performing a morphological closing operation on the original voxel structure to obtain a voxel structure after closing; the voxel structure after closing includes the original voxels and new voxels filled by the morphological closing operation; determining the target voxel structure from the voxel structure after closing and the original voxel structure based on the difference in the number of voxels between the voxel structure after closing and the original voxel structure, thereby obtaining multiple voxels corresponding to the target voxel structure in the preset reference space.
[0083] In practical applications, many surfaces in 3D mesh models are not intentionally closed during the fabrication process, especially in visually blind areas where numerous small, unclosed regions remain. Since generated models generally require a watertight state, it's difficult to directly fill such voids at the 3D mesh model level. A watertight mesh, in computer graphics and 3D modeling, is a mesh model without any holes or gaps. Such a model is like a completely waterproof container, hence the term "watertight." Having a watertight mesh is crucial for certain types of simulations (e.g., fluid dynamics) or 3D printing. Therefore, hole-filling operations can be performed directly at the 3D mesh model level, preventing small voids from causing the initial voxels to be non-watertight. Morphological closing operations can be used for voxels, assigning a space of 1 to the voxel's occupied space and 0 to unoccupied spaces. Since closing operations not only fill small holes in the voxel structure but also fill surface irregularities, a check is needed to cancel the closing operation if it fails to fill the voids.
[0084] The original voxel structure is the set of voxels obtained by directly voxelizing the three-dimensional mesh model.
[0085] The morphological closing operation is a three-dimensional morphological operation, which includes expansion followed by erosion. It is used to fill small holes in voxel structures and connect broken voxel regions, making the voxel distribution more complete. Expansion expands the area occupied by voxels, filling gaps or holes around them; erosion shrinks the expanded area, restoring a structure close to its original shape but with internal holes filled.
[0086] In the specific implementation, a morphological closing operation is performed on the original voxel structure. The resulting voxel structure includes the original voxel and a new voxel. The new voxel is a voxel filled by the morphological closing operation and is used to repair holes or breaks.
[0087] In practice, the rationality of the morphological closing operation can be judged based on the difference in the number of voxels between the voxel structure after the closing operation and the original voxel structure. This difference in the total number of voxels between the voxel structure after the closing operation and the original voxel structure can then be used to select the final set of voxels from the original or the voxel structure after the closing operation based on the difference in the number of voxels.
[0088] In one embodiment, the number N of external voxels can be determined based on the voxel positional labels. out Then, a morphological closing operation is performed on the original voxel structure to obtain the closed voxel structure; the number N of external voxels is calculated from the closed voxel structure. out The difference in the number of voxels between the voxel structure after the closing operation and the original voxel structure can be expressed as N. out 'with N out The ratio between them. If N out 'with N out If the ratio between the values is less than the threshold, it means that the closing operation can fill the holes in the voxel, allowing the internal region to be completely separated, and the voxel structure can be updated to the voxel structure after the closing operation; otherwise, it means that the closing operation did not separate the internal region by filling the holes, or that it does not have an internal region, and the original voxel structure should be used. Optionally, assuming the threshold is 0.3, if N out ' / N out If the value is less than 0.3, it means that the morphological closing operation reduced the external space by 30%. This threshold can be determined based on empirical values.
[0089] The technical solution of this embodiment repairs the voxel structure through morphological closing operations, and selects target voxels by combining quantity differences. It utilizes voxel connectivity region calculation, visibility analysis, and voxel layer hole filling operations to avoid the fact that the structure of the 3D mesh model cannot guarantee watertightness and is difficult to convert. It also avoids meaningless parameter calculations caused by useless internal structures, and provides a more reliable voxel basis for subsequent feature extraction or model representation of the 3D mesh.
[0090] In another embodiment, the preset reference space is a cubic space, and the reference points include the vertices of the cubic space. Based on the connectivity between the voxels and the reference points in the preset reference space, the positional relationship labels of the voxels relative to the reference points are determined, including: determining a first spatial point that starts from a vertex of the cubic space and slides in orthogonal directions; if the first spatial point intersects with a voxel during the sliding process, the positional relationship label of the intersecting voxel is determined as an external voxel; determining a second spatial point that starts from the interior of any voxel and slides in orthogonal directions; if the second spatial point can contact other voxels during the sliding process in each set of orthogonal directions, the positional relationship label of any voxel is determined as a middle voxel; and determining the positional relationship labels of the voxels other than the external and middle voxels among the multiple voxels as internal voxels.
[0091] The cube space can be a pre-defined standardized three-dimensional reference space in the form of a cube. The eight vertices of the cube can be used as a pre-defined reference starting point for the outside to determine whether the voxel is connected to the outside space.
[0092] Among them, the orthogonal direction can include the positive and negative directions along the x, y, and z coordinate axes in three-dimensional space (a total of 6 directions: front and back, left and right, up and down), ensuring the regularity and consistency of the sliding direction of spatial points.
[0093] The first spatial point can be a virtual point that slides along an orthogonal direction from any vertex (reference point) in the cubic space, used to detect whether a voxel has a connected path to an external reference point. An external voxel is a voxel that intersects with the first spatial point during the sliding process, indicating that the voxel can be reached through the sliding path of the external reference point and belongs to the external accessible region.
[0094] The second spatial point can be a virtual point that originates from the interior of a voxel and slides along orthogonal directions, used to detect the distribution of voxels in all directions around the voxel. A middle voxel is a voxel that, when the second spatial point originates from its interior and slides along all orthogonal directions, can contact other voxels, indicating that it is in an intermediate transition region surrounded by voxels in all directions. An inner voxel is neither an outer nor a middle voxel, indicating that it has no connected path to the external reference point and is not in an intermediate transition region, belonging to the inner region.
[0095] In the specific implementation, assuming that the coordinates of all 8 vertices of the entire cube space are defined as the exterior, then by sliding a spatial point from the exterior, which cannot pass through the 3D coordinates (coord_vert) already occupied by voxels, and this spatial point slides along orthogonal directions (front, back, left, right, up, and down), any voxels it intersects with during the sliding process are defined as exterior voxels, and points connected to the regions of the 8 vertices are exterior points. Then, for each voxel, starting from its interior position, if a spatial point can touch other voxels while sliding along all orthogonal directions, similarly, a voxel that slides within a voxel and touches voxels in all 6 directions can be identified as a middle voxel. Among all voxels, those already marked as exterior or middle voxels are excluded, and the remaining voxels are interior voxels.
[0096] The technical solution of this application embodiment can accurately label the positional relationship of voxels by orthogonally sliding from the vertices of the cube to detect the outer voxels and orthogonally sliding from the inside of the voxels to detect the middle voxels. This avoids misjudgment of positional relationship caused by problems such as non-watertight mesh, improves the reliability of spatial attribute classification of voxels, and provides an accurate basis for subsequent screening of target voxels. It also facilitates the removal of invalid internal voxels and improves the generation accuracy and efficiency of model representation parameters.
[0097] In another embodiment, determining the visibility value of a voxel based on its projection information under a preset camera view includes: determining the relative depth of the voxel relative to the surface of the 3D mesh model under the preset camera view based on the voxel's projection coordinates and projection depth under the preset camera view; and determining the visibility value of the voxel based on the minimum value of the relative depth of the voxel under each preset camera view.
[0098] In the specific implementation, a set of pre-set surround cameras is used to obtain the projection depth map of the 3D mesh model from the perspective of a single pre-set camera using rasterization. At the same time, the projection coordinates and projection depth of each voxel are calculated to obtain the relative depth D of each voxel relative to the visible surface of the 3D mesh model from the perspective of that pre-set camera. i Wherein, the projection coordinates are the coordinates of the voxel projected from three-dimensional space onto the camera's two-dimensional imaging plane; the projection depth is the three-dimensional spatial distance of the voxel along the camera's optical axis to the camera lens.
[0099] If the relative depth D of the voxel relative to the surface of the 3D mesh model under the preset camera viewpoint i A value less than 0 indicates that, from the preset camera viewpoint, the voxel is closer to the camera than the surface of the 3D mesh model and is in an unobstructed state; if the voxel's relative depth D relative to the surface of the 3D mesh model from the preset camera viewpoint is less than 0, it means that the voxel is closer to the camera than the surface of the 3D mesh model and is in an unobstructed state. iA value greater than 0 indicates that the voxel is occluded by the surface of the 3D mesh model under the preset camera viewpoint. The final visibility value for each voxel is D = min(D1, D2, ..., D...). Nc ), representing the minimum relative depth of a voxel under each preset camera viewpoint; where Nc represents the number of cameras surrounding it, and D i This represents the relative depth from any preset camera viewpoint. If the visibility value is positive, it means that from any preset camera viewpoint, the depth of the voxel relative to the camera is greater than the depth of the 3D mesh model surface relative to the camera. Such voxels have very low visibility and are likely located inside the 3D mesh model, i.e., in a completely invisible area. If the visibility value is negative, it indicates that the voxel has high visibility and may be located in an unobstructed area or a highly occluded area.
[0100] The technical solution of this application embodiment obtains relative depth through multiple sets of preset camera viewpoints, solving the problem of visibility misjudgment caused by occlusion under a single viewpoint; and takes the minimum value of the relative depth of each viewpoint as the visibility value. As long as the voxel is not occluded under any viewpoint, it can be retained. It can accurately identify and retain effective voxels that are highly occluded but not completely invisible, while removing internal redundant voxels that are occluded from all viewpoints, thus improving the efficiency and accuracy of subsequent target voxel screening.
[0101] In another embodiment, the model representation parameters of the three-dimensional mesh model are determined based on the spatial information of the target voxel in the three-dimensional mesh model, including: determining the undirected distance field and directed distance field of the vertex based on the nearest distance of the vertex of the target voxel relative to the surface of the three-dimensional mesh model; determining the displacement vector of the vertex based on the gradient of the undirected distance field of the vertex; the displacement vector is used to represent the vector by which the vertex is displaced to the surface of the three-dimensional mesh model; and determining the model representation parameters of the three-dimensional mesh model based on the undirected distance field, the directed distance field and the displacement vector.
[0102] The directed distance field (SDF) is composed of the shortest directed distances from points in space to the surface of an object. Typically, the distance from a point inside the object to the surface is positive, and the distance from a point outside the object to the surface is negative. The unsigned distance field (UDF) is the absolute value of the directed distance field.
[0103] For example, the eight vertices of each voxel are converted into spatial coordinates, which are located in the same coordinate system as the 3D mesh model. The unsigned distance field (UDF) v_udf is calculated by finding the nearest distance from each point to the surface of the 3D mesh model. The gradient of the UDF value of each vertex is the vector of displacement of that point to the mesh surface.
[0104] If the 3D mesh model is built using the Flexicube technique, the displacement vectors in Flexicube are used to improve representation accuracy, not to move every vertex to the surface of the 3D mesh model. For example, the displacement vector for each vertex can be defined as:
[0105] ;
[0106] in, This represents the gradient of the undirected distance field; 0.8 represents a scaling factor set empirically to balance the magnitude of vertex approaching the mesh surface with the adjustment space for subsequent parameter optimization. Setting it to 0.8 allows vertices to partially approach the mesh, improving the current representation accuracy while reserving adjustment leeway for subsequent optimization. Based on the UDF value and the internal / external relationship between each vertex and the surface of the 3D mesh model, v_sdf can be calculated, where the external value is positive, the internal value is negative, and the absolute value is the size of the UDF.
[0107] The technical solution of this application embodiment can obtain high-precision predicted parameters by using undirected distance fields, directed distance fields and displacement vectors to sparsify the representation parameters, which greatly reduces the number of iterations for optimizing the model representation parameters and can be used to process the data required for training massive 3D large models.
[0108] In another embodiment, after determining the model representation parameters of the 3D mesh model based on the spatial information of the target voxel in the 3D mesh model, the method further includes: constructing a reconstruction model corresponding to the 3D mesh model based on the model representation parameters; calculating the loss based on the difference between the projection feature maps corresponding to the reconstruction model and the 3D mesh model respectively; and optimizing the model representation parameters based on the loss to obtain optimized parameters.
[0109] In the specific implementation, assuming the 3D mesh model is generated using the Flexicube 3D mesh generation technology, the model representation parameters of the 3D mesh model can be generated based on the target voxel spatial information. These parameters are Flexicube sparsification parameters (including coord_vert, v_deform, and v_sdf) used to represent the geometric features of the 3D mesh model. These parameters can represent the basic shape of the original 3D mesh model, which can greatly shorten the number of iterations required for projection optimization of Flexicube. Then, using a differentiable renderer, such as nvdiffrast or pytorch3d, the normal map and depth map obtained by projecting the 3D mesh model using the parameter extraction by Flexicube are calculated, and the loss is calculated between these and the normal map and depth map obtained by projecting the original 3D mesh model. The Flexicube parameters are further optimized through gradient backpropagation. Differentiable rendering can be achieved by designing or approximating a traditional rendering pipeline, enabling the entire rendering process to support backpropagation. This allows the use of gradient information to optimize scene parameters, minimizing the difference between the rendered image and the target image.
[0110] The restored model can be a 3D mesh model obtained by restoring the model representation parameters. For example, a mesh model reconstructed according to the Flexicube rule using model representation parameters such as coord_vert, v_deform, and v_sdf can be used to simulate the process of restoring the original mesh from the feature parameters.
[0111] The projection feature map can be a two-dimensional feature map generated by rendering a three-dimensional model using a differentiable renderer. It can include a normal map and a depth map. The normal map is used to record the direction of the normal vector at each point on the model surface, reflecting the geometric orientation of the surface. The depth map is used to record the distance from each point on the model surface to the preset camera, reflecting the spatial depth of the surface.
[0112] In practice, the loss is calculated based on the difference between the projected feature maps corresponding to the restored model and the 3D mesh model, which can be either L2 loss or L1 loss. Then, the model representation parameters are adjusted through backpropagation of the loss to obtain the final model representation parameters, which can further reduce the difference between the restored model and the original model and improve the representation accuracy of the model representation parameters for the original 3D mesh model.
[0113] The technical solution of this application embodiment constructs a restoration model, calculates the projection feature difference loss, and directly quantifies the deviation between the model representation parameters and the original three-dimensional mesh model, thereby optimizing the model representation parameters and improving the representation accuracy of the model representation parameters on the original three-dimensional mesh model.
[0114] In another embodiment, the projection feature map includes a normal map and a depth map obtained by projecting the restored model and the 3D mesh model onto the camera, respectively; the step of calculating the loss based on the difference between the projection feature maps corresponding to the restored model and the 3D mesh model includes: calculating the loss based on the difference between the normal maps corresponding to the restored model and the 3D mesh model, the difference between the depth maps, and the effective calculation area; wherein, for the outermost region of the restored model and the 3D mesh model, the effective calculation area is the image area that the camera can capture; for the second outermost region relative to the outermost region, the effective calculation area is the region in the second outermost region where the difference in projection depth under the camera is less than a depth threshold.
[0115] In the specific implementation, it is first necessary to randomly initialize a set of camera positions around the 3D mesh model. Based on the position of each camera, the renderer renders the normal map of the reconstructed model from the current viewpoint. and depth map And the normal map obtained from the rendering of the original 3D mesh model. and depth map And the effective computational area of the restored model and the 3D mesh model. The calculated loss can be expressed as:
[0116] ;
[0117] Here, L2 is used to calculate the L2 loss. It should be noted that either L1 or L2 loss can be used here.
[0118] Furthermore, since the rendering process generally only involves the outermost region, when the 3D mesh model has significant occlusion, the surrounding camera may not be able to capture the corresponding area, making it impossible to optimize the parameters of that area. Therefore, in addition to rendering the outermost layer through the renderer, the next outermost layer is also rendered simultaneously.
[0119] For the outermost region of the restored model and the 3D mesh model, the effective computational area is... The image area that the camera can capture This refers to the area containing content from the camera's perspective.
[0120] For the second outermost region relative to the outermost region in the restored model and the 3D mesh model, the effective computational region is... This refers to the region in the outermost layer where the difference in projected depth under the camera is less than a depth threshold. Since the aforementioned steps have already removed internal voxels belonging to the inner region and eliminated invisible areas by filtering the target voxels, the effective calculation area for the second outermost region can be calculated only for parts with similar depths, avoiding incorrect calculations of clipped mesh portions. Assume the rendered second outermost normal map and depth map are as follows: , , , Then the effective computational region of the second outermost layer is This indicates that the effective computational region only considers regions with similar projection depths. Experiments have shown that the parameters of the sparse representation model can be optimized by randomly sampling four surrounding camera views in each iteration and performing 100 iterations, while the parameters of the non-sparse representation model, even for simple models, require 1000 iterations to be optimized at low resolution.
[0121] In practical applications, the final optimized model representation parameters are sparse feature vectors representing the 3D mesh model, composed of the v_deform, v_sdf parameters, and the vertex coordinates coord_vert of its voxels. This feature vector can accurately reproduce the shape of the original 3D mesh model. For meshes of arbitrary shapes, a unified parameterized representation can be obtained using the above method, which can be directly used in subsequent 3D generation algorithms and VAE compression algorithms.
[0122] For the convenience of those skilled in the art, Figure 3 An exemplary diagram of a normal plot and a schematic diagram of the effective calculation region is provided. Figure 3 (a) and (b) are normal rendering maps. Above (a) and (b) is the reconstructed model obtained by extracting model representation parameters, and below (a) and (b) is the original 3D mesh model. (c) is the effective computation region.
[0123] The technical solution of this application embodiment optimizes highly invisible areas by iterating through an additional sub-outer layer rendering loss function, which ensures that the generated parameters can extract a high-precision 3D mesh model and restore the original 3D mesh model surface.
[0124] For the convenience of those skilled in the art, Figure 4 An exemplary logic diagram of a method for processing a 3D mesh model is provided. The original 3D mesh model is first voxelized to obtain voxels; voxels are used for visibility calculation to obtain visibility values; simultaneously, voxels are filled to create watertight voxels, and then positional relationship labels, i.e., inside and outside labels, are obtained through connectivity calculation; subsequently, target voxels (i.e., surface voxels) are selected by combining visibility values and positional relationship labels, and undirected distance field UDF calculation is performed on the target voxels (to obtain UDF values and UDF gradients of voxel displacements) and directed distance field SDF is initialized; finally, model characterization parameters are generated based on these results, which can be used to extract the mesh to reconstruct the 3D model.
[0125] This application's embodiments employ a single model directly encoded into model representation parameters. By efficiently removing useless internal structures through visibility and connectivity analysis, high-precision initialization parameters are obtained through pre-computation for training model representation parameters, greatly shortening the training time. Highly occluded regions are learned through multi-layer rendering, minimizing the accuracy loss caused by mesh encoding and decoding while maintaining the 3D structure to the greatest extent possible. Furthermore, these features can be used in VAEs to further compress features for training 3D generation algorithms and their downstream tasks.
[0126] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0127] Based on the same inventive concept, this application also provides a three-dimensional mesh model processing apparatus for implementing the three-dimensional mesh model processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations of one or more three-dimensional mesh model processing apparatus embodiments provided below can be found in the limitations of the three-dimensional mesh model processing method described above, and will not be repeated here.
[0128] In one exemplary embodiment, such as Figure 5 As shown, a three-dimensional mesh model processing device is provided, comprising:
[0129] The voxel module 510 is used to voxelize the three-dimensional mesh model of the target object to obtain multiple voxels corresponding to the target object in a preset reference space.
[0130] The projection module 520 is used to determine the visibility value of the voxel based on the projection information of the voxel under a preset camera view.
[0131] The tag module 530 is used to determine the positional relationship tag of the voxel relative to the reference point based on the connectivity relationship between the voxel and the reference point in the preset reference space.
[0132] The filtering module 540 is used to filter out target voxels from the voxels based on the voxel visibility value and positional relationship label.
[0133] The characterization module 550 is used to determine the model characterization parameters of the three-dimensional mesh model based on the spatial information of the target voxel in the three-dimensional mesh model.
[0134] In one embodiment, the voxel module 510 is specifically used to voxelize the three-dimensional mesh model of the target object to obtain the original voxel structure of the target object in the preset reference space; the original voxel structure includes multiple original voxels; a morphological closing operation is performed on the original voxel structure to obtain a voxel structure after closing operation; the voxel structure after closing operation includes the original voxels and new voxels filled by the morphological closing operation; based on the difference in the number of voxels between the voxel structure after closing operation and the original voxel structure, a target voxel structure is determined from the voxel structure after closing operation and the original voxel structure to obtain multiple voxels corresponding to the target voxel structure in the preset reference space.
[0135] In one embodiment, the preset reference space is a cubic space, and the reference point includes the vertex of the cubic space; the label module 530 is specifically used to determine a first spatial point that starts from the vertex of the cubic space and slides in orthogonal directions; if the first spatial point intersects with a voxel during the sliding process, the positional relationship label of the intersecting voxel is determined as an external voxel; a second spatial point that starts from the interior of any voxel and slides in orthogonal directions is determined; if the second spatial point can contact other voxels during the sliding process in each set of orthogonal directions, the positional relationship label of any voxel is determined as a middle voxel; and the positional relationship labels of the voxels other than the external voxel and the middle voxel among the plurality of voxels are determined as internal voxels.
[0136] In one embodiment, the projection module 520 is specifically used to determine the relative depth of the voxel relative to the surface of the three-dimensional mesh model under the preset camera viewpoint based on the projection coordinates and projection depth of the voxel under the preset camera viewpoint; and to determine the visibility value of the voxel based on the minimum value of the relative depth of the voxel under each preset camera viewpoint.
[0137] In one embodiment, the characterization module 550 is specifically configured to: determine the undirected distance field and the directed distance field of the vertex based on the nearest distance of the vertex of the target voxel relative to the surface of the three-dimensional mesh model; determine the displacement vector of the vertex based on the gradient of the undirected distance field of the vertex; the displacement vector is used to characterize the vector by which the vertex is displaced to the surface of the three-dimensional mesh model; and determine the model characterization parameters of the three-dimensional mesh model based on the undirected distance field, the directed distance field, and the displacement vector.
[0138] In one embodiment, the characterization module 550 is specifically used to construct a reconstruction model corresponding to the three-dimensional mesh model based on the model characterization parameters; calculate the loss based on the difference between the projection feature maps corresponding to the reconstruction model and the three-dimensional mesh model respectively; and optimize the model characterization parameters based on the loss to obtain optimized parameters.
[0139] In one embodiment, the projection feature map includes a normal map and a depth map obtained by projecting the restored model and the 3D mesh model onto the camera, respectively; the characterization module 550 is specifically used to calculate the loss based on the differences between the normal maps corresponding to the restored model and the 3D mesh model, the differences between the depth maps, and the effective computation area.
[0140] Specifically, for the outermost region of the restored model and the 3D mesh model, the effective calculation region is the image region that the camera can capture; for the second outermost region relative to the outermost region, the effective calculation region is the region in the second outermost region where the difference in projection depth under the camera is less than a depth threshold.
[0141] Each module in the aforementioned 3D mesh model processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can call and execute the operations corresponding to each module.
[0142] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for processing a three-dimensional mesh model. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0143] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0144] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0145] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0146] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0148] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0150] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of processing a three-dimensional mesh model, characterized by, The method comprises: voxelizing a three-dimensional mesh model of a target object to obtain a plurality of voxels corresponding to the target object in a preset reference space; determining a visibility value of the voxel according to projection information of the voxel under a preset camera perspective; determining a position relationship label of the voxel relative to a reference point in the preset reference space according to a connectivity relationship between the voxel and the reference point; screening a target voxel from each of the voxels according to the visibility value and the position relationship label of the voxel; determining a model representation parameter of the three-dimensional mesh model according to spatial information of the target voxel in the three-dimensional mesh model.
2. The method of claim 1, wherein, The voxelizing of the three-dimensional mesh model of the target object to obtain a plurality of voxels corresponding to the target object in a preset reference space comprises: voxelizing the three-dimensional mesh model of the target object to obtain an original voxel structure of the target object in the preset reference space; the original voxel structure comprises a plurality of original voxels; performing a morphological closing operation on the original voxel structure to obtain a closing operation voxel structure; the closing operation voxel structure comprises the original voxels and new voxels filled through the morphological closing operation; determining a target voxel structure from the closing operation voxel structure and the original voxel structure according to a voxel number difference between the closing operation voxel structure and the original voxel structure, and obtaining a plurality of voxels corresponding to the target voxel structure in the preset reference space.
3. The method of claim 1, wherein, The preset reference space is a cubic space, and the reference points comprise vertices of the cubic space; the determination of the position relationship label of the voxel relative to the reference point according to the connectivity relationship between the voxel and the reference point in the preset reference space comprises: determining a first space point sliding from a vertex of the cubic space in an orthogonal direction, and if the first space point intersects with a voxel in the sliding process, determining a position relationship label of the intersected voxel as an external voxel; determining a second space point sliding from an interior of any voxel in an orthogonal direction, and if the second space point can contact other voxels in the sliding process according to each set of orthogonal directions, determining a position relationship label of any voxel as a middle voxel; determining a position relationship label of other voxels in the plurality of voxels except the external voxels and the middle voxels as internal voxels.
4. The method of claim 3, wherein, The determination of the visibility value of the voxel according to the projection information of the voxel under a preset camera perspective comprises: determining a relative depth of the voxel relative to a surface of the three-dimensional mesh model under the preset camera perspective according to a projection coordinate and a projection depth of the voxel under the preset camera perspective; determining the visibility value of the voxel according to a minimum value of the relative depth of the voxel under each preset camera perspective.
5. The method of claim 1, wherein, The determination of the model representation parameter of the three-dimensional mesh model according to the spatial information of the target voxel in the three-dimensional mesh model comprises: determine, according to the nearest distance of the vertex of the target voxel relative to the surface of the three-dimensional mesh model, an undirected distance field and a directed distance field of the vertex; determine, according to the gradient of the undirected distance field of the vertex, a displacement vector of the vertex; the displacement vector is used to represent a vector of displacement of the vertex to the surface of the three-dimensional mesh model; determine, according to the undirected distance field, the directed distance field and the displacement vector, a model representation parameter of the three-dimensional mesh model.
6. The method of claim 1, wherein, After the model representation parameter of the three-dimensional mesh model is determined according to the spatial information of the target voxel in the three-dimensional mesh model, the method further comprises: construct a restored model corresponding to the three-dimensional mesh model according to the model representation parameter; calculate a loss according to the difference between the projection feature maps respectively corresponding to the restored model and the three-dimensional mesh model, and optimize the model representation parameter according to the loss to obtain an optimized parameter.
7. The method of claim 6, wherein, The projection feature maps comprise normal maps and depth maps respectively projected by a camera on the restored model and the three-dimensional mesh model; and the calculating the loss according to the difference between the projection feature maps respectively corresponding to the restored model and the three-dimensional mesh model comprises: calculating the loss according to the difference between the normal maps respectively corresponding to the restored model and the three-dimensional mesh model, the difference between the depth maps, and an effective calculation region; wherein, for the outermost region of the restored model and the three-dimensional mesh model, the effective calculation region is an image region that can be captured by the camera; and for a sub-outer region relative to the outermost region, the effective calculation region is a region in the sub-outer region that has a projection depth difference less than a depth threshold under the camera.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 7.
9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 7.
Citation Information
Cited By
Method and device for evaluating acquisition quality of three-dimensional Gaussian splashing data
CN121639700A
A method and device for evaluating the quality of three-dimensional Gaussian sputtering data acquisition
CN121639700B