Building top surface recognition method and device

Through the deep learning model, high-resolution satellite images are block-recognized, and combined with rotation and filling processing, vector map spots are generated on the top of the building, solving the problem of inaccurate extraction of the top of the building in the existing technology and achieving a fast and accurate extraction effect.

CN119339256BActive Publication Date: 2025-04-29北京观微科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411877331.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-29
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

The prior art cannot quickly and accurately extract the top surface of a building, especially in complex environments and large-scale conditions.

Method used

By obtaining high-resolution satellite images, inputting deep learning models to identify them after blocking, combining rotation and fill processing, single-band binary images are generated, and vectorized and regularized processing are performed to obtain the vector pattern on the top of the building.

Benefits of technology

It realizes rapid and accurate extraction of the top surface of the building, improves the obsession and reliability of the identification results, and has good consistency with manual outlines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339256B_ABST
    Figure CN119339256B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for identifying the top surface of a building, and relates to the technical field of remote sensing image processing. The method comprises: obtaining a first GF-2 image of a target area; the first GF-2 image is a satellite image with a sub-meter resolution, and the target area contains a target building; the first GF-2 image is divided into blocks to obtain a plurality of first divided images; each first divided image is input into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image data set, and the initial semantic segmentation model is a deep learning model; the single-band binary image of the target building is regularized to obtain a top surface vector map of the target building. The present invention realizes fast and accurate extraction of the top surface of a building, and the recognition result is considerable and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of remote sensing image processing, and in particular to a method and device for identifying a building top surface. Background Art

[0002] As a product of the continuous advancement of human industrialization and urbanization, buildings are typical artificial targets. Accurate and rapid identification of buildings is of great significance in applications such as urban planning, basic geographic information data update, geological disaster assessment, and environmental monitoring.

[0003] Traditional methods for extracting buildings focus on manually designing the representation of buildings based on human-understandable knowledge and experience, so as to separate buildings from the background. For example, the classic morphological building index, image edge extraction and screening and combination, etc. Existing methods for extracting buildings cannot meet the needs of quickly and accurately extracting the top surfaces of buildings in complex environments and large-scale conditions.

[0004] Therefore, how to quickly and accurately extract the top surface of a building has become a technical problem that urgently needs to be solved in the industry. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present invention provides a method and device for identifying the top surface of a building, which can achieve rapid and accurate extraction of the top surface of a building.

[0006] In a first aspect, the present invention provides a method for identifying a building top surface, the method comprising the following steps:

[0007] Acquire a first Gaofen-2 image of the target area; the first Gaofen-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building;

[0008] Divide the first GF-2 image into blocks to obtain a plurality of first block images;

[0009] Input each of the first block images into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image dataset, and the initial semantic segmentation model is a deep learning model;

[0010] The single-band binary image of the target building is regularized to obtain a top surface vector patch of the target building.

[0011] According to a building top surface recognition method provided by the present invention, the first block images are input into a building recognition model to obtain a single-band binary image of the target building, including:

[0012] Rotate each of the first block images by a preset angle to obtain each rotated first block image;

[0013] Filling blank areas in each of the rotated first block images according to the filling parameters corresponding to each of the rotated first block images to obtain each of the second block images;

[0014] Inputting each of the second block images into a building recognition model to obtain a recognition result corresponding to each of the second block images;

[0015] According to the preset angles and filling parameters corresponding to each of the second-block images, the recognition results corresponding to each of the second-block images are classified and merged to obtain a single-band binary image of the target building; the preset angles and filling parameters corresponding to each of the second-block images are consistent with the preset angles and filling parameters corresponding to each of the second-block images.

[0016] According to a building top surface recognition method provided by the present invention, the single-band binary image of the target building is subjected to regular processing to obtain a top surface vector map of the target building, including:

[0017] Vectorizing the single-band binary image of the target building to obtain a plurality of vector spots;

[0018] Each of the vector image spots is regularized to obtain the top surface vector image spot of the target building.

[0019] According to a building top surface recognition method provided by the present invention, the regularization processing of each of the vector image spots to obtain the top surface vector image spots of the target building includes:

[0020] Thinning the boundary points of each vector pattern patch to obtain each thinned vector pattern patch, so that the holes in the middle of each thinned vector pattern patch are automatically filled;

[0021] According to the minimum angle threshold or the minimum area threshold, the abnormal vector spots in the thinned out vector spots are screened and removed; the abnormal vector spots are vector spots whose angles are less than the minimum angle threshold in the thinned out vector spots or vector spots whose areas are less than the minimum area threshold in the thinned out vector spots;

[0022] Determine the main direction of each vector spot after thinning, and regularize the boundaries of each vector spot after thinning according to the main direction of the vector spot corresponding to each vector spot, so as to obtain each vector spot after the boundary regularization;

[0023] According to the edge length threshold, the short edges of each of the vector patches after the boundary regularization are removed to obtain the top surface vector patch of the target building.

[0024] According to a building top surface recognition method provided by the present invention, the first GF-2 image is divided into blocks to obtain a plurality of first block images, including:

[0025] Preprocessing the first GF-2 image to obtain a first GF-2 true color image;

[0026] The first high-resolution-2 true color image is divided into blocks to obtain a plurality of the first block images.

[0027] According to a building top surface recognition method provided by the present invention, the preprocessing of the first GF-2 image to obtain the first GF-2 true color image includes:

[0028] Performing orthorectification on the first GF-2 image to obtain the orthorectified first GF-2 image;

[0029] Using the reference image, performing image registration on the first GF-2 image after orthorectification to obtain the registered first GF-2 image;

[0030] The panchromatic band of the first GF-2 image after registration is fused with the multispectral band to obtain the first GF-2 true color image; the amount of information of the first GF-2 true color image is greater than that of the first GF-2 image, and the first GF-2 true color image is a high-resolution image with spatial details of the panchromatic image and spectral information of the multispectral band.

[0031] According to a building top surface recognition method provided by the present invention, the training step of the building recognition model includes:

[0032] Acquire multiple second GF-2 images, and preprocess each of the second GF-2 images to obtain each second GF-2 true color image;

[0033] Using ArcGIS raster tools to slice each of the second GF-2 true color images to obtain each of the second GF-2 true color images of a preset size;

[0034] Performing building labeling processing on each of the second GF-2 true color images of a preset size to obtain each labeled third GF-2 true color image;

[0035] Determining the GF-2 image data set according to each third GF-2 true color image;

[0036] Dividing the GF-2 image data set into a training set, a test set and a validation set;

[0037] The initial semantic segmentation model is trained according to the training set, the test set, the validation set, the model batch size, the loss function and the preset number of iterations to obtain the building recognition model.

[0038] According to a building top surface recognition method provided by the present invention, the step of determining the GF-2 image data set according to each third GF-2 true color image comprises:

[0039] Performing a data enhancement operation on each of the third high-resolution-2 true color images to obtain data-enhanced third high-resolution-2 true color images;

