Building grid model optimization method and device based on line feature constraint

Through the method based on line feature constraints, the three-dimensional building mesh model is optimized, which solves the problems of poor quality of the building edge area and large storage demand, and realizes efficient three-dimensional model reconstruction and optimization.

CN120182491APending Publication Date: 2025-06-20WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510270202.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing three-dimensional model reconstruction methods are of poor quality in building edge areas and redundant when describing point clouds, resulting in rough edges and large storage requirements of the three-dimensional mesh model, which is difficult to overcome, affecting urban entity storage, analysis and decision-making.

Method used

A method of optimization of building mesh model based on line feature constraints is proposed. By registering three-dimensional straight lines and grids with high precision, projecting three-dimensional straight lines, and optimizing the grid under three-dimensional straight lines based on greedy growth and dynamic programming algorithms, realizing automatic and efficient optimization of building models.

Benefits of technology

Effectively restore building edge features, optimize planar structure expression, improve the quality of three-dimensional model reconstruction, reduce storage requirements, and improve reconstruction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120182491A_ABST
    Figure CN120182491A_ABST
Patent Text Reader

Abstract

The invention discloses a building grid model optimization method and device based on line feature constraint, and the method comprises the steps: firstly searching a to-be-optimized region, and carrying out the positioning of a three-dimensional line segment in a grid based on the thought of local projection; on the basis of a greedy thought, region growth is carried out under double constraints of geometric distance and angle, so that the region can cover a plane structure which can be controlled by a three-dimensional straight line. And performing iterative shrinkage on the region based on dual constraints of the shortest path and the geometric distance to obtain a grid region needing to be optimized under the constraint of the three-dimensional straight line. Then, grid reconstruction is carried out, grid points and faces in the area are removed, and two end points of a three-dimensional straight line are connected with the nearest boundary points respectively, so that the reconstruction area is preprocessed; triangulation is carried out on the area under a proposed multi-target dynamic planning framework of adaptive iteration solution normalization coefficients, a hypothesis test model is introduced to optimize a dynamic planning state transition process, and efficient multi-target optimal grid reconstruction of the area is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to a method for optimizing a three-dimensional model in photogrammetry, and particularly relates to a method and device for optimizing a building grid model based on line feature constraints. Background Art

[0002] In the current field of photogrammetry and computer vision, three-dimensional grid models are mainly constructed based on dense point clouds. However, dense point clouds often have poor quality in building areas, specifically manifested in: 1) Since dense matching algorithms are often unstable in the edge areas of buildings, the point clouds are usually rough in these areas; 2) Since point clouds are an unstructured data structure, when describing objects with obvious structural features such as buildings, they are often redundant. And the above-mentioned disadvantages of point clouds are often difficult to overcome when constructing three-dimensional grid models, resulting in problems such as rough edges and large storage requirements in the finally produced three-dimensional building digital models, which pose great challenges to efficient urban entity storage, analysis, decision-making, etc. Therefore, how to optimize the above problems existing in building models has great application value.

[0003] In urban scenes, especially in building areas, there are obvious linear features. Compared with three-dimensional points, three-dimensional lines have high-level geometric features and can express clear structural information such as edges, planes, and topologies. Current research aims to reconstruct high-precision, sufficient quantity, and easy-to-use three-dimensional lines from multi-view aerial images, which can enrich the primitives for urban three-dimensional reconstruction, restore the high-level structure of the three-dimensional scene, and overcome the problems existing in three-dimensional models constructed based on single point elements, and is becoming a new paradigm for urban three-dimensional scene expression and efficient reconstruction. However, due to the huge differences in the characteristics between point elements and line elements, there are still great challenges in how to combine the advantages of point features and line features to improve the quality of three-dimensional model reconstruction, and there are large gaps in its research. Some researchers only use three-dimensional lines to construct three-dimensional models for building scenes. Although these methods avoid the time-consuming process of generating dense point clouds, they ignore the advantages of point features in expressing building details and irregular structures, and the constructed models have topological structure errors. There are also researchers who convert three-dimensional line segments into discrete points and use them together with dense point clouds as inputs to construct building grids. Although such methods have improved the reconstruction quality of building edges to a certain extent, they essentially do not utilize the constraints of three-dimensional lines on edge and plane structures, and there is still much room for improvement in model quality. And the only current algorithm framework that directly combines point features and line features for three-dimensional reconstruction is the extended tetrahedron carving algorithm proposed by Sugiura et al. However, it still does not utilize the constraints of three-dimensional lines on plane structures, and the global optimization method is very time-consuming in the reconstruction of large-scale urban scenes.

