Large-scale scene area reduction optimization method, device and equipment based on clustering algorithm

Through the triangular facet model optimization method based on clustering algorithm, the problems of model details retention and resource occupation optimization in large-scale scenarios are solved, the smooth processing and performance improvement of the model are achieved, and key features and details are maintained.

CN120472115AActive Publication Date: 2025-08-12ZHONGKE XINGTU DIGITAL EARTH HEFEI CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510496858.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-12
Estimated Expiration
2045-04-21

AI Technical Summary

Technical Problem

When dealing with large-scale scenarios, the existing triangular panel model optimization method is difficult to take into account the model's detail retention and resource utilization optimization, and the accuracy and robustness of plane area detection are insufficient, resulting in unsatisfactory optimization results.

Method used

Using a clustering algorithm method, we optimize the triangular facet model and generate a new triangular facet model by calculating the vertex normal vector and constructing topological relationships, combining multi-conditional plane area determination, multi-mode detection and K-Means clustering.

Benefits of technology

The smoothing treatment of the abrupt areas of the model is realized, reducing the redundancy of abnormal points and surface protrusions and patches, improving the operating performance and display effect of the model, and maintaining key features and details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120472115A_ABST
    Figure CN120472115A_ABST
Patent Text Reader

Abstract

The invention discloses a large-scale scene area reduction optimization method, device and equipment based on a clustering algorithm, and the method comprises the steps: calculating a vertex normal vector, and constructing a triangular patch topological relation; carrying out multi-condition plane region judgment, and carrying out merging and topological optimization processing on the plane regions meeting the conditions; multi-mode detection is carried out, contour points of the triangular patch model are judged, K-Means clustering is carried out on non-contour points, and a point set is formed; and performing triangulation on the point set, and reconstructing to generate a new triangular patch model. Through calculation optimization of the triangular patch model, smoothing processing of the abrupt area of the model is realized, so that after the model is optimized, abnormal point surface protrusions of the model are reduced, patch redundancy is reduced, a better display effect is kept, the operation performance of the model is greatly improved, and effect display and fluency of live-action three-dimensional rendering and demonstration are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of triangular facet model optimization in three-dimensional models, and in particular to a large-scale scene face reduction optimization method, device and equipment based on a clustering algorithm. Background Art

[0002] In 3D modeling and scene rendering, especially in the construction and visualization of large-scale scenes, triangular facet models are widely used to represent complex 3D surface structures. However, as model size and scene complexity increase, the number of facets increases dramatically, leading to problems such as large storage space requirements, long rendering times, and decreased computational performance. Therefore, optimizing models to reduce system resource usage without significantly compromising visual quality has become an important research direction in this field.

[0003] Existing methods for optimizing triangular facet models primarily include vertex simplification, edge collapse, and topology optimization. However, these methods often struggle to balance retaining model detail and optimizing resource usage when processing large-scale scenes. Many algorithms over-smoothe the model's edges during model compression, affecting the refinement of the model's contours. Therefore, a method for intelligently optimizing triangular facet models is urgently needed, minimizing the number of facets while preserving the model's key features and details.

[0004] Current technologies have the following limitations: (1) Unscientific selection of optimization areas: Previous optimization algorithms may optimize areas that should not be optimized while omitting areas that need to be optimized, resulting in unsatisfactory optimization results. (2) Incomplete optimization: Traditional methods focus on local optimization and lack the ability to optimize globally, resulting in the final result being a local optimum rather than a global optimum.

[0005] For example, the invention application with application number 202410102833.2 discloses a three-dimensional reconstruction method, device and terminal. This application can generate a high-fidelity, high-detail-preserving three-dimensional reconstruction model by combining a point cloud map with a visual image. However, its solution also has the following problems: (1) It lacks smoothing processing of the abrupt areas of the model, resulting in poor display effect; (2) It does not detect the plane area, and the accuracy and robustness of the plane area detection are poor. Summary of the Invention

[0006] In response to the above-mentioned problems, the purpose of the present invention is to provide a large-scale scene face reduction optimization method, device and equipment based on a clustering algorithm to optimize the calculation of triangular face models and improve the operating performance of the model.

[0007] Embodiments of the present invention provide a large-scale scene face reduction optimization method, apparatus, and device based on a clustering algorithm.

