Mesh model regularization method and related apparatus, device, and medium
By using voxel division and interpolation methods, combined with a mesh model regularization device, the problems of feature loss and low efficiency in the mesh model regularization process are solved, achieving more efficient feature preservation and topology repair.
Patent Information
- Application Number
- CN202511405564.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing techniques are prone to losing important geometric features or model details during mesh model normalization, and are inefficient, making it difficult to effectively improve feature preservation capabilities.
By dividing and interpolating voxels based on the target voxel scale and the physical space coordinates of the mesh vertices of the initial mesh model, voxel splitting points are determined, and new mesh vertices are obtained by merging or sampling. Finally, facets are constructed to form a regularized target mesh model.
It improves the efficiency of mesh model regularization and feature preservation, reduces the number of voxel points and improves uniformity, alleviates problems such as excessively close point spacing and self-intersection of patches, and enhances topology repair capabilities.
Smart Images

Figure CN120876748B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision, in particular to a mesh model regularization method and related device, equipment and medium. BACKGROUND
[0002] A mesh model is a basic data structure for expressing complex geometric shapes and performing subsequent operations (such as physical modeling, stress analysis, fluid calculation, path planning, rendering display, etc.), which is usually composed of mesh vertices, edges connecting the mesh vertices, and face patches (such as triangular face patches, etc.) formed by connecting the edges.
[0003] At present, whether the mesh model is obtained by an automatic generation algorithm (such as Delaunay triangulation, octree / quaternary tree division), or by scanning reconstruction (such as laser scanning, CT / MRI imaging) or manual modeling, it inevitably contains various geometric defects or topological problems. Therefore, in order to ensure the reliability and efficiency of subsequent applications, regularization of the original mesh model has become an indispensable preprocessing step. Although there are many technical solutions for mesh model regularization in the prior art, the prior art is prone to losing important geometric features or model details in the regularization process, that is, the feature preservation ability is weak. In addition, the efficiency of some regularization methods is also relatively low. Therefore, how to improve the efficiency and feature preservation ability of mesh model regularization has become a problem to be solved. SUMMARY
[0004] The technical problem solved by the present application is to provide a mesh model regularization method and related device, equipment and medium, which can improve the efficiency and feature preservation ability of mesh model regularization.
[0005] In order to solve the above technical problem, the first aspect of the present application provides a mesh model regularization method, comprising: obtaining the voxel space coordinates of the mesh vertices corresponding to the voxel representative points in the voxel space based on the target voxel scale and the physical space coordinates of the mesh vertices in the initial mesh model of the target object; performing interpolation on the voxel space coordinates of the voxel representative points in the target direction to obtain the voxel space coordinates of the voxel split points of the voxel representative points after splitting in the target direction; determining whether to merge different voxel split points as voxel target points based on the voxel space coordinates of different voxel split points; sampling in the initial mesh model based on the voxel target points to obtain new mesh vertices; performing face patch construction based on the new mesh vertices to obtain a target mesh model after regularization of the initial mesh model.
[0006] To solve the above technical problems, the second aspect of the present application provides a mesh model regularization device, comprising: a voxel division module, a split expansion module, a merging determination module, a model sampling module and a patch construction module, the voxel division module is used to obtain the voxel space coordinates of the grid vertex corresponding to the voxel representative point in the voxel space based on the target voxel scale and the physical space coordinates of the grid vertex in the initial mesh model of the target object; the split expansion module is used to obtain the voxel space coordinates of the voxel split point after the voxel representative point is split in the target direction based on the voxel space coordinates of the voxel representative point; the merging determination module is used to determine whether to merge different voxel split points as voxel target points based on the voxel space coordinates of different voxel split points; the model sampling module is used to sample in the initial mesh model based on the voxel target points to obtain new grid vertices; and the patch construction module is used to construct patches based on the new grid vertices to obtain the target mesh model after the initial mesh model is regularized.
[0007] To solve the above technical problems, the third aspect of the present application provides an electronic device, at least comprising a memory and a processor coupled with each other, the memory at least stores program instructions, and the processor is used to execute the program instructions to realize the mesh model regularization method in the first aspect.
[0008] To solve the above technical problems, the fourth aspect of the present application provides a computer readable storage medium, which stores program instructions capable of being run by a processor, and the program instructions are used to realize the mesh model regularization method of the first aspect.
[0009] The above scheme, based on the target voxel scale and the physical space coordinates of the mesh vertices in the initial mesh model of the target object, obtains the voxel space coordinates of the voxel representative points corresponding to the mesh vertices in voxel space. Then, based on the voxel space coordinates of the voxel representative points, interpolation is performed in the target direction to obtain the voxel space coordinates of the voxel split points after the voxel representative points split in the target direction. Next, based on the voxel space coordinates of different voxel split points, it is determined whether to merge different voxel split points as voxel target points. Thus, sampling is performed in the initial mesh model based on the voxel target points to obtain new mesh vertices. Finally, patch construction is performed based on the new mesh vertices to obtain the target mesh model after the initial mesh model is regularized. Therefore, by optimizing the initial mesh model... After voxel subdivision of the mesh vertices, interpolation is performed along the target direction to split and expand the voxel representative points. This enables subdivision of the voxel space, helping to better control the density of regularization. Based on this, the voxel coordinates of the split points determine whether to merge to obtain the target voxel point. This approach minimizes the total number and uniformity of voxel points while preserving the original features of the target object as much as possible. When sampling in the initial mesh model, the reduced number of voxel points improves sampling efficiency, and the increased uniformity helps alleviate problems such as excessively close point spacing and self-intersection of faces in the initial mesh model, thus improving topology repair capabilities. Therefore, this method improves the efficiency of mesh model regularization and feature preservation. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating an embodiment of the mesh model normalization method of this application;
[0011] Figure 2 This is a schematic diagram of a process of an embodiment of the mesh model normalization method of this application;
[0012] Figure 3 This is a schematic diagram of the framework of an embodiment of the mesh model straightening device of this application;
[0013] Figure 4 This is a schematic diagram of the framework of an embodiment of the electronic device of this application;
[0014] Figure 5 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation
[0015] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0016] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0017] The terms "system" and "network" are often used interchangeably herein. The term "and / or", merely describes an associated relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist together, and B exists alone. In addition, the segment " / " herein generally represents an "or" relationship between the associated objects. In addition, "multiple" herein means two or more than two.
[0018] Please refer to Figure 1 , Figure 1 is a flowchart of an embodiment of the grid model regularization method of the present application. Specifically, it can include the following steps:
[0019] Step S11: Based on the target voxel scale and the physical space coordinates of the grid vertices in the initial grid model of the target object, the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space are obtained.
[0020] In one implementation scenario, the target object can include, but is not limited to, a person, an animal, a plant, and a non-living object, etc., and the specific type of the target object is not limited herein. For example, in the application scenario of human modeling, the target object can be a person; or, for another example, in the application scenario of home modeling, the target object can be a non-living object such as furniture. It should be noted that the above examples are only a few possible implementation examples of the target object in actual applications, and other possible cases are not listed one by one.
[0021] In one implementation scenario, as a possible implementation example, after obtaining the initial grid model, the initial grid network model can be directly voxelized based on the target voxel scale to obtain the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space. Specifically, for each grid vertex in the initial grid model, each coordinate value in the physical space coordinates of the grid vertex can be divided by the target voxel scale to obtain the voxel space coordinates of the grid vertex corresponding to the voxel representative points in the voxel space. For the convenience of understanding, for the grid vertex v(x, y, z), the voxel space coordinates of the grid vertex corresponding to the voxel representative points in the voxel space can be represented as:
[0022]
[0023] In the above formula, v'(i,j,k) represents the voxel space coordinates of the grid vertex v(x,y,z) corresponding to the voxel representative point in the voxel space, and voxel_size represents the target voxel size. It should be noted that the target voxel size can be set according to actual application requirements. For example, in the case of high refinement of the voxel representative point, the target voxel size can be set to be smaller, or in the case of high requirement for subsequent processing speed, the target voxel size can be set to be larger. In this case, the specific value of the target voxel size is not limited, and will not be exemplified one by one.
[0024] In another implementation scenario, as another possible implementation example, before voxel planning, clustering can also be performed based on the initial normal of each grid vertex in the initial mesh model to obtain a plurality of first clusters, and the first cluster contains at least one grid vertex, and then clustering is performed based on the representative normal of each first cluster to obtain a plurality of second clusters, so that the representative normal of the second cluster can be selected as the main normal of the initial mesh model based on the total number of grid vertices in each second cluster, and then the initial mesh model can be rotated until the main normal of the initial mesh model is parallel to the Z coordinate axis. On this basis, voxel planning can be performed on the initial mesh network model after rotation based on the target voxel size. The above-mentioned method of normal-guided hierarchical clustering to estimate the main normal of the initial mesh model can quickly determine the main normal of the initial mesh model, and on this basis, the initial mesh model is rotated to the main normal parallel to the Z coordinate axis before voxel planning, which can help to improve the accuracy of voxel planning.
[0025] In a specific implementation scenario, in order to obtain a plurality of first clusters, the initial normal and local curvature of each grid vertex in the initial mesh model can be obtained first. For example, the initial normal of the grid vertex can be obtained by PCA covariance analysis (for example, the initial normal can be determined based on the eigenvector corresponding to the smallest eigenvalue of each eigenvalue obtained based on the covariance matrix), and the local curvature of the grid vertex can be obtained based on the ratio of the smallest eigenvalue to the sum of eigenvalues obtained based on the covariance matrix. On this basis, the grid vertex with the smallest local curvature among the unselected grid vertices can be selected as the seed point, and the neighbor points of the seed point can be searched within a second sphere with the seed point as the center of the sphere, and the sphere radius of the second sphere can be adaptively determined by the local curvature of the seed point. For example, the sphere radius can be represented as:
[0026]
[0027] In the above formula, r_adapt represents the sphere radius, base_radius represents a preset multiple (e.g., 5 times, etc.) of the average distance of the point cloud (i.e., the average value of the distance between any different grid vertices in the initial mesh model), a represents an adjustment parameter (e.g., 0.5, etc.), and c_seed represents the local curvature of the seed point. After the neighbor points of the seed point are searched, it can be further determined whether to select the neighbor points to be included in the first cluster where the seed point is located based on the angle between the initial normal of the neighbor point and the initial normal of the seed point. For example, when the angle between the initial normal of the neighbor point and the initial normal of the seed point is less than an angle threshold, the neighbor point can be included in the first cluster where the seed point is located, and otherwise, when the angle between the initial normal of the neighbor point and the initial normal of the seed point is not less than the angle threshold, the neighbor point can not be included in the first cluster where the seed point is located. In addition, after it is determined whether each neighbor point of the seed point is included in the first cluster where the seed point is located, as a possible example, the first cluster where the seed point is located can be directly determined as a first cluster; or as another possible example, it can also be determined whether the total number of grid vertices in the first cluster where the seed point is located is not less than a number threshold, and if so, the first cluster where the seed point is located can be determined as a first cluster, and otherwise, the seed point can be marked as a noise point, that is, at this time, there is no first cluster where the seed point is located, and that is, each grid vertex originally included in the first cluster where the seed point is located is also released (i.e., these grid vertices can be selected subsequently). For ease of understanding, the i-th grid vertex in the initial mesh model can be denoted as p_i, the initial normal thereof can be denoted as n_i, and the local curvature thereof can be denoted as c_i. Then, an empty cluster list clusters=[] can be initialized, and an unprocessed point set unprocessed=P (i.e., containing all grid vertices in the initial mesh model) can be initialized. When the unprocessed point set unprocessed is non-empty, the following steps a to f can be executed in a loop:
[0028] Step a: Take the grid vertex with the smallest local curvature in the unprocessed point set unprocessed as the seed point p_seed.
[0029] Step b: Adaptively calculate the sphere radius r_adapt according to the above formula.
[0030] Step c: Search for the neighbor points N_seed of the seed point p_seed in a second sphere with the seed point p_seed as the center and the sphere radius r_adapt.
[0031] Step d: Determine whether the jth neighbor point p_j is a consistent neighbor point N_consistent according to whether the angle between the initial normal n_seed of the seed point p_seed and the initial normal n_j of the jth neighbor point p_j is less than an angle threshold θ_max.
[0032]
[0033] In the above formula, angle(.,.) represents the angle.
[0034] Step e: Determine whether the total number of consistent neighbor points N_consistent is not less than a number threshold min_points. If yes, a new first cluster cluster_new can be created, and the seed point p_seed and the aforementioned consistent neighbor points N_consistent are included in the first cluster cluster_new, i.e., cluster_new = p_seed U N_consistent. In addition, the representative normal of the first cluster cluster_new can be calculated. For example, the initial normals of the grid vertices in the first cluster cluster_new can be averaged and then normalized to obtain the representative normal n_cluster = normalize(∑n_j). At this time, the consistent neighbor points N_consistent can be removed from the unprocessed point set unprocessed, and the first cluster cluster_new can be added to the cluster list clusters.
[0035] Step f: If no (i.e., the total number of consistent neighbor points N_consistent is not less than the number threshold min_points), the seed point p_seed can be marked as a noise point.
[0036] In one specific implementation scenario, after obtaining a plurality of first clusters, the representative normal of each first cluster can be used to perform clustering to obtain a plurality of second clusters. For example, the representative normal of each first cluster can be subjected to K-Means clustering (e.g., K = 6, etc.) to obtain a plurality of second clusters. For details, refer to clustering algorithms such as K-Means clustering, which will not be described here.
[0037] In one specific implementation scenario, after obtaining a plurality of second clusters, the total number of grid vertices in each second cluster can be counted, and then a second cluster with the largest total number of grid vertices can be selected, and the representative normal of the second cluster is taken as the main normal of the initial mesh model. Then the initial mesh model can be rotated until the main normal of the mesh model is parallel to the Z coordinate axis. At this time, the initial mesh model can be voxelized based on the target voxel scale to obtain the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space.
[0038] Step S12: interpolating the voxel space coordinates of the voxel representative points in the target direction to obtain the voxel space coordinates of the voxel split points of the voxel representative points after the target direction splitting.
[0039] Specifically, the target direction can include at least one coordinate axis direction of the voxel space, such as the X-axis direction, the Y-axis direction, the Z-axis direction, etc. On this basis, each target direction can be selected as the to-be-interpolated direction, and the coordinate axis direction other than the to-be-interpolated direction can be selected as the coordinate-keeping direction. Then the coordinate value of the coordinate-keeping direction in the voxel space coordinates of the voxel representative points can be kept, and the coordinate value of the to-be-interpolated direction in the voxel space coordinates of the voxel representative points can be interpolated based on the target voxel scale to obtain the voxel space coordinates of the voxel split points. For example, in the case where the X-axis direction is selected as the to-be-interpolated direction, the Y-axis direction and the Z-axis direction are taken as the coordinate-keeping direction. Then the coordinate values of the Y-axis direction and the Z-axis direction in the voxel space coordinates of the voxel representative points can be kept, and the coordinate value of the X-axis direction in the voxel space coordinates of the voxel representative points can be interpolated based on the target voxel scale to obtain the voxel space coordinates of the voxel split points. In this way, after the X-axis direction, the Y-axis direction, and the Z-axis direction are respectively selected as the to-be-interpolated direction, one voxel representative point can be expanded into six voxel split points (two voxel split points are expanded for each target direction).
[0040] As a possible interpolation manner, the coordinate value of the voxel representative point in the direction to be interpolated in the voxel space coordinate can be directly taken as N times of the target voxel scale to obtain a voxel split point, and the coordinate value of the voxel representative point in the direction to be interpolated in the voxel space coordinate can be taken as N+1 times of the target voxel scale to obtain another voxel split point. For example, taking the voxel representative point (1.1, 1.5, 1.6) as an example, in the case of a target voxel scale of 1, if the direction to be interpolated is the X-axis direction, the coordinate values in the Y-axis direction and the Z-axis direction can be kept, and the coordinate value in the X-axis direction can be taken as N times of the target voxel scale 1. Since the coordinate value of the voxel representative point in the X-axis direction is 1.1, the coordinate value can be taken as 1 times of the target voxel scale 1, that is, the voxel space coordinate of a voxel split point is (1.0, 1.5, 1.6). Similarly, the coordinate value in the X-axis direction can be taken as N+1 times of the target voxel scale 1. Since the coordinate value of the voxel representative point in the X-axis direction is 1.1, the coordinate value can be taken as 2 times of the target voxel scale 1, that is, the voxel space coordinate of another voxel split point is (2.0, 1.5, 1.6). Of course, the above example is only a specific example in actual application, and other cases are not exemplified one by one.
[0041] As another possible interpolation manner, the coordinate value of the voxel representative point in the direction to be interpolated in the voxel space coordinate can be added by half of the target voxel scale to obtain a voxel split point, and the coordinate value of the voxel representative point in the direction to be interpolated in the voxel space coordinate can be subtracted by half of the target voxel scale to obtain another voxel split point. For example, still taking the voxel representative point (1.1, 1.5, 1.6) as an example, in the case of a target voxel scale of 1, if the direction to be interpolated is the X-axis direction, the coordinate values in the Y-axis direction and the Z-axis direction can be kept, and the coordinate value in the X-axis direction can be added by half of the target voxel scale (i.e. 0.5), that is, the voxel space coordinate of a voxel split point is (1.6, 1.5, 1.6). The coordinate value in the X-axis direction can be subtracted by half of the target voxel scale (i.e. 0.5), that is, the voxel space coordinate of a voxel split point is (0.6, 1.5, 1.6). Of course, the above example is only a specific example in actual application, and other cases are not exemplified one by one.
[0042] It should be noted that the above examples are only several possible interpolation manners in actual application, and other possible interpolation manners are not limited herein and are not exemplified one by one.
[0043] Step S13: determining whether to merge different voxel split points as voxel target points based on the voxel space coordinates of different voxel split points.
[0044] Specifically, to determine whether to merge different voxel split points as a voxel target point, it can be detected whether the voxel space coordinates of different voxel split points are same, in response to the voxel space coordinates of different voxel split points being same, different voxel split points are merged as a voxel target point, and in response to the voxel space coordinates of different voxel split points being different, different voxel split points are not merged.
[0045] Step S14: Sampling based on the voxel target point in the initial mesh model to obtain a new mesh vertex.
[0046] In one implementation scenario, as one possible implementation example, for each voxel target point, the shortest distance from the voxel target point to a face in the initial mesh model can be directly calculated, and the face intersection point when the shortest distance is formed and its physical space coordinates and normal angle are determined, and based on the to-be-judged information of the face intersection point corresponding to the voxel target point, it is determined whether to select the face intersection point as a new mesh vertex. It should be noted that the to-be-judged information can include the normal angle and the shortest distance, and in the case of selecting the face intersection point as a new mesh vertex, the physical space coordinates of the face intersection point can be used as the physical space coordinates of the new mesh vertex. In addition, based on the to-be-judged information of the face intersection point corresponding to the voxel target point, it is determined whether to select the face intersection point as a new mesh vertex, and the specific process can be referred to the related description below, which is not described here.
[0047] In another implementation scenario, as another possible implementation example, to achieve fast sampling, a sphere with the voxel target point as the center can also be expanded at a target speed, as a first sphere, in this process, in response to detecting that the first sphere first intersects a face in the initial mesh model, the expansion of the first sphere is stopped, and the physical space coordinates and the normal angle of the face intersection point are recorded, and based on the target speed and the expansion time, the straight-line distance from the voxel target point to the face intersection point is obtained, and then based on the to-be-judged information of the face intersection point corresponding to the voxel target point, it can be determined whether to select the face intersection point as a new mesh vertex. It should be noted that the to-be-judged information includes the normal angle and the straight-line distance, and in the case of selecting the face intersection point as a new mesh vertex, the physical space coordinates of the face intersection point are used as the physical space coordinates of the new mesh vertex. The above-mentioned method, by sphere expansion, can greatly speed up the sampling speed compared with directly calculating the shortest distance from the voxel target point to the face.
[0048] In one specific implementation scenario, the voronoi diagram idea can be utilized to design a discrete 3D / voronoi diagram to stop expanding when the first intersection of the voxel target point and the face occurs. It should be noted that when the first sphere intersects the face, the first sphere is essentially tangent to the face. In other words, the face intersection point is more accurately a face tangent point. Considering that the sphere is tangent to the plane, it can also be understood as a special intersection case, so the "first intersection" is emphasized in this embodiment.
[0049] In one specific implementation scenario, as described above, the information to be determined can include the normal angle and the straight-line distance, and for each face intersection point, it can be determined whether to retain or discard the face intersection point based on whether the normal angle is less than the angle threshold and whether the straight-line distance is less than the distance threshold. Illustratively, in the case where the normal angle is less than the angle threshold and the straight-line distance is less than the distance threshold, the face intersection point can be retained; otherwise, in the case where the normal angle is not less than the angle threshold and / or the straight-line distance is not less than the distance threshold, the face intersection point can be discarded. For ease of understanding, the angle threshold can be denoted as a, and the distance threshold can be denoted as d, and when the normal angle is less than the angle threshold a and the straight-line distance is less than the distance threshold d, the face intersection point can be retained. On this basis, based on the physical space coordinates of different face intersection points, it is determined whether to merge different face intersection points as new mesh vertices. Illustratively, it can be detected whether the physical space coordinates of different face intersection points are the same, and in response to the physical space coordinates of different face intersection points being the same, different face intersection points can be merged as new mesh vertices, and in response to the physical space coordinates of different face intersection points being different, different face intersection points can not be merged.
[0050] Step S15: Perform face construction based on the new mesh vertices to obtain the target mesh model after the initial mesh model is regularized.
[0051] In one implementation scenario, as one possible implementation example, the face construction can be implemented based on the Ball Pivoting Algorithm (BPA) to obtain the target mesh model after the initial mesh model is regularized. For specific construction process, please refer to the technical details of BPA, which will not be repeated here. It should be noted that the face construction is essentially to connect the new mesh vertices to form edges, and then different edges enclose to form faces, such as three edges enclosing to form a triangular face, four edges enclosing to form a quadrangular face, and so on, which is not limited here.
[0052] In another implementation scenario, as another possible implementation example, some steps in the ball pivot algorithm can also be improved to implement patch construction based on improved BPA. For example, in the ball determination step in the process of performing patch construction using the ball pivot algorithm, the base radius and different multiples of the base radius that need to be multiplied can be determined based on the point cloud density and the point cloud distribution of the new mesh vertex. Illustratively, the greater the point cloud density, the smaller the base radius can be set, and vice versa, the smaller the point cloud density, the greater the base radius can be set. At the same time, reference can be made to the point cloud distribution. The more uniform the point cloud distribution, the smaller the gap between different multiples of the base radius that need to be multiplied, and vice versa, the more uneven the point cloud distribution, the greater the gap between different multiples of the base radius that need to be multiplied. That is, the base radius can be negatively correlated with the point cloud density, and the gap between different multiples of the base radius that need to be multiplied can be negatively correlated with the uniformity of the point cloud distribution. On this basis, the base radius can be multiplied by different multiples respectively to obtain third balls of different ball radii, and then patch construction can be performed in parallel using the ball pivot algorithm based on the third balls of different ball radii. The above-mentioned manner determines the base radius and different multiples of the base radius that need to be multiplied based on the point cloud density and the point cloud distribution of the new mesh vertex, multiplies the base radius by different multiples respectively to obtain third balls of different ball radii, and then performs patch construction in parallel using the ball pivot algorithm based on the third balls of different ball radii. This can adaptively determine the ball radius of BPA according to the actual situation, and help to improve the details and quality of patch construction. For example, it can eliminate problems such as long and narrow cells (i.e., patches with an inner angle close to 0 degrees or a length-width ratio that is extremely large), degenerate cells (i.e., patches with an area of 0 or close to 0), topological errors, etc.
[0053] In a specific implementation scenario, in addition to the aforementioned ball determination step, in the space division step in the process of performing patch construction using the ball pivot algorithm, a space division data structure (such as a KD tree, an octree, or a grid division) can be used to accelerate the field search and reduce the time complexity of each search for adjacent points.
[0054] In a specific implementation scenario, in addition to the aforementioned ball determination step, in the neighborhood search step in the process of performing patch construction using the ball pivot algorithm, only points intersecting the current ball can be considered in each iteration to avoid global search as much as possible.
[0055] In a specific implementation scenario, in addition to the aforementioned sphere determination link, in the face smoothing post-processing link of the face construction process performed by using the sphere pivot algorithm: when the point cloud is smoothed and the face is constructed, the normal vector information of the new mesh vertex can be used to ensure that the generated face surface is as smooth and natural as possible; in the face smoothing post-processing, the position of each new mesh vertex can be adjusted by calculating the Laplacian operator of the new mesh vertex, so that it moves to the average position of the adjacent new mesh vertices.
[0056] In an implementation scenario, after obtaining the target mesh model after the initial mesh model is regularized, in order to further improve the model quality of the target mesh model, edges in the target mesh model can be traversed to obtain an adjacency matrix. It should be noted that the number of rows and the number of columns of the adjacency matrix are both the total number of new mesh vertices in the target mesh model, and the element value of any row and any column in the adjacency matrix represents whether there is an edge between the new mesh vertex corresponding to the row and the new mesh vertex corresponding to the column, and whether it is an edge edge when there is an edge, and the edge edge only exists in one face. Illustratively, when the element value is 0, it can represent that there is no edge between the new mesh vertex corresponding to the row and the new mesh vertex corresponding to the column; when the element value is 1, it can represent that there is an edge between the new mesh vertex corresponding to the row and the new mesh vertex corresponding to the column; when the element value is 2, it can represent that there is an edge between the new mesh vertex corresponding to the row and the new mesh vertex corresponding to the column and the edge is an edge edge. On this basis, the closed path can be obtained by searching based on the adjacency matrix, and then whether to perform face construction on the edges in the closed path can be determined based on the total number of edges in the closed path. It should be noted that the closed path can include several edges, and the search can be stopped to obtain the closed path when the edge edge is searched. The above-mentioned method can perform hole filling on the possible hole region in the target mesh model by constructing the adjacency matrix and searching the closed path based on the adjacency matrix to determine whether to perform face construction on the edges in the closed path based on the total number of edges in the closed path.
[0057] In a specific implementation scenario, for any face, if one edge in the face is shared by other faces, it can be determined that the edge is not an edge edge, otherwise, if the edge is not shared by other faces, it can be determined that the edge is an edge edge.
[0058] In a specific implementation scenario, taking the case that the target mesh model contains N new mesh vertices, an adjacency matrix of N rows and N columns can be constructed, where the element value of the ith row and jth column represents whether there is an edge between the ith new mesh vertex and the jth new mesh vertex in the target mesh model, and whether it is an edge edge when there is an edge. Illustratively, if there is no edge, the element value of the ith row and jth column can be set to 0, if there is an edge and it is not an edge edge, the element value of the ith row and jth column can be set to 1, and if there is an edge and it is an edge edge, the element value of the ith row and jth column can be set to 2.
[0059] In a specific implementation scenario, after the adjacency matrix is constructed, a search algorithm such as depth-first search or breadth-first search can be used to search the adjacency matrix to find a closed path. When searching the adjacency matrix to traverse the edges, if a certain edge is found to be an edge edge, the search can be stopped, and the path formed by the edges obtained in this search can be considered as a closed path. For specific search procedures, refer to the technical details of the depth-first search or breadth-first search algorithm, which will not be described here.
[0060] In a specific implementation, after obtaining the closed path, it can be detected whether the total number of edges in the closed path is less than the number threshold. If so, it can be considered that the hole region is caused by improper operation when the patch is constructed (such as caused by the algorithm itself), and the patch construction of the edges in the closed path is continued, otherwise, if not, it can be considered that the hole region actually exists in the target object (such as taking the target object as a "roll paper" as an example, which itself has a hole region), so the patch construction of the edges in the closed path can not be performed.
[0061] In an implementation scenario, after obtaining the target mesh model after the initial mesh model is regularized, in order to further improve the model quality of the target mesh model, as a possible implementation example, it can also be determined whether to filter any patch in the target mesh model based on the patch area of the patch; or, as another possible implementation example, it can also be determined whether to filter any patch in the target mesh model based on the aspect ratio of the long and short sides of the patch. It should be noted that when filtering the patch, the new mesh vertices in the patch are retained, and the edges between the new mesh vertices in the patch are deleted. The above method further filters the patch based on the patch area, the aspect ratio of the long and short sides, etc. after obtaining the target mesh model, which helps to improve the smoothness and continuity of patch construction.
[0062] In one specific implementation scenario, for the former implementation example above, since the area of each face in the target mesh model should be relatively stable after the process steps of voxel division, voxel expansion, model sampling, face construction, etc., an area threshold or area range can be set, and if the area of a face is too different from the area threshold (e.g., greater than an allowed error) or is not in the area range, the face can be filtered, otherwise the face can be retained.
[0063] In one specific implementation scenario, for the latter implementation example above, since each face in the target mesh model should theoretically be close to an isosceles right triangle, i.e., the ratio of the long side to the short side is , after the process steps of voxel division, voxel expansion, model sampling, face construction, etc., for any face, if the ratio of the long side to the short side is too different from the above ratio (i.e., ), the face can be filtered, otherwise the face can be retained.
[0064] In one implementation scenario, please refer to Figure 2 , Figure 2 is a process diagram of one embodiment of the mesh model regularization method of the present application. As shown in Figure 2 , as one possible example, the principal normal of the initial mesh model can be estimated by normal-guided hierarchical clustering, and the initial mesh model can be rotated until the principal normal of the initial mesh model is parallel to the Z coordinate axis, then the initial mesh model is voxelized (e.g., voxel division, voxel expansion, etc.) based on the target voxel size to obtain voxel target points, so that model sampling can be performed on the initial mesh model based on the voxel target points to obtain new mesh vertices, and face construction is performed based on the new mesh vertices to obtain a target mesh model after the initial mesh model is regularized, and finally the target mesh model can be subjected to face hole filling and face filtering.
[0065] The scheme is based on the target voxel scale and the physical space coordinates of the grid vertices in the initial mesh model of the target object to obtain the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space, and based on the voxel space coordinates of the voxel representative points, interpolation is performed in the target direction to obtain the voxel space coordinates of the voxel split points after the voxel representative points are split in the target direction, and based on the voxel space coordinates of the different voxel split points, it is determined whether to merge the different voxel split points as voxel target points, so that sampling is performed in the initial mesh model based on the voxel target points to obtain new mesh vertices, and then face construction is performed based on the new mesh vertices to obtain the target mesh model after the initial mesh model is regularized. Therefore, after the voxel division of the grid vertices in the initial mesh model, the voxel representative points are expanded by interpolation in the target direction to realize the subdivision operation of the voxel space, which helps to better control the density of regularization. On this basis, whether to perform merging to obtain the voxel target points is determined according to the voxel space coordinates of the voxel split points, which can reduce the total number and uniformity of the voxel points as much as possible on the premise of maintaining the original characteristics of the target object as much as possible. When sampling in the initial mesh model, the total number of voxel points is reduced, which can help to improve the sampling efficiency, and the uniformity of the voxel points is improved, which can help to alleviate the problems of too close distance between points and self-intersection of faces in the initial mesh model, and can improve the topological repair capability. Therefore, the efficiency and feature preservation capability of mesh model regularization can be improved.
[0066] Please refer to Figure 3 , Figure 3 is a schematic diagram of an embodiment of the mesh model regularization device. The mesh model regularization device 30 comprises a voxel division module 31, a split expansion module 32, a merging determination module 33, a model sampling module 34 and a face construction module 35. The voxel division module 31 is configured to obtain the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space based on the target voxel scale and the physical space coordinates of the grid vertices in the initial mesh model of the target object. The split expansion module 32 is configured to perform interpolation in the target direction based on the voxel space coordinates of the voxel representative points to obtain the voxel space coordinates of the voxel split points after the voxel representative points are split in the target direction. The merging determination module 33 is configured to determine whether to merge the different voxel split points as voxel target points based on the voxel space coordinates of the different voxel split points. The model sampling module 34 is configured to sample in the initial mesh model based on the voxel target points to obtain new mesh vertices. The face construction module 35 is configured to perform face construction based on the new mesh vertices to obtain the target mesh model after the initial mesh model is regularized.
[0067] In the above scheme, the grid model regularization device 30 obtains the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space based on the target voxel size and the physical space coordinates of the grid vertices in the initial grid model of the target object, and obtains the voxel space coordinates of the voxel split points of the voxel representative points after splitting in the target direction by interpolation in the target direction based on the voxel space coordinates of the voxel representative points. Then, whether to merge different voxel split points as voxel target points is determined based on the voxel space coordinates of the different voxel split points, so that new grid vertices are obtained by sampling in the initial grid model based on the voxel target points, and then the target grid model after regularization of the initial grid model is obtained by performing patch construction based on the new grid vertices. Therefore, by performing voxel division on the grid vertices in the initial grid model and then performing interpolation in the target direction to realize the splitting and expansion of the voxel representative points, the subdivision operation on the voxel space can be realized, which helps to better control the density of regularization. On this basis, whether to perform merging to obtain the voxel target points is determined according to the voxel space coordinates of the voxel split points, which can reduce the total number and uniformity of the voxel points as much as possible on the premise of maintaining the original characteristics of the target object as much as possible. Then, when sampling in the initial grid model, the sampling efficiency can be improved due to the reduction in the total number of voxel points, and the problem of too close distance between points and self-intersection of patches in the initial grid model can be alleviated due to the improvement in the uniformity of the voxel points, which can improve the topological repair capability. Therefore, the efficiency and feature preservation capability of the grid model regularization can be improved.
[0068] In some disclosed embodiments, the target directions include at least one coordinate axis direction of the voxel space, the splitting and expanding module 32 includes a direction selection sub-module for selecting each target direction as a to-be-interpolated direction and selecting a coordinate axis direction other than the to-be-interpolated direction as a coordinate preservation direction; and the splitting and expanding module 32 includes a preservation and interpolation sub-module for preserving the coordinate value of the coordinate preservation direction in the voxel space coordinates of the voxel representative points, and interpolating the coordinate value of the to-be-interpolated direction in the voxel space coordinates of the voxel representative points based on the target voxel size to obtain the voxel space coordinates of the voxel split points.
[0069] In some disclosed embodiments, the merging determination module 33 includes a coordinate detection sub-module for detecting whether the voxel space coordinates of different voxel split points are the same; the merging determination module 33 includes a first response sub-module for merging different voxel split points as voxel target points in response to the voxel space coordinates of different voxel split points being the same; and the merging determination module 33 includes a second response sub-module for not merging different voxel split points in response to the voxel space coordinates of different voxel split points being different.
[0070] In some disclosed embodiments, the model sampling module 34 comprises a sphere expansion sub-module configured to expand a sphere with the voxel target point as the sphere center and a target speed as the sphere radius as a first sphere; the model sampling module 34 comprises a record calculation sub-module configured to stop expanding the first sphere and record the physical space coordinates and normal angle of the intersection point of the face in the initial mesh model in response to detecting that the first sphere first intersects the face; and obtain the straight line distance from the voxel target point to the intersection point of the face based on the target speed and the expansion time; the model sampling module 34 comprises an information judgment sub-module configured to determine whether to select the intersection point of the face as a new mesh vertex based on the to-be-judged information of the intersection point of the face corresponding to the voxel target point; wherein the to-be-judged information comprises the normal angle and the straight line distance, and in the case of selecting the intersection point of the face as a new mesh vertex, the physical space coordinates of the intersection point of the face are used as the physical space coordinates of the new mesh vertex.
[0071] In some disclosed embodiments, the information judgment sub-module comprises a retention rejection unit configured to determine, for each intersection point of the face, whether to retain or reject the intersection point of the face based on whether the normal angle is less than an angle threshold and whether the straight line distance is less than a distance threshold; and the information judgment sub-module comprises an intersection point merging unit configured to determine whether to merge different intersection points of the face as a new mesh vertex based on the physical space coordinates of the different intersection points of the face.
[0072] In some disclosed embodiments, the mesh model regularizing device 30 comprises a first clustering module configured to perform clustering based on the initial normals of the mesh vertices in the initial mesh model to obtain a plurality of first clusters; wherein each first cluster contains at least one mesh vertex; the mesh model regularizing device 30 comprises a second clustering module configured to perform clustering based on the representative normal of each first cluster to obtain a plurality of second clusters; the mesh model regularizing device 30 comprises a normal determining module configured to select the representative normal of each second cluster as the main normal of the initial mesh model based on the total number of mesh vertices in each second cluster; and the mesh model regularizing device 30 comprises a model rotating module configured to rotate the initial mesh model until the main normal of the initial mesh model is parallel to the Z coordinate axis.
[0073] In some disclosed embodiments, the first clustering module comprises a normal curvature obtaining sub-module configured to obtain the initial normal and the local curvature of each mesh vertex in the initial mesh model; the first clustering module comprises a seed point selecting sub-module configured to select, from the mesh vertices that have not been selected, the mesh vertex with the smallest local curvature as a seed point; the first clustering module comprises a neighbor point searching sub-module configured to search, within a second sphere with the seed point as the sphere center, mesh vertices as neighbor points of the seed point; wherein the sphere radius of the second sphere is adaptively determined by the local curvature of the seed point; and the first clustering module comprises a determination sub-module configured to determine whether to select the neighbor points to be included in the first cluster in which the seed point is located based on the included angle between the initial normal of the neighbor points and the initial normal of the seed point.
[0074] In some disclosed embodiments, the patch construction is implemented based on a ball pivot algorithm, the patch construction module 35 includes a radius multiple determination submodule for determining a base radius and different multiples at which the base radius needs to be multiplied based on the point cloud density and the point cloud distribution of the new mesh vertices in the process of performing patch construction using the ball pivot algorithm; the patch construction module 35 includes a sphere radius multiplication submodule for multiplying the base radius by the different multiples respectively to obtain third spheres of different sphere radii; the patch construction module 35 includes an algorithm parallel execution submodule for performing patch construction in parallel using the ball pivot algorithm based on the third spheres of different sphere radii.
[0075] In some disclosed embodiments, the mesh model regularization apparatus 30 includes a matrix construction module for traversing each edge in the target mesh model to obtain an adjacency matrix; wherein the number of rows and the number of columns of the adjacency matrix are both the total number of new mesh vertices in the target mesh model, and the element value of any row and any column in the adjacency matrix represents whether there is an edge between the new mesh vertex corresponding to the row where the element value is located and the new mesh vertex corresponding to the column where the element value is located, and whether the edge is an edge edge when the edge exists, and the edge edge only exists in one patch; the mesh model regularization apparatus 30 includes a path search module for searching based on the adjacency matrix to obtain a closed path; wherein the closed path contains a plurality of edges, and the search is stopped to obtain the closed path when the edge edge is searched; the mesh model regularization apparatus 30 includes a hole completion module for determining whether to perform patch construction on the plurality of edges in the closed path based on the total number of edges in the closed path.
[0076] In some disclosed embodiments, the mesh model regularization apparatus 30 includes a patch filtering module for performing at least one of the following: determining whether to filter any patch in the target mesh model based on the patch area of the patch; determining whether to filter any patch in the target mesh model based on the long-short side ratio of the patch; wherein when the patch is filtered, the new mesh vertices in the patch are retained, and the edges between the new mesh vertices in the patch are deleted.
[0077] Please refer to Figure 4 , Figure 4 is a frame schematic diagram of an embodiment of the electronic device. The electronic device 40 at least includes a memory 41 and a processor 42 coupled with each other, the memory 41 at least stores program instructions, and the processor 42 is configured to execute the program instructions to implement the steps in any of the above mesh model regularization method embodiments. For details, please refer to the foregoing disclosed embodiments, which will not be repeated here. The electronic device 40 can include but is not limited to a smart phone, a tablet computer, a smart large screen, a server and the like, and the specific type of the electronic device 40 is not limited here.
[0078] In particular, the processor 42 is configured to control itself and the memory 41 to implement the steps in any of the above-described embodiments of the mesh model regularization method. The processor 42 can also be referred to as a CPU (Central Processing Unit). The processor 42 can be an integrated circuit chip having a processing capability of signals. The processor 42 can also be a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like. In addition, the processor 42 can be implemented by an integrated circuit chip together.
[0079] In the above scheme, the electronic device 40 obtains the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space based on the target voxel scale and the physical space coordinates of the grid vertices in the initial mesh model of the target object, and performs interpolation in the target direction based on the voxel space coordinates of the voxel representative points to obtain the voxel space coordinates of the voxel split points of the voxel representative points after splitting in the target direction, and then determines whether to merge different voxel split points as voxel target points based on the voxel space coordinates of the different voxel split points, so as to sample in the initial mesh model based on the voxel target points to obtain new grid vertices, and then perform patch construction based on the new grid vertices to obtain the target mesh model after regularization of the initial mesh model. Therefore, by performing voxel division on the grid vertices in the initial mesh model and then performing interpolation in the target direction to realize the splitting and expansion of the voxel representative points, the subdivision operation on the voxel space can be realized, which helps to better control the density of regularization. On this basis, whether to perform merging to obtain the voxel target points is determined based on the voxel space coordinates of the voxel split points, which can reduce the total number and uniformity of the voxel points as much as possible on the premise of maintaining the original features of the target object as much as possible. Then, when sampling in the initial mesh model, the total number of voxel points is reduced, which helps to improve the sampling efficiency, and the uniformity of the voxel points is improved, which helps to alleviate the problems of too close distance between points and self-intersection of patches in the initial mesh model, and improves the topological repair capability. Therefore, the efficiency and feature preservation capability of mesh model regularization can be improved.
[0080] Please refer to Figure 5 , Figure 5Fig. 1 is a schematic diagram of a framework of an embodiment of the computer readable storage medium of the present application. The computer readable storage medium 50 stores program instructions 51 capable of being executed by a processor, which are used to implement the steps in any of the above mesh model regularization method embodiments.
[0081] In the above scheme, the computer readable storage medium 50 obtains the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space based on the target voxel scale and the physical space coordinates of the grid vertices in the initial mesh model of the target object, and performs interpolation in the target direction based on the voxel space coordinates of the voxel representative points to obtain the voxel space coordinates of the voxel split points of the voxel representative points after splitting in the target direction, and then determines whether to merge different voxel split points as voxel target points based on the voxel space coordinates of different voxel split points, so as to sample in the initial mesh model based on the voxel target points to obtain new grid vertices, and then perform patch construction based on the new grid vertices to obtain the target mesh model after regularization of the initial mesh model. Therefore, by performing voxel division on the grid vertices in the initial mesh model and then performing interpolation in the target direction to realize the splitting and expansion of the voxel representative points, the subdivision operation on the voxel space can be realized, which helps to better control the density of regularization. On this basis, whether to perform merging to obtain the voxel target points is determined according to the voxel space coordinates of the voxel split points, which can reduce the total number and uniformity of the voxel points as much as possible on the premise of maintaining the original features of the target object as much as possible. Then, when sampling in the initial mesh model, the total number of voxel points is reduced, which helps to improve the sampling efficiency, and the uniformity of the voxel points is improved, which helps to alleviate the problems of too close distance between points, self-intersection of patches, etc. in the initial mesh model, and the topological repair capability is improved. Therefore, the efficiency and feature preservation capability of mesh model regularization can be improved.
[0082] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or contains modules that can be used to execute the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, details are not described here.
[0083] The above description of each embodiment tends to emphasize the differences between each embodiment, and the same or similar parts can be mutually referred to. For brevity, details are not described here.
[0084] In several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses can be implemented in other manners. For example, the division of the apparatus embodiments described above is merely an example, and the division of the modules or units can be different, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interfaces, and can be electrical, mechanical or other forms.
[0085] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment.
[0086] In addition, the functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can be physically present separately, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0087] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0088] If the technical solution of the present application involves personal information, the product applying the technical solution of the present application has clearly informed the personal information processing rules before processing the personal information and obtained the personal independent consent. If the technical solution of the present application involves sensitive personal information, the product applying the technical solution of the present application has obtained the personal independent consent before processing the sensitive personal information and at the same time meets the requirement of "explicit consent". For example, at the personal information collection device such as camera, a clear and prominent mark is set to inform that it has entered the personal information collection range and will collect personal information. If the individual voluntarily enters the collection range, it is considered to agree to collect personal information. Or on the device for processing personal information, through the pop-up information or by asking the individual to upload his / her personal information, the individual's authorization is obtained under the condition of using obvious mark / information to inform the personal information processing rules. The personal information processing rules can include personal information processor, personal information processing purpose, processing method and personal information type, etc.
Claims
1. A mesh model regularization method, characterized in that, The method comprises: based on the physical space coordinates of the grid vertices in the initial mesh model of the target object and the target voxel scale, obtaining the voxel space coordinates of the grid vertices corresponding to the voxel representative points in the voxel space; based on the voxel space coordinates of the voxel representative points, performing interpolation in the target direction to obtain the voxel space coordinates of the voxel split points after the voxel representative points are split in the target direction; based on the voxel space coordinates of different voxel split points, determining whether to merge different voxel split points as voxel target points; based on the voxel target points, sampling in the initial mesh model to obtain new mesh vertices; based on the new mesh vertices, performing patch construction to obtain a target mesh model after the initial mesh model is regularized; wherein the sampling of the voxel target points in the initial mesh model to obtain new mesh vertices comprises: expanding a sphere with the voxel target point as the center to a first sphere with a radius as the target speed; in response to detecting that the first sphere first intersects a patch in the initial mesh model, stopping expanding the first sphere, recording the physical space coordinates and normal angle of the patch intersection point, and based on the target speed and expansion time, obtaining the straight line distance from the voxel target point to the patch intersection point; based on the to-be-judged information of the voxel target point corresponding to the patch intersection point, determining whether to select the patch intersection point as the new mesh vertex; wherein the to-be-judged information includes the normal angle and the straight line distance, and in the case of selecting the patch intersection point as the new mesh vertex, the physical space coordinates of the patch intersection point are used as the physical space coordinates of the new mesh vertex.
2. The method of claim 1, wherein, The target direction includes at least one coordinate axis direction of the voxel space, and the interpolation of the voxel space coordinates of the voxel representative points in the target direction to obtain the voxel space coordinates of the voxel split points after the voxel representative points are split in the target direction comprises: selecting each target direction as a to-be-interpolated direction, and selecting the coordinate axis direction other than the to-be-interpolated direction as a coordinate-keeping direction; keeping the coordinate values of the coordinate-keeping direction in the voxel space coordinates of the voxel representative points, and interpolating the coordinate values of the to-be-interpolated direction in the voxel space coordinates of the voxel representative points based on the target voxel scale to obtain the voxel space coordinates of the voxel split points.
3. The method of claim 1, wherein, The determination of whether to merge different voxel split points as voxel target points based on the voxel space coordinates of different voxel split points comprises: detecting whether the voxel space coordinates of different voxel split points are the same; in response to the voxel space coordinates of different voxel split points being the same, merging different voxel split points as the voxel target points; in response to the voxel space coordinates of different voxel split points being different, not merging different voxel split points.
4. The method of claim 1, wherein, The determination of whether to select the patch intersection point as the new mesh vertex based on the to-be-judged information of the voxel target point corresponding to the patch intersection point comprises: For each of the patch intersection points, it is determined whether to keep or discard the patch intersection point based on whether the normal angle is less than an angle threshold and whether the straight line distance is less than a distance threshold; Based on the physical space coordinates of different patch intersection points, it is determined whether to merge different patch intersection points as the new mesh vertex.
5. The method of claim 1, wherein, Before obtaining the voxel space coordinates of the mesh vertex corresponding to the representative point of the voxel in the voxel space based on the physical space coordinates of the mesh vertex in the initial mesh model of the target voxel size and the target object, the method further comprises: Clustering based on the initial normal of each mesh vertex in the initial mesh model to obtain a plurality of first clusters; wherein the first cluster contains at least one mesh vertex; Clustering based on the representative normal of each first cluster to obtain a plurality of second clusters; Based on the total number of mesh vertices in each second cluster, the representative normal of the second cluster is selected as the main normal of the initial mesh model; Rotate the initial mesh model until the main normal of the initial mesh model is parallel to the Z coordinate axis.
6. The method of claim 5, wherein, The clustering based on the initial normal of each mesh vertex in the initial mesh model to obtain a plurality of first clusters comprises: Obtain the initial normal and local curvature of each mesh vertex in the initial mesh model; Select the mesh vertex with the smallest local curvature among the unselected mesh vertices as the seed point; Search for neighbor points of the mesh vertex as the seed point within a second sphere with the seed point as the center; wherein the sphere radius of the second sphere is adaptively determined by the local curvature of the seed point; Based on the angle between the initial normal of the neighbor point and the initial normal of the seed point, it is determined whether to select the neighbor point into the first cluster where the seed point is located.
7. The method of claim 1, wherein, The patch construction is realized based on the ball pivot algorithm, and in the process of performing the patch construction using the ball pivot algorithm, it comprises: Based on the point cloud density and point cloud distribution of the new mesh vertex, determine the base radius and different multiples of the base radius that need to be multiplied; Based on the different multiples, multiply the base radius respectively to obtain third spheres with different sphere radii; Based on the third spheres with different sphere radii, perform the patch construction in parallel using the ball pivot algorithm.
8. The method of claim 1, wherein, After the patch construction based on the new mesh vertex to obtain the target mesh model after the initial mesh model is regularized, the method further comprises: Traverse each edge in the target mesh model to obtain an adjacency matrix; wherein the number of rows and columns of the adjacency matrix is the total number of new mesh vertices in the target mesh model, and the element value of any row and any column in the adjacency matrix represents whether there is an edge between the new mesh vertex corresponding to the row and the new mesh vertex corresponding to the column, and whether it is an edge edge when there is an edge, and the edge edge only exists in one patch; Based on the adjacency matrix, search to obtain a closed path; wherein the closed path contains a plurality of edges, and the search is stopped to obtain the closed path when the edge edge is searched; Determine whether to perform patch construction on the edges in the closed path based on a total number of the edges in the closed path.
9. The method of claim 1, wherein, After the patch construction based on the new mesh vertices and obtaining the target mesh model after the regularization of the initial mesh model, the method further comprises at least one of the following: Determine whether to filter any patch in the target mesh model based on a patch area of the patch; Determine whether to filter any patch in the target mesh model based on a long-to-short side ratio of the patch; In the filtering of the patch, the new mesh vertices in the patch are retained, and the edges between the new mesh vertices in the patch are deleted.
10. A mesh model regularization apparatus, characterized by, Comprise: The voxel division module is configured to obtain voxel space coordinates of voxel representative points corresponding to mesh vertices based on a target voxel scale and physical space coordinates of the mesh vertices in an initial mesh model of a target object; The splitting expansion module is configured to obtain voxel space coordinates of voxel split points after splitting of the voxel representative points in a target direction based on interpolation of the voxel space coordinates of the voxel representative points in the target direction; The merging determination module is configured to determine whether to merge different voxel split points as a voxel target point based on the voxel space coordinates of the different voxel split points; The model sampling module is configured to sample the voxel target point in the initial mesh model to obtain new mesh vertices; The patch construction module is configured to perform patch construction based on the new mesh vertices to obtain a target mesh model after regularization of the initial mesh model; wherein the sampling of the voxel target point in the initial mesh model to obtain new mesh vertices comprises: Expand a sphere with the voxel target point as the center to a sphere radius at a target speed as a first sphere; In response to detecting that the first sphere first intersects a patch in the initial mesh model, stop expanding the first sphere, and record physical space coordinates and a normal angle of the patch intersection point, and obtain a straight-line distance from the voxel target point to the patch intersection point based on the target speed and expansion time; Determine whether to select the patch intersection point as the new mesh vertex based on to-be-judged information of the voxel target point corresponding to the patch intersection point; wherein the to-be-judged information comprises the normal angle and the straight-line distance, and in the case of selecting the patch intersection point as the new mesh vertex, the physical space coordinates of the patch intersection point are used as the physical space coordinates of the new mesh vertex.
11. An electronic device, comprising: At least comprise a memory and a processor coupled to each other, the memory at least stores program instructions, and the processor is configured to execute the program instructions to implement the mesh model regularization method of any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The program instructions stored in the memory can be run by the processor, and the program instructions are used to implement the mesh model regularization method of any one of claims 1 to 9.
Citation Information
Patent Citations
Three-dimensional model simplification method and device, computer equipment and storage medium
CN120339501A