[0040] The GF-2 image data set is determined according to each of the data enhanced third GF-2 true color images.

[0041] According to a building top surface recognition method provided by the present invention, the initial semantic segmentation model is trained according to the training set, the test set, the verification set, the model batch size, the loss function and the preset number of iterations to obtain the building recognition model, including:

[0042] According to the model batch size, the loss function, the preset number of iterations and the optimizer, the initial semantic segmentation model is trained using the training set to obtain a first model parameter of the initial semantic segmentation model;

[0043] Using the test set and the validation set to evaluate the semantic segmentation model corresponding to the first model parameters, and updating the first model parameters according to the evaluation results to obtain target model parameters;

[0044] The building recognition model is determined according to the target model parameters.

[0045] In a second aspect, the present invention further provides a building top surface recognition device, the device comprising the following modules:

[0046] An acquisition module is used to acquire a first GF-2 image of a target area; the first GF-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building;

[0047] The recognition module is used to divide the first GF-2 image into blocks to obtain a plurality of first block images; each of the first block images is input into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image data set, and the initial semantic segmentation model is a deep learning model;

[0048] The post-processing module is used to perform regular processing on the single-band binary image of the target building to obtain the top surface vector patch of the target building.

[0049] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements any of the above-described building top surface recognition methods.

[0050] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described building top surface recognition methods.

[0051] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-described building top surface recognition methods.

[0052] The present invention provides a method and device for identifying the top surface of a building. The method and device obtain a first GF-2 image of a target area, wherein the first GF-2 image is a satellite image with a sub-meter resolution, and the target area contains a target building; then, the first GF-2 image is divided into blocks to obtain a plurality of first divided images; each of the first divided images is input into a building recognition model to identify and obtain a single-band binary image of the target building; wherein the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image data set, and the initial semantic segmentation model is a deep learning model; further, the single-band binary image of the target building is regularized to obtain a top surface vector map of the target building.

[0053] The initial semantic segmentation model in the present invention is a deep learning model, and the building recognition model is obtained by training the initial semantic segmentation model using the GF-2 image data set. By acquiring a first GF-2 image with high resolution of the target area, and then using the building recognition model to recognize each block of the first GF-2 image, a single-band binary image of the target building is obtained, thereby realizing high-precision intelligent automatic extraction of building patches in remote sensing images, and performing regular processing on the single-band binary image of the target building. The recognition result is considerable and reliable, and has good consistency with manual outlining. The present invention realizes fast and accurate extraction of building top surfaces. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 This is one of the flow charts of the building top surface recognition method provided by the present invention.

[0056] Figure 2 It is a schematic diagram of the effect of the building top surface recognition method provided by the present invention.

[0057] Figure 3 This is the second flow chart of the building top surface recognition method provided by the present invention.

[0058] Figure 4 It is a structural schematic diagram of the building top surface identification device provided by the present invention.

[0059] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first" and "second" are generally a class, and the number of objects is not limited. For example, the first node can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the front and back associated objects are in an "or" relationship.

[0062] Combine the following Figure 1-Figure 5 The present invention describes the building top surface recognition method and device.

[0063] Figure 1 FIG. 1 is one of the flow charts of the building top surface recognition method provided by the present invention, such as Figure 1 As shown, the method includes the following:

[0064] Step 101, obtaining the first GF-2 image of the target area; the first GF-2 image is a satellite image with sub-meter resolution, and the target area includes the target building;

[0065] Specifically, it should be noted that the executor of the present invention is an electronic device, which is used to achieve high-precision intelligent automatic extraction of building patches in remote sensing images, and to perform regular processing on single-band binary images of target buildings to achieve fast and accurate extraction of building top surfaces.

[0066] Among them, the target area is the target area that needs to be studied, such as area A in a certain urban area and area B in a certain urban area. The target area contains the target building, and the top surface of the building in the target area needs to be extracted later. The first GF-2 image is a satellite image with sub-meter resolution, that is, a high-resolution remote sensing satellite image. High-resolution remote sensing satellite images have broad application and development prospects in many fields such as surveying and mapping, land planning, and environmental resource monitoring, and have become an important spatial information source for social information services. Then, the first GF-2 image of the target area is obtained.

[0067] Step 102, dividing the first GF-2 image into blocks to obtain a plurality of first block images;

[0068] Specifically, after obtaining the first GF-2 image of the target area, the trained deep learning model can be further used to identify the first GF-2 image, and the first GF-2 image is a remote sensing image.

[0069] However, the size (width and height) of a remote sensing image is much larger than the model input size (that is, the sample size obtained by cropping during model training), so the image needs to be divided into blocks before recognition. The remote sensing image itself has coordinate information, and the results of block recognition can be restored by splicing based on the coordinate information. The block division process can be performed using a sliding window.

[0070] Step 103: input each first block image into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using the GF-2 image dataset, and the initial semantic segmentation model is a deep learning model;

[0071] Specifically, the building recognition model is obtained by training the initial semantic segmentation model using the Gaofen-2 image dataset. The initial semantic segmentation model is a deep learning model. The deep learning model in the present invention adopts the SegFormer model, a variant of the Transformer model. The core of the Transformer model is the self-attention mechanism, which allows the model to consider all elements in the sequence at the same time when processing sequence data, thereby effectively capturing long-distance dependencies. The Transformer model consists of an encoder and a decoder, each of which contains multiple identical layers that process data through a self-attention mechanism and a feedforward neural network. The self-attention mechanism enables the model to assign different attention weights according to different parts of the input sequence, thereby better capturing semantic relationships. In addition, Transformer also introduces multi-head attention, which allows the model to learn information in parallel in different representation subspaces. The SegFormer model is a Transformer architecture for semantic segmentation tasks. It achieves a simple and efficient design through a layered Transformer encoder and a lightweight multi-layer perceptron (MLP) decoder without using position encoding. The features of SegFormer include: 1. Hierarchical resolution Transformer Encoder structure: SegFormer's encoder can output multi-scale features without the need for positional encoding, avoiding positional encoding interpolation when the test resolution is different from the training resolution, thereby reducing performance loss. 2. Lightweight full MLP Decoder structure: SegFormer's decoder combines local attention and global attention by aggregating information from different layers to produce powerful feature representations without the need for complex and computationally intensive modules. The architecture of SegFormer includes the following key parts: 1. Overlap Patch Merging: PatchMerge performed through convolution operations to reduce feature resolution and maintain local continuity. 2. Transformer Block: Contains multi-head attention and feedforward neural network FFN for feature extraction. 3. MLP Decoder: A simple multi-layer perceptron structure for fusing hierarchical features for prediction. The SegFormer model can be used for semantic segmentation tasks.

[0072] By inputting each first block image into the building recognition model, a single-band binary image of the target building can be identified.

[0073] Step 104: Regularize the single-band binary image of the target building to obtain a top surface vector patch of the target building.