[0008] Aspect 1: A large-scale scene face reduction optimization method based on a clustering algorithm, comprising:

[0009] S1. Obtain the vertex coordinates of the triangular face model, calculate the vertex normal vector, and construct the triangular face topology relationship;

[0010] S2. Determine the multi-conditional plane regions of the model based on the topological relationship, and merge and perform topological optimization on the plane regions that meet at least two conditions;

[0011] S3. Perform multi-mode detection on the processed triangular face model and comprehensively judge the contour points of the triangular face model based on the detection results;

[0012] S4, retain the contour points, perform K-Means clustering on the non-contour points, and form a point set with the contour points and the clustered non-contour points;

[0013] S5. Triangulate the point set and reconstruct it to generate a new triangular face model.

[0014] Furthermore, in step S1, the vertex normal vector is calculated using the formula:

[0015]

[0016] Among them, P1, P2 and P3 are the three vertices of the triangle, and f is the vertex p i The triangle to which it belongs, n f is the normal vector of the triangle, A f is the patch area, n i For vertex p i Normal vector, F i For vertex p i The set of triangles to which it belongs.

[0017] Furthermore, the model multi-conditional plane region determination includes:

[0018] Local plane area judgment based on PCA;

[0019] Local plane area judgment based on normal vector consistency;

[0020] The local plane region is judged based on the local plane fitting error.

[0021] Furthermore, the local plane area judgment based on PCA is expressed as follows:

[0022]

[0023] in, is the center point of the local area, N iis the local neighborhood vertex set, p is the local neighborhood vertex, ∑ is the local neighborhood vertex set N i The covariance matrix of , the eigenvalues of the covariance matrices of λ1, λ2 and λ3, and δ1 are the feature thresholds.

[0024] The local plane area judgment based on normal vector consistency is expressed as follows:

[0025] cosθ ij =n i ·n j

[0026] θ ij <δ2

[0027] Among them, θ ij is the normal vector n of the neighboring vertex i , δ2 is the normal vector angle threshold.

[0028] The determining of the local plane region based on the local plane fitting error includes:

[0029] The plane is fitted using the least squares method, and the formula is expressed as:

[0030] ax+by+cz+d=0

[0031] Among them, p(x,y,z) is the local neighborhood vertex, and the average distance from each vertex to the plane is calculated. The formula is expressed as:

[0032]

[0033] d avg <δ3

[0034] Among them, p i (x i ,y i ,z i ) is one of the vertices, d avg The average distance from the vertex to the plane, δ3 is the distance threshold.

[0035] Among them, the thresholds δ1δ2 and δ3 are dynamically adjusted to adapt to the requirements of models of different complexities.

[0036] Furthermore, the topology optimization includes:

[0037] Reconstruct local triangles to maintain the regularity of the mesh structure; calculate the adjacency relationship of boundary points and optimize the transition area through Laplace smoothing.

[0038] Furthermore, the processed triangular face model is subjected to multi-mode detection, including: normal mutation detection, curvature detection and side length ratio detection;

[0039] Among them, the normal mutation detection formula is expressed as:

[0040] θ ij =arccos(n i ·n j )

[0041] θ ij is the normal vector n of the neighboring vertex i The angle between them, θ ij When γ > 1, the vertex is determined to be a contour point, and γ1 is the normal mutation angle threshold.

[0042] Curvature detection, the formula is expressed as:

[0043]

[0044] Where A is the area of the domain, θ jk From the perspective of the field, K i >γ2 determines the vertex as a contour point, and γ2 is the curvature threshold.

[0045] Side length ratio detection, the formula is expressed as:

[0046]

[0047] in, The neighborhood side length, R>γ3 determines the vertex as a contour point, and γ3 is the ratio threshold.

[0048] Among them, the contour points of the triangular face model are comprehensively judged based on the results of normal mutation detection, curvature detection and side length ratio detection;

[0049] Furthermore, the K-Means clustering is performed on the non-contour points, and the formula is expressed as:

[0050]

[0051] Among them, C k is the point set of the kth cluster, and K is the number of clusters.

[0052] Furthermore, the S5 comprises the steps of:

[0053] S51. Use the Delaunay triangulation algorithm to triangulate the point set to obtain a reconstructed triangular face model;

[0054] S52, optimizing the model contour points so that their connection relationships are consistent with the original model;

[0055] S53. Use a mesh smoothing algorithm to optimize the reconstructed model.

[0056] The second aspect: A large-scale scene face reduction optimization device based on a clustering algorithm, comprising:

[0057] The preprocessing module is used to calculate the vertex coordinates and vertex normal vectors of the triangular face model and construct the triangular face topology relationship;

[0058] The detection and merging module is used to determine the plane area of the model and merge and perform topology optimization on the plane areas that meet the conditions;

[0059] The contour detection module is used to perform multi-mode detection on the processed triangular face model and comprehensively determine the contour points of the triangular face model based on the detection results;

[0060] Clustering optimization module, used to retain contour points and perform K-Means clustering on non-contour points; contour points and clustered non-contour points form a point set;

[0061] The topology reconstruction module is used to triangulate the point set and reconstruct it to generate a new triangular face model.

[0062] A third aspect: An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method provided in the first aspect are implemented.

[0063] A fourth aspect: A non-transitory computer-readable storage medium having a computer program stored thereon, which implements the steps of the method provided in the first aspect when executed by a processor.

[0064] Beneficial effects of the present invention:

[0065] 1. The present invention achieves smoothing of the abrupt areas of the model by optimizing the calculation of the triangular face model. After the model is optimized, the protrusions of the model's abnormal points and faces are reduced, the redundancy of the facets is reduced, and a better display effect is maintained. The running performance of the model is greatly improved, ensuring the effect display and smoothness of real-scene three-dimensional rendering and demonstration.

[0066] 2. This paper uses multi-condition fusion to detect plane regions, combining PCA planarity determination, normal vector consistency detection, and local plane fitting error. Plane regions are merged only when at least two conditions are met. This multi-condition fusion strategy improves the accuracy and robustness of plane region detection, avoiding the limitations of a single method.

[0067] 3. The present invention proposes to combine three methods, namely normal mutation detection, curvature detection and side length ratio detection, to determine contour points and retain these points to enhance contour details. This comprehensive strategy can more comprehensively capture the contour features of the model, dynamically adjust the threshold parameters, and adapt to the complexity of different models.

[0068] 4. When simplifying a model, the present invention clearly distinguishes between plane regions and contour regions, and adopts different processing strategies for each (merging plane regions and protecting contour regions). This balanced strategy can reduce the amount of model data while retaining key geometric features, achieving a balance between plane region merging and contour protection.

[0069] 5. The present invention optimizes non-contour areas through K-Means clustering while retaining contour points, reducing the protrusions of model abnormal points and facet redundancy, maintaining a better display effect, and introducing an automatic parameter adjustment mechanism to dynamically adjust the threshold parameters of each step (such as δ1, δ2, δ3, γ1, γ2, γ3) according to the geometric characteristics of the model. This automated mechanism can improve the versatility and adaptability of the method.

[0070] 6. The normal mutation detection of the present invention is suitable for detecting sharp corners, but it is easy to misjudge in flat areas. Therefore, it is combined with curvature detection to supplement information. Curvature detection is suitable for detecting curved areas, but it may not be able to detect areas with extremely small curvature. Therefore, it is combined with side length ratio detection for further screening. This combined strategy makes contour point detection more accurate and avoids the misjudgment problem caused by a single detection method. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 Schematic diagram of the process of a large-scale scene face reduction optimization method based on a clustering algorithm implemented in the present invention;

[0072] Figure 2 This is a schematic structural diagram of a large-scale scene face reduction optimization device based on a clustering algorithm according to the present invention;

[0073] Figure 3 Schematic diagram of the structure of the electronic device of the present invention. DETAILED DESCRIPTION

[0074] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar symbols throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.

[0075] Existing triangular patch model optimization methods often find it difficult to balance model detail retention and resource utilization optimization. During the model compression process, many algorithms will over-smooth the model's edges and corners, affecting the fineness of the model's contours.

[0076] In order to solve the above problems, the present invention provides a large-scale scene surface reduction optimization method based on clustering algorithm. Figure 1A schematic diagram of a process flow of a large-scale scene face reduction optimization method based on a clustering algorithm provided in an embodiment of the present invention, the method comprising:

[0077] S1. Obtain the vertex coordinates of the triangular face model, calculate the vertex normal vectors, and construct the triangular face topology relationship.

[0078] First, number the vertices and obtain their coordinates, read all the vertices in the triangular face model, and record the coordinates P of each vertex. i =(x i ,y i ,z i ), assigning a unique number to each vertex.

[0079] Then, calculate the vertex normal vector using the formula:

[0080]

[0081] Among them, P1, P2 and P3 are the three vertices of the triangle, and f is the vertex p i The triangle to which it belongs, n f is the normal vector of the triangle, A f is the patch area, n i For vertex p i Normal vector, F i For vertex p i The set of triangles to which it belongs.

[0082] S2. Determine the multi-conditional plane regions of the model based on topological relationships, and merge and perform topological optimization on the plane regions that meet at least two conditions.

[0083] Multi-condition plane region judgment includes: local plane region judgment based on PCA, local plane region judgment based on normal vector consistency, and local plane region judgment based on local plane fitting error.

[0084] First, plane area judgment is performed based on PCA to determine whether the local neighborhood belongs to the plane area and select an appropriate neighborhood radius r to avoid the neighborhood being too large or too small.

[0085] Calculate the local neighborhood point set N of each vertex i (Take all vertices within radius r), calculate the neighborhood point set N i Covariance matrix:

[0086]

[0087] in, is the center of the field, N i is the local neighborhood vertex set, p is the local neighborhood vertex, ∑ is the local neighborhood vertex set N iThe covariance matrix of .

[0088] Then, calculate the eigenvalues λ1, λ2, and λ3 of the covariance matrix ∑ if:

[0089]

[0090] Then the local neighborhood can be regarded as a planar area, where δ1 is the feature threshold.

[0091] Secondly, based on the consistency of normal vectors, local plane area judgment is performed and the normal vector n of the neighboring vertex is calculated. i The angle between:

[0092] cosθ ij =n i ·n j

[0093] If all neighboring vertices satisfy:

[0094] θ ij <δ2

[0095] Then the area can be regarded as a plane area, and the flatness of the local area is determined by the normal vector angle. δ2 is the normal vector angle threshold, which can be set to 5°~10° and adjusted according to the model requirements.

[0096] Then, the local plane area is judged based on the local plane fitting error, and the plane is fitted using the least squares method:

[0097] ax+by+cz+d=0

[0098] And calculate the average distance of a point to the plane:

[0099]

[0100] like

[0101] d avg <δ3

[0102] Among them, p i (x i ,y i ,z i ) is one of the vertices, d avg The average distance from the vertex to the plane, δ3 is the distance threshold.

[0103] The local neighborhood merging conditions are determined, and at least two conditions (PCA, normal vector consistency, and plane fitting error) are met before merging to ensure the accuracy of planarity judgment.

[0104] At the same time, by analyzing the local geometric features of the model, the thresholds δ1, δ2 and δ3 are dynamically adjusted to adapt to models of different complexity.

[0105] For example: For highly detailed models (such as buildings): increase thresholds δ1, δ2, and δ3 to reduce over-merging and retain more details.

[0106] For low-detail models (such as terrain): reduce thresholds δ1, δ2, and δ3 to achieve higher optimization efficiency.

[0107] Finally, topology optimization is performed on the merged local neighborhoods. After the planar regions are merged, topology optimization methods (such as local triangle reconstruction) are used to maintain the regularity of the mesh structure, avoiding the appearance of elongated triangles or uneven patch distribution. The adjacency relationship of boundary points is also calculated, and Laplace smoothing is used to optimize the transition area for a more natural visual effect.

[0108] S3. Perform multi-mode detection on the processed triangular face model, and comprehensively determine the contour points of the triangular face model based on the detection results.

[0109] First, normal mutation detection is performed to detect contour points through the normal angles of adjacent facets. The formula is:

[0110] θ ij =arccos(n i ·n j )

[0111] like

[0112] θ ij >γ1

[0113] Then vertex p i This may be a contour point. The normal mutation angle threshold γ1 can be set to 30° to 45°, depending on the complexity of the model. The detected contour points are marked to avoid being merged in subsequent steps.

