Roof parameter extraction and building three-dimensional modeling method based on central axis transformation
Through the method based on central axis transformation, the problem of difficult to extract the roof three-dimensional parameter information in the drone image is solved, and the rapid construction of the three-dimensional model of urban buildings is realized, and the drone technology is improved in urban planning and disaster assessment. Application efficiency and accuracy.
Patent Information
- Application Number
- CN202411099648.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-12-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to automatically extract the three-dimensional parameter information of building roofs from high-precision drone images, especially the roof slope and height, and it is difficult to meet the needs of the three-dimensional model of urban buildings.
Using a central axis transformation method, a three-dimensional model of the building is constructed by discrete point sampling and KD tree construction of the building outline polygon, the central axis point is extracted, and the height and slope of the sampling points are obtained in the slope raster image.
It has achieved rapid construction of three-dimensional urban building models, and improved the application efficiency and accuracy of drone technology in urban planning and disaster assessment.
Smart Images

Figure CN119091040A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of surveying and mapping engineering, and in particular relates to a method for extracting roof parameters and three-dimensional building modeling based on medial axis transformation. Background Art
[0002] With the rapid development of drone technology, drones are increasingly being used in various fields. Drones are equipped with high-precision cameras and sensors to shoot and measure the ground with high precision and high resolution. At the same time, due to their low price and easy access, settlement mapping and building 3D modeling based on drone images are becoming more and more popular among cartographers. Drone roof parameter extraction refers to the use of high-resolution images taken by drones to extract the geometric parameters of the roof, such as area, slope, direction, etc., through image processing and pattern recognition technology. These parameters have important application value for urban planning, environmental assessment, disaster assessment, etc.
[0003] At present, methods based on machine learning and deep learning have been able to extract building roofs from high-precision drone images. However, the extracted roofs are usually represented in pixel form, which is difficult to meet the needs of urban building 3D modeling. This is mainly reflected in the fact that building 3D models are usually vector polygonal surface models. Determining the roof surface of the building 3D model requires parameter information such as roof slope and building height. This information belongs to 3D information, and its automatic extraction and application in the modeling process still faces many difficulties.
[0004] In view of this, it is necessary to provide a method for roof parameter extraction and building three-dimensional modeling based on medial axis transformation. Summary of the invention
[0005] The purpose of the present invention is to at least partially solve the above-mentioned technical problems, and to provide a method for roof parameter extraction and building three-dimensional modeling based on medial axis transformation, which can quickly construct a three-dimensional model of urban buildings based on building polygons and digital surface models, and meet the needs of reconstructing three-dimensional building models based on drone images.
[0006] In one aspect of the present invention, a method for roof parameter extraction and building three-dimensional modeling based on medial axis transformation is provided, the method comprising the following steps:
[0007] Step S1: Slope calculation: Slope calculation is performed on the DSM data of the digital surface model to obtain a slope grid image;
[0008] Step S2: Extracting the medial axis of the building outline polygon: Sampling discrete points of the given building outline polygon and constructing a KD tree, traversing each edge of the building outline polygon, and then sampling multiple points on each edge according to the preset number of edge sampling points, and extracting the corresponding medial axis point for each sampling point;
[0009] Step S3 roof parameter extraction: obtaining the height and slope of each sampling point in the slope grid image according to the line connecting the sampling point and its corresponding mid-axis point, and taking the median value of the height and the median value of the slope of the sampling point corresponding to each edge as the elevation and slope of the edge;
[0010] Step S4: Building 3D modeling: Based on the building 3D modeling, according to the median elevation and slope values corresponding to each sampling point, an array of median elevation and slope values of each edge in the building outline polygon is constructed to construct a 3D model of the building.
[0011] In some embodiments, the medial axis of the polygon is a locus of points with equal distances to two or more sides, and the points falling on the locus are called medial axis points.
[0012] In some embodiments, in the step S2 of extracting the medial axis of the polygon, a circle contraction algorithm is used for each sampling point to extract the medial axis point corresponding to the point.
[0013] In some embodiments, the step S2 of extracting the central axis of the polygon includes:
[0014] Step S21: Sampling the building outline polygon with t edges, generating m sampling points P with equal spacing between the starting point and direction vector of each edge. t ={p1,p2,…,p i …,p m}; Get the building outline point cloud T = P 1 ∪P 2 …∪P t …∪P n , construct a KD tree;
[0015] Step S22: traverse each edge e of the building outline polygon and randomly select n sampling points T s ={p s1 ,p s2 ,…,p si …,p sn}; Determine each sampling point p si The normal vector direction;
[0016] Step S23: Initialize the initial circle radius r to r initial , according to the current sampling point p si Coordinates and Normals Initial radius r initial Calculate the center c initial ;
[0017] Step S25: Start the iterative process, according to the center c initialThe KD tree constructed with the building outline point cloud T searches for the center c initial The nearest neighbor point q next ; Neighboring point q next is the circle center c initial The nearest point;
[0018] Step S26: According to the sampling point p si Coordinates, normal vector and neighboring point q next , calculate the new center c next and radius r next ;
[0019] Step S27: Determine the sampling point p si 、Center c next and radius r next The angle ∠p si c next r next Is it greater than the angle threshold α? If the result of the judgment is greater than the angle threshold α, the center and radius of the circle are updated as p si The median point c si and radius r si , otherwise jump out of the loop;
[0020] Step S28: Repeat steps S22-S27 until all sampling points have obtained the central axis point, and obtain the set C = {c1, c2, c3, ..., c n}.
[0021] In some embodiments, in step S3 of extracting roof slope parameters, the method for obtaining the height and slope of the sampling point includes the following steps:
[0022] S31: Calculate sampling point p si With the central axis point c si The rectangular bounding box G of the line L in the XOY plane;
[0023] S32: Calculate the mask area in the slope grid image corresponding to the rectangular bounding box G according to the lower left corner point and length of the rectangular bounding box G;
[0024] S33: Calculate the pixel points in the mask area that fall on the line L, and take the height and slope values of the pixel points close to the edge of the building outline polygon as the sampling point p si The corresponding height h si and slope s si .
[0025] In some embodiments, the step S1 of slope calculation includes:
[0026] Step S11: using the survey area photos obtained by drone photogrammetry, obtaining the digital orthophoto and digital surface model of the survey area by photogrammetry 3D reconstruction method, and taking the building outline polygons and DSM data of the digital surface model corresponding to the digital orthophoto as input;
[0027] Step S12: Use DSM to calculate the slope grid, use a 3×3 sliding window, assume that the 9 pixel values of the DSM image in the window are (a, b, c, d, e, f, g, h, i), during the window sliding process, the slope value of the central pixel will be calculated through the 8 adjacent pixel values in the sliding window to obtain a slope grid image, and use DSM to perform slope calculation to reflect the slope information of the roof.
[0028] In some embodiments, when calculating the values of 8 adjacent pixels,
[0029] The rate of change of the pixel in the x direction is:
[0030]
[0031] The rate of change of the pixel in the y direction is:
[0032]
[0033] The slope is:
[0034]
[0035] In some embodiments, in step S4 of building three-dimensional modeling, the method of building three-dimensional modeling based on shape grammar constructs a three-dimensional model of the building based on the building outline polygon and according to the elevation and slope of each edge of the building outline polygon.
[0036] In some embodiments, the step S4 of building three-dimensional modeling includes:
[0037] Step S41: stretching the building outline polygon to a predetermined height to obtain a building polygon plot, wherein the predetermined height is calculated based on the elevation of each side of the building outline polygon;
[0038] Step S42: constructing a roof surface model using each edge of the building outline polygon and its corresponding slope;
[0039] Step S43: construct a three-dimensional building model based on the building polygonal plot and the roof surface model.
[0040] Furthermore, the step S42 is specifically as follows:
[0041] Each edge of the building outline polygon and its corresponding slope are used to construct a plane, and adjacent planes are intersected based on binary tree space partitioning to obtain binary plane face elements;
[0042] Whether the candidate face element is a roof surface is determined through the intersection relationship between the plane face element and the DSM surface, and a roof surface model is constructed.
[0043] In another aspect of the present invention, a readable storage medium is provided, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the method for extracting roof parameters and three-dimensional building modeling based on medial axis transformation is performed.
[0044] The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to an embodiment of the present invention has at least one of the following advantages:
[0045] The present invention proposes a method for roof parameter extraction and building three-dimensional modeling based on medial axis transformation, which better realizes the roof parameter extraction based on building outline polygons and DSM, can meet the needs of building three-dimensional model reconstruction, and is of great significance for promoting the application of drone technology and improving the efficiency and accuracy of urban planning, environmental protection and disaster assessment. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] These and / or other aspects and advantages of the present invention will become apparent and readily understood from the following description of the preferred embodiments in conjunction with the accompanying drawings, in which:
[0047] Figure 1 A flowchart of a method for extracting roof parameters and three-dimensional building modeling based on medial axis transformation according to an embodiment of the present invention;
[0048] Figure 2 for Figure 1 The schematic diagram including building polygons and DSM as input data of the present invention in the method shown;
[0049] Figure 3 Based on Figure 2 Schematic diagram of the slope raster image generated by the DSM is shown;
[0050] Figure 4 for Figure 2 Schematic diagram of medial axis transformation of building outline polygon shown;
[0051] Figure 5 for Figure 1 Schematic diagram of urban building roof slope parameter extraction in the method shown;
[0052] Figure 6 Based on Figure 1The schematic diagram of the reconstruction result of the building three-dimensional model obtained by the method of roof parameter extraction based on medial axis transformation and building three-dimensional modeling is shown. DETAILED DESCRIPTION
[0053] The technical solution of the present invention is further specifically described below by examples and in conjunction with the accompanying drawings. In the specification, the same or similar reference numerals indicate the same or similar components. The following description of the embodiments of the present invention with reference to the accompanying drawings is intended to explain the overall inventive concept of the present invention and should not be construed as a limitation of the present invention.
[0054] For technical issues mentioned in the background technology section, see Figure 1 , shows a method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to an embodiment of the present invention. The method comprises the following steps:
[0055] The method comprises the following steps:
[0056] Step S1: Slope calculation: Slope calculation is performed on the DSM data of the digital surface model to obtain a slope grid image;
[0057] Step S2: Extracting the medial axis of the building outline polygon: Sampling discrete points of the given building outline polygon and constructing a KD tree, traversing each edge of the building outline polygon, and then sampling multiple points on each edge with a preset number of edge sampling points, and extracting the medial axis point corresponding to each sampling point for each sampling point;
[0058] Step S3 roof parameter extraction: obtaining the height and slope of each sampling point in the slope grid image according to the line connecting the sampling point and its corresponding mid-axis point, and taking the median value of the height and the median value of the slope of the sampling point corresponding to each edge as the elevation and slope of the edge;
[0059] Step S4: Building 3D modeling: Based on the building 3D modeling, a 3D model of the building is constructed according to the elevation and slope of each edge obtained in step S3.
[0060] In one embodiment of the present invention, the medial axis of a polygon refers to a trajectory of points with equal distances to two or more sides, and the points falling on the trajectory are called medial axis points.
[0061] In the step S2 of extracting the medial axis of the polygon, a circle contraction algorithm is used to extract the medial axis point corresponding to each sampling point.
[0062] The steps of slope calculation in step S1 specifically include:
[0063] Step S11: Using the survey area photos obtained by drone photogrammetry, a digital orthophoto (DOM) and a digital surface model (DSM) of the survey area can be obtained through a photogrammetric 3D reconstruction method, with the building outline polygons corresponding to the digital orthophoto and the DSM data of the digital surface model as input. Figure 2 DSM images of top view and three-dimensional view of a digital surface model of a building outline polygon used in one embodiment of the present invention.
[0064] Step S12: Calculate the slope grid using DSM, using a 3×3 sliding window. Assume that the 9 pixel values of DSM in the sliding window are (a, b, c, d, e, f, g, h, i). During the window sliding process, the slope value of the central pixel will be calculated using the values of the 8 adjacent pixels in the sliding window. The rate of change of the pixel in the x direction is:
[0065]
[0066] The rate of change of the pixel in the y direction is:
[0067]
[0068] The slope is:
[0069]
[0070] Based on the above calculation, a slope grid image can be obtained. Using DSM for slope calculation, the slope information of the roof can be reflected, such as Figure 3 As shown, you can see Figure 2 The slope raster image obtained by slope calculation of the DSM shown.
[0071] In one embodiment of the present invention, the specific implementation steps of step S2 of extracting the central axis of the polygon are:
[0072] Step S21: Sample the building outline polygon. Assuming that the polygon contains t edges, generate m sampling points P with equal spacing between the starting point and direction vector of each edge. t ={p1,p2,p i …,p m}; Get the building outline point cloud T = P 1 ∪P 2 …∪P t …∪P n , construct a KD tree;
[0073] Step S22: traverse each edge e of the building outline polygon, from P t Randomly select n sampling points T from s ={p s1 ,ps2 ,p si …,p sn};
[0074] Step S23: For each sampling point p si , determine its normal vector direction;
[0075] Step S24: Figure 4 As shown, the circle contraction algorithm is used to extract the central axis point corresponding to the point. First, the initial circle radius r is initialized to r initial , according to the current point p si Coordinates, normal vector and the initial radius r initial Calculate the center c initial ;
[0076] Step S25: Start the iterative process, according to the center c initial The KD tree constructed with point cloud T searches for c initial The nearest point next ;
[0077] Step S26: According to point p si Coordinates, normal vector and neighboring point q next , calculate the new center c next and r next ;
[0078] Step S27: Determine point p si 、Center c next and r next The angle ∠p si c next r next Is it greater than the angle threshold α? If so, update the center and radius as p si The median point c si and radius r si , otherwise jump out of the loop;
[0079] Step S28: Repeat steps S21-S27 until all sampling points have obtained the central axis points, and obtain the set C = {c s1 ,s c2 ,c s3 ,…,c sn}.
[0080] Furthermore, the specific implementation steps of step S3 roof slope parameter extraction are:
[0081] S31: Figure 5 As shown, according to the sampling point p si With the central axis point c siConnect line L and calculate the rectangular bounding box G;
[0082] S32: Calculate the slope grid image mask area corresponding to G according to the lower left corner point and length of the bounding box G;
[0083] S33: Calculate the pixel points in the mask area that fall on the straight line L, and take the height value and slope value of the pixel point close to the contour edge of the building contour polygon as p si The corresponding height h si and slope s si ;
[0084] S34: Construct the height value array of each edge of the building outline polygon {h s1 ,h s2 ,…,h si …,h sn} and the slope value array {s s1 ,s s2 ,…,s si …,s sn}, use the median height and slope as the height and slope corresponding to the roof edge e;
[0085] In one embodiment of the present invention, step S4 of building 3D modeling is specifically a shape grammar-based building 3D modeling method, which constructs a building 3D model based on the building outline polygon and the elevation and slope of each edge of the building outline polygon.
[0086] In one embodiment of the present invention, step S4 of building three-dimensional modeling is specifically as follows:
[0087] Step S41: stretch the building outline polygon to a predetermined height to obtain a building polygon plot, wherein the predetermined height is calculated based on the elevation of each side of the building outline polygon; optionally, the average elevation of each side of the building outline polygon can be used as the stretching height.
[0088] Step S42: constructing a roof surface model using each edge of the building outline polygon and its corresponding slope;
[0089] Step S43: construct a three-dimensional building model based on the building polygonal plot and the roof surface model. Figure 6 ).
[0090] In one embodiment of the present invention, the method for constructing the roof surface model may be as follows:
[0091] Each edge of the building outline polygon and its corresponding slope are used to construct a plane, and adjacent planes are intersected based on binary tree space partitioning to obtain binary plane face elements;
[0092] Whether the candidate face element is a roof surface is determined through the intersection relationship between the plane face element and the DSM surface, and a roof surface model is constructed.
[0093] The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the method for extracting roof parameters and three-dimensional building modeling based on medial axis transformation is executed.
[0094] In one example, a readable storage medium is provided according to another embodiment of the present invention. The "readable storage medium" of an embodiment of the present invention refers to any medium that participates in providing a program or instruction to a processor for execution. The medium can take a variety of forms, including but not limited to non-volatile media, volatile media and transmission media. Non-volatile media include, for example, optical disks or disks, such as storage devices. Volatile media include dynamic memory, such as main memory. Transmission media include coaxial cables, copper wires and optical fibers, including wires containing buses. Transmission media can also take the form of sound waves or light waves, such as sound waves or light waves generated during radio frequency (RF) and infrared (IR) data communications. Common forms of readable storage media include, for example, floppy disks, flexible disks, hard disks, magnetic tapes, any other magnetic media, CD-ROMs, DVDs, any other optical media, punch cards, paper tapes, any other physical media with hole patterns, RAMs, PROMs and EPROMs, FLASH-EPROMs, any other memory chips or boxes, carriers as described below, or any other media from which a computer can read.
[0095] The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to an embodiment of the present invention has at least one of the following advantages:
[0096] The present invention proposes a method for roof parameter extraction and building three-dimensional modeling based on medial axis transformation, which better realizes the roof parameter extraction based on building outline polygons and DSM, can meet the needs of building three-dimensional model reconstruction, and is of great significance for promoting the application of drone technology and improving the efficiency and accuracy of urban planning, environmental protection and disaster assessment.
[0097] Although some embodiments of the present general inventive concept have been shown and described, it will be appreciated by those skilled in the art that changes may be made to these embodiments without departing from the principles and spirit of the present general inventive concept, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation, characterized in that: The method comprises the following steps: Step S1: Slope calculation: Slope calculation is performed on the DSM data of the digital surface model to obtain a slope grid image; Step S2: Extracting the medial axis of the building outline polygon: Sampling discrete points of the given building outline polygon and constructing a KD tree, traversing each edge of the building outline polygon, and then sampling multiple points on each edge with a preset number of edge sampling points, and extracting the medial axis point corresponding to each sampling point for each sampling point; Step S3 roof parameter extraction: obtaining the height and slope of each sampling point in the slope grid image according to the line connecting the sampling point and its corresponding mid-axis point, and taking the median value of the height and the median value of the slope of the sampling point corresponding to each edge as the elevation and slope of the edge; Step S4: Building 3D modeling: Based on the building 3D modeling, a 3D model of the building is constructed according to the elevation and slope of each edge obtained in step S3.
2. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 1 is characterized in that: In the step S2 of extracting the medial axis of the polygon, a circle contraction algorithm is used to extract the medial axis point corresponding to each sampling point.
3. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 2 is characterized in that: The step S2 of extracting the medial axis of the polygon comprises: Step S21: Sampling the building outline polygon with t edges, generating m sampling points P with equal spacing between the starting point and direction vector of each edge. t ={p1,p2,…,p i …,p m }; Get the building outline point cloud T = P 1 ∪P 2 …∪P t …∪P n , construct a KD tree; Step S22: traverse each edge e of the building outline polygon and randomly select n sampling points T s ={p s1 ,p s2 ,…,p si …,p sn }, and determine each sampling point p si The normal vector direction; Step S23: Initialize the initial circle radius to r initial , according to the current sampling point p si Coordinates and Normals Initial radius r initial Calculate the center c initial ; Step S24: Start the iterative process, according to the center c initial The KD tree constructed with the building outline point cloud T searches for the center c initial The nearest neighbor point q next ; Neighboring point q next is the circle center c initial The point with the smallest distance; Step S26: According to the sampling point p si Coordinates, normal vector and neighboring point q next , calculate the new center c next and radius r next ; Step S27: Determine the point p to be used si 、Center c next and radius r next The angle ∠p si c next r next Is it greater than the angle threshold α? If the result of the judgment is greater than the angle threshold α, the center and radius of the circle are updated as p si The median point c si and radius r si , otherwise jump out of the loop; Step S28: Repeat steps S22-S27 until all sampling points have obtained the central axis point, and obtain the set C = {c1, c2, c3, ..., c n }.
4. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to any one of claims 1 to 3, characterized in that: In step S3 of extracting the roof slope parameters, the method for obtaining the height and slope of the sampling point includes the following steps: S31: Calculate sampling point p si With the central axis point c si The rectangular bounding box G of the line L in the XOY plane; S32: Calculate the mask area in the slope grid image corresponding to the rectangular bounding box G according to the lower left corner point and length of the rectangular bounding box G; S33: Calculate the pixel points in the mask area that fall on the line L, and take the height and slope values of the pixel points close to the edge of the building outline polygon as p si The corresponding height h si and slope s si .
5. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 4 is characterized in that: The step S1 of slope calculation comprises: Step S11: using the survey area photos obtained by drone photogrammetry, obtaining the digital orthophoto and digital surface model of the survey area by photogrammetry 3D reconstruction method, and taking the building outline polygons and DSM data of the digital surface model corresponding to the digital orthophoto as input; Step S12: Calculate the slope grid using the DSM data, using a 3×3 sliding window, assuming that the 9 pixel values of the DSM image in the window are (a, b, c, d, e, f, g, h, i). During the window sliding process, the slope value of the central pixel will be calculated using the 8 adjacent pixel values in the sliding window to obtain a slope grid image.
6. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 5 is characterized in that: When calculating the values of 8 adjacent pixels, The rate of change of the pixel in the x direction is: The rate of change of the pixel in the y direction is: The slope is:
7. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 6 is characterized in that: In step S4 of building three-dimensional modeling, a shape grammar-based building three-dimensional modeling method is adopted to construct a building three-dimensional model based on the building outline polygon and the elevation and slope of each edge of the building outline polygon.
8. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 7 is characterized in that: The step S4 of building three-dimensional modeling includes: Step S41: stretching the building outline polygon to a predetermined height to obtain a building polygon plot, wherein the predetermined height is calculated based on the elevation of each side of the building outline polygon; Step S42: constructing a roof surface model using each edge of the building outline polygon and its corresponding slope; Step S43: construct a three-dimensional building model based on the building polygonal plot and the roof surface model.
9. The method for extracting roof parameters and building three-dimensional modeling based on medial axis transformation according to claim 8, characterized in that: The step S42 is specifically as follows: Each edge of the building outline polygon and its corresponding slope are used to construct a plane, and adjacent planes are intersected based on binary tree space partitioning to obtain binary plane face elements; Whether the candidate face element is a roof surface is determined through the intersection relationship between the plane face element and the DSM surface, and a roof surface model is constructed.
10. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, it executes the method for roof parameter extraction and building three-dimensional modeling based on medial axis transformation as described in any one of claims 1-9.