[0074] Specifically, the recognition result of the pixel-based deep learning semantic segmentation model can achieve very good accuracy, but pixel segmentation also has obvious limitations, such as the existence of small misclassified pixel blocks and rough building boundaries. In the present invention, the single-band binary image of the target building is further regularized to improve the accuracy of the final output result, and the top surface vector patch of the target building can be obtained. For example, vectorization is converted from a raster into multiple patches, and all patches are post-processed to make them regular polygons.

[0075] For example, Figure 2 This is a schematic diagram of the effect of the building top surface recognition method provided by the present invention, which shows the vector map of the building surface extracted from the Gaofen-2 image in a certain urban area. After evaluation and analysis, the method can achieve good extraction effect, reduce a lot of manual workload, and improve work efficiency. Therefore, the invention has certain practical significance for the acquisition and update of urban geographic information data.

[0076] The method provided in this embodiment obtains a first GF-2 image of the target area, wherein the first GF-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building; then, the first GF-2 image is divided into blocks to obtain a plurality of first block images; each of the first block images is input into a building recognition model to identify and obtain a single-band binary image of the target building; wherein the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image data set, and the initial semantic segmentation model is a deep learning model; further, the single-band binary image of the target building is regularized to obtain a top surface vector map of the target building.

[0077] The initial semantic segmentation model in the present invention is a deep learning model, and the building recognition model is obtained by training the initial semantic segmentation model using the GF-2 image data set. By acquiring a first GF-2 image with high resolution of the target area, and then using the building recognition model to recognize each block of the first GF-2 image, a single-band binary image of the target building is obtained, thereby realizing high-precision intelligent automatic extraction of building patches in remote sensing images, and performing regular processing on the single-band binary image of the target building. The recognition result is considerable and reliable, and has good consistency with manual outlining. The present invention realizes fast and accurate extraction of building top surfaces.

[0078] According to a building top surface recognition method provided by the present invention, each first block image is input into a building recognition model to identify and obtain a single-band binary image of a target building, including:

[0079] Rotate each first block image by a preset angle to obtain each rotated first block image;

[0080] Filling blank areas in the rotated first block images according to the filling parameters corresponding to the rotated first block images to obtain second block images;

[0081] Input each second block image into the building recognition model to obtain a recognition result corresponding to each second block image;

[0082] According to the preset angles and filling parameters corresponding to each second block image, the recognition results corresponding to each second block image are classified and merged to obtain a single-band binary image of the target building; the preset angles and filling parameters corresponding to each second block image are consistent with the preset angles and filling parameters corresponding to each second block image.

[0083] Specifically, in some embodiments, the specific implementation process of step 103 inputting each first block image into the building recognition model to identify and obtain the single-band binary image of the target building includes the following steps:

[0084] After the image is divided into blocks, some processing is required as model input, for example, rotating the divided image and filling the blank area after rotation. The advantage of this is that the result after model recognition can be used to restore the original divided image according to the rotation angle and filling parameters, and then the divided results at different angles can be classified and merged to generate a single-band binary image for building recognition.

[0085] First, each first segmented image is rotated by a preset angle to obtain each rotated first segmented image, that is, the segmented image is rotated by a certain angle with the center point as the center of the circle; after the rotation, there will be a blank area filling problem around the image, and according to the filling parameters corresponding to each rotated first segmented image, the blank area in each rotated first segmented image is filled to obtain each second segmented image. Further, each second segmented image is input into the building recognition model to obtain the recognition result corresponding to each second segmented image.

[0086] Further, according to the preset angles and filling parameters corresponding to each second block image, the recognition results corresponding to each second block image are classified and merged to obtain a single-band binary image of the target building, wherein the preset angles and filling parameters corresponding to each second block image are consistent with the preset angles and filling parameters corresponding to each second block image. After the model recognition result, according to the rotation angle and filling parameters, the result of the original block image can be restored, for example, the block results at different angles are classified and merged to generate a single-band binary image of building recognition.

[0087] In the method provided in this embodiment, first, each first block image is rotated by a preset angle to obtain each rotated first block image; then, according to the filling parameters corresponding to each rotated first block image, the blank area in each rotated first block image is filled to obtain each second block image, and each second block image is input into the building recognition model to obtain the recognition result corresponding to each second block image; then, according to the preset angle and filling parameters corresponding to each second block image, the recognition results corresponding to each second block image are classified and merged to obtain a single-band binary image of the target building. The present invention realizes high-precision intelligent automatic extraction of building spots in remote sensing images with high extraction efficiency.

[0088] According to a building top surface recognition method provided by the present invention, a single-band binary image of a target building is subjected to regular processing to obtain a top surface vector map of the target building, including:

[0089] Vectorize the single-band binary image of the target building to obtain multiple vector spots;

[0090] Each vector image spot is regularized to obtain the top surface vector image spot of the target building.

[0091] Specifically, in some embodiments, the specific implementation process of step 104 of performing regularization processing on the single-band binary image of the target building to obtain the top surface vector map of the target building includes the following steps:

[0092] First, the single-band binary image of the target building is vectorized to obtain multiple vector patches. To vectorize a single-band binary image, you can use the gdal.Polygonize function in the Geospatial Data Abstraction Library (GDAL). This function converts raster data into vector data and is particularly suitable for processing binary images, where the pixel values ​​of the image are usually 0 or 1, representing the background and target objects. GDAL is an open source geospatial data conversion library that provides support for a variety of raster and vector data formats. The main functions of GDAL include: 1. Support for reading and writing of multiple raster and vector data formats. 2. Provide a command line tool set for data conversion, correction, cropping and other operations. 3. Efficient raster data access and support for large file processing. 4. Coordinate system engine based on PROJ.4 and OGC Well Known Text (WKT) coordinate system description. The following are the basic steps for single-band binary image vectorization using Python and GDAL:

[0093] 1. Open the binary image file and obtain the band that needs to be vectorized.

[0094] 2. Create an empty vector data source (such as Shapefile) and create a layer.

[0095] 3. Define a field to store the attribute values ​​(for example, pixel values) of the vectorized polygon.

[0096] 4. Call the gdal.Polygonize function to vectorize the non-zero pixel area of ​​the binary image into polygons and write them into the vector layer.

[0097] In addition, if the image file is large, you may need to consider memory usage and performance optimization. When processing large images, you can consider using GDAL's gdal.Translate function to compress or simplify the image first to reduce processing time and memory consumption.

[0098] Furthermore, each vector patch is regularized to obtain the top surface vector patch of the target building. Regularization operations include thinning of patch boundary points, removal of outliers, regularization of patch boundaries, etc. For the pixel-based semantic segmentation method, a post-processing step is added to regularize the boundaries of the identified buildings and some internal cavities of the roof.

[0099] In the method provided in this embodiment, first, the single-band binary image of the target building is vectorized to obtain multiple vector patches; then, each vector patch is regularized to obtain the top surface vector patch of the target building. The present invention regularizes the boundaries of the identified building, as well as some internal cavities of the roof, and the accuracy of building top surface recognition is relatively high.

