A method and device for regionalized house three-dimensional reconstruction based on remote sensing data
By extracting road mask division areas in remote sensing data processing, and using building outlines and net heights to determine directions and segmentation rules, the problems of low-rise building processing and house orientation determination in the existing technology are solved, and fast and accurate three-dimensional house reconstruction is achieved. and orientation fitting effect.
Patent Information
- Application Number
- CN202410756170.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-06-13
AI Technical Summary
When the existing technology uses remote sensing data to reconstruct three-dimensional house models, it is difficult to quickly and accurately handle low-rise buildings, and the determination of the house orientation is unrealistic. It relies on empirical parameters and a large amount of training data, and lacks versatility.
The reconstruction area is divided by extracting the road mask, the main direction is determined based on the maximum line segment length and angle interval of the building outline, the segmentation rule is selected according to the net height of the building for individual segmentation, and the main direction is used to determine the building orientation for regularization, and finally based on the elevation The data are reconstructed in three dimensions.
It achieves fast and accurate three-dimensional reconstruction of the house, which can fit the real orientation of the house without relying on empirical parameters and large amounts of training data, improving the unity and versatility of the reconstruction.
Smart Images

Figure CN118334264B
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to image processing technology, and more particularly, to a method and device for regionalized three-dimensional reconstruction of houses based on remote sensing data. Background Art
[0002] Reconstructing three-dimensional house models using remote sensing image data is of great significance for urban planning, development and mapping. Existing reconstruction technologies mainly perform deep learning on remote sensing data, and directly construct three-dimensional house models based on detected building masks or building monomer detection rectangles combined with elevation data. Existing methods mostly use color, height or directly use detected monomer rectangles for cutting when performing mask monomer cutting, which is easy to cut a building separately, and because the height directly depends on the accuracy of elevation data, the effect on low buildings is not good, and the overall monomer segmentation has a large error. At the same time, when the existing methods regularize the outer contour of the monomer target, either the direction of the house becomes uncertain and the orientation is not uniform, or only vertical is used to replace all angles, and the house orientation is not true, or it relies on specially set various empirical parameters and a large amount of training data, which is not universal and cannot be used. In summary, it is difficult for the current methods to quickly and accurately reconstruct the house in three dimensions while making the reconstructed house fit the real orientation of the house. Summary of the invention
[0003] In order to solve the above problems, one or more embodiments of this specification describe a method and device for regionalized three-dimensional reconstruction of houses based on remote sensing data.
[0004] According to a first aspect, a method for regionalized three-dimensional reconstruction of houses based on remote sensing data is provided, the method comprising:
[0005] Determining remote sensing data to be reconstructed, extracting a road mask of the remote sensing data, and dividing the remote sensing data into a plurality of reconstruction areas based on each of the road masks and a boundary line of the remote sensing data;
[0006] For any of the reconstructed areas, determining the main direction of the reconstructed area based on the maximum line segment length and the corresponding angle interval in the building outline;
[0007] For any building in the reconstructed area, the net height of the building is determined based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and the building is segmented into monomers according to the building category corresponding to the net height of the building, so as to obtain each monomer area, wherein the building category includes high-rise buildings and low-rise buildings, and the segmentation rule includes a segmentation rule based on height clustering corresponding to the high-rise building and a segmentation rule based on building rotation box corresponding to the low-rise building;
[0008] For any single area in the reconstruction area, the building direction of each building is determined based on the angle difference with the main direction, and after each building is regularized based on the building direction, each building is three-dimensionally reconstructed based on the elevation data of the single area. The building direction is the main direction when the angle difference is less than a preset difference, and is the building's own direction when the angle difference is not less than the preset difference.
[0009] Preferably, the building outline includes a first building outline and a second building outline;
[0010] The determining the main direction of the reconstruction area based on the maximum line segment length and the corresponding angle interval in the building outline includes:
[0011] Determine the first building outline based on the vector outline of the building mask, determine the angle intervals to which all continuous broken lines on the first building outline belong with a preset angle as the interval interval, determine the first maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the middle value of the first maximum line segment length and the corresponding first angle interval as the first main direction of the reconstructed area;
[0012] Determine the second building outline based on the straight line detection result of the building image, determine the angle intervals to which all continuous broken lines on the second building outline belong using a preset angle as the interval interval, determine the second maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the second main body direction of the reconstructed area using the middle value of the second maximum line segment length and the corresponding second angle interval;
[0013] The accuracy of the first building outline and the second building outline are calculated respectively, and the main direction of the building outline with higher accuracy is used as the main direction of the reconstructed area, and the accuracy is the ratio of the sum of the broken line lengths within the angle interval of the main direction to the sum of all broken line lengths of the building outline.
[0014] Preferably, the determining of the net height of the building based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building comprises:
[0015] Determine a non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a first height histogram of the non-building mask area with a preset height as the height interval, and cumulatively stack the histogram intervals of the first height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the ground surface height;
[0016] Determine a building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a second height histogram of the building mask area with a preset height as the height interval, cumulatively stack the histogram intervals of the second height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the building height;
[0017] The difference between the building height and the ground surface height is calculated to obtain the net height of the building.
[0018] Preferably, the segmentation rule is selected according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area, including:
[0019] For the high-rise building, adjacent pixel search is performed based on the highest point to determine adjacent areas whose height difference with the highest point is less than a second preset ratio of the net height of the building, field search is performed based on the adjacent areas, individualization is performed based on the field search results, and adjacent area determination and field search are repeated in the remaining areas until no pixel points exist in the remaining areas, thereby obtaining each individual area;
[0020] For the low buildings, a rotating target detection model is constructed, and the building rotation frame of each building is detected based on the rotating target detection model, and the building rotation frame is segmented into individual parts to obtain each individual area.
[0021] Preferably, determining the building direction of each building based on the angle difference with the main body direction includes:
[0022] Determine a first orientation of each of the buildings based on a vector outline of a building mask and a second orientation based on a straight line detection result of a building image, and respectively calculate an angular difference between the first orientation and the second orientation and the main body direction;
[0023] When at least one of the angle differences is less than a preset angle, determining the main body direction as the building direction of the building;
[0024] When the difference between the two angles is not less than a preset angle, the direction closest to the main body direction is determined as the building direction of the building.
[0025] Preferably, the regularizing of each of the buildings based on the building directions comprises:
[0026] Determine the longest line segment of the original mask outline of the building in the direction of the building, construct a rectangular frame with the longest line segment as the bottom edge, determine the optimal rectangular frame by scoring the rectangular frame, and regularize the building based on the optimal rectangular frame;
[0027] The optimal rectangular frame that fits together is subjected to polygon fusion.
[0028] Preferably, the three-dimensional reconstruction of each of the buildings based on the elevation data of the monomer area includes:
[0029] Constructing a third height histogram of the building mask area in the monomer area based on the elevation data of the monomer area, accumulating and superimposing the histogram intervals of the third height histogram from high value to low value until the accumulated value is greater than a first preset proportion of the total amount of the histogram, and setting the middle value of the last superimposed histogram interval as the area height of the monomer area;
[0030] The buildings are three-dimensionally reconstructed based on the height of the area.
[0031] According to a second aspect, a regionalized house three-dimensional reconstruction device based on remote sensing data is provided, the device comprising:
[0032] An extraction module, used for determining remote sensing data to be reconstructed, extracting a road mask of the remote sensing data, and dividing the remote sensing data into a plurality of reconstruction areas based on each of the road masks and the boundary lines of the remote sensing data;
[0033] A determination module, for determining, for any of the reconstructed areas, a main direction of the reconstructed area based on a maximum line segment length in a building outline and a corresponding angle interval;
[0034] A segmentation module is used to determine the net height of any building in the reconstruction area based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and to select a segmentation rule according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area, wherein the building category includes high-rise buildings and low-rise buildings, and the segmentation rule includes a segmentation rule based on height clustering corresponding to the high-rise building and a segmentation rule based on building rotation box corresponding to the low-rise building;
[0035] A reconstruction module is used to determine the building direction of each of the buildings based on the angle difference with the main direction for any single area in the reconstruction area, and after regularizing each of the buildings based on the building direction, perform three-dimensional reconstruction on each of the buildings based on the elevation data of the single area, wherein the building direction is the main direction when the angle difference is less than a preset difference, and is the building's own direction when the angle difference is not less than the preset difference.
[0036] According to a third aspect, there is provided an electronic device, comprising a processor and a memory;
[0037] The processor is connected to the memory;
[0038] The memory is used to store executable program code;
[0039] The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method provided in the first aspect or any possible implementation manner of the first aspect.
[0040] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the computer-readable storage medium stores instructions, which, when the instructions are executed on a computer or a processor, cause the computer or the processor to execute the method provided in the first aspect or any possible implementation of the first aspect.
[0041] The method and device provided in the embodiments of this specification first divide the reconstruction area into closed areas formed by road masks, avoiding the cutting and separation of the building body, and then determine the main direction of the reconstruction area through the maximum line segment length and angle interval in the building outline. The main direction is used as a constraint and restriction on the orientation of each subsequent building, thereby increasing the uniformity of the building orientation. Then, the buildings are divided into different building categories according to the different net heights of each building, and different segmentation rules are selected according to the building categories for individual segmentation. Finally, after the building direction of each building in the individual area is determined by the main direction, the building is reconstructed in three dimensions according to the elevation data. In the above manner, the three-dimensional reconstruction of the house can be achieved quickly and accurately without relying on various empirical parameters and a large amount of training data, and the reconstructed house can be made to fit its real orientation, with a good overall reconstruction effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flowchart of a method for regionalized three-dimensional reconstruction of houses based on remote sensing data in one embodiment of the present specification.
[0044] Figure 2 It is a schematic diagram of the structure of a regionalized three-dimensional house reconstruction device based on remote sensing data in one embodiment of the present specification.
[0045] Figure 3 It is a structural diagram of an electronic device in one embodiment of this specification. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0047] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.
[0048] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.
[0049] See also Figure 1 , Figure 1 : is a flow chart of a method for regionalized three-dimensional reconstruction of houses based on remote sensing data provided in an embodiment of the present application. In an embodiment of the present application, the method includes:
[0050] S101 , determining remote sensing data to be reconstructed, extracting road masks of the remote sensing data, and dividing the remote sensing data into a plurality of reconstruction areas based on the road masks and boundary lines of the remote sensing data.
[0051] The execution entity of this application can be a cloud server.
[0052] In the embodiments of this specification, the cloud server will first obtain the remote sensing data required for three-dimensional reconstruction of the house. Since the remote sensing data is generally large, it needs to be divided into multiple areas for separate processing. In order to avoid dividing the house into multiple parts and dividing them into different areas during the regional division process, this application will extract the road mask in the remote sensing data, connect the road mask and the boundary line of the remote sensing data, so as to realize the division of the remote sensing data into closed areas formed by roads through the road mask. Each closed area is a reconstruction area, and each reconstruction area will be processed separately later. Since the house must be surrounded by roads, rather than directly intersecting with the roads, such a division can ensure that no house is divided into multiple parts.
[0053] Among them, the method of extracting road masks from remote sensing data can be to train a Deep LabV3 semantic segmentation network model and extract it through the model. The specific process can be as follows:
[0054] First, we will select areas of different scenes for road mask annotation. The selected areas cover various common road types, including expressways, urban main roads, roads inside building complexes, rural roads, and dirt roads. After annotation, we will crop the images to form a sample set that meets the requirements of neural network training. When cropping samples, we can use different resolutions for the images, so that the trained model can better process image data of different resolutions.
[0055] Next, the initial Deep LabV3 semantic segmentation network is trained to extract the mask of the road in the image. DeepLabv3 extracts features of different scales and fuses them to obtain more accurate results. During the training optimization process, positive and negative samples can be added according to the model prediction results. Among them, positive samples help the model improve the recognition effect on different feature images, and negative samples reduce the model's misidentification, such as vegetable greenhouses, pipelines, and canals. In order to alleviate the problem of imbalance in the number of roads and non-roads, the weight ratio of the loss function can also be set during the training process so that the model pays more attention to the recognition of road areas.
[0056] Finally, considering that the masks extracted by the semantic segmentation model have problems such as jagged edges, disconnections, and holes, they also need to be post-processed and optimized. After the masks are converted into geometric objects, they are first dilated to fill the holes and possible breaks, which can also make the subsequent Simplify results better. Then, shorter geometric objects are filtered out, and Simplify is used to simplify the contour boundaries to make the road boundaries more regular.
[0057] S102: For any of the reconstructed areas, determine a main direction of the reconstructed area based on a maximum line segment length in a building outline and a corresponding angle interval.
[0058] In the embodiment of the present specification, for the reconstruction area being processed, the cloud server will first determine the building outlines of all buildings in the reconstruction area through algorithms such as Douglas-Peuker and Line Segment Detector. Each outline is composed of multiple line segments, and the direction of each line segment may be different, so the cloud server can set different angle intervals at intervals of preset angles (for example, 5 degrees), and attribute each line segment to an angle interval according to the azimuth of each line segment, and calculate the sum of the lengths of all line segments in each angle interval, that is, the sum of the line segment lengths corresponding to the angle interval. The angle interval with the maximum line segment length can be understood as the direction of the largest number of line segments is within the angle interval, then the direction corresponding to the angle interval can be regarded as the main direction of the reconstruction area as a whole. Among them, the main direction can be the middle value of the determined angle interval, that is, for example, if the angle interval is 0-5 degrees, the angle of the main direction is 2.5 degrees. According to different actual needs, other values in the angle interval can also be selected to determine the main direction.
[0059] In addition, a house building is generally a rectangle. The main direction determined in this application is mainly used to characterize the overall orientation of the houses in the reconstruction area. This orientation is mainly used to distinguish the deviation angles between houses, such as whether the houses are facing east or northeast. Therefore, east and north can essentially be regarded as one orientation. For the convenience of calculation and processing, line segments with a difference of 90 degrees can also be merged into a group. That is, assuming that the direction of one line segment is 1 degree and the direction of the other line segment is 91 degrees, the two line segments can both belong to the angle range of 0-5 degrees, thereby changing the overall range of the angle range from 0-180 degrees to 0-90 degrees.
[0060] In one possible implementation, the building outline includes a first building outline and a second building outline;
[0061] The determining the main direction of the reconstruction area based on the maximum line segment length and the corresponding angle interval in the building outline includes:
[0062] Determine the first building outline based on the vector outline of the building mask, determine the angle intervals to which all continuous broken lines on the first building outline belong with a preset angle as the interval interval, determine the first maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the middle value of the first maximum line segment length and the corresponding first angle interval as the first main direction of the reconstructed area;
[0063] Determine the second building outline based on the straight line detection result of the building image, determine the angle intervals to which all continuous broken lines on the second building outline belong using a preset angle as the interval interval, determine the second maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the second main body direction of the reconstructed area using the middle value of the second maximum line segment length and the corresponding second angle interval;
[0064] The accuracy of the first building outline and the second building outline are calculated respectively, and the main direction of the building outline with higher accuracy is used as the main direction of the reconstructed area, and the accuracy is the ratio of the sum of the broken line lengths within the angle interval of the main direction to the sum of all broken line lengths of the building outline.
[0065] In the embodiment of the present specification, the cloud server first determines the building mask in the reconstruction area through another semantic segmentation network trained for extracting building masks, and then extracts the vector contour of the building mask through the Douglas-Peuker algorithm, which simplifies the contour line by sampling, taking a finite number of points on the curve, and converting it into a broken line, while keeping the original shape unchanged to a certain extent. The vector contour is regarded as the first building contour corresponding to the reconstruction area, and then, according to the direction of the continuous broken lines on the first building contour, each continuous broken line is assigned to a different angle interval, and finally the first maximum line segment length with the longest sum of broken line lengths is determined, and the middle value of the first maximum line segment length and the corresponding first angle interval is used as the first main direction of the reconstruction area.
[0066] Considering the instability of building masks, they often cannot express the true building outline and direction. Subsequent calculations based solely on the direction determined by the mask may result in errors. Therefore, the cloud server will also use the Line Segment Detector algorithm to determine the straight lines in the image through the rich directional textures in the building image, and then extract the building edge to obtain the second building outline of the reconstructed area. In this process, in order to further robust the algorithm, the building area can be expanded so that the building edge can also be fully extracted. At the same time, in order to prevent environmental interference, a buffer area can be introduced. If one of the endpoints of the detected line segment is in the buffer area, the line segment is discarded. Next, the cloud server will also determine the second maximum line segment length and the corresponding second angle interval through the angle interval of each continuous broken line in the second building outline, and use the middle value of the second angle interval as the second main direction of the reconstructed area.
[0067] Regardless of the detection method based on masks or images, there will be uncertainty and a lot of interference. Therefore, after obtaining the first subject direction and the second subject direction, the cloud server needs to determine which subject direction is more accurate. Specifically, the ratio of the sum of the lengths of all line segments within the angle interval of the subject direction to the sum of the lengths of all detected line segments is used as the accuracy, and the direction with higher accuracy is used as the final subject direction of the reconstructed area. The formula for calculating accuracy can be as follows:
[0068]
[0069] Where p is the accuracy, is the sum of the lengths of all line segments within the selected main angle interval, It is the sum of the lengths of the line segments detected in the entire area.
[0070] S103. For any building in the reconstructed area, determine the net height of the building based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and select a segmentation rule according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area.
[0071] The building categories include high-rise buildings and low-rise buildings, and the segmentation rules include a segmentation rule based on height clustering corresponding to the high-rise buildings and a segmentation rule based on building rotation boxes corresponding to the low-rise buildings.
[0072] In the embodiment of the present specification, for the buildings divided into a reconstruction area, the heights of the buildings may be different. If all the buildings are directly processed and reconstructed in a unified manner, the reconstruction results are prone to large deviations. Therefore, it is also necessary to segment the buildings into individual units to segment the buildings with similar heights into the same individual unit area, and then perform three-dimensional reconstruction on the individual units separately. Specifically, the filling area corresponding to the maximum circumscribed matrix of the building is first determined, and the building mask area and non-building mask area in the filling area corresponding to the maximum circumscribed matrix are determined. Then, the cloud server determines the height information of each position according to the elevation data corresponding to the filling area corresponding to the maximum circumscribed matrix, and constructs a height histogram based on this. The height histogram can be a statistical histogram constructed with a preset height (for example, 2 meters) as the height interval. According to the height histogram of the building mask area and the non-building mask area, the net height of the building can be determined, that is, the height of the building above the ground. Next, considering that the higher buildings are less adherent to other buildings and are easy to distinguish, while the lower buildings may be composed of blocks of houses, which cannot be well distinguished by color or height, so this application will segment the buildings into individual units according to the height. Specifically, a preset height can be pre-set in the cloud server. By comparing the net height of the building with the preset height, it can be determined whether the building is a high-rise building or a low-rise building. Different segmentation rules will be selected for different buildings to segment the buildings into individual units. Finally, each building segmented into one type will constitute a single unit area. The net height of the building can be determined by first determining the median value of each histogram and then calculating the difference between the two medians, or by first retaining the histogram intervals with a number greater than the preset number, and then calculating the average of all the remaining heights, and finally calculating the difference between the two average values. Other implementation methods are also possible.
[0073] For high-rise buildings, the segmentation rule of height clustering can be used, that is, first select a height, cluster at this height, determine several buildings with height differences lower than the preset difference, and divide these buildings into the same single area, and then continue clustering in the remaining buildings until all buildings are divided into single areas. For low buildings, the segmentation rule of building rotation box can be used, that is, the rotation box detection in the deep learning algorithm is used to group low buildings, and then obtain single areas. As an example, the Rotated_RTMDet model can be used for area division. Rotated_RTMDet is a model for real-time detection of rotating targets. It uses CSPDarkNet as the baseline and uses CSPPAFPN for multi-scale feature fusion. Finally, the features are input to different detection heads to complete tasks such as target detection, instance segmentation, and rotation box detection.
[0074] In one possible implementation, determining the net height of the building based on a height histogram of a building mask area and a non-building mask area in a filling area corresponding to a maximum circumscribed matrix of the building comprises:
[0075] Determine a non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a first height histogram of the non-building mask area with a preset height as the height interval, and cumulatively stack the histogram intervals of the first height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the ground surface height;
[0076] Determine a building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a second height histogram of the building mask area with a preset height as the height interval, cumulatively stack the histogram intervals of the second height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the building height;
[0077] The difference between the building height and the ground surface height is calculated to obtain the net height of the building.
[0078] In an embodiment of the present specification, the cloud server can construct a first height histogram of the non-building mask area with a preset height (e.g., 2 meters) as the height interval, and the height histogram can characterize the quantity distribution between different histogram intervals. The cloud server will accumulate and superimpose the values of each histogram interval in order from low to high values, that is, from left to right in the histogram, until the accumulated value is greater than the sum of the values of the histogram intervals, that is, the first preset proportion of the total histogram (e.g., 10%), and then set the middle value of the last superimposed histogram interval as the ground surface height. Similarly, the cloud server will repeat the above process for the second height histogram of the building mask area, determine the middle value of the last superimposed histogram interval when the accumulated value is greater than the first preset proportion of the total histogram, and use it as the building height. Finally, you only need to calculate the difference between the building height and the ground surface height to get the net height of the building, that is, the height of the building above the ground surface.
[0079] In one possible implementation, the segmentation rule is selected according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area, including:
[0080] For the high-rise building, adjacent pixel search is performed based on the highest point to determine adjacent areas whose height difference with the highest point is less than a second preset ratio of the net height of the building, field search is performed based on the adjacent areas, individualization is performed based on the field search results, and adjacent area determination and field search are repeated in the remaining areas until no pixel points exist in the remaining areas, thereby obtaining each individual area;
[0081] For the low buildings, a rotating target detection model is constructed, and the building rotation frame of each building is detected based on the rotating target detection model, and the building rotation frame is segmented into individual parts to obtain each individual area.
[0082] In the processing of high-rise buildings in the embodiment of this specification, the cloud server first finds a highest point p in the building mask area through the elevation data, and then searches for adjacent pixels in eight directions to find the adjacent area whose height difference with the point is less than a second preset ratio (for example, 5%) of the net height of the building, and marks it as Then, with these marked points as the center, a field search is performed. According to different actual needs, different search conditions can be set for the field search. For example, in addition to the height difference with the marked point being less than the second preset ratio of the net height of the building, it is also necessary to determine that the height difference between the search point and the initial highest point p is within the third preset ratio of the net height of the building (for example, 20%), and at the same time, it is higher than 4m above the ground height, etc. The field search will mark the points that meet the conditions again and iterate the search until all the points that meet the conditions are marked. These points will be divided into a single area. Then, for the pixels in the remaining mask area, the above process will be repeated until there are no pixels in the mask area, and the single areas corresponding to the high-rise building are obtained. In the process of processing low buildings, the rotating target detection model can be used to detect the rotating frame of the building, and the single segmentation is performed according to the detection results of the rotating frame of the building, and the low buildings in the same frame are divided into a single area.
[0083] As an example, the Rotated_RTMDet model based on deep learning can be used to detect the rotation box. The model training process is as follows:
[0084] Use the sample annotation tool to annotate the building, annotating it as the minimum circumscribed rectangle (rotated rectangle) of the building roof. Covering as many architectural styles as possible and enriching the sample set will help improve the generalization ability of the model. After the samples are made, they are uniformly cropped and a certain overlap rate is set. The samples are generally set to 1024*1024. Setting the overlap rate is usually to reduce the possibility of buildings being cut in half. At the same time, a retention threshold needs to be set. When the building is cut in half, samples above the threshold are retained. In addition, when the number of samples is sufficient, empty samples are generally filtered out. When the number of samples is insufficient, some empty samples can be appropriately added. Generally, the empty samples are set within 10%, and the selection of empty samples is generally in areas where the model is easily misjudged, that is, the model is likely to detect it as a building but it is not actually a building.
[0085] The samples are trained using Rotated_RTMDet. Using rotated rectangles to represent objects means that each bounding box has a center point, width, height, and an angle, which can be rotated to adapt to the orientation of the object. In drone and satellite images, buildings are not arranged horizontally, but at arbitrary angles. Therefore, compared with the traditional horizontal box object detection algorithm, the rotated object detection algorithm can provide more accurate positioning and better performance.
[0086] S104. For any single area in the reconstruction area, determine the building direction of each building based on the angle difference with the main direction, regularize each building based on the building direction, and then reconstruct each building in three dimensions based on the elevation data of the single area.
[0087] Among them, the building direction is the main direction when the angle difference is less than the preset difference, and is the building direction itself when the angle difference is not less than the preset difference.
[0088] In the embodiments of this specification, the individualized building mask needs to be regularized using a rectangle. First, the cloud server will determine the orientation of each building, compare it with the main direction of the individual area, determine the angle difference between the two, and use this to adjust and determine the building direction of each building. If the angle difference is small, the main direction is directly used as the building direction of the building. If the angle difference is large, the orientation of the building itself is used as the building direction. After determining the building direction, the cloud server will use the line segment of the mask in the building direction as one side of the rectangle to construct a rectangle that can just frame the mask, and regularize the mask into the shape of the rectangle. After all buildings are regularized, each building is a rectangle with its own orientation determined. The cloud server will process these rectangles according to the elevation data, and it will be able to reconstruct and generate the corresponding three-dimensional models of each building.
[0089] In one possible implementation, determining the building direction of each building based on the angle difference with the main body direction includes:
[0090] Determine a first orientation of each of the buildings based on a vector outline of a building mask and a second orientation based on a straight line detection result of a building image, and respectively calculate an angular difference between the first orientation and the second orientation and the main body direction;
[0091] When at least one of the angle differences is less than a preset angle, determining the main body direction as the building direction of the building;
[0092] When the difference between the two angles is not less than a preset angle, the direction closest to the main body direction is determined as the building direction of the building.
[0093] In the embodiment of this specification, similarly, the cloud server first determines the first orientation v1 and the second orientation v2 of each building based on the vector contour of the building mask and the straight line detection result based on the building image. Assuming the main direction is , the angle difference between the first orientation and the second orientation and the main orientation will be calculated respectively. If at least one of the angle differences is less than the preset angle (for example, 5 degrees), the building orientation of the building will be set as the main orientation , consistent with the overall orientation. If the difference between the two angles is not less than the preset angle, the angle that matches v1 and v2 will be selected. The closest direction is used as the building direction.
[0094] In one possible implementation, the regularizing of each of the buildings based on the building directions includes:
[0095] Determine the longest line segment of the original mask outline of the building in the direction of the building, construct a rectangular frame with the longest line segment as the bottom edge, determine the optimal rectangular frame by scoring the rectangular frame, and regularize the building based on the optimal rectangular frame;
[0096] The optimal rectangular frame that fits together is subjected to polygon fusion.
[0097] In the embodiments of the present specification, there may be multiple line segments in the direction of the building, and the cloud server will select the longest line segment as the bottom edge of the rectangular frame. Among them, for a small number of buildings, their shape is not a rectangle but an L-shape, in which case they will be divided into multiple rectangular frames for regularization. In order to avoid generating erroneous rectangular frames in the process of dividing into multiple rectangular frames, the longest line segment needs to be selected based on the original mask outline, that is, the line segment at the intersection of the two rectangles in the L-shape will not be considered. In order to determine the rectangular frame that fits the mask outline exactly, the rectangular frame constructed with the longest line segment as the bottom edge will be scored to determine the optimal rectangular frame with the highest score, and finally regularized with the rectangular frame. The scoring calculation process is as follows:
[0098] The bottom edge of the image is used as the initial straight line. A rectangular frame is constructed by translating the initial straight line, rotating the initial straight line 90 degrees, and translating it again. The four points of the rectangular frame are x1, x2, y1, and y2. The score calculation formula is:
[0099]
[0100] in, is the overall score of the rectangle, is the score of the overlap area between the rectangle formed by the position y2 and the initial straight line and the mask, is a parameter that measures the proportion of the true mask in the rectangle. is the degree of overlap between the line segment at position y2 and the line segment detected in the image, To adjust , and The coefficient of weight between them.
[0101] The calculation formula is:
[0102]
[0103] This ensures that the generated rectangle can include the mask to the greatest extent while being close to the edge line of the mask itself. Using y2 corresponding to the maximum score found, a new initial edge can be formed while keeping x1 and x2 unchanged. Repeat the above process to find a new y1. Then, by rotating the outline 90 degrees and swapping x and y, you can continue to find the corresponding new x1 and x2. By looping the above process until the positions of x1, x2, y1, and y2 have not changed, the rectangle at this time is the optimal rectangle. Finally, the cloud server will perform polygon fusion on the fitted rectangles to form integral polygons.
[0104] In one possible implementation, the three-dimensional reconstruction of each of the buildings based on the elevation data of the single area includes:
[0105] Constructing a third height histogram of the building mask area in the monomer area based on the elevation data of the monomer area, accumulating and superimposing the histogram intervals of the third height histogram from high value to low value until the accumulated value is greater than a first preset proportion of the total amount of the histogram, and setting the middle value of the last superimposed histogram interval as the area height of the monomer area;
[0106] The buildings are three-dimensionally reconstructed based on the height of the area.
[0107] In the embodiment of the present specification, the cloud server will construct a third height histogram for the building mask area in the single area based on the elevation data, and then similarly, it will determine the middle value of the final superimposed histogram interval through cumulative superposition, but by accumulating from high values to low values. The middle value will be used as the regional height of the single area, and all buildings in the single area will be three-dimensionally reconstructed according to the regional height, and finally a three-dimensional model of each building will be obtained.
[0108] The following will be combined with the attached Figure 2 , the regionalized house 3D reconstruction device based on remote sensing data provided by the embodiment of the present application is introduced in detail. Figure 2 The regionalized house three-dimensional reconstruction device based on remote sensing data is used to implement the present application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.
[0109] See also Figure 2 , Figure 2 Schematic diagram of a regional house 3D reconstruction device based on remote sensing data provided by an embodiment of the present application. Figure 2 As shown, the device comprises:
[0110] An extraction module 201 is used to determine remote sensing data to be reconstructed, extract road masks of the remote sensing data, and divide the remote sensing data into a plurality of reconstruction areas based on the road masks and the boundary lines of the remote sensing data;
[0111] A determination module 202, for determining, for any of the reconstructed areas, a main direction of the reconstructed area based on a maximum line segment length in a building outline and a corresponding angle interval;
[0112] The segmentation module 203 is used to determine the net height of the building in the reconstructed area based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and select a segmentation rule according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area, wherein the building category includes high-rise buildings and low-rise buildings, and the segmentation rule includes a segmentation rule based on height clustering corresponding to the high-rise building and a segmentation rule based on building rotation box corresponding to the low-rise building;
[0113] The reconstruction module 204 is used to determine the building direction of each of the buildings based on the angle difference with the main direction for any single area in the reconstruction area, and after regularizing each of the buildings based on the building direction, perform three-dimensional reconstruction on each of the buildings based on the elevation data of the single area. The building direction is the main direction when the angle difference is less than a preset difference, and is the building's own direction when the angle difference is not less than the preset difference.
[0114] In one possible implementation, the building outline includes a first building outline and a second building outline;
[0115] The determination module 202 is specifically used for:
[0116] Determine the first building outline based on the vector outline of the building mask, determine the angle intervals to which all continuous broken lines on the first building outline belong with a preset angle as the interval interval, determine the first maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the middle value of the first maximum line segment length and the corresponding first angle interval as the first main direction of the reconstructed area;
[0117] Determine the second building outline based on the straight line detection result of the building image, determine the angle intervals to which all continuous broken lines on the second building outline belong using a preset angle as the interval interval, determine the second maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the second main body direction of the reconstructed area using the middle value of the second maximum line segment length and the corresponding second angle interval;
[0118] The accuracy of the first building outline and the second building outline are calculated respectively, and the main direction of the building outline with higher accuracy is used as the main direction of the reconstructed area, and the accuracy is the ratio of the sum of the broken line lengths within the angle interval of the main direction to the sum of all broken line lengths of the building outline.
[0119] In one possible implementation, the segmentation module 203 is specifically used for:
[0120] Determine a non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a first height histogram of the non-building mask area with a preset height as the height interval, and cumulatively stack the histogram intervals of the first height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the ground surface height;
[0121] Determine a building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a second height histogram of the building mask area with a preset height as the height interval, cumulatively stack the histogram intervals of the second height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the building height;
[0122] The difference between the building height and the ground surface height is calculated to obtain the net height of the building.
[0123] In one possible implementation, the segmentation module 203 is further configured to:
[0124] For the high-rise building, adjacent pixel search is performed based on the highest point to determine adjacent areas whose height difference with the highest point is less than a second preset ratio of the net height of the building, field search is performed based on the adjacent areas, individualization is performed based on the field search results, and adjacent area determination and field search are repeated in the remaining areas until no pixel points exist in the remaining areas, thereby obtaining each individual area;
[0125] For the low buildings, a rotating target detection model is constructed, and the building rotation frame of each building is detected based on the rotating target detection model, and the building rotation frame is segmented into individual parts to obtain each individual area.
[0126] In one embodiment, the reconstruction module 204 is specifically configured to:
[0127] Determine a first orientation of each of the buildings based on a vector outline of a building mask and a second orientation based on a straight line detection result of a building image, and respectively calculate an angular difference between the first orientation and the second orientation and the main body direction;
[0128] When at least one of the angle differences is less than a preset angle, determining the main body direction as the building direction of the building;
[0129] When the difference between the two angles is not less than a preset angle, the direction closest to the main body direction is determined as the building direction of the building.
[0130] In one embodiment, the reconstruction module 204 is further configured to:
[0131] Determine the longest line segment of the original mask outline of the building in the direction of the building, construct a rectangular frame with the longest line segment as the bottom edge, determine the optimal rectangular frame by scoring the rectangular frame, and regularize the building based on the optimal rectangular frame;
[0132] The optimal rectangular frame that fits together is subjected to polygon fusion.
[0133] In one embodiment, the reconstruction module 204 is further configured to:
[0134] Constructing a third height histogram of the building mask area in the monomer area based on the elevation data of the monomer area, accumulating and superimposing the histogram intervals of the third height histogram from high value to low value until the accumulated value is greater than a first preset proportion of the total amount of the histogram, and setting the middle value of the last superimposed histogram interval as the area height of the monomer area;
[0135] The buildings are three-dimensionally reconstructed based on the height of the area.
[0136] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0137] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
[0138] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 3 As shown, the electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0139] The communication bus 302 is used to realize the connection and communication between these components.
[0140] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0141] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0142] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the electronic device 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics central processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0143] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may optionally be at least one storage device located away from the aforementioned processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.
[0144] exist Figure 3 In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the regionalized house 3D reconstruction application based on remote sensing data stored in the memory 305, and specifically perform the following operations:
[0145] Determining remote sensing data to be reconstructed, extracting a road mask of the remote sensing data, and dividing the remote sensing data into a plurality of reconstruction areas based on each of the road masks and a boundary line of the remote sensing data;
[0146] For any of the reconstructed areas, determining the main direction of the reconstructed area based on the maximum line segment length and the corresponding angle interval in the building outline;
[0147] For any building in the reconstructed area, the net height of the building is determined based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and the building is segmented into monomers according to the building category corresponding to the net height of the building, so as to obtain each monomer area, wherein the building category includes high-rise buildings and low-rise buildings, and the segmentation rule includes a segmentation rule based on height clustering corresponding to the high-rise building and a segmentation rule based on building rotation box corresponding to the low-rise building;
[0148] For any single area in the reconstruction area, the building direction of each building is determined based on the angle difference with the main direction, and after each building is regularized based on the building direction, each building is three-dimensionally reconstructed based on the elevation data of the single area. The building direction is the main direction when the angle difference is less than a preset difference, and is the building's own direction when the angle difference is not less than the preset difference.
[0149] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0150] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0151] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0152] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0153] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0156] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0157] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
Claims
1. A method for regionalized three-dimensional reconstruction of houses based on remote sensing data, characterized in that: The method comprises: Determining remote sensing data to be reconstructed, extracting a road mask of the remote sensing data, and dividing the remote sensing data into a plurality of reconstruction areas based on each of the road masks and a boundary line of the remote sensing data; For any of the reconstructed areas, determining the main direction of the reconstructed area based on the maximum line segment length and the corresponding angle interval in the building outline; For any building in the reconstructed area, the net height of the building is determined based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and the building is segmented into monomers according to the building category corresponding to the net height of the building, so as to obtain each monomer area, wherein the building category includes high-rise buildings and low-rise buildings, and the segmentation rule includes a segmentation rule based on height clustering corresponding to the high-rise building and a segmentation rule based on building rotation box corresponding to the low-rise building; For any single area in the reconstruction area, the building direction of each building is determined based on the angle difference with the main direction, and each building is regularized based on the building direction, and then three-dimensional reconstruction is performed on each building based on the elevation data of the single area, and the building direction is the main direction when the angle difference is less than a preset difference, and is the building direction itself when the angle difference is not less than the preset difference; The segmentation rule is selected according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area, including: For the high-rise building, adjacent pixel search is performed based on the highest point to determine adjacent areas whose height difference with the highest point is less than a second preset ratio of the net height of the building, field search is performed based on the adjacent areas, individualization is performed based on the field search results, and adjacent area determination and field search are repeated in the remaining areas until no pixel points exist in the remaining areas, thereby obtaining each individual area; For the low buildings, a rotating target detection model is constructed, and the building rotation frame of each building is detected based on the rotating target detection model, and the building rotation frame is segmented into individual parts to obtain each individual area.
2. The method according to claim 1, characterized in that The building outline includes a first building outline and a second building outline; The determining the main direction of the reconstruction area based on the maximum line segment length and the corresponding angle interval in the building outline includes: Determine the first building outline based on the vector outline of the building mask, determine the angle intervals to which all continuous broken lines on the first building outline belong with a preset angle as the interval interval, determine the first maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the middle value of the first maximum line segment length and the corresponding first angle interval as the first main direction of the reconstructed area; Determine the second building outline based on the straight line detection result of the building image, determine the angle intervals to which all continuous broken lines on the second building outline belong using a preset angle as the interval interval, determine the second maximum line segment length sum based on the sum of the broken line lengths in each of the angle intervals, and determine the second main body direction of the reconstructed area using the middle value of the second maximum line segment length and the corresponding second angle interval; The accuracy of the first building outline and the second building outline are calculated respectively, and the main direction of the building outline with higher accuracy is used as the main direction of the reconstructed area, and the accuracy is the ratio of the sum of the broken line lengths within the angle interval of the main direction to the sum of all broken line lengths of the building outline.
3. The method according to claim 1, characterized in that The determining of the net height of the building based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building comprises: Determine a non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a first height histogram of the non-building mask area with a preset height as the height interval, and cumulatively stack the histogram intervals of the first height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the ground surface height; Determine a building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, construct a second height histogram of the building mask area with a preset height as the height interval, cumulatively stack the histogram intervals of the second height histogram from low values to high values until the cumulative value is greater than a first preset proportion of the total amount of the histogram, and set the middle value of the last stacked histogram interval as the building height; The difference between the building height and the ground surface height is calculated to obtain the net height of the building.
4. The method according to claim 1, characterized in that: The determining the building direction of each building based on the angle difference with the main body direction comprises: Determine a first orientation of each of the buildings based on a vector outline of a building mask and a second orientation based on a straight line detection result of a building image, and respectively calculate an angular difference between the first orientation and the second orientation and the main body direction; When at least one of the angle differences is less than a preset angle, determining the main body direction as the building direction of the building; When the difference between the two angles is not less than a preset angle, the direction closest to the main body direction is determined as the building direction of the building.
5. The method according to claim 1, characterized in that The regularizing of each of the buildings based on the building directions comprises: Determine the longest line segment of the original mask outline of the building in the direction of the building, construct a rectangular frame with the longest line segment as the bottom edge, determine the optimal rectangular frame by scoring the rectangular frame, and regularize the building based on the optimal rectangular frame; The optimal rectangular frame that fits together is subjected to polygon fusion.
6. The method according to claim 1, characterized in that The three-dimensional reconstruction of each of the buildings based on the elevation data of the monomer area includes: Constructing a third height histogram of the building mask area in the monomer area based on the elevation data of the monomer area, accumulating and superimposing the histogram intervals of the third height histogram from high value to low value until the accumulated value is greater than a first preset proportion of the total amount of the histogram, and setting the middle value of the last superimposed histogram interval as the area height of the monomer area; The buildings are three-dimensionally reconstructed based on the height of the area.
7. A regionalized house three-dimensional reconstruction device based on remote sensing data, characterized in that: The device comprises: An extraction module, used for determining remote sensing data to be reconstructed, extracting a road mask of the remote sensing data, and dividing the remote sensing data into a plurality of reconstruction areas based on each of the road masks and the boundary lines of the remote sensing data; A determination module, for determining, for any of the reconstructed areas, a main direction of the reconstructed area based on a maximum line segment length in a building outline and a corresponding angle interval; A segmentation module is used to determine the net height of any building in the reconstruction area based on the height histogram of the building mask area and the non-building mask area in the filling area corresponding to the maximum circumscribed matrix of the building, and to select a segmentation rule according to the building category corresponding to the net height of the building to perform monomer segmentation on the building to obtain each monomer area, wherein the building category includes high-rise buildings and low-rise buildings, and the segmentation rule includes a segmentation rule based on height clustering corresponding to the high-rise building and a segmentation rule based on building rotation box corresponding to the low-rise building; A reconstruction module, for determining the building direction of each of the buildings based on the angle difference with the main direction for any single area in the reconstruction area, and regularizing each of the buildings based on the building direction, and then performing three-dimensional reconstruction on each of the buildings based on the elevation data of the single area, wherein the building direction is the main direction when the angle difference is less than a preset difference, and is the building direction itself when the angle difference is not less than the preset difference; The segmentation module is further used for: For the high-rise building, adjacent pixel search is performed based on the highest point to determine adjacent areas whose height difference with the highest point is less than a second preset ratio of the net height of the building, field search is performed based on the adjacent areas, individualization is performed based on the field search results, and adjacent area determination and field search are repeated in the remaining areas until no pixel points exist in the remaining areas, thereby obtaining each individual area; For the low buildings, a rotating target detection model is constructed, and the building rotation frame of each building is detected based on the rotating target detection model, and the building rotation frame is segmented into individual parts to obtain each individual area.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer-readable storage medium has instructions stored therein, and when the instructions are executed on a computer or a processor, the computer or the processor executes the steps of the method according to any one of claims 1 to 6.