[0004] In summary, the existing 3D model reconstruction and optimization methods that combine point features and line features cannot simultaneously consider the detailed expression of point features, the edge and plane constraints of line features, and there is still great room for improvement in the 3D building models reconstructed by them. Based on this, the present invention proposes a local optimization method for 3D building grid models based on line feature constraints to achieve automatic and efficient optimization of 3D building models constructed based on point features. Summary of the Invention

[0005] The present invention proposes a method and device for optimizing a building grid model based on line feature constraints to solve the problems of rough edges and large memory overhead in building models constructed based on point features.

[0006] The technical solution adopted by the present invention is as follows: a method for optimizing a building grid model based on line feature constraints, comprising the following steps:

[0007] Step 1, perform high-precision registration on the input 3D line and 3D grid to ensure the unity of their coordinate systems;

[0008] Step 2, project the 3D line onto the input grid by calculating the shortest distance from the sampling points of the 3D line to the 3D grid;

[0009] Step 3, based on the idea of greedy growth, search for the plane structure controlled by the 3D line in the input grid under the constraints of geometric distance and angle;

[0010] Step 4, based on the attribute of the marker, determine whether there is any other embedded 3D line in the area controlled by the 3D line obtained in Step 3. If so, perform clipping based on the embedded 3D line using the shortest path algorithm with constraints;

[0011] Step 5, preprocess the area to be optimized, including: clearing the grid points and triangular faces inside it, and connecting the two endpoints of the 3D line to the nearest boundary points;

[0012] Step 6, perform grid reconstruction under the constraint of the 3D line based on the dynamic programming algorithm.

[0013] Preferably, in Step 2, the 3D line is located in the input grid based on the local projection method. The local projection method designed by the present invention is based on the idea of an adaptive threshold, enabling the algorithm to optimize grid models with different precisions. First, the 3D line is discretized into dense points, and the point with the shortest distance to the 3D grid in each point is calculated as the "projection point". The set of grid primitive regions where all the projection points of the 3D line in the grid are located is the region corresponding to the 3D line in the grid. The calculation of the shortest distance is shown in formula (1):

[0014]

[0015] In formula (1), d space represents the distance from a three-dimensional straight line sampling point to its projection point, and represents the distance from a three-dimensional straight line sampling point to the j-th triangular face in the three-dimensional grid.

[0016] Preferably, in step 3, based on the constraints of distance and angle, greedy growth is performed on the region where the three-dimensional straight line is located in the grid in step 2, so that the region that can be optimized under the constraint of the three-dimensional line segment covers the grids corresponding to the two half-planes it can control. The growth process is constrained according to the line-plane geometric relationship, based on the distance from the straight line to the triangular face of the grid and the angle between adjacent triangular faces of the grid, and the triangular faces of the grid with distances and angles less than the threshold are added to the region controlled by the straight line. The iteration stop condition is: no new triangular faces of the grid are added to the region controlled by the straight line. The angle threshold between adjacent triangular faces of the grid is generally taken as 30°. The distance threshold from the straight line to the triangular face of the grid is determined by an adaptive strategy, and the calculation is shown in formula (2):

[0017]

[0018] In formula (2), d threshold represents the distance threshold, represents the distance from the i-th sampling point to its projection point, median represents taking the median value, std represents taking the standard deviation, and C is a constant, which is usually selected according to the noise and detail richness of the optimized three-dimensional grid, etc.

[0019] Preferably, in step 4, based on the shortest path and distance constraint strategy, iterative contraction is performed on the control region to solve the conflict problem existing when multiple three-dimensional straight lines optimize the grid simultaneously. The present invention designs a grid clipping algorithm to avoid the three-dimensional straight line embedded later in the grid from damaging the three-dimensional straight line embedded earlier in the grid. First, the grid is regarded as a graph model, and the embedded line features are used as a benchmark to clip this grid region. To avoid clipping failure caused by overlapping or forming a closed loop of the clipping lines, the present invention introduces two constraints based on Dijkstra's algorithm for shortest path search to ensure that each grid sub-region after clipping is simply connected:

[0020] 1) Non-repetition constraint: The shortest path searched from the endpoints of the embedded three-dimensional straight line cannot coincide with itself in whole or in part;

[0021] 2) Non-loop constraint: When the end point of the shortest path of a certain end point of the embedded three-dimensional straight line A is on the embedded three-dimensional straight line B, then when searching for the shortest path of the embedded three-dimensional straight line B, the three-dimensional straight line A cannot be considered as the end point again, so as to avoid the clipping line forming multiple closed loops and causing clipping failure.