[0100] According to a building top surface recognition method provided by the present invention, each vector image patch is subjected to regular processing to obtain a top surface vector image patch of a target building, including:

[0101] Thinning the boundary points of each vector patch to obtain each thinned vector patch, so that the holes in the middle of each thinned vector patch are automatically filled;

[0102] According to the minimum angle threshold or the minimum area threshold, the abnormal vector spots in the thinned vector spots are screened and removed; the abnormal vector spots are the vector spots whose angle values ​​in the thinned vector spots are less than the minimum angle threshold or the vector spots whose areas in the thinned vector spots are less than the minimum area threshold;

[0103] Determine the main direction of each vector spot after thinning, and regularize the boundaries of each vector spot after thinning according to the main direction of each vector spot, so as to obtain each vector spot after boundary regularization;

[0104] According to the edge length threshold, the short edges of each vector patch after boundary regularization are removed to obtain the top surface vector patch of the target building.

[0105] Specifically, in some embodiments, the specific implementation process of regularizing each vector pattern spot to obtain the top surface vector pattern spot of the target building includes the following steps:

[0106] First, the boundary points of each vector patch are thinned to obtain the thinned vector patches, so that the holes in the middle of each thinned vector patch are automatically filled. Among them, the pixel boundary converted into a vector boundary after vectorization will be obviously jagged and have many vertices. In order to improve the processing efficiency, the Douglas-Peucker algorithm can be used to thin the polygon vertices, and this method can remove holes. Among them, the Douglas-Peucker algorithm, also known as the iterative end-point fit algorithm, is an algorithm for simplifying curves composed of line segments. It approximates the original curve by reducing the number of points while trying to maintain the basic shape of the curve. This algorithm is widely used in geographic information systems (GIS) for compression and simplification of vector data. The basic steps of the Douglas-Peucker algorithm are as follows:

[0107] 1. Determine the first and last points on the original curve.

[0108] 2. Connect the first and last points to get a straight line, and calculate the maximum distance from other points on the curve to this straight line.

[0109] 3. Compare the maximum distance with the preset threshold ε:

[0110] If the maximum distance is less than ε, the middle point on the curve is considered to be removed, and the first and last points are retained. If the maximum distance is greater than or equal to ε, the farthest point is retained and the curve is divided into two parts with this point as the boundary.

[0111] 4. Repeat the above process recursively for these two parts until all parts have been processed.

[0112] The key to the algorithm is how to choose the threshold ε, which determines the accuracy of the simplified curve. The smaller the ε value, the closer the simplified curve is to the original curve, but the more points are retained; the larger the ε value, the simpler the simplified curve is, but some details may be lost.

[0113] Furthermore, after thinning out the contour points of the patches, outliers can be further removed. For example, according to the minimum angle threshold or the minimum area threshold, the abnormal vector patches in each of the thinned out vector patches are screened and removed. Among them, the abnormal vector patches are the vector patches whose patch angle values ​​are less than the minimum angle threshold in each of the thinned out vector patches or the vector patches whose areas are less than the minimum area threshold in each of the thinned out vector patches. That is, in the patches after identification and thinning, there are points with abnormal angles and small-angle and small-range bumps. This is mostly caused by inaccurate model boundary recognition. It is iteratively removed by checking the values ​​of each corner of the patch. The threshold is set to 15 degrees in the operation, for example. After the recognition result, it is inevitable that there are some small (less than the minimum area threshold) broken patches, which need to be filtered and removed by calculating the area of ​​each patch. The area threshold is usually set to 20.

[0114] For example, according to the minimum angle threshold, the angle abnormal vector spots in each vector spot after thinning are screened and removed, and the abnormal vector spot is a vector spot whose angle value is less than the minimum angle threshold in each vector spot after thinning.

[0115] Furthermore, after thinning out the boundary points and removing the abnormal points, the boundaries of the patches can be further regularized. For example, the main direction of the patches corresponding to each vector patch after thinning is first determined. It can be understood that the main direction determines the direction of the regularized patches. First, the side lengths in the patches are sorted, and while allowing an angle deviation of ±15 degrees, the angle value with the longest cumulative side length within the range is recorded and averaged as the main direction of the patch.

[0116] Then, according to the main direction of the pattern, the angles of each side length are corrected to obtain each vector pattern after the boundary is regularized. For example, according to the main direction, the angles of each side length are corrected, less than 45 degrees is parallel to the main direction, and greater than 45 degrees is perpendicular to the main direction. Then, check whether each line intersects. If the adjacent sides are parallel after correction, add a connecting line or delete the side according to the position of the previous intersection. Whether to delete depends on the parallel distance, and then ensure that the result is a complete polygon.

[0117] Furthermore, according to the edge length threshold, the short edges of each vector image patch after the boundary regularization are removed to obtain the top surface vector image patch of the target building. At the same time, there will be some unreasonable short edges in the regularized image patch, which makes the boundary of the regularized image patch complicated. By judging the edge length threshold, the leading edge is translated. The edge length threshold is 2.

[0118] In the method provided in this embodiment, the recognition result is regularized, including thinning out the boundary points of each vector patch to obtain each vector patch after thinning, so that the holes in the middle of each vector patch after thinning have been automatically filled; according to the minimum angle threshold or the minimum area threshold, the abnormal vector patches in each vector patch after thinning are screened and removed; the abnormal vector patches are the vector patches whose patch angle values ​​in each vector patch after thinning are less than the minimum angle threshold or the vector patches whose areas in each vector patch after thinning are less than the minimum area threshold; determine the main direction of the patch corresponding to each thinned vector patch, and regularize the boundaries of each vector patch after thinning according to the main direction of the patch corresponding to each vector patch to obtain each vector patch after regularization of the boundaries; according to the edge length threshold, remove the short edges of each vector patch after regularization of the boundaries to obtain the top surface vector patch of the target building. The present invention combines the intelligence of deep learning and the post-processing of the results, and by establishing a reliable building roof extraction technical process, it is possible to quickly obtain the building patches of the city, greatly reducing the time and cost of manual visual interpretation, and the recognition results are considerable and reliable, with a high consistency with manual outlining.

[0119] According to a building top surface recognition method provided by the present invention, a first GF-2 image is divided into blocks to obtain a plurality of first block images, including:

[0120] Preprocess the first GF-2 image to obtain the first GF-2 true color image;

[0121] The first high-resolution-2 true color image is divided into blocks to obtain a plurality of first block images.

[0122] Specifically, in some embodiments, the process of dividing the first GF-2 image into blocks to obtain a plurality of first block images can be implemented by the following steps, including:

[0123] First, the first GF-2 image is preprocessed to obtain the first GF-2 true color image. For example, using python+GDAL to preprocess the GF-2 satellite image includes three steps: ① Orthorectification: Correct the geometric distortion caused by system and terrain factors when the satellite acquires ground images. ② Image registration: Use the Fourier phase correlation strategy to obtain multiple registration point pairs of the image, realize sub-pixel registration of the image, and achieve coordinate unification. ③ Image fusion. The multispectral band of the image is fused with the panchromatic band to obtain an image with richer information. Since no quantitative and qualitative analysis is performed on the spectrum of the image, there is no need for radiation calibration and atmospheric correction.

