Building contour extraction method and device, electronic equipment and storage medium

By determining the normal vector and point density of the building point cloud data, constructing a three-dimensional space straight line, and calculating the cutoff distance, the accuracy and automation problems of building contour extraction in traditional methods are solved, and high-precision and efficient outer contour line extraction is achieved.

CN120807543APending Publication Date: 2025-10-17WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510798720.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-10-17

Smart Images

  • Figure CN120807543A_ABST
    Figure CN120807543A_ABST
Patent Text Reader

Abstract

The invention provides a building contour extraction method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining point cloud data of a target building; determining a normal vector of the segmentation plane according to the point cloud data, and determining a first vector and a second vector according to the normal vector and a Z-axis reference unit vector; for each boundary point in the point cloud data, constructing a three-dimensional space straight line passing through the boundary point according to the first vector and the second vector, and calculating the point density of the three-dimensional space straight line; calculating the cut-off distance of the boundary point; determining main body contour points of the target building according to the cut-off distance and the point density; and determining an outer contour line of the target building according to the main body contour point, the first vector and the second vector. The accuracy of building outer contour extraction can be improved, and the extraction efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of building geometric modeling, and in particular to a building contour extraction method and device, an electronic device, and a storage medium. BACKGROUND

[0002] With the development of unmanned aerial vehicle technology and the popularization of three-dimensional surveying and mapping technology, unmanned aerial vehicle point cloud data has been widely applied in fields such as building digital modeling, feature extraction, and urban planning. Point cloud data is a three-dimensional spatial data set composed of a large number of discrete points, which can reflect the geometric shape and surface features of a building. Through laser radar (LiDAR) or structured light technology, an unmanned aerial vehicle can quickly and accurately collect point cloud data of a building, providing an important basis for high-precision three-dimensional modeling.

[0003] In the regularization processing of building point clouds, the construction of contour lines is one of the key links. The walls and roofs of buildings usually have certain geometric regularity, so the rationality judgment of closed contour lines plays an important role in feature extraction. Traditional contour line extraction methods rely on clustering and fitting of boundary points, but when the point cloud data contains noise or is unevenly distributed, these methods may not be able to ensure the accuracy of the extraction results. SUMMARY

[0004] Therefore, the present application provides a building contour extraction method, device, electronic device, and storage medium, which can improve the accuracy of building outer contour extraction and has high extraction efficiency.

[0005] A first aspect of an embodiment of the present application provides a building contour extraction method, comprising: obtaining point cloud data of a target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of a building group by a segmentation plane; determining a normal vector of the segmentation plane according to the point cloud data, and determining a first vector and a second vector according to the normal vector and a Z-axis reference unit vector, wherein the first vector is used to represent a horizontal contour direction of an outer contour of the target building, and the second vector is used to represent a vertical contour direction of the outer contour of the target building; for each boundary point in the point cloud data, constructing a three-dimensional space straight line passing through the boundary point according to the first vector and the second vector, and calculating the point density of the three-dimensional space straight line; calculating the cutoff distance of the boundary point, wherein the cutoff distance is the minimum distance between the boundary point and a target three-dimensional space straight line corresponding to a target boundary point, and the target boundary point is another boundary point whose point density is greater than that of the boundary point; determining a main contour point of the target building according to the cutoff distance and the point density; and determining an outer contour line of the target building according to the main contour point, the first vector, and the second vector.

[0006] Compared with the related art, the embodiments of the present application have at least the following advantages: by determining the normal vector of the segmentation plane according to the point cloud data of the target building, the accurate horizontal profile direction and vertical profile direction of the target building can be derived based on the normal vector. By determining the point density of the three-dimensional space straight line corresponding to each boundary point, and then calculating the cutoff distance of each boundary point, since the cutoff distance is the minimum distance between the boundary point and the target three-dimensional space straight line corresponding to the target boundary point, and the target boundary point is another boundary point with a point density greater than that of the boundary point, and since the point density and the cutoff distance of the points on the main profile of the target building are both large among all the boundary points extracted from the point cloud data, the main profile points among the boundary points can be determined by the point density and the cutoff distance. Finally, the outer contour line of the target building is determined based on the main profile points, the first vector and the second vector. Since the main profile points, the first vector and the second vector determined have high accuracy, the outer contour line determined finally has high accuracy. In addition, the above-mentioned extraction method of the outer contour line reduces manual intervention and has high automation, thereby improving the efficiency of the extraction of the outer contour of the target building.