[0022] Among several cropped grid sub-regions, select the block with the minimum distance to the three-dimensional line as the area to be finally optimized. The calculation formula for the distance is shown in Formula (3):

[0023]

[0024] In Formula (3), d line-mesh represents the distance from the three-dimensional line to the grid.

[0025] Preferably, in step 6, the grid reconstruction is implemented based on a dynamic programming framework, with the perimeter sum and dihedral angle sum of triangular patches as the optimization objectives. According to the dynamic programming algorithm framework for hole filling, the state transition process combines a new triangle ΔV i V k V j and the triangulation results of two smaller three-dimensional polygon holes {V i ,V i+1 ,...,V k} and {V k ,V k+1 ,...,V j}. Let the current sub-problem be the triangulation of the three-dimensional polygon hole {V i ,V i+1 ,...,V j} that includes the triangle ΔV i V k V j (i < k < j), and its state is E i-j-k . Then the state transition equation is shown in Formula (4):

[0026]

[0027] In Formula (4), A(Δ1,Δ2) represents the dihedral angle between two triangular patches, L(Δ) represents the perimeter of the triangular patch, and w represents the normalization coefficient.

[0028] Preferably, in step 6, the present invention designs a calculation method for adaptively iteratively solving the normalization coefficient. With the idea of reinforcement learning, during the dynamic programming process, the distribution of the two indexes of the hole to be triangulated in the next round is predicted based on the distribution of the perimeter and dihedral angle in the previous round of triangulation to calculate the normalization coefficient. The specific calculation is shown in Formula (5):

[0029]

[0030] In Formula (5), A LSM and P LSM respectively represent the sum of the dihedral angles and the sum of the perimeters of the triangular patches in the grid region to be optimized, A s-1 and Ps-1 Denotes the average value of the sum of dihedral angles and the sum of perimeters corresponding to the optimal triangulation of a three-dimensional polygonal hole with s - 1 sides, w s Denotes the normalization coefficient during the dynamic programming process for calculating the optimal triangulation of a three-dimensional polygonal hole with s sides. n represents the total number of sides of the three-dimensional polygonal hole to be triangulated.

[0031] Preferably, in step 6, the present invention introduces a hypothesis testing model in the dynamic programming process to improve the efficiency of the algorithm. When the dynamic programming algorithm introduces a new dihedral angle, an additional backtracking process is required to solve the optimal value. If the newly introduced dihedral angle is smaller, there is a greater probability that it remains the optimal solution after the new dihedral angle is introduced, and there is no need to backtrack other triangulation results. Let the newly introduced dihedral angle be A merge = a0. Define the null hypothesis: directly perform state transition from the triangulation result corresponding to the optimal state; alternative hypothesis: backtrack all candidate states and recalculate the minimum value after introducing the new dihedral angle. If the formula (6) is satisfied, we reject the null hypothesis and backtrack all possible candidate states to recalculate the optimal state. Otherwise, we directly perform the state transition of the optimal state:

[0032] P(A merge ≥ a0) ≤ α (6)

[0033] In formula (6), P represents the probability of an event occurring, and α represents the significance level, taking 0.05.

[0034] The present invention also provides an optimization device for a building grid model based on line feature constraints, including:

[0035] A processor and a memory. The memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute an optimization method for a building grid model based on line feature constraints as described in the above technical solution.

[0036] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0037] The building grid model optimization method based on line feature constraints proposed by the present invention includes two parts: searching for the area to be optimized under the constraint of a three-dimensional line and grid optimization. First, search for the area to be optimized. Based on the idea of local projection, locate the three-dimensional line segment in the grid. Based on the greedy idea, perform region growth under the dual constraints of geometric distance and angle to cover the plane structure that can be controlled by the three-dimensional line. Iteratively shrink the above area under the dual constraints of the shortest path and geometric distance to obtain the grid area that needs to be optimized under the constraint of this three-dimensional line. Then, perform grid reconstruction. Pretreat the reconstruction area by clearing the grid points and faces in the area and connecting the two endpoints of the three-dimensional line to the nearest boundary points respectively. Triangulate the area under the proposed multi-objective dynamic programming framework of adaptively iteratively solving the normalization coefficient to achieve the multi-objective optimal reconstruction of the grid in this area. In addition, introduce a hypothesis testing model to optimize the dynamic programming state transition process and reduce redundant calculations. The results show that the method proposed by the present invention can better restore the edge features of the building under the constraint of the three-dimensional line and can optimize the expression of its plane structure. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is the flowchart of the method of the present invention;