[0124] Furthermore, the first high-resolution No. 2 true color image obtained by preprocessing is divided into blocks using a sliding window to obtain multiple first block images.

[0125] In the method provided in this embodiment, first, the first high-resolution image is preprocessed to obtain the first high-resolution image, and then the first high-resolution image is divided into blocks to obtain a plurality of first block images. After that, the first block images are identified using the building recognition model, and the subsequent classification and merging can obtain the building recognition result of the whole scene image. The extraction effect of the preprocessed and divided image is better and the recognition accuracy is higher.

[0126] According to a building top surface recognition method provided by the present invention, a first GF-2 image is preprocessed to obtain a first GF-2 true color image, including:

[0127] Performing orthorectification on the first GF-2 image to obtain the orthorectified first GF-2 image;

[0128] Using the reference image, image registration is performed on the first GF-2 image after orthorectification to obtain the registered first GF-2 image;

[0129] The panchromatic band of the registered first GF-2 image is fused with the multispectral band to obtain the first GF-2 true color image; the amount of information of the first GF-2 true color image is greater than that of the GF-2 satellite image, and the first GF-2 true color image is a high-resolution image with the spatial details of the panchromatic image and the spectral information of the multispectral band.

[0130] Specifically, in some embodiments, the process of preprocessing the first GF-2 image is implemented by the following steps, including:

[0131] First, orthorectify the first GF-2 image to obtain the orthorectified first GF-2 image. For example, the orthorectification of the original GF-2 image is achieved by calling the Warp function in the GDAL library, setting rpc to True, inputting the original GF-2 image (the first GF-2 image) and the digital terrain model (DEM) data within the image range, and then the orthorectification operation can be completed.

[0132] Furthermore, the reference image is used to perform image registration on the first GF-2 image after orthorectification to obtain the registered first GF-2 image. Exemplarily, the image registration in this embodiment adopts the Fourier phase method, and the first GF-2 image after orthorectification and the reference image (such as the earth image of Company A) are input, and the result image is output. The overall process includes: first, the first GF-2 image after orthorectification and the reference image are converted into grayscale images; then, the two images are fast Fourier transformed to convert them from the spatial domain to the frequency domain. Next, the conjugate product of the two images is calculated to obtain the phase difference, and then the peak correlation matrix is ​​obtained by inverse Fourier transformation. Finally, the translation amount between the images is determined by finding the peak position, and the images are image registered using the translation amount.

[0133] Furthermore, the panchromatic band of the first GF-2 image after registration is fused with the multispectral image to obtain the first GF-2 true color image. It should be noted that the amount of information of the first GF-2 true color image after image fusion is greater than that of the GF-2 satellite image, and the first GF-2 true color image is a high-resolution image with the spatial details of the panchromatic image and the spectral information of the multispectral image. The image fusion of the GF-2 satellite image is to fuse the panchromatic band and the multispectral image so that the output result has both the spatial details of the panchromatic image and the spectral information of the multispectral image. Exemplarily, a Bayesian image fusion method is used, and the process includes: by modeling the relationship between the panchromatic image and the multispectral image, using Bayesian reasoning combined with prior information and likelihood function, maximizing the posterior probability to generate a fused high-resolution multispectral image.

[0134] In the method provided in this embodiment, first, orthorectification is performed on the first GF-2 image to obtain the orthorectified first GF-2 image; then, image registration is performed on the orthorectified first GF-2 image using a reference image to obtain the registered first GF-2 image; further, the panchromatic band and multispectral band of the registered first GF-2 image are fused to obtain the first GF-2 true color image, wherein the amount of information of the first GF-2 true color image is greater than that of the GF-2 satellite image, and the first GF-2 true color image is a high-resolution image with the spatial details of the panchromatic image and the spectral information of the multispectral image, and the accuracy of subsequently identifying the top surface of the building based on the first GF-2 true color image is improved.

[0135] According to a building top surface recognition method provided by the present invention, the steps of training a building recognition model include:

[0136] Acquire multiple second GF-2 images, and pre-process each second GF-2 image to obtain each second GF-2 true color image;

[0137] Using ArcGIS raster tools to slice each second high-resolution true color image to obtain each second high-resolution true color image of a preset size;

[0138] Performing building labeling processing on each second high-resolution-2 true color image of a preset size to obtain each labeled third high-resolution-2 true color image;

[0139] Determine the Gaofen-2 image data set based on each third Gaofen-2 true color image;

[0140] The GF-2 image dataset is divided into training set, test set and validation set;

[0141] According to the training set, test set, validation set, model batch size, loss function and preset number of iterations, the initial semantic segmentation model is trained to obtain the building recognition model.

[0142] Specifically, in some embodiments, the training steps of the building recognition model of the present invention include the following:

[0143] First, multiple second GF-2 images are acquired, and each second GF-2 image is preprocessed to obtain each second GF-2 true color image. The process of preprocessing each second GF-2 image is similar to the steps of preprocessing the first GF-2 image, and will not be repeated here.

[0144] Furthermore, each second high-resolution 2 true color image is sliced ​​using ArcGIS raster tools to obtain each second high-resolution 2 true color image of a preset size, wherein the preset size is a sample size suitable for model input, such as a 512×512 image.

[0145] Furthermore, the second GF-2 true color images of the preset size are subjected to building labeling to obtain the labeled third GF-2 true color images, and the GF-2 image dataset is determined based on the third GF-2 true color images. For example, a 512×512 image is subjected to building labeling to accurately outline all the buildings in the image, and a unified standard is formed into a GF-2 image dataset.

[0146] Furthermore, the GF-2 image dataset is divided into a training set, a test set and a validation set, for example, divided into the training set, the test set and the validation set in a ratio of 7:2:1.

[0147] Optionally, the initial semantic segmentation model is, for example, an initialized deep learning model, and the initialization process is, for example: combining the transfer learning method, pre-training the semantic segmentation model on a public dataset to obtain the initialization parameters of the model, wherein the public datasets are, for example, 1. GBSS building dataset: The images and building labels are from Google Maps and OpenStreetMap, respectively. The dataset covers six continents and contains approximately 742,000 building instances. The image of each sample has three RGB channels, a size of 512×512, and a resolution of 0.25 meters. 2. WHU aerial dataset: Contains approximately more than 20,000 building instances, and the image of each sample has three RGB channels, a size of 512×512, and a resolution of 0.3 meters. 3. Inria dataset: The dataset contains aerial images from five cities, with an image resolution of 0.3 meters and a sample size of 5000×5000. The main feature of the Inria dataset is that it covers different urban environments and provides rich and accurate building segmentation annotations.

[0148] Furthermore, the initial semantic segmentation model is trained according to the training set, test set, validation set, model batch size, loss function and preset number of iterations to obtain a building recognition model, that is, a building recognition model obtained after training using the GF-2 satellite image data.