[0007] In a possible implementation, before the point density of the three-dimensional space straight line is calculated, the method further includes: calculating a first distance between each boundary point and the three-dimensional space straight line; comparing each first distance with a preset distance to obtain the number of boundary points with a first distance less than the preset distance; and the calculation of the point density of the three-dimensional space straight line includes: calculating the point density of the three-dimensional space straight line when the number is greater than a preset number.

[0008] In a possible implementation, the three-dimensional space straight line includes N original points, where N is an integer greater than 1, and the original points include points obtained by projecting the point cloud corresponding to the point cloud data to the three-dimensional space straight line; and the calculation of the point density of the three-dimensional space straight line includes: obtaining an end point coordinate of any end point on the three-dimensional space straight line; calculating a second distance between each original point and the end point according to N coordinates corresponding to the N original points and the end point coordinate; sorting N second distances and calculating the difference between adjacent two second distances to obtain N-1 difference values; calculating the average of the N-1 difference values and the standard deviation of the average; and performing exponential normalization on the standard deviation to obtain the point density of the three-dimensional space straight line.

[0009] In one possible implementation, determining the normal vector of the segmentation plane based on the point cloud data includes: extracting boundary points of the point cloud data; projecting the boundary points onto the segmentation plane; calculating the average value of the point cloud in the segmentation plane, and constructing a covariance matrix based on the average value; performing eigenvalue decomposition on the covariance matrix, and using the eigenvector corresponding to the minimum eigenvalue obtained after the eigenvalue decomposition as the normal vector.

[0010] In one possible implementation, determining the first vector and the second vector based on the normal vector and the Z-axis reference unit vector includes: calculating a first product of the normal vector and the Z-axis reference unit vector, the first vector being the first product; calculating a second product of the first vector and the normal vector, the second vector being the second product.

[0011] In a possible implementation, determining the outer contour line of the target building according to the main contour points, the first vector, and the second vector includes: Determine a horizontal main contour line and a vertical main contour line based on the main contour point, the first vector and the second vector; determine the intersection between the horizontal main contour line and the vertical main contour line; calculate a first minimum value of the distance between the intersection and the boundary point on the horizontal main contour line, and a second minimum value of the distance between the intersection and the boundary point on the vertical main contour line; determine a positional relationship between the horizontal main contour line and the vertical main contour line based on the first minimum value and the second minimum value; determine the outer contour line based on the horizontal main contour line, the vertical main contour line and the positional relationship.

[0012] In a possible implementation, constructing a three-dimensional space line passing through the boundary point according to the first vector and the second vector includes: constructing the three-dimensional space line according to the following formula: ;in,( , , ) are the coordinates of the boundary points, is the first vector or the second vector.

[0013] In a second aspect, the embodiments of the present application further provide a building contour extraction device, comprising: an obtaining module, a first determining module, a first calculating module, a second calculating module, a second determining module, and a third determining module; the obtaining module is configured to obtain point cloud data of a target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of a building group by a segmentation plane; the first determining module is configured to determine a normal vector of the segmentation plane according to the point cloud data, and determine a first vector and a second vector according to the normal vector and a Z-axis reference unit vector, wherein the first vector is used to represent a horizontal contour direction of an outer contour of the target building, and the second vector is used to represent a vertical contour direction of the outer contour of the target building; for each boundary point in the point cloud data, the first calculating module is configured to construct a three-dimensional space straight line passing through the boundary point according to the first vector and the second vector, and calculate a point density of the three-dimensional space straight line; the second calculating module is configured to calculate a cutoff distance of the boundary point, wherein the cutoff distance is a minimum distance between the boundary point and a target three-dimensional space straight line corresponding to a target boundary point, and the target boundary point is another boundary point with a point density greater than that of the boundary point; the second determining module is configured to determine a main contour point of the target building according to the cutoff distance and the point density; and the third determining module is configured to determine an outer contour line of the target building according to the main contour point, the first vector, and the second vector.

[0014] In a third aspect, the embodiments of the present application further provide an electronic device, comprising a processor and a memory, wherein the memory is configured to store instructions, and the processor is configured to invoke the instructions in the memory, so that the electronic device performs the building contour extraction method according to the first aspect.

[0015] In a fourth aspect, the embodiments of the present application further provide a storage medium, and the computer readable storage medium stores computer instructions, when the computer instructions run on an electronic device, so that the electronic device performs the building contour extraction method according to the first aspect.