[0039] Figure 2 is the schematic diagram of calculating the distance from a point to a grid triangular face;

[0040] Figure 3 is the flowchart of the grid clipping algorithm;

[0041] Figure 4 is the result diagram of the shortest path search algorithm with constraints. (a) is the result of directly searching for the shortest path of point A, (b) is the result of searching for the shortest path of point A after introducing the non-repetition constraint, (c) is the result of directly searching for the shortest path of the two endpoints of line segment l2, and (d) is the result of searching for the shortest path of the two endpoints of line segment l2 after introducing the acyclic constraint;

[0042] Figure 5 is the schematic diagram of the dynamic programming algorithm. (a) is the flowchart of the dynamic programming algorithm with the dihedral angle as the optimization target and the perimeter or area as the optimization target, (b) is the schematic diagram of the reason for increasing the time complexity in the backtracking process, and (c) is the schematic diagram of the principle of the hypothesis testing of the present invention;

[0043] Figure 6 is the flowchart of the grid reconstruction algorithm;

[0044] Figure 7 are some images in the dataset used for the test of the present invention;

[0045] Figure 8 is the result comparison diagram of the multi-objective dynamic programming algorithm for adaptively iteratively solving the normalization coefficient;

[0046] Figure 9 Effect diagram of the dynamic programming algorithm for introducing the hypothesis testing model;

[0047] Figure 10 Test result diagram of the present invention. (a) is the input line segment, (b) is the input grid, (c) is the grid optimized based on the method of the present invention, and (d) is the building grid reconstructed by the PolyFit algorithm for comparison. Specific implementation manners

[0048] To facilitate the understanding and implementation of the present invention by those of ordinary skill in the art, the present invention will be further described in detail below in conjunction with the accompanying drawings and implementation examples. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.

[0049] Please refer to Figure 1 The flowchart. The method for optimizing the building grid model based on line feature constraints provided by the present invention includes the following steps (it should be noted that steps 2 to 4 are to search for the area that can be optimized under the constraint of a certain three-dimensional line, and steps 5 to 6 are for grid optimization):

[0050] Step 1: Perform high-precision registration on the input three-dimensional line and three-dimensional grid to ensure the unity of their coordinate systems.

[0051] Step 2: Project the three-dimensional line onto the input grid by calculating the shortest distance from the sampling points of the three-dimensional line to the three-dimensional grid.

[0052] Preferably, the registered three-dimensional line in step 1 is positioned in the input grid based on the local projection method. The local projection method designed by the present invention is based on the idea of an adaptive threshold, enabling the algorithm to optimize grid models with different precisions. First, the three-dimensional line is discretized into dense points, and the point closest to each point in the three-dimensional grid is calculated as the "projection point". The set of grid primitive regions where all the projection points of the three-dimensional line in the grid are located is the region corresponding to the three-dimensional line in the grid. The calculation of the shortest distance is shown in formula (1):

[0053]

[0054] In formula (1), d space represents the distance from the sampling point of the three-dimensional line to its projection point, represents the distance from the sampling point of the three-dimensional line to the j-th triangular face in the three-dimensional grid, and its calculation method is shown in the appendix Figure 2 .

[0055] Step 3: Search for the planar structure controlled by the three-dimensional line in the input grid under the constraints of geometric distance and angle based on the idea of greedy growth.

[0056] Based on the distance and angle constraints, the region where the three-dimensional line is located in the grid is extended to the grid region corresponding to the plane structure controlled by the three-dimensional line. Considering that a three-dimensional line is generally generated by the intersection of two half-planes, therefore, a three-dimensional line and the sparse points on both sides of the half-planes can express the plane structure, without the need to express it through a dense grid with a large memory overhead. Greedily grow the region where the three-dimensional line is located in the grid in step 2, so that the region that can be optimized under the constraint of the three-dimensional line segment covers the grids corresponding to the two half-planes it can control. In the growth process, according to the line-plane geometric relationship, constraints are imposed based on the distance from the line to the grid triangular face and the angle between adjacent grid triangular faces, and the grid triangular faces with distances and angles less than the threshold are added to the region controlled by the line. The iteration stop condition is: no new grid triangular faces are added to the region controlled by the line.

