A method, system and medium for automatically extracting white mold of a building
By calculating the normal vector of building point cloud data for stratification and contour extraction, building white model is solved, and the problem of not being able to quickly reflect the outline differences of different floors of buildings in the existing technology is achieved, and the rapid white model of buildings is achieved , refine construction.
Patent Information
- Application Number
- CN202410796178.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-06-20
AI Technical Summary
The existing building white model construction method cannot quickly reflect the outline differences between different floors of the building, and the data acquisition is difficult and the calculation complexity is high, so it is impossible to achieve refined automatic extraction of white model of the building.
By calculating the normal vectors of each data point in the point cloud data of a building, layer the point cloud data in the height direction based on the normal vector, extract the contour lines of each layered point cloud data, and based on these contour lines and hierarchies Construct the main body of the building highly and form the white mold of the building.
It realizes the rapid and automatic extraction of white molds in the building, retains the overall structural characteristics of the building, and accurately displays the structural differences between different floors, realizing the refined construction of white molds in the building.
Smart Images

Figure CN118608716B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of geographic information surveying and mapping technology, and in particular, relates to a method, system and medium for automatically extracting white molds of buildings. Background Art
[0002] The white model of a building can quickly provide the basic framework of the urban spatial structure, including information such as the location, shape and height of the building, so as to provide accurate spatial data for the construction of urban planning and geographic information systems.
[0003] The traditional building white mold construction method usually extracts a cross-sectional outline in the height direction of the building and combines it with the height of the building to construct the building white mold. However, the building white mold constructed by the traditional building white mold construction method only reflects the overall outline characteristics of the building, but cannot reflect the structural differences between different floors. With the development of science and technology, the existing building white mold construction method realizes the refined construction of the building white mold by combining high-resolution satellite stereo images. However, the existing building white mold construction method has high data acquisition difficulty, and the computational complexity of building white mold construction based on high-resolution satellite stereo images is large, and it is impossible to quickly obtain a refined building white mold.
[0004] Based on this, how to quickly and automatically extract the building's white mold according to the contour differences of different floors of the building is an important issue that needs to be solved urgently. Summary of the invention
[0005] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide a method for automatically extracting white molds of buildings, so as to solve the problem that the existing white mold extraction methods of buildings cannot quickly construct white molds of buildings that reflect the differences in the contours of different floors of the building.
[0006] To achieve the above object and other related objects, the present invention provides a method for automatically extracting white molds of buildings, comprising the following steps:
[0007] Based on the point cloud data of the building, calculating the normal vector corresponding to each data point in the point cloud data;
[0008] In the height direction of the building, the point cloud data is layered based on the normal vector to obtain each layer height of the building and layered point cloud data corresponding to the layer height;
[0009] Performing a contour line extraction operation on each of the layered point cloud data to obtain a contour line corresponding to each of the layered point cloud data;
[0010] Based on the contour lines and the layered heights corresponding to each of the layered point cloud data, corresponding building bodies are constructed respectively; in the height direction of the building, the building bodies are stacked in sequence to form an overall building model as a white model of the building.
[0011] In one embodiment of the present invention, the step of stratifying the point cloud data based on the normal vector in the height direction of the building includes:
[0012] Acquire a preset layer thickness, and divide the point cloud data into initial layer point cloud data based on the preset layer thickness in the height direction of the building;
[0013] For each of the initial layered point cloud data, based on the normal vector of the data point in each of the initial layered point cloud data, the inclination angle of each of the data points is calculated; the inclination angle is the inclination angle of the data point in each of the initial layered point cloud data in a preset direction;
[0014] Based on the inclination angle, performing layer determination on each of the initial layered point cloud data, obtaining each of the initial layered point cloud data having an abnormally changed inclination angle in the height direction of the building as determination layered point cloud data; and obtaining each layered height of the building based on each of the determination layered point cloud data;
[0015] Based on the heights of each layer of the building, the point cloud data is layered in a height direction to obtain point cloud data of each layer of the building.
[0016] In one embodiment of the present invention, the method further includes, before performing the layer determination:
[0017] The number of the data points whose inclination angle is greater than a preset inclination angle threshold is obtained in each of the initial layered point cloud data, and the initial layered point cloud data whose number is less than a preset first number threshold is eliminated in each of the initial layered point cloud data.
[0018] In one embodiment of the present invention, the implementation of the layered determination includes:
[0019] The proportion of the data points whose inclination angle is greater than a preset inclination angle threshold in the current initial layered point cloud data is obtained; if the proportion is greater than the preset proportion threshold, it is determined that the current initial layered point cloud data has an abnormal change in the inclination angle in the height direction of the building, and the current initial layered point cloud data is used as the determined layered point cloud data.
[0020] In one embodiment of the present invention, the implementation method of the layered determination further includes:
[0021] Obtaining the proportion of data points whose inclination angle is greater than a preset inclination angle threshold in the current initial layered point cloud data, and the absolute value of the difference between the inclination angle mean value of the current initial layered point cloud data and the inclination angle mean value of the initial layered point cloud data of the previous layer; if the proportion is greater than the preset proportion threshold, and the absolute value of the difference is greater than the preset difference threshold, it is determined that the current initial layered point cloud data has an abnormal change in inclination angle in the height direction of the building, and the current initial layered point cloud data is used as the determined layered point cloud data;
[0022] The inclination angle mean is the average value of the inclination angles of the data points in the initial layered point cloud data.
[0023] In one embodiment of the present invention, the implementation method of the contour extraction operation includes:
[0024] Acquire a preset slice thickness, and slice point cloud data having the preset slice thickness from the layered point cloud data in the height direction of the building;
[0025] Based on the spatial distribution characteristics of the data points, clustering the data points in the slice point cloud data to obtain each clustered point cloud cluster; in each clustered point cloud cluster, obtaining a point cloud cluster whose number of data points is greater than a preset second number threshold as a projection contour line to be extracted point cloud cluster;
[0026] Performing projection contour line extraction on each of the projection contour line to be extracted point cloud clusters to obtain projection contour lines corresponding to each of the projection contour line to be extracted point cloud clusters, fusing the projection contour lines to obtain fused projection contour lines as contour lines corresponding to the layered point cloud data;
[0027] Among them, the projection contour line extraction includes: based on point coordinates, projecting each of the data points in the point cloud cluster to be extracted from the projection contour line to a horizontal plane, and using the contour line obtained by projecting each of the data points in the horizontal plane as the projection contour line of the point cloud cluster to be extracted from the projection contour line.
[0028] In one embodiment of the present invention, when there is a sloping roof in the building, the corresponding building bodies are constructed based on the contour lines and the layer heights corresponding to each of the layered point cloud data, respectively, including:
[0029] Based on the contour lines corresponding to the layered point cloud data, respectively calculating the enclosed areas corresponding to the contour lines as the building cross-sectional areas of the corresponding layered point cloud data;
[0030] According to the building cross-sectional area and the corresponding layered height, obtaining the area change distribution of each building cross-sectional area as the height changes;
[0031] In the height direction of the building, extracting each of the layered point cloud data whose area change distribution changes linearly; dividing each of the layered point cloud data whose linear changes are distributed into corresponding layered point cloud data groups based on the layered height, to obtain each of the layered point cloud data groups;
[0032] Extracting group contours and group layer heights for each of the layered point cloud data groups to obtain group contours and group layer heights corresponding to each of the layered point cloud data groups; the group contours are contours of the layered point cloud data corresponding to the smallest layer height in the layered point cloud data group; the group layer heights are the largest layer heights in the layered point cloud data group;
[0033] Based on the group contour lines and group layer heights corresponding to each of the layered point cloud data groups, the building bodies corresponding to the layered point cloud data groups are respectively constructed; and based on the contour lines and layer heights corresponding to the nonlinearly changing layered point cloud data, the building bodies corresponding to the nonlinearly changing layered point cloud data are respectively constructed.
[0034] Correspondingly, the present invention provides a building white mold automatic extraction system, characterized in that it includes:
[0035] A calculation module, used for calculating a normal vector corresponding to each data point in the point cloud data based on the point cloud data of the building;
[0036] A stratification module, used for stratifying the point cloud data based on the normal vector in the height direction of the building to obtain each layer height of the building and the layered point cloud data corresponding to the layer height;
[0037] A contour line extraction module, used to perform a contour line extraction operation on each layered point cloud data to obtain a contour line corresponding to each layered point cloud data;
[0038] The white model construction module is used to construct the corresponding building bodies based on the contour lines and the layer heights corresponding to each layered point cloud data; and stack the building bodies in sequence in the height direction of the building to form an overall building model as the white model of the building.
[0039] In one embodiment of the present invention, the system further includes:
[0040] The fusion extraction submodule is used to obtain a preset slice thickness, and to cut out slice point cloud data of the preset slice thickness from the layered point cloud data in the height direction of the building; cluster the data points in the slice point cloud data based on the spatial distribution characteristics of the data points to obtain each clustered point cloud cluster; in each clustered point cloud cluster, a point cloud cluster with a number of data points greater than a preset second number threshold is obtained as a projection contour line point cloud cluster to be extracted; projection contour line extraction is performed on each projection contour line point cloud cluster to be extracted to obtain a projection contour line corresponding to each projection contour line point cloud cluster to be extracted, and each projection contour line is fused to obtain a fused projection contour line as the contour line corresponding to the layered point cloud data; wherein,
[0041] The projection contour line extraction includes: based on point coordinates, projecting each of the data points in the projection contour line point cloud cluster to be extracted onto a horizontal plane, and using the contour line formed by the projection of each of the data points in the horizontal plane as the projection contour line of the projection contour line point cloud cluster to be extracted.
[0042] Correspondingly, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the red tide prediction method as described above is implemented.
[0043] As described above, the method, system and medium for automatically extracting white molds of buildings described in the present application have the following beneficial effects:
[0044] By calculating the normal vector corresponding to each data point in the point cloud data of the building, based on the normal vector, the point cloud data is layered in the height direction to obtain each layer height of the building and the layered point cloud data corresponding to the layer height; by extracting the contour line of each layered point cloud data, based on the contour line and the layer height corresponding to each layered point cloud data, the corresponding building body is respectively constructed, and each building body is stacked to obtain the white mold of the building, thereby quickly realizing the automatic extraction of the white mold of the building, and the white mold of the building extracted based on the method not only retains the overall structural characteristics of the building, but also can accurately show the structural differences between different floors of the building, thereby realizing the refined construction of the white mold of the building. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 A schematic diagram of a process flow of an automatic extraction method for white mold of a building provided by the present application in one embodiment is shown.
[0046] Figure 2 A schematic diagram of the process of stratifying the point cloud data in the height direction in one embodiment of the automatic extraction method of the building white model provided in the present application is shown.
[0047] Figure 3 A schematic diagram showing the flow of performing contour extraction operations in an embodiment of the automatic extraction method for white molds of buildings provided in the present application is shown.
[0048] Figure 4 A schematic diagram of the process of constructing a building main body in one embodiment of the automatic extraction method of building white mold provided in the present application is shown.
[0049] Figure 5 Shown is a physical diagram of a building.
[0050] Figure 6 Shown is a schematic diagram of a building point cloud.
[0051] Figure 7 Shown is a schematic diagram of a building main body constructed based on the automatic extraction method of building white mold.
[0052] Figure 8 A module structure diagram of an automatic extraction system for white molds of buildings provided by the present application in one embodiment is shown.
[0053] Fig. 9 Shown is a module structure diagram of the automatic extraction system for white molds of buildings provided in the present application in another embodiment.
[0054] Description of Reference Numerals
[0055] Steps S1~S4; Steps S21~S24; Steps S31~S33; Steps S41~S45; 300 White model automatic extraction system; 301 Calculation module; 302 Layering module; 303 Contour extraction module; 3031 Fusion extraction submodule; 304 White model construction module. DETAILED DESCRIPTION
[0056] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0057] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0058] To facilitate the understanding of the technical solutions provided by the present application, the relevant terms in the present application are explained before the specific embodiments, as follows:
[0059] Point cloud data: It is a common data format in the fields of geographic information science, remote sensing technology, 3D modeling and computer graphics. It consists of a large number of points (usually in three-dimensional space), each of which contains its position information in space, and possible other related information such as color, intensity, classification, etc.
[0060] The following embodiments of the present application provide a method for automatically extracting white molds of buildings, by calculating the normal vector corresponding to each data point in the point cloud data of the building, and based on the normal vector, stratifying the point cloud data in the height direction to obtain each layer height of the building and layered point cloud data corresponding to the layer height; by extracting the contour lines of each layered point cloud data, and based on the contour lines and the layer heights corresponding to each layered point cloud data, respectively constructing corresponding building bodies, stacking each building body, and obtaining the white mold of the building, the automatic extraction of the white mold of the building is quickly realized, and the white mold of the building extracted based on the method not only retains the overall structural characteristics of the building, but also can accurately display the structural differences between different floors of the building, thereby realizing the refined construction of the white mold of the building.
[0061] Please refer to Figure 1 , showing a flow chart of an automatic extraction method of a building white mold provided by the present invention in one embodiment.
[0062] like Figure 1 As shown, in this embodiment, the automatic extraction method of building white mold provided by the present invention comprises the following steps:
[0063] Step S1, obtaining point cloud data corresponding to the building, and calculating the normal vector of each point in the point cloud data based on the point cloud data;
[0064] In one implementation, the method for calculating the normal vector of each point in the point cloud data includes:
[0065] In the point cloud data, a point to be calculated is obtained; based on the point to be calculated, a neighborhood point set of the point to be calculated is determined; the covariance matrix of the point cloud data in the neighborhood point set is calculated; the covariance matrix is decomposed by eigenvalues to obtain eigenvalues of the covariance matrix and eigenvectors corresponding to the eigenvalues; the eigenvalues and the eigenvectors are normalized, and among the eigenvalues and the eigenvectors after the normalization, the eigenvector corresponding to the largest eigenvalue is obtained as the normal vector of the point to be calculated.
[0066] The neighborhood point set includes: the point to be calculated and N data points that are closest to the calculated point.
[0067] Optionally, the number of the N data points that are nearest to the point to be calculated is 9, 16, 25, etc.
[0068] In this embodiment, by obtaining the domain point set of the point to be calculated, the data points in the neighborhood point set can be fitted into a local surface; by calculating the covariance matrix of the point cloud data in the domain point set and performing eigendecomposition on the covariance matrix, the vector that best represents the local surface changes can be obtained, and the vector is used as the normal vector of the point to be calculated to obtain a normal vector that can accurately characterize the local surface changes.
[0069] Step S2, in the height direction of the building, the point cloud data is layered based on the normal vector to obtain each layer height of the building in the height direction and the layered point cloud data corresponding to the layer height;
[0070] See also Figure 2 , showing a schematic flow chart of layering the point cloud data in the height direction in one embodiment of the automatic building extraction method provided by the present invention;
[0071] like Figure 2 As shown, in one embodiment, the implementation method of layering the point cloud data based on the normal vector in the height direction of the building includes:
[0072] Step S21, obtaining a preset layer thickness, and dividing the point cloud data into initial layer point cloud data based on the preset layer thickness in the height direction of the building;
[0073] Exemplarily, the height of the building is 10 meters, and the preset layer thickness is 5 cm. Then, in the height direction of the building, the point cloud data can be divided into 200 initial layered point cloud data.
[0074] Step S22, for each of the initial layered point cloud data, based on the normal vector of the data point in each of the initial layered point cloud data, calculating the inclination angle of the data point in each of the initial layered point cloud data;
[0075] The tilt angle is a tilt angle of the data point in each of the initial layered point cloud data in a preset direction.
[0076] Optionally, the preset direction includes: the height direction of the building, or the horizontal direction; illustratively, the inclination angle is the angle between the normal vector and the horizontal plane.
[0077] Step S23, based on the inclination angle, performing layer determination on each of the initial layered point cloud data, obtaining each of the initial layered point cloud data having an abnormally changed inclination angle in the height direction of the building as determination layered point cloud data; and obtaining each layered height of the building based on each of the determination layered point cloud data;
[0078] Optionally, the method for obtaining the layered height includes: calculating the average value of the vertical axis coordinates of each data point in the layered point cloud data, and using the average value as a layered height of the building; the vertical axis is a coordinate axis perpendicular to the horizontal plane.
[0079] In one implementation, the implementation of the layered determination includes:
[0080] The proportion of the data points whose inclination angle is greater than a preset inclination angle threshold in the current initial layered point cloud data is obtained; if the proportion is greater than the preset proportion threshold, it is determined that the current initial layered point cloud data has an abnormal change in the inclination angle in the height direction of the building, and the current initial layered point cloud data is used as the determined layered point cloud data.
[0081] Exemplarily, the preset ratio threshold is 50%.
[0082] In another implementation manner, the implementation of the layered determination further includes:
[0083] Obtaining the proportion of the data points whose inclination angle is greater than a preset inclination angle threshold in the current initial layered point cloud data, and the absolute value of the difference between the inclination angle mean value of the current initial layered point cloud data and the inclination angle mean value of the initial layered point cloud data of the previous layer; if the proportion is greater than a preset proportion threshold, and the absolute value of the difference is greater than a preset difference threshold, it is determined that the current initial layered point cloud data has an abnormal change in inclination angle in the height direction of the building, and the current initial layered point cloud data is used as the determined layered point cloud data;
[0084] Wherein, the inclination angle mean is the average value of the inclination angles of each of the data points in the initial layered point cloud data;
[0085] The initial layer point cloud data of the previous layer is the initial layer point cloud data which is adjacent to the current initial layer point cloud data in the height direction of the building and has been subjected to the layer determination.
[0086] Exemplarily, the preset tilt angle mean is 45 degrees; the preset difference threshold is 30 degrees.
[0087] In this embodiment, when performing layer determination, by combining the absolute value of the difference between the inclination angles of adjacent layered point cloud data and the ratio, it is determined whether the current initial layered point cloud data has an abnormal change in the inclination angle in the height direction of the building. Not only can the initial layered point cloud data with continuous inclined surfaces be filtered out in each of the initial layered point cloud data to accurately obtain the initial layered point cloud data with abnormal change in inclination angle, but the calculation method used in this type of layer determination method adopted in the present application is simple, thereby improving the implementation efficiency of the layer determination, so as to quickly obtain each of the determined layered point cloud data, thereby improving the construction efficiency of the building white mold.
[0088] Optionally, before performing layer determination on each of the initial layered point cloud data, the method further includes:
[0089] The number of the data points whose inclination angle is greater than a preset inclination angle threshold is obtained in each of the initial layered point cloud data, and the initial layered point cloud data whose number is less than a preset first number threshold is eliminated in each of the initial layered point cloud data.
[0090] In this embodiment, the initial layered point cloud data whose number of inclination points is less than the preset first number threshold is pre-screened to avoid being misjudged as the judgment point cloud data when performing subsequent layering judgment based on the initial layered point cloud data with a small number of inclination points, thereby affecting the accuracy of the building height obtained based on the judgment point cloud data and reducing the accuracy of the layering of the point cloud data in the height direction.
[0091] It should be noted that the point cloud data contains fewer data points, which means that the geometric shape and / or some details of the building are not fully captured, and cannot accurately reflect the real shape and structure of the building.
[0092] Step S24: based on the heights of the layers of the building, the point cloud data is layered in the height direction to obtain the point cloud data of the layers of the building.
[0093] Step S3, performing a contour line extraction operation on each of the layered point cloud data to obtain a contour line corresponding to each of the layered point cloud data;
[0094] See also Figure 3 , showing a schematic flow chart of the contour line extraction operation performed by the automatic building extraction method provided by the present invention in one embodiment;
[0095] like Figure 3 As shown, in one embodiment, the implementation of the contour extraction operation includes:
[0096] Step S31, obtaining a preset slice thickness, and slicing slice point cloud data of the preset slice thickness from the layered point cloud data in the height direction of the building;
[0097] Optionally, the slice point cloud data of the preset slice thickness is cut out in the middle of the layered point cloud data in the height direction of the building; in this embodiment, the slice point cloud data is cut out based on the middle of the layered point cloud data, and subsequent contour line extraction is performed, which can improve the accuracy of the extracted contour line.
[0098] It should be noted that the bottom and top surfaces of the layered point cloud data are both located at the place where the cross-sectional contour of the building changes in the height direction. Based on the sliced point cloud data cut out from the middle part of the layered point cloud data, subsequent contour line extraction operations are performed, which can avoid the extracted contour line being affected by the change in the cross-sectional contour of the building, thereby improving the accuracy of the extracted contour line.
[0099] Step S32: clustering the data points in the slice point cloud data based on the spatial distribution characteristics of the data points to obtain clustered point cloud clusters; obtaining, from the clustered point cloud clusters, a point cloud cluster whose number of data points is greater than a preset second number threshold as a projection contour line to be extracted point cloud cluster;
[0100] Optionally, the spatial distribution characteristics of the data points include: the number of data points, the spacing between data points, and the normal vectors of data points, etc.
[0101] It should be noted that, in actual scenarios, the preset second quantity threshold can be set based on actual application requirements, and this application does not limit it here.
[0102] Step S33, performing projection contour line extraction on each of the projection contour line point cloud clusters to be extracted to obtain the projection contour line corresponding to each of the projection contour line point cloud clusters to be extracted, fusing the projection contour lines to obtain the fused projection contour line as the contour line corresponding to the layered point cloud data.
[0103] In one embodiment, the projection contour line extraction includes: based on point coordinates, projecting each of the data points in the point cloud cluster to be extracted from the projection contour line onto a horizontal plane, and using the contour line formed by the projection of each of the data points in the horizontal plane as the projection contour line of the point cloud cluster to be extracted from the projection contour line.
[0104] In another embodiment, the projection contour line extraction includes: based on the point coordinates, projecting each point in the point cloud cluster to be extracted by the projection contour line to a horizontal plane, calculating the bounding volume of the point cloud cluster to be extracted by the projection contour line on the horizontal plane, generating a projection image based on a preset resolution and the bounding volume, and extracting the projection contour line of the point cloud cluster to be extracted by the projection contour line in the projection image;
[0105] The bounding volume is a minimum rectangular frame on the horizontal plane that surrounds each of the data points in the point cloud cluster.
[0106] Optionally, an existing fusion method is used to fuse the projection contour lines, which is not limited in the present application; illustratively, the existing fusion method includes: a threshold-based fusion method or a distance-based fusion method, etc.
[0107] In this embodiment, considering that the projection contour line extraction is directly based on the layered point cloud data, not only the amount of data involved is large, but also each of the data points in the layered point cloud data is projected, which contains too many error offset points. The projection contour line obtained by the projection is easily affected by the error offset points, resulting in low accuracy of the obtained projection contour line; based on this, in the present application, slice point cloud data is obtained from the layered point cloud data, and the spatial distribution characteristics of the data points including the number of data points, the distance of data points and the normal vector of the data points are used to cluster the slice point cloud data, wherein, by setting the normal vector of the data point, a point cloud cluster with a different inclination angle range from the preset direction, that is, a point cloud cluster with a different layering effect can be obtained, by eliminating the point cloud cluster whose number of data points is less than the preset second number threshold, the data points with error offset in the slice point cloud data are removed, and based on the remaining point cloud clusters to be extracted for each projection contour line, each projection contour line is extracted respectively, and each projection contour line is fused to comprehensively analyze the contour features of each projection contour line to obtain a contour line with higher accuracy as the contour line corresponding to the layered point cloud data.
[0108] It should be noted that the number of points preset in the clustering algorithm is the number of points that each cluster is expected to contain, but the clustering algorithm will be affected by many factors in the process of clustering data, including the distribution characteristics of the data itself, the choice of clustering algorithm, and parameter settings. Therefore, the number of points in each cluster obtained after clustering is different from the preset number of points. For example, the noise or abnormal points contained in the data may not be classified into any cluster, or the clustering algorithm may mistakenly classify these points into smaller clusters.
[0109] Step S4, based on the contour lines and the layer heights corresponding to each of the layered point cloud data, respectively construct corresponding building bodies; in the height direction of the building, stack the building bodies in sequence to form an overall building model as a white model of the building.
[0110] Specifically, a layered point cloud data to be constructed is obtained; in the height direction of the building, starting from the previous height, the contour line corresponding to the layered point cloud data to be constructed is stretched to the corresponding height of the contour line to form a building body corresponding to the layered point cloud data to be constructed; for other layered point cloud data to be constructed, the above-mentioned stretching process is respectively performed to obtain the building body corresponding to each layered point cloud data; according to the layered height, each building body is stacked in sequence to form an overall building model as a white mold of the building.
[0111] Wherein, when the layered point cloud data to be constructed is not the layered point cloud data of the top floor of the building, the corresponding height of the contour line is the layered height corresponding to the layered point data to be constructed; when the layered point cloud data to be constructed is the layered point cloud data of the top floor of the building, the corresponding height of the contour line is the maximum height of the points in the layered point data to be constructed, that is, the height of the building;
[0112] When the layer height corresponding to the layered point cloud data to be constructed is the minimum, the previous height is the bottom height of the building; when the layer height corresponding to the layered point cloud data to be constructed is not the minimum, the previous height is the layer height corresponding to the layered point cloud data of the previous layer; the layered point cloud data of the previous layer is adjacent to the layered point cloud data to be constructed in the height direction of the building, and the layer height is less than the layered point cloud data to be constructed.
[0113] See also Figure 4 , showing a schematic diagram of the process of constructing a building main body in an embodiment of the automatic building extraction method provided by the present invention;
[0114] like Figure 4 As shown, in another embodiment, when there is a sloping roof in the building, the corresponding building bodies are constructed based on the contour lines and the layer heights corresponding to each layered point cloud data, respectively, including:
[0115] Step S41, based on the contour lines corresponding to the layered point cloud data, respectively calculating the enclosed area corresponding to each contour line as the building cross-sectional area of the corresponding layered point cloud data;
[0116] Optionally, the open source algorithm cv::contourArea of OpenCV is used to calculate the enclosed area corresponding to the contour line.
[0117] Step S42, obtaining the area change distribution of each building cross-sectional area as the height changes according to the building cross-sectional area and the corresponding layer height;
[0118] Optionally, the area change rate of each building cross-sectional area in the height direction of the building is calculated, and based on each area change rate, the area change distribution of each building cross-sectional area as the height changes is obtained; illustratively, the area change rate is calculated as follows:
[0119]
[0120] In the above formula, r Indicates the area change rate corresponding to the current layered point cloud data; Represents the current building cross-sectional area of the layered point cloud data; A building cross-sectional area representing the layered point cloud data of adjacent layers; Indicates the layer height corresponding to the current layered point cloud data; The layered height corresponding to the layered point cloud data of the adjacent layer is represented; the point cloud data of the adjacent layer is the layered point cloud data adjacent to the current layered point cloud data in the height direction of the building.
[0121] Step S43, extracting each of the layered point cloud data whose area change distribution is linearly changing in the height direction of the building; dividing each of the layered point cloud data with linear changes into corresponding layered point cloud data groups based on the layer height, to obtain each of the layered point cloud data groups;
[0122] The layered point cloud data set includes a plurality of layered point cloud data whose building cross-sectional areas vary linearly in the height direction of the building and are adjacent in the height direction of the building;
[0123] The layered point cloud data in the layered point cloud data set are adjacent to each other in a height direction of the building.
[0124] Optionally, extracting each of the layered point cloud data whose area change distribution changes linearly in the height direction of the building comprises: determining in turn whether each of the layered point cloud data satisfies a preset cross-sectional area linear change condition, and using the layered point cloud data that satisfies the preset cross-sectional area linear change condition as the layered point cloud data that changes linearly; the preset cross-sectional area linear change condition comprises: the area change rate corresponding to the current layered point cloud data is greater than a preset area change rate threshold, and the change rate difference between the area change rate corresponding to the current layered point cloud data and the area change rate corresponding to the layered point cloud data of the previous layer is less than a preset change rate difference threshold;
[0125] Optionally, dividing the linearly changing layered point cloud data into corresponding layered point cloud data groups based on the layered heights includes: based on the layered heights corresponding to the layered point cloud data, dividing the layered point cloud data that are adjacent in the height direction of the building and linearly changing into the same layered point cloud data group.
[0126] Optionally, the layered point cloud data group includes at least 2 layered point cloud data.
[0127] Step S44, extracting the group contour line and the group layer height of each of the layered point cloud data groups to obtain the group contour line and the group layer height corresponding to each of the layered point cloud data groups; wherein,
[0128] The group contour line and group layer height extraction includes: based on the layer height, in the layered point cloud data group, obtaining the layered point cloud data corresponding to the minimum layer height, and using the corresponding contour line as the group contour line of the layered point cloud data group; in the layered point cloud data group, obtaining the maximum layer height as the group layer height of the layered point cloud data group;
[0129] Step S45: construct the building bodies corresponding to the layered point cloud data groups based on the group contour lines and group layer heights corresponding to the layered point cloud data groups; and construct the building bodies corresponding to the layered point cloud data with nonlinear changes based on the contour lines and layer heights corresponding to the layered point cloud data with nonlinear changes.
[0130] Optionally, when there is a sloping roof in the building, the building bodies are stacked in sequence in the height direction of the building to form an overall model of the building as a white mold of the building, including: according to the group layer height and the layer height, the building bodies are stacked in sequence to form an overall model of the building as a white mold of the building.
[0131] See also Figures 5 to 7, respectively showing a real-life image of a building, a point cloud schematic diagram of a building, and a schematic diagram of a main building body obtained based on the automatic extraction method of a building white mold.
[0132] like Figures 5 to 7 As shown, in the building point cloud schematic diagram obtained from the point cloud data of the building, only the overall outline features of the building are shown, and the clarity of the edges of the overall outline is low, and the changes in the cross-sectional outlines of the building in the height direction are not clearly shown. However, the building body obtained by the automatic extraction method of the building white mold provided by the present invention can clearly show the changes in the circumferential outlines of the building in the height direction while retaining the overall structure of the building, and accurately extract the building white mold at the same height as the building.
[0133] The above embodiment provides a method for automatically extracting a white mold of a building. The method calculates the normal vector corresponding to each data point in the point cloud data of the building, and based on the normal vector, the point cloud data is layered in the height direction to obtain each layer height of the building and the layered point cloud data corresponding to the layer height; the contour line of each layered point cloud data is extracted, and based on the contour line and the layer height corresponding to each layered point cloud data, the corresponding building body is respectively constructed, and each building body is stacked to obtain the white mold of the building, thereby quickly realizing the automatic extraction of the white mold of the building. The white mold of the building extracted based on the method not only retains the overall structural characteristics of the building, but also can accurately display the structural differences between different floors of the building, thereby realizing the refined construction of the white mold of the building.
[0134] like Figure 8 As shown, in this embodiment, the present invention provides a building white mold automatic extraction system, comprising:
[0135] A calculation module 301 is used to calculate a normal vector corresponding to each data point in the point cloud data based on the point cloud data of the building;
[0136] A layering module 302, configured to layer the point cloud data in the height direction of the building based on the normal vector to obtain each layer height of the building and layered point cloud data corresponding to the layer height;
[0137] A contour line extraction module 303 is used to perform a contour line extraction operation on each layered point cloud data to obtain a contour line corresponding to each layered point cloud data;
[0138] The white model construction module 304 is used to construct the corresponding building bodies based on the contour lines and the layer heights corresponding to each of the layered point cloud data; and stack the building bodies in sequence in the height direction of the building to form an overall building model as the white model of the building.
[0139] like Fig. 9 As shown, in this embodiment, the building white mold automatic extraction system also includes:
[0140] The fusion extraction submodule 3031 is used to obtain a preset slice thickness, and to cut out slice point cloud data of the preset slice thickness from the layered point cloud data in the height direction of the building; cluster the data points in the slice point cloud data based on the spatial distribution characteristics of the data points to obtain each clustered point cloud cluster; in each clustered point cloud cluster, obtain a point cloud cluster whose number of data points is greater than a preset second number threshold as a projection contour line point cloud cluster to be extracted; perform projection contour line extraction on each projection contour line point cloud cluster to be extracted to obtain a projection contour line corresponding to each projection contour line point cloud cluster to be extracted, fuse each projection contour line, and obtain a fused projection contour line as the contour line corresponding to the layered point cloud data; wherein,
[0141] The projection contour line extraction includes: based on point coordinates, projecting each of the data points in the projection contour line point cloud cluster to be extracted onto a horizontal plane, and using the contour line formed by the projection of each of the data points in the horizontal plane as the projection contour line of the projection contour line point cloud cluster to be extracted.
[0142] The embodiment of the present application also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by instructing the processor through a program, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0143] The embodiment of the present application may also provide a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0144] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0145] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0146] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A method for automatically extracting white molds of buildings, characterized in that: The method comprises: Based on the point cloud data of the building, calculating the normal vector corresponding to each data point in the point cloud data; In the height direction of the building, the point cloud data is layered based on the normal vector to obtain each layer height of the building and layered point cloud data corresponding to the layer height; Performing contour line extraction operation on each of the layered point cloud data to obtain contour lines corresponding to each of the layered point cloud data, including: obtaining a preset slice thickness, and cutting out slice point cloud data of the preset slice thickness from the layered point cloud data in the height direction of the building; clustering each of the data points in the slice point cloud data based on the spatial distribution characteristics of the data points to obtain each clustered point cloud cluster; obtaining a point cloud cluster with a number of data points greater than a preset second number threshold in each of the clustered point cloud clusters as a projection contour line point cloud cluster to be extracted; performing projection contour line extraction on each of the projection contour line point cloud clusters to be extracted to obtain a projection contour line corresponding to each of the projection contour line point cloud clusters to be extracted, and fusing each of the projection contour lines to obtain a fused projection contour line as the contour line corresponding to the layered point cloud data; Based on the contour lines and the layer heights corresponding to each of the layered point cloud data, corresponding building bodies are constructed respectively, including: obtaining the layered point cloud data to be constructed; starting from the previous height in the height direction of the building, stretching the contour lines corresponding to the layered point cloud data to be constructed to the corresponding height of the contour lines to form the building bodies corresponding to the layered point cloud data to be constructed; for other layered point cloud data to be constructed, respectively executing the above-mentioned stretching process to obtain the building bodies corresponding to each of the layered point cloud data; in the height direction of the building, stacking the building bodies in sequence to form an overall building model as a white mold of the building.
2. The method according to claim 1, characterized in that The step of stratifying the point cloud data based on the normal vector in the height direction of the building includes: Acquire a preset layer thickness, and divide the point cloud data into initial layer point cloud data based on the preset layer thickness in the height direction of the building; For each of the initial layered point cloud data, based on the normal vector of the data point in each of the initial layered point cloud data, the inclination angle of each of the data points is calculated; the inclination angle is the inclination angle of the data point in each of the initial layered point cloud data in a preset direction; Based on the inclination angle, performing layer determination on each of the initial layered point cloud data, obtaining each of the initial layered point cloud data having an abnormally changed inclination angle in the height direction of the building as determination layered point cloud data; and obtaining each layered height of the building based on each of the determination layered point cloud data; Based on the heights of each layer of the building, the point cloud data is layered in a height direction to obtain point cloud data of each layer of the building.
3. The method according to claim 2, characterized in that Before performing the layer determination, the method further includes: The number of the data points whose inclination angle is greater than a preset inclination angle threshold is obtained in each of the initial layered point cloud data, and the initial layered point cloud data whose number is less than a preset first number threshold is eliminated in each of the initial layered point cloud data.
4. The method according to claim 2, characterized in that: The implementation of the hierarchical determination includes: The proportion of the data points whose inclination angle is greater than a preset inclination angle threshold in the current initial layered point cloud data is obtained; if the proportion is greater than the preset proportion threshold, it is determined that the current initial layered point cloud data has an abnormal change in the inclination angle in the height direction of the building, and the current initial layered point cloud data is used as the determined layered point cloud data.
5. The method according to claim 2, characterized in that: The implementation method of the hierarchical determination further includes: Obtaining the proportion of data points whose inclination angle is greater than a preset inclination angle threshold in the current initial layered point cloud data, and the absolute value of the difference between the inclination angle mean value of the current initial layered point cloud data and the inclination angle mean value of the initial layered point cloud data of the previous layer; if the proportion is greater than the preset proportion threshold, and the absolute value of the difference is greater than the preset difference threshold, it is determined that the current initial layered point cloud data has an abnormal change in inclination angle in the height direction of the building, and the current initial layered point cloud data is used as the determined layered point cloud data; The inclination angle mean is the average value of the inclination angles of the data points in the initial layered point cloud data.
6. The method according to claim 1, characterized in that The projection contour line extraction comprises: Based on the point coordinates, each of the data points in the point cloud cluster to be extracted by the projection contour line is projected onto a horizontal plane, and a contour line obtained by projecting each of the data points in the horizontal plane is used as a projection contour line of the point cloud cluster to be extracted by the projection contour line.
7. The method according to claim 1, characterized in that When there is a sloping roof in the building, the corresponding building bodies are constructed based on the contour lines and the layer heights corresponding to the layered point cloud data, respectively, including: Based on the contour lines corresponding to the layered point cloud data, respectively calculating the enclosed areas corresponding to the contour lines as the building cross-sectional areas of the corresponding layered point cloud data; According to the building cross-sectional area and the corresponding layered height, obtaining the area change distribution of each building cross-sectional area as the height changes; In the height direction of the building, extracting each of the layered point cloud data whose area change distribution changes linearly; dividing each of the layered point cloud data whose linear changes are distributed into corresponding layered point cloud data groups based on the layered height, to obtain each of the layered point cloud data groups; Extracting group contours and group layer heights for each of the layered point cloud data groups to obtain group contours and group layer heights corresponding to each of the layered point cloud data groups; the group contours are contours of the layered point cloud data corresponding to the smallest layer height in the layered point cloud data group; the group layer heights are the largest layer heights in the layered point cloud data group; Based on the group contour lines and group layer heights corresponding to each of the layered point cloud data groups, the building bodies corresponding to the layered point cloud data groups are respectively constructed; and based on the contour lines and layer heights corresponding to the nonlinearly changing layered point cloud data, the building bodies corresponding to the nonlinearly changing layered point cloud data are respectively constructed.
8. A building white mold automatic extraction system, characterized in that: include: A calculation module, used for calculating a normal vector corresponding to each data point in the point cloud data based on the point cloud data of the building; A stratification module, used for stratifying the point cloud data based on the normal vector in the height direction of the building to obtain each layer height of the building and the layered point cloud data corresponding to the layer height; A contour line extraction module is used to perform a contour line extraction operation on each of the layered point cloud data to obtain a contour line corresponding to each of the layered point cloud data; the contour line extraction module includes a fusion extraction submodule; the fusion extraction submodule is used to obtain a preset slice thickness, and to slice out slice point cloud data of the preset slice thickness from the layered point cloud data in the height direction of the building; Based on the spatial distribution characteristics of the data points, clustering the data points in the slice point cloud data to obtain clustered point cloud clusters; In each of the clustered point cloud clusters, a point cloud cluster with a number of data points greater than a preset second number threshold is obtained as a point cloud cluster to be extracted from a projection contour line; projection contour line extraction is performed on each of the point cloud clusters to be extracted from a projection contour line to obtain a projection contour line corresponding to each of the point cloud clusters to be extracted from a projection contour line, and each of the projection contour lines is fused to obtain a fused projection contour line as a contour line corresponding to the layered point cloud data; The white model construction module is used to construct the corresponding building bodies based on the contour lines and the layer heights corresponding to each layered point cloud data, including: obtaining the layered point cloud data to be constructed; starting from the previous height in the height direction of the building, stretching the contour lines corresponding to the layered point cloud data to be constructed to the corresponding height of the contour lines to form the building bodies corresponding to the layered point cloud data to be constructed; executing the above-mentioned stretching process for other layered point cloud data to be constructed, respectively, to obtain the building bodies corresponding to each layered point cloud data; in the height direction of the building, stacking each of the building bodies in sequence to form an overall building model as the white model of the building.
9. The system according to claim 8, characterized in that The projection contour line extraction comprises: Based on the point coordinates, each of the data points in the point cloud cluster to be extracted from the projection contour line is projected onto a horizontal plane, and a contour line formed by the projection of each of the data points in the horizontal plane is used as a projection contour line of the point cloud cluster to be extracted from the projection contour line.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the method described in any one of claims 1 to 7 is implemented.
