Method for automatically carrying out building spatialization measurement based on point cloud data
By employing voxel partitioning and 2D projection mesh reconstruction methods, the problem of geometric inference errors in complex structures in point cloud data was solved, generating high-fidelity 3D building models and achieving automated and efficient urban 3D modeling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-03
AI Technical Summary
Existing point cloud-based automated modeling methods are prone to geometric inference errors when dealing with buildings with complex structures such as dormer windows and domes. This leads to geometric distortion of the 3D model, which fails to faithfully reflect the true form of the building. Furthermore, these methods require a large amount of manual post-processing work, which restricts the large-scale, high-efficiency production of urban 3D models.
The system generates feature point clouds of buildings by voxel division, identifies point cloud subsets of roof, facade walls and facade attachments, and uses two-dimensional projection and mesh reconstruction methods to generate roof surface and wall surface models. It also measures attachments and automatically generates a three-dimensional measurement model of the building.
It significantly improves the geometric fidelity of the model, enables automated and high-precision measurement of complex structures, reduces the need for manual post-processing, and provides reliable support for large-scale urban 3D modeling.
Smart Images

Figure CN121788752A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D modeling technology, and in particular to a method for automatically performing spatial measurements of buildings based on point cloud data. Background Technology
[0002] Building spatial measurement refers to the process of comprehensively utilizing technologies such as remote sensing, photogrammetry, and 3D laser scanning to acquire multi-source data such as point clouds and images of buildings, and then accurately extracting spatial information such as the three-dimensional geometric dimensions, structural features, surface area, and volume of buildings through automated or semi-automated data processing and model reconstruction methods. It aims to provide accurate underlying data support for fields such as urban planning, real estate management, and building information systems.
[0003] Existing automated modeling methods based on point clouds work by simplifying, segmenting, and fitting geometric primitives to massive, discrete point cloud data using algorithms. First, algorithms such as region growing and random sampling consistency are used to identify and extract geometric primitives such as planes and cylinders representing different building components from the point cloud. Then, based on the spatial relationships between these primitives, regular constraints and combinations are applied to finally construct a structured 3D model composed of parametric surfaces, thereby achieving a digital expression of the geometric form of buildings.
[0004] However, existing methods face significant drawbacks in practical applications. When dealing with roofs featuring complex structures like dormer windows and domes, and facades with numerous attachments such as balconies and air conditioning units, coupled with the inherent occlusion, noise, and density unevenness of point cloud data, the geometric inference steps in automated processes are highly prone to errors. For example, attachment point clouds might be incorrectly merged into the main wall surface, or complex roof structures might be oversimplified into a single tilted plane, resulting in severely distorted 3D models that fail to faithfully reflect the building's true form. To obtain usable models, extensive and tedious manual post-processing is required to correct and adjust each model individually, severely hindering the realization of large-scale, high-efficiency urban 3D modeling. Therefore, there is an urgent need to provide a method for automatically spatializing buildings based on point cloud data to address these issues. Summary of the Invention
[0005] The technical problem this invention aims to solve is to overcome the shortcomings of existing technologies in handling complex structures such as roofs with dormer windows and domes, and facades with numerous attachments such as balconies and air conditioning units. Furthermore, the inherent problems of occlusion, noise, and uneven density in point cloud data make the geometric inference steps of automated processes highly prone to errors. For example, attachment point clouds may be incorrectly merged into the main wall surface, or complex roof structures may be oversimplified into a single inclined plane, resulting in severe geometric distortion in the generated 3D model, failing to faithfully reflect the true form of the building. To obtain a usable model, extensive and tedious manual post-processing is required to correct and adjust the model piece by piece, severely limiting the realization of large-scale, high-efficiency urban 3D modeling. This invention provides a method for automatically measuring the spatiality of buildings based on point cloud data.
[0006] To solve the above-mentioned technical problems, one technical solution adopted by the present invention is: to provide a method for automatically performing spatial measurement of buildings based on point cloud data, comprising the following steps:
[0007] S1. Input the acquired building point cloud data, divide the building point cloud data into voxels to generate several voxel units, calculate the average coordinates of all points in each voxel unit as the centroid of the voxel unit, and construct the building feature point cloud based on the set of all the centroids.
[0008] S2. Perform structural feature recognition on the building feature point cloud to distinguish the point cloud subsets belonging to the building roof, facade walls and facade attachments;
[0009] S3. For the building roof point cloud subset, project the building roof point cloud subset onto a preset horizontal plane to form a two-dimensional projection point set. Detect its outer closed boundary based on the two-dimensional projection point set as a horizontal projection contour. Identify the main extension direction of the horizontal projection contour within the horizontal plane as the main contour direction. Regularly divide the horizontal projection contour along the main contour direction to generate a two-dimensional mesh. Project the vertices of the two-dimensional mesh in reverse onto a preset three-dimensional space and combine it with the height information in the three-dimensional coordinates of the building roof point cloud subset to reconstruct the roof surface model.
[0010] S4. For the subset of point clouds of the facade wall, perform a preset facade contour extraction to generate a wall surface model.
[0011] S5. For the subset of the surface attachment point cloud, perform a preset attachment measurement and calculate its positioning size and protrusion depth relative to the wall surface model.
[0012] S6. Integrate the roof surface model, the wall surface model, and the measurement results of each attachment to automatically generate a three-dimensional measurement model of the building.
[0013] The present invention is further configured such that: in step S1, the overall point cloud data of the building is scanned by a preset scanning device to obtain a point cloud dataset containing the surface three-dimensional coordinate information of the target building.
[0014] 3. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 2, characterized in that: the method for dividing the voxel units in step S1 is as follows:
[0015] S101. Based on the input point cloud data of the building, calculate its spatial distribution range, determine the minimum and maximum coordinates of the point cloud data of the building in the X, Y, and Z axes of the preset three-dimensional rectangular coordinate system, and construct an axial three-dimensional bounding box that completely surrounds the point cloud data of the building. The length, width, and height of the axial three-dimensional bounding box are determined by the difference between the maximum and minimum values of the point cloud data of the building in the coordinate axis directions of the preset three-dimensional rectangular coordinate system.
[0016] S102. Based on the preset initial voxel size, the axial three-dimensional bounding box is divided into equal intervals along the X, Y, and Z coordinate axes to generate a series of regularly arranged initial cubic mesh units. If an initial cubic mesh unit contains at least one laser point from the overall point cloud data of the building, the initial cubic mesh unit is marked as a non-empty voxel unit. If an initial cubic mesh unit does not contain any laser points from the overall point cloud data of the building, the initial cubic mesh unit is marked as an empty voxel unit.
[0017] The steps for constructing the building feature point cloud are as follows:
[0018] S103. For the marked non-empty voxel unit, calculate the arithmetic mean of the spatial coordinates of all the laser points contained within it, and use it as the centroid coordinates of the non-empty voxel unit. The centroids of all the non-empty voxel units constitute the downsampled building feature point cloud.
[0019] The present invention is further configured such that: the specific steps for structural feature recognition of the building feature point cloud in step S2 are as follows:
[0020] S201. Perform a preset region growth on the building feature point cloud to identify all potential planar structures in the building feature point cloud. The region growth uses each centroid point in the building feature point cloud as a growth seed point. For each centroid point of the growth seed point, within a spatial range centered on the centroid point and bounded by a preset neighborhood radius, select all other centroid points falling within the spatial range from the building feature point cloud to form a local point set. Based on the spatial coordinate distribution of the local point set, calculate the normal vector and curvature value of the centroid point of the growth seed point. Determine that adjacent centroid points whose angle between the normal vectors is less than a preset angle threshold and whose curvature value is less than a preset curvature threshold belong to the same potential plane. Merge adjacent centroid points belonging to the same potential plane into the same temporary point cloud group initialized by the growth seed point until no new centroid points meet the merging conditions. Define each temporary point cloud group as a candidate planar point cloud patch.
[0021] S202. For each candidate planar point cloud patch, calculate its best-fit plane equation, and define the geometric plane represented by the best-fit plane equation as the reference plane of the candidate planar point cloud patch. Calculate the angle between the normal vector of the reference plane and a preset global direction vector. Based on the size of the angle, classify the candidate planar point cloud patches into horizontal plane family, vertical plane family, and inclined plane family. The candidate planar point cloud patches with an angle less than a first preset angle threshold are classified into the horizontal plane family, the candidate planar point cloud patches with an angle greater than a second preset angle threshold are classified into the vertical plane family, and the candidate planar point cloud patches with an angle between the first preset angle threshold and the second preset angle threshold are classified into the inclined plane family.
[0022] S203. Based on the classified candidate planar point cloud patches, they are identified as point cloud subsets of building roofs, facade walls, and facade attachments, respectively. Specifically, in the preset three-dimensional rectangular coordinate system of the overall building point cloud data, candidate planar point cloud patches with Z coordinate values greater than a preset height threshold are selected, and the candidate planar point cloud patches of the horizontal plane family or the inclined plane family whose area calculation values reach or exceed a preset roof area priority threshold are identified as the building roof point cloud subset; the candidate planar point cloud patches of the vertical plane family whose difference between the angle between the normal vector and the global direction vector and 90 degrees is less than a preset vertical tolerance and whose area calculation values are greater than a preset area threshold are selected and identified as the facade wall point cloud subset.
[0023] From all candidate planar point cloud patches, remove the portions that have been identified as the roof point cloud subset and the facade wall point cloud subset of the building, and obtain the remaining candidate planar point cloud patches. Calculate the spatial Euclidean distance between the remaining candidate planar point cloud patches and the identified facade wall point cloud subsets. Identify the candidate planar point cloud patches whose spatial Euclidean distance is less than a preset attachment distance threshold and whose calculated area does not exceed a preset upper limit threshold for attachment area as the facade attachment point cloud subset.
[0024] The present invention is further configured such that the calculation steps of the best-fit plane equation in step S202 are as follows:
[0025] S2021. Randomly select three non-collinear centroids from the candidate planar point cloud to be calculated to form a random three-point combination. Calculate a set of planar parameters based on the spatial coordinates of the random three-point combination as candidate planar parameters. The candidate planar parameters include a planar normal vector and a constant term. Based on the candidate planar parameters, a plane can be uniquely determined and defined as a temporary plane.
[0026] S2022. Based on the candidate plane parameters corresponding to the temporary plane, calculate the vertical distance from each centroid point in the candidate plane point cloud to the temporary plane, and include all centroid points whose vertical distance is less than a preset distance threshold into the temporary inner point set corresponding to this calculation, and count the number of centroid points contained in the temporary inner point set.
[0027] S2023. Repeat steps S2021 to S2022 until the preset number of iterations is reached. From the set of temporary interior points obtained from all iterative calculations, select the temporary interior point set that contains the first number of centroid points as the final interior point set.
[0028] S2024. Based on the spatial coordinates of all the centroids contained in the final interior point set, calculate their covariance matrix, and perform eigenvalue decomposition on the covariance matrix. Take the unit eigenvector corresponding to the smallest eigenvalue as the normal vector of the best-fitting plane equation, substitute the average coordinates of all the centroids in the final interior point set into the plane equation determined by the normal vector, solve the constant term, and obtain the best-fitting plane equation of the candidate plane point cloud.
[0029] The present invention is further configured such that the method for generating the two-dimensional mesh in step S3 is as follows:
[0030] S301. A local two-dimensional coordinate system is established with the geometric center of the horizontal projection contour as the origin, the main direction of the contour as the positive X-axis, and the direction perpendicular to the main direction of the contour and in the horizontal plane as the positive Y-axis.
[0031] S302. In the local two-dimensional coordinate system, along the X-axis and Y-axis directions, the minimum bounding rectangle of the horizontal projection contour is divided at equal intervals according to the preset grid size parameters to generate an initial two-dimensional grid covering the horizontal projection contour.
[0032] S303. For each grid cell of the initial two-dimensional grid, determine whether its center point or vertex is located inside the horizontal projection contour, retain all grid cells whose center point or vertex is located inside the horizontal projection contour, remove grid cells located outside, and integrate the retained grid cells to form a regularized two-dimensional grid.
[0033] The reconstruction steps of the roof surface model in step S3 are as follows:
[0034] S304. The two-dimensional coordinates of each vertex of the two-dimensional mesh in the local two-dimensional coordinate system are combined with the weighted average of the laser point height values corresponding to the projection positions of the vertex in the cloud subset of the building roof points and converted into coordinates in a preset three-dimensional rectangular coordinate system to generate a spatial mesh point set as the basic geometric framework of the roof surface model.
[0035] S305. Using each grid cell of the spatial grid point set as the basic processing unit, fit the four vertices of each grid cell into a spatial planar patch. For each spatial planar patch, compare it with all laser points whose projection positions in the building roof point cloud subset fall within the boundary range of the grid cell. Calculate the height error from the laser points to the spatial planar patch. If the average height error of all laser points in the grid cell exceeds a preset tolerance, or the height change rate of the laser points in the grid cell exceeds a preset curvature threshold, then subdivide the grid cell into four sub-units. Generate vertices for each new sub-unit based on the elevation information of the spatial grid point set, and refit the planar patch. Iterate this process until the average height error of all finally generated planar patches and the laser points in their corresponding grid regions is less than the preset tolerance. Finally, based on the inherent adjacency relationship of the grid cells, stitch all the planar patches together at their shared edges to form a roof surface model.
[0036] The present invention is further configured such that: the specific content of generating the wall surface model in step S4 is as follows: projecting the subset of the facade wall point cloud onto its corresponding best-fit plane to generate a two-dimensional projection point set; in the two-dimensional coordinate system formed by the best-fit plane, performing line segment detection and connection on the two-dimensional projection point set to form a closed facade contour polygon; mapping the facade contour polygon back to a preset three-dimensional rectangular coordinate system, and performing geometric alignment with the boundary of the roof surface model to generate the wall surface model;
[0037] The method for forming the polygonal outline of the facade is as follows:
[0038] S401. Construct a triangular mesh on the two-dimensional projection point set to generate a triangular mesh structure composed of multiple interconnected triangular facets, each of which consists of three projection points.
[0039] S402. Based on the triangular mesh structure, extract all edge segments shared by only one triangular facet as candidate boundary segments. Sort and connect the candidate boundary segments according to the spatial distance between the endpoints of the candidate boundary segments and the preset directional consistency threshold to form a continuous and closed loop polygon. Optimize and adjust the vertices of the loop polygon to generate a closed facade outline polygon.
[0040] The present invention is further configured such that: the specific content of performing the preset attachment measurement in step S5 is as follows: based on the spatial distribution and density characteristics of the attachment point cloud in the subset of the facade attachment point cloud, it is classified into balcony, window opening or external equipment type; for a single subset of the facade attachment point cloud in each category, its minimum circumscribed solid frame is calculated as the measurement bounding box of the attachment, and the key corner coordinates of the measurement bounding box are extracted.
[0041] The calculation method for the positioning dimensions and protrusion depth of the key corner point coordinates relative to the wall surface model is as follows:
[0042] S501. For each key corner point of the measurement bounding box, calculate the shortest vertical distance vector from it to the wall surface model. The direction of the shortest vertical distance vector is from the key corner point to the nearest projection point on the wall surface model. The length of the shortest vertical distance vector is recorded as the initial protrusion depth of the key corner point. At the same time, the coordinates of the projection point of the key corner point on the wall surface model are converted into two-dimensional coordinates in the local two-dimensional coordinate system of the wall surface model to obtain the initial positioning coordinates of the key corner point.
[0043] S502. Based on the initial protrusion depth and initial positioning coordinates of all the key corner points, calculate the overall positioning dimensions and overall protrusion depth of the measurement bounding box. Specifically, extract the projection points of all the key corner points on the wall surface model, calculate the minimum bounding rectangle of the projection polygon formed by the projection points, take the center point coordinates of the minimum bounding rectangle as the overall positioning center, and take the length and width of the minimum bounding rectangle as the positioning dimensions; at the same time, take the maximum value of the initial protrusion depth of all the key corner points as the protrusion depth of the attachment, and generate a measurement result that includes the positioning dimensions and protrusion depth.
[0044] The present invention is further configured such that: the specific content of step S6 is as follows: based on the spatial boundary of the roof curved surface model, the facade outline of the wall surface model, and the positioning dimensions and protrusion depths in the measurement results of each of the attachments, the bottom edge of the roof curved surface model is geometrically aligned with the top boundary of the wall surface model, and according to the positioning dimensions and protrusion depths of each of the attachments relative to the wall surface model in the measurement results of each of the attachments, each of the attachments is assembled to the corresponding spatial position of the wall surface model to form a complete three-dimensional geometric framework of the building including the roof, walls, and attachments; the geometric parameters of the roof curved surface model, the facade dimensions of the wall surface model, and the positioning dimensions and protrusion depths in the measurement results of each of the attachments are used as attribute information and associated with the corresponding components of the complete three-dimensional geometric framework of the building to generate a three-dimensional measurement model of the building.
[0045] The beneficial effects of this invention are as follows:
[0046] 1. This invention accurately separates the building point cloud into subsets of roof, walls and attachments, and combines projection meshing and adaptive subdivision reconstruction methods for complex roof structures. This effectively avoids the geometric distortion problems common in traditional algorithms, such as mistakenly incorporating attachments into walls or oversimplifying complex roofs into a single slope, and significantly improves the geometric fidelity of the model.
[0047] 2. This invention performs refined classification of the point cloud subset of facade attachments based on spatial distribution features, and performs independent bounding box calculations and high-precision measurements on various attachments. This enables automated and high-precision extraction of the dimensions and locations of complex facade structures such as balconies and window openings, solving the key defect of existing technologies that ignore or incorrectly represent detailed features due to insufficient processing power, resulting in missing model details.
[0048] 3. This invention achieves end-to-end generation of 3D measurement models of buildings by constructing a complete automated process from point cloud preprocessing, structure recognition, component modeling to final attribute integration. It automatically associates the geometric models of roofs, walls, and attachments with spatial measurement attributes, greatly reducing the reliance on manual post-processing and providing reliable technical support for large-scale, high-efficiency urban 3D modeling production. Attached Figure Description
[0049] Figure 1 This is a flowchart of the method of the present invention;
[0050] Figure 2 This is a flowchart of the voxel unit partitioning method of the present invention;
[0051] Figure 3 This is a flowchart illustrating the reconstruction steps of the roof surface model according to the present invention. Detailed Implementation
[0052] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby providing a clearer and more explicit definition of the scope of protection of the present invention.
[0053] Please see Figure 1 - Figure 3 A method for automatically performing spatial measurement of buildings based on point cloud data includes the following steps:
[0054] S1. Input the acquired building point cloud data, divide the building point cloud data into voxels to generate several voxel units, calculate the average coordinates of all points in each voxel unit as the centroid of the voxel unit, and construct the building feature point cloud based on the set of all centroids.
[0055] S2. Perform structural feature recognition on the feature point cloud of the building to distinguish the point cloud subsets belonging to the building roof, facade walls and facade attachments;
[0056] S3. For the building roof point cloud subset, project the building roof point cloud subset onto a preset horizontal plane to form a two-dimensional projection point set. Detect its outer closed boundary based on the two-dimensional projection point set as the horizontal projection contour. Identify the main extension direction of the horizontal projection contour in the horizontal plane as the contour's main direction. Regularly divide the horizontal projection contour along the contour's main direction to generate a two-dimensional mesh. Project the vertices of the two-dimensional mesh in reverse onto a preset three-dimensional space and combine the height information in the three-dimensional coordinates of the building roof point cloud subset to reconstruct the roof surface model.
[0057] S4. For the point cloud subset of the facade wall, perform the preset facade contour extraction to generate the wall surface model.
[0058] S5. For the subset of points cloud of attachments on the facade, perform the preset attachment measurement and calculate its positioning size and protrusion depth relative to the wall surface model.
[0059] S6 integrates the roof surface model, wall surface model, and measurement results of various attachments to automatically generate a three-dimensional measurement model of the building.
[0060] Steps S1-S6 accurately separate the point clouds of the roof, walls and attachments through voxel division and feature recognition, and use two-dimensional meshing rules for reconstruction and independent measurement. This effectively avoids the problems of erroneous merging of complex structures and distortion caused by simplification. While improving processing efficiency and automation, it significantly enhances the geometric fidelity of the model, thereby greatly reducing the need for manual post-processing.
[0061] One embodiment of the present invention is as follows: in step S1, the overall point cloud data of the building is scanned by a preset scanning device to obtain a point cloud dataset containing the surface three-dimensional coordinate information of the target building.
[0062] Scanning equipment includes laser scanners, drone-mounted 3D scanning equipment, or fixed 3D laser scanning systems.
[0063] The method for dividing the voxel units in step S1 is as follows:
[0064] S101. Based on the input point cloud data of the building as a whole, calculate its spatial distribution range, determine the minimum and maximum coordinates of the point cloud data of the building as a whole in the X, Y, and Z axes of the preset three-dimensional rectangular coordinate system, and construct an axial three-dimensional bounding box that can completely surround the point cloud data of the building as a whole. The length, width, and height of the axial three-dimensional bounding box are determined by the difference between the maximum and minimum values of the point cloud data of the building as a whole in the coordinate axes of the preset three-dimensional rectangular coordinate system.
[0065] The method for determining the minimum and maximum coordinates of the overall point cloud data of a building in the X, Y, and Z axes of a preset three-dimensional rectangular coordinate system is as follows: traverse the spatial coordinates of all laser points in the overall point cloud data of the building, and filter out the minimum and maximum coordinate values in the X, Y, and Z axes by comparing each point. These coordinate values define the spatial boundaries of the axial three-dimensional bounding box.
[0066] S102. Based on the preset initial voxel size, the axial three-dimensional bounding box is divided into equal intervals along the X, Y, and Z coordinate axes to generate a series of regularly arranged initial cubic mesh units. If an initial cubic mesh unit contains at least one laser point from the overall point cloud data of a building, the initial cubic mesh unit is marked as a non-empty voxel unit. If an initial cubic mesh unit does not contain any laser points from the overall point cloud data of a building, the initial cubic mesh unit is marked as an empty voxel unit and is not included in subsequent calculations.
[0067] Equal interval division method: Based on the preset initial voxel size, the axial three-dimensional bounding box is cut at equal distances along its three axes of X, Y, and Z to generate a series of regularly arranged initial cubic mesh units. Then, it is determined whether each initial cubic mesh unit contains at least one laser point from the overall point cloud data of the building, and it is marked as a non-empty voxel unit or an empty voxel unit accordingly.
[0068] The steps for constructing a building feature point cloud are as follows:
[0069] S103. For the marked non-empty voxel units, calculate the arithmetic mean of the spatial coordinates of all laser points contained within them, and use it as the centroid coordinates of the non-empty voxel unit. The centroids of all non-empty voxel units constitute the downsampled building feature point cloud, thus completing the voxel unit division and feature extraction.
[0070] This embodiment quickly defines the precise processing range of the overall point cloud data of the building by constructing an axial three-dimensional bounding box, and effectively preserves the building feature point cloud describing the key geometric features of the building while significantly improving the data preprocessing efficiency by utilizing equal interval division based on the initial voxel size and centroid point calculation.
[0071] One embodiment of the present invention is as follows: the specific steps for structural feature recognition of the building feature point cloud in step S2 are as follows:
[0072] S201. Perform a pre-defined region growing based on the consistency of normal vector and curvature on the building feature point cloud, identify all potential planar structures in the building feature point cloud, and use each centroid point in the building feature point cloud as a growth seed point for the region growing. For the centroid point of each growth seed point, within a spatial range centered on the centroid point and bounded by a pre-defined neighborhood radius, select all other centroid points falling within the spatial range from the building feature point cloud to form a local point set. Based on the spatial coordinate distribution of the local point set, calculate the normal vector and curvature value of the centroid point of the growth seed point. Determine that adjacent centroid points whose angle between normal vectors is less than a pre-defined angle threshold and whose curvature value is less than a pre-defined curvature threshold belong to the same potential plane, and merge adjacent centroid points belonging to the same potential plane into the same temporary point cloud group initialized by the growth seed point, until no new centroid points meet the merging conditions. Define each temporary point cloud group as a candidate planar point cloud patch.
[0073] Preset neighborhood radius: The optimal value is determined based on the average point spacing of the building feature point cloud, and is 5 to 8 times the average point spacing, to ensure that the local point set can fully reflect the local geometric features of the centroid point;
[0074] The calculation method for the normal vector and curvature value of the centroid of the seed point is as follows: based on the spatial coordinates of all centroids in the local point set, calculate the principal direction of their distribution. The direction of the principal normal vector is determined by the eigenvector corresponding to the minimum eigenvalue, while the curvature value is calculated by the ratio of the minimum eigenvalue to the sum of the eigenvalues.
[0075] Preset angle threshold: The optimal value is 5 to 15 degrees, which is used to constrain the angle change of the normal vector; the optimal value of the preset curvature threshold is 0.01 to 0.05, which is used to define flat regions. When the calculated curvature value of the centroid point is less than the preset curvature threshold, it is considered to be located on the potential planar structure.
[0076] S202. For each candidate planar point cloud patch, calculate its best-fit plane equation, and define the geometric plane represented by the best-fit plane equation as the reference plane of the candidate planar point cloud patch. Calculate the angle between the normal vector of the reference plane and a preset global direction vector. Based on the size of the angle, classify the candidate planar point cloud patches into horizontal plane family, vertical plane family, and inclined plane family. Candidate planar point cloud patches with an angle less than a first preset angle threshold are classified into the horizontal plane family, candidate planar point cloud patches with an angle greater than a second preset angle threshold are classified into the vertical plane family, and candidate planar point cloud patches with an angle between the first preset angle threshold and the second preset angle threshold are classified into the inclined plane family.
[0077] The optimal value of the preset global direction vector is (0,0,1). This vector is opposite to the direction of gravitational acceleration and points vertically upward, serving as a benchmark for distinguishing the direction categories of candidate planar point cloud patches.
[0078] The angle between the normal vector of the reference plane and a preset global direction vector is calculated as follows: calculate the dot product between the normal vector of the reference plane and the preset global direction vector, and then solve for the angle corresponding to the dot product value using the inverse cosine function to obtain the angle.
[0079] The optimal value is 10 degrees, used to define the horizontal plane family; the optimal value for the second preset angle threshold is 80 degrees, used to define the vertical plane family.
[0080] S203. Based on the classified candidate planar point cloud patches, identify them as point cloud subsets of building roofs, facade walls, and facade attachments, respectively. Specifically, in the preset three-dimensional rectangular coordinate system of the overall building point cloud data, select candidate planar point cloud patches with Z coordinate values greater than a preset height threshold, and identify the horizontal or inclined plane families of candidate planar point cloud patches whose area calculation values reach or exceed the preset roof area priority threshold as the building roof point cloud subset; select the vertical plane families of candidate planar point cloud patches whose difference between the angle between the normal vector and the global direction vector and 90 degrees is less than the preset vertical tolerance and whose area calculation values are greater than the preset area threshold, and identify them as the facade wall point cloud subset.
[0081] From all candidate planar point cloud patches, remove the portions that have been identified as building roof point cloud subsets and facade wall point cloud subsets to obtain the remaining candidate planar point cloud patches. Calculate the spatial Euclidean distance between the remaining candidate planar point cloud patches and the identified facade wall point cloud subsets. Identify the candidate planar point cloud patches whose spatial Euclidean distance is less than a preset attachment distance threshold and whose area calculation value does not exceed a preset upper limit threshold for attachment area as facade attachment point cloud subsets.
[0082] The optimal value is set based on the bottom elevation and average floor height of the overall building point cloud data, usually 3 to 5 meters above the bottom elevation; the optimal value for the preset vertical tolerance is 5 degrees; the optimal value for the preset area threshold is set based on typical wall dimensions, usually not less than 2 square meters; the optimal value for the preset attachment distance threshold is set based on the typical interval between the attachment and the wall, usually 0.1 to 0.5 meters; the optimal value for the preset attachment area upper limit threshold is used to exclude excessively large structures, usually set to 1.5 square meters.
[0083] The calculation steps for the area of the candidate planar point cloud are as follows: project all centroids of the candidate planar point cloud vertically onto its own reference plane, and then calculate the area of the two-dimensional convex hull or polygon formed by these projected points on the reference plane. This area is the area of the candidate planar point cloud.
[0084] The calculation steps for the best-fit plane equation in step S202 are as follows:
[0085] S2021. Randomly select three non-collinear centroids from the candidate planar point cloud to be calculated to form a random three-point combination. Calculate a set of plane parameters based on the spatial coordinates of the random three-point combination as candidate plane parameters. The candidate plane parameters include the plane normal vector and a constant term. Based on the candidate plane parameters, a plane can be uniquely determined and defined as a temporary plane.
[0086] The steps for calculating the plane parameters are as follows: Based on the spatial coordinates of the three centroids in the random three-point combination, calculate the normal vector of the temporary plane through the vector cross product operation, and use the normal vector and the coordinates of one of the centroids to solve for the constant terms in the plane equation, which together constitute the candidate plane parameters.
[0087] S2022. Based on the candidate plane parameters corresponding to the temporary plane, calculate the vertical distance from each centroid point in the candidate plane point cloud to the temporary plane, and include all centroid points whose vertical distance is less than a preset distance threshold into the temporary inner point set corresponding to this calculation, and count the number of centroid points contained in the temporary inner point set.
[0088] The method for calculating the vertical distance from each centroid point in the candidate planar point cloud to the temporary plane is as follows: substitute the spatial coordinates of the centroid point into the equation of the temporary plane determined by the candidate plane parameters, and the absolute value obtained is the vertical distance; the optimal value of the preset distance threshold is related to the average point spacing of the building feature point cloud, and is usually set to 1 to 2 times the average point spacing.
[0089] S2023. Repeat steps S2021 to S2022 until the preset number of iterations is reached. From the set of temporary interior points obtained from all iterative calculations, select the temporary interior point set that contains the largest number of centroid points as the final interior point set.
[0090] The optimal value of the preset number of iterations is dynamically calculated based on the expected proportion of interior points in the candidate planar point cloud, ensuring that the correct best-fit plane equation can be found with a high probability, usually no less than 1000 times;
[0091] S2024. Based on the spatial coordinates of all centroids in the final interior point set, calculate their covariance matrix, and perform eigenvalue decomposition on the covariance matrix. Take the unit eigenvector corresponding to the smallest eigenvalue as the normal vector of the best-fitting plane equation, substitute the average coordinates of all centroids in the final interior point set into the plane equation determined by the normal vector, solve the constant term, and obtain the best-fitting plane equation of the candidate plane point cloud.
[0092] The method for calculating the covariance matrix is as follows: based on the spatial coordinates of all centroids in the final interior point set, first calculate the average coordinates, then subtract the average coordinates from the coordinates of each centroid to obtain the centered coordinates, and finally calculate the covariance matrix based on all centered coordinates.
[0093] This embodiment accurately segments candidate planar point cloud patches by using consistent growth based on normal vectors and curvature, and robustly classifies roofs, walls and attachments using multi-level thresholds. This effectively solves the problems of inaccurate structure identification and misjudgment in complex point clouds, providing a reliable foundation for subsequent independent modeling and precise measurement, and significantly improving the automation level and processing accuracy of the overall process.
[0094] One embodiment of the present invention is as follows: the method for generating the two-dimensional mesh in step S3 is as follows:
[0095] S301. Establish a local two-dimensional coordinate system with the geometric center of the horizontal projection contour as the origin, the main direction of the contour as the positive X-axis, and the direction perpendicular to the main direction of the contour and in the horizontal plane as the positive Y-axis.
[0096] S302. In the local two-dimensional coordinate system, along the X-axis and Y-axis directions, the minimum bounding rectangle of the horizontal projection contour is divided at equal intervals according to the preset grid size parameters to generate an initial two-dimensional grid covering the horizontal projection contour.
[0097] The optimal value of the preset grid size parameter is adaptively determined based on the size of the circumscribed rectangle of the horizontal projection profile and the average point density of the building roof point cloud subset, and is usually 1 / 20 to 1 / 50 of the average side length of the circumscribed rectangle.
[0098] The specific steps for generating the initial two-dimensional mesh are as follows: In the local two-dimensional coordinate system, with the origin as the reference, along the positive and negative directions of the X and Y axes, the minimum bounding rectangle of the horizontal projection contour is extended and divided according to the preset mesh size parameters to generate a set of regularly arranged initial mesh cells that cover the entire minimum bounding rectangle, thus forming the initial two-dimensional mesh.
[0099] S303. For each grid cell of the initial two-dimensional grid, determine whether its center point or vertex is located inside the horizontal projection contour. Retain all grid cells whose center points or vertices are located inside the horizontal projection contour, remove grid cells located outside, and integrate the retained grid cells to form a regularized two-dimensional grid. The vertices of this two-dimensional grid are the basis for subsequent back projection to the preset three-dimensional rectangular coordinate system.
[0100] The steps for reconstructing the roof surface model in step S3 are as follows:
[0101] S304. The two-dimensional coordinates of each vertex of the two-dimensional mesh in the local two-dimensional coordinate system are combined with the weighted average of the laser point height values corresponding to the vertex projection position in the cloud subset of the building roof points and converted into coordinates in the preset three-dimensional rectangular coordinate system to generate a spatial mesh point set as the basic geometric framework of the roof surface model.
[0102] The weights in the weighted average calculation process are determined by the reciprocal of the horizontal distance from the laser point to the vertex of the two-dimensional grid;
[0103] The specific method for generating the spatial grid point set is as follows: For each vertex of the two-dimensional grid, its two-dimensional coordinates are determined in the local two-dimensional coordinate system. Then, based on the horizontal projection position of all laser points in the building roof point cloud subset, all laser points whose horizontal distance from the vertex is within a specified threshold are searched. The weighted average of the height values of these laser points is calculated using the reciprocal of the horizontal distance from these laser points to the vertex as the weight. This weighted average is used as the elevation value of this vertex. Thus, the two-dimensional coordinates of the vertex are combined with the calculated elevation value to convert them into three-dimensional coordinates in a preset three-dimensional rectangular coordinate system. The set of three-dimensional coordinates obtained after the conversion of all vertices constitutes the spatial grid point set.
[0104] S305. Using each grid cell of the spatial grid point set as the basic processing unit, fit the four vertices of each grid cell into a spatial planar patch. For each spatial planar patch, compare it with all laser points whose projection positions in the building roof point cloud subset fall within the boundary range of the grid cell. Calculate the height error (i.e., vertical distance) from the laser points to the spatial planar patch. If the average height error of all laser points in the grid cell exceeds the preset tolerance, or the height change rate of the laser points in the grid cell exceeds the preset curvature threshold, then subdivide the grid cell into four sub-cells. Generate vertices for each new sub-cell based on the elevation information of the spatial grid point set, and refit the planar patch. Iterate this process until the average height error of all the finally generated planar patches and the laser points in their corresponding grid regions is less than the preset tolerance. Finally, based on the inherent adjacency relationship of the grid cells, stitch all the planar patches together at their shared edges to ensure that there are no gaps between adjacent planar patches and that the normal vectors are continuous, forming the roof surface model.
[0105] The method for calculating the height error from the laser point to the spatial plane is as follows: Substitute the three-dimensional coordinates of the laser point into the plane equation of the spatial plane determined by the four vertices of the grid cell, and the absolute value obtained is the vertical distance from the laser point to the spatial plane, which is the height error.
[0106] The rate of change of the height of the laser points within the grid cell is obtained by the standard deviation of the height values of the laser points within the grid computing cell.
[0107] The optimal value of the preset tolerance is related to the elevation accuracy of the building roof point cloud subset, and is usually set to 2 to 3 times the elevation error of the building roof point cloud subset; the optimal value of the preset curvature threshold is used to judge local undulations, and is usually set to 2 to 3 times the average elevation difference of adjacent grid cells.
[0108] This embodiment, through contour-aligned meshing rules and adaptive subdivision based on height error and curvature, can accurately fit the geometric details of complex roof surfaces while maintaining the regular topology of the roof model, significantly improving the geometric fidelity and automated reconstruction quality of the roof surface model.
[0109] One embodiment of the present invention is as follows: The specific content of generating the wall surface model in step S4 is as follows: Project the subset of the wall point cloud onto its corresponding best-fit plane to generate a two-dimensional projection point set; In the two-dimensional coordinate system formed by the best-fit plane, perform line segment detection and connection on the two-dimensional projection point set to form a closed facade contour polygon; Map the facade contour polygon back to the preset three-dimensional rectangular coordinate system, and perform geometric alignment with the boundary of the roof surface model to generate the wall surface model;
[0110] The method for forming the polygonal outline of the facade is as follows:
[0111] S401. Construct a triangular mesh for the two-dimensional projection point set to generate a triangular mesh structure composed of multiple interconnected triangular facets. Each triangular facet consists of three projection points, thereby establishing the topological adjacency relationship between point clouds.
[0112] S402. Based on the triangular mesh structure, extract all edge segments shared by only one triangular facet as candidate boundary segments. Sort and connect the candidate boundary segments according to the spatial distance between the endpoints of the candidate boundary segments and the preset direction consistency threshold to form a continuous and closed loop polygon. Optimize and adjust the vertices of the loop polygon to eliminate redundant points or fill gaps and generate a closed facade outline polygon.
[0113] The optimal value of the preset directional consistency threshold is set based on the average point spacing of the two-dimensional projection point set and the average length of the candidate boundary line segments. It is usually 1.5 to 3 times the average point spacing. It is used to determine whether two candidate boundary line segments meet the conditions of collinearity or small-angle turning, and thus decide whether to connect them.
[0114] The specific steps for optimizing and adjusting the vertices of the annular polygon are as follows: traverse all consecutive vertex sequences on the annular polygon, calculate the turning angle between the two line segments formed by each intermediate vertex and its preceding and following vertices, if the turning angle is less than the preset angle tolerance, then the intermediate vertex is determined to be a redundant point and deleted. At the same time, for vertex pairs whose distance between adjacent vertices exceeds the preset maximum gap threshold, insert new vertices at equal intervals on their connecting lines to fill the gaps, and finally obtain a closed and smooth facade contour polygon composed of key feature points.
[0115] This embodiment extracts boundary line segments and optimizes their connections using triangular meshes, enabling robust generation of accurate and closed wall contour polygons from point clouds. This effectively avoids the jagged edges or discontinuities caused by noise points, providing a reliable geometric basis for the subsequent generation of high-quality wall surface models.
[0116] One embodiment of the present invention is as follows: The specific content of performing the preset attachment measurement in step S5 is as follows: Based on the spatial distribution and density characteristics of the attachment point cloud in the attachment point cloud subset of the facade, it is classified into balcony, window opening or external equipment type. For a single attachment point cloud subset in each category, its minimum circumscribed solid frame is calculated as the measurement bounding box of the attachment, and the key corner coordinates of the measurement bounding box are extracted.
[0117] Based on the spatial distribution and density characteristics of the attachment point cloud subsets, the specific method for classifying them into balcony, window opening, or external equipment types is as follows: Analyze the three-dimensional spatial distribution morphology and local point density variation patterns of the attachment point cloud subsets. Attachment point cloud subsets that exhibit large-area regular planar distribution and uniform point density are classified as balcony types. Attachment point cloud subsets that show local point cloud deficiencies or recessed areas with regular boundaries are classified as window opening types. Attachment point cloud subsets with smaller volume, higher point density, and independent spatial distribution are classified as external equipment types.
[0118] For a single facade attachment point cloud subset in each category, the specific content of calculating its minimum bounding cube as the measurement bounding box of the attachment is as follows: traverse the three-dimensional coordinates of all points in the facade attachment point cloud subset of this type, determine the minimum and maximum coordinate values in the X, Y, and Z directions respectively, use these extreme points as boundaries to generate an axially aligned cuboid that can completely enclose the point cloud subset, and define the cuboid as the measurement bounding box of the attachment.
[0119] The steps for extracting the key corner coordinates of the measurement bounding box are as follows: For the constructed measurement bounding box, whose geometry consists of eight vertices, the three-dimensional spatial coordinates of these eight vertices are directly obtained as the key corner coordinates describing the spatial range of the measurement bounding box.
[0120] The calculation method for the positioning dimensions and protrusion depth of key corner points relative to the wall surface model is as follows:
[0121] S501. For each key corner point of the measurement bounding box, calculate the shortest vertical distance vector from it to the wall surface model. The direction of the shortest vertical distance vector is from the key corner point to the nearest projection point on the wall surface model. The length of the shortest vertical distance vector is recorded as the initial protrusion depth of the key corner point. At the same time, the coordinates of the projection point of the key corner point on the wall surface model are converted into two-dimensional coordinates in the local two-dimensional coordinate system of the wall surface model to obtain the initial positioning coordinates of the key corner point.
[0122] S502. Based on the initial protrusion depth and initial positioning coordinates of all key corner points, calculate the overall positioning dimensions and overall protrusion depth of the measurement bounding box. Specifically, extract the projection points of all key corner points on the wall surface model, calculate the minimum bounding rectangle of the projection polygon formed by the projection points, take the center point coordinates of the minimum bounding rectangle as the overall positioning center, and take the length and width of the minimum bounding rectangle as the positioning dimensions. At the same time, take the maximum value of the initial protrusion depth of all key corner points as the protrusion depth of the attachment, and generate the measurement results including the positioning dimensions and protrusion depth.
[0123] The specific steps for extracting the projection points of all key corner points onto the wall surface model and calculating the minimum bounding rectangle of the projected polygon formed by the projection points are as follows: Project the coordinates of the key corner points onto the model surface along a direction perpendicular to the main plane of the wall surface model to obtain a set of two-dimensional projection points. Then, calculate the convex hull boundary of this set of two-dimensional projection points to form the projected polygon. Finally, solve for the minimum area bounding rectangle of the projected polygon to determine its center position and side length.
[0124] This embodiment significantly improves the automation and geometric accuracy of measuring facade attachments such as balconies and window openings by refining the classification of attachments based on point cloud distribution and density characteristics, and performing precise measurements based on their minimum bounding cube and projected polygon.
[0125] One embodiment of the present invention is as follows: Step S6 specifically involves: based on the spatial boundary of the roof curved surface model, the facade outline of the wall surface model, and the positioning dimensions and protrusion depths in the measurement results of each attachment, the bottom edge of the roof curved surface model and the top boundary of the wall surface model are geometrically aligned. Then, according to the positioning dimensions and protrusion depths of each attachment relative to the wall surface model in the measurement results, each attachment is assembled to its corresponding spatial position on the wall surface model, forming a complete three-dimensional geometric framework of the building, including the roof, walls, and attachments. The geometric parameters of the roof curved surface model, the facade dimensions of the wall surface model, and the positioning dimensions and protrusion depths in the measurement results of each attachment are used as attribute information and associated with the corresponding components of the complete three-dimensional geometric framework of the building, generating a three-dimensional measurement model of the building that combines geometric form and measurement attributes.
[0126] The generation process of the 3D measurement model of the building adopts the Neural Radiation Field (NeRF) algorithm. This algorithm reconstructs the continuous 3D scene geometry and appearance from multi-view images or point cloud data through implicit scene representation and volume rendering technology, and supports the synthesis of new views.
[0127] This embodiment achieves automatic integration and precise measurement attribute binding of roof, wall and attachment models through geometric docking and attribute association, generating a high-precision structured 3D model that combines geometric shape and measurement information, significantly improving the automation level of modeling and the applicability of the results.
[0128] Example: This specific example uses a rectangular building that is 10 meters long, 8 meters wide, and 6 meters high. The overall point cloud data of the building contains 1 million points, with a spatial distribution range of [0,10] meters on the X-axis, [0,8] meters on the Y-axis, and [0,6] meters on the Z-axis. First, an axial three-dimensional bounding box is constructed, and the initial voxel size is preset to 0.2 meters for equal interval division. For each non-empty voxel unit, the arithmetic mean of the coordinates of all points within it is calculated as the centroid (for example, if a voxel contains two points P1 (0.1,0.1,0.1) and P2 (0.15,0.15,0.15), then the centroid is (0.125,0.125,0.125)), forming the feature point cloud of the building.
[0129] Subsequently, structural feature recognition was performed on the feature point cloud. Each centroid point was used as a seed point for growth. A local point set was constructed with a preset neighborhood radius of 0.4 meters (8 times the average point spacing of 0.05 meters). The normal vector (the vector corresponding to the smallest eigenvalue obtained through eigenvalue decomposition) and curvature (the ratio of the smallest eigenvalue to the sum of eigenvalues, the formula is the ratio of the smallest eigenvalue to the sum of eigenvalues) were calculated. The threshold values for the angle between the normal vectors were set to 10 degrees and the curvature threshold value to 0.03. Points that met the conditions were merged to generate candidate planar point cloud patches.
[0130] Next, using the global direction vector (0,0,1) as a reference, candidate patches with an angle less than 10 degrees are classified into horizontal plane families (roof), and those with an angle greater than 80 degrees are classified into vertical plane families (walls). A subset of roof point clouds with Z coordinates > 3 meters and areas ≥ 2 square meters are selected and projected onto the horizontal plane to generate a 2D projection point set. After detecting its contour, a 2D grid is divided along the main direction (such as the X-axis) with a grid size of 0.5 meters. The grid vertices are back-projected and combined with the height-weighted average (the weight is the reciprocal of the distance, the formula is the height value of all laser points divided by the horizontal distance to the 2D grid vertex, the sum of these quotients is divided by the sum of all distance reciprocals) to reconstruct the roof surface model. At the same time, the height error from the laser point to the fitted plane patch is calculated (the vertical distance formula is the formula for calculating the vertical distance from a point to a plane, the value is the absolute value of the point's coordinates after substituting into the plane equation, divided by the length of the plane normal vector). If the average error exceeds the tolerance of 0.02 meters or the height change rate (standard deviation) exceeds the curvature threshold of 0.05, the grid is subdivided.
[0131] For the wall point cloud subset, the outline polygons are extracted after being projected onto its best-fit plane and mapped back to 3D space to generate the wall surface model; for the attachment point cloud subset, the minimum bounding box is calculated after classification, the coordinates of its eight corner points are extracted, and the shortest vertical distance to the wall model is calculated as the protrusion depth (taking the maximum value of 0.5 meters). The center of the minimum bounding rectangle of the projection point is (5,4) meters and the size is 3×2 meters as the positioning dimensions; finally, the roof surface model, the wall surface model and the attachment measurement results are integrated to generate a complete 3D measurement model.
[0132] This example demonstrates an automated process from point cloud to 3D model using specific numerical values and formulas. Voxel division and feature recognition effectively reduce the amount of data while preserving key geometric features. The reconstruction method based on projection and adaptive mesh significantly improves the modeling accuracy of complex roofs and walls, while the accurate measurement of attachments reduces human intervention. The overall process balances efficiency and accuracy, providing a reliable example for spatial measurement of buildings.
[0133] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for automatically performing spatial measurement of buildings based on point cloud data, characterized in that: Includes the following steps: S1. Input the acquired building point cloud data, divide the building point cloud data into voxels to generate several voxel units, calculate the average coordinates of all points in each voxel unit as the centroid of the voxel unit, and construct the building feature point cloud based on the set of all the centroids. S2. Perform structural feature recognition on the building feature point cloud to distinguish the point cloud subsets belonging to the building roof, facade walls and facade attachments; S3. For the building roof point cloud subset, project the building roof point cloud subset onto a preset horizontal plane to form a two-dimensional projection point set. Detect its outer closed boundary based on the two-dimensional projection point set as a horizontal projection contour. Identify the main extension direction of the horizontal projection contour within the horizontal plane as the main contour direction. Regularly divide the horizontal projection contour along the main contour direction to generate a two-dimensional mesh. Project the vertices of the two-dimensional mesh in reverse onto a preset three-dimensional space and combine it with the height information in the three-dimensional coordinates of the building roof point cloud subset to reconstruct the roof surface model. S4. For the subset of point clouds of the facade wall, perform a preset facade contour extraction to generate a wall surface model. S5. For the subset of the surface attachment point cloud, perform a preset attachment measurement and calculate its positioning size and protrusion depth relative to the wall surface model. S6. Integrate the roof surface model, the wall surface model, and the measurement results of each attachment to automatically generate a three-dimensional measurement model of the building.
2. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 1, characterized in that: In step S1, the overall point cloud data of the building is obtained by scanning the target building with a preset scanning device to obtain a point cloud dataset containing the surface three-dimensional coordinate information of the target building.
3. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 2, characterized in that: The method for dividing the voxel units in step S1 is as follows: S101. Based on the input point cloud data of the building, calculate its spatial distribution range, determine the minimum and maximum coordinates of the point cloud data of the building in the X, Y, and Z axes of the preset three-dimensional rectangular coordinate system, and construct an axial three-dimensional bounding box that completely surrounds the point cloud data of the building. The length, width, and height of the axial three-dimensional bounding box are determined by the difference between the maximum and minimum values of the point cloud data of the building in the coordinate axis directions of the preset three-dimensional rectangular coordinate system. S102. Based on the preset initial voxel size, the axial three-dimensional bounding box is divided into equal intervals along the X, Y, and Z coordinate axes to generate a series of regularly arranged initial cubic mesh units. If an initial cubic mesh unit contains at least one laser point from the overall point cloud data of the building, the initial cubic mesh unit is marked as a non-empty voxel unit. If an initial cubic mesh unit does not contain any laser points from the overall point cloud data of the building, the initial cubic mesh unit is marked as an empty voxel unit. The steps for constructing the building feature point cloud are as follows: S103. For the marked non-empty voxel unit, calculate the arithmetic mean of the spatial coordinates of all the laser points contained within it, and use it as the centroid coordinates of the non-empty voxel unit. The centroids of all the non-empty voxel units constitute the downsampled building feature point cloud.
4. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 3, characterized in that: The specific steps for structural feature recognition of the building feature point cloud in step S2 are as follows: S201. Perform a preset region growth on the building feature point cloud to identify all potential planar structures in the building feature point cloud. The region growth uses each centroid point in the building feature point cloud as a growth seed point. For each centroid point of the growth seed point, within a spatial range centered on the centroid point and bounded by a preset neighborhood radius, select all other centroid points falling within the spatial range from the building feature point cloud to form a local point set. Based on the spatial coordinate distribution of the local point set, calculate the normal vector and curvature value of the centroid point of the growth seed point. Determine that adjacent centroid points whose angle between the normal vectors is less than a preset angle threshold and whose curvature value is less than a preset curvature threshold belong to the same potential plane. Merge adjacent centroid points belonging to the same potential plane into the same temporary point cloud group initialized by the growth seed point until no new centroid points meet the merging conditions. Define each temporary point cloud group as a candidate planar point cloud patch. S202. For each candidate planar point cloud patch, calculate its best-fit plane equation, and define the geometric plane represented by the best-fit plane equation as the reference plane of the candidate planar point cloud patch. Calculate the angle between the normal vector of the reference plane and a preset global direction vector. Based on the size of the angle, classify the candidate planar point cloud patches into horizontal plane family, vertical plane family, and inclined plane family. The candidate planar point cloud patches with an angle less than a first preset angle threshold are classified into the horizontal plane family, the candidate planar point cloud patches with an angle greater than a second preset angle threshold are classified into the vertical plane family, and the candidate planar point cloud patches with an angle between the first preset angle threshold and the second preset angle threshold are classified into the inclined plane family. S203. Based on the classified candidate planar point cloud patches, they are identified as point cloud subsets of building roofs, facade walls, and facade attachments, respectively. Specifically, in the preset three-dimensional rectangular coordinate system of the overall building point cloud data, candidate planar point cloud patches with Z coordinate values greater than a preset height threshold are selected, and the candidate planar point cloud patches of the horizontal plane family or the inclined plane family whose area calculation values reach or exceed a preset roof area priority threshold are identified as the building roof point cloud subset; the candidate planar point cloud patches of the vertical plane family whose difference between the angle between the normal vector and the global direction vector and 90 degrees is less than a preset vertical tolerance and whose area calculation values are greater than a preset area threshold are selected and identified as the facade wall point cloud subset. From all candidate planar point cloud patches, remove the portions that have been identified as the roof point cloud subset and the facade wall point cloud subset of the building, and obtain the remaining candidate planar point cloud patches. Calculate the spatial Euclidean distance between the remaining candidate planar point cloud patches and the identified facade wall point cloud subsets. Identify the candidate planar point cloud patches whose spatial Euclidean distance is less than a preset attachment distance threshold and whose calculated area does not exceed a preset upper limit threshold for attachment area as the facade attachment point cloud subset.
5. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 4, characterized in that: The calculation steps for the best-fit plane equation in step S202 are as follows: S2021. Randomly select three non-collinear centroids from the candidate planar point cloud to be calculated to form a random three-point combination. Calculate a set of planar parameters based on the spatial coordinates of the random three-point combination as candidate planar parameters. The candidate planar parameters include a planar normal vector and a constant term. Based on the candidate planar parameters, a plane can be uniquely determined and defined as a temporary plane. S2022. Based on the candidate plane parameters corresponding to the temporary plane, calculate the vertical distance from each centroid point in the candidate plane point cloud to the temporary plane, and include all centroid points whose vertical distance is less than a preset distance threshold into the temporary inner point set corresponding to this calculation, and count the number of centroid points contained in the temporary inner point set. S2023. Repeat steps S2021 to S2022 until the preset number of iterations is reached. From the set of temporary interior points obtained from all iterative calculations, select the temporary interior point set that contains the first number of centroid points as the final interior point set. S2024. Based on the spatial coordinates of all the centroids contained in the final interior point set, calculate their covariance matrix, and perform eigenvalue decomposition on the covariance matrix. Take the unit eigenvector corresponding to the smallest eigenvalue as the normal vector of the best-fitting plane equation, substitute the average coordinates of all the centroids in the final interior point set into the plane equation determined by the normal vector, solve the constant term, and obtain the best-fitting plane equation of the candidate plane point cloud.
6. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 5, characterized in that: The method for generating the two-dimensional mesh in step S3 is as follows: S301. A local two-dimensional coordinate system is established with the geometric center of the horizontal projection contour as the origin, the main direction of the contour as the positive X-axis, and the direction perpendicular to the main direction of the contour and in the horizontal plane as the positive Y-axis. S302. In the local two-dimensional coordinate system, along the X-axis and Y-axis directions, the minimum bounding rectangle of the horizontal projection contour is divided at equal intervals according to the preset grid size parameters to generate an initial two-dimensional grid covering the horizontal projection contour. S303. For each grid cell of the initial two-dimensional grid, determine whether its center point or vertex is located inside the horizontal projection contour, retain all grid cells whose center point or vertex is located inside the horizontal projection contour, remove grid cells located outside, and integrate the retained grid cells to form a regularized two-dimensional grid. The reconstruction steps of the roof surface model in step S3 are as follows: S304. The two-dimensional coordinates of each vertex of the two-dimensional mesh in the local two-dimensional coordinate system are combined with the weighted average of the laser point height values corresponding to the projection positions of the vertex in the cloud subset of the building roof points and converted into coordinates in a preset three-dimensional rectangular coordinate system to generate a spatial mesh point set as the basic geometric framework of the roof surface model. S305. Using each grid cell of the spatial grid point set as the basic processing unit, fit the four vertices of each grid cell into a spatial plane patch. For each spatial plane patch, compare it with all laser points whose projection positions in the building roof point cloud subset fall within the boundary range of the grid cell. Calculate the height error of the laser points to the spatial plane patch. If the average height error of all laser points in the grid cell exceeds a preset tolerance, or the height change rate of the laser points in the grid cell exceeds a preset curvature threshold, then subdivide the grid cell into four sub-units, and generate vertices for each new sub-unit based on the elevation information of the spatial grid point set, and refit the plane patch. This process is iterated until the average height error of all the finally generated planar pieces and the laser points in their corresponding grid areas is less than the preset tolerance; finally, based on the inherent adjacency relationship of the grid cells, all the planar pieces are spliced together at their shared edges to form a roof surface model.
7. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 6, characterized in that: The specific content of generating the wall surface model in step S4 is as follows: Project the subset of the wall point cloud onto its corresponding best-fit plane to generate a two-dimensional projection point set; in the two-dimensional coordinate system formed by the best-fit plane, perform line segment detection and connection on the two-dimensional projection point set to form a closed facade contour polygon; map the facade contour polygon back to the preset three-dimensional rectangular coordinate system, and perform geometric alignment with the boundary of the roof surface model to generate the wall surface model. The method for forming the polygonal outline of the facade is as follows: S401. Construct a triangular mesh for the two-dimensional projection point set to generate a triangular mesh structure composed of multiple interconnected triangular facets, each of which consists of three projection points. S402. Based on the triangular mesh structure, extract all edge segments shared by only one triangular facet as candidate boundary segments. Sort and connect the candidate boundary segments according to the spatial distance between the endpoints of the candidate boundary segments and the preset directional consistency threshold to form a continuous and closed loop polygon. Optimize and adjust the vertices of the loop polygon to generate a closed facade outline polygon.
8. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 7, characterized in that: The specific content of performing the preset attachment measurement in step S5 is as follows: based on the spatial distribution and density characteristics of the attachment point cloud in the attachment point cloud subset of the facade, it is classified into balcony, window opening or external equipment type. For a single attachment point cloud subset in each category, its minimum bounding box is calculated as the measurement bounding box of the attachment, and the key corner coordinates of the measurement bounding box are extracted. The calculation method for the positioning dimensions and protrusion depth of the key corner point coordinates relative to the wall surface model is as follows: S501. For each key corner point of the measurement bounding box, calculate the shortest vertical distance vector from it to the wall surface model. The direction of the shortest vertical distance vector is from the key corner point to the nearest projection point on the wall surface model. The length of the shortest vertical distance vector is recorded as the initial protrusion depth of the key corner point. At the same time, the coordinates of the projection point of the key corner point on the wall surface model are converted into two-dimensional coordinates in the local two-dimensional coordinate system of the wall surface model to obtain the initial positioning coordinates of the key corner point. S502. Based on the initial protrusion depth and initial positioning coordinates of all the key corner points, calculate the overall positioning dimensions and overall protrusion depth of the measurement bounding box. Specifically, extract the projection points of all the key corner points on the wall surface model, calculate the minimum bounding rectangle of the projection polygon formed by the projection points, take the center point coordinates of the minimum bounding rectangle as the overall positioning center, and take the length and width of the minimum bounding rectangle as the positioning dimensions; at the same time, take the maximum value of the initial protrusion depth of all the key corner points as the protrusion depth of the attachment, and generate a measurement result that includes the positioning dimensions and protrusion depth.
9. The method for automatically performing spatial measurement of buildings based on point cloud data according to claim 8, characterized in that: The specific content of step S6 is as follows: Based on the spatial boundary of the roof surface model, the facade outline of the wall surface model, and the positioning dimensions and protrusion depths in the measurement results of each attachment, the bottom edge of the roof surface model is geometrically aligned with the top boundary of the wall surface model. Then, according to the positioning dimensions and protrusion depths of each attachment relative to the wall surface model in the measurement results, each attachment is assembled to its corresponding spatial position on the wall surface model, forming a complete three-dimensional geometric framework of the building, including the roof, walls, and attachments. The geometric parameters of the roof surface model, the facade dimensions of the wall surface model, and the positioning dimensions and protrusion depths in the measurement results of each attachment are used as attribute information and associated with the corresponding components of the complete three-dimensional geometric framework of the building to generate a three-dimensional measurement model of the building.
Citation Information
Cited By
A method of mapping three-dimensional ultrasound data of a c-shaped object
CN122222806A