[0149] In the method provided in this embodiment, multiple second GF-2 true color images are used for model training. First, each second GF-2 true color image is sliced ​​using ArcGIS raster tools to obtain each second GF-2 true color image of a preset size. Then, each second GF-2 true color image of a preset size is subjected to building annotation processing to obtain each third GF-2 true color image after annotation; a GF-2 image data set is determined based on each third GF-2 true color image; the GF-2 image data set is divided into a training set, a test set, and a validation set; and then, according to the training set, the test set, the validation set, the model batch size, the loss function, and the preset number of iterations, the initial semantic segmentation model is trained to obtain a building recognition model. The present invention utilizes domestic GF-2 satellite image data and the inherent morphological features of buildings, combined with a deep learning model, to achieve high-precision automatic extraction of building patches from remote sensing images, providing technical support for subsequent geographic information, geological disasters, and urban planning.

[0150] According to a building top surface recognition method provided by the present invention, a GF-2 image data set is determined according to each third GF-2 true color image, including:

[0151] Performing data enhancement operation on each third high-resolution No. 2 true color image to obtain each third high-resolution No. 2 true color image with data enhancement;

[0152] A GF-2 image dataset is determined based on the data enhanced third GF-2 true color images.

[0153] Specifically, in some embodiments, the implementation process of determining the GF-2 image data set according to each third GF-2 true color image includes the following steps:

[0154] First, data enhancement is performed on each third high-resolution No. 2 true color image to obtain each data-enhanced third high-resolution No. 2 true color image. Data enhancement can achieve the purpose of data augmentation. The data enhancement method includes Gaussian blur, random cropping, resampling, random contrast stretching, affine transformation, random removal of pixel blocks, picture rearrangement, etc., and one or more combinations of the above methods are selected for operation.

[0155] Furthermore, the building dataset after data enhancement can also be normalized. The normalization operation of the true color RGB image includes: obtaining the mean and variance of the three RGB channels, subtracting the channel mean from the pixel value of each channel and then dividing it by the variance.

[0156] Finally, the normalized data is divided into training data set, test set and validation set in a ratio of 7:2:1.

[0157] In the method provided in this embodiment, data enhancement operation can be performed on each third GF-2 true color image to obtain each data-enhanced third GF-2 true color image, and then the GF-2 image data set is determined based on each data-enhanced third GF-2 true color image. The GF-2 image data set obtained after data enhancement is used to train the initial deep learning model to obtain the building recognition model. In the present invention, the effect of model training using the GF-2 image data set is better, and the accuracy of building top surface recognition based on the trained building recognition model is higher.

[0158] According to a building top surface recognition method provided by the present invention, an initial semantic segmentation model is trained according to a training set, a test set, a validation set, a model batch size, a loss function, and a preset number of iterations to obtain a building recognition model, including:

[0159] According to the model batch size, the loss function, the preset number of iterations and the optimizer, the initial semantic segmentation model is trained using the training set to obtain the first model parameters of the initial semantic segmentation model;

[0160] Using the test set and the validation set to evaluate the semantic segmentation model corresponding to the first model parameters, and updating the first model parameters according to the evaluation results to obtain target model parameters;

[0161] The building recognition model is determined according to the target model parameters.

[0162] Specifically, in some embodiments, according to the training set, the test set, the validation set, the model batch size, the loss function, and the preset number of iterations, the process of training the initial semantic segmentation model to obtain the building recognition model can be implemented by the following steps, including:

[0163] First, according to the model batch size, loss function, preset number of iterations and optimizer, the initial semantic segmentation model is trained using the training set to obtain the first model parameters of the initial semantic segmentation model. Then, the semantic segmentation model corresponding to the first model parameters is evaluated using the test set and the validation set, and the first model parameters are updated according to the evaluation results to obtain the target model parameters. For example, the model batch size is set to 32, the loss function uses the cross entropy loss function, the preset number of iterations is determined to be 320,000 times, the optimizer is Adamw, and the relatively optimal parameters of the model (target model parameters) are selected and saved based on the test accuracy and the performance on the validation set.

[0164] Furthermore, the building recognition model is determined according to the target model parameters. That is, the relatively optimal parameters of the model (target model parameters) are determined as the final parameters of the deep learning model and saved, and the obtained deep learning model is the building recognition model, that is, the trained deep learning model.

[0165] In the method provided in this embodiment, during the model training process, firstly, the initial semantic segmentation model is trained using the training set according to the model batch size, loss function, preset number of iterations and optimizer to obtain the first model parameters of the initial semantic segmentation model; then, the semantic segmentation model corresponding to the first model parameter is evaluated using the test set and the validation set, and the first model parameter is updated according to the evaluation result to obtain the target model parameter; then, the building recognition model is determined according to the target model parameter. In the present invention, the effect of model training using the GF-2 image dataset is better, and the accuracy of building top surface recognition based on the trained building recognition model is higher.

[0166] Figure 3 FIG. 2 is a flow chart of the method for identifying the top surface of a building provided by the present invention. Figure 3 As shown, the method includes:

[0167] The original images of GF-2 are preprocessed. The preprocessing steps include orthorectification, image registration, and image fusion.

[0168] Model training process: perform sample outlining, cropping and data enhancement on multiple pre-processed GF-2 original images to obtain the GF-2 original image dataset; divide the GF-2 original image dataset into training set, test set and validation set; input the training set into the deep learning model, and use the test set and validation set to verify the model recognition effect. Finally, a deep learning model (building recognition model) is obtained through training, and the deep learning model has the optimal parameters.

[0169] Model reasoning process: The pre-processed GF-2 original image of the target area is subjected to block cropping, boundary filling, rotation angle, etc. to obtain the pre-processed GF-2 original image. The roof surface contour is extracted using the deep learning model based on the pre-processed GF-2 original image. The model recognition is post-processed, including vectorization, point thinning, and boundary regularization, and finally the building contour vector is obtained.

[0170] The building top surface recognition device provided by the present invention is described below. The building top surface recognition device described below and the building top surface recognition method described above can be referenced to each other.

[0171] Figure 4 Schematic diagram of the structure of the building top surface recognition device provided by the present invention. Figure 4 As shown, the building top surface recognition device 400 includes an acquisition module 410, a recognition module 420 and a post-processing module 430, wherein:

[0172] An acquisition module 410 is used to acquire a first GF-2 image of a target area; the first GF-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building;

[0173] The recognition module 420 is used to divide the first GF-2 image into blocks to obtain a plurality of first block images; each of the first block images is input into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using the GF-2 image data set, and the initial semantic segmentation model is a deep learning model;

[0174] The post-processing module 430 is used to perform regularization processing on the single-band binary image of the target building to obtain the top surface vector patch of the target building.