[0114] Then, perform curvature detection and detect the contour points (inflection points) through Gaussian curvature. The formula for calculating Gaussian curvature is:

[0115]

[0116] Where A is the area of the domain, θ jk From the perspective of the field, if:

[0117] K i >γ2

[0118] The point is considered to be a contour point (inflection point) and should be retained. The curvature threshold γ2 can be dynamically adjusted according to the curvature distribution of the model, and points in areas with larger curvatures are encrypted to enhance contour details.

[0119] Then, perform side length ratio detection and calculate the neighborhood side length And the maximum side length ratio:

[0120]

[0121] like

[0122] R>γ3

[0123] Then p i It may be a contour point. The edge ratio threshold γ3 can be set to 2 to 5, which is adjusted according to the model requirements.

[0124] Finally, the contour points of the triangular face model are comprehensively judged by combining the results of normal mutation detection, curvature detection and side length ratio detection.

[0125] S4. The contour points are retained and the non-contour points are clustered using K-Means. The contour points and the clustered non-contour points form a point set.

[0126] First, perform K-Means clustering, set the target number K, and use K-Means clustering. The formula is expressed as:

[0127]

[0128] Among them, C k The point set of the Kth cluster is clustered. The vertices in the non-contour area are clustered to reduce the number of points. The number of clusters K can be dynamically calculated based on the simplification ratio of the model. An accelerated K-Means algorithm (such as Mini-Batch K-Means) can be used to improve computational efficiency.

[0129] Then, border point protection

[0130] Retain contour points to prevent them from participating in clustering, mark the contour points, and retain them directly in the clustering process.

[0131] S5. Triangulate the point set and reconstruct it to generate a new triangular face model.

[0132] First, use the point set to triangulate using an efficient Delaunay triangulation algorithm (such as the CGAL library) to generate new faces, ensuring that the triangulated faces are consistent with the topological structure of the original model.

[0133] Then, the boundary point connection optimization is performed to ensure that the contour points are connected consistently and avoid topological errors. The contour points are locally optimized to ensure that their connection relationship is consistent with the original model. The reconstructed model is optimized using a mesh smoothing algorithm (such as Laplacian smoothing).

[0134] like Figure 2 As shown, the present invention also discloses a large-scale scene face reduction optimization device based on a clustering algorithm, which includes: a preprocessing module, a detection and merging module, a contour detection module, a clustering optimization module, and a topology reconstruction module.

[0135] Among them, the preprocessing module is used to read the original triangular face model data (vertex coordinates, face connection relationship), calculate the triangular face model vertex coordinates and vertex normal vectors, and construct the triangular face topology relationship (record the neighborhood information of each vertex) to provide basic data support for subsequent steps.

[0136] The detection and merging module is used to determine the plane area of the model and merge and perform topology optimization on the plane areas that meet the conditions.

[0137] Based on the multi-condition fusion strategy (PCA planarity, normal vector consistency, plane fitting error), the mergeable plane areas are detected, the merging threshold is dynamically adjusted (such as adaptively adjusting δ1, δ2, δ3 according to the model curvature distribution), and the topology optimization of the plane area is performed (such as local triangle reconstruction).

[0138] The contour detection module is used to perform multi-mode detection on the processed triangular face model and comprehensively judge the contour points of the triangular face model based on the detection results.

[0139] Comprehensive normal mutation (θ ij >γ1), curvature (K i >γ2) and edge length ratio (R>γ3) to detect contour points, mark them and prevent them from participating in subsequent clustering optimization.

[0140] The clustering optimization module is used to retain contour points and perform K-Means clustering on non-contour points; the contour points and the clustered non-contour points form a point set.

[0141] Perform K-Means clustering on non-contour vertices (the target number of clusters K is dynamically calculated), use acceleration algorithms (such as Mini-Batch K-Means) to improve efficiency, retain cluster center points, replace the original non-contour point set, reduce redundant vertices through spatial position clustering (Euclidean distance metric), and protect contour points to maintain features.

[0142] The topology reconstruction module is used to triangulate the point set and reconstruct it to generate a new triangular face model.

