Method and device for automatically extracting regular contour of three-dimensional building based on seed points
Through the three-dimensional building regular contour automatic extraction method based on seed points, the projection histogram and the connected domain marking algorithm are used to solve the problems of insufficient accuracy and inefficiency in building contour extraction in the prior art, and efficient and accurate automatic building boundary definition is achieved.
Patent Information
- Application Number
- CN202510425497.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-08
AI Technical Summary
The prior art has problems such as insufficient accuracy, low efficiency and low automation in building profile extraction, especially remote sensing images cannot meet the requirements of high-precision mapping, point cloud data methods lack automated applications, and real scene three-dimensional models rely on manual operations.
The automatic extraction method of the three-dimensional building regular contour based on seed points is adopted. Through projection histogram technology and the connecting domain marking algorithm, combined with the index grid and counting grid, the regular contour of the building is automatically extracted, including the precise definition of the roof and the wall.
It improves the accuracy and efficiency of building profile extraction, can automatically and accurately define building boundaries, adapt to various roof forms, simplify manual operations, and improve the degree of automation of mapping.
Smart Images

Figure CN120279186A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and device for automatically extracting regular outlines of three-dimensional buildings based on seed points, belonging to the field of surveying and mapping technology. Technical Background
[0002] The accurate extraction of building outlines has always been one of the important tasks in the surveying and mapping industry. Currently, the data sources for extracting building outlines mainly include three types: remote sensing images, point cloud data, and real scene three-dimensional model data:
[0003] 1. Remote sensing images can only extract roof outlines and are central projections. For buildings with a certain height, the roof will deviate from the actual position and deform (the area becomes larger). Coupled with the fact that the spatial resolution of remote sensing images is often low, it cannot meet the high-precision mapping requirements of the surveying and mapping industry (usually centimeter-level);
[0004] 2. For point cloud-based methods, many research papers have proposed corresponding algorithms, but there are not many automatic extraction methods that can be used in actual production. Many commercial software still mainly relies on manual mapping.
[0005] 3. Compared with point clouds, the data volume of real scene three-dimensional models is relatively small, and there is rich texture information, which is widely used in the 3D mapping industry, but the efficiency is low.
[0006] In addition, the current commercial software tools for building surveying and mapping mainly utilize the orthogonality principle of building facades. By manually rotating the three-dimensional model to collect points on each wall surface and then generating building outlines, including the commonly used five-point house drawing method. Although this method can ensure the closure and accuracy of the outline, it requires a large amount of manual operation, the work is cumbersome, and the efficiency is low. Summary of the Invention
[0007] Technical Problem: Aiming at the deficiencies of the existing technology, a method and device for automatically extracting regular outlines of three-dimensional buildings based on seed points are provided, which are excellent in the effectiveness of defining building boundaries, accurately depict the regular outlines of buildings through projection histogram technology, and push the three-dimensional mapping work of buildings to a new stage of automation and precision.
[0008] Technical Solution: To achieve the above technical objectives, the present invention provides a method for automatically extracting regular outlines of three-dimensional buildings based on seed points, and its steps are as follows:
[0009] Obtain the triangular mesh data of the real scene three-dimensional model, project the triangular mesh data into two-dimensional data, filter out irrelevant triangular surface data, and construct an index grid and a counting grid to grid the area within the circumscribed rectangle of the triangular mesh on the two-dimensional plane;
[0010] Manually specify a coordinate point on the roof surface on one side of a single building as a seed point, calculate the average roof orientation of the grid neighborhood where the seed point is located, use the connected component labeling algorithm to extract the roof grid on one side, and use the symmetry algorithm to obtain the roof on the other side, thereby obtaining the roof grid area;
[0011] Within the roof range, use the index grid to extract the triangular mesh data of the wall below the roof according to the height and the preset normal vector threshold condition; divide the corresponding triangular mesh of the wall into four groups in four directions, and then perform coordinate transformation on the triangular mesh data of the wall to rotate the wall of the building to the horizontal or vertical direction, and use the projection histogram method to obtain the position of the wall edge line;
[0012] By judging the overlapping situation between the rectangular grid formed by all wall edge lines and the roof grid area, optimize the wall edge line, and finally obtain the planar regular outline of the selected building.
[0013] Furthermore, the specific steps are as follows:
[0014] Data preparation: First, read the triangular mesh data of the real scene 3D model of the research area, and at the same time obtain the attribute information, including: height, normal vector, the angle between the vector and the horizontal plane / vertical angle; then, project the triangular mesh data of the real scene 3D model onto a two-dimensional plane to form two-dimensional data. Since there is only one adjacent triangular mesh in the ground area, combined with the height information, filter out the triangular meshes belonging to the ground; within the circumscribed rectangle of the triangular mesh on the two-dimensional plane, set the grid cell size according to the accuracy of the real scene 3D model, construct an index grid and a counting grid to grid the area within the circumscribed rectangle of the triangular mesh on the two-dimensional plane, and use the index grid and the counting grid to record the ID and the number of triangular meshes projected onto the two-dimensional plane that intersect with each grid cell respectively. In the counting grid, the triangular meshes that are coplanar or collinear but do not intersect are only counted once;
[0015] Obtain the planar range of a single building: First, manually select a coordinate point on the roof surface on one side of the single building to be studied as a seed point, and determine its position in the index grid and the counting grid according to the coordinates of the seed point; obtain the attribute information of all triangular meshes recorded in the corresponding grid cell according to the ID of the triangular meshes recorded in the index grid, and calculate the average roof orientation of the grid neighborhood where the seed point is located; according to the average roof orientation and under the limitation of the height and the normal vector threshold, use the connected component labeling algorithm to extract the roof grid area; for a gable roof, first obtain one side of the roof, and then use the symmetry algorithm to obtain the other side of the roof, and then obtain the complete roof range; within the roof range, use the index grid to extract the triangular mesh data of the wall below the roof according to the height and the preset normal vector threshold condition;
[0016] Extract the regular outline of the building: Count the normal vector information of all the triangular face data of the walls below the roof, classify all the normal vector information in four directions, so as to divide the corresponding wall triangular faces into four groups, and at the same time obtain the orientation of the longest wall; perform coordinate transformation on the wall triangular face data to rotate the building walls to the horizontal or vertical direction, that is, the east-west or north-south orientation; then project the vertices of the east-west oriented wall triangular faces south or north, and project the vertices of the north-south oriented wall triangular faces east or west to form a histogram, and the peak position of the histogram is the position of the corresponding wall edge line, so as to obtain all the wall edge lines and the rectangular grid formed by the wall edge lines; finally, optimize the rectangular grid cells by judging the overlapping situation between the rectangular grid cells and the roof counting grid, as well as the topological characteristics of the rectangular grid cells themselves, remove the non-building areas, merge the remaining grids, and delete the redundant points and redundant lines to finally obtain the regular plane outline of the selected building.
[0017] Furthermore, the specific steps to convert the extracted three-dimensional data into two-dimensional data are as follows:
[0018] Project the triangular mesh of the real-scene three-dimensional model of the entire research area onto the XOY two-dimensional plane to form a two-dimensional triangular mesh, set a suitable grid cell size according to the minimum circumscribed rectangle of the two-dimensional triangular mesh and the accuracy of the real-scene three-dimensional model, and construct an index grid and a counting grid within the range of the minimum circumscribed rectangle; each index grid cell is used to record the triangular face ID intersecting with it, and each counting grid cell is used to record the number of triangular faces projected onto the two-dimensional plane intersecting with it; in the counting grid, the triangular faces that share points or lines but do not intersect are only counted once, so as to ensure that the counting grid can more truly reflect the positional relationship between the building walls and the roof through the values it records, which is convenient for subsequent processing;
[0019] Furthermore, the steps to obtain the roof grid are as follows:
[0020] Manually select a three-dimensional coordinate point on the roof surface of one side of any building as the seed point P0, conduct statistical analysis on the neighborhood of the index grid where the seed point P0 is located, and obtain the prior knowledge about the roof orientation;
[0021] Select the roof grid using the connected component labeling algorithm: Take the grid where the projection position of the seed point P0 in the counting grid is located as the starting point. Through the connected component labeling algorithm, label the counting grids connected to the seed point P0 as the same connected component. At the same time, use the height and the roof normal vector threshold as the judgment criteria to exclude other grids that do not belong to the roof, and accurately determine the roof grid area. For gable roofs, after obtaining the roof grid on one side, construct the minimum bounding rectangle of the roof grid. According to the orientation of the roof on this side, define one side of the minimum bounding rectangle opposite to the orientation of this side of the roof as the ridge line. Then, take the ridge line as the axis of symmetry and find the symmetric point P1 according to the selected seed point P0, so as to obtain the grid on the other side of the roof in the same way, and thus obtain the roof grid area representing the entire roof range.
[0022] Furthermore, after determining the roof grid, query the index grid to obtain the wall triangular surface data by judging the orientation of the triangular surface normal vector at the interior or edge position within the roof range. By traversing all roof grids, the conditions for screening out the wall triangular surface data are: the absolute value of the angle between the normal vector of the indexed triangular surface and the Z-axis / vertical angle is less than the preset threshold, and the threshold is determined by the model accuracy; the absolute value of the centroid height of the indexed triangular surface is less than the minimum height of the roof triangular surface.
[0023] Furthermore, process the screened wall triangular surface data to obtain the regular contour of the building wall. The process is as follows:
[0024] (1) Select a right-angled building. Since the exterior walls of the building have four orientations, that is, the triangular surface normal vectors of the walls have four main directions, divide the screened wall triangular surface data into four groups according to the four main directions, and divide the wall triangular surface data with the same orientation into one group;
[0025] (2) According to the orientation of the longest side of the building, perform coordinate transformation on the screened wall triangular surface data to rotate the building wall into a horizontal or vertical direction;
[0026] (3) Use the projection histogram method. Set the statistical interval according to the accuracy of the real scene 3D model. Project the vertex data of the screened wall triangular surfaces to two perpendicular directions of the four orientations respectively. The wall triangular surfaces in the east-west orientation are projected to the south or north direction, and the wall triangular surfaces in the north-south orientation are projected to the east or west direction, to obtain two histograms of the number of wall triangular surface vertices. Since there are a large number of wall triangular surfaces at the position of the wall, an obvious peak exceeding the preset value will be formed in the histogram. The doors, windows, and interference noises embedded in the wall will form peaks less than the preset value, and the rest will be 0;
[0027] (4) By analyzing the positions of the peaks in the histogram, straight lines representing the outer walls of each side of the building are obtained, and these straight lines together form a rectangular grid with different grid cell sizes.
[0028] (5) By judging the overlapping situation between the rectangular grid cells and the roof counting grid, the grids outside the building range are removed.
[0029] (6) Then, according to the topological characteristics of the remaining grid lines themselves, the grid lines inside the building contour are deleted, and then the redundant collinear points are deleted, and only the two endpoints of each line are retained, and a regular building contour can be constructed.
[0030] A computer device includes a processor and a memory. The processor is electrically connected to the memory. The memory is used to store instructions and data, and the processor is used to execute the automatic extraction method for the regular contour of a three-dimensional building based on seed points.
[0031] Beneficial effects: By understanding the characteristics of the roof, this method can more accurately identify the position of the roof and ensure accuracy and robustness during the building contour extraction process. This method can not only help better understand the structure and shape of the building, but also improve the efficiency and accuracy of building contour extraction.
[0032] This method can accurately define the range of gable roofs and can also effectively handle other common roof forms. Whether it is a complex multi-slope roof or a simple single-slope roof, it can flexibly respond, demonstrating its strong adaptability and practical value. The adopted projection histogram method has four functions: 1) It can further separate each wall in each group; 2) Delete a part of the noise triangular surface data; 3) Delete the triangular surface objects such as doors and windows attached to the wall that are in the same direction as the wall but on different surfaces to ensure the accuracy of the final building contour; 4) Ensure that the obtained building footprint is a right-angled polygon.
[0033] This method is excellent in the effectiveness of defining the building contour. It accurately depicts the regular contour of the building through the projection histogram technique. Its step method is simple, and the degree of automation and extraction accuracy are high. Description of the Drawings
[0034] Figure 1 It is a schematic diagram of the angle between the normal vector and the XOY plane in the embodiment of the present invention;
[0035] Figure 2 It is a schematic diagram of the three-dimensional model of the wall, the triangular mesh data projected onto the XOY plane, and the meshing; (a) is the orthographic projection of the three-dimensional model, (b) is the triangular mesh data projected onto the XOY plane, and (c) is the meshing schematic diagram;
[0036] Figure 3 Schematic diagram of the steps for obtaining the roof grid area in the embodiments of the present invention; (a) shows obtaining half of the roof, and (b) shows obtaining the entire roof grid area;
[0037] Figure 4 Schematic diagram of the wall triangular surface obtained through the roof grid range in the embodiments of the present invention:
[0038] Figure 5 Projection histograms in the horizontal and vertical directions in the embodiments of the present invention;
[0039] Figure 6 Schematic diagram of the generation of the wall contour in the embodiments of the present invention; the line marked as 1 in the figure is the retained line, and the line marked as 2 is the deleted line;
[0040] Figure 7 Schematic diagram of the extraction effect of the building contour in the embodiments of the present invention;
[0041] Figure 8 Schematic diagram of the extraction of the building contour under different occlusions and complex layouts in the embodiments of the present invention, where (a), (b), and (c) in the figure represent schematic diagrams of different building extraction effects.
[0042] Specific implementation method
[0043] The present invention will be further described in detail below with reference to the accompanying drawings:
[0044] The present invention discloses an automatic extraction method for the regular contour of a three-dimensional building based on seed points, and the steps are as follows:
[0045] As Figure 2 shown, first extract the triangulation data: The real-scene three-dimensional model is composed of a triangulation network and texture mapping. Understanding its data structure, it is easy to read the triangulation data of the model, and at the same time obtain or calculate the attribute features of each triangular surface, such as height, normal vector, the included angle between the normal vector and the horizontal plane, etc. In the Cartesian coordinate system, for any triangular surface ΔABC, the normal vector of the triangular surface can be obtained by the cross product of vectors The formula is:
[0046]
[0047] Let point D be the projection point of point N on the horizontal plane XOY, and θ be the normal vector between the normal vector and the horizontal plane XOY. As Figure 1 shown, its formula is:
[0048]
[0049] where the value range of θ is In addition, the height information of the triangular faces is calculated from the height values of the three vertices, including the minimum elevation h min , the maximum elevation h max , and the average elevation h mean .
[0050] Since the model triangular mesh contains a large amount of triangular face data, in the subsequent steps of selecting roof and wall triangular faces, if the original triangular mesh is directly operated on, it will be very time-consuming. To improve the algorithm efficiency, the triangular mesh is flattened onto the XOY two-dimensional plane, and two two-dimensional grid data of the same size are established according to the maximum bounding box of the triangular mesh and the model accuracy: the index grid and the count grid.
[0051] First, the triangular mesh is flattened and projected onto the XOY plane. The purpose of doing this is to simplify the subsequent operations, reduce the direct operation on the original triangular mesh, and thus improve the algorithm efficiency.
[0052] On the flattened two-dimensional plane, grid cells of appropriate size are set according to the minimum circumscribed rectangle of the triangular mesh and the model accuracy. The index grid is used to record the triangular face IDs that intersect with it, while the count grid is used to record the number of flattened overlapping triangular faces that intersect with it.
[0053] In the count grid, only triangular faces that are coplanar or collinear but do not overlap are not counted. For example, when the roof and ground areas are flattened and overlap with other triangular faces, the count is 1, while in the wall area, triangular faces at different heights will have multiple overlapping relationships, so the wall area will have a relatively large count value. In this way, the position and shape of the building walls can be effectively determined. The ground grid is counted as 0. The three-dimensional data is converted into two-dimensional data, and the index grid and the count grid are constructed on the two-dimensional plane.
[0054] As Figure 4 shown, in the process of building contour extraction, a seed point-based method is used to determine the roof position and obtain important information about roof features:
[0055] Manually select a coordinate point on one side of the roof surface as the seed point P0; perform statistical analysis on the neighborhood around the seed point to obtain prior knowledge about roof features. When performing statistics on the neighborhood, a series of important information about the roof can be obtained, such as the angle, orientation, inclination degree, etc. of the roof. This information provides important references for subsequent roof selection and building contour extraction. By understanding the roof features, the position of the roof can be more accurately identified, and the accuracy and robustness can be ensured during the building contour extraction process. This method can not only help better understand the structure and shape of the building, but also improve the efficiency and accuracy of building contour extraction.
[0056] Secondly, the connected component labeling algorithm is used to select the roof grids. Starting from the grid where the projection position of the seed point in the counting grid is located, through the connected component labeling algorithm, the roof grids connected to the seed point can be labeled as the same connected component. However, in the case of tree occlusion or adjacent buildings, the connected components obtained directly using the connected component labeling algorithm may be inaccurate and unable to effectively select the roof of a single building. Therefore, additional limiting conditions, such as height and roof normal vector thresholds, are needed to more precisely select the roof grids. By judging whether the difference between the roof triangular surface normal vector and the average normal vector is less than the threshold, other ground objects are excluded to determine the roof grids.
[0057] On this basis, the roof grids on one side and the triangular surfaces intersecting with them are successfully obtained. Taking the ridge line as the axis of symmetry, the symmetric point P1 is found according to the selected seed point, so that the grids and triangular surface structures on the other side of the roof can be obtained in the same way. Thus, the entire roof range is obtained, as Figure 3 shown, where Contour is the outer polygon of the roof range and RotBox is the minimum area rectangle of the roof range.
[0058] As Figure 5 shown, since the outer wall of the building is usually located at the edge of the roof, when the roof range is determined, the wall triangular surfaces can be obtained by querying the index grid by judging the orientation of the triangular surface normal vector inside or at the edge of the roof range:
[0059] First, the minimum area rectangle and the outer polygon of the roof grids are calculated. The minimum area rectangle is the smallest rectangle surrounding the roof grids, used to define the boundary of the roof range; the outer polygon is the polygon surrounding the roof grids, used to more precisely define the roof range. Next, all roof grids intersecting with the selected triangular surfaces are traversed. To filter out the wall triangular surfaces, the following two conditions are set:
[0060] First, the absolute value of the angle between the normal vector of the indexed triangular surface and the Z-axis / vertical angle is less than 5 degrees;
[0061] Second, the centroid height of the indexed triangular surface is less than the minimum height of the roof triangular surface.
[0062] Through such filtering, the wall triangular surfaces can be accurately identified. These triangular surfaces are located at the edge of the roof and have a small angle with the vertical direction, conforming to the characteristics of the wall. As Figure 3 shown, the purple line represents the outer polygon, as Figure 4 shown, the green ones are the filtered wall triangular surfaces. On this basis, their minimum circumscribed rectangle and outer polygon are calculated, providing the necessary data basis for further research and analysis.
[0063] AsFigure 5 As shown, the projection histogram algorithm is a technique in the fields of image processing and computer vision, commonly used in feature extraction and recognition tasks. Its basic idea is to project the grayscale or color information of an image onto a histogram in a certain direction (horizontal or vertical) to analyze the structure and content of the image. In this section, the building wall contour line is obtained by projecting the selected wall triangular face vertices and statistically analyzing the histogram. The specific process is as follows:
[0064] (1) Most building contours are mainly right-angled polygons. The outer walls of such buildings have four orientations, that is, the normal vectors of the wall triangular faces have four main directions. Based on this, the selected wall triangular faces can be divided into four groups, and the data of the wall triangular faces in the same orientation are grouped together.
[0065] (2) Using the projection histogram method and selecting an appropriate interval, project the data of each group of wall triangular faces onto the vertical direction of the wall orientation respectively, and statistically analyze the histogram of the number of triangular faces. There are more triangular faces at the position where the wall is located, which will form a larger peak in the histogram. The doors, windows and some interference noises embedded in the wall will form smaller peaks, and the rest will be 0.
[0066] (3) By analyzing the positions of the peaks in the histogram, the straight lines representing the outer walls of each side of the building can be obtained, and all the straight lines can construct a rectangular grid with uneven intervals.
[0067] The rectangular grid formed by the building contour line is successfully obtained using the projection histogram method. The further problem is how to accurately merge and split the rectangular grid, and delete redundant points and lines. Using the polygon optimization algorithm, the rectangular grid is optimized into a closed and complete regular contour of the building. The process is as follows.
[0068] (1) By judging the overlapping situation between the rectangular grid cells and the roof grid area, the non-building areas are removed.
[0069] (2) Among the remaining rectangular grids, the internal line segments are shared by two rectangular grids, while the building contour line segments are only used by one rectangular grid. According to this characteristic, the internal line segments can be deleted to retain the outer edge line segments of the roof.
[0070] (3) Finally, delete the redundant points of the remaining line segments, and the regular contour of the building can be obtained, as Figure 6 shown.
[0071] The above algorithm can effectively construct a regular building contour, thereby improving the accuracy and usability of building contour extraction.
[0072] Here, the projection histogram method mainly has four functions: 1) It can further separate each wall in each group, except for non-connected but coplanar walls with the same orientation; 2) Delete some noisy triangular surface data; 3) Delete triangular object surfaces such as doors and windows attached to the wall that have the same orientation as the wall but are on different surfaces to ensure the accuracy of the final building footprint; 4) Ensure that the obtained building footprint is a right-angled polygon. The regular extraction of the outer wall is as Figure 7 shown.
[0073] Example 1: By conducting experiments on the selected area in Yangjiang Town, Gaochun District, Nanjing City, Jiangsu Province and the teaching buildings of Wuhan Donghu University, the robustness of the proposed method in this paper is verified. In the experiment, Data 1 focuses on rural low gable roof buildings, while Data 2 focuses on medium-height four-slope roof structures. These experimental results clearly show the extraction effect of the regular outline of the building, as Figure 8 shown. In this paper, the extraction accuracy of the regular outline of the building is evaluated, as shown in Table 1:
[0074] Table 1 Precision evaluation results
[0075]
[0076] Evaluated by five indicators: mean intersection over union (mIOU), root mean square error (RMSE), correct rate (Cm), recall rate (Cr), and F1 score, the results show that the algorithm proposed in this case has high accuracy in the extraction of the regular outline of the building. The method proposed in this case can also extract the complete outline for some buildings partially blocked by trees, and this method is not only applicable to gable roof buildings, but also to flat roof and four-slope roof buildings, and can obtain the complete outline for some buildings with complex structures, indicating that the proposed method has high accuracy and robustness.
Claims
1. A method for automatically extracting the regular contour of a three-dimensional building based on seed points, characterized in that The steps are as follows: Obtain the triangular mesh data of the real scene 3D model, project the triangular mesh data into 2D data, filter out irrelevant triangular face data, and construct an index grid and a counting grid to grid the area within the circumscribed rectangle of the triangular mesh on the 2D plane. Manually specify a coordinate point on one side of the roof surface of a single building as a seed point, calculate the average roof orientation of the grid neighborhood where the seed point is located, use the connected component labeling algorithm to extract the roof grid on one side, and use the symmetry algorithm to obtain the roof on the other side, thereby obtaining the roof grid area. Within the roof range, use the index grid to extract the triangular face data of the wall below the roof according to the height and the preset normal vector threshold condition; divide the corresponding triangular faces of the wall into four groups in four directions, then perform coordinate transformation on the triangular face data of the wall to rotate the wall of the building to the horizontal or vertical direction, and use the projection histogram method to obtain the position of the wall edge line. By judging the overlapping situation between the rectangular grid formed by all the wall edge lines and the roof grid area, optimize the wall edge lines, and finally obtain the planar regular outline of the selected building.
2. The automatic extraction method of the regular contour of a three-dimensional building based on a seed point according to claim 1, characterized in that The specific steps are as follows: Data preparation: First, read the triangular mesh data of the real scene 3D model of the research area, and at the same time obtain the attribute information, including: height, normal vector, angle between the vector and the horizontal plane / vertical angle; then, project the triangular mesh data of the real scene 3D model onto the 2D plane to form 2D data. Since there is only one layer of adjacent triangular faces in the ground area, combined with the height information, filter out the triangular faces belonging to the ground; within the circumscribed rectangle of the triangular mesh on the 2D plane, set the grid cell size according to the accuracy of the real scene 3D model, construct an index grid and a counting grid to grid the area within the circumscribed rectangle of the triangular mesh on the 2D plane, and use the index grid and the counting grid to record the ID and the number of triangular faces in the triangular mesh projected onto the 2D plane that intersect with each grid cell respectively. In the counting grid, the triangular faces that are coplanar or collinear but do not intersect are only counted once. Obtain the planar range of a single building: First, manually select a coordinate point on one side of the roof surface of the single building to be studied as a seed point, and determine its positions in the index grid and the counting grid according to the coordinates of the seed point; obtain the attribute information of all the triangular faces recorded in the corresponding grid cell according to the ID of the triangular faces recorded in the index grid, and calculate the average roof orientation of the grid neighborhood where the seed point is located; according to the average roof orientation and under the limitation of the height and normal vector thresholds, use the connected component labeling algorithm to extract the roof grid area; for the gable roof, first obtain the roof on one side, and then use the symmetry algorithm to obtain the roof on the other side, and then obtain the complete roof range; within the roof range, use the index grid to extract the triangular face data of the wall below the roof according to the height and the preset normal vector threshold condition. Extract the regular outline of the building: Count the normal vector information of all wall triangle data below the roof, classify all normal vector information according to four directions, so as to divide the corresponding wall triangles into four groups, and obtain the direction of the longest wall at the same time; transform the coordinates of the wall triangle data to rotate the wall of the building to the horizontal or vertical direction, that is, the east-west or north-south direction; then project the vertices of the east-west wall triangles to the south or north, and project the vertices of the north-south wall triangles to the east or west to form a histogram. The peak position of the histogram corresponds to the position of the wall edge line, thereby obtaining all the wall edge lines and the rectangular grid composed of the wall edge lines; finally, by judging the overlap between the rectangular grid unit and the roof counting grid, as well as the topological characteristics of the rectangular grid unit itself, the rectangular grid unit is optimized, non-building areas are eliminated, the remaining grids are merged, and redundant points and redundant lines are deleted, and finally the plane regular outline of the selected building is obtained.
3. The method for automatically extracting a regular contour of a three-dimensional building based on a seed point according to claim 2, characterized in that, The specific steps to convert the extracted three-dimensional data into two-dimensional data are as follows: The triangulated network of the real-life 3D model of the entire study area is projected onto the XOY 2D plane to form a 2D triangulated network. The appropriate grid unit size is set according to the minimum circumscribed rectangular frame of the 2D triangulated network and the accuracy of the real-life 3D model, and the index grid and counting grid are constructed within the minimum circumscribed rectangular frame. Each index grid unit is used to record the ID of the triangle face that intersects with it, and each counting grid unit is used to record the number of triangle faces projected onto the 2D plane that intersect with it. In the counting grid, triangle faces that have common points or are in the same line but do not intersect are counted only once, thereby ensuring that the counting grid can more realistically reflect the positional relationship between the walls and roofs of the buildings through the numerical values recorded, which is convenient for subsequent processing.
4. The method for automatically extracting a regular contour of a three-dimensional building based on seed points according to claim 2, characterized in that, The steps to obtain the roof mesh are as follows: A three-dimensional coordinate point is manually selected on the roof surface of one side of any building as the seed point P0, and a statistical analysis is performed on the neighborhood of the index grid where the seed point P0 is located to obtain prior knowledge about the roof orientation; The connected domain marking algorithm is used to select the roof grid: the grid where the projection position of the seed point P0 in the counting grid is located is taken as the starting point, and the counting grids connected to the seed point P0 are marked as the same connected domain through the connected domain marking algorithm; at the same time, the height and roof normal vector threshold are used as the judgment criteria to exclude other grids that do not belong to the roof, and the roof grid area is accurately determined; for the gable roof, after obtaining the roof grid on one side, the minimum enclosing rectangle of the roof grid is constructed, and according to the orientation of the roof on this side, the edge of the minimum enclosing rectangle on the opposite side of the roof on this side is defined as the ridge line, and then the ridge line is used as the symmetry axis, and the symmetric point P1 is found according to the selected seed point P0, so that the grid on the other side of the roof is obtained in the same way, thereby obtaining the roof grid area representing the entire roof range.
5. The automatic extraction method for regular outlines of three-dimensional buildings based on seed points according to claim 4, wherein, After determining the roof grid, the wall triangular surface data is obtained by querying the index grid based on the orientation of the normal vector of the triangular surface inside or at the edge of the roof range; by traversing all the roof grids, the conditions for screening the wall triangular surface data are as follows: the absolute value of the angle between the normal vector of the indexed triangular surface and the Z-axis / vertical angle is less than a preset threshold, and the threshold is determined by the model accuracy; the absolute value of the centroid height of the indexed triangular surface is less than the minimum height of the roof triangular surface.
6. The method for automatically extracting a regular contour of a three-dimensional building based on a seed point according to claim 5, characterized in that, Process the screened wall triangular surface data to obtain the regular contour of the building wall, and the process is as follows: (1) Select a right-angled building. Since there are four orientations of the outer wall of the building, that is, there are four main directions of the normal vector of the wall triangular surface, the screened wall triangular surface data is divided into four groups according to the four main directions, and the wall triangular surface data of the same orientation is divided into one group; (2) According to the orientation of the longest side of the building, perform coordinate transformation on the screened wall triangular surface data to rotate the building wall into a horizontal or vertical direction; (3) Using the projection histogram method, set the statistical interval according to the accuracy of the real scene three-dimensional model, project the vertex data of the screened wall triangular surfaces to two perpendicular directions of the four orientations respectively. The wall triangular surfaces in the east-west orientation are projected to the south or north direction, and the wall triangular surfaces in the north-south orientation are projected to the east or west direction, obtaining two histograms of the number of vertices of the wall triangular surfaces. Since there are a large number of wall triangular surfaces at the position where the wall is located, an obvious peak exceeding the preset value is formed in the histogram, and the doors, windows and interference noises embedded in the wall will form peaks less than the preset value, and the rest is 0; (4) By analyzing the positions of the peaks in the histogram, obtain the straight lines representing the outer walls of each side of the building, and these straight lines together form a rectangular grid with different grid unit sizes; (5) By judging the overlapping situation between the rectangular grid unit and the roof counting grid, remove the grids outside the building range; (6) Then, according to the topological characteristics of the remaining grid lines themselves, delete the grid lines inside the building contour, and then delete the redundant collinear points, and only retain the two end points of each line, then the regular building contour can be constructed.
7. A computer device, characterized in that, It includes a processor and a memory. The processor is electrically connected to the memory. The memory is used to store instructions and data. The processor is used to execute the method for automatically extracting the regular contour of a three-dimensional building based on seed points according to any one of claims 1-6.
Citation Information
Cited By
Pathological scanning focal plane establishing method based on triangulation
CN121236333A