Three-dimensional mesh data filtering method, device and equipment and storage medium
By identifying and distinguishing between non-feature regions and feature regions of a 3D mesh model, and employing Laplace filtering and feature recovery algorithms for differentiated processing, the problem of low filtering efficiency and poor feature preservation in existing technologies is solved, thus achieving efficient 3D mesh data filtering.
Patent Information
- Application Number
- CN202210844225.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2042-07-18
AI Technical Summary
Existing 3D mesh data filtering algorithms struggle to achieve efficient filtering while preserving features, resulting in reconstructed 3D meshes that cannot be directly applied to data analysis.
By identifying non-feature regions and feature regions in the 3D mesh model, the Laplace filtering algorithm and feature recovery algorithm are used for filtering, respectively, to ensure that the features of the feature regions are preserved during the filtering process.
It achieves improved filtering efficiency while preserving the characteristics of 3D meshes, and is suitable for large-scale 3D geographic information mesh models, improving mesh processing efficiency and feature preservation capabilities.
Smart Images

Figure CN116957993B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of mesh data processing, and relate to but are not limited to a three-dimensional mesh data filtering method, device, equipment and storage medium. BACKGROUND
[0002] The three-dimensional reconstruction obtained geographic information mesh data usually contains noise data, and the noise data causes the reconstructed three-dimensional mesh to be unable to be directly applied to data analysis, so that the three-dimensional mesh of geographic information needs to be filtered to obtain a smooth mesh surface and better applied to data analysis. The mesh filtering algorithm all faces a problem: how to ensure the filtering effect while keeping the characteristics from being contracted and having high filtering efficiency. SUMMARY
[0003] Therefore, embodiments of the present application provide a three-dimensional mesh data filtering method, device, equipment and storage medium.
[0004] The technical solution of the embodiments of the present application is implemented as follows:
[0005] In a first aspect, the embodiments of the present application provide a three-dimensional mesh data filtering method, which comprises: obtaining an initial three-dimensional mesh model; determining that the curvature of any vertex in the initial three-dimensional mesh model is greater than or equal to a curvature threshold of the three-dimensional mesh model; performing the following iterative filtering processing on the initial three-dimensional mesh model: performing feature recognition on the initial three-dimensional mesh model based on the curvature of each vertex in the initial three-dimensional mesh model to determine a non-feature area and a feature area in the initial three-dimensional mesh model; performing filtering processing on the non-feature area and the feature area by using a Laplace filtering algorithm and a feature recovery algorithm respectively to obtain a target three-dimensional mesh model; and determining that the filtering of the initial three-dimensional mesh model is completed in a case where the curvature of each vertex in the target three-dimensional mesh model is less than the curvature threshold.
[0006] In a second aspect, the embodiments of the present application provide a three-dimensional mesh data filtering device, the device comprising: an obtaining module configured to obtain an initial three-dimensional mesh model; a first determining module configured to determine whether the curvature of any vertex in the initial three-dimensional mesh model is greater than or equal to a curvature threshold of the three-dimensional mesh model; an iterative filtering module configured to perform the following iterative filtering process on the initial three-dimensional mesh model: performing feature recognition on the initial three-dimensional mesh model based on the curvature of each vertex in the initial three-dimensional mesh model to determine a non-feature region and a feature region in the initial three-dimensional mesh model; performing filtering processing on the non-feature region and the feature region by using a Laplace filtering algorithm and a feature recovery algorithm respectively to obtain a target three-dimensional mesh model; and a second determining module configured to determine that the filtering of the initial three-dimensional mesh model is completed when it is determined that the curvature of each vertex in the target three-dimensional mesh model is less than the curvature threshold.
[0007] In a third aspect, the embodiments of the present application provide an electronic device, comprising a memory and a processor, wherein the memory stores a computer program capable of running on the processor, and the processor implements the above method when executing the program.
[0008] In a fourth aspect, the embodiments of the present application provide a storage medium storing executable instructions for causing a processor to implement the above method when executing the instructions.
[0009] In this embodiment, an initial 3D mesh model is first obtained; then, it is determined that the curvature of any vertex in the initial 3D mesh model is greater than or equal to the curvature threshold of the 3D mesh model; the following iterative filtering process is performed on the initial 3D mesh model: feature recognition is performed on the initial 3D mesh model based on the curvature of each vertex in the initial 3D mesh model to determine the non-feature regions and feature regions in the initial 3D mesh model; the non-feature regions and the feature regions are respectively filtered using the Laplace filter algorithm and the feature recovery algorithm to obtain the target 3D mesh model; finally, if it is determined that the curvature of each vertex in the target 3D mesh model is less than the curvature threshold, the filtering of the initial 3D mesh model is considered complete. In this way, surface feature regions are identified in the 3D mesh model, and model feature differentiation filtering is performed on the non-feature regions and feature regions. The Laplace filter algorithm is applied to the non-feature regions for surface filtering, and the feature recovery algorithm is applied to the feature regions. The processing results ensure the smoothness of the filtered surface of the 3D geographic information mesh; at the same time, feature recovery is performed on the feature regions, so that the mesh features are well preserved during filtering. The overall algorithm has near-linear complexity in terms of efficiency. When applied, it can perform filtering on feature regions and non-feature regions in parallel, thus having a greater advantage in processing large-scale 3D geographic information grid models. This improves the applicability of the algorithm, enhances grid processing efficiency, and preserves grid filtering features. Attached Figure Description
[0010] Figure 1 A schematic diagram illustrating the implementation process of the three-dimensional network data filtering method provided in this application embodiment;
[0011] Figure 2A A schematic diagram illustrating the implementation process of a feature recognition method provided in an embodiment of this application;
[0012] Figure 2B This is a schematic diagram of a first-order neighborhood of a vertex provided in an embodiment of this application;
[0013] Figure 3 A schematic diagram illustrating the implementation process of the three-dimensional network data filtering method provided in this application embodiment;
[0014] Figure 4A This is a schematic diagram of the original point cloud data after filtering processing provided in an embodiment of this application;
[0015] Figure 4B The three-dimensional image provided in the embodiments of this application after filtering processing;
[0016] Figure 5 A schematic diagram of the composition structure of the three-dimensional network data filtering device provided in the embodiments of this application;
[0017] Figure 6 This is a schematic diagram of a hardware entity of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of the embodiments will be further described in detail below with reference to the accompanying drawings. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0019] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0020] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0022] This application provides a three-dimensional network data filtering method, such as... Figure 1 As shown, the method includes:
[0023] Step S110: Obtain the initial 3D mesh model;
[0024] The initial three-dimensional mesh model can be a stereolithography mesh model or a Stanford triangular archive mesh model.
[0025] During implementation, StereoLithography (STL) or Stanford Triangle Format (PLY) mesh data can be read in. STL is a file format used in stereolithography computer-aided design software. STL files describe the surface geometry of a 3D object but lack color, material maps, or other common 3D model attributes. The STL format has both text and binary formats. PLY is used to store the 3D numerical values of the stereo scanning results. It describes a 3D object through a set of polygon facets and can store information including color, transparency, surface normals, material coordinates, and data reliability. Different attributes can be set for the front and back faces of the polygons.
[0026] In some embodiments, the three-dimensional mesh data can be described using the following formula (1):
[0027]
[0028] wherein Vertex (V) is used to describe the vertex coordinates in the three-dimensional mesh data, i is used to represent the serial number of the vertex, x, y, and z are respectively used to represent the three-dimensional coordinates, n v is used to represent the number of vertices; Edge (E) is used to describe two edge data connected with the vertex in the three-dimensional mesh data, k is used to represent the serial number of the edge, i1 and i2 respectively represent two vertices of the edge, n E is used to represent the number of edges; Face (F) is used to describe a triangular face in the three-dimensional mesh data, k is used to represent the serial number of the triangular face, i1, i2, and i3 respectively represent three vertices of the triangular face, n F is used to represent the number of edges. Surface (S) is described using the vertices and the triangular faces.
[0029] Step S120, determining whether the curvature of any vertex in the initial three-dimensional mesh model is greater than or equal to the curvature threshold of the three-dimensional mesh model.
[0030] Here, the user can set the curvature threshold according to actual needs.
[0031] In the implementation process, the curvature of each vertex in the initial three-dimensional mesh model can be determined first, and then the curvature of each vertex is compared with the curvature threshold to determine whether the curvature of each vertex is greater than the curvature threshold.
[0032] In the case where the curvature of any vertex in the initial three-dimensional mesh model is greater than or equal to the curvature threshold, step S130 is performed to filter the initial three-dimensional mesh model.
[0033] Step S130, performing the following iterative filtering process on the initial three-dimensional mesh model:
[0034] Based on the curvature of each vertex in the initial three-dimensional mesh model, feature recognition is performed on the initial three-dimensional mesh model to determine the non-feature region and the feature region in the initial three-dimensional mesh model.
[0035] In the implementation process, the curvature of each vertex in the initial three-dimensional mesh model can be determined first, and then according to the set curvature threshold, the vertices in the initial three-dimensional mesh model are divided into two categories, i.e., the vertices with a curvature greater than or equal to the curvature threshold are divided into feature points, and the vertices with a curvature less than the curvature threshold are divided into non-feature points; then the feature region is determined based on the feature points, and the non-feature region is determined based on the non-feature points.
[0036] The non-feature region and the feature region are respectively filtered by using a Laplace filtering algorithm and a feature recovery algorithm to obtain a target three-dimensional mesh model;
[0037] In the implementation process, the non-feature region can be filtered by using the Laplace filtering algorithm, and the feature region can be filtered by using the feature recovery algorithm. The filtered feature region and non-feature region are fused to obtain the target three-dimensional mesh model.
[0038] In the implementation process, the non-feature region can be filtered by using the Laplace filtering algorithm, and the feature region can be filtered by using the feature recovery algorithm. The filtered feature region and non-feature region are fused to obtain the target three-dimensional mesh model.
[0039] In step S140, if the curvature of each vertex in the target three-dimensional mesh model is less than the curvature threshold of the three-dimensional mesh model, it is determined that the filtering of the initial three-dimensional mesh model is completed.
[0040] After one filtering is completed, the curvature of each vertex in the target three-dimensional mesh model can be reacquired. If the curvature of each vertex in the target three-dimensional mesh model is less than the curvature threshold, it is determined that the filtering of the initial three-dimensional mesh model is completed. If the curvature of any vertex in the target three-dimensional mesh model is greater than or equal to the curvature threshold, the step S130 is repeatedly executed for iterative filtering until the curvature of each vertex is less than the curvature threshold.
[0041] In this embodiment, an initial 3D mesh model is first obtained; then, it is determined that the curvature of any vertex in the initial 3D mesh model is greater than or equal to the curvature threshold of the 3D mesh model; the following iterative filtering process is performed on the initial 3D mesh model: feature recognition is performed on the initial 3D mesh model based on the curvature of each vertex in the initial 3D mesh model to determine the non-feature regions and feature regions in the initial 3D mesh model; the non-feature regions and the feature regions are respectively filtered using the Laplace filter algorithm and the feature recovery algorithm to obtain the target 3D mesh model; finally, if it is determined that the curvature of each vertex in the target 3D mesh model is less than the curvature threshold, the filtering of the initial 3D mesh model is considered complete. In this way, surface feature regions are identified in the 3D mesh model, and model feature differentiation filtering is performed on the non-feature regions and feature regions. The Laplace filter algorithm is applied to the non-feature regions for surface filtering, and the feature recovery algorithm is applied to the feature regions. The processing results ensure the smoothness of the filtered surface of the 3D geographic information mesh; at the same time, feature recovery is performed on the feature regions, so that the mesh features are well preserved during filtering. The overall algorithm has near-linear complexity in terms of efficiency. When applied, it can perform filtering on feature regions and non-feature regions in parallel, thus having a greater advantage in processing large-scale 3D geographic information grid models. This improves the applicability of the algorithm, enhances grid processing efficiency, and preserves grid filtering features.
[0042] In some embodiments, such as Figure 2A As shown, the step S130 above, "performing feature recognition on the initial three-dimensional mesh model based on the curvature of each vertex in the initial three-dimensional mesh model to determine the non-feature regions and feature regions in the initial three-dimensional mesh model," can be achieved through the following steps:
[0043] Step S210: Obtain the initial vertex set and the initial triangle set based on the initial 3D mesh model;
[0044] Step S220: Determine the curvature of each vertex based on the initial vertex set and the initial triangle set;
[0045] In some embodiments, the curvature of a vertex can be determined by the sum of the areas of all triangular faces adjacent to each vertex and the angle of the interior angle associated with that vertex.
[0046] In some embodiments, the curvature of the vertex can also be calculated using other calculation methods.
[0047] Step S230: Sequentially determine whether the curvature of each vertex is greater than the curvature threshold;
[0048] Step S240, determining the non-feature region based on a first vertex set whose curvature is less than the curvature threshold value;
[0049] Step S250, determining the feature region based on a second vertex set whose curvature is greater than or equal to the curvature threshold value.
[0050] In the implementation process, the division of the non-feature region and the feature region can be performed according to a given curvature threshold value δ to divide different feature regions and store them into different region vertex tables, including the non-feature region S1 and the feature region S2, where S1∈{v1, v2, v3,..., v m |K(v i )<δ} and S2∈{v1, v2, v3,..., v m |K(v i )>=δ}, and m is a positive integer.
[0051] In the embodiments of the present application, first, an initial vertex set and an initial triangular face set are obtained based on an initial three-dimensional mesh model; then, the curvature of each vertex is determined based on the initial vertex set and the initial triangular face set; whether the curvature of each vertex is greater than a curvature threshold value is determined in turn; finally, the non-feature region is determined based on a first vertex set whose curvature is less than the curvature threshold value; and the feature region is determined based on a second vertex set whose curvature is greater than or equal to the curvature threshold value. In this way, the non-feature region and the feature region of the initial three-dimensional mesh model can be determined based on the curvature of each vertex.
[0052] In some embodiments, the above step S220 “determining the curvature of each vertex based on the initial vertex set and the initial triangular face set” can be implemented by the following steps:
[0053] Step 221, determining the area and the internal angle of the triangular face adjacent to each vertex based on the initial vertex set and the initial triangular face set.
[0054] Figure 2B A vertex first-order neighborhood diagram provided by the embodiments of the present application is shown in FIG. 1, which includes a vertex v, a vertex first-order neighborhood v1, v2, v3, v4, v5 and v6 of the vertex v, A(v) is the area sum of all triangular faces adjacent to the vertex v, and θi is the angle value of the internal angle i. i Figure 2B Here, the first-order neighborhood of the mesh vertex can be defined as the vertex directly adjacent to the vertex.
[0055]
[0056] In the implementation, the area of the triangular faces adjacent to each vertex and the internal angle sum associated with each vertex can be determined based on the initial vertex set and the initial triangular face set. For example, as shown in FIG. 9, the area A(v) of the six triangular faces adjacent to vertex v and the six internal angle sums associated with vertex v can be determined. Here, the area A(v) can be calculated using the following formula (1): Figure 2B The six internal angle sums associated with vertex v are described in FIG. 10. Here, θi is the angle value of internal angle i, i is the first-order adjacent vertex set of vertex v. i *
[0057] Step 222: Divide the angle value obtained by subtracting the internal angle sum from 2π by the area sum to obtain the curvature of each vertex.
[0058] In the implementation, the curvature K(v) of each vertex can be obtained using the following formula (2):
[0059]
[0060] Here, A(v) is the area sum of all the triangular faces adjacent to vertex v; θi is the angle value of internal angle i; i is the first-order adjacent vertex set of vertex v. i *
[0061] In the embodiments of the present application, the area of the triangular faces adjacent to each vertex and the internal angle sum associated with each vertex are first determined based on the initial vertex set and the initial triangular face set, and then the curvature of each vertex is obtained by dividing the angle value obtained by subtracting the internal angle sum from 2π by the area sum. In this way, the curvature of each vertex can be effectively determined.
[0062] In some embodiments, the above step S130 of “performing filtering processing on the non-feature region and the feature region respectively using a Laplace filtering algorithm and a feature recovery algorithm to obtain a target three-dimensional mesh model” can be implemented through the following steps:
[0063] Step 131: Perform surface filtering processing on the non-feature region using a Laplace filtering algorithm to obtain a filtered non-feature region.
[0064] Step 132: Perform feature recovery processing on the feature region using a feature recovery algorithm to obtain a feature region with completed feature recovery.
[0065] Step 133: Fuse the filtered non-feature region and the feature region with completed feature recovery to obtain the target three-dimensional mesh model.
[0066] In this embodiment, the non-feature regions are surface-filtered using a Laplace filter algorithm to obtain filtered non-feature regions; the feature regions are then restored using a feature recovery algorithm to obtain restored feature regions; the filtered non-feature regions and the restored feature regions are fused to obtain the target 3D mesh model. This achieves model feature differentiation filtering for both non-feature and feature regions. Applying a Laplace filter to the non-feature regions and a feature recovery algorithm to the feature regions ensures the smoothness of the filtered surface of the 3D geographic information mesh; simultaneously, feature recovery in the feature regions ensures good preservation of mesh features during filtering.
[0067] In some embodiments, step 131 above, "applying the Laplace filter algorithm to the non-feature region for surface filtering to obtain the filtered non-feature region," can be achieved through the following steps:
[0068] Step 1311: Obtain the weight coefficients of the initial 3D mesh model;
[0069] Here, users can determine the weight coefficient σ of the initial 3D mesh model based on actual needs, where 0 < σ < 1.
[0070] Step 1312: Determine a vertex to be processed in the non-feature region and a set of first-order neighborhood points of the vertex to be processed;
[0071] In the implementation process, firstly, a vertex to be processed in the feature region is determined, and then the set of first-order neighborhood points of the vertex to be processed is determined based on the vertex to be processed.
[0072] like Figure 2B As shown, the schematic diagram includes: vertex v, and the first-order neighbors of vertex v v1, v2, v3, v4, v5 and v6, that is, the vertex v to be processed and the set of first-order neighbors of the vertex to be processed: v1, v2, v3, v4, v5 and v6.
[0073] Step 1313: Determine the influence weight of each first-order neighbor point in the first-order neighbor point set based on the vertex to be processed, the weight coefficient, and the first-order neighbor point set of the vertex to be processed.
[0074] During implementation, the influence weight ω of each first-order neighbor point can be obtained using the following formula (3). ij :
[0075]
[0076] Where σ is the weighting coefficient, and 0 < σ < 1; v i v is the i-th vertex to be processed;j is the first-order neighborhood point of the jth vertex to be processed; ω ij is the influence weight of the jth first-order neighborhood point.
[0077] Step 1314, adding values obtained by multiplying the influence weight of each first-order neighborhood point by the coordinate value of the first-order neighborhood point to obtain a first sum value;
[0078] Step 1315, adding the influence weight of each first-order neighborhood point to obtain a second sum value;
[0079] Step 1316, dividing the first sum value by the second sum value to obtain the coordinate value of the vertex after filtering;
[0080] In the implementation process, the coordinate value v` of the vertex after filtering can be obtained by using the following formula (4): i
[0081]
[0082] wherein, is the first sum value, that is, the value obtained by adding the value obtained by multiplying the influence weight ω ij of each first-order neighborhood point by the coordinate value v j of the first-order neighborhood point; and j∈i *ω ij is the second sum value, that is, the value obtained by adding the influence weight ω ij of each first-order neighborhood point.
[0083] Step 1317, sequentially processing the remaining vertices to be processed in the non-feature region to obtain the non-feature region after filtering.
[0084] Sequentially processing the remaining vertices to be processed in the non-feature region to obtain the non-feature region after filtering, that is, the grid filtering can obtain a smoother surface S1`∈{v1`,v2`,v3`,...,v m `|K(v i `)<δ}.
[0085] In the embodiment of the application, the Laplace filtering algorithm (that is, a gradual diffusion process, in which some spikes and noise fluctuations of the curved surface will quickly spread to the surrounding area, so that the curved surface becomes smooth) of formula (4) is applied to the non-feature region S1 for grid filtering, and a smoother grid surface can be obtained.
[0086] In some embodiments, the above step 132, “performing feature restoration processing on the feature region by using a feature restoration algorithm to obtain a feature region after feature restoration”, can be implemented by the following steps:
[0087] Step 1321, obtaining the weight coefficient, normal constant filtering factor and negative constant filtering factor of the initial three-dimensional mesh model;
[0088] Here, the user can determine the weight coefficient σ of the initial three-dimensional mesh model based on actual needs; determine the normal constant filtering factor λ and the negative constant filtering factor μ based on the curvature of each vertex in the initial three-dimensional mesh model, wherein the value range of λ and μ satisfies: 0<λ<1, 0<λ<-μ, μ+λ<0.
[0089] Step 1322, determining a to-be-processed vertex in the feature region and a first-order neighborhood point set of the to-be-processed vertex;
[0090] In the implementation process, first, a to-be-processed vertex in the feature region is determined, and then a first-order neighborhood point set of the to-be-processed vertex is determined based on the to-be-processed vertex.
[0091] As shown in the schematic diagram, the schematic diagram includes: a vertex v, a first-order neighborhood v1, v2, v3, v4, v5 and v6 of the vertex v, that is, a to-be-processed vertex v and a first-order neighborhood point set v1, v2, v3, v4, v5 and v6 of the to-be-processed vertex. Figure 2B
[0092] Step 1323, determining the influence weight of each first-order neighborhood point in the first-order neighborhood point set based on the to-be-processed vertex, the weight coefficient and the first-order neighborhood point set of the to-be-processed vertex;
[0093] In the implementation process, the influence weight ω of each first-order neighborhood point can be obtained by using the following formula (3) ij :
[0094]
[0095] Wherein, σ is the weight coefficient, and 0<σ<1; v i is the i-th to-be-processed vertex; v j is the first-order neighborhood point of the j-th to-be-processed vertex; ω ij is the influence weight of the j-th first-order neighborhood point.
[0096] Step 1324, obtaining the filtering transfer vector of the to-be-processed vertex based on the coordinate value of the to-be-processed vertex, the coordinate value of the first-order neighborhood point and the influence weight of the first-order neighborhood point;
[0097] In the implementation process, the filtering transfer vector Δv i of the i-th to-be-processed vertex can be obtained by using the following formula (5)
[0098]
[0099] wherein, △v i is the filter transition vector of the i-th vertex to be processed; ω ij is the influence weight of the j-th first-order neighborhood point; v i is the i-th vertex to be processed; v j is the j-th first-order neighborhood point of the vertex to be processed; i * is the first-order neighborhood point set of the vertex to be processed.
[0100] Step 1325, multiply the filter transition vector by the normal number filter factor and add the vertex to be processed to obtain an intermediate coordinate value;
[0101] In the implementation process, the following formula (6) can be used to obtain the intermediate coordinate value v` i :
[0102] v` i = v i + λ△v i (6) ;
[0103] wherein, v i is the i-th vertex to be processed; λ is the normal number filter factor; △v i is the filter transition vector of the i-th vertex to be processed.
[0104] Step 1326, multiply the filter transition vector by the negative constant filter factor and add the intermediate coordinate value to obtain a vertex with completed feature restoration;
[0105] In the implementation process, the following formula (7) can be used to obtain the vertex with completed feature restoration v`` i :
[0106]
[0107] wherein, v` i is the intermediate coordinate value; μ is the negative constant filter factor; △v i is the filter transition vector of the i-th vertex to be processed.
[0108] Step 1327, sequentially process the remaining vertices to be processed in the feature area to obtain a feature area with completed feature restoration.
[0109] In the embodiment of the present application, in the processing procedure of the feature region S2, the Laplace filtering with normal filter factor λ of formula (6) can be used firstly. In the application of three-dimensional space model, the simple normal filter factor Laplace filtering operation can greatly flatten the model features and lose the model details, so the feature recovery operation of negative constant filter factor μ of formula (7) is needed on the basis of the processing of formula (6) to recover the features. In this way, the feature region of the three-dimensional grid model itself is well reserved, the details of the model itself are greatly maintained, and the model can be better applied to industrial measurement and three-dimensional printing.
[0110] Figure 3 The flowchart of the three-dimensional grid data filtering method provided by the embodiment of the present application is shown in Figure 3 The method comprises the following steps:
[0111] Step S310, data input;
[0112] In the implementation process, the three-dimensional stereolithography (STL) or Stanford triangle format (PLY) grid data can be read in, the grid topology structure is established, the grid vertex table, the edge table and the face table are constructed. The three-dimensional grid data can be described by using the following formula (1):
[0113]
[0114] Wherein, V is used to describe the vertex coordinates in the three-dimensional grid data, i is used to represent the serial number of the vertex, x, y and z are respectively used to represent the three-dimensional coordinates, n v is used to represent the number of vertices; E is used to describe two edge data connected with the vertex in the three-dimensional network data, k is used to represent the serial number of the edge, i1 and i2 respectively represent two vertices of the edge, n E is used to represent the number of edges; F is used to describe the triangular face in the three-dimensional grid data, k is used to represent the serial number of the triangular face, i1, i2 and i3 respectively represent three vertices of the triangular face, n F is used to represent the number of edges. S is used to describe the surface by using the vertex and the triangular face.
[0115] Step S320, feature recognition;
[0116] In the implementation process, the first-order neighborhood of the vertex can be searched, and the first-order neighborhood of the grid vertex is defined as the vertex directly adjacent to the point, as shown in Figure 2B The first-order neighborhood vertex and the corresponding grid face are obtained by searching. The curvature K(v) of each vertex can be obtained by using the following formula (2):
[0117]
[0118] wherein A(v) is the sum of the areas of all the triangles adjacent to vertex v; θ i is the angle value of the inner angle i; i * is the first-order adjacent vertex set of vertex v.
[0119] Step S330, determining whether the feature point is determined;
[0120] The non-feature region and the feature region are divided, different feature regions can be divided according to a given curvature threshold δ, and stored in different region vertex tables, including a non-feature region S1 and a feature region S2, wherein S1 ∈ {v1, v2, v3,..., v m |K(v i )<δ}, S2 ∈ {v1, v2, v3,..., v m |K(v i )>=δ}, and m is a positive integer.
[0121] In the case where the to-be-processed vertex is determined to belong to the feature region, step S340 is executed; in the case where the to-be-processed vertex is determined to belong to the non-feature region, step S350 is executed.
[0122] Step S340, processing by using a feature recovery filtering algorithm;
[0123] In the processing process of the feature region S2, first, Laplace filtering with a normal number filtering factor is performed according to formula (5). In the application of a three-dimensional space model, the simple normal number filtering factor Laplace filtering operation can greatly smooth the model features and lose the model details, and thus on the basis of the processing of formula (5), a feature recovery operation of a negative constant filtering factor of formula (6) is further needed to recover the features.
[0124] Here, the following formula (5) can be used to obtain the filtering transition vector △v i :
[0125]
[0126] wherein △v i is the filtering transition vector of the i-th to-be-processed vertex; ω ij is the influence weight of the j-th first-order neighborhood point; v i is the i-th to-be-processed vertex; v j is the j-th to-be-processed vertex of the first-order neighborhood point; i * is the first-order adjacent vertex set of the to-be-processed vertex.
[0127] The following formula (6) can be used to obtain the intermediate coordinate value v` i :
[0128] vi = vi + λ△vi i i (6);
[0129] vi = vi + λ△vi i is the i-th vertex to be processed; λ is a normal number filtering factor; △vi i is the filtering transition vector of the i-th vertex to be processed.
[0130] Step S350, processing using a non-feature filtering algorithm;
[0131] For the non-feature region S1, the Laplace filtering algorithm of formula (4) (i.e. a step-by-step diffusion process in which some spikes and noise fluctuations of the curved surface will quickly spread to the surrounding area, so that the curved surface becomes smooth) is applied to perform grid filtering, and a relatively smooth grid surface S1`∈{v1`, v2`, v3`,..., v m `|K(v i `)<δ} is obtained.
[0132] Here, the following formula (4) can be used to obtain the coordinate value v` i of the completed filtering vertex:
[0133]
[0134] wherein, is a first sum value, i.e. a sum of values obtained by multiplying the influence weight ω ij of each of the first-order neighborhood points by the coordinate value v j of the first-order neighborhood point; is a second sum value, i.e. a sum of values obtained by multiplying the influence weight ω ij of each of the first-order neighborhood points.
[0135] Step S360, data fusion;
[0136] The grid data processed through the step S340 and the step S350 are fused to obtain target three-dimensional grid data.
[0137] Step S370, determining whether iteration is completed;
[0138] After completing one filtering, the curvature of each vertex in the target three-dimensional grid model can be re-acquired; in a case where it is determined that the curvature of each vertex in the target three-dimensional grid model is less than the curvature threshold, it can be determined that the filtering of the initial three-dimensional grid model is completed; in a case where it is determined that the curvature of any vertex in the target three-dimensional grid model is greater than or equal to the curvature threshold, the iteration filtering is performed by turning to execute the step S320, until it is determined that the curvature of each vertex is less than the curvature threshold.
[0139] Step S380, data output.
[0140] In the embodiments of the present application, the filtering process can be iterated according to the processing effect, and the data of the non-feature region and the feature region needs to be fused at the end of each iteration, and finally the complete filtered mesh data is output to obtain smooth mesh data, and the feature region of the mesh model itself is well preserved, which greatly maintains the details of the model itself and can be better applied to industrial measurement and three-dimensional printing.
[0141] Figure 4A The original point cloud data provided by the embodiments of the present application for completing the filtering process is shown in the figure; Figure 4B The three-dimensional image provided by the embodiments of the present application for completing the filtering process is shown in the figure; Figure 4A And 4B It can be seen that based on high-precision real scene map, based on geographic location information, combined with rural high-definition satellite image and three-dimensional modeling of oblique photography data, a full-immersion three-dimensional real scene rural display platform is formed. Compared with the digital large screen constructed on the two-dimensional basis, the three-dimensional rural digital large screen can well realize the display and query of the plane information, and the emergence of three-dimensional visualization technology fundamentally breaks through the limitation of geographic spatial information expression and processing, and makes up for the lack of perception and experience of two-dimensional rural geoscience data. The three-dimensional mesh data filtering method provided by the embodiments of the present application filters the mesh data with noise obtained by on-site exploration to obtain more accurate and complete building contours.
[0142] Based on the foregoing embodiments, the embodiments of the present application provide a three-dimensional mesh data filtering device, which includes various modules, each module includes various sub-modules, and can be realized by a processor in an electronic device; of course, it can also be realized by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
[0143] Figure 5 The composition structure diagram of the three-dimensional mesh data filtering device provided by the embodiments of the present application is shown in the figure, Figure 5 As shown in the figure, the device 500 includes:
[0144] The acquisition module 510 is configured to acquire an initial three-dimensional mesh model.
[0145] The first determination module 520 is configured to determine the curvature of any vertex in the initial three-dimensional mesh model greater than or equal to the curvature threshold of the three-dimensional mesh model.
[0146] The iterative filtering module 530 is configured to perform the following iterative filtering processing on the initial three-dimensional mesh model:
[0147] perform feature recognition on the initial three-dimensional mesh model based on the curvature of each vertex in the initial three-dimensional mesh model to determine a non-feature region and a feature region in the initial three-dimensional mesh model; and perform filtering processing on the non-feature region and the feature region respectively using a Laplace filtering algorithm and a feature recovery algorithm to obtain a target three-dimensional mesh model.
[0148] The second determination module 540 is configured to determine that the filtering of the initial three-dimensional mesh model is completed when it is determined that the curvature of each vertex in the target three-dimensional mesh model is less than the curvature threshold.
[0149] In some embodiments, the iterative filtering module 530 includes a surface filtering submodule, a feature recovery submodule, and a fusion submodule. The surface filtering submodule is configured to perform surface filtering processing on the non-feature region using a Laplace filtering algorithm to obtain a filtered non-feature region. The feature recovery submodule is configured to perform feature recovery processing on the feature region using a feature recovery algorithm to obtain a feature region after feature recovery. The fusion submodule is configured to fuse the filtered non-feature region and the feature region after feature recovery to obtain the target three-dimensional mesh model.
[0150] In some embodiments, the surface filtering submodule includes a first acquisition unit, a first determination unit, a second determination unit, a first summation unit, a second summation unit, a first division unit, and a first sequential processing unit. The first acquisition unit is configured to acquire a weight coefficient of the initial three-dimensional mesh model. The first determination unit is configured to determine a to-be-processed vertex in the non-feature region and a first-order neighbor point set of the to-be-processed vertex. The second determination unit is configured to determine an influence weight of each first-order neighbor point in the first-order neighbor point set based on the to-be-processed vertex, the weight coefficient, and the first-order neighbor point set of the to-be-processed vertex. The first summation unit is configured to sum values obtained by multiplying the influence weight of each first-order neighbor point by the coordinate value of the first-order neighbor point to obtain a first summation value. The second summation unit is configured to sum the influence weights of each first-order neighbor point to obtain a second summation value. The first division unit is configured to divide the first summation value by the second summation value to obtain a coordinate value of a filtered vertex. The first sequential processing unit is configured to sequentially process the remaining to-be-processed vertices in the non-feature region to obtain the filtered non-feature region.
[0151] In some embodiments, the feature recovering submodule comprises a second acquisition unit, a third determination unit, a fourth determination unit, a third adding unit, a first adding unit, a second adding unit and a second sequential processing unit, wherein the second acquisition unit is configured to acquire a weight coefficient, a normal constant filtering factor and a negative constant filtering factor of the initial three-dimensional mesh model; the third determination unit is configured to determine a to-be-processed vertex in the feature region and a first-order neighborhood point set of the to-be-processed vertex; the fourth determination unit is configured to determine an influence weight of each first-order neighborhood point in the first-order neighborhood point set based on the to-be-processed vertex, the weight coefficient and the first-order neighborhood point set of the to-be-processed vertex; the third adding unit is configured to obtain a filtering transition vector of the to-be-processed vertex based on a coordinate value of the to-be-processed vertex, a coordinate value of the first-order neighborhood point and the influence weight of the first-order neighborhood point; the first adding unit is configured to obtain an intermediate coordinate value by multiplying the filtering transition vector by the normal constant filtering factor and adding the intermediate coordinate value to the coordinate value of the to-be-processed vertex; the second adding unit is configured to obtain a coordinate value of a feature recovery completed vertex by multiplying the filtering transition vector by the negative constant filtering factor and adding the intermediate coordinate value to the coordinate value of the to-be-processed vertex; and the second sequential processing unit is configured to sequentially process the remaining to-be-processed vertices in the feature region to obtain a feature recovery completed feature region.
[0152] In some embodiments, the iterative filtering module 530 further comprises an acquisition submodule, a first determination submodule, a sequential determination submodule, a second determination submodule and a third determination submodule, wherein the acquisition submodule is configured to acquire an initial vertex set and an initial triangular face set based on the initial three-dimensional mesh model; the first determination submodule is configured to determine a curvature of each vertex based on the initial vertex set and the initial triangular face set; the sequential determination submodule is configured to sequentially determine whether the curvature of each vertex is greater than the curvature threshold; the second determination submodule is configured to determine the non-feature region based on a first vertex set whose curvature is less than the curvature threshold; and the third determination submodule is configured to determine the feature region based on a second vertex set whose curvature is greater than or equal to the curvature threshold.
[0153] In some embodiments, the first determination submodule comprises a fifth determination unit and a second division unit, wherein the fifth determination unit is configured to determine an area sum and an inner angle sum of triangular faces adjacent to each vertex based on the initial vertex set and the initial triangular face set; and the second division unit is configured to obtain the curvature of each vertex by dividing an angle value obtained by subtracting the inner angle sum from 2π by the area sum.
[0154] In some embodiments, the initial three-dimensional mesh model is a stereolithography mesh model or a Stanford triangle archive mesh model.
[0155] The above description of the device embodiments is similar to the description of the method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments for understanding.
[0156] It should be noted that, in the embodiments of the present application, if the above method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of a software product in essence or the part that contributes to the related art, and the computer software product is stored in a storage medium, including a plurality of instructions for causing an electronic device (which can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.) to execute all or part of the method described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various media that can store program codes. Thus, the embodiments of the present application are not limited to any specific hardware and software combination.
[0157] Correspondingly, the embodiments of the present application provide a storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the steps of the three-dimensional grid data filtering method provided in the above embodiments.
[0158] Correspondingly, the embodiments of the present application provide an electronic device, Figure 6 A hardware entity schematic diagram of the electronic device provided in the embodiments of the present application is shown in FIG. 6, which includes a memory 601 and a processor 602. The memory 601 stores a computer program executable on the processor 602, and the processor 602 implements the steps of the three-dimensional grid data filtering method provided in the above embodiments when executing the program. Figure 6
[0159] The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data (for example, image data, audio data, voice communication data and video communication data) to be processed by the processor 602 and each module in the electronic device 600. The memory 601 can be implemented by a flash memory (FLASH) or a random access memory (RAM).
[0160] It should be noted that the description of the storage medium and device embodiments above is similar to the description of the method embodiments above, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0161] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that the size of the sequence number of each process in various embodiments of the present application does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The sequence number of the above embodiments of the present application is only for description, not representing the advantages and disadvantages of the embodiments.
[0162] It should be noted that in this document, the terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "comprises a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0163] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and actual implementation can have another division manner, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be through some interface, indirect coupling or communication connection between devices or units, which can be electrical, mechanical or other forms.
[0164] The units described above as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units; they can be located in one place or distributed on multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0165] In addition, each of the functional units in the embodiments of the present application can be integrated into one processing unit, each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in the form of hardware, or in the form of hardware plus software function units.
[0166] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by relevant hardware instructed by programs. The aforementioned programs can be stored in a computer readable storage medium, and when the programs are executed, the steps of the above-mentioned method embodiments are executed. The aforementioned storage medium includes mobile storage devices, read-only memories (ROM), magnetic discs or optical discs, and various media that can store program codes.
[0167] Alternatively, when the integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products, and the computer software products are stored in a storage medium, including a number of instructions to make an electronic device (which can be a mobile phone, a tablet computer, a notebook computer, a desktop computer, etc.) execute all or part of the methods described in the embodiments of the present application. The aforementioned storage medium includes mobile storage devices, ROM, magnetic discs or optical discs, and various media that can store program codes.
[0168] The methods disclosed in the several method embodiments of the present application can be combined arbitrarily without conflict to obtain new method embodiments.
[0169] The features disclosed in the several product embodiments of the present application can be combined arbitrarily without conflict to obtain new product embodiments.
[0170] The features disclosed in the several method or device embodiments of the present application can be combined arbitrarily without conflict to obtain new method or device embodiments.
[0171] The above is only an implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A three-dimensional mesh data filtering method, characterized in that, The method includes: Obtain the initial 3D mesh model; Determine that the curvature of any vertex in the initial 3D mesh model is greater than or equal to the curvature threshold of the 3D mesh model; The following iterative filtering process is performed on the initial 3D mesh model: Based on the curvature of each vertex in the initial 3D mesh model, feature recognition is performed on the initial 3D mesh model to determine the non-feature regions and feature regions in the initial 3D mesh model; the non-feature regions and the feature regions are respectively filtered using the Laplace filter algorithm and the feature recovery algorithm to obtain the target 3D mesh model; wherein, the Laplace filter algorithm includes: determining the influence weight of each first-order neighbor point of the vertex to be processed based on the weight coefficients of the initial 3D mesh model, and obtaining the coordinate value of the filtered vertex based on the ratio of the influence weight to the first sum of the first-order neighbor points and the second sum of the influence weight; If the curvature of each vertex in the target 3D mesh model is determined to be less than the curvature threshold, the filtering of the initial 3D mesh model is determined to be complete.
2. The method as described in claim 1, characterized in that, The process of applying Laplace filtering and feature recovery algorithms to the non-feature regions and feature regions respectively to obtain the target 3D mesh model includes: The non-feature region is subjected to surface filtering using the Laplace filter algorithm to obtain the filtered non-feature region. The feature region is processed by a feature recovery algorithm to obtain the feature region after feature recovery. The target 3D mesh model is obtained by fusing the non-feature regions that have completed filtering and the feature regions that have completed feature recovery.
3. The method as described in claim 2, characterized in that, The surface filtering process performed on the non-feature region using the Laplace filter algorithm to obtain the filtered non-feature region includes: Obtain the weight coefficients of the initial 3D mesh model; Determine a vertex to be processed and a set of first-order neighborhood points of the vertex to be processed within the non-feature region; The influence weight of each first-order neighbor in the first-order neighbor set is determined based on the vertex to be processed, the weight coefficient, and the first-order neighbor set of the vertex to be processed. The values obtained by multiplying the influence weight of each first-order neighbor point by the coordinate value of the first-order neighbor point are summed to obtain the first sum value. The influence weights of each first-order neighbor point are summed to obtain the second sum value; Divide the first summed value by the second summed value to obtain the coordinate value of the filtered vertex; The remaining vertices in the non-feature region are processed sequentially to obtain the filtered non-feature region.
4. The method as described in claim 2, characterized in that, The step of performing feature recovery processing on the feature region using a feature recovery algorithm to obtain the feature region with completed feature recovery includes: Obtain the weight coefficients, positive constant filter factor, and negative constant filter factor of the initial 3D mesh model; Determine a vertex to be processed in the feature region and a set of first-order neighborhood points of the vertex to be processed; The influence weight of each first-order neighbor in the first-order neighbor set is determined based on the vertex to be processed, the weight coefficient, and the first-order neighbor set of the vertex to be processed. Based on the coordinates of the vertex to be processed, the coordinates of the first-order neighboring points, and the influence weights of the first-order neighboring points, the filter transition vector of the vertex to be processed is obtained. The intermediate coordinate value is obtained by multiplying the filter transition vector by the positive constant filter factor and adding it to the coordinate value of the vertex to be processed. Multiply the filter transfer vector by the negative constant filter factor and add it to the intermediate coordinate value to obtain the coordinate value of the vertex where the feature recovery is completed; The remaining vertices in the feature region are processed sequentially to obtain the feature region with complete feature recovery.
5. The method as described in claim 1, characterized in that, The step of performing feature recognition on the initial 3D mesh model based on the curvature of each vertex in the initial 3D mesh model to determine the non-feature regions and feature regions in the initial 3D mesh model includes: Based on the initial 3D mesh model, obtain the initial vertex set and the initial triangle set; The curvature of each vertex is determined based on the initial vertex set and the initial triangle set; Sequentially determine whether the curvature of each vertex is greater than the curvature threshold; The non-feature region is determined based on a first set of vertices whose curvature is less than the curvature threshold. The feature region is determined based on a second set of vertices whose curvature is greater than or equal to the curvature threshold.
6. The method as described in claim 5, characterized in that, Determining the curvature of each vertex based on the initial vertex set and the initial triangle set includes: Based on the initial set of vertices and the initial set of triangles, determine the sum of the areas and the sum of the interior angles of the triangles adjacent to each vertex; The curvature of each vertex is obtained by subtracting the sum of the interior angles from 2π and dividing the sum of the areas.
7. The method according to any one of claims 1 to 6, characterized in that, The initial three-dimensional mesh model is a stereolithography mesh model or a Stanford triangular archive mesh model.
8. A three-dimensional mesh data filtering device, characterized in that, The device includes: The acquisition module is used to acquire the initial 3D mesh model; The first determining module is used to determine that the curvature of any vertex in the initial three-dimensional mesh model is greater than or equal to the curvature threshold of the three-dimensional mesh model; The iterative filtering module is used to perform the following iterative filtering process on the initial 3D mesh model: Based on the curvature of each vertex in the initial 3D mesh model, feature recognition is performed on the initial 3D mesh model to determine the non-feature regions and feature regions in the initial 3D mesh model; the non-feature regions and the feature regions are respectively filtered using the Laplace filter algorithm and the feature recovery algorithm to obtain the target 3D mesh model; wherein, the Laplace filter algorithm includes: determining the influence weight of each first-order neighbor point of the vertex to be processed based on the weight coefficients of the initial 3D mesh model, and obtaining the coordinate value of the filtered vertex based on the ratio of the influence weight to the first sum of the first-order neighbor points and the second sum of the influence weight; The second determining module is used to determine the completion of filtering of the initial three-dimensional mesh model when the curvature of each vertex in the target three-dimensional mesh model is less than the curvature threshold.
9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The device stores executable instructions for causing a processor to execute, thereby implementing the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Triangular mesh filtering method based on Laplace operator and terminal device
CN110120069A
Substation three-dimensional point cloud model denoising method based on curvature weighted guidance
CN112598588A