[0143] The simplified point set (contour points + cluster centers) is subjected to Delaunay triangulation to optimize boundary connections (such as Laplace smooth transition regions), Delaunay triangulation, maximize the minimum internal angle, avoid narrow triangles, constrain the connection relationship of contour points, and maintain topological consistency.

[0144] When applied, the original triangular mesh model (such as a building model, 1 million facets) is input into the preprocessing module for preprocessing, vertex normal vectors are calculated, and neighborhood relationships are marked. The detection and merging module is then used to merge planes, detect flat areas such as walls (PCA, normal vector consistency, or plane fitting error), and merge redundant facets. The contour detection module then performs contour protection to retain high-curvature contour points such as eaves and window frames. Clustering simplification is then performed based on the clustering optimization module: non-contour areas (such as flat walls) are clustered, and the number of vertices is reduced from 500,000 to 50,000. Finally, the topology reconstruction module is used to reconstruct the output and generate an optimized model (100,000 facets, with visual quality close to the original model).

[0145] The device of the present invention makes decisions through multi-condition fusion, and plane detection and contour protection are coordinated through multiple thresholds to avoid the deviation of a single method; at the same time, dynamic parameter adjustment is performed, and thresholds are automatically optimized according to model complexity (such as terrain vs. high-precision buildings), achieving a balance between performance and quality. Clustering simplification reduces the amount of calculation, and contour protection ensures that key features are not lost.

[0146] The present invention also provides an electronic device, Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, the electronic device may include: a processor, a communications interface, a memory, and a communication bus, wherein the processor, the communications interface, and the memory communicate with each other via the communication bus. The processor may call logic instructions in the memory, for example, to execute the following method:

[0147] S1. Obtain the vertex coordinates of the triangular face model, calculate the vertex normal vector, and construct the triangular face topology relationship;

[0148] S2. Determine the multi-conditional plane regions of the model based on the topological relationship, and merge and perform topological optimization on the plane regions that meet at least two conditions;

[0149] S3. Perform multi-mode detection on the processed triangular face model and comprehensively judge the contour points of the triangular face model based on the detection results;

[0150] S4, retain the contour points, perform K-Means clustering on the non-contour points, and form a point set with the contour points and the clustered non-contour points;

[0151] S5. Triangulate the point set and reconstruct it to generate a new triangular face model.

[0152] In addition, the logical instructions in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program code.

[0153] An embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method provided in each of the above embodiments is implemented, for example, including:

[0154] S1. Obtain the vertex coordinates of the triangular face model, calculate the vertex normal vector, and construct the triangular face topology relationship;

[0155] S2. Determine the multi-conditional plane regions of the model based on the topological relationship, and merge and perform topological optimization on the plane regions that meet at least two conditions;

[0156] S3. Perform multi-mode detection on the processed triangular face model and comprehensively judge the contour points of the triangular face model based on the detection results;

[0157] S4, retain the contour points, perform K-Means clustering on the non-contour points, and form a point set with the contour points and the clustered non-contour points;

[0158] S5. Triangulate the point set and reconstruct it to generate a new triangular face model.

[0159] The device embodiments described above are merely illustrative. 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 may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A large-scale scene face reduction optimization method based on clustering algorithm, characterized in that: include: S1. Obtain the vertex coordinates of the triangular face model, calculate the vertex normal vector, and construct the triangular face topology relationship; S2. Determine the multi-conditional plane regions of the model based on the topological relationship, and merge and perform topological optimization on the plane regions that meet at least two conditions; S3. Perform multi-mode detection on the processed triangular face model and comprehensively judge the contour points of the triangular face model based on the detection results; S4, retain the contour points, perform K-Means clustering on the non-contour points, and form a point set with the contour points and the clustered non-contour points; S5. Triangulate the point set and reconstruct it to generate a new triangular face model.

2. The surface reduction optimization method according to claim 1, characterized in that: The vertex normal vector is calculated in S1, and the formula is: Among them, P1, P2 and P3 are the three vertices of the triangle, and f is the vertex p i The triangle to which it belongs, n f is the normal vector of the triangle, A f is the patch area, n i For vertex p i Normal vector, F i For vertex p i The set of triangles to which it belongs.