[0016] The technical effects obtained by the second aspect, the third aspect, and the fourth aspect are similar to the technical effects obtained by the corresponding technical means in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0017] Figure 1 A step flowchart of the building contour extraction method provided by an embodiment of the present application.

[0018] Figure 2 A main contour decision diagram of point density and cutoff distance provided by an embodiment of the present application. ​​

[0019] Figure 3 A schematic diagram of relative position relationship between the horizontal body contour line and the vertical body contour line is provided for an embodiment of the present application.

[0020] Figure 4 A schematic diagram of intersection position between the horizontal body contour line and the vertical body contour line is provided for an embodiment of the present application.

[0021] Figure 5 A schematic diagram of application scenario of wall surface point cloud body contour extraction is provided for an embodiment of the present application.

[0022] Figure 6 Another step flow chart of the building contour extraction method is provided for an embodiment of the present application.

[0023] Figure 7 A functional module diagram of the building contour extraction device is provided for an embodiment of the present application.

[0024] Figure 8 A structural schematic diagram of the electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to more clearly understand the above objectives, features and advantages of the present application, the present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0026] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application. The described embodiments are only some of the embodiments of the present application, and are not all the embodiments.

[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used in the specification of the present application are only for the purpose of describing the specific embodiments of the present application, and are not intended to limit the present application.

[0028] It should be further noted that, in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or device. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0029] In the present application, “at least one” means one or more, and “multiple” means two or more than two. “And / or” describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The terms “first”, “second”, “third”, “fourth” and the like (if any) in the specification and claims of the present application and the drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0030] In the embodiments of the present application, the words such as “exemplary” or “for example” are used to mean an example, illustration, or description. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the use of “exemplary” or “for example” and the like is intended to present the relevant concept in a specific manner.

[0031] For ease of understanding, some descriptions of concepts related to the embodiments of the present application are exemplarily given for reference.

[0032] Boundary point: Let A be a subset of a topological space X, if any neighborhood of point x contains both points of A and points not in A, then x is called a boundary point of A. The boundary point may or may not belong to the set A (such as isolated points belong to the set but not the aggregate point).

[0033] Region growing algorithm: an image / point cloud segmentation method based on pixel or point cloud similarity, the core idea of which is to start from the initial seed point and gradually merge the adjacent similar regions according to certain criteria.

[0034] Please refer to Figure 1 , Figure 1 is a step flow chart of an embodiment of the building contour extraction method of the present application. The order of the steps in the flow chart can be changed according to different needs, and some steps can be omitted. The building contour extraction method of the present application can be applied to a building contour extraction device, but is not limited thereto, and the embodiments of the present application do not limit this.

[0035] The specific process of the present embodiment is shown in Figure 1 , including the following steps: Step 101, obtaining point cloud data of a target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of a building group by a segmentation plane.

[0036] In some embodiments, after obtaining the overall point cloud data of the building group by the unmanned aerial vehicle, the overall point cloud data is segmented according to a multi-level region growing algorithm to obtain a planar segmentation result of different building point clouds. That is, the overall point cloud data is segmented into a plurality of segmentation planes, and each segmentation plane corresponds to a building.

[0037] In step 102, a normal vector of the segmentation plane is determined according to the point cloud data, and a first vector and a second vector are determined according to the normal vector and a Z-axis reference unit vector.

[0038] Specifically, the first vector is used to represent the transverse contour direction of the outer contour of the target building, and the second vector is used to represent the vertical contour direction of the outer contour of the target building.

[0039] In some embodiments, determining the normal vector of the segmentation plane according to the point cloud data comprises: extracting a boundary point of the point cloud data; projecting the boundary point onto the segmentation plane; calculating an average value of the point cloud in the segmentation plane, and constructing a covariance matrix according to the average value; performing eigenvalue decomposition on the covariance matrix, and taking the eigenvector corresponding to the smallest eigenvalue obtained after the eigenvalue decomposition as the normal vector.

[0040] In some embodiments, the first vector and the second vector are determined according to the normal vector and the Z-axis reference unit vector, comprising: calculating a first product of the normal vector and the Z-axis reference unit vector, and the first vector is the first product; calculating a second product of the first vector and the normal vector, and the second vector is the second product.