[0057] Preferably, the angle threshold between adjacent grid triangular faces is only used to enhance the robustness of the greedy growth process, and can be selected according to the noise, detail richness, etc. of the three-dimensional grid to be optimized, and generally 30° is sufficient. The distance threshold from the line to the grid triangular face is determined by an adaptive strategy, and the calculation is shown in formula (2):

[0058]

[0059] In formula (2), d threshold represents the distance threshold, represents the distance from the i-th three-dimensional line sampling point to its projection point, median represents taking the median, std represents taking the standard deviation, and C is a constant, usually selected according to the noise, detail richness, etc. of the optimized three-dimensional grid

[0060] Step 4, based on the attribute of the mark, determine whether there are other embedded three-dimensional lines in the region controlled by the three-dimensional line obtained in step 3. If so, then perform clipping based on the embedded three-dimensional line and the shortest path algorithm with constraints.

[0061] When multiple three-dimensional lines optimize the grid simultaneously, the method of the present invention needs to be executed in sequence to embed all three-dimensional lines into the three-dimensional grid for grid optimization. If there are already embedded three-dimensional lines in the grid region controlled by the subsequent three-dimensional line search, the optimization process will damage the embedded three-dimensional line. Therefore, it is necessary to clip the region controlled by the three-dimensional line obtained in step 3 so that the region does not contain the already embedded three-dimensional line. The process is shown in the appendix Figure 3 as shown. First, regard the grid as a graph model, and use the embedded three-dimensional line as a benchmark to clip the region controlled by the line obtained in this step 3. Among the several clipped grid sub-regions, select the sub-region with the smallest distance to the three-dimensional line as the final region to be optimized. The calculation formula for the distance is shown in formula (3):

[0062]

[0063] In Equation (3), d line-mesh represents the distance from the three-dimensional straight line to the grid.

[0064] Preferably, the cutting line is composed of the shortest paths from the endpoints of each embedded line feature to the boundary of the grid region or other embedded line features in the region. Considering that if the cutting lines overlap or form a "closed loop", a simply connected region to be optimized that meets the requirements of Step 5 cannot be cut out, as shown in the appendix Figure 4 shown. Therefore, the shortest path search is implemented using the improved Dijkstra algorithm with constraints of the present invention. That is, in the region controlled by the straight line obtained in Step 3, the shortest paths from the two endpoints of the embedded three-dimensional straight line to the region boundary or other embedded three-dimensional straight lines in the region are searched sequentially. Two constraint limitations are added during the search process:

[0065] 1) Non-repetition constraint: The shortest path searched from the endpoint of the embedded three-dimensional straight line cannot coincide with itself in whole or in part;

[0066] 2) Non-loop constraint: When the end point of the shortest path of a certain end point of the embedded three-dimensional straight line A is on the embedded three-dimensional straight line B, then when searching for the shortest path of the embedded three-dimensional straight line B, the three-dimensional straight line A cannot be considered as the end point again, so as to avoid the cutting line forming multiple closed loops resulting in cutting failure.

[0067] Step 5, preprocess the region to be optimized, including: clearing the grid points and triangular faces inside it, and connecting the two endpoints of the three-dimensional straight line to the nearest boundary points.

[0068] The above preprocessing process transforms the problem of reconstructing the region constrained by the three-dimensional straight line into a problem of filling grid holes, and the dynamic programming algorithm can be used to solve it.

[0069] Step 6, based on the dynamic programming algorithm, perform grid reconstruction under the constraint of the three-dimensional straight line.

[0070] The grid reconstruction is implemented based on the dynamic programming framework, and the appendix Figure 6 shows the basic process of the grid reconstruction algorithm designed by the present invention. To ensure the flatness of the optimized local grid surface while basically avoiding topological errors, the dynamic programming needs to optimize the perimeter sum and dihedral angle sum of the triangles simultaneously. First, take the appendix Figure 5 as an example to elaborate the basic framework of solving the dynamic programming algorithm in the hole filling problem:

[0071] 1) Original problem: Triangulate the three-dimensional polygon hole {V0, V1,..., V n-1} with n boundary points;

[0072] 2) Sub - problem: Triangulation of the three - dimensional polygon hole {V i , V i+1 ,..., V j} (0 ≤ i < j ≤ n - 1) that contains the triangle ΔV i V k V j (i < k < j), where i, k, and j represent the indices of the vertices. The reason for defining the sub - problem in this way is that in the subsequent calculation of sub - problems, ΔV i V k V j will have new adjacent triangular patches, and it is necessary to record the optimal triangulation results for each type of ΔV i V k V j to facilitate re - solving the optimal value after introducing new dihedral angles;