[0175] The device provided in this embodiment includes an acquisition module 410, an identification module 420 and a post-processing module 430, wherein the acquisition module 410 is used to acquire a first GF-2 image of a target area, wherein the first GF-2 image is a satellite image with a sub-meter resolution, and the target area contains a target building; then, the identification module 420 is used to block the first GF-2 image to obtain a plurality of first block images; each first block image is input into a building recognition model to identify and obtain a single-band binary image of the target building; wherein the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image data set, and the initial semantic segmentation model is a deep learning model; further, the post-processing module 430 performs regularization processing on the single-band binary image of the target building to obtain a top surface vector patch of the target building.

[0176] The initial semantic segmentation model in the present invention is a deep learning model, and the building recognition model is obtained by training the initial semantic segmentation model using the GF-2 image data set. By acquiring a first GF-2 image with high resolution of the target area, and then using the building recognition model to recognize each block of the first GF-2 image, a single-band binary image of the target building is obtained, thereby realizing high-precision intelligent automatic extraction of building patches in remote sensing images, and performing regular processing on the single-band binary image of the target building. The recognition result is considerable and reliable, and has good consistency with manual outlining. The present invention realizes fast and accurate extraction of building top surfaces.

[0177] According to the building top surface recognition device 400 provided by the present invention, the recognition module 420 is specifically used for:

[0178] Rotate each of the first block images by a preset angle to obtain each rotated first block image;

[0179] Filling blank areas in each of the rotated first block images according to the filling parameters corresponding to each of the rotated first block images to obtain each of the second block images;

[0180] Inputting each of the second block images into a building recognition model to obtain a recognition result corresponding to each of the second block images;

[0181] According to the preset angles and filling parameters corresponding to each of the second-block images, the recognition results corresponding to each of the second-block images are classified and merged to obtain a single-band binary image of the target building; the preset angles and filling parameters corresponding to each of the second-block images are consistent with the preset angles and filling parameters corresponding to each of the second-block images.

[0182] According to a building top surface recognition device 400 provided by the present invention, the post-processing module 430 is specifically used for:

[0183] Vectorizing the single-band binary image of the target building to obtain a plurality of vector spots;

[0184] Each of the vector image spots is regularized to obtain the top surface vector image spot of the target building.

[0185] According to a building top surface recognition device 400 provided by the present invention, the regularization of each of the vector image spots to obtain the top surface vector image spots of the target building includes:

[0186] Thinning the boundary points of each vector pattern patch to obtain each thinned vector pattern patch, so that the holes in the middle of each thinned vector pattern patch are automatically filled;

[0187] According to the minimum angle threshold or the minimum area threshold, the abnormal vector spots in the thinned out vector spots are screened and removed; the abnormal vector spots are vector spots whose angles are less than the minimum angle threshold in the thinned out vector spots or vector spots whose areas are less than the minimum area threshold in the thinned out vector spots;

[0188] Determine the main direction of each vector spot after thinning, and regularize the boundaries of each vector spot after thinning according to the main direction of the vector spot corresponding to each vector spot, so as to obtain each vector spot after the boundary regularization;

[0189] According to the edge length threshold, the short edges of each of the vector patches after the boundary regularization are removed to obtain the top surface vector patch of the target building.

[0190] According to a building top surface recognition device 400 provided by the present invention, the recognition module 420 is further used for:

[0191] Preprocessing the first GF-2 image to obtain a first GF-2 true color image;

[0192] The first high-resolution-2 true color image is divided into blocks to obtain a plurality of the first block images.

[0193] According to a building top surface recognition device 400 provided by the present invention, the recognition module 420 is further used for:

[0194] Performing orthorectification on the first GF-2 image to obtain the orthorectified first GF-2 image;

[0195] Using the reference image, performing image registration on the first GF-2 image after orthorectification to obtain the registered first GF-2 image;

[0196] The panchromatic band of the first GF-2 image after registration is fused with the multispectral band to obtain the first GF-2 true color image; the amount of information of the first GF-2 true color image is greater than that of the first GF-2 image, and the first GF-2 true color image is a high-resolution image with spatial details of the panchromatic image and spectral information of the multispectral band.

[0197] According to a building top surface recognition device 400 provided by the present invention, the device also includes a building recognition model training module;

[0198] The building recognition model training module is used to:

[0199] Acquire multiple second GF-2 images, and preprocess each of the second GF-2 images to obtain each second GF-2 true color image;

[0200] Using ArcGIS raster tools to slice each of the second GF-2 true color images to obtain each of the second GF-2 true color images of a preset size;

[0201] Performing building labeling processing on each of the second GF-2 true color images of a preset size to obtain each labeled third GF-2 true color image;

[0202] Determining the GF-2 image data set according to each third GF-2 true color image;

[0203] Dividing the GF-2 image data set into a training set, a test set and a validation set;

[0204] The initial semantic segmentation model is trained according to the training set, the test set, the validation set, the model batch size, the loss function and the preset number of iterations to obtain the building recognition model.

[0205] According to a building top surface recognition device 400 provided by the present invention, the building recognition model training module is further used for:

[0206] Performing a data enhancement operation on each of the third high-resolution-2 true color images to obtain data-enhanced third high-resolution-2 true color images;

[0207] The GF-2 image data set is determined according to each of the data enhanced third GF-2 true color images.

[0208] According to a building top surface recognition device 400 provided by the present invention, the building recognition model training module is further used for:

[0209] According to the model batch size, the loss function, the preset number of iterations and the optimizer, the initial semantic segmentation model is trained using the training set to obtain a first model parameter of the initial semantic segmentation model;

[0210] Using the test set and the validation set to evaluate the semantic segmentation model corresponding to the first model parameters, and updating the first model parameters according to the evaluation results to obtain target model parameters;

[0211] The building recognition model is determined according to the target model parameters.

[0212] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communications interface 520 and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the building top surface recognition method, which includes:

[0213] Acquire a first Gaofen-2 image of the target area; the first Gaofen-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building;

[0214] Divide the first GF-2 image into blocks to obtain a plurality of first block images;

[0215] Input each of the first block images into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image dataset, and the initial semantic segmentation model is a deep learning model;

[0216] The single-band binary image of the target building is regularized to obtain a top surface vector patch of the target building.

[0217] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0218] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the building top surface recognition method provided by the above methods, the method comprising:

[0219] Acquire a first Gaofen-2 image of the target area; the first Gaofen-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building;

[0220] Divide the first GF-2 image into blocks to obtain a plurality of first block images;

[0221] Input each of the first block images into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image dataset, and the initial semantic segmentation model is a deep learning model;

[0222] The single-band binary image of the target building is regularized to obtain a top surface vector patch of the target building.

[0223] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the building top surface recognition method provided by the above methods, the method comprising:

[0224] Acquire a first Gaofen-2 image of the target area; the first Gaofen-2 image is a satellite image with a sub-meter resolution, and the target area includes a target building;

[0225] Divide the first GF-2 image into blocks to obtain a plurality of first block images;

[0226] Input each of the first block images into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image dataset, and the initial semantic segmentation model is a deep learning model;

[0227] The single-band binary image of the target building is regularized to obtain a top surface vector patch of the target building.

