Historical and cultural block building point cloud monomer segmentation method, system, equipment and medium
By combining the self-attention mechanism and normal area growth algorithm, the problem of errors in building segmentation in historical and cultural blocks is solved, and a more refined monomer segmentation effect is achieved, improving the accuracy of building edge recognition.
Patent Information
- Application Number
- CN202510140863.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-07-04
AI Technical Summary
The existing building point cloud segmentation method has problems of segmentation errors and identification errors in historical and cultural blocks, especially when the space distance between buildings is small and there are special structures such as eaves and brackets, it is difficult to achieve fine single segmentation.
A semantic classification model based on self-attention mechanism combined with a normal region growth algorithm is adopted. By calculating local geometric features and scene features, building point clouds are extracted, and cross-domain rasterization processing and visual segmentation are performed to generate building edge information enhancement images, and finally achieve fine monomer segmentation.
It improves the accuracy of monomer segmentation of point clouds in buildings in historical and cultural blocks, and can obtain more accurate monomer segmentation results in dense buildings, enhancing the accuracy of identification of building structure edges.
Smart Images

Figure CN120259643A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of building point cloud single - body segmentation, and in particular to a method, system, device and medium for building point cloud single - body segmentation in historical and cultural blocks. Background Technique
[0002] In the process of protecting historical and cultural blocks, three - dimensional model technology plays a crucial role. Traditional three - dimensional modeling methods rely on manual drawing of the outlines of individual buildings on orthophoto maps (DOM) and manual sketching in 3D modeling software combined with point cloud data to generate models. This process is costly and time - consuming.
[0003] Currently, existing building single - body point cloud segmentation methods are divided into two categories. One category first calculates the local features of each point in the scene point cloud, then uses machine learning and deep learning methods to obtain the building category, and finally uses methods based on spatial distance clustering such as Euclidean distance clustering and density clustering to segment the building point cloud into single - bodies to obtain the building single - body results; the other category designs a neural network structure in an end - to - end manner and realizes building single - body point cloud segmentation through object recognition. However, existing building single - body point cloud segmentation methods only consider local features of the point cloud, which will cause incorrect point cloud classification results. In addition, in the dense building scenes of historical and cultural blocks, the spatial distance between buildings is small, and buildings often have special structures such as overhanging eaves and brackets. The above - mentioned methods based on spatial distance clustering and object recognition are prone to misidentifying multiple buildings as the same building, losing or misidentifying special structures such as overhanging eaves, and cannot achieve fine building point cloud single - body segmentation in historical and cultural blocks. Summary of the Invention
[0004] The purpose of the present invention is to provide a method, system, device and medium for building point cloud single - body segmentation in historical and cultural blocks, which can achieve more fine - grained building point cloud single - body segmentation for the building point cloud in historical and cultural blocks and improve the accuracy of building point cloud single - body segmentation in historical and cultural blocks.
[0005] To achieve the above purpose, an embodiment of the present invention provides a method for building point cloud single - body segmentation in historical and cultural blocks, including:
[0006] Collect the building point cloud data of the historical and cultural block to obtain the first building point cloud;
[0007] Calculate local geometric features and scene features based on the first building point cloud;
[0008] Use the local geometric features and the scene features as the input of a semantic classification model based on the self - attention mechanism to extract the third building point cloud;
[0009] Process the third building point cloud using a normal-based region growing algorithm to obtain the building edge point cloud;
[0010] Perform cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate an enhanced image of the building edge information from a top-down perspective;
[0011] Use a visual segmentation model to segment the enhanced image of the building edge information to obtain multiple image segmentation results, and obtain the building single-point cloud corresponding to each image segmentation result according to the mapping relationship.
[0012] Optionally, before calculating the local geometric features and scene features based on the first building point cloud, the method further includes:
[0013] Based on the spatial distance distribution of adjacent points of each point in the first building point cloud, use a statistical filtering method to remove the outlier points contained in the first building point cloud to obtain the second building point cloud.
[0014] Optionally, calculating the local geometric features and scene features based on the second building point cloud includes:
[0015] Respectively select spherical neighborhoods corresponding to the radius lengths, and calculate the planarity local feature, sphericity local feature, and perpendicularity local feature of each point in the second building point cloud;
[0016] Use a cloth simulation algorithm to obtain the ground points, and calculate the elevation difference between each point in the second building point cloud and the ground point closest to the corresponding point as the scene feature.
[0017] Optionally, the process of using a normal-based region growing algorithm to process the third building point cloud to obtain the building edge point cloud includes:
[0018] Calculate the normal and curvature of each point in the third building point cloud;
[0019] Take the point with the lowest curvature as the initial seed point;
[0020] Search for the neighborhood points of the current seed point, calculate the angle between the normal of the neighborhood point and the normal of the current seed point, and add the neighborhood points with an angle less than the preset normal angle threshold to the current region;
[0021] Check the curvature of each neighborhood point, add the neighborhood points with a curvature less than the preset curvature threshold to the seed point sequence, and delete the current seed point;
[0022] Take the points that meet both the normal angle threshold and the curvature threshold as new seed points, continue growing with the new seed points until the seed point sequence is emptied, and classify all the points in the current region;
[0023] When all points are traversed, the points that have not been classified are used as building edge points.
[0024] Optionally, performing cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate an enhanced image of building edge information from a top-down perspective, including:
[0025] Projecting the third building point cloud and the building edge point cloud onto a two-dimensional plane for raster division, and constructing a point cloud index corresponding to each raster;
[0026] According to the point cloud index corresponding to each raster and the relative average height feature of the building points within each raster, assigning color information to the raster to generate an enhanced image of building edge information from a top-down perspective.
[0027] Further, the enhanced image of building edge information is generated by the following formula:
[0028]
[0029] where Image(u, v) represents the generated enhanced image of building edge information, grid(u, v) represents the point cloud index corresponding to each raster, u and v respectively represent the index values of the raster in the x and y coordinate directions, P edge represents the building edge point cloud, i represents the i-th building point cloud, grid_n is the number of building point clouds included in grid(u, v), and relative_evelation i is the relative average height feature of all building point clouds included in grid(u, v).
[0030] Optionally, after obtaining the building single-point cloud corresponding to each image segmentation result according to the mapping relationship, the method further includes:
[0031] When there is an intersection between two image segmentation results, merging the two image segmentation results and merging the corresponding obtained building single-point clouds to obtain a single-point segmentation result of the historical and cultural block building point cloud.
[0032] To achieve the above object, an embodiment of the present invention further provides a system for single-point segmentation of historical and cultural block building point clouds, including:
[0033] A building point cloud acquisition module, configured to acquire building point cloud data of a historical and cultural block to obtain a first building point cloud;
[0034] A feature calculation module, configured to calculate local geometric features and scene features based on the first building point cloud;
[0035] A building point cloud extraction module, configured to use the local geometric features and the scene features as inputs to a semantic classification model based on a self-attention mechanism, and extract a third building point cloud;
[0036] A building edge point cloud extraction module, which processes the third building point cloud by using a region growing algorithm based on normals to obtain a building edge point cloud;
[0037] A building edge information enhanced image generation module, configured to perform cross-domain rasterization processing on the third building point cloud and the building edge point cloud, enhance the building structure edge, and generate a building edge information enhanced image from a top-down perspective;
[0038] A building point cloud single entity segmentation module, configured to segment the building edge information enhanced image by using a visual segmentation model to obtain a plurality of image segmentation results, and obtain the building single entity point cloud corresponding to each of the image segmentation results according to the mapping relationship.
[0039] To achieve the above object, an embodiment of the present invention further provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the historical and cultural block building point cloud single entity segmentation method described in any one of the above is implemented.
[0040] To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the historical and cultural block building point cloud single entity segmentation method described in any one of the above.
[0041] Compared with the prior art, an historical and cultural block building point cloud single entity segmentation method, system, device and medium provided by an embodiment of the present invention first collects building point cloud data of an historical and cultural block to obtain a first building point cloud, then calculates local geometric features and scene features based on the first building point cloud, and uses the local geometric features and the scene features as inputs of a semantic classification model based on a self-attention mechanism to extract a third building point cloud. At the same time, a region growing algorithm based on normals is used to process the third building point cloud to obtain building edge point clouds, and then the third building point cloud and the building edge point clouds are subjected to cross-domain rasterization processing to enhance the building structure edges and generate a building edge information enhanced image from a top-down perspective. Finally, a visual segmentation model is used to segment the building edge information enhanced image to obtain a plurality of image segmentation results, and the building single entity point cloud corresponding to each image segmentation result is obtained according to a mapping relationship. The present invention can extract building point clouds by combining multi-scale features. By inputting the above features into a semantic classification model, more accurate building point clouds can be obtained. At the same time, the present invention converts three-dimensional point clouds into two-dimensional top-down images, combines point cloud normal information to enhance building edges, and then applies an image segmentation model for image segmentation to obtain building point cloud single entity segmentation results, which can achieve more refined building point cloud single entity segmentation for the building point clouds of historical and cultural blocks and obtain more accurate single entity segmentation results in dense areas such as historical and cultural block buildings. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the present invention, the drawings to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings without creative efforts based on these drawings.
[0043] Figure 1 is a flowchart of an historical and cultural block building point cloud single entity segmentation method provided by an embodiment of the present invention;
[0044] Figure 2 is another flowchart of an historical and cultural block building point cloud single entity segmentation method provided by an embodiment of the present invention;
[0045] Figure 3 is a structural block diagram of an historical and cultural block building point cloud single entity segmentation system provided by an embodiment of the present invention;
[0046] Figure 4 is a structural block diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] See Figure 1 , Figure 1 which is a flowchart of a method for segmenting individual building point clouds in a historical and cultural block provided by an embodiment of the present invention. The method for segmenting individual building point clouds in the historical and cultural block includes steps S1 to S6:
[0049] S1. Collect the building point cloud data of the historical and cultural block to obtain the first building point cloud;
[0050] Exemplarily, oblique photogrammetry, vehicle-mounted laser scanning systems, and hand-held laser scanners can be used across devices, and combined with registration technology to collect point cloud and image data that are spatially aligned covering the historical and cultural block.
[0051] S2. Calculate the local geometric features and scene features based on the first building point cloud;
[0052] In an optional embodiment, between calculating the local geometric features and scene features based on the first building point cloud, the method further includes:
[0053] Based on the spatial distance distribution of the adjacent points of each point cloud in the first building point cloud, use a statistical filtering method to remove the outlier points included in the first building point cloud to obtain a second building point cloud.
[0054] It should be noted that when obtaining point cloud data through technologies such as laser scanning, due to instrument precision limitations, environmental interference (such as dust and fog in the air), or object surface characteristics (such as high reflectivity and transparency), some noise points may be generated. The coordinate values of these noise points deviate from the true positions of the actual object surface. If they are not removed, inaccurate results will occur in subsequent measurements and analyses based on the point cloud data. Therefore, in the embodiments of the present invention, the first building point cloud is driven of noise through a statistical filtering method, that is, the obtained second building point cloud. In subsequent calculations of local features and scene features, it can be based on the second building point cloud.
[0055] Further, calculating the local geometric features and scene features based on the second building point cloud includes:
[0056] Respectively select spherical neighborhoods corresponding to the radius lengths, and calculate the planar local feature, spherical local feature, and verticality local feature of each point in the second building point cloud;
[0057] Use a cloth simulation algorithm to obtain ground points, and calculate the elevation difference between each point in the second building point cloud and the ground point closest to the corresponding point as the scene feature.
[0058] It should be noted that when calculating the local features of the point cloud, different neighborhood selection methods can be applied in combination with the characteristics of the buildings in the historical and cultural block, so that the local features of planarity, sphericity, and perpendicularity can all better separate the building point cloud from other types of point clouds;
[0059] At the same time, when calculating the scene feature, the cloth simulation algorithm can well fit the actual terrain. The obtained ground points can accurately reflect the true topography of the site. By calculating the elevation difference, topographic features such as slopes and potholes in the site can be accurately captured. And the elevation difference, as a kind of scene feature, also has strong discrimination, which can distinguish the building point cloud from the point clouds of other objects, because the elevation difference relationship between the building and the ground is usually different from that of other objects. This feature discrimination helps to more accurately extract building-related features in the data processing and analysis process, and improve the quality of building point cloud processing tasks (such as building extraction, reconstruction, etc.).
[0060] S3. Use the local geometric feature and the scene feature as the input of a semantic classification model based on the self-attention mechanism to extract the third building point cloud;
[0061] Specifically, use the spatial position information, local features of planarity, sphericity, and perpendicularity, and the scene feature of each point in the second building point cloud as the input, perform semantic classification using a semantic classification model based on the self-attention mechanism, and extract a more accurate building point cloud according to the semantic label to obtain the third building point cloud.
[0062] It should be noted that the local geometric feature can capture the geometric shape information of the building point cloud in the local area, and the scene feature reflects the relationship between the building and the surrounding environment from a more macroscopic perspective. Using these two features as the input can enable the classification model to utilize both microscopic and macroscopic information at the same time, and construct a more comprehensive and representative feature representation. For example, when classifying ancient buildings and modern buildings, the local geometric feature can help identify the differences in the structural details of the buildings, while the scene feature can reflect the environmental differences such as the traditional garden landscape around the ancient building and the modern facilities around the modern building, so as to more accurately classify the buildings. Moreover, when using only the local geometric feature or the scene feature alone, it may be affected by factors such as data noise and occlusion. In the embodiments of the present invention, combining the two can complement and correct each other to a certain extent, thereby enhancing the robustness of the overall feature.
[0063] In the embodiments of the present invention, the self-attention mechanism can automatically learn the correlation relationships between input features. By simultaneously inputting local geometric features and scene features, deeper semantic correlations between these features can be mined. For example, it can learn the semantic connection between certain local geometric shapes of a building (such as a spire) and the historical and cultural scene where the building is located (such as scene features like the gardens and bell towers around the palace). This can better understand the function and use of the building. This semantic understanding ability is crucial for accurately extracting the building point cloud and performing semantic classification on it (such as distinguishing palace buildings, religious sacrificial buildings, garden buildings, ancient cities and ancient towns, etc.).
[0064] S4. Process the third building point cloud using a normal-based region growing algorithm to obtain the building edge point cloud;
[0065] Specifically, the process of using the normal-based region growing algorithm to process the third building point cloud to obtain the building edge point cloud includes:
[0066] Calculate the normal and curvature of each point in the third building point cloud, and use the point with the lowest curvature as the initial seed point;
[0067] Search for the neighborhood points of the current seed point, calculate the angle between the normal of each neighborhood point and the normal of the current seed point. If the angle between the normal of the neighborhood point and the normal of the current seed point is less than the preset normal angle threshold, add the corresponding neighborhood point to the current region;
[0068] Check the curvature of each neighborhood point. If the curvature of the neighborhood point is less than the preset curvature threshold, add the corresponding neighborhood point to the seed point sequence and delete the current seed point;
[0069] Take the points that are simultaneously less than the preset normal angle threshold and the preset curvature threshold as new seed points, and continue growing with the new seed points until the seed point sequence is emptied, indicating that all points in the current region have been classified;
[0070] Until all points are traversed, take the unclassified points as the building edge points.
[0071] It should be noted that in the embodiments of the present invention, the region growing and classification steps are repeated for some points until all points are traversed. The unclassified points are usually points with large normal changes. In the embodiments of the present invention, these points are considered as building edge points.
[0072] It should be noted that in the embodiment of the present invention, the normal-based region growing algorithm can, to a certain extent, filter out the interference of noise points on edge extraction by analyzing the normals. Since the normal directions of noise points are usually random and quite different from the normals of surrounding normal points, they are not easily incorporated into the effective region during the region growing process, thereby improving the quality and accuracy of the edge point cloud. At the same time, by using the normal-based region growing algorithm to process the third building point cloud, it is possible to judge whether they belong to the same region by calculating the normal vector difference between adjacent points based on the normal vector information of the points in the point cloud, and can more accurately identify the edge point cloud of the building. Especially for buildings with complex shapes in historical and cultural blocks, such as those with irregular contours, curved surfaces or richly detailed structures, it can effectively overcome the problems of edge blurring or misjudgment that may occur in traditional methods, and thus accurately outline the boundary of the building.
[0073] S5. Perform cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate an enhanced image of building edge information from a top-down perspective;
[0074] In an optional embodiment, the performing cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate an enhanced image of building edge information from a top-down perspective includes:
[0075] Project the third building point cloud and the building edge point cloud onto a two-dimensional plane for grid division, and construct a point cloud index corresponding to each grid;
[0076] According to the point cloud index corresponding to each grid and the relative average height feature of the building points in each grid, assign color information to the grid to generate an enhanced image of building edge information from a top-down perspective.
[0077] Specifically, the enhanced image of building edge information is generated by the following formula:
[0078]
[0079] where Image(u, v) represents the generated enhanced image of building edge information, grid(u, v) represents the point cloud index corresponding to each grid, u and v respectively represent the index values of the grid in the x and y coordinate directions, P edge represents the building edge point cloud, i represents the i-th building point cloud, grid_n is the number of building point clouds included in grid(u, v), and relative_evelation i is the relative average height feature of all building point clouds included in grid(u, v).
[0080] Exemplarily, color information can be assigned to the grid according to the relative average height feature of the point cloud within the grid. If the grid contains building edge points, the grid is assigned red, thereby realizing edge enhancement of the building image.
[0081] It should be noted that the edge of a building is a key part of the building structure. Through rasterization processing, edge information can be highlighted, especially the edges of special structures in historical and cultural blocks will be clearer and more obvious. The top-down view can provide an overall view of the overall layout and external shape of the building, enabling people to intuitively understand information such as the location of the building in the plot, the relationship with surrounding buildings, and the occupied shape of the building itself, and facilitating comparative analysis of the edge information of different buildings. For example, the edge information enhancement images of the same ancient building in different periods can be compared to analyze the changes in the building structure, providing data support for the protection and restoration of ancient buildings.
[0082] S6. Use a visual segmentation model to segment the building edge information enhancement image to obtain multiple image segmentation results, and obtain the building single-point cloud corresponding to each image segmentation result according to the mapping relationship.
[0083] In an alternative embodiment, after obtaining the building single-point cloud corresponding to each image segmentation result according to the mapping relationship, the method for segmenting the historical and cultural block building point cloud into single entities further includes:
[0084] When there is an intersection between two image segmentation results, the two image segmentation results are merged, and the corresponding obtained building single-point clouds are merged to obtain the segmentation result of the historical and cultural block building point cloud into single entities.
[0085] Specifically, apply a visual segmentation model to perform image segmentation to obtain image segmentation results, and obtain the building single-point cloud based on the image segmentation results. Among them, the segmentation results obtained by the visual segmentation model contain pixel information, so that the point cloud corresponding to each segmentation result can be obtained based on the point cloud index included in the grid as the building single-point cloud, and it is determined whether each image segmentation result intersects with other segmentation results. If there is an intersection, the two segmentation results are merged, and the corresponding obtained building single-point clouds are merged.
[0086] In summary, for the method for single building point cloud segmentation in a historical and cultural block provided by the embodiment of the present invention, first, the building point cloud data of the historical and cultural block is collected to obtain the first building point cloud. Then, the local geometric features and scene features are calculated based on the first building point cloud, and the local geometric features and the scene features are used as the input of the semantic classification model based on the self-attention mechanism to extract the third building point cloud. At the same time, the third building point cloud is processed by using the region growing algorithm based on the normal vector to obtain the building edge point cloud. Then, the third building point cloud and the building edge point cloud are subjected to cross-domain rasterization processing to enhance the building structure edge and generate an image with enhanced building edge information from a top-down perspective. Finally, a visual segmentation model is used to segment the image with enhanced building edge information to obtain a plurality of image segmentation results, and the building single point cloud corresponding to each image segmentation result is obtained according to the mapping relationship.
[0087] In the embodiment of the present invention, by combining the characteristics of the building when calculating the local geometric features of the point cloud and applying different neighborhood selection methods, the plane, spherical, and vertical features can better separate the building point cloud from other category point clouds. The CSF method is used to obtain the elevation starting from the ground, the relative height feature is calculated, and the above features are input into the deep learning method, realizing a method for extracting building point clouds with multi-scale features, and more accurate building point clouds can be obtained. At the same time, by converting the three-dimensional point cloud into a two-dimensional top-down image and combining the point cloud normal information to enhance the building edge, an image segmentation model is applied to obtain the pixel region after instance segmentation. According to the mapping relationship between the image pixels and the point cloud, the point cloud is segmented into single buildings, and accurate single segmentation results can be obtained in areas with dense buildings. For the building point clouds in historical and cultural blocks, more refined single building point cloud segmentation can be realized, and more accurate single segmentation results can be obtained in areas with dense buildings such as historical and cultural block buildings.
[0088] To make those skilled in the art more clear about the implementation process of the present invention, the following Figure 2 will describe the steps of the method for single building point cloud segmentation in a historical and cultural block in more detail.
[0089] See Figure 2 , Figure 2 which is another flowchart of the method for single building point cloud segmentation in a historical and cultural block provided by the embodiment of the present invention. As Figure 2 shown, the method includes three major processes: building point cloud extraction, point cloud-image conversion, and single building point cloud segmentation, and specifically includes the following steps 1 to 10:
[0090] Step 1, obtain the building point cloud of the historical and cultural block:
[0091] First, we use oblique photogrammetry, vehicle-mounted laser scanning systems, handheld laser scanners and other equipment, and combine them with registration technology to obtain a complete point cloud of historical and cultural blocks, set as P raw ={p1,p2,...,p n}.
[0092] Step 2, building point cloud denoising:
[0093] Based on the acquired point cloud P raw ={p1,p2,...,p n Each point p in i (x i ,y i ,z i ) is used to calculate the spatial distance distribution of adjacent points. The statistical filtering method is used to remove the outliers contained in the point cloud to obtain the point cloud P after noise removal. denoised ={p1,p2,...,p m}.
[0094] Step 3: Calculation of local geometric features of point cloud:
[0095] P denoised ={p1,p2,...,p m Each point p contained in i The local geometric features of planarity, sphericity, and verticality are calculated separately.
[0096] Exemplarily, the local geometric features are specifically calculated as follows:
[0097] Point p i As the center, select the radius r planarity 、r sphericity and r verticality Construct a spherical neighborhood and calculate multiple covariance matrices M planarity 、M sphericity and M verticality :
[0098]
[0099] Where n is p i The total number of points in the neighborhood, q j (x j ,y j ,z j ) is p i Points in the neighborhood;
[0100] Then for M f Perform eigenvalue decomposition and obtain three eigenvalues The standard deviations along the directions of these three eigenvectors are obtained as follows:
[0101]
[0102] Furthermore, the calculation methods for the geometric features of planarity, sphericity, and perpendicularity are as follows:
[0103]
[0104] Step 4, Point cloud scene feature calculation:
[0105] For each point p denoised ={p1, p2,..., p m} contained in P, calculate the relative height from the ground as the point cloud scene feature. i (x i , y i , z i )
[0106] Exemplarily, the specific calculation method is as follows:
[0107] Apply the cloth simulation algorithm (CSF) to obtain the ground points P ground . Among the ground points, find the ground point closest to the point p i . Calculate the normalized scene feature relative_evelation through the following formula:
[0108]
[0109] In the formula, normal_evelation is the relative elevation normalization factor.
[0110] Step 5, Building point cloud extraction based on multi-scale features:
[0111] Use the position information, planarity, sphericity, perpendicularity local geometric features, and scene features of each point p denoised ={p1, p2,..., p m} in P as inputs, use a semantic classification model based on the self-attention mechanism for semantic classification, and extract the building point cloud P i according to the semantic labels. buildings .
[0112] Step 6, Enhancement of edge information of special structures of historical and cultural block buildings:
[0113] Apply the region growing algorithm based on normals to process the building point cloud P buildings to obtain the building edge point cloud P edge .
[0114] Exemplarily, the specific calculation process is as follows:
[0115] (1) For each point in P buildings calculate the normal vector normal and curvatures. Among them, the normal vector is obtained by performing eigenvalue decomposition on the covariance matrix of and taking the minimum eigenvector, and the principal curvature is estimated by the normal vectors of the points within the neighborhood.
[0116] (2) Sort in ascending order according to the curvature, and select the one with the lowest curvature as the initial seed point;
[0117] (3) Set the normal vector angle threshold, search for the neighborhood points of the current seed point, calculate the angle between the normal vector of the neighborhood point and the normal vector of the current seed point, and add the neighborhood points with an angle less than the threshold to the current region;
[0118] (4) Set the curvature threshold, check the curvature of each neighborhood point, add the neighborhood points with a curvature less than the curvature threshold to the seed point sequence, delete the current seed point, and continue to grow with the new seed point;
[0119] (5) If the normal vector angle threshold and the curvature threshold are satisfied, this point can be used as a seed point;
[0120] (6) If only the normal vector angle threshold is satisfied, classify it but do not use it as a seed;
[0121] (7) Repeat the above growth process until the seed point sequence is emptied. At this time, the growth of one region is completed, and it is added to the clustering array;
[0122] (8) Repeat the above steps for the remaining points until all points are traversed. The points that are not classified are usually points with large changes in the normal vector. In the embodiments of the present invention, these points are considered as building edge points.
[0123] Step 7, point cloud - image conversion from the top - down view:
[0124] Project the building point cloud P buildings and the building edge point cloud P edge onto a two - dimensional plane, and perform grid division according to the planar coordinates x and y. After grid division, each grid grid(u, v) contains the corresponding point cloud index.
[0125] Generate the enhanced image Image of the building edge information from the top - down view according to the following formula:
[0126]
[0127] In the formula, grid_n is the number of building points contained in grid(u, v), relative_evelationi It is the relative height feature of the building points contained in grid(u,v).
[0128] Step 8, image segmentation based on the visual segmentation model:
[0129] Specifically, apply the visual segmentation model for image segmentation to obtain the segmentation result Mask = {m1, m2,..., m o}.
[0130] Step 9, obtaining the building single-point cloud based on the image segmentation result:
[0131] Specifically, the segmentation result m i obtained by the visual segmentation model contains pixels (u i , v i ). Based on the point cloud index contained in grid(u i , v i ), the point cloud corresponding to each segmentation result can be obtained as the building single-point cloud
[0132] Step 10, building single-point cloud optimization module:
[0133] Judge whether the image segmentation result m i intersects with other segmentation results. If it intersects, merge the two segmentation results and merge the corresponding building single-point clouds obtained in step 9 to obtain the final building point cloud single-body segmentation result.
[0134] Based on the above method items, the present invention correspondingly provides an embodiment of the system item.
[0135] See Figure 3 , Figure 3 is the structural block diagram of a historical and cultural block building point cloud single-body segmentation system provided by an embodiment of the present invention. The historical and cultural block building point cloud single-body segmentation system includes:
[0136] A building point cloud acquisition module 21, configured to acquire the building point cloud data of the historical and cultural block to obtain the first building point cloud;
[0137] A feature calculation module 22, configured to calculate local geometric features and scene features based on the first building point cloud;
[0138] A building point cloud extraction module 23, configured to use the local geometric features and the scene features as the input of a semantic classification model based on the self-attention mechanism to extract the third building point cloud;
[0139] The building edge point cloud extraction module 24 processes the third building point cloud using a normal-based region growing algorithm to obtain the building edge point cloud;
[0140] The building edge information enhanced image generation module 25 is used to perform cross-domain rasterization processing on the third building point cloud and the building edge point cloud, enhance the building structure edge, and generate a building edge information enhanced image from a top-down perspective;
[0141] The building point cloud single entity segmentation module 26 is used to segment the building edge information enhanced image using a visual segmentation model to obtain multiple image segmentation results, and obtain the building single entity point cloud corresponding to each image segmentation result according to the mapping relationship.
[0142] In an alternative embodiment, the historical and cultural block building point cloud single entity segmentation system further includes:
[0143] The point cloud denoising module is used to remove the outlier points included in the first building point cloud using a statistical filtering method based on the spatial distance distribution of the adjacent points of each point in the first building point cloud to obtain the second building point cloud.
[0144] Furthermore, the feature calculation module 22 is specifically used for:
[0145] Build spherical neighborhoods by selecting corresponding radius lengths respectively, and calculate the planar local feature, spherical local feature, and verticality local feature of each point in the second building point cloud;
[0146] Use the cloth simulation algorithm to obtain the ground points, and calculate the elevation difference between each point in the second building point cloud and the ground point closest to the corresponding point as the scene feature.
[0147] In an alternative embodiment, the building edge point cloud extraction module 24 is specifically used for:
[0148] Calculate the normal and curvature of each point in the third building point cloud;
[0149] Take the point with the lowest curvature as the initial seed point;
[0150] Search for the neighborhood points of the current seed point, calculate the angle between the normal of the neighborhood point and the normal of the current seed point, and add the neighborhood points with an angle less than the preset normal angle threshold to the current region;
[0151] Check the curvature of each neighborhood point, add the neighborhood points with a curvature less than the preset curvature threshold to the seed point sequence, and delete the current seed point;
[0152] Points with the simultaneous normal angle threshold and curvature threshold are used as new seed points, and growth continues with the new seed points until the seed point sequence is emptied, and all points in the current region are classified;
[0153] When all points have been traversed, points that have not been classified are used as building edge points.
[0154] In an alternative embodiment, the building edge information enhancement image generation module 25 is specifically configured to:
[0155] Project the third building point cloud and the building edge point cloud onto a two-dimensional plane for grid division, and construct a point cloud index corresponding to each grid;
[0156] According to the point cloud index corresponding to each grid and the relative average height feature of the building points within each grid, color information is assigned to the grid to generate an enhanced image of building edge information from a top-down perspective.
[0157] Specifically, the enhanced image of building edge information is generated by the following formula:
[0158]
[0159] where Image(u, v) represents the generated enhanced image of building edge information, grid(u, v) represents the point cloud index corresponding to each grid, u and v respectively represent the index values of the grid in the x and y coordinate directions, P edge represents the building edge point cloud, i represents the i-th building point cloud, grid_n is the number of building point clouds included in grid(u, v), and relative_evelation i is the relative average height feature of all building point clouds included in grid(u, v).
[0160] In an alternative embodiment, the building point cloud single entity segmentation module 26 further includes:
[0161] A building point cloud single entity segmentation optimization module, which is used to merge two image segmentation results when there is an intersection between them, and merge the corresponding obtained building single entity point clouds to obtain the historical and cultural block building point cloud single entity segmentation result.
[0162] It should be noted that a historical and cultural block building point cloud single entity segmentation system provided by an embodiment of the present invention is used to execute all the process steps of a historical and cultural block building point cloud single entity segmentation method in the above embodiment, and their working principles and beneficial effects correspond one by one, so they will not be elaborated here.
[0163] An embodiment of the present invention also provides a terminal device, such as Figure 4As shown in the figure, it is a structural block diagram of a terminal device provided by an embodiment of the present invention. The terminal device includes a processor 31, a memory 32, and a computer program stored in the memory 32 and configured to be executed by the processor 31. When the processor 31 executes the computer program, it implements the historical and cultural block building point cloud single body segmentation method described in any of the above embodiments.
[0164] In addition, an embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. Wherein, when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the historical and cultural block building point cloud single body segmentation method described in any of the above embodiments.
[0165] When the processor 31 executes the computer program, it implements the steps in the above embodiments of the historical and cultural block building point cloud single body segmentation method, such as Figure 1 All the steps of the historical and cultural block building point cloud single body segmentation method shown in the figure. Or, when the processor 31 executes the computer program, it implements the functions of each module in the above embodiments of the historical and cultural block building point cloud single body segmentation system, such as Figure 3 The functions of each module of the historical and cultural block building point cloud single body segmentation system shown in the figure.
[0166] Preferably, the computer program can be divided into one or more modules / units. The one or more modules / units are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the terminal device.
[0167] The processor 31 can be a central processing unit (CPU), or can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 31 can also be any conventional processor. The processor 31 is the control center of the terminal device, and connects various parts of the terminal device through various interfaces and lines.
[0168] The memory 32 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc., and the data storage area can store relevant data, etc. In addition, the memory 32 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., or the memory 32 can also be other volatile solid-state storage devices.
[0169] It should be noted that the above terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that Figure 4 The shown block diagram is only an example of the structure of the above terminal device, and does not constitute a limitation on the structure of the above terminal device. The above terminal device may include more or fewer components than those shown, or combine some components, or different components.
[0170] The above is the preferred embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for single - body segmentation of building point clouds in a historical and cultural block, characterized in that, Including: Collecting the building point cloud data of the historical and cultural block to obtain the first building point cloud; Calculating the local geometric features and scene features based on the first building point cloud; Taking the local geometric features and the scene features as the input of a semantic classification model based on the self-attention mechanism to extract the third building point cloud; Processing the third building point cloud by using a region growing algorithm based on the normal vector to obtain the building edge point cloud; Performing cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate a building edge information enhanced image from a top-down perspective; Using a visual segmentation model to segment the building edge information enhanced image to obtain multiple image segmentation results, and obtaining the building single point cloud corresponding to each image segmentation result according to the mapping relationship.
2. The method for segmenting individual building point clouds in a historical and cultural block according to claim 1, wherein, Before calculating the local geometric features and scene features based on the first building point cloud, the method further includes: Based on the spatial distance distribution of the adjacent points of each point in the first building point cloud, using a statistical filtering method to remove the outlier points included in the first building point cloud to obtain the second building point cloud.
3. The method for segmenting individual building point clouds in a historical and cultural block according to claim 2, wherein, Calculating the local geometric features and scene features based on the second building point cloud, including: Respectively selecting corresponding radius lengths to construct spherical neighborhoods, and calculating the planar local feature, spherical local feature, and verticality local feature of each point in the second building point cloud; Using a cloth simulation algorithm to obtain the ground points, and calculating the elevation difference between each point in the second building point cloud and the ground point closest to the corresponding point as the scene feature.
4. The method for segmenting individual building point clouds in a historical and cultural block according to claim 1, wherein The processing the third building point cloud by using a region growing algorithm based on the normal vector to obtain the building edge point cloud includes: Calculating the normal vector and curvature of each point in the third building point cloud; Taking the point with the lowest curvature as the initial seed point; Searching for the neighborhood points of the current seed point, calculating the angle between the normal vector of the neighborhood point and the normal vector of the current seed point, and adding the neighborhood points with an angle less than the preset normal vector angle threshold to the current region; Checking the curvature of each neighborhood point, adding the neighborhood points with a curvature less than the preset curvature threshold to the seed point sequence, and deleting the current seed point; Taking the points that satisfy both the normal vector angle threshold and the curvature threshold as new seed points, and continuing to grow with the new seed points until the seed point sequence is emptied, and classifying all the points in the current region; When all points are traversed, taking the unclassified points as the building edge points.
5. The method for segmenting individual building point clouds in a historical and cultural block according to claim 1, wherein The performing cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate a building edge information enhanced image from a top-down perspective includes: Projecting the third building point cloud and the building edge point cloud onto a two-dimensional plane for grid division, and constructing the point cloud index corresponding to each grid; According to the point cloud index corresponding to each grid and the relative average height feature of the building points in each grid, assigning color information to the grid to generate a building edge information enhanced image from a top-down perspective.
6. The method for single - body segmentation of point clouds of historical and cultural block buildings according to claim 5, wherein, The building edge information enhanced image is generated by the following formula: Among them, Image(u, v) represents the generated enhanced image of building edge information, grid(u, v) represents the point cloud index corresponding to each grid, u and v respectively represent the index values of the grid in the x and y coordinate directions, and P edge represents the building edge point cloud, u represents the i-th building point cloud, grid_n is the number of building point clouds included in grid(u, v), and relative_evelation i is the relative average height feature of all building point clouds included in grid(u, v).
7. The method for single - body segmentation of point clouds of historical and cultural block buildings according to claim 1, wherein, After obtaining the building single point clouds corresponding to each of the image segmentation results according to the mapping relationship, the method further includes: When there is an intersection between two image segmentation results, merge the two image segmentation results and merge the corresponding obtained building single point clouds to obtain the building point cloud monomerization segmentation result of the historical and cultural block.
8. A system for segmenting individual building point clouds in a historical and cultural block, characterized in that, Including: A building point cloud acquisition module, configured to acquire building point cloud data of a historical and cultural block to obtain a first building point cloud; A feature calculation module, configured to calculate local geometric features and scene features based on the first building point cloud; A building point cloud extraction module, configured to use the local geometric features and the scene features as inputs of a semantic classification model based on a self-attention mechanism to extract a third building point cloud; A building edge point cloud extraction module, configured to process the third building point cloud by using a region growing algorithm based on a normal vector to obtain a building edge point cloud; A building edge information enhanced image generation module, configured to perform cross-domain rasterization processing on the third building point cloud and the building edge point cloud to enhance the building structure edge and generate a building edge information enhanced image from a top-down perspective; A building point cloud monomer segmentation module, configured to use a visual segmentation model to segment the building edge information enhanced image to obtain a plurality of image segmentation results, and obtain the building single point clouds corresponding to each of the image segmentation results according to the mapping relationship.
9. A terminal device, characterized in that, Including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the historical and cultural block building point cloud monomer segmentation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the historical and cultural block building point cloud monomer segmentation method according to any one of claims 1 to 7.
Citation Information
Cited By
Single building three-dimensional reconstruction method based on improved semantic segmentation
CN121304962A