[0041] In order to facilitate understanding, the following specifically describes how to obtain the normal vector of the segmentation plane and how to determine the first vector and the second vector in the embodiment: 1. After projecting the boundary point onto the segmentation plane, the average value of the point cloud in the segmentation plane is calculated according to the following formula: Formula 1: ; wherein n is the number of point clouds in the segmentation plane, is the coordinate of each point in the segmentation plane, is the average value.

[0042] 2. The covariance matrix is constructed according to the above formula 1: Formula 2: ; wherein C is the covariance matrix.

[0043] 3. The covariance matrix C is subjected to eigenvalue decomposition to obtain three eigenvalues , wherein , the eigenvector , the eigenvector , the eigenvector , determine the minimum eigenvalue The corresponding eigenvector is the normal vector of the splitting plane.

[0044] 4. In the target building, the horizontal contour line of the wall point cloud in the outer contour must be perpendicular to the normal vector of the wall and the z-axis direction. Assume that the reference unit vector in the z-axis direction is According to the definition of vector cross product, we can get and Vector: ;in, is the first vector.

[0045] ;in, is the first vector.

[0046] Step 103 : for each boundary point in the point cloud data, construct a three-dimensional space line passing through the boundary point according to the first vector and the second vector, and calculate the point density of the three-dimensional space line.

[0047] In some embodiments, the three-dimensional space straight line is constructed according to the following formula: ;in,( , , ) are the coordinates of the boundary points, is the first vector or the second vector.

[0048] In some embodiments, a three-dimensional space straight line includes N original points, where N is an integer greater than 1, and the original points include points where the point cloud corresponding to the point cloud data is projected onto the three-dimensional space straight line; calculating the point density of the three-dimensional space straight line includes: obtaining the endpoint coordinates of any endpoint on the three-dimensional space straight line; calculating the second distance from each original point to the endpoint based on the N coordinates and endpoint coordinates corresponding to the N original points; sorting the N second distances, and calculating the difference between two adjacent second distances to obtain N-1 differences; calculating the average of the N-1 differences, and calculating the standard deviation of the average; performing exponential normalization on the standard deviation to obtain the point density of the three-dimensional space straight line.

[0049] To facilitate understanding, the following specifically describes how this embodiment calculates the point density of a straight line in three-dimensional space: 1. Project the point cloud near the three-dimensional space line onto the three-dimensional space line. Assume that the point projected onto the three-dimensional space line The coordinates are ( ), the number of points projected onto the straight line in three-dimensional space is .

[0050] 2. Determine the coordinates of any endpoint on a straight line in three-dimensional space ( ), calculate the distance from all points on a straight line in three-dimensional space to the endpoints according to the following formula ( )'s second distance : .

[0051] 3. Distance Sort and get the sorted distance . Calculate the difference between two adjacent second distances: Formula 3: ,in, is the difference between two adjacent second distances.

[0052] 4. Calculate according to the following formula Average value :Formula 4:

[0053] 5. According to formula 3 and formula 4, we can get The standard deviation of: ;in, is the standard deviation.

[0054] 6. Due to and The magnitude is different, and Perform exponential normalization: Formula 5: ; Among them, Formula 5 is one of the point density judgment conditions of the three-dimensional space line, and the number of points projected onto the three-dimensional space line is As the second condition for determining the point density of a three-dimensional line, the point density on the three-dimensional line is obtained: ;in, is the point density on a straight line in three-dimensional space.

[0055] Step 104: Calculate the cutoff distance of the boundary point.

[0056] Specifically, the cutoff distance is the minimum distance between a boundary point and a target three-dimensional space straight line corresponding to a target boundary point, and the target boundary point is another boundary point having a point density greater than that of the boundary point.

[0057] Step 105: Determine the main contour points of the target building according to the cutoff distance and the point density.

[0058] Specifically, the greater the cut-off distance and the greater the point density, the more likely the corresponding boundary point is a main contour point.

[0059] For the convenience of understanding, the following will be combined with Figure 2 , to make a specific description of how to calculate the cut-off distance of the boundary point and how to determine the main contour point: 1. According to the calculation method of the preceding step 3, the point density of the three-dimensional space straight line corresponding to each boundary point is obtained , and the point density is arranged in descending order.

[0060] 2. Calculate the point density of each point density , and the distance from the corresponding boundary point i to other three-dimensional space straight lines , so as to obtain the cut-off distance , and the cut-off distance is determined by calculating the minimum distance between the boundary point i and other point density higher three-dimensional space straight lines: .