[0228] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0229] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0230] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying a building top surface, characterized in that: include: Acquire the first GF-2 image of the target area; The first GF-2 image is a satellite image with a sub-meter resolution, and the target area includes the target building; Divide the first GF-2 image into blocks to obtain a plurality of first block images; Input each of the first block images into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using the GF-2 image dataset, and the initial semantic segmentation model is a deep learning model; the building recognition model is a SegFormer model; Regularizing the single-band binary image of the target building to improve the accuracy of building top surface recognition, and obtaining a top surface vector patch of the target building; The step of regularizing the single-band binary image of the target building to obtain the top surface vector map of the target building includes: Vectorizing the single-band binary image of the target building to obtain a plurality of vector spots; Regularizing each of the vector image spots to obtain the top surface vector image spots of the target building; The step of regularizing each of the vector image spots to obtain the top surface vector image spots of the target building includes: Thinning the boundary points of each vector pattern patch to obtain each thinned vector pattern patch, so that the holes in the middle of each thinned vector pattern patch are automatically filled; According to the minimum angle threshold or the minimum area threshold, the abnormal vector spots in the thinned out vector spots are screened and removed; the abnormal vector spots are vector spots whose angles are less than the minimum angle threshold in the thinned out vector spots or vector spots whose areas are less than the minimum area threshold in the thinned out vector spots; Determine the main direction of each vector spot after thinning, and regularize the boundaries of each vector spot after thinning according to the main direction of the vector spot corresponding to each vector spot, so as to obtain each vector spot after the boundary regularization; According to the edge length threshold, the short edges of each of the vector patches after the boundary regularization are removed to obtain the top surface vector patch of the target building.

2. The building top surface recognition method according to claim 1, characterized in that: The step of inputting each of the first block images into a building recognition model to identify and obtain a single-band binary image of the target building includes: Rotate each of the first block images by a preset angle to obtain each rotated first block image; Filling blank areas in each of the rotated first block images according to the filling parameters corresponding to each of the rotated first block images to obtain each of the second block images; Inputting each of the second block images into a building recognition model to obtain a recognition result corresponding to each of the second block images; According to the preset angles and filling parameters corresponding to each of the second-block images, the recognition results corresponding to each of the second-block images are classified and merged to obtain a single-band binary image of the target building; the preset angles and filling parameters corresponding to each of the second-block images are consistent with the preset angles and filling parameters corresponding to each of the second-block images.

3. The building top surface recognition method according to claim 1 or 2, characterized in that: The step of dividing the first GF-2 image into blocks to obtain a plurality of first block images includes: Preprocessing the first GF-2 image to obtain a first GF-2 true color image; The first high-resolution-2 true color image is divided into blocks to obtain a plurality of the first block images.

4. The building top surface recognition method according to claim 3, characterized in that: The preprocessing of the first GF-2 image to obtain the first GF-2 true color image includes: Performing orthorectification on the first GF-2 image to obtain the first GF-2 image after orthorectification; Using the reference image, performing image registration on the first GF-2 image after orthorectification to obtain the registered first GF-2 image; The panchromatic band of the first GF-2 image after registration is fused with the multispectral band to obtain the first GF-2 true color image; the amount of information of the first GF-2 true color image is greater than that of the first GF-2 image, and the first GF-2 true color image is a high-resolution image with spatial details of the panchromatic image and spectral information of the multispectral band.

5. The building top surface recognition method according to claim 1 or 2, characterized in that: The training steps of the building recognition model include: Acquire multiple second GF-2 images, and preprocess each of the second GF-2 images to obtain each second GF-2 true color image; Using ArcGIS raster tools to slice each of the second GF-2 true color images to obtain each of the second GF-2 true color images of a preset size; Performing building labeling processing on each of the second GF-2 true color images of a preset size to obtain each of the labeled third GF-2 true color images; Determining the GF-2 image data set according to each third GF-2 true color image; Dividing the GF-2 image data set into a training set, a test set and a validation set; The initial semantic segmentation model is trained according to the training set, the test set, the validation set, the model batch size, the loss function and the preset number of iterations to obtain the building recognition model.

6. The building top surface recognition method according to claim 5, characterized in that: Determining the GF-2 image data set according to each third GF-2 true color image includes: Performing a data enhancement operation on each of the third high-resolution-2 true color images to obtain data-enhanced third high-resolution-2 true color images; The GF-2 image data set is determined according to each of the data enhanced third GF-2 true color images.

7. The building top surface recognition method according to claim 5, characterized in that: The initial semantic segmentation model is trained according to the training set, the test set, the validation set, the model batch size, the loss function and the preset number of iterations to obtain the building recognition model, including: According to the model batch size, the loss function, the preset number of iterations and the optimizer, the initial semantic segmentation model is trained using the training set to obtain a first model parameter of the initial semantic segmentation model; Using the test set and the validation set to evaluate the semantic segmentation model corresponding to the first model parameters, and updating the first model parameters according to the evaluation results to obtain target model parameters; The building recognition model is determined according to the target model parameters.

8. A building top surface recognition device, characterized in that: include: An acquisition module, used to acquire the first GF-2 image of the target area; The first GF-2 image is a satellite image with a sub-meter resolution, and the target area includes the target building; A recognition module is used to divide the first GF-2 image into blocks to obtain a plurality of first block images; each of the first block images is input into a building recognition model to identify and obtain a single-band binary image of the target building; the building recognition model is obtained by training an initial semantic segmentation model using a GF-2 image data set, and the initial semantic segmentation model is a deep learning model; the building recognition model is a SegFormer model; A post-processing module is used to perform regular processing on the single-band binary image of the target building to improve the accuracy of building top surface recognition and obtain a top surface vector patch of the target building; The post-processing module is specifically used to vectorize the single-band binary image of the target building to obtain a plurality of vector spots; and to perform regular processing on each of the vector spots to obtain the top surface vector spot of the target building; The method of regularizing each of the vector patches to obtain the top surface vector patches of the target building includes: thinning out the patch boundary points of each of the vector patches to obtain the thinned out vector patches, so that the holes in the middle of the patches in each of the thinned out vector patches are automatically filled; screening and removing abnormal vector patches in each of the thinned out vector patches according to a minimum angle threshold or a minimum area threshold; the abnormal vector patches are vector patches whose patch angle values ​​in each of the thinned out vector patches are less than the minimum angle threshold or vector patches whose areas in each of the thinned out vector patches are less than the minimum area threshold; determining the patch main direction corresponding to each of the thinned out vector patches, and regularizing the boundaries of each of the thinned out vector patches according to the patch main direction corresponding to each of the vector patches to obtain each vector patch with regularized boundaries; removing the short edges of each of the vector patches with regularized boundaries according to a side length threshold to obtain the top surface vector patches of the target building.

Citation Information

Patent Citations

  • Remote sensing image building extraction method and system based on depth learning, storage medium and electronic device

    CN109446992A

  • High-resolution remote sensing image building identification method and system considering shadow information

    CN116665053A