Building group contour automatic generation method based on TLS point cloud
Through the TLS point cloud method, a 3D laser scanner is used to obtain point cloud data and combined with Gaussian blur and Hough transform to automatically generate the outline of the building complex. This solves the problems of low efficiency, low precision and environmental limitations of traditional methods, and realizes fast and accurate extraction of building wall lines.
Patent Information
- Application Number
- CN202510776306.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-09
AI Technical Summary
The existing technology for extracting building contours is inefficient, low-precision, and subject to environmental constraints. Traditional manual surveying methods are time-consuming, costly, subject to large measurement errors, and pose safety risks in dangerous environments.
A TLS point cloud method is used to obtain point cloud data through a 3D laser scanner, and point cloud registration, downsampling, denoising, cropping and projection are performed. Combined with Gaussian blur, Canny edge detection and Hough transform, the automatic generation of building complex outlines is achieved.
It achieves fast and accurate extraction of building wall lines, is suitable for complex environments, improves extraction efficiency and accuracy, and reduces the safety risks of manual operation.
Smart Images

Figure CN120612340A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision and three-dimensional reconstruction, and in particular to a method for automatically generating building complex outlines based on TLS point clouds. Background Art
[0002] Building outlines play a crucial role in geographic information acquisition, 3D building generation, structural identification and inspection, and military simulation. Traditional methods for extracting wall lines from existing building complexes primarily involve field visits and manual measurements of building dimensions, using tools like tape measures and levels, and then creating floor plans using specialized drafting software. While reliable, this traditional method suffers from several drawbacks:
[0003] (1) Inefficiency: Manual surveying is often time-consuming, especially when it comes to large building complexes. It is often inefficient, costly, and requires high operator skills. Using the acquired dimensional information, the existing manual drawing method is time-consuming.
[0004] (2) Low accuracy: Traditional manual surveying methods cannot achieve high accuracy, especially in complex building environments, where measurement errors are large.
[0005] (3) Environmental limitations: Some areas are difficult to survey manually due to terrain or other environmental factors. Manual surveying in certain hazardous environments poses safety risks. Summary of the Invention
[0006] The purpose of this invention is to solve the problems of low efficiency, low precision and environmental limitations of existing technologies, and to achieve fast and accurate building wall line extraction, thereby providing a method for automatically generating building complex outlines based on TLS point clouds.
[0007] The purpose of the present invention can be achieved by the following technical solutions:
[0008] A method for automatically generating building group outlines based on TLS point cloud, the method comprising the following steps:
[0009] S1. Obtain point cloud data of buildings at different site locations, perform point cloud registration on the point cloud data, and obtain a complete point cloud model of the building complex;
[0010] S2. Downsampling, denoising, and cropping the complete point cloud model to obtain a preprocessed complete point cloud model;
[0011] S3, slicing the complete point cloud model after preprocessing, and intercepting the middle segment point cloud;
[0012] S4, performing point cloud projection on the middle segment point cloud to obtain a projected two-dimensional plane;
[0013] S5, dividing the projected two-dimensional plane into a grid, then converting it into a grayscale image and performing a binarization process;
[0014] S6. Perform Gaussian blur, Canny edge detection, and Hough transform on the binarized grayscale image to obtain the point cloud contour.
[0015] Furthermore, when acquiring point cloud data at different site locations,
[0016] Different site locations include all visible surfaces of the building, and ensure that there is at least one plane overlap between two consecutive sites.
[0017] Furthermore, downsampling is specifically as follows:
[0018] The complete point cloud model is voxelized in three dimensions, and then a point is extracted from each voxel, which satisfies the center point or is closest to the center point. This point is used as the sampling point of the voxel, and all sampling points are integrated as the downsampled point cloud.
[0019] Furthermore, the specific steps of S4 are: computing the point cloud coordinates after projection of the middle segment point cloud, and obtaining a projected two-dimensional plane based on the projected point cloud coordinates.
[0020] Furthermore, the specific steps for calculating the point cloud coordinates after cloud projection of the middle segment point cloud are as follows:
[0021] Assuming the equation of the fitting plane, assuming that the three-dimensional space coordinates of the middle segment point cloud that is not on the plane are (x0, y0, z0), and the coordinates of its projection point on the plane are (x t ,y t , z t ), construct constraints, and substitute the constraints into the equation of the fitting plane. Substitute the obtained equation into the constraints to obtain the projected point cloud coordinates.
[0022] Furthermore, the equation of the fitting plane is:
[0023] A·x+B·y+C·z=D
[0024] Where A, B, C, and D are the plane parameters, and x, y, and z are the plane coordinates.
[0025] Furthermore, the constraints are:
[0026]
[0027] Furthermore, the equation obtained is:
[0028]
[0029] Furthermore, the specific steps of dividing the projected two-dimensional plane into a grid and then converting it into a grayscale image are as follows:
[0030] The two-dimensional plane is divided into grids of equal size. For each grid, a grayscale value is calculated according to the density of the points in it, and each grid is converted into a grayscale image composed of corresponding grayscale values.
[0031] Furthermore, the binarized grayscale image is processed by Gaussian blur, Canny edge detection and Hough transform to obtain the point cloud contour. The specific steps are as follows:
[0032] Gaussian blur is performed on the binarized grayscale image, and the Canny algorithm is used to detect edges of the blurred image to generate an edge map. Double threshold detection is performed, and two thresholds are applied to determine strong edges, weak edges, and non-edges. The strong edge and the weak edge connected to the strong edge are taken as the final edge. Hough transform is applied to the final edge to extract the straight line and obtain the point cloud contour.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] This method uses a 3D laser scanner to acquire point cloud data, enabling non-contact, precise measurement of even complex structures and shapes, capturing large amounts of point cloud data in a very short time. Furthermore, by integrating Gaussian blur, Canny edge detection, and Hough transform, linear fitting is performed on binary images, enabling the automatic generation of high-precision building contour maps through programming. This method addresses the inaccurate and inefficient building contour extraction issues encountered in existing technologies and is suitable for widespread adoption. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 is a flow chart of the method of the present invention;
[0036] Figure 2 This is a schematic diagram of the initial point cloud model of the building complex of the present invention;
[0037] Figure 3 It is a schematic diagram of the result of horizontal slicing of the point cloud according to the present invention;
[0038] Figure 4 This is a schematic diagram of the result of projecting the point cloud according to the present invention;
[0039] Figure 5 This is a schematic diagram of the result of converting a point cloud into a binary image in the present invention;
[0040] Figure 6 2 is a schematic diagram of the wall line extraction result of the present invention. DETAILED DESCRIPTION
[0041] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0042] In the present invention, Figure 1 is a flow chart of the method of the present invention; Figure 2 This is a schematic diagram of the initial point cloud model of the building complex of the present invention; Figure 3 It is a schematic diagram of the result of horizontal slicing of the point cloud according to the present invention; Figure 4 This is a schematic diagram of the result of projecting the point cloud according to the present invention; Figure 5 This is a schematic diagram of the result of converting a point cloud into a binary image in the present invention; Figure 6 2 is a schematic diagram of the wall line extraction result of the present invention.
[0043] The present invention proposes a method for automatically generating building group outlines based on TLS point cloud, the method comprising the following steps:
[0044] S1. Obtain point cloud data of buildings at different site locations, perform point cloud registration on the point cloud data, and obtain a complete point cloud model of the building complex;
[0045] S2. Downsampling, denoising, and cropping the complete point cloud model to obtain a preprocessed complete point cloud model;
[0046] S3, slicing the complete point cloud model after preprocessing, and intercepting the middle segment point cloud;
[0047] S4, performing point cloud projection on the middle segment point cloud to obtain a projected two-dimensional plane;
[0048] S5, dividing the projected two-dimensional plane into a grid, then converting it into a grayscale image and performing a binarization process;
[0049] S6. Perform Gaussian blur, Canny edge detection, and Hough transform on the binarized grayscale image to obtain the point cloud contour.
[0050] In step S1, a multi-site 3D laser scanner is used to acquire point cloud data. During scanning, there needs to be at least one plane overlap between two consecutive sites to facilitate subsequent point cloud registration and splicing.
[0051] In step S2, the pre-processing downsampling of the point cloud includes voxel grid downsampling method, random downsampling method, nearest neighbor downsampling method, and uniform downsampling method. The pre-processing denoising of the point cloud includes statistical filtering method, radius filtering method, and voxel filtering method.
[0052] In step S3, in order to display the outline of the building, a section at the middle height of the three-dimensional building point cloud model is intercepted.
[0053] In step S4, the point cloud is projected onto the fitting plane, that is, onto the same horizontal plane as the point cloud coordinate system.
[0054] Assume that the equation of the fitted plane is:
[0055] A·x+B·y+C·z=D (1)
[0056] Assume that the three-dimensional space coordinates not on the plane are (x0, y0, z0), and the coordinates of its projection point on the plane are (x t ,y t , z t ). Because the projection point to the current point is perpendicular to the plane, according to the vertical constraint, y t and z t and meet the following conditions:
[0057]
[0058] Substituting equations (2) and (3) into equation (1), we can obtain:
[0059]
[0060] Substituting formula (4) into formula (2) and formula (3), we can obtain:
[0061]
[0062] The coordinates (x t ,y t , z t ).
[0063] The projected two-dimensional plane is divided into grids of equal size. For each grid, a grayscale value is calculated based on the density of points within it, and each grid is converted into a pixel in the grayscale image. Finally, the grayscale image is binarized by setting a threshold. Pixels above the threshold are set to 1 (or 255, representing white), and pixels below the threshold are set to 0 (representing black).
[0064] In step S6, Gaussian blur is applied to the original binary image to smooth the image and reduce noise; the Canny algorithm is used to perform edge detection on the blurred image to generate an edge map; and Hough transform is applied to the result after Canny edge detection to extract straight lines in the image.
[0065] In step S1, point cloud registration and stitching methods include nearest neighbor matching, iterative closest point algorithm, feature-based registration method, global registration method, and multi-view registration.
[0066] The purpose of this invention is to overcome the shortcomings of traditional technology and provide a point cloud-based automatic extraction method for building wall lines, so as to solve the problems of low efficiency, low precision and environmental limitations of existing technologies and realize fast and accurate building wall line extraction.
[0067] Specifically, the present invention uses a terrestrial 3D laser scanner to collect point cloud data of the building complex. During scanning, the site locations must encompass all visible surfaces, and there must be at least one plane overlap between two consecutive sites. After scanning, all site data is point cloud-registered to obtain a complete point cloud model of the building complex.
[0068] Point cloud registration is primarily divided into two phases: coarse registration and fine registration. First, the morphological characteristics of the objects in different scenes are used to establish matching correspondences between point clouds (coarse registration). Then, based on this coarse registration, the spatial position differences between point clouds are minimized (fine registration). Because houses have many flat surfaces, such as walls, floors, and ceilings, this paper employs an iterative nearest neighbor fine registration algorithm.
[0069] Step S2: Perform preprocessing such as downsampling, denoising, and cropping on the entire point cloud.
[0070] The amount of data in the spliced building point cloud model is often large, and direct processing requires a high computational cost. Therefore, the present invention downsamples the original data in preprocessing to improve data processing efficiency. Noise points will inevitably appear during the scanning process of the laser radar, so the point cloud is subjected to noise reduction processing to avoid the impact of noise points on subsequent processing. By cropping the point cloud to remove irrelevant or unnecessary parts, the amount of data can be reduced, thereby improving processing speed and efficiency.
[0071] Specifically, the downsampling method of the point cloud includes a voxel grid downsampling method, a random downsampling method, a nearest neighbor downsampling method, and a uniform downsampling method. The present invention adopts a voxel downsampling method. Voxel downsampling is the process of voxelizing the three-dimensional space and then extracting a point in each voxel. First, the size of the voxel is determined. The voxel can be regarded as a small cube in the three-dimensional space, and its size determines the accuracy of the downsampling. Each voxel contains several points, and the center point or the point closest to the center point is used as the sampling point. After processing all voxels, the downsampled point cloud is obtained. The number of points in the downsampled point cloud is smaller, but the shape and structure of the original point cloud are better preserved.
[0072] Point cloud denoising methods include statistical filtering method, radius filtering method, and voxel filtering method.
[0073] Point cloud clipping can filter out points in the point cloud that exceed the limit by setting coordinate limits.
[0074] Step S3: Horizontally slice the pre-processed data and intercept a section at the middle height of the 3D building point cloud model by setting coordinate limits to reflect the outline of the building.
[0075] Step S4: Project the point cloud onto the fitting plane, that is, the same horizontal plane as the point cloud coordinate system.
[0076] Specifically, first calculate the projected point cloud coordinates, and then use the numpy library in python to generate the projected point cloud.
[0077] The specific steps for calculating the point cloud coordinates after projection are:
[0078] Assume that the equation of the fitted plane is:
[0079] A·x+B·y+C·z=D (1)
[0080] Assume that the three-dimensional space coordinates not on the plane are (x0, y0, z0), and the coordinates of its projection point on the plane are (x t ,y t , z t ). Because the projection point to the current point is perpendicular to the plane, according to the vertical constraint, y t and z t and meet the following conditions:
[0081]
[0082] Substituting equations (2) and (3) into equation (1), we can obtain:
[0083]
[0084] Substituting formula (4) into formula (2) and formula (3), we can obtain:
[0085]
[0086] The coordinates (x t ,y t , z t ).
[0087] Step S5: Divide the projected plane point cloud into a grid, convert it into a grayscale image, and perform binarization processing.
[0088] Specifically, the projected two-dimensional plane is divided into grids of equal size. For each grid, a grayscale value is calculated based on the density of points within it, and each grid is converted into a pixel in the grayscale image. Finally, the grayscale image is binarized, and a threshold is set. Pixels above the threshold are set to 1 (or 255, representing white), and pixels below the threshold are set to 0 (representing black).
[0089] Step S6: Fuse Gaussian blur, Canny edge detection, and Hough transform to perform straight line fitting on the binary image.
[0090] First, a Gaussian blur is applied to the original binary image to smooth the image and reduce noise. Using a Gaussian function as a weight, a weighted average is performed on each pixel and its neighborhood. Gaussian blur takes into account the distance of a pixel's neighborhood, with pixels at the center of the neighborhood receiving the highest weight, while pixels further from the center receive smaller weights. Applying a Gaussian blur before edge detection effectively reduces the impact of image noise, resulting in more accurate edge detection.
[0091] Use the Canny algorithm to detect edges in the blurred image and generate an edge map. Use the Sobel operator or other methods to calculate the image's gradient strength and direction. Retain local maxima in gradient strength and remove all other points to ensure edge refinement. Then, perform dual-threshold detection, applying two thresholds to determine strong edges, weak edges, and non-edges. The final edge is determined by tracing and connecting strong edges and their associated weak edges.
[0092] Apply the Hough transform to the results of Canny edge detection to extract straight lines in the image. Each point in image space corresponds to a curve in Hough space. The intersection of these curves indicates the presence of a straight line in the image space. The points in image space are converted to Hough space, and the lines are detected by counting the cumulative number of intersections. A straight line is typically parameterized as ρ = xcosθ + ysinθ, where ρ is the distance from the origin to the line and θ is the direction angle of the line.
[0093] In the programming implementation, we used the direct functions and methods for Gaussian blur, Canny edge detection, and Hough transform provided by the Python OpenCV library to simply and efficiently implement the entire process. By adjusting the parameters in each step, such as the size of the Gaussian kernel, the threshold of the Canny algorithm, and the threshold of the Hough transform, we optimized the line detection effect.
[0094] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.
Claims
1. A method for automatically generating building group outlines based on TLS point cloud, characterized in that: The method comprises the following steps: S1. Obtain point cloud data of buildings at different site locations, perform point cloud registration on the point cloud data, and obtain a complete point cloud model of the building complex; S2. Downsampling, denoising, and cropping the complete point cloud model to obtain a preprocessed complete point cloud model; S3, slicing the complete point cloud model after preprocessing, and intercepting the middle segment point cloud; S4, performing point cloud projection on the middle segment point cloud to obtain a projected two-dimensional plane; S5, dividing the projected two-dimensional plane into a grid, then converting it into a grayscale image and performing a binarization process; S6. Perform Gaussian blur, Canny edge detection, and Hough transform on the binarized grayscale image to obtain the point cloud contour.
2. The method for automatically generating building group outlines based on TLS point cloud according to claim 1, characterized in that: When acquiring point cloud data at different site locations, Different site locations include all visible surfaces of the building, and ensure that there is at least one plane overlap between two consecutive sites.
3. The method for automatically generating building group outlines based on TLS point cloud according to claim 1, characterized in that: Downsampling is specifically: The complete point cloud model is voxelized in three dimensions, and then a point is extracted from each voxel, which satisfies the center point or is closest to the center point. This point is used as the sampling point of the voxel, and all sampling points are integrated as the downsampled point cloud.
4. The method for automatically generating building group outlines based on TLS point cloud according to claim 1, characterized in that: The specific steps of S4 are: computing the point cloud coordinates after projection of the middle segment point cloud, and obtaining a projected two-dimensional plane based on the projected point cloud coordinates.
5. The method for automatically generating building complex outlines based on TLS point cloud according to claim 4, characterized in that: The specific steps for computing the point cloud coordinates after projecting the middle segment point cloud are as follows: Assuming the equation of the fitting plane, assuming that the three-dimensional space coordinates of the middle segment point cloud that is not on the plane are (x0, y0, z0), and the coordinates of its projection point on the plane are (x t ,y t , z t ), construct constraints, and substitute the constraints into the equation of the fitting plane. Substitute the obtained equation into the constraints to obtain the projected point cloud coordinates.
6. The method for automatically generating building group outlines based on TLS point cloud according to claim 5, characterized in that: The equation of the fitted plane is: A·x+B·y+C·z=D Where A, B, C, and D are the plane parameters, and x, y, and z are the plane coordinates.
7. The method for automatically generating building group outlines based on TLS point cloud according to claim 6, characterized in that: The constraints are:
8. The method for automatically generating building group outlines based on TLS point cloud according to claim 7, characterized in that: The resulting equation is:
9. The method for automatically generating building group outlines based on TLS point cloud according to claim 1, characterized in that: The specific steps of dividing the projected two-dimensional plane into a grid and then converting it into a grayscale image are as follows: The two-dimensional plane is divided into grids of equal size. For each grid, a grayscale value is calculated according to the density of the points in it, and each grid is converted into a grayscale image composed of corresponding grayscale values.
10. The method for automatically generating building group outlines based on TLS point cloud according to claim 1, characterized in that: The specific steps of performing Gaussian blur, Canny edge detection and Hough transform on the binary grayscale image to obtain the point cloud contour are as follows: Gaussian blur is performed on the binarized grayscale image, and the Canny algorithm is used to detect edges of the blurred image to generate an edge map. Double threshold detection is performed, and two thresholds are applied to determine strong edges, weak edges, and non-edges. The strong edge and the weak edge connected to the strong edge are taken as the final edge. Hough transform is applied to the final edge to extract the straight line and obtain the point cloud contour.