Building three-dimensional model construction method and system, intelligent terminal and storage medium
By extracting roof and facade primitives from building point clouds and combining building outline polygons for facade primitive inference and screening, the difficulty in building three-dimensional model construction caused by the lack of point cloud facades is solved, and efficient three-dimensional model generation is achieved.
Patent Information
- Application Number
- CN202510878944.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-27
AI Technical Summary
The prior art cannot effectively build a three-dimensional building model when the point cloud facade part of the building is missing, resulting in loss of model structural features and reduced geometric accuracy.
By obtaining the initial building point cloud and building outline polygons, extracting the roof plane primitives and partial elevation primitives, deleting the point cloud corresponding to the partial elevation primitives, combining the building outline polygons to perform elevation primitive inference, generating a candidate primitive pool, and filtering the target candidate primitives according to preset constraints to generate a three-dimensional building model.
Even in the absence of partial point clouds on the facade, a three-dimensional building model can be constructed better, which improves the success rate and geometric accuracy of model construction.
Smart Images

Figure CN120374889A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional model generation, and particularly to a method, a system, an intelligent terminal, and a storage medium for constructing a three-dimensional model of a building. Background Art
[0002] Currently, three-dimensional refined models of buildings are increasingly widely used and provide key basic information for various applications such as urban management, planning, simulation, safety, and emergency response. Existing methods for reconstructing buildings based on point clouds usually directly use plane extraction algorithms to obtain each plane block, and then assemble them according to the topological relationship between the plane blocks to obtain a complete building model.
[0003] The problem with the existing technology is that when the elevation part of the building point cloud is missing, the corresponding plane cannot be extracted, which is not conducive to realizing the construction of the three-dimensional model of the building.
[0004] Therefore, the related technology still needs to be improved and developed. Summary of the Invention
[0005] The main purpose of the present application is to provide a method, a system, an intelligent terminal, and a storage medium for constructing a three-dimensional model of a building, aiming to solve the technical problem that in the related technology, when directly using a plane extraction algorithm to obtain each plane block and then assembling them according to the topological relationship between the plane blocks to generate a building model, it is not conducive to realizing the construction of the three-dimensional model of the building when the elevation part of the building point cloud is missing.
[0006] To achieve the above object, in the first aspect of the present application, a method for constructing a three-dimensional model of a building is provided, wherein the method for constructing a three-dimensional model of a building includes: Obtain an initial building point cloud and a building contour polygon corresponding to a target building; Extract primitives from the initial building point cloud to obtain an extracted roof plane primitive and an extracted elevation part primitive; Delete the point cloud corresponding to the elevation part primitive from the initial building point cloud to obtain a processed building point cloud; Perform elevation primitive inference based on the processed building point cloud and the building contour polygon to obtain a vertical elevation primitive corresponding to the processed building point cloud; Generate a candidate primitive pool according to the intersection relationship between the roof plane primitive and the vertical elevation primitive, wherein each candidate primitive in the candidate primitive pool is determined according to the sub-patches obtained by cutting based on the intersection relationship; Determine the target candidate primitive from the above candidate primitive pool according to the preset constraint conditions, and generate a three-dimensional building model matching the above target building according to the above target candidate primitive, wherein the above constraint conditions include the fitting degree constraint between the above candidate primitive and the above initial building point cloud, the fitting constraint of the boundary line of the above candidate primitive to the sharp features of the building, and the depth constraint of the above candidate primitive to the building.
[0007] Optionally, the above primitive extraction is performed according to the above initial building point cloud to obtain the extracted roof plane primitive and the extracted facade part primitive, including: Calculate the local normal vector curvature of each initial point in the above initial building point cloud; Determine the initial seed points from the above initial points according to the preset curvature threshold, mark the corresponding classifications for the above initial seed points, and add the above initial seed points to the current region; Update the above current region through the region growing algorithm according to the above seed points and the above initial points until all points are processed, then stop the region growing and obtain the target region after region growing, wherein the above target region includes multiple point clusters of different classifications; Determine the above facade part primitive according to the normal vector components of the plane corresponding to the above point cluster; Determine the above roof plane primitive according to the remaining point clusters, wherein the above remaining point clusters are other point clusters except the point clusters corresponding to the above facade part primitive.
[0008] Optionally, the above determination of the above roof plane primitive according to the remaining point clusters includes: Traverse all the planes corresponding to the above remaining point clusters, and determine the coplanar planes according to the included angle of the normal vectors between the above planes and the overlap degree between the corresponding remaining point clusters; Merge the remaining point clusters corresponding to the above coplanar planes, and update the fitting plane according to the merged remaining point clusters; Take the fitting plane corresponding to the merged remaining point clusters as the above roof plane primitive.
[0009] Optionally, the above inference of the facade primitive is performed according to the above processed building point cloud and the above building contour polygon to obtain the vertical facade primitive corresponding to the above processed building point cloud, including: Construct a triangular mesh according to the above processed building point cloud, wherein each triangular patch in the above triangular mesh is associated with the original three-dimensional vertices in the above processed building point cloud; Obtain the size of the bounding box of the above processed building point cloud in the horizontal plane, and calculate the grid resolution according to the above bounding box size and the preset point cloud density parameter; Obtain the actual coordinates corresponding to each grid point, and determine whether each of the above grid points belongs to the interior of the above building outline polygon; For the interior grid points that belong to the interior of the above building outline polygon, determine the triangular patches in the above triangular mesh corresponding to the above interior grid points, construct a three-dimensional plane equation based on the vertices of the above triangular patches, calculate the height value of the intersection point according to the target ray and the above three-dimensional plane equation, use the above height value as the pixel value corresponding to the above interior grid point, and obtain a height map based on the pixel values corresponding to all the above interior grid points, where the above target ray is a ray passing through the above interior grid point and along the vertical direction; According to the above height map, perform elevation primitive inference to obtain the inferred vertical elevation primitives corresponding to the processed building point cloud.
[0010] Optionally, the above-mentioned performing elevation primitive inference according to the above height map to obtain the inferred vertical elevation primitives corresponding to the processed building point cloud includes: Perform linear mapping on the pixel values in the above height map according to a preset numerical range; Construct a morphological operation kernel, and perform a closing operation on the above height map according to the above morphological operation kernel; Determine a high threshold and a low threshold according to the building height range, and perform edge detection on the above height map according to the above high threshold and the above low threshold to generate a binary edge map; According to the above binary edge map, extract a set of polyline segments corresponding to the elevation contour polyline, perform line segment clustering on the above set of polyline segments, and determine the representative line segment corresponding to each cluster in the clustering result; Obtain the main direction of the building, adjust the direction of the above representative line segment according to the above main direction of the building, and project the adjusted representative line segment in the vertical direction, and use the obtained vertical plane as the above vertical elevation primitive.
[0011] Optionally, the above-mentioned generating a candidate primitive pool according to the intersection relationship between the above roof plane primitive and the above vertical elevation primitive includes: Construct an initial set according to the above roof plane primitive and the above vertical elevation primitive, traverse each primitive in the above initial set, determine all other primitives that intersect with the above primitive, and construct an initial set of intersecting primitives; For each primitive in the above initial set, select a cutting plane from the set of initial intersecting primitives corresponding to the above primitive, and cut the above primitive. If there is an intersection relationship between the sub-primitives generated after cutting and the remaining primitives in the above set of initial intersecting primitives, then return to continue performing the above step of selecting a cutting plane from the set of initial intersecting primitives corresponding to the above primitive and cutting the above primitive until a preset cutting termination condition is met. Among them, for each cutting plane, mutual cutting between planes is performed during cutting; Merge all the sub-patches generated by cutting to obtain the above candidate primitive pool.
[0012] Optionally, the above method of determining a target candidate primitive from the above candidate primitive pool according to preset constraint conditions and generating a building three-dimensional model matching the above target building includes: Construct an energy equation according to the above preset constraint conditions, where the energy equation is used to represent the sum of the data values constrained by each of the above preset constraint conditions; Taking the minimum solution of the above energy equation as the goal, determine the target candidate primitive from the above candidate primitive pool; Generate a building three-dimensional model matching the above target building according to the above target candidate primitive.
[0013] The second aspect of the present application provides a building three-dimensional model construction system, where the building three-dimensional model construction system includes: A data acquisition module for acquiring an initial building point cloud and a building contour polygon corresponding to a target building; A primitive extraction module for extracting primitives according to the above initial building point cloud to obtain the extracted roof plane primitives and the extracted facade part primitives; A point cloud processing module for deleting the point cloud corresponding to the above facade part primitives from the above initial building point cloud to obtain a processed building point cloud; A primitive inference module for performing facade primitive inference according to the above processed building point cloud and the above building contour polygon to obtain the inferred vertical facade primitives corresponding to the above processed building point cloud; A candidate primitive pool generation module for generating a candidate primitive pool according to the intersection relationship corresponding to the above roof plane primitives and the above vertical facade primitives, where each candidate primitive in the above candidate primitive pool is determined according to the sub-patches obtained after cutting based on the above intersection relationship; A three-dimensional model generation module, configured to determine a target candidate primitive from the above-mentioned candidate primitive pool according to preset constraint conditions, and generate a three-dimensional building model that matches the above-mentioned target building according to the above-mentioned target candidate primitive, where the above-mentioned constraint conditions include the fitting degree constraint between the above-mentioned candidate primitive and the above-mentioned initial building point cloud, the fitting constraint of the boundary line of the above-mentioned candidate primitive to the sharp features of the building, and the depth constraint of the above-mentioned candidate primitive to the building.
[0014] The third aspect of the present application provides an intelligent terminal. The above-mentioned intelligent terminal includes a memory, a processor, and a computer program stored on the above-mentioned memory and executable on the above-mentioned processor. When the above-mentioned computer program is executed by the above-mentioned processor, the steps of any one of the above-mentioned building three-dimensional model construction methods are implemented.
[0015] The fourth aspect of the present application provides a computer-readable storage medium. A computer program is stored on the above-mentioned computer-readable storage medium. When the above-mentioned computer program is executed by a processor, the steps of any one of the above-mentioned building three-dimensional model construction methods are implemented.
[0016] As can be seen from the above, in the solution of the present application, an initial building point cloud and a building contour polygon corresponding to a target building are obtained; primitive extraction is performed according to the above-mentioned initial building point cloud to obtain the extracted roof plane primitive and the extracted facade part primitive; the point cloud corresponding to the above-mentioned facade part primitive is deleted from the above-mentioned initial building point cloud to obtain a processed building point cloud; according to the above-mentioned processed building point cloud and the above-mentioned building contour polygon, facade primitive inference is performed to obtain the vertical facade primitive corresponding to the above-mentioned processed building point cloud; according to the intersection relationship between the above-mentioned roof plane primitive and the above-mentioned vertical facade primitive, a candidate primitive pool is generated, where each candidate primitive in the above-mentioned candidate primitive pool is determined according to the sub-patches obtained by cutting based on the above-mentioned intersection relationship; according to preset constraint conditions, a target candidate primitive is determined from the above-mentioned candidate primitive pool, and a three-dimensional building model that matches the above-mentioned target building is generated according to the above-mentioned target candidate primitive, where the above-mentioned constraint conditions include the fitting degree constraint between the above-mentioned candidate primitive and the above-mentioned initial building point cloud, the fitting constraint of the boundary line of the above-mentioned candidate primitive to the sharp features of the building, and the depth constraint of the above-mentioned candidate primitive to the building.
[0017] Compared with the prior art, in the method for constructing a three-dimensional building model provided by the present application, for the acquisition of facade primitives, instead of directly using a planar algorithm to extract from the initial building point cloud, the point cloud corresponding to some of the facade primitives extracted from the initial building point cloud is deleted, and then the facade primitives are inferred in combination with the building contour polygon. Further, for the extracted roof plane primitives and the inferred vertical facade primitives, screening is performed according to preset constraint conditions, so as to better generate the three-dimensional building model. In this way, even in the case of missing point cloud in part of the building facade, the construction of the three-dimensional building model can be better achieved. Therefore, the solution of the present application is conducive to realizing the construction of the three-dimensional building model and improving the success rate of constructing the three-dimensional building model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 is a schematic flowchart of a method for constructing a three-dimensional building model provided by an embodiment of the present application; Figure 2 is a schematic diagram of a roof plane primitive provided by an embodiment of the present application; Figure 3 is a schematic diagram of the inference process of a vertical facade primitive provided by an embodiment of the present application; Figure 4 is a schematic diagram of the construction of a candidate primitive pool provided by an embodiment of the present application; Figure 5 is a schematic diagram of voxel weight assignment provided by an embodiment of the present application; Figure 6 is a schematic flowchart of the specific process of a method for constructing a three-dimensional building model provided by an embodiment of the present application; Figure 7 is a schematic diagram of the component modules of a three-dimensional building model construction system provided by an embodiment of the present application; Figure 8 is a schematic block diagram of the internal structure principle of an intelligent terminal provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] In the following description, specific details such as specific system architectures, technologies, etc. are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0021] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0022] It should also be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0023] It should be further understood that the term "and / or" used in the specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0024] As used in this specification and the appended claims, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to classifying" according to the context. Similarly, the phrase "if determined" or "if classified into [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once classified into [the described condition or event]", or "in response to classifying into [the described condition or event]" according to the context.
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0026] Many specific details are set forth in the following description in order to provide a thorough understanding of the present application, but the present application may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific embodiments disclosed below.
[0027] In the construction of a new type of smart city, the three-dimensional refined model of buildings is a core component, providing key basic information for various applications such as urban management, planning, simulation, security, and emergency response. Existing building reconstruction methods based on point clouds usually assume that a building is a polyhedron model composed of planes. By using a plane extraction algorithm, each plane block is obtained, and then assembled according to the topological relationship between the plane blocks to obtain a complete building model, which can well meet the modeling requirements for buildings with complex geometric structures and unknown types.
[0028] However, the above methods also have some defects. For example, when the elevation part of the building point cloud is missing, the corresponding plane cannot be extracted, which is not conducive to the construction of the building's three-dimensional model and the improvement of the success rate of building three-dimensional model construction. Specifically, when the elevation part of the building point cloud is missing, the corresponding plane cannot be extracted, resulting in the inability to generate a closed Lod2 (Level of Detail 2) building model, that is, a three-dimensional model with the second level of detail. At the same time, the generated Lod2 model will also have problems such as large deformation of the roof height, resulting in the loss of the structural characteristics of the building model and the reduction of geometric accuracy, greatly reducing the subsequent application value of the building model.
[0029] To solve at least one of the above multiple technical problems, in the solution of this application, the initial building point cloud and the building contour polygon corresponding to the target building are obtained; primitive extraction is performed according to the above initial building point cloud to obtain the extracted roof plane primitive and the extracted elevation part primitive; the point cloud corresponding to the above elevation part primitive is deleted from the above initial building point cloud to obtain the processed building point cloud; according to the above processed building point cloud and the above building contour polygon, elevation primitive inference is performed to obtain the vertical elevation primitive corresponding to the above processed building point cloud; according to the intersection relationship between the above roof plane primitive and the above vertical elevation primitive, a candidate primitive pool is generated, where each candidate primitive in the above candidate primitive pool is determined according to the sub-patches obtained by cutting based on the above intersection relationship; according to the preset constraint conditions, the target candidate primitive is determined from the above candidate primitive pool, and a building three-dimensional model matching the above target building is generated according to the above target candidate primitive, where the above constraint conditions include the fitting degree constraint between the candidate primitive and the above initial building point cloud, the fitting constraint of the boundary line of the candidate primitive to the sharp features of the building, and the depth constraint of the candidate primitive to the building.
[0030] Compared with the prior art, in the method for constructing a three-dimensional building model provided by this application, for the acquisition of elevation primitives, it is not directly obtained by using a planar algorithm to extract the initial building point cloud. Instead, after deleting the point cloud corresponding to the elevation partial primitives extracted from the initial building point cloud, the elevation primitives are inferred in combination with the building contour polygon. Further, for the extracted roof plane primitives and the inferred vertical elevation primitives, they are screened according to preset constraint conditions, and then a three-dimensional building model is better generated. In this way, even in the case of missing point cloud in the elevation part of the building, the construction of the three-dimensional building model can be better realized. Therefore, the solution of this application is beneficial to realizing the construction of the three-dimensional building model and improving the success rate of constructing the three-dimensional building model.
[0031] As Figure 1 shown, an embodiment of this application provides a method for constructing a three-dimensional building model. Specifically, the above method includes the following steps: Step S100, obtaining the initial building point cloud and the building contour polygon corresponding to the target building; Step S200, performing primitive extraction according to the above initial building point cloud to obtain the extracted roof plane primitives and the extracted elevation partial primitives; Step S300, deleting the point cloud corresponding to the elevation partial primitives from the above initial building point cloud to obtain the processed building point cloud; Step S400, performing elevation primitive inference according to the above processed building point cloud and the above building contour polygon to obtain the vertical elevation primitives corresponding to the above processed building point cloud; Step S500, generating a candidate primitive pool according to the intersection relationship between the above roof plane primitives and the above vertical elevation primitives, where each candidate primitive in the above candidate primitive pool is determined according to the sub-patches obtained by cutting based on the above intersection relationship; Step S600, determining the target candidate primitive from the above candidate primitive pool according to the preset constraint conditions, and generating a three-dimensional building model matching the above target building according to the above target candidate primitive, where the above constraint conditions include the fitting degree constraint between the candidate primitive and the above initial building point cloud, the fitting degree constraint of the boundary line of the candidate primitive to the sharp features of the building, and the depth constraint of the candidate primitive to the building.
[0032] Among them, the above target building is the building for which a three-dimensional building model needs to be constructed, and the generated three-dimensional building model matches the target building and can represent the three-dimensional features of the target building.
[0033] Specifically, the input data to be obtained in this application includes: point cloud of a single building (i.e., the initial building point cloud corresponding to the target building) and a building contour polygon. Through four steps of roof plane primitive extraction, vertical facade primitive inference, candidate primitive pool construction, and voxel-constrained candidate primitive pool optimization for the building point cloud, a building Lod2 model is generated. It should be noted that in the embodiments of this application, the construction of the three-dimensional building model is taken as an example of the Lod2 model for specific illustration, but it is not a specific limitation.
[0034] In the embodiments of this application, plane primitives are detected from the point cloud of a single building. Specifically, the above-mentioned primitive extraction is performed according to the above-mentioned initial building point cloud to obtain the extracted roof plane primitives and the extracted facade part primitives, including: Calculating the local normal vector curvature of each initial point in the above-mentioned initial building point cloud; Determining initial seed points from the above-mentioned initial points according to a preset curvature threshold, marking the corresponding classification for the above-mentioned initial seed points, and adding the above-mentioned initial seed points to the current region; Updating the above-mentioned current region through a region growing algorithm according to the above-mentioned seed points and the above-mentioned initial points until all points are processed, stopping the region growth, and obtaining the target region after region growth, where the above-mentioned target region includes multiple point clusters of different classifications; Determining the above-mentioned facade part primitives according to the normal vector components of the planes corresponding to the above-mentioned point clusters; Determining the above-mentioned roof plane primitives according to the remaining point clusters, where the above-mentioned remaining point clusters are other point clusters except the point clusters corresponding to the above-mentioned facade part primitives.
[0035] Specifically, the local normal vector curvature of each initial point in the initial building point cloud is calculated by principal component analysis (PCA, Principle Component Analysis). Then, all points are sorted in ascending order of curvature, and the unclassified points with curvature values less than the preset curvature threshold ( ) are selected as the initial seed points for region growth. The above-mentioned curvature threshold can be set and adjusted according to actual needs and is not specifically limited here.
[0036] Adding the initial seed points to the current region, marking them as classified, finding the neighborhood points of the seed points (by k-nearest neighbor), and traversing these points in ascending order of distance, screening the candidate points that meet the following conditions: normal vector angle constraint, the angle between the normal vector of the candidate point and the average normal vector of the current region ; plane distance constraint, the distance from the candidate point to the current fitted plane Add the candidate points that meet the conditions to the queue as the seed points for the next round of expansion and add them to the current region, that is, update the set of seed points corresponding to the current region. Among them, the above current region is an empty set in the initial state, which is used to store the points that meet the conditions when the seed points grow outward; the seed point is the first data, and the point data gradually increases during the growth process. K-nearest neighbor refers to the K-Nearest Neighbor (KNN) algorithm. Query the k nearest points around the seed point according to the distance, and traverse them in order of distance. The specific value of k can be adjusted according to actual needs. It should be further noted that and are preset thresholds, and their values can also be set and adjusted according to actual needs, and are not specifically limited here.
[0037] For each newly added point, re-fit the plane equation by the least squares method to update the fitted plane to ensure that the constraint conditions are dynamically corrected as the region expands. At the same time, calculate the average normal vector of the region by combining the original points and the newly added points in the set to avoid the influence of the initial seed deviation on the expansion direction.
[0038] Iterate the above steps until no new points can be added, then regard the marked points as a classification and perform the next round of region growth. When all points have been processed, stop the region growth. Specifically, start growing from the initially selected seed points to the surrounding. When the surrounding points do not meet the above two constraint conditions, the growth ends. Regard the points in the region as a category and perform the next round of region growth. Iterate multiple times until all points have categories.
[0039] After the region growth algorithm, each point cluster corresponds to a plane. For a plane with the z component of the normal vector less than 0.1 (the specific value can be set and adjusted according to actual needs), it is considered a vertical structure facade and is deleted.
[0040] Specifically, determining the above roof plane primitive according to the remaining point clusters includes: Traverse all the planes corresponding to the above remaining point clusters, and determine the coplanar planes according to the included angle between the normal vectors of the above planes and the overlap degree between the corresponding remaining point clusters; Merge the remaining point clusters corresponding to the above coplanar planes, and update the fitted plane according to the merged remaining point clusters; Regard the fitted plane corresponding to the merged remaining point clusters as the above roof plane primitive.
[0041] To improve the geometric rationality and consistency of the segmentation result, traverse all the planes and merge the point clusters of the coplanar planes. If the included angle between the normal vectors of two planes (The specific values can be set and adjusted according to actual requirements), and if the overlap degree between point clusters meets a certain threshold (the specific value can be set and adjusted according to actual requirements), then the two point clusters are merged, and the fitting plane is updated through the least squares algorithm. Figure 2 is a schematic diagram of a roof plane primitive provided by an embodiment of the present application. Taking the plane corresponding to each point cluster after merging as the roof plane primitive, Figure 2 the shown roof plane primitive is obtained, which is used to prepare for the construction of the subsequent candidate primitive pool.
[0042] Further, based on the processed building point cloud and the building contour polygon, vertical primitive inference is performed to obtain the vertical facade primitive corresponding to the processed building point cloud, including: Construct a triangular mesh based on the processed building point cloud, where each triangular patch in the triangular mesh is associated with the original three-dimensional vertices in the processed building point cloud; Obtain the size of the bounding box of the processed building point cloud in the horizontal plane, and calculate the grid resolution according to the bounding box size and a preset point cloud density parameter; Obtain the actual coordinates corresponding to each grid point, and determine whether each grid point belongs to the interior of the building contour polygon; For the interior grid points belonging to the interior of the building contour polygon, determine the triangular patches in the triangular mesh corresponding to the interior grid points, construct a three-dimensional plane equation according to the vertices of the triangular patches, calculate the height value of the intersection point according to the target ray and the three-dimensional plane equation, use the height value as the pixel value corresponding to the interior grid point, and obtain a height map based on the pixel values corresponding to all the interior grid points, where the target ray is a ray passing through the interior grid point and along the vertical direction; Based on the height map, perform vertical primitive inference to obtain the vertical facade primitive corresponding to the processed building point cloud.
[0043] Among them, the vertical primitive inference based on the height map to obtain the vertical facade primitive corresponding to the processed building point cloud includes: Perform linear mapping on the pixel values in the height map according to a preset numerical range; Construct a morphological operation kernel, and perform a closing operation on the height map according to the morphological operation kernel; Determine a high threshold and a low threshold according to the building height range, and perform edge detection on the height map according to the high threshold and the low threshold to generate a binary edge map; According to the above binary edge map, a set of broken lines corresponding to the elevation contour broken lines is extracted. The set of broken lines is subjected to line segment clustering, and a representative line segment corresponding to each cluster in the clustering result is determined. Obtain the main direction of the building. Adjust the direction of the above representative line segments according to the main direction of the building, and project the adjusted representative line segments in the vertical direction. The obtained vertical plane is used as the above vertical elevation primitive.
[0044] Specifically, in this application, for the processed building point cloud obtained after removing the point cloud corresponding to the elevation part of the primitive after plane primitive extraction, an irregular triangular network (TIN) is established by using the Delaunay triangulation technology. Then, the TIN model is rasterized at a specified resolution to generate a height map. After that, the morphological algorithm is used to alleviate the hole problem caused by uneven point cloud distribution, and then the Canny operator is used to extract a set of discrete pixel point contours from the height map as the initial estimate of the vertical elevation. Finally, a set of optimal broken lines is extracted from the contour by the optimal transport method, and the plane obtained by projecting it in the z-axis direction is used as the elevation primitive. Here, the z-axis direction (or vertical direction) in this application refers to the z-axis direction corresponding to the initial building point cloud data, and other coordinate axis directions also refer to the coordinate axis directions corresponding to the initial building point cloud data. The horizontal direction refers to the x-axis direction corresponding to the initial building point cloud data.
[0045] Specifically, the processed building point cloud is subjected to two-dimensional Delaunay triangulation to construct an irregular triangular network, where each triangular patch is associated with the original three-dimensional vertices to prepare for subsequent height estimation.
[0046] Calculate the size of the bounding box of the building point cloud in the XOY plane, and calculate the grid resolution according to the preset point cloud density parameter (the specific value can be set and adjusted according to actual needs) as the resolution of the subsequent height map.
[0047] For each grid point, calculate its actual coordinates, that is, the corresponding (x, y) coordinates in the point cloud coordinate system, and use the ray method to judge whether the point is inside the building contour polygon. If it is inside, locate the triangular patch where the current pixel point is located in the Delaunay triangular network, use the vertices of the triangular patch to construct a three-dimensional plane equation, and then emit a ray along the vertical direction (z-axis) to calculate the intersection height with the plane, and record this height as the value of the grid. By traversing all grid points, the corresponding height map is obtained.
[0048] Traverse all valid pixels, record the minimum and maximum height values, and linearly map the height values to 0-255 to enhance the visual distinguishability of the image.
[0049] Dynamically calculate the size of the morphological operation kernel according to the image size, with the minimum being 3, perform a closing operation to fill the holes caused by sparse point clouds and smooth the edges; specifically, create a morphological operation kernel and perform a closing operation of dilation followed by erosion on the height map. Calculate the double thresholds, a high threshold and a low threshold, according to the building height range. Points above the high threshold are strong edges, points above the low threshold are potential candidate edge points that need to be further verified for connection to strong edges, and points below the low threshold are non-edges. Then apply the Canny operator for edge detection to generate a binary edge map; among them, the above double thresholds are parameters of the Canny operator and are adaptively calculated based on the point cloud height.
[0050] Furthermore, extract the contour polyline from the binary edge map through an optimal transport method. First, perform a 2D Delaunay triangulation on the discrete contour points in the binary edge map to generate an initial triangular mesh. Among them, the optimal transport method is a mathematical framework used to efficiently transform one probability distribution (or geometric structure) into another while minimizing a certain transport cost (such as distance, energy, etc.). In the embodiments of the present application, the role of the optimal transport method can be understood as: transforming the discrete set of edge pixel points into a continuous contour polyline while maintaining the optimality of the geometric shape. It should be noted that in the embodiments of the present application, the calculation is performed in a way that minimizes the distance.
[0051] Extract the elevation contour polyline map through an optimal transport method. First, convert the grid points in the binary map into vector points and perform a 2D Delaunay triangulation to construct an initial polyline map. Then, reduce the number of edges through edge collapse, which is controlled by two constraints: a. The maximum Hausdorff distance from the original points to the simplified edge set is within a certain threshold; b. The maximum incremental transport cost allowed for each fold is within a certain threshold. By iteratively folding the edges, the final set of polylines is obtained.
[0052] Perform line segment clustering on the set of polylines, which is implemented through a density-based clustering algorithm (DBSCAN, Density-Based Spatial Clustering of Applications with Noise). Then, calculate the weighted average direction of the line segments within each cluster in the clustering result. After that, generate the bounding box of the point set within the cluster, and use the line segment passing through the center of the bounding box along the average direction as the representative line segment.
[0053] Analyze the building ground contour polygon and extract the main direction of the building. Adjust the representative line segments generated by each cluster to be consistent with the main direction of the building while keeping the midpoints of the line segments unchanged.
[0054] Project the obtained line segments in the z-axis direction of the original point cloud, and the resulting vertical plane is the inferred vertical facade primitive.
[0055] Figure 3 This is a schematic diagram of the inference process of a vertical facade primitive provided by an embodiment of the present application. As Figure 3 shown, based on the above steps, the inference of the vertical facade primitive is realized.
[0056] Specifically, according to the intersection relationship between the above roof plane primitive and the above vertical facade primitive, a candidate primitive pool is generated, including: Construct an initial set according to the above roof plane primitive and the above vertical facade primitive, traverse each primitive in the above initial set, determine all other primitives that intersect with the above primitive, and construct an initial intersecting primitive set; For each primitive in the above initial set, select a cutting plane from the initial intersecting primitive set corresponding to the above primitive, cut the above primitive, if there is an intersection relationship between the sub-primitives generated after cutting and the remaining primitives in the above initial intersecting primitive set, then return to continue to execute the above step of selecting a cutting plane from the initial intersecting primitive set corresponding to the above primitive and cutting the above primitive until the preset cutting termination condition is met, where, for each cutting plane, mutual cutting between surfaces is performed during cutting; Merge all the sub-patches generated by cutting to obtain the above candidate primitive pool.
[0057] Figure 4 This is a schematic diagram of constructing a candidate primitive pool provided by an embodiment of the present application. Specifically, referring to Figure 4 , in the embodiment of the present application, a candidate primitive pool is constructed by pairwise intersecting the plane primitive and the building facade primitive.
[0058] Specifically, place the roof plane primitive and the facade primitive in a set (i.e., the initial set), traverse each primitive, and dynamically detect all other primitives that intersect with it to form an initial intersecting primitive set (i.e., the initial intersecting primitive set).
[0059] Traverse each primitive, sequentially select a cutting plane from the corresponding initial intersecting primitive set in the order of area, cut it, and re-determine the intersection relationship between the sub-primitives generated after each cut and the remaining primitives in the intersecting primitive set. If there is an intersection, continue to execute the cut, and iterate until the initial intersecting primitive set is empty. It should be noted that the order of area is used to ensure that each one can be traversed. In the actual application process, other orders can also be used, for example, number each primitive and then traverse according to the number order. After selecting the cutting plane, split the primitive along the intersection line with the cutting plane into two small sub-primitives.
[0060] For each cutting plane, perform mutual cutting between surfaces to ensure that the cutting plane and the cut surface are consistent in geometric form.
[0061] Merge all the sub - patches generated by cutting to form a candidate primitive pool, and assign a unique identifier and a random color code to each primitive to facilitate subsequent calls and displays of each primitive.
[0062] Specifically, determining the target candidate primitives from the above - mentioned candidate primitive pool according to the preset constraint conditions, and generating a three - dimensional building model matching the above - mentioned target building based on the above - mentioned target candidate primitives includes: Construct an energy equation according to the above - mentioned preset constraint conditions, where the energy equation is used to represent the sum of the data values constrained by each of the above - mentioned preset constraint conditions; Taking the minimum solution of the above - mentioned energy equation as the goal, determine the target candidate primitives from the above - mentioned candidate primitive pool; Generate a three - dimensional building model matching the above - mentioned target building based on the above - mentioned target candidate primitives.
[0063] In order to select the optimal primitive cluster from the candidate primitive pool to form a highly - faithful lod2 building model with the original building structure, an energy equation is constructed in this application, comprehensively considering the fitting degree of the candidate primitive with the original point cloud (i.e., the initial building point cloud) , the fitting of the candidate primitive boundary line to the sharp features of the original building , and the depth constraint of the candidate primitive on the original building These three aspects of factors. Specifically, an energy equation is as shown in the following formula (1): ; Among them, represents the value of the energy equation. In the embodiments of this application, the solution with the minimum value of the energy equation is used as the goal for optimization to determine the target candidate primitives.
[0064] Regarding the fitting degree of the candidate primitive with the point cloud, in this application, according to the weighted sum of the point cloud confidence degrees included within a certain buffer range of each candidate primitive, a fitting degree energy term is defined . Traverse the points within a certain range of the candidate primitive, construct a covariance matrix according to different neighborhood ranges, and define the confidence degree of the point as : ; ; ; Among them, is the Euclidean distance from point p to the candidate primitive, is the dynamic distance threshold, is the eigenvalue of the covariance matrix of the neighborhood of point p at the i - th scale. represents the total number of point clouds, represents the total number of candidate primitives; A representative indicator function is used to characterize whether the corresponding candidate primitive (i.e., the i-th candidate primitive) is selected. If the candidate primitive is selected = 1, otherwise = 0; represents the candidate primitive, and represents the i-th candidate primitive.
[0065] Regarding the fitting degree of the candidate primitive boundary line to the sharp features of the original building, this application quantifies the model complexity through the sharp edge ratio If two candidate primitives intersect and there is a certain included angle, it is a sharp edge. The more complex the model, the more sharp edges there are: ; Among them, is the total number of boundaries in the candidate primitive set, is the indicator function, indicating that the two candidate primitives connected by the boundary form a sharp feature, and 0 indicates that the two candidate primitives are coplanar.
[0066] Regarding the depth constraint of the candidate primitive on the original building , this application constructs a voxelized model based on the original point cloud data to constrain each candidate primitive in terms of depth. First, according to the generated height map, it is extended in the Z-axis direction to obtain a voxelized bounding box (Box). Then, according to the building ground contour polygon, the effective voxel columns are judged as shown in the following formula (7), that is, the voxel columns within the polygon range. The voxel weights of the invalid voxel columns are assigned 0. For the effective voxel columns, the peak voxel of each column is calculated according to the height map value as shown in the following formula (8) Figure 5 is a schematic diagram of voxel weight assignment provided by an embodiment of this application. As Figure 5 shown, the peak voxel weight of each column is assigned 1, and taking the peak voxel as the boundary, the voxel weights decrease linearly upward and downward to 0 as shown in the following formula (9). Traverse each voxel column to obtain a weighted voxelized model. For each candidate primitive, detect the voxel columns covered by its projection onto the XOY plane, and then extract the first non-empty voxel with weight below the candidate primitive in each voxel column, and normalize the sum of these voxel weights as the energy term of the candidate primitive: ; ; ; ; ; ; ; Among them, represents the number of voxels in the x-axis direction, represents the number of voxels in the y-axis direction, represents the number of voxels in the z-axis direction; represents the maximum coordinate value in the x-axis direction of the bounding box where the point cloud is located, represents the minimum coordinate value in the x-axis direction of the bounding box where the point cloud is located, represents the maximum coordinate value in the y-axis direction of the bounding box where the point cloud is located, represents the minimum coordinate value in the y-axis direction of the bounding box where the point cloud is located, represents the maximum coordinate value in the z-axis direction of the bounding box where the point cloud is located, represents the minimum coordinate value in the z-axis direction of the bounding box where the point cloud is located, represents the resolution of the voxels in the xoy plane. is used to indicate whether the voxel column is a valid voxel column, represents the range of the building heat map. represents the z-height value corresponding to the height image pixel, represents the resolution of the voxels in the z-axis direction. represents the weight value of the voxels, represents the voxels on the surface layer below the candidate primitive, represents the voxel closest to the candidate primitive in a certain voxel column below the candidate primitive, represents the voxel set in a certain voxel column below the candidate primitive, represents the candidate primitive, represents the weight of the candidate primitive, represents the number of voxel columns covered by the candidate primitive, represents the weight value of the voxels on the surface layer below the candidate primitive, represents the total number of candidate primitives, represents the indicator function (if the candidate primitive is selected = 1, otherwise = 0).
[0067] Furthermore, by obtaining the minimum energy solution of the binary integer programming calculation formula (1), the corresponding target candidate primitive is obtained, and a high-fidelity building lod2 model with retained height structure features is further constructed.
[0068] In the method for constructing a three-dimensional building model provided by this application, for the acquisition of elevation primitives, it is not directly obtained by using a planar algorithm to extract the initial building point cloud. Instead, after deleting the point cloud corresponding to the partial elevation primitives extracted from the initial building point cloud, the elevation primitives are inferred in combination with the building contour polygon. Further, for the roof plane primitives obtained by extraction and the vertical elevation primitives obtained by inference, they are screened according to preset constraint conditions, and then a three-dimensional building model is better generated. In this way, even in the case of missing point cloud in the building elevation part, the construction of the three-dimensional building model can be better realized. Therefore, the solution of this application is beneficial to realizing the construction of the three-dimensional building model and improving the success rate of constructing the three-dimensional building model.
[0069] Figure 6 is a schematic flow chart of a method for constructing a three-dimensional building model provided by an embodiment of this application. As Figure 6 shown, this application first extracts the plane primitives of the roof part from the building point cloud through a region growing algorithm, and discards the primitives and corresponding point cloud extracted from the elevation part. Discarding means removing the vertical plane primitives and point cloud extracted by the region growing algorithm, and using the elevation primitives extracted by subsequent elevation primitive inference as a substitute. By extracting the component of the normal vector of the plane primitive on the z-axis, if it is less than a certain threshold, it is discarded.
[0070] On this basis, a triangular mesh is constructed for the point cloud of the roof part to generate a height map, and a set of broken lines is extracted from the height map as elevation primitives. Then, the obtained plane primitives and elevation primitives are pairwise intersected to obtain a candidate plane primitive pool. By constructing a voxelized model for the original building point cloud, the selection of candidate primitives is constrained from the depth. Finally, considering the geometric accuracy of the original building point cloud, the building regularity and combining the voxel depth constraint to construct an energy equation, a set of optimal subsets is selected from the candidate plane primitive pool to generate a high-fidelity lod2 building model.
[0071] In view of the problems of loss of reconstructed building structural features and reduction of geometric accuracy in the existing lod2 model reconstruction method under the conditions of limited point cloud data quality and high building complexity, a height map is constructed from the point cloud, and the facade of the building is inferred from the height map. At the same time, in the energy equation generated by the construction model, by constructing a voxel model of the original building point cloud, the building is constrained from the depth level, so that the optimized candidate primitive subset is consistent with the height of the original building point cloud at the height level, and some obvious prominent structural features of the building are better protected. Among them, when inferring the facade primitives in the facade missing point cloud, a height map is constructed from the point cloud, and the Canny operator is used to infer the facade primitives of the missing part of the building. A depth constraint based on the voxel model is constructed. By constructing a voxel model, a depth constraint is realized during the optimization process of the candidate primitive pool, ensuring that the selected candidate primitives are highly consistent with the original building in depth and ensuring that some detailed structural features of the building can be retained.
[0072] As Figure 7 shown in, corresponding to the above-mentioned building three-dimensional model construction method, an embodiment of the present application also provides a building three-dimensional model construction system, and the above-mentioned building three-dimensional model construction system includes: A data acquisition module 710, configured to acquire an initial building point cloud and a building contour polygon corresponding to a target building; A primitive extraction module 720, configured to extract primitives according to the above-mentioned initial building point cloud, and obtain the extracted roof plane primitives and the extracted facade part primitives; A point cloud processing module 730, configured to delete the point cloud corresponding to the above-mentioned facade part primitives from the above-mentioned initial building point cloud to obtain a processed building point cloud; A primitive inference module 740, configured to perform facade primitive inference according to the above-mentioned processed building point cloud and the above-mentioned building contour polygon, and obtain the vertical facade primitives corresponding to the above-mentioned processed building point cloud; A candidate primitive pool generation module 750, configured to generate a candidate primitive pool according to the intersection relationship between the above-mentioned roof plane primitives and the above-mentioned vertical facade primitives, wherein each candidate primitive in the above-mentioned candidate primitive pool is determined according to the sub-patches obtained by cutting based on the above-mentioned intersection relationship; A three-dimensional model generation module 760, configured to determine target candidate primitives from the above-mentioned candidate primitive pool according to preset constraint conditions, and generate a building three-dimensional model matching the above-mentioned target building according to the above-mentioned target candidate primitives, wherein the above-mentioned constraint conditions include the fitting degree constraint between the above-mentioned candidate primitives and the above-mentioned initial building point cloud, the fitting constraint of the boundary line of the above-mentioned candidate primitives to the sharp features of the building, and the depth constraint of the above-mentioned candidate primitives to the building.
[0073] Thus, for the acquisition of elevation primitives, instead of directly extracting the initial building point cloud using a planar algorithm, the point cloud corresponding to the elevation part primitives extracted from the initial building point cloud is deleted, and then the elevation primitives are inferred in combination with the building contour polygon. Further, for the extracted roof plane primitives and the inferred vertical elevation primitives, screening is performed according to preset constraint conditions, so as to better generate the 3D building model. Thus, even in the case of missing point cloud in the building elevation part, the construction of the 3D building model can be better realized. Therefore, the solution of this application is conducive to realizing the construction of the 3D building model and improving the success rate of the construction of the 3D building model.
[0074] It should be noted that the specific structures and implementation manners of the above 3D building model construction system and its various modules or units can refer to the corresponding descriptions in the above method embodiments, and will not be elaborated here.
[0075] It should be noted that the division methods of the various modules of the above 3D building model construction system are not unique, and are not specifically limited here either.
[0076] Based on the above embodiments, this application also provides an intelligent terminal, and its principle block diagram can be as Figure 8 shown. The above intelligent terminal includes a processor, a memory, a network interface, and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements the steps of any of the above 3D building model construction methods. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
[0077] Those skilled in the art can understand that Figure 8 the principle block diagram shown in
[0078] merely shows the block diagram of some structures related to the solution of this application, and does not constitute a limitation on the intelligent terminal to which the solution of this application is applied. The specific intelligent terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0079] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the building three-dimensional model construction methods provided by the embodiments of the present application are implemented.
[0080] It should be understood that the sequence numbers of the above steps do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0081] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the above device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit. In addition, the specific names of each functional unit and module are only for the convenience of mutual distinction and do not limit the protection scope of the present application. The specific working process of the units and modules in the above device can refer to the corresponding process in the foregoing method embodiment and will not be elaborated herein.
[0082] In the above embodiments, the descriptions of the respective embodiments have their own emphases. For the parts not detailed or recorded in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0083] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0084] In the embodiments provided by the present application, it should be understood that the disclosed system / terminal device and method can be implemented in other ways. For example, the system / terminal device embodiments described above are only illustrative. For example, the above division of modules or units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0085] If the above integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, to implement all or part of the processes in the above-described embodiment methods of the present application, it can also be completed by a computer program instructing relevant hardware. The above computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the above computer program includes computer program code, and the above computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The above computer-readable medium can include: any entity or device capable of carrying the above computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, and software distribution medium, etc. It should be noted that the content included in the above computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0086] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for constructing a three-dimensional model of a building, characterized in that, The method includes: Obtaining an initial building point cloud and a building contour polygon corresponding to a target building; Performing primitive extraction based on the initial building point cloud to obtain an extracted roof plane primitive and an extracted facade part primitive; Deleting the point cloud corresponding to the facade part primitive from the initial building point cloud to obtain a processed building point cloud; Performing facade primitive inference based on the processed building point cloud and the building contour polygon to obtain a vertical facade primitive corresponding to the processed building point cloud; Generating a candidate primitive pool according to the intersection relationship between the roof plane primitive and the vertical facade primitive, wherein each candidate primitive in the candidate primitive pool is determined according to a sub-plane obtained by cutting based on the intersection relationship; Determining a target candidate primitive from the candidate primitive pool according to a preset constraint condition, and generating a three-dimensional building model matching the target building according to the target candidate primitive, wherein the constraint condition includes a fitting degree constraint between the candidate primitive and the initial building point cloud, a fitting constraint of the boundary line of the candidate primitive to the sharp feature of the building, and a depth constraint of the candidate primitive to the building.
2. The method for constructing a three-dimensional model of a building according to claim 1, wherein The performing primitive extraction based on the initial building point cloud to obtain an extracted roof plane primitive and an extracted facade part primitive includes: Calculating the local normal vector curvature of each initial point in the initial building point cloud; Determining initial seed points from the initial points according to a preset curvature threshold, marking corresponding classifications for the initial seed points, and adding the initial seed points to the current region; Updating the current region by a region growing algorithm according to the seed points and the initial points until all points are processed, stopping the region growth, and obtaining a target region after region growth, wherein the target region includes multiple point clusters with different classifications; Determining the facade part primitive according to the normal vector components of the plane corresponding to the point cluster; Determining the roof plane primitive according to the remaining point clusters, where the remaining point clusters are other point clusters except the point clusters corresponding to the facade part primitive.
3. The method for constructing a three-dimensional model of a building according to claim 2, wherein The determining the roof plane primitive according to the remaining point clusters includes: Traversing all planes corresponding to the remaining point clusters, and determining coplanar planes according to the included angle between the normal vectors of the planes and the overlap degree between the corresponding remaining point clusters; Merging the remaining point clusters corresponding to the coplanar planes, and updating the fitting plane according to the merged remaining point clusters; Taking the fitting plane corresponding to the merged remaining point clusters as the roof plane primitive.
4. The method for constructing a three-dimensional model of a building according to claim 1, wherein The performing facade primitive inference based on the processed building point cloud and the building contour polygon to obtain a vertical facade primitive corresponding to the processed building point cloud includes: Constructing a triangular mesh according to the processed building point cloud, wherein each triangular patch in the triangular mesh is associated with the original three-dimensional vertices in the processed building point cloud; Obtain the size of the bounding box of the processed building point cloud on the horizontal plane, and calculate the grid resolution according to the size of the bounding box and the preset point cloud density parameter; Obtain the actual coordinates corresponding to each grid point, and determine whether each of the grid points belongs to the interior of the building contour polygon; For the interior grid points that belong to the interior of the building contour polygon, determine the triangular patches in the triangular mesh corresponding to the interior grid points, construct a three-dimensional plane equation according to the vertices of the triangular patches, calculate the height value of the intersection point according to the target ray and the three-dimensional plane equation, and use the height value as the pixel value corresponding to the interior grid point, and obtain a height map based on the pixel values corresponding to all the interior grid points, where the target ray is a ray passing through the interior grid point and along the vertical direction; According to the height map, perform elevation primitive inference to obtain the inferred vertical elevation primitives corresponding to the processed building point cloud.
5. The method for constructing a three-dimensional model of a building according to claim 4, characterized in that, The performing elevation primitive inference according to the height map to obtain the inferred vertical elevation primitives corresponding to the processed building point cloud includes: Perform linear mapping on the pixel values in the height map according to a preset numerical range; Construct a morphological operation kernel, and perform a closing operation on the height map according to the morphological operation kernel; Determine a high threshold and a low threshold according to the building height range, and perform edge detection on the height map according to the high threshold and the low threshold to generate a binary edge map; According to the binary edge map, extract a set of polyline segments corresponding to the elevation contour polyline, perform line segment clustering on the set of polyline segments, and determine the representative line segment corresponding to each cluster in the clustering result; Obtain the main direction of the building, adjust the direction of the representative line segment according to the main direction of the building, and project the adjusted representative line segment in the vertical direction, and use the obtained vertical plane as the vertical elevation primitive.
6. The method for constructing a three-dimensional model of a building according to claim 1, characterized in that, The generating a candidate primitive pool according to the intersection relationship between the roof plane primitive and the vertical elevation primitive includes: Construct an initial set according to the roof plane primitive and the vertical elevation primitive, traverse each primitive in the initial set, determine all other primitives that intersect with the primitive, and construct an initial intersecting primitive set; For each primitive in the initial set, select a cutting plane from the initial intersecting primitive set corresponding to the primitive, and cut the primitive. If there is an intersection relationship between the sub-primitives generated after cutting and the remaining primitives in the initial intersecting primitive set, then return to continue to execute the step of selecting a cutting plane from the initial intersecting primitive set corresponding to the primitive and cutting the primitive until a preset cutting termination condition is met, where for each cutting plane, mutual cutting between planes is performed during cutting; Merge all the sub-patches generated by cutting to obtain the candidate primitive pool.
7. The method for constructing a three-dimensional model of a building according to any one of claims 1 to 6, characterized in that, The determining a target candidate primitive from the candidate primitive pool according to a preset constraint condition, and generating a three-dimensional building model matching the target building according to the target candidate primitive includes: Construct an energy equation according to the preset constraint conditions, where the energy equation is used to represent the sum of the data values constrained by each of the preset constraint conditions; Taking the minimum solution of the energy equation as the goal, determine the target candidate primitive from the candidate primitive pool; Generate a three-dimensional building model that matches the target building according to the target candidate primitive.
8. A three-dimensional model construction system for a building, characterized in that, The system includes: A data acquisition module, configured to acquire an initial building point cloud and a building contour polygon corresponding to a target building; A primitive extraction module, configured to extract primitives according to the initial building point cloud, and obtain the extracted roof plane primitives and the extracted facade part primitives; A point cloud processing module, configured to delete the point cloud corresponding to the facade part primitive from the initial building point cloud to obtain a processed building point cloud; A primitive inference module, configured to perform facade primitive inference according to the processed building point cloud and the building contour polygon, and obtain the vertical facade primitives corresponding to the processed building point cloud obtained by inference; A candidate primitive pool generation module, configured to generate a candidate primitive pool according to the intersection relationship between the roof plane primitive and the vertical facade primitive, where each candidate primitive in the candidate primitive pool is determined according to the sub-patches obtained by cutting based on the intersection relationship; A three-dimensional model generation module, configured to determine a target candidate primitive from the candidate primitive pool according to preset constraint conditions, and generate a three-dimensional building model that matches the target building according to the target candidate primitive, where the constraint conditions include the fitting degree constraint between the candidate primitive and the initial building point cloud, the fitting constraint of the boundary line of the candidate primitive to the sharp features of the building, and the depth constraint of the candidate primitive to the building.
9. An intelligent terminal, characterized in that, The intelligent terminal includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the building three-dimensional model construction method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the building three-dimensional model construction method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Building point cloud segmentation and vector contour line extraction method and device
CN116485821A
Enhanced three-dimensional point cloud rendering
US20180247447A1
Cited By
Building facade layout completion method and device, terminal and storage medium
CN120544050A
Building facade layout completion methods, devices, terminals and storage media
CN120544050B