[0061] 3. According to the point density and the cut-off distance , the decision diagram of the main contour shown in FIG. Figure 2 can be obtained.

[0062] Specifically, Figure 2 , (c) in FIG. shows the cut-off distance of each boundary point. Regarding the change diagram of the point density , it represents the decision diagram of the wall main contour determination. The greater the cut-off distance and the greater the density Figure 2 , the more likely it is a point on the main contour, such as the points in the dashed box of (a), (c) in FIG. Figure 2 . There are four points in the dashed box of (a) in FIG. Figure 2 , which are points on the four horizontal main contours of the wall, as shown in (b) in FIG. Figure 2 . There are three points in the dashed box of (a) in FIG. Figure 3 to Figure 5 , which are points on the three vertical main contours of the wall, as shown in (d) in FIG. . According to the points on the horizontal and vertical main contours of the wall and the first and second vectors, the fitting straight line of the wall main contour can be obtained.

[0063] Step 106, determining the outer contour line of the target building according to the main contour point, the first vector and the second vector.

[0064] In some embodiments, the transverse body contour line and the vertical body contour line are determined according to the body contour point, the first vector and the second vector; an intersection between the transverse body contour line and the vertical body contour line is determined; a first minimum value of a distance between the intersection and a boundary point on the transverse body contour line and a second minimum value of a distance between the intersection and a boundary point on the vertical body contour line are calculated; a positional relationship between the transverse body contour line and the vertical body contour line is determined according to the first minimum value and the second minimum value; and the outer contour line is determined according to the transverse body contour line, the vertical body contour line and the positional relationship.

[0065] For the purpose of better understanding, the following will be described in combination with Figure 3 The outer contour line is determined in the embodiment as follows: Suppose two transverse body contour lines are determined as and , and two vertical body contour lines are determined as and . Please refer to Figure 3 , a schematic diagram of the relative positional relationship between the transverse body contour line and the vertical body contour line provided by the embodiment of the present application.

[0066] Figure 3 In FIG. 1(a), the extension line of the transverse body contour line intersects with the vertical body contour line, which is taken as a first case. Figure 3 In FIG. 1(b), the extension line of the vertical body contour line intersects with the transverse body contour line, which is taken as a second case. Figure 3 In FIG. 1(c), the transverse body contour line intersects with the vertical body contour line, which is taken as a third case. Figure 4 In FIG. 1(d), the extension line of the transverse body contour line intersects with the extension line of the vertical body contour line, which is taken as a fourth case. The intersection point of the extension line of the transverse body contour line and the extension line of the vertical body contour line is determined as . The minimum values of the distances from the intersection point to all boundary points on the transverse body contour line and the vertical body contour line are calculated respectively, and two minimum distance values and are obtained. The minimum distance values and are used to determine the positional relationship between the transverse body contour line and the vertical body contour line: .

[0067] For case 1, case 2 and case 3, the intersection of the transverse body contour line and the vertical body contour line is used to obtain the coordinates of the body contour line corner point. For case 4, please refer to Figure 4 , there can be two intersection points in two cases: The horizontal main contour line and the vertical main contour line directly intersect to obtain the main contour line corner coordinates, such as Figure 4 As shown in (a). The endpoints of the horizontal main contour line and the vertical main contour line extend in different directions and intersect to obtain the main contour line corner point, as shown in Figure 5 As shown in (b). By detecting the proportion of wall points within the closed contour line to the total number of wall points , if the ratio If the requirements are met, the constructed closed contour is the optimal contour. How to detect whether the closed contour is the optimal contour is described in detail in subsequent embodiments. In order to avoid repetition, it will not be described here.

[0068] According to the above method, the main outline of the wall point cloud is constructed, such as Figure 5 shown. Figure 5 (a)(b)(c) are the original UAV point clouds of the three walls respectively. Figure 5 (d)(e)(f) are the point cloud contour points of the three walls respectively. Figure 6 (g)(h)(i) are the main outlines of the three wall point clouds respectively.

