Optimization method of QEM algorithm based on tip feature degree and area weighting
By introducing the average area and sharp eigenity of neighboring triangles, and using Laplace operator to adjust the vertex position, the problem of QEM algorithm losing geometric details and producing low-quality triangles in three-dimensional model rendering is solved, and the smooth rendering and visual effect of the model is improved.
Patent Information
- Application Number
- CN202510340283.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-04
AI Technical Summary
The existing QEM algorithms are prone to losing geometric details and producing low-quality narrow triangles during the simplified process of three-dimensional model rendering, resulting in poor visual effects of the model.
The average area and sharp eigenvalue of neighboring triangles are introduced as new constraint factors to optimize the folding cost, and the Laplace operator is used to adjust the vertex position to form an optimized folding cost. By calculating the average area and the number of pointed feature edges of neighboring triangles, and combining with the Laplace operator to optimize the vertex position, an improved QEM algorithm is formed.
Effectively retain the geometric details of the model, eliminate low-quality narrow triangles, and improve the visual effect and overall quality after rendering of the model.
Smart Images

Figure CN120259509A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to an optimization method for the QEM algorithm based on sharp feature degree and area weighting. Background Art
[0002] In practical applications, current 3D models often face the problem of excessive data volume. For example, in the use of BIM models in the engineering field, the volume of a BIM model is often extremely large, and users will encounter situations such as slow model loading, model distortion, lag, and even crashes during use, seriously affecting the user experience. Therefore, the simplification and optimization of 3D model rendering are current hot research directions.
[0003] Currently, the commonly used 3D model rendering simplification ideas are mainly divided into three categories, namely: vertex clustering method, region merging method, and geometric deletion method. The vertex clustering method means: dividing the mesh model into several regions, merging the vertices in each region into one point according to certain rules as the new vertex after simplification, and re-triangulating the model according to the new vertex to obtain the simplified 3D mesh model. The region merging method means: merging adjacent triangles on the same plane of the model according to certain merging rules to generate a larger polygon, and re-triangulating the merged plane to form a mesh model. Among these three categories, the most commonly used is the geometric deletion method. This type of simplification idea is a method of simplifying the model and reducing the model data volume by folding elements such as vertices, edges, and triangular meshes of the model to delete redundant model data. In the algorithm idea of the geometric deletion method, the most famous and commonly used algorithm is the QEM (Quadric Error Metrics) algorithm.
[0004] The QEM algorithm is a mesh simplification algorithm proposed by G. Garland. He first proposed the concept of quadratic error metric, that is, representing the distance from the point to be folded to the adjacent surface as a quadratic error matrix, adding the error cost as a folding constraint factor to the folding process, and determining the folding order according to the size of the folding cost. The advantages of this algorithm are simplicity and low complexity, but there are the following problems: (1) The mesh folding algorithm is prone to losing feature regions: The commonly used method in the current field to reduce the model volume is to achieve it through the geometric deletion method. That is, by deleting certain points, edges, and triangles in the triangular mesh model to reduce data redundancy and the model data volume. For example, for a complex model folded by the QEM algorithm, due to the overly single folding factor considered, it cannot reflect the geometric detail features of the model from multiple dimensions, and there may be a problem of losing the geometric detail features of the model after folding, resulting in poor visual quality in regions such as the edges, corners, and boundaries of the model.
[0005] 2. The quality of the simplified model is poor, with irregular triangles: The conventional model simplification idea usually only considers the simplification problem of triangular meshes, and there is not much research on optimizing the spatial topological structure of the simplified model. Therefore, problems such as flipped patches and low-quality long and narrow triangles may occur in the triangular meshes of the simplified model, seriously affecting the visual effect and overall quality of the model.
[0006] Glossary: Average area of neighboring triangles: Based on the QEM algorithm, some research further proposes to introduce the average area of neighboring triangles as a control factor, which can improve the accuracy of the folding cost to a certain extent. Through the area of neighboring triangles, the grid density around the vertex can be reflected to measure the degree of detail features of the vertex.
[0007] Sharp feature degree: Liu Xiaoli proposed the concept of the sharp feature degree of vertices based on the traditional QEM algorithm. The sharp feature degree mainly involves two concepts, sharp feature edges and the sharp feature degree of vertices. A sharp feature edge refers to a given threshold , if the dihedral angle (the included angle between the outer normal vectors of two faces) of two faces adjacent to any edge in the triangular mesh is greater than the threshold , then this edge is defined as a sharp feature edge, and the boundary edges of the 3D model are specified as sharp feature edges. Among them, the threshold is an empirical constant, which is set to different values according to the required feature degree. Based on the concept of sharp feature edges, the sharp feature degree of a vertex is defined as the number of sharp feature edges adjacent to a vertex. That is , where, is an empirical constant, which is set according to experience and the required degree of feature retention. is the number of feature edges adjacent to the vertex. However, this empirical constant cannot objectively and perfectly express the degree of vertex features to a certain extent, so there is still room for research.
[0008] Laplace operator: The Laplace operator is used to describe the change of certain physical quantities in space, and can also be used to adjust vertices, moving vertices to the geometric center of the plane to achieve the effect of optimizing the mesh. Therefore, the Laplace operator can be used to optimize the triangular meshes of the folded model. By adjusting the vertex topological structure, a large number of irregular triangular meshes existing after model simplification can be adjusted to triangular meshes that conform to the Delaunay criterion, improving the visual effect of the model. Summary of the Invention
[0009] The object of the present invention is to provide a method for solving the above problems, introducing a new constraint factor to optimize the folding cost in the original OEM algorithm, considering the folding of the model from more aspects, and optimizing the vertices based on the Laplace operator, so as to improve the overall quality of the model. An optimization method based on the QEM algorithm with sharp feature degree and area weighting.
[0010] To achieve the above object, the technical solution adopted by the present invention is as follows: An optimization method based on the QEM algorithm with sharp feature degree and area weighting, comprising the following steps; S1. Obtain the model to be simplified, simplify it using the QEM algorithm, and replace the original folding cost with the optimized folding cost during simplification to obtain the first simplified model; S2. Optimize each vertex in the first simplified model based on the Laplace operator to obtain the optimal simplified model; In S1, the optimized folding cost is obtained according to steps S11 to S13; S11. Calculate the folding cost of each edge in the model to be processed through the QEM algorithm, where the folding cost of the edge (v i , v j ) is , , where in the formula, v i , v j are the two vertices of the edge, v1 is the new vertex after folding, and T is the transpose operation; S12. Calculate the average area of the neighborhood triangles and the sharp feature edges of each vertex; S13. Calculate the optimized folding cost of each edge, where the optimized folding cost i of the edge (v j ) is obtained according to the following formula; According to the following formula; , In the formula, , are the average areas of the neighborhood triangles of v i , v j respectively, and , are the numbers of sharp feature edges of v i , v j respectively; S2 specifically includes S21 to S22; S21. Preset the operator optimization parameter u, for the first simplified model, calculate the Laplace operator of each vertex, where the Laplace operator L(i) of the vertex v i is obtained according to the following formula; , In the formula, Ad(i) represents the vertex v iThe set of adjacent vertices, N is the number of points in the set of adjacent vertices, v k is a vertex within the set of adjacent vertices; S22, based on the operator optimization parameter u, perform vertex position fine-tuning and update until the preset number of iterations is reached to obtain the optimal simplified model, where the vertex Generate the corresponding fine-tuned vertex according to the following formula , and use to update v i ; .
[0011] As a preference: For the vertex v i , the average area of its neighborhood triangles is obtained according to the following formula; , In the formula, n is the number of neighborhood triangles of the vertex v i , and A I represents the area of the I-th neighborhood triangle.
[0012] As a preference: In S1, after calculating the optimized folding cost, store the optimized folding cost in the minimum heap and perform a removal operation from the top of the minimum heap until there are no edges to be removed in the minimum heap.
[0013] As a preference: The method for judging the edges to be removed in the minimum heap is to preset a quadratic error threshold, calculate the quadratic error metric of the edge, and if it is greater than or equal to the quadratic error threshold, it is determined as an edge to be removed, otherwise it does not need to be removed.
[0014] As a preference: For the operator optimization parameter u, 0.01 ≤ u ≤ 0.1.
[0015] Compared with the prior art, the advantages of the present invention are as follows: (1) The present invention introduces new constraint factors on the basis of the traditional QEM algorithm: the average area of neighborhood triangles and the sharp feature degree. And use the average area of the vertex neighborhood triangles for weighted processing, and use this to replace the empirical constant in the old sharp feature degree folding cost, and add it as a more scientific control coefficient to the formula for calculating the QEM folding cost (original folding cost) in the prior art, so as to form an improved folding cost factor (optimized folding cost). The optimized folding cost obtained after improvement is more objective and scientific. Compared with the original folding cost, it can consider the folding of the model from more aspects. Especially in the processing of geometric detail features, the present invention can retain the parts with obvious detail features of the model to a greater extent during the patch folding, improving the visual effect after model rendering.
[0016] (2)In addition to simplifying operations, the present invention also introduces vertex optimization in model rendering. By calculating the Laplacian operator of each vertex of the simplified model, setting corresponding empirical control coefficients, and using the operator to perform topological adjustment of the spatial positions of each vertex, each vertex is adjusted to a position closer to the centroid of the triangle, so as to eliminate low-quality long and narrow triangles to the greatest extent in the three-dimensional model, make the surface of the geometric model smoother after rendering, and improve the overall quality of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is the specific flowchart of the present invention; Figure 2 is the simplified three-dimensional model diagram of the OEM algorithm in Embodiment 3; Figure 3 is the simplified three-dimensional model diagram of the method of the present invention in Embodiment 3; Figure 4 is Figure 2 the corresponding wireframe model; Figure 5 is Figure 3 the corresponding wireframe model. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] The present invention will be further described below in conjunction with the embodiments and the drawings.
[0019] Embodiment 1: Refer to Figure 1 , an optimization method based on the QEM algorithm with sharp feature degree and area weighting, including the following steps; S1. Obtain the model to be simplified, simplify it using the QEM algorithm, and replace the original folding cost with the optimized folding cost during simplification to obtain the first simplified model; S2. Optimize each vertex in the first simplified model based on the Laplacian operator to obtain the optimal simplified model; In S1, the optimized folding cost is obtained according to steps S11~S13; S11. Calculate the folding cost of each edge in the model to be processed through the QEM algorithm, where the folding cost of the edge (v i , v j ) is , , in the formula, v i , v j are the two vertices of the edge, v1 is the new vertex after folding, and T is the transpose operation; S12. Calculate the average area of the neighborhood triangles and the sharp feature edges of each vertex; S13. Calculate the optimized folding cost of each edge, where the optimized folding cost of the edge (v i , v j ) is Obtained according to the following formula; , In the formula, 、 are the average areas of the neighborhood triangles of v i 、v j respectively, 、 are the numbers of sharp feature edges of v i 、v j respectively; S2 specifically includes S21~S22; S21, preset the operator optimization parameter u, for the first simplified model, calculate the Laplacian operator of each vertex, where the Laplacian operator L(i) of vertex v i is obtained according to the following formula; , In the formula, Ad(i) represents the set of adjacent vertices of vertex v i , N is the number of points in the set of adjacent vertices, and v k is the vertex in the set of adjacent vertices; S22, based on the operator optimization parameter u, perform vertex position fine-tuning and update until the preset number of iterations is reached to obtain the optimal simplified model, where the vertex generates the corresponding fine-tuned vertex according to the following formula , and uses to update v i ; .
[0020] In this embodiment, for vertex v i , its average area of the neighborhood triangle is obtained according to the following formula; , In the formula, n is the number of neighborhood triangles of vertex v i , and A I represents the area of the I-th neighborhood triangle.
[0021] In step S1 of this embodiment, after calculating the optimized folding cost, store the optimized folding cost in the minimum heap, and perform a removal operation from the top of the minimum heap until there are no edges to be removed in the minimum heap. The method for judging the edges to be removed in the minimum heap is: preset a quadratic error threshold, calculate the quadratic error metric of the edge, if it is greater than or equal to the quadratic error threshold, then determine it as an edge to be removed, otherwise it does not need to be removed.
[0022] For the operator optimization parameter u, the value of u is an empirical constant, which is set according to experience and used to control the adjustment amplitude of vertices. If u is set too large, it may cause excessive adjustment of vertices; if u is set too small, it may not achieve an ideal effect on model optimization, and it needs to be adjusted according to the actual degree of model optimization required. In order to maintain the detailed features of the model, in this embodiment, 0.01 ≤ u ≤ 0.1.
[0023] Embodiment 2: Refer to Figure 1 , based on Embodiment 1, we give a more detailed and specific implementation process; an optimization method for the QEM algorithm based on sharp feature degree and area weighting, including the following steps; Step1: Initialize, set various parameters, including the simplification ratio, the angle threshold θ of the feature edges, the number of optimization iterations, and the optimization parameter u of the Laplacian operator; Step2: Import the model to be simplified, traverse each vertex of the model to be simplified, establish the edge list between each group of points and save it; Step3: Mark the feature edges in the edge list based on the angle threshold θ of the feature edges; Step4: Calculate the folding cost of each edge through the original QEM algorithm; Step5: Calculate the average area of the neighborhood triangles and the sharp feature edges of each vertex; Step6: Based on 's formula, calculate the optimized folding cost of each edge; Step7: Store the calculated optimized folding cost into the minimum heap; Step8: Perform a removal operation from the top of the minimum heap, that is, perform the edge folding operation of the triangular mesh until there are no edges to be removed in the minimum heap, and obtain the first simplified model; Step9: Calculate the Laplacian operator of each vertex of the first simplified model; Step10: Adjust the vertex positions based on the optimization parameter u of the Laplacian operator and update the vertex coordinates; Step11: Stop the optimization after reaching the preset number of iterations;
[0024] Step12: Obtain the optimal simplified model and save it, and the algorithm ends.
[0025] Embodiment 3: Refer to Figures 1 to 5 , for the same model to be simplified, comparative experiments are carried out using the existing OEM algorithm and the method of the present invention, and the simplified three-dimensional model diagrams of the two methods with a simplification ratio of 0.5 are as shown in Figure 2 、 Figure 3 shown, Figure 2 、 Figure 3The wireframe models of the corresponding Bunny.obj models are respectively as Figure 4 , Figure 5 shown. In Figure 4 , Figure 5 , the internal triangular patches and vertex structures can be seen.
[0026] It can be seen from Figure 4 that there are irregular triangular mesh regions marked by red circles inside the Bunny model optimized by the existing QEM algorithm. Correspondingly, in Figure 2 it can also be seen that there will be some low-quality triangular regions on the model surface.
[0027] However, it can be seen from Figure 5 that the irregular triangular mesh regions existing in the original algorithm rendering are eliminated inside the Bunny model optimized by the method of the present invention. In the corresponding Figure 3 original image model, it can also be seen that the surface of the model is smoother and there are no triangular meshes with rendering errors.
[0028] Thus, it can be seen that the optimization effect of the method of the present invention has been actually improved.
[0029] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An optimization method for the QEM algorithm based on sharp feature degree and area weighting, characterized in that: It includes the following steps; S1. Obtain the model to be simplified, simplify it using the QEM algorithm, and replace the original folding cost with the optimized folding cost during simplification to obtain the first simplified model; S2. Optimize each vertex in the first simplified model based on the Laplace operator to obtain the optimal simplified model; In S1, the optimized folding cost is obtained according to steps S11 to S13; S11, calculate the folding cost of each edge in the model to be processed through the QEM algorithm, where the edge (v i , v j ) has a folding cost of , , where v i , v j are the two vertices of the edge, v1 is the new vertex after folding, and T is the transpose operation; S12. Calculate the average area of the neighborhood triangles and the sharp feature edges of each vertex; S13, calculate the optimized folding cost of each edge, where the edge (v i , v j )'s optimized folding cost is obtained according to the following formula; , In the formula, , are respectively the average areas of the neighborhood triangles of v i and v j ; , are respectively the numbers of sharp feature edges of v i and v j ; S2 specifically includes S21 to S22; S21, Preset the operator optimization parameter u, and calculate the Laplacian operator of each vertex for the first simplified model, where the vertex v i The Laplacian operator L(i) of is obtained according to the following formula; , Where Ad(i) represents the set of adjacent vertices of vertex v i , N is the number of points in the set of adjacent vertices, and v k is the vertex within the set of adjacent vertices; S22, based on the operator optimization parameter u, perform vertex position fine-tuning and update until the preset number of iterations is reached to obtain the optimal simplified model, where the vertex Generate the corresponding fine-tuned vertex according to the following formula , and use to update v i ; 。 2. The optimization method of the QEM algorithm based on sharp feature degree and area weighting according to claim 1, characterized in that: For vertex v i , the average area of its neighboring triangles is obtained according to the following formula; , where n is the number of neighboring triangles of vertex v i and A I represents the area of the i-th neighboring triangle.
3. An optimization method for the QEM algorithm based on sharp feature degree and area weighting according to claim 1, characterized in that: In S1, after calculating the optimized folding cost, store the optimized folding cost in the minimum heap and perform a removal operation from the top of the minimum heap until there are no edges to be removed in the minimum heap.
4. An optimization method for the QEM algorithm based on sharp feature degree and area weighting according to claim 3, characterized in that: The method for judging the edges to be removed in the minimum heap is; Preset a quadratic error threshold, calculate the quadratic error metric of the edge. If it is greater than or equal to the quadratic error threshold, it is determined as an edge to be removed, otherwise it does not need to be removed.
5. An optimization method for a QEM algorithm based on sharp feature degree and area weighting according to claim 1, characterized in that: For the operator optimization parameter u, 0.01 ≤ u ≤ 0.1.
Citation Information
Cited By
Regular building three-dimensional model data lightweight method
CN120997444A
Method for lightweighting regular building three-dimensional model data
CN120997444B