A method and system for converting a building real scene model into a monomer model
Through technical means such as filtering processing, grid clustering, wireframe extraction and fitting projection, the problem of low accuracy of existing grid simplification methods is solved, and efficient simplification and accurate conversion of building structures is achieved.
Patent Information
- Application Number
- CN202410991590.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The existing grid simplification method has low accuracy in the conversion process of building structures, resulting in unsatisfactory simplification effect of building structures.
The Mesh model of the building is filtered, grid clustering is performed, wireframe structure is extracted and simplified, the polygonal Mesh model is reconstructed by fitting projection, and the model is optimized through self-interlace polygon repair.
It realizes fully automatic transformation of building structure from Mesh model to monolithic model, reduces the geometric complexity of the model, improves simplified accuracy, and is suitable for large-scale application scenarios.
Smart Images

Figure CN118781290B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of real-scene three-dimensional data processing, and in particular relates to a method and a system for converting a real-scene model of a building into a monomer model. Background Art
[0002] Real-life 3D technology is an important part of smart city construction. Through 3D digital technology, accurate representation and dynamic management of urban space can be achieved, promoting the intelligent and refined governance of cities. With the development of technology and the expansion of application scenarios, a variety of mainstream technologies have emerged in the field of real-life 3D data processing, including data collection, processing, analysis and visualization. The main modeling methods in the field of 3D modeling include fully automatic reconstruction based on multi-view 3D images and semi-automatic modeling based on human-machine collaboration based on multi-source remote sensing data.
[0003] The method of fully automatic reconstruction based on multi-view 3D reconstruction of images first determines the image pose and camera internal orientation elements through sparse reconstruction of images, then obtains dense point clouds through computer vision multi-view matching technology, and then uses these point clouds to obtain 3D irregular triangulated networks (3D TIN) through 3D meshing technology. Finally, the texture mapping technology is used to extract realistic textures from each face of the irregular triangulated network, and finally an irregular triangulated mesh model is formed. Due to the full automation of multi-view 3D reconstruction, the modeling efficiency and cost are relatively controllable, and the 3D expression is more accurate, so the 3D model in the form of irregular triangulated networks is favored by many applications.
[0004] However, the mesh models generated from point clouds through surface reconstruction algorithms usually contain hundreds of millions of faces, which poses a huge burden on visualization, storage, and data transmission in real-world applications. In some large-scale application scenarios, such as communication shielding analysis, augmented reality navigation, disaster assessment simulation, etc., the texture information and details of the model are not necessary. But in these applications, low memory usage, fast data transmission, and efficient physical calculation analysis are always preferred. Therefore, achieving a reduction in model complexity while maintaining the scene structure has become an urgent task.
[0005] Semi-automatic modeling based on multi-source remote sensing data mainly collects feature points and lines through certain rules on the reference three-dimensional irregular network model, point cloud or stereo image through human-computer interaction, and finally the computer completes the construction of the three-dimensional body through a specific algorithm. The model generated by this method is a monomer model. Unlike the automated irregular triangulated network model, it models each independent entity in a complex scene (such as a single building, mechanical parts, etc.) separately, and the generated model focuses on the detailed description of the individual entity. It often contains geometric shapes, topological information, materials, textures, etc. The monomer model is more specific and detailed in information expression. Compared with the Mesh model, the advantages of the monomer model are that it contains detailed physical, geometric and material information, which is suitable for analysis and simulation. The monomer model has a clear structure and complete information, which is convenient for subsequent modification and optimization. The disadvantage is that the construction process is complicated and the time and labor costs are high.
[0006] Extracting buildings from large scenes is crucial for many applications, and many excellent techniques for extracting individual buildings have been developed. Among them, mesh simplification is one of the most common algorithms. An efficient mesh simplification method should be able to ignore small-scale details while preserving the main structure of the mesh. Mesh simplification algorithms merge vertices by performing edge collapse operations by minimizing a predefined geometric error metric. However, existing error metrics are sensitive to noise and vertex density, so incorrect approximations may accumulate during the iteration process, resulting in low accuracy.
[0007] Therefore, a new mesh simplification method is needed to achieve the automatic conversion of building structures from Mesh models to monomer models while maintaining the structure of urban building mesh models. Summary of the invention
[0008] In view of this, the present invention proposes a method and system for converting a real-scene model of a building into a monomer model, which is used to solve the problem of low accuracy of a grid simplification method for building structures in monomer building extraction technology.
[0009] The present invention discloses a method for converting a building real scene model into a monomer model, the method comprising:
[0010] Select a single building to be processed from the real-scene 3D model of the building, obtain the Mesh model of the single building and perform filtering processing;
[0011] Performing mesh clustering on the filtered Mesh model, and extracting and simplifying the wireframe structure according to the mesh clustering result to obtain a simplified wireframe model;
[0012] Perform fitting projection according to the simplified wireframe model to obtain the plane polygon corresponding to each cluster, and reconstruct the polygonal Mesh model;
[0013] The polygonal Mesh model is repaired by self-intersecting polygons through line segment intersection detection to obtain a simplified polygonal Mesh model.
[0014] On the basis of the above technical solution, preferably, the filtering process specifically includes:
[0015] Initialize the normal vector of each triangle face of the Mesh model;
[0016] Calculate the weight function of the filter through the Gaussian function;
[0017] Calculate the expected normal vector after smoothing filtering according to the normal vector of each triangle face of the Mesh model, the area of the triangle face, and the corresponding weight function;
[0018] Update the positions of the triangle vertices of the Mesh model according to the expected normal vector after the smoothing filter;
[0019] Repeat the above steps for iterative calculation until the preset convergence condition is met.
[0020] On the basis of the above technical solution, preferably, the mesh clustering of the filtered Mesh model specifically includes:
[0021] Calculate the k-neighborhood flatness of each point in the Mesh model after the filtering process;
[0022] Calculate the k-neighborhood flatness of each triangle face based on the k-neighborhood flatness of each point;
[0023] Sort the flatness of the k-neighborhood of each triangle in descending order, and take the triangle with the highest flatness of the k-neighborhood as the starting face of clustering;
[0024] Calculate the average normal vector of each cluster based on the normal vector of each triangle;
[0025] Starting from the starting face, retrieve the connected faces of the current triangle face. If the angle between the normal vector of the connected face and the average normal vector of the current cluster is less than a preset threshold, add the connected face to the current cluster. This process is repeated until all connected faces are retrieved, and a clustering process is completed.
[0026] From the remaining unclustered triangles, take the triangle with the highest k-neighborhood flatness as the starting face for clustering, and repeat the above clustering process until all triangles are clustered.
[0027] On the basis of the above technical solution, preferably, the extraction and simplification of the wireframe structure according to the grid clustering result to obtain a simplified wireframe model specifically includes:
[0028] Extract the boundary line of the grid surface according to the grid clustering result, and determine the endpoints of the boundary line and the connection points in the middle of the boundary line by querying the adjacent clusters of each point on the boundary line;
[0029] The endpoints of the dividing line are defined as key points, and the connection points in the middle of the dividing line are discarded to obtain a simplified wireframe model.
[0030] On the basis of the above technical solution, preferably, performing fitting projection according to the simplified wireframe model to obtain the plane polygon corresponding to each cluster, and reconstructing the polygonal Mesh model specifically includes:
[0031] According to the simplified wireframe model, the key point weights and area weights in each cluster are calculated, the projection weight of each cluster is calculated according to the key point weights and area weights, and the projection weights are arranged in descending order;
[0032] According to the order of projection weights, the mesh surface corresponding to each non-triangular cluster is projected into a plane polygon, and the coordinates of the corresponding key points are used as fixed key points of the projection plane;
[0033] For clusters with existing fixed key points, the number of fixed key points corresponding to each cluster is counted, and different fitting projection strategies are formulated according to the number of fixed key points to obtain the fitting plane of the corresponding cluster;
[0034] Plane polygons are generated according to the fitting planes and projection boundaries of each cluster to obtain a polygonal Mesh model.
[0035] On the basis of the above technical solution, preferably, the formula for calculating the projection weight of each cluster according to the key point weight and the area weight is:
[0036]
[0037] Among them, c t ∈C is the tth cluster in the full cluster set C, is the cluster c t The projection weight, is the cluster c t The key point weights in is the cluster c t The area weight of Represents cluster c t The number of key points in ; Represents cluster c t The horizontal projection area of .
[0038] On the basis of the above technical solution, preferably, the formulating different fitting projection strategies according to the number of fixed key points specifically includes:
[0039] If the number of fixed key points is 1, the key points in the corresponding cluster are fitted by the least squares method to obtain an approximation plane, and the approximation plane is translated to the corresponding fixed key points as the fitting plane of the corresponding cluster;
[0040] If the number of fixed key points is 2, take these two fixed key points as anchor points, and form a plane with each of the remaining movable key points in turn, and take the plane with the smallest average projection distance as the fitting plane of the corresponding cluster;
[0041] If the number of fixed key points is 3, a plane is constructed with these 3 fixed key points as anchor points as the fitting plane of the corresponding clustering cluster;
[0042] If the number of fixed key points is greater than 3, the mesh surface in the corresponding cluster is re-meshed and re-projected.
[0043] In a second aspect, the present invention discloses a system for converting a building real scene model into a monomer model, the system comprising:
[0044] Preprocessing module: used to select a single building to be processed from the real-life 3D model of the building, obtain the Mesh model of the single building and perform filtering processing;
[0045] Wireframe simplification module: used to perform mesh clustering on the Mesh model after the filtering process, and extract and simplify the wireframe structure according to the mesh clustering result to obtain a simplified wireframe model;
[0046] Polygon reconstruction module: used to perform fitting projection according to the simplified wireframe model, obtain the plane polygon corresponding to each cluster, and reconstruct the polygon Mesh model;
[0047] Model repair module: used for repairing the self-intersecting polygons of the polygonal Mesh model through line segment intersection detection to obtain a simplified polygonal Mesh model.
[0048] In a third aspect of the present invention, an electronic device is disclosed, comprising: at least one processor, at least one memory, a communication interface and a bus;
[0049] Wherein, the processor, memory, and communication interface communicate with each other via the bus;
[0050] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the method according to the first aspect of the present invention.
[0051] According to a fourth aspect of the present invention, a computer-readable storage medium is disclosed, wherein the computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to implement the method described in the first aspect of the present invention.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] 1) The present invention performs mesh clustering on the filtered single building Mesh model, extracts and simplifies the wireframe structure according to the mesh clustering result, reconstructs the polygonal Mesh model by fitting projection, and optimizes the polygonal Mesh model by self-intersecting polygon repair to obtain a simplified monomer model; the present invention can process monomer buildings in real three-dimensional scenes one by one, realize the automatic construction of buildings from Mesh models to monomer models, simplify the urban building mesh model structure while maintaining it, reduce the geometric complexity of monomer buildings, and improve the accuracy of simplification.
[0054] 2) The present invention removes geometric defects such as noise and uneven density in complex meshes by smoothing and filtering the facial normals of a single building Mesh model, and retains the basic structure of the model, providing streamlined data support for subsequent model simplification.
[0055] 3) The present invention performs mesh clustering by calculating the k-neighborhood flatness of each triangular face, and takes each cluster as the basic unit for simplification processing. For each cluster, the boundary line of the mesh surface is extracted, and the wireframe structure is extracted and simplified by querying the number of adjacent clusters of each point on the boundary line. The main structure of the mesh can be retained while ignoring small-scale details, simplifying the Mesh model into a wireframe structure, reducing the data volume of the model while maintaining the plane features.
[0056] 4) The present invention measures the complexity of clustering according to the number and area of key points, thereby calculating the projection weight of each cluster, and projects the mesh surfaces corresponding to each cluster into planar polygons in the order of projection weights. Different fitting projection strategies are formulated according to the number of fixed key points obtained by projection to generate planar polygons, thereby achieving segmented plane approximation of the original geometric shape and ensuring the accuracy of the simplified polygonal Mesh model. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 A flow chart of a method for converting a real-scene model of a building into a monomer model according to the present invention;
[0059] Figure 2 The figure is a comparison diagram of the top structure model of a certain building before and after the conversion by the present invention;
[0060] Figure 3 A comparison diagram of the top structure model of another building before and after the conversion by the present invention;
[0061] Figure 4 This is a comparison diagram of the top structure model of another building before and after the conversion by the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] See also Figure 1 The present invention proposes a method for converting a building real scene model into a monomer model, the method comprising:
[0064] S1. Select a single building to be processed from the real-scene 3D model of the building, obtain a Mesh model of the single building and perform filtering processing.
[0065] In an embodiment of the present invention, a bilateral filtering algorithm is used to smooth the normals of the triangular faces of the Mesh model to achieve filtering of the Mesh model of a single building. Each time the Mesh model is filtered, a new set of expected smooth normals is obtained, and the coordinates of each triangular face vertex can be updated by these expected normal values. After multiple rounds of iterations, the normals of each triangular face gradually tend to the expected direction, and the coordinate value changes gradually converge, thereby achieving smoothing of the triangular face normals.
[0066] S11. Initialize the normal vector of each triangle face of the Mesh model.
[0067] Given a Mesh model M, its triangle face f with index i i The normal vector The calculation formula is:
[0068]
[0069] Among them, v1, v2, v3 are f i The three vertices of .
[0070] S12. Calculate the weight function of the filter by using a Gaussian function.
[0071] The bilateral filtering of the present invention involves two weights: (1) a weight based on spatial distance; and (2) a weight based on normal vector proximity.
[0072] Given two faces f with indices i and j i and f j , the spatial distance between them is determined by their center point c i and c j The Euclidean distance between is calculated using and As the normal vectors of the two faces, two weight functions of the filter are calculated. The definition of the two weight functions is similar to that of the Gaussian function. The formula is as follows:
[0073]
[0074] in, and Are two weight functions of filtering, and both are non-negative functions, is the weight function based on spatial distance, is the weight function based on the normal vector proximity; σ dist is the distance proximity variance parameter; θ is the user-defined angle threshold, a smaller value will produce better discrimination; when the distance between adjacent triangles increases, The value of decreases rapidly, and vice versa; when the difference between the normal vectors of adjacent triangles is large, reflects a smaller change, and vice versa. In the invention, σ dist is estimated as the average edge length of M, and θ is set to 20°.
[0075] S13, calculating the expected normal vector after smoothing filtering according to the normal vector of each triangular face of the Mesh model, the area of the triangular face, and the corresponding weight function.
[0076] definition For the triangle face f i A neighborhood set where each neighborhood element satisfies the following conditions:
[0077] (1) It is related to the triangle face f i There is at least one common point;
[0078] (2) Its normal vector With noodles i The normal vector The dot product of should be greater than cosθ.
[0079] In addition, to prevent the absence of adjacent faces that meet the conditions, resulting in an empty result, the face fi You should also include In collection.
[0080] set up is a set of triangular faces of the Mesh model. The formula for calculating the expected normal vector after filtering is as follows:
[0081]
[0082] in, is the expected normal vector after filtering, w i is the normalization term, ensuring that the result is a unit vector, is a triangle face f j area.
[0083] It can be seen that the new filtered expected normal vector is a weighted average of the neighborhood normal vectors, which can be intuitively interpreted as a smoothing operation on the facial normal, so it essentially preserves the basic structure of the model.
[0084] S14. Update the positions of the triangle vertices of the Mesh model according to the expected normal vector after the smoothing filter.
[0085] Since the non-boundary vertex v with index l l There are at least three faces in its single ring neighborhood, which are defined as neighborhood faces. They provide reliable guidance for vertex updates. Triangle face f k Calculate the vertex displacement value based on the center point coordinates
[0086]
[0087] in, is the vertex v l The number of neighboring faces of ; Indicates f k is the vertex v l A neighborhood face of is the triangle face f with index k k The filtered expected normal vector of is a triangle face f k The current normal vector, For the triangle face f k The center point coordinates of .
[0088] According to the vertex displacement value Update the triangle vertex positions of the Mesh model.
[0089] S15. Repeat the above steps to perform iterative calculations until a preset convergence condition is met.
[0090] Return to step S11 to perform iterative calculations until a preset convergence condition is met. The preset convergence condition is that the displacement of each vertex is within a specified threshold or reaches a preset number of iterations. Generally, after 15 iterations, the change in the mesh can be ignored.
[0091] The present invention removes geometric defects such as noise and uneven density in complex meshes by smoothing and filtering the facial normals of a single building Mesh model, and retains the basic structure of the model, providing streamlined data support for subsequent model simplification.
[0092] S2. Performing mesh clustering on the filtered Mesh model, and extracting and simplifying the wireframe structure according to the mesh clustering result to obtain a simplified wireframe model.
[0093] Step S2 specifically includes the following sub-steps:
[0094] S21. Flatness calculation.
[0095] S211, calculating the k-neighborhood flatness of each point in the Mesh model after the filtering process.
[0096] Suppose in the Mesh model, point v l With v k The grid distance between If two points are directly connected, the distance is set to 1, if there is one point between them, the distance is set to 2, and so on. For point v l The k-ring neighborhood point set of v, where all point elements satisfy the condition: it is connected to point v l Grid distance Less than or equal to k.
[0097] definition Set midpoint v l The quality of the least squares plane fit is the point v l The k-neighborhood flatness The least squares plane fit quality is defined as: the best fit plane is calculated using the least squares method, and then the fit quality is obtained by calculating the projection distances of the points in the point set to the fit plane and calculating the variance of these distances. The fit quality value is between 0 and 1, where 0 means the variance is the same on any line in the best fit plane, i.e. the worst fit, and 1 means the variance is zero in the vertical direction of the best fit line, i.e. the best fit, and the data points are best arranged along the best fit line.
[0098] S212. Calculate the k-neighborhood flatness of each triangle according to the k-neighborhood flatness of each point.
[0099] Suppose a triangle f i The k-neighboring plane set of The concept of k-neighborhood here combines the definition of the neighborhood in the filtering process of step S1 and the definition of k-neighborhood in the point planarity calculation of step S211, that is, it satisfies: i The neighborhood triangle f k With f i Grid distance For every additional triangle, Increase by 1, The triangular elements in the set all satisfy f i Grid distance Less than or equal to k.
[0100] Based on this, we can calculate the triangle face f i The k-neighborhood flatness
[0101]
[0102] in, Represents point v with index m m yes The endpoints of the triangles in the collection, is the number of endpoints, is the flatness of the k-neighborhood corresponding to the endpoint.
[0103] S22. Grid clustering.
[0104] S221. Sort the flatness of the k-neighborhood of each triangular face in descending order, and take the triangular face with the highest k-neighborhood flatness as the starting face for clustering.
[0105] S222. During the clustering process, the average normal vector of each cluster is calculated based on the normal vector of each triangle.
[0106] The tth cluster c t The average normal vector for:
[0107]
[0108] Among them, f k ∈c t (k) represents f k is cluster c t The triangle in |c t (k)|0 is the number of triangles in the current cluster. is a triangle face f k The normal vector of .
[0109] Understandably, The value of will be updated as the number of clustering iterations is updated.
[0110] S223, starting from the starting face, retrieve the current triangle face f i If the normal vector of the contact surface is consistent with the current cluster c t The average normal vector If the angle between them is less than a preset threshold, the connecting faces are added to the current cluster cluster until all the connecting faces are retrieved and a clustering process is completed.
[0111] S224: For the remaining unclustered triangular faces, return to step S221 and repeat the above clustering process until all triangular faces are clustered.
[0112] In an embodiment of the present invention, in order to resist abnormal clustering caused by noise or poor mesh quality, the present invention sets an adjustable threshold for the minimum number of clustering triangles. For clusters with a number of triangles less than the adjustable threshold, after completing the above clustering, they will be merged into the adjacent cluster with the closest average normal vector.
[0113] S23. Extraction and simplification of wireframe structure.
[0114] The boundary line of the grid surface is extracted according to the grid clustering result. By querying the adjacent clusters of each point on the boundary line, the endpoints of the boundary line and the connection points in the middle of the boundary line are determined. Specifically, if a point is adjacent to only two or less clusters, it is a connection point; if the number of adjacent clusters of a point is greater than or equal to 3, it is the endpoint of the boundary line. It can be understood that in order to handle the boundary situation, when searching for adjacent clusters, the boundary should also be counted as a cluster and added as the number of adjacent clusters.
[0115] The endpoints of the dividing line are defined as key points, and the connection points in the middle of the dividing line are discarded to obtain a simplified wireframe model.
[0116] The present invention performs mesh clustering by calculating the k-neighborhood flatness of each triangular face, and takes each cluster as the basic unit of simplification processing. For each cluster, the boundary line of the mesh surface is extracted, and the wireframe structure is extracted and simplified by querying the number of adjacent clusters of each point on the boundary line. The main structure of the mesh can be retained while ignoring small-scale details, and the Mesh model can be simplified to a wireframe structure, thereby reducing the data volume of the model while maintaining the plane features.
[0117] S3. Perform fitting projection according to the simplified wireframe model to obtain the plane polygons corresponding to each cluster, and reconstruct the polygonal Mesh model.
[0118] Step S3 specifically includes the following sub-steps:
[0119] S31. Calculate projection weights and arrange them in descending order.
[0120] The present invention calculates the key point weights and area weights in each cluster according to the simplified wireframe model, calculates the projection weight of each cluster according to the key point weights and area weights, and arranges the projection weights in descending order.
[0121] In the embodiment of the present invention, the order of projection is determined by calculating the projection weight of each cluster. This weight is related to two parameters:
[0122] (1) The number of key points in the cluster. This parameter reflects the complexity of the cluster to a certain extent. More key points indicate that the cluster is associated with many other clusters and should be fitted first.
[0123] (2) The projected area of the clusters on the horizontal plane. Clusters with larger areas should be projected first.
[0124] Therefore, the present invention calculates the key point weights and area weights in each cluster, and then calculates the projection weight of each cluster according to the key point weights and area weights. The specific calculation formula is:
[0125]
[0126]
[0127] Among them, c t ∈C is the tth cluster in the full cluster set C, is the cluster c t The projection weight, is the cluster c t The key point weights in is the cluster c t The area weight of Represents cluster c t The number of key points in ; Represents cluster c t The horizontal projection area of .
[0128] S32. Project the mesh surface corresponding to each non-triangular cluster into a plane polygon in the order of projection weights, and use the coordinates of the corresponding key points as fixed key points of the projection plane.
[0129] It is understandable that in the embodiments of the present invention, the projection needs to comply with the following rules:
[0130] (1) Triangular clustering does not require projection fitting.
[0131] (2) Whenever a cluster is projected into a planar polygon, the coordinates of its key points are fixed and cannot be reprojected.
[0132] (3) For clusters that already have fixed key points, calculate the number of fixed key points and formulate different fitting projection strategies based on the number of fixed key points.
[0133] (4) When projecting key points, if the projection error of any key point exceeds the set threshold, clustering is applied for re-division.
[0134] According to the above projection rules, the mesh surface corresponding to the cluster to be projected is projected into a plane polygon, and the coordinates of the corresponding key points are used as fixed key points of the projection plane.
[0135] S33. For clusters with existing fixed key points, count the number of fixed key points corresponding to each cluster, adopt different fitting projection strategies according to the number of fixed key points, and obtain the fitting plane of the corresponding cluster.
[0136] In the embodiment of the present invention, formulating different fitting projection strategies according to the number of fixed key points specifically includes:
[0137] ① If the number of fixed key points is 1, the key points in the corresponding cluster are fitted by the least squares method to obtain an approximation plane, and the approximation plane is translated to the corresponding fixed key points as the fitting plane of the corresponding cluster;
[0138] ② If the number of fixed key points is 2, take these two fixed key points as anchor points, and form a plane with each of the remaining movable key points in turn, and use the plane with the smallest average projection distance as the fitting plane of the corresponding cluster; in each cluster, the key points to be projected except the fixed key points are all movable key points;
[0139] ③ If the number of fixed key points is 3, use these 3 fixed key points as anchor points to form a plane as the fitting plane of the corresponding clustering cluster;
[0140] ④ If the number of fixed key points is greater than 3, the grid surface in the corresponding cluster will be re-meshed and re-projected.
[0141] For cluster repartitioning, the division rules are as follows: first, re-triangulate the polygonal holes formed by the cluster, calculate the normal vectors of each triangle, then traverse the edges of the triangulated triangles, calculate the dot product of the normal vectors of the triangles on both sides of each edge, and find the edge with the smallest dot product as the dividing line to divide the cluster into two new clusters. It can be understood that in order to prevent the generation of reverse abnormal faces, edges with a dot product less than 0 should not be taken into consideration.
[0142] S34. Generate planar polygons according to the fitting planes and projection boundaries of each cluster to obtain a polygonal Mesh model.
[0143] The projection polygon can be determined based on the fitting plane and projection key points of each cluster.
[0144] The present invention measures the complexity of clustering according to the number and area of key points, thereby calculating the projection weight of each clustering cluster, and projects the mesh surfaces corresponding to each clustering cluster into planar polygons in the order of projection weights. Different fitting projection strategies are formulated according to the number of fixed key points obtained by projection to generate planar polygons, thereby achieving segmented plane approximation of the original geometric shape and ensuring the accuracy of the simplified polygonal Mesh model.
[0145] S4. Perform self-intersecting polygon repair on the polygonal Mesh model through line segment intersection detection to obtain a simplified polygonal Mesh model.
[0146] After the mesh surfaces of each cluster are projected to form planar polygons, the point index order of the polygon surface still follows the boundary order of the cluster. However, the projection operation may cause some key points that are close to each other or on clusters with poor boundary quality to be reversed in order after projection, forming self-intersecting polygons.
[0147] In order to repair these self-intersecting polygons, the present invention processes the planar polygons with self-intersecting line segments through line segment intersection detection, and after solving the intersection points, discards the smaller self-intersecting parts, thereby retaining the correct polygon.
[0148] The following takes the roof structure plate of a building as an example to verify the technical effect of the present invention.
[0149] Figure 2 , Figure 3 , Figure 4 The figures are comparison diagrams before and after the simplification processing of different single building Mesh models by the method of the present invention, wherein the left side are all original Mesh models before simplification processing, and the right side are all monomer models obtained after simplification processing. By comparing the Mesh model before simplification processing and the monomer model after simplification processing, it can be known that the three-dimensional model conversion method of the present invention realizes the conversion of the top structure of the building from the three-dimensional irregular triangulated mesh structure to the polygonal Mesh structure, and can effectively reduce the geometric complexity of the monomer building while retaining the basic structure of the model, improve the accuracy of simplification, and provide technical support for realizing the fully automatic construction technology from the building Mesh model to the monomer model.
[0150] Corresponding to the above method embodiment, a system for converting a building real scene model into a monomer model includes:
[0151] Preprocessing module: used to select a single building to be processed from the real-life 3D model of the building, obtain the Mesh model of the single building and perform filtering processing;
[0152] Wireframe simplification module: used to perform mesh clustering on the Mesh model after the filtering process, and extract and simplify the wireframe structure according to the mesh clustering result to obtain a simplified wireframe model;
[0153] Polygon reconstruction module: used to perform fitting projection according to the simplified wireframe model, obtain the plane polygon corresponding to each cluster, and reconstruct the polygon Mesh model;
[0154] Model repair module: used for repairing the self-intersecting polygons of the polygonal Mesh model through line segment intersection detection to obtain a simplified polygonal Mesh model.
[0155] The above system embodiments and method embodiments correspond one to one, and for a brief description of the system embodiments, please refer to the method embodiments.
[0156] The present invention also discloses an electronic device, comprising: at least one processor, at least one memory, a communication interface and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the aforementioned method of the present invention.
[0157] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to implement all or part of the steps of the method described in the embodiment of the present invention. The storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk, and other media that can store program codes.
[0158] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be distributed to multiple network units. A person skilled in the art may select some or all of the modules according to actual needs to achieve the purpose of the solution of this embodiment without creative effort.
[0159] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for converting a building real scene model into a monomer model, characterized in that: The method comprises: Select a single building to be processed from the real-scene 3D model of the building, obtain the Mesh model of the single building and perform filtering processing; Performing mesh clustering on the filtered Mesh model, and extracting and simplifying the wireframe structure according to the mesh clustering result to obtain a simplified wireframe model; Extract the boundary line of the mesh surface according to the mesh clustering result, define the endpoint of the boundary line of the mesh surface as the key point, calculate the key point weight and area weight in each cluster class cluster according to the simplified wireframe model, calculate the projection weight of each cluster class cluster according to the key point weight and area weight, and arrange the projection weights in descending order; project the mesh surface corresponding to each non-triangular cluster class cluster into a plane polygon according to the order of projection weight, and use the coordinates of the corresponding key points as the fixed key points of the projection plane; for cluster class clusters with existing fixed key points, count the number of fixed key points corresponding to each cluster class cluster, formulate different fitting projection strategies according to the number of fixed key points, and obtain the fitting plane of the corresponding cluster class cluster; generate a plane polygon according to the fitting plane and projection boundary of each cluster class cluster to obtain a polygonal Mesh model; The polygonal Mesh model is repaired by self-intersecting polygons through line segment intersection detection to obtain a simplified polygonal Mesh model.
2. The method for converting a building real scene model into a monomer model according to claim 1, characterized in that: The filtering process specifically includes: Initialize the normal vector of each triangle face of the Mesh model; Calculate the weight function of the filter through the Gaussian function; Calculate the expected normal vector after smoothing filtering according to the normal vector of each triangle face of the Mesh model, the area of the triangle face, and the corresponding weight function; Update the positions of the triangle vertices of the Mesh model according to the expected normal vector after the smoothing filter; Repeat the above steps for iterative calculation until the preset convergence condition is met.
3. The method for converting a building real scene model into a monomer model according to claim 1, characterized in that: The mesh clustering of the filtered Mesh model specifically includes: Calculate the k-neighborhood flatness of each point in the Mesh model after the filtering process; Calculate the k-neighborhood flatness of each triangle face based on the k-neighborhood flatness of each point; Sort the flatness of the k-neighborhood of each triangle in descending order, and take the triangle with the highest flatness of the k-neighborhood as the starting face of clustering; During the clustering process, the average normal vector of each cluster is calculated based on the normal vector of each triangle. Starting from the starting face, retrieve the connected faces of the current triangle face. If the angle between the normal vector of the connected face and the average normal vector of the current cluster is less than a preset threshold, add the connected face to the current cluster. This process is repeated until all connected faces are retrieved, and a clustering process is completed. From the remaining unclustered triangles, take the triangle with the highest k-neighborhood flatness as the starting face for clustering, and repeat the above clustering process until all triangles are clustered.
4. The method for converting a building real scene model into a monomer model according to claim 3, characterized in that: The extraction and simplification of the wireframe structure according to the grid clustering result to obtain a simplified wireframe model specifically includes: Extract the boundary line of the grid surface according to the grid clustering result, and determine the endpoints of the boundary line and the connection points in the middle of the boundary line by querying the adjacent clusters of each point on the boundary line; The endpoints of the dividing line are defined as key points, and the connection points in the middle of the dividing line are discarded to obtain a simplified wireframe model.
5. The method for converting a building real scene model into a monomer model according to claim 1, characterized in that: The formula for calculating the projection weight of each cluster according to the key point weight and area weight is: Among them, c t ∈C is the tth cluster in the full cluster set C, is the cluster c t The projection weight, is the cluster c t The key point weights in is the cluster c t The area weight of Represents cluster c t The number of key points in ; Represents cluster c t The horizontal projection area of .
6. The method for converting a building real scene model into a monomer model according to claim 1, characterized in that: The formulation of different fitting projection strategies according to the number of fixed key points specifically includes: If the number of fixed key points is 1, the key points in the corresponding cluster are fitted by the least squares method to obtain an approximation plane, and the approximation plane is translated to the corresponding fixed key points as the fitting plane of the corresponding cluster; If the number of fixed key points is 2, take these two fixed key points as anchor points, and form a plane with each of the remaining movable key points in turn, and take the plane with the smallest average projection distance as the fitting plane of the corresponding cluster; If the number of fixed key points is 3, a plane is constructed with these 3 fixed key points as anchor points as the fitting plane of the corresponding clustering cluster; If the number of fixed key points is greater than 3, the mesh surface in the corresponding cluster is re-meshed and re-projected.
7. A system for converting a building real scene model into a single model, characterized in that: The system comprises: Preprocessing module: used to select a single building to be processed from the real-life 3D model of the building, obtain the Mesh model of the single building and perform filtering processing; Wireframe simplification module: used to perform mesh clustering on the Mesh model after the filtering process, and extract and simplify the wireframe structure according to the mesh clustering result to obtain a simplified wireframe model; Polygonal reconstruction module: extract the boundary line of the mesh surface according to the mesh clustering result, define the endpoint of the boundary line of the mesh surface as the key point, calculate the key point weight and area weight in each cluster class cluster according to the simplified wireframe model, calculate the projection weight of each cluster class cluster according to the key point weight and area weight, and arrange the projection weights in descending order; project the mesh surface corresponding to each non-triangular cluster class cluster into a plane polygon according to the order of projection weight, and use the coordinates of the corresponding key points as the fixed key points of the projection plane; for cluster class clusters with existing fixed key points, count the number of fixed key points corresponding to each cluster class cluster, formulate different fitting projection strategies according to the number of fixed key points, and obtain the fitting plane of the corresponding cluster class cluster; generate plane polygons according to the fitting plane and projection boundary of each cluster class cluster to obtain a polygonal Mesh model; Model repair module: used for repairing the self-intersecting polygons of the polygonal Mesh model through line segment intersection detection to obtain a simplified polygonal Mesh model.
8. An electronic device, characterized in that: include: at least one processor, at least one memory, a communication interface, and a bus; Wherein, the processor, memory, and communication interface communicate with each other via the bus; The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Building monomer segmentation method for unmanned aerial vehicle oblique photography model according to building facade characteristics
CN114842148A
Building Mesh model simplification method capable of keeping regular features
CN116129076A