3. The surface reduction optimization method according to claim 1, characterized in that: The model multi-condition plane area determination includes: Local plane area judgment based on PCA; Local plane area judgment based on normal vector consistency; The local plane region is judged based on the local plane fitting error.

4. The surface reduction optimization method according to claim 3, characterized in that: The local plane area judgment based on PCA is expressed as follows: in, is the center point of the local area, N i is the local neighborhood vertex set, p is the local neighborhood vertex, ∑ is the local neighborhood vertex set N i The covariance matrix of , λ1, λ2 and λ3 covariance matrix eigenvalues, δ1 is the characteristic threshold; The local plane area judgment based on normal vector consistency is expressed as follows: cosθ ij =n i ·n j i ij <δ2 Among them, θ ij is the normal vector n of the neighboring vertex i The angle between them, δ2 is the normal vector angle threshold; The determining of the local plane region based on the local plane fitting error includes: The plane is fitted using the least squares method, and the formula is expressed as: ax+by+cz+d=0 Among them, p(x,y,z) is the local neighborhood vertex, and the average distance from each vertex to the plane is calculated. The formula is expressed as: d avg <δ3 Among them, p i (x i ,y i ,z i ) is one of the vertices, d avg The average distance from the vertex to the plane, δ3 is the distance threshold; Among them, the thresholds δ1, δ2 and δ3 are dynamically adjusted to adapt to the requirements of models of different complexities.

5. The surface reduction optimization method according to claim 1, characterized in that: The topology optimization includes: Reconstruct local triangles to maintain the regularity of the mesh structure; calculate the adjacency relationship of boundary points and optimize the transition area through Laplace smoothing.

6. The surface reduction optimization method according to claim 1, characterized in that: The processed triangular face model is subjected to multi-mode detection, including: normal mutation detection, curvature detection and side length ratio detection; Among them, the normal mutation detection formula is expressed as: i ij =arccos(n i ·n j ) θ ij is the normal vector n of the neighboring vertex i The angle between them, θ ij When >γ1, the vertex is determined to be a contour point, and γ1 is the angle threshold; Curvature detection, the formula is expressed as: Where A is the area of the domain, θ jk From the perspective of the field, K i >γ2 determines the vertex as a contour point, and γ2 is the curvature threshold; Side length ratio detection, the formula is expressed as: Among them, l ij The neighborhood side length, R>γ3 determines the vertex as a contour point, and γ3 is the ratio threshold; Among them, the contour points of the triangular face model are comprehensively judged based on the results of normal mutation detection, curvature detection and side length ratio detection.

7. The surface reduction optimization method according to claim 1, characterized in that: In S4, K-Means clustering is performed on non-contour points, and the formula is expressed as follows: Among them, C k is the point set of the kth cluster, and K is the number of clusters.

8. The surface reduction optimization method according to claim 7, characterized in that: The S5 comprises the steps of: S51. Use the Delaunay triangulation algorithm to triangulate the point set to obtain a reconstructed triangular face model; S52, optimizing the model contour points so that their connection relationships are consistent with the original model; S53. Use a mesh smoothing algorithm to optimize the reconstructed model.

9. A large-scale scene face reduction optimization device based on a clustering algorithm applied to the method according to any one of claims 1 to 8, characterized in that: The device comprises: The preprocessing module is used to calculate the vertex coordinates and vertex normal vectors of the triangular face model and construct the triangular face topology relationship; The detection and merging module is used to determine the plane area of the model and merge and perform topology optimization on the plane areas that meet the conditions; The contour detection module is used to perform multi-mode detection on the processed triangular face model and comprehensively determine the contour points of the triangular face model based on the detection results; Clustering optimization module, used to retain contour points and perform K-Means clustering on non-contour points; contour points and clustered non-contour points form a point set; The topology reconstruction module is used to triangulate the point set and reconstruct it to generate a new triangular face model.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of a large-scale scene face reduction optimization method based on a clustering algorithm as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Three-dimensional reconstruction method, device and terminal

    CN117635875A

  • Nonuniform simplifying method for STL model of products

    CN101510228A

  • Model processing method and device, electronic equipment and computer readable storage medium

    CN113274735A

  • Three-dimensional model simplification method and device and storage medium

    CN113379924A

  • BIM model surface reduction method based on vertex normal angle calculation

    CN114565718A