[0073] 3) State: The state of the sub - problem is defined as the weighted sum E i-j-k of the perimeter sum and the dihedral angle sum of its triangulation result;

[0074] 4) Initialization: Define the state of all holes with 2 sides as E i-(i+1)-0 = 0 (0 ≤ i ≤ n - 1), and the state of all holes with 3 sides as E i-(i+2)-(i+1) = L(ΔV i V i+1 V i+2 ) (0 ≤ i ≤ n - 2);

[0075] 5) State transition: The state transition process of dynamic programming is as shown in (a) of the appendix Figure 5 . It can be seen that the triangulation problem of the three - dimensional polygon hole {V i , V i+1 ,..., V j} that contains the triangle ΔV i V k V j can be combined from the triangulation results of ΔV i V k V j and the triangulation results of the three - dimensional polygon holes {V i , V i+1 ,..., V k} and {V k , V k+1 ,..., V j}. The state transition equation is as shown in formula (4):

[0076]

[0077] In formula (4), A(Δ1, Δ2) represents the dihedral angle between two triangular patches, L(Δ) represents the perimeter of the triangular patch, and w represents the normalization coefficient.

[0078] Preferably, the present invention designs a calculation method for adaptively iteratively solving the normalization coefficient. Since the scales of the perimeter and the dihedral angle are not unified, and the commonly used normalization methods require pre-determining the respective probability distributions of the two indicators in the data, this condition cannot be satisfied before triangulation. Previous studies have all adopted the method of first optimizing the dihedral angle and then optimizing other indicators if the dihedral angles are equal, but this method cannot optimize the two indicators balancedly. Therefore, the present invention borrows the idea of reinforcement learning and predicts the distributions of the two indicators of the holes to be triangulated in the next round through the distributions of the perimeter and the dihedral angle in the previous round of triangulation during the dynamic programming process to calculate the normalization coefficient. The specific calculation is shown in formula (5):

[0079]

[0080] In formula (5), A LSM and P LSM respectively represent the sum of the dihedral angles and the sum of the perimeters of the triangular patches in the mesh region to be optimized. A s-1 and P s-1 represent the average values of the sum of the dihedral angles and the sum of the perimeters corresponding to the optimal triangulation of the three-dimensional polygon hole with s - 1 sides. w s represents the normalization coefficient during the dynamic programming process for calculating the optimal triangulation of the three-dimensional polygon hole with s sides, and n represents the total number of sides of the three-dimensional polygon hole to be triangulated.

[0081] Preferably, the present invention introduces a hypothesis testing model during the dynamic programming process to improve the efficiency of the algorithm. In the grid hole filling algorithm based on dynamic programming, the time complexity with the minimum perimeter sum as the optimization objective is O(n 3 ), and the time complexity with the minimum dihedral angle sum as the optimization objective is O(n 4 ). This is because the calculation of the dihedral angle involves two adjacent triangles, and during the optimization process, it is necessary to backtrack the optimal values of multiple sub-problems and recalculate the minimum value. The specific process is explained in (a) of the appendix Figure 5 , and the reason for the increase in time complexity during the backtracking process is explained in (b) of the appendix Figure 5 . Since there is a high-confidence planar structure in the mesh region that we need to optimize and reconstruct, through the hypothesis testing model, the backtracking process can be cancelled for the high-confidence local planar region, reducing the redundant calculation of the dihedral angle optimization for this region. Appendix Figure 5In (c), the basic principle of our hypothesis testing model is explained. That is, if the newly introduced dihedral angle is small enough under high confidence conditions, there will be a high probability that the backtracking process will obtain the same triangulation result as directly fusing the optimal sub-problem. Specifically as follows: Taking sub-problem I in (a) of the appendix Figure 5 as an example, assume that in state E i-k-p (i < p < k), the optimal state is E i-k-opt(p) , where opt(p) represents the value of vertex index p when E i-k-opt(p) = min p E i-k-p . When triangulating a larger hole, if it is necessary to transfer from the optimal triangulation result of the hole composed of consecutive vertices {V i , V i+1 ,..., V k}, calculate ΔV i V opt(p) V k and the dihedral angle A merge = a0 of the newly added adjacent triangle. Define the null hypothesis: directly perform state transfer from the triangulation result corresponding to the optimal state E i-k-opt(p) ; alternative hypothesis: backtrack all states E i-k-p (i < p < k), and recalculate the minimum value after introducing the new dihedral angle. If formula (6) is satisfied, we reject the null hypothesis, backtrack all possible states, and recalculate the optimal state. Otherwise, we directly transfer the optimal state:

[0082] P(A merge ≥a0) ≤ α (6)

[0083] In formula (6), P represents the probability of the event occurring, and α represents the significance level, taking 0.05. The probability calculation can be determined according to the probability distribution function F, and the probability distribution F is initialized by the detection result of the RANSAC for the planarity of the grid to be optimized, and is updated according to the dihedral angles formed during the triangulation process in dynamic programming.

[0084] Step 7, test the performance of the method for testing the present invention using a simulated data and 5 real-scenario data. The data is shown in the appendix Figure 7 . Use the simulated data to test and verify the effect of the multi-objective dynamic programming designed by the present invention. See the appendix Figure 8。The dynamic programming algorithm with the perimeter sum as the single objective (named PSDP), the dynamic programming algorithm with the dihedral angle sum as the single objective (named ASDP), the multi-objective dynamic programming algorithm solved by importance sorting (named OPMDP), and our multi-objective dynamic programming algorithm for adaptively iteratively solving the normalization coefficient (named AWMDP) were experimentally compared and tested, which proved that our method can reconstruct a high-precision and flat planar structure without generating topological errors. In terms of the overall mesh optimization effect, the meshes before and after optimization and the structured meshes reconstructed based on the PolyFit algorithm were experimentally compared. See Appendix Figure 10 。The results show that the method designed in the present invention can obtain a mesh with a flat planar structure, obvious edge features and no topological structure errors. In addition, Appendix Figure 9 Both the simulation experiment and the real-scene experiment prove that after introducing the hypothesis testing model, the efficiency of the algorithm is greatly improved while the accuracy of the reconstructed mesh is hardly affected.

[0085] On the other hand, the embodiment of the present invention also provides an optimization device for a building mesh model based on line feature constraints, including:

[0086] A processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute an optimization method for a building mesh model based on line feature constraints as described in the above technical solution.

[0087] It should be understood that the parts not elaborated in detail in this specification all belong to the prior art.

[0088] It should be understood that the above description of the preferred embodiment is relatively detailed, and it should not be considered as a limitation to the protection scope of the present invention patent. Under the inspiration of the present invention, those of ordinary skill in the art can also make substitutions or deformations without departing from the protection scope defined by the claims of the present invention, and all fall within the protection scope of the present invention. The scope of protection requested by the present invention shall be subject to the appended claims.

Claims

1. A building grid model optimization method based on line feature constraints, characterized in that: The following steps are involved: Step 1: perform high-precision registration of the input 3D straight line and the 3D grid to ensure that the coordinate systems of the two are consistent; Step 2, projecting the 3D straight line onto the grid by calculating the shortest distance from the 3D straight line sampling point to the 3D grid; Step 3: Based on the idea of ​​greedy growth, under the constraints of geometric distance and angle, search for the plane structure controlled by the three-dimensional straight line in the three-dimensional grid; Step 4: determine whether there are other embedded three-dimensional straight lines in the area controlled by the three-dimensional straight line obtained in step 3 based on the marked attributes. If so, cut the area to be optimized based on the embedded three-dimensional straight line using the constrained shortest path algorithm. Step 5, preprocessing the area to be optimized, including: clearing the grid points and triangular faces inside it, connecting the two end points of the three-dimensional straight line with the nearest boundary point; Step 6: Based on the dynamic programming algorithm, the pre-processed area to be optimized is reconstructed into a grid under the constraint of the three-dimensional straight line.

2. A building grid model optimization method based on line feature constraints according to claim 1, characterized in that: In step 2, the three-dimensional straight line is discretized into dense points, and the point with the shortest distance from each point to the three-dimensional grid is calculated as the projection point. The set of grid primitive areas where all the projection points of the three-dimensional straight line in the grid are located is the area corresponding to the three-dimensional straight line in the grid; The calculation of the shortest distance is shown in formula (1): In formula (1), d space Represents the distance from the 3D line sampling point to its projection point. Represents the distance from the 3D line sampling point to the jth triangle in the 3D mesh.

3. A building grid model optimization method based on line feature constraints according to claim 1, characterized in that: In step 3, greedy growth is performed on the area where the three-dimensional straight line is located in the grid, so that the area that can be optimized under the constraint of the three-dimensional line segment covers the grids corresponding to the two half-planes that it can control. The growth process is constrained based on the geometric relationship between the line and the surface, the distance from the straight line to the triangular mesh surface, and the angle between adjacent mesh triangles. The mesh triangles with distances and angles less than the threshold are added to the area controlled by the straight line. The iteration stop condition is: no new mesh triangles are added to the area controlled by the straight line.