[0069] Compared to related technologies, the embodiments of the present application have at least the following advantages: by determining the normal vector of the segmentation plane based on the point cloud data of the target building, it is possible to deduce the target building's accurate horizontal and vertical contour directions based on the normal vector. By determining the point density of the three-dimensional space line corresponding to each boundary point, and then calculating the cutoff distance of each boundary point, since the cutoff distance is the minimum distance between the boundary point and the target three-dimensional space line corresponding to the target boundary point, and the target boundary point is a boundary point with a point density greater than the point density of the boundary point, and since the cutoff distance and point density corresponding to the points on the main contour of the target building are both large among all the boundary points extracted from the point cloud data, the main contour points among the boundary points can be determined based on the cutoff distance and point density. Finally, the outer contour line of the target building is determined based on the main contour points, the first vector, and the second vector. Since the determined main contour points, the first vector, and the second vector all have high precision, the final outer contour line is highly accurate. In addition, the above outer contour line extraction method reduces manual intervention and has a high degree of automation, thereby improving the efficiency of target building outer contour extraction.

[0070] Please refer to Figure 6 , Figure 6 This is a flowchart of the steps of one embodiment of the building outline extraction method of the present application. Depending on different needs, the order of the steps in this flowchart can be changed, and some steps can be omitted. This building outline extraction method can be applied to the aforementioned building outline extraction device, but is not limited thereto, and this embodiment of the present application is not limited thereto.

[0071] The embodiment is a further improvement of the foregoing embodiment, and specifically, in the embodiment, it is further judged whether the point density of the straight line in the three-dimensional space needs to be calculated. In this way, the efficiency of building contour extraction can be further improved.

[0072] The specific process of the embodiment is shown in Figure 7 The specific process of the embodiment is shown in Step 201, obtaining point cloud data of a target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of a building group by a segmentation plane.

[0073] Step 202, determining a normal vector of the segmentation plane according to the point cloud data, and determining a first vector and a second vector according to the normal vector and a Z-axis reference unit vector.

[0074] Step 203, for each boundary point in the point cloud data, constructing a straight line in the three-dimensional space passing through the boundary point according to the first vector and the second vector.

[0075] Step 204, calculating a first distance between each boundary point and the straight line in the three-dimensional space.

[0076] Step 205, comparing each first distance with a preset distance, and obtaining the number of boundary points whose first distance is less than the preset distance.

[0077] In some embodiments, the preset distance is 0.1. It can be understood that the embodiment does not specifically limit the size of the preset distance, which can be set according to actual needs.

[0078] Step 206, in the case that the number is greater than a preset number, calculating the point density of the straight line in the three-dimensional space.

[0079] In some embodiments, the preset number is 5. It can be understood that the embodiment does not specifically limit the size of the preset number, which can be set according to actual needs.

[0080] Step 207, calculating a cutoff distance of the boundary point.

[0081] Step 208, determining a main contour point of the target building according to the cutoff distance and the point density.

[0082] Step 209, determining an outer contour line of the target building according to the main contour point, the first vector and the second vector.

[0083] The steps 201, 202, 206 to 209 of the embodiment are similar to the steps 101 to 106 of the foregoing embodiment, and to avoid repetition, they will not be described here.

[0084] Compared with the related art, the embodiments of the present application have at least the following advantages: by determining the normal vector of the segmentation plane according to the point cloud data of the target building, the accurate horizontal profile direction and vertical profile direction of the target building can be derived based on the normal vector. By determining the point density of the three-dimensional space straight line corresponding to each boundary point, and then calculating the cutoff distance of each boundary point, since the cutoff distance is the minimum distance between the target three-dimensional space straight line corresponding to the target boundary point and the boundary point, and the target boundary point is another boundary point whose point density is greater than that of the boundary point, and since the point corresponding to the cutoff distance and the point density of the main profile on the main body of the target building are greater among all the boundary points extracted from the point cloud data, the main profile point in the boundary point can be determined by the cutoff distance and the point density. Finally, the outer contour line of the target building is determined based on the main profile point, the first vector and the second vector. Since the main profile point, the first vector and the second vector determined have high accuracy, the outer contour line determined finally has high accuracy. In addition, the above-mentioned extraction method of the outer contour line reduces manual intervention and has high automation, thereby improving the efficiency of the extraction of the outer contour of the target building.

[0085] Based on the same idea as the building contour extraction method in the above embodiment, the present application also provides a building contour extraction device which can be used to execute the above-mentioned building contour extraction method. For ease of illustration, only the parts related to the embodiments of the present application are shown in the structural schematic diagram of the building contour extraction device embodiments, and those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and can include more or fewer components than the illustrated, or combine certain components, or different component arrangements.