4. A building grid model optimization method based on line feature constraints according to claim 3, characterized in that: The distance threshold from the 3D line to the mesh triangle is determined using an adaptive strategy, as shown in formula (2): In formula (2), d threshold represents the distance threshold, It represents the distance from the i-th 3D line sampling point to its projection point, median represents the median, std represents the standard deviation, and C is a constant.

5. The building grid model optimization method based on line feature constraints according to claim 1, characterized in that: In step 4, the clipping line is composed of the shortest path from the endpoint of each embedded line feature to the grid area boundary or other embedded line features in the area. The shortest path search is implemented using the constrained Dijkstra algorithm, that is, in the area controlled by the straight line obtained in step 3, the shortest path from the two endpoints of the embedded three-dimensional straight line to the area boundary or other embedded three-dimensional straight lines in the area is searched in turn. Two constraints are added during the search process: 1) Non-repetitive constraint: The shortest path searched from the endpoints of the embedded 3D line cannot overlap with itself in whole or in part; 2) Non-loop constraint: When the endpoint of the shortest path of an endpoint of the embedded three-dimensional straight line A is on the embedded three-dimensional straight line B, when the embedded three-dimensional straight line B searches for the shortest path, the three-dimensional straight line A cannot be used as the endpoint to avoid the cutting line forming multiple closed loops and causing cutting failure.

6. A building grid model optimization method based on line feature constraints according to claim 5, characterized in that: Among the several grid sub-regions after clipping, the sub-region with the smallest distance to the three-dimensional straight line is selected as the final region to be optimized. The distance calculation formula is shown in formula (3): In formula (3), d line-mesh represents the distance from the 3D line to the grid, It represents the distance from the i-th 3D line sampling point to its projection point, and median represents the median value.

7. The building grid model optimization method based on line feature constraints according to claim 1, characterized in that: The mesh reconstruction in step 6 is implemented based on the dynamic programming framework, with the sum of the perimeter and the sum of the dihedral angles of the triangle as the optimization target. According to the dynamic programming algorithm framework for hole filling, the state transition process combines a new triangle ΔV i V k V j And three-dimensional polygonal holes {V i ,V i+1 ,...,V k } and {V k ,V k+1 ,...,V j }, where i, k, and j represent the indices of vertices; let the current subproblem be to find the triangulation result of a three-dimensional polygon hole {V i ,V i+1 ,...,V j } contains the triangle ΔV i V k V j The triangulation of i-j-k , then the state transfer equation is as shown in formula (4): In formula (4), A(Δ1, Δ2) represents the dihedral angle of two triangular facets, L(Δ) represents the perimeter of the triangular facet, and w represents the normalization coefficient.

8. A building grid model optimization method based on line feature constraints according to claim 7, characterized in that: Based on the adaptive iteration to solve the normalization coefficient, the specific calculation is shown in formula (5): In formula (5), A LSM and P LSM They represent the sum of dihedral angles and perimeters of the triangular facets in the mesh area to be optimized, A s-1 and P s-1 represents the average value of the sum of dihedral angles and the sum of perimeters corresponding to the optimal triangulation of a three-dimensional polygonal hole with s-1 sides, w s It represents the normalization coefficient when calculating the optimal triangulation of a 3D polygonal hole with s sides during dynamic programming. n represents the total number of sides of the 3D polygonal hole to be triangulated.

9. The method for optimizing a building grid model based on line feature constraints according to claim 7, characterized in that: In step 6, a hypothesis testing model is introduced in the dynamic programming process to improve the efficiency of the algorithm. Suppose the newly introduced dihedral angle A merge =a0, define the null hypothesis: directly transfer the state from the triangulation result corresponding to the optimal state; alternative hypothesis: backtrack all candidate states, recalculate the minimum value after introducing the new dihedral angle, if it satisfies formula (6), reject the null hypothesis, backtrack all possible candidate states, and recalculate the optimal state, otherwise, directly transfer the optimal state; P(A merge ≥a0)≤α (6) In formula (6), P represents the probability of an event, α represents the significance level, and the probability distribution function F based on which the probability is calculated is initialized by the RANSAC detection result of the planarity of the optimized grid, and is updated in dynamic programming according to the dihedral angle formed during the triangulation process.

10. A building grid model optimization device based on line feature constraints, characterized in that: include: A processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute a building grid model optimization method based on line feature constraints as described in any one of claims 1 to 9.