[0086] As shown in Figure 8 The building contour extraction device 70 includes an acquisition module 701, a first determination module 702, a first calculation module 703, a second calculation module 704, a second determination module 705 and a third determination module 706. In some embodiments, the above-mentioned modules can be programmable software instructions stored in a memory and executable by a processor. It can be understood that in other embodiments, the above-mentioned modules can also be program instructions or firmware fixed in the processor.

[0087] The acquisition module 701 is configured to acquire point cloud data of a target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of a building group by a segmentation plane; The first determination module 702 is configured to determine a normal vector of the segmentation plane according to the point cloud data, and determine a first vector and a second vector according to the normal vector and a Z-axis reference unit vector, wherein the first vector is used to represent a horizontal profile direction of the target building outer profile, and the second vector is used to represent a vertical profile direction of the target building outer profile. The first calculation module 703 is configured to construct a three-dimensional space straight line passing through the boundary point according to the first vector and the second vector, and calculate a point density of the three-dimensional space straight line, for each boundary point in the point cloud data. The second calculation module 704 is configured to calculate a cutoff distance of the boundary point, wherein the cutoff distance is a minimum distance between the boundary point and a target three-dimensional space straight line corresponding to a target boundary point, and the target boundary point is another boundary point with a point density greater than that of the boundary point. The second determination module 705 is configured to determine a main profile point of the target building according to the cutoff distance and the point density. The third determination module 706 is configured to determine an outer profile line of the target building according to the main profile point, the first vector and the second vector.

[0088] Please refer to 8, Figure 1 is a schematic diagram of an embodiment of the electronic device.

[0089] The electronic device 100 includes a memory 20, a processor 30, and a computer program 40 stored in the memory 20 and executable on the processor 30. The processor 30 implements the steps in the building profile extraction method embodiment described above when executing the computer program 40, for example ​ The steps 101-106 shown.

[0090] For example, the computer program 40 can also be divided into one or more modules / units, one or more modules / units are stored in the memory 20 and executed by the processor 30. One or more modules / units can be a series of computer program instruction segments capable of completing a specific function, and the instruction segments are used to describe the execution process of the computer program 40 in the electronic device 100. For example, it can be divided into the acquisition module 701, the first determination module 702, the first calculation module 703, the second calculation module 704, the second determination module 705, and the third determination module 706 shown.

[0091] Those skilled in the art can understand that the schematic diagram is only an example of the electronic device 100, and does not constitute a limitation on the electronic device 100, and can include more or fewer components than the diagram, or combine certain components, or different components, for example, the electronic device 100 can also include an input / output device, a network access device, a bus, etc.

[0092] The processor 30 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor, a microcontroller, or the processor 30 can also be any conventional processor.

[0093] The memory 20 can be used to store a computer program 40 and / or modules / units, and the processor 30 realizes various functions of the electronic device 100 by running or executing the computer program and / or modules / units stored in the memory 20, and calling data stored in the memory 20. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data (such as audio data) created according to the use of the electronic device 100, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other nonvolatile solid-state storage device.

[0094] The modules / units integrated by the electronic device 100, if implemented in the form of software function units and sold or used as independent products, can be stored in a storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be implemented by a computer program instructing related hardware to complete, and the computer program can be stored in a storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The storage medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the storage medium can be appropriately increased or decreased according to the requirements of patent practice. For example, according to the patent practice, the storage medium does not include the electrical carrier signal and the telecommunication signal.

[0095] The building contour extraction method and device, electronic device and storage medium provided by the present application are described in detail above, and the principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to help understand the method and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the embodiments is only used to

Claims

1. A building outline extraction method, characterized in that: include: Acquiring point cloud data of a target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of the building group using a segmentation plane; Determining a normal vector of the segmentation plane according to the point cloud data, and determining a first vector and a second vector according to the normal vector and a Z-axis reference unit vector, wherein the first vector is used to represent a horizontal contour direction of the outer contour of the target building, and the second vector is used to represent a vertical contour direction of the outer contour of the target building; For each boundary point in the point cloud data, construct a three-dimensional space line passing through the boundary point according to the first vector and the second vector, and calculate the point density of the three-dimensional space line; Calculating a cutoff distance of the boundary point, wherein the cutoff distance is a minimum distance between the boundary point and a target three-dimensional space straight line corresponding to a target boundary point, and the target boundary point is another boundary point having a point density greater than that of the boundary point; Determine the main contour points of the target building according to the cutoff distance and the point density; An outer contour line of the target building is determined according to the main contour points, the first vector and the second vector.

2. The building outline extraction method according to claim 1, wherein Before calculating the point density of the three-dimensional space line, the method further includes: Calculating a first distance between each of the boundary points and the three-dimensional space straight line; Comparing each of the first distances with a preset distance, and obtaining the number of the boundary points whose first distance is smaller than the preset distance; Calculating the point density of the three-dimensional space straight line includes: When the number is greater than a preset number, the point density of the three-dimensional space straight line is calculated.

3. The building outline extraction method according to claim 1 or 2, characterized in that: The three-dimensional space straight line includes N original points, where N is an integer greater than 1, and the original points include points where the point cloud corresponding to the point cloud data is projected onto the three-dimensional space straight line; Calculating the point density of the three-dimensional space straight line includes: Obtaining the endpoint coordinates of any endpoint on the three-dimensional space straight line; Calculate a second distance from each of the original points to the endpoint based on the N coordinates corresponding to the N original points and the endpoint coordinates; Sort the N second distances, and calculate the difference between two adjacent second distances to obtain N-1 difference values; Calculate the average of N-1 differences and the standard deviation of the average; The standard deviation is subjected to exponential normalization processing to obtain the point density of the three-dimensional space straight line.

4. The building outline extraction method according to claim 1, wherein: The determining the normal vector of the segmentation plane according to the point cloud data includes: Extracting boundary points of the point cloud data; Projecting the boundary points onto the segmentation plane; Calculating the average value of the point cloud in the segmentation plane, and constructing a covariance matrix based on the average value; Perform eigenvalue decomposition on the covariance matrix, and use the eigenvector corresponding to the minimum eigenvalue obtained after the eigenvalue decomposition as the normal vector.

5. The building outline extraction method according to claim 4, characterized in that: The determining of the first vector and the second vector according to the normal vector and the Z-axis reference unit vector includes: Calculate a first product of the normal vector and the Z-axis reference unit vector, the first vector being the first product; A second product of the first vector and the normal vector is calculated, and the second vector is the second product.

6. The building outline extraction method according to claim 1, characterized in that: The step of determining the outer contour line of the target building according to the main contour points, the first vector, and the second vector includes: determining a horizontal body contour line and a vertical body contour line according to the body contour point, the first vector, and the second vector; determining an intersection point between the horizontal body contour line and the vertical body contour line; Calculating a first minimum value of a distance between the intersection point and the boundary point on the horizontal main body contour line, and a second minimum value of a distance between the intersection point and the boundary point on the vertical main body contour line; determining a positional relationship between the horizontal main body contour line and the vertical main body contour line according to the first minimum value and the second minimum value; The outer contour line is determined according to the horizontal main contour line, the vertical main contour line and the positional relationship.

7. The building outline extraction method according to any one of claims 1 to 6, characterized in that: The constructing a three-dimensional space straight line passing through the boundary point according to the first vector and the second vector includes: The three-dimensional space straight line is constructed according to the following formula: ; in,( , , ) are the coordinates of the boundary points, is the first vector or the second vector.

8. A building outline extraction device, characterized in that: include: an acquisition module, a first determination module, a first calculation module, a second calculation module, a second determination module, and a third determination module; The acquisition module is used to acquire point cloud data of the target building, wherein the point cloud data is obtained by segmenting the overall point cloud data of the building group using a segmentation plane; The first determination module is used to determine a normal vector of the segmentation plane according to the point cloud data, and to determine a first vector and a second vector according to the normal vector and a Z-axis reference unit vector, wherein the first vector is used to represent a horizontal contour direction of the outer contour of the target building, and the second vector is used to represent a vertical contour direction of the outer contour of the target building; For each boundary point in the point cloud data, the first calculation module is used to construct a three-dimensional space line passing through the boundary point according to the first vector and the second vector, and calculate the point density of the three-dimensional space line; The second calculation module is used to calculate the cutoff distance of the boundary point, wherein the cutoff distance is the minimum distance between the boundary point and the target three-dimensional space straight line corresponding to the target boundary point, and the target boundary point is another boundary point whose point density is greater than the point density of the boundary point; The second determining module is used to determine the main contour points of the target building according to the cutoff distance and the point density; The third determining module is used to determine the outer contour line of the target building according to the main contour points, the first vector and the second vector.

9. An electronic device comprising a processor and a memory, characterized in that: The memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the building outline extraction method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the building outline extraction method according to any one of claims 1 to 7.