Remote sensing image building extraction method combining U-Net and segmentation model
By combining U-Net and SAM models, using U-Net to generate point prompts and iteratively segment differential masks, the problems of incomplete identification and lack of details of building extraction in remote sensing images are solved, and efficient building segmentation effect is achieved.
Patent Information
- Application Number
- CN202510422349.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-04-07
AI Technical Summary
The problem of incomplete recognition of target masks and missing details of building extraction in remote sensing images, and the existing deep learning methods are not good in segmentation in high-resolution images.
Combining U-Net and segmentation model SAM, the remote sensing image is processed through U-Net to generate point prompts, and SAM is used for segmentation, and the differential mask is iteratively compared until it meets the preset area to generate the final mask.
Without increasing the running time, the integrity of building segmentation is improved and the error detection rate is reduced, effectively avoiding the problems of incomplete mask recognition and lack of details.
Smart Images

Figure CN120047457B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image processing, and in particular to a remote sensing image building extraction method combining U-Net and a segmentation model. Background Art
[0002] With the development of Earth observation satellites and aerial remote sensing technology, massive amounts of multi-source remote sensing data have provided a wealth of information for various applications. Building information, as a crucial component of geographic information, serves as essential foundational data for applications such as population density estimation, land use management, and urban planning. Before deep learning became mainstream, building features were primarily constructed manually based on the visual characteristics of images. These features were obtained through image segmentation and feature extraction, and then classified using traditional machine learning methods. However, these methods are often only applicable to specific datasets, suffer from low accuracy, and are unable to handle buildings with more complex shapes.
[0003] In recent years, the emergence of deep learning technology has greatly improved the accuracy and efficiency of automatic building extraction from high-resolution imagery. By automatically learning image features, the subjectivity of manual feature selection is avoided. Since the advent of convolutional neural networks, a series of semantic segmentation networks have been developed for automatic building extraction. U-Net deep learning network models use skip connections for feature fusion when extracting buildings, improving the extraction of detailed results. However, due to the significant semantic and scale differences between high- and low-level features, insufficient feature fusion can still lead to incomplete recognition and missing details in the extracted object masks. Summary of the Invention
[0004] The main purpose of this invention is to provide a remote sensing image building extraction method combining U-Net and segmentation model, aiming to solve the problems of incomplete mask recognition and missing details of target extracted from remote sensing images.
[0005] To achieve the above objectives, the present invention proposes a remote sensing image building extraction method combining U-Net and a segmentation model, comprising:
[0006] Acquire a remote sensing image, process the remote sensing image through U-Net, and determine a first mask for each building;
[0007] Determine the point prompt of each building according to the first mask of each building;
[0008] Input each of the point prompts into SAM segmentation to determine a second mask for each building;
[0009] determining a differential mask of each building according to each of the first masks and each of the second masks;
[0010] Determining whether the area of the differential mask meets a preset area;
[0011] When the preset area is met, the second mask becomes the final mask;
[0012] When the preset area is not met, the differential mask is used as the first mask, and the step of determining the point prompt of each building according to the first mask of each building is performed.
[0013] Preferably, the step of acquiring remote sensing images, processing the remote sensing images through U-Net, and determining the first mask of each building includes:
[0014] The remote sensing image is obtained, and the remote sensing image is processed by U-Net to determine the binary label of each pixel in the remote sensing image;
[0015] performing a denoising operation on each of the pixels marked with the binary label to eliminate error items in each of the pixels marked with the binary label;
[0016] The first mask of each building is determined by processing each pixel after eliminating error items using a connected component analysis algorithm.
[0017] Preferably, the step of determining the point prompt of each building according to the first mask of each building includes:
[0018] According to each of the first masks, two preset collection points, namely, the center of gravity of the first mask and the long side of the minimum circumscribed rectangle of the first mask, are determined as the point prompts of each building.
[0019] Preferably, the formula of the point prompt is as follows:
[0020] ;
[0021] in, The center of gravity and two preset collection points; is the center of gravity; One of the preset collection points; For another preset collection point; is the offset.
[0022] Preferably, the preset area is 25 pixels.
[0023] Preferably, the step of inputting each of the point prompts into SAM for segmentation to determine the second mask of each building includes:
[0024] The point prompts are input into SAM for segmentation to determine the preliminary mask of each building;
[0025] Determining whether the edge straight lines of each of the preliminary masks meet a first preset condition;
[0026] When the first preset condition is not met, removing the preliminary mask that does not meet the first preset condition;
[0027] When the first preset condition is met, the preliminary mask where the edge straight line meeting the first preset condition is located is determined as the second mask.
[0028] Preferably, the first preset condition is that the length of the edge straight line is greater than 10 pixels, and the number of the edge straight lines in the preliminary mask where the edge straight line is located is greater than or equal to 2.
[0029] Preferably, the step of inputting each of the point prompts into SAM for segmentation to determine a preliminary mask of each building comprises:
[0030] Determining whether the percentage of the pixel area of each preliminary mask to the minimum circumscribed rectangle of each preliminary mask meets a second preset condition;
[0031] When the second preset condition is not met, removing the preliminary mask that does not meet the second preset condition;
[0032] When the second preset condition is met, the preliminary mask meeting the second preset condition is determined as the second mask.
[0033] Preferably, the second preset condition is that the percentage of the pixel area of the preliminary mask to the minimum circumscribed rectangle of each preliminary mask is greater than or equal to 30%.
[0034] Compared with the prior art, the present invention has at least the following beneficial effects:
[0035] Remote sensing imagery is processed using U-Net to generate point cues, which are then segmented using SAM. Finally, a differential mask is generated by comparison. This differential mask is iterated until it meets the preset area, at which point the final mask is used. This effectively improves the integrity of building segmentation and reduces the false positive rate without increasing runtime, effectively avoiding issues such as incomplete mask recognition and missing details. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0037] Figure 11. A flow chart of an embodiment of a method for extracting buildings from remote sensing images by combining U-Net and a segmentation model according to the present invention;
[0038] Figure 2 This is a flow chart of another embodiment of the method for extracting buildings from remote sensing images by combining U-Net and a segmentation model according to the present invention;
[0039] Figure 3 It is a schematic diagram of the calculation of the point prompt;
[0040] Figure 4a It is remote sensing image 1; Figure 4b A first effect diagram for generating a point prompt based on a remote sensing image; Figure 4c The second rendering is obtained by segmenting the first rendering using SAM;
[0041] Figure 5a It is remote sensing image 2; Figure 5b This is the third effect image of the first mask after processing the remote sensing image 2 through U-Net; Figure 5c a fourth rendering of the second mask determined by first segmenting the third rendering using SAM; Figure 5d a fifth rendering of a second mask determined by segmenting the third rendering using SAM for the second time; Figure 5e A sixth rendering of the differential mask determined according to the third rendering and the fourth rendering; Figure 5f A seventh rendering of the differential mask determined according to the third rendering and the fifth rendering;
[0042] Figure 6 The figure is a comparison chart of the embodiments, where a is an example remote sensing image, b is the rendering of the ground truth (artificially extracted building standard set) of the building extracted from the remote sensing image; c is the rendering of the building extracted by U-Net; d is the rendering of the building extracted by U-Net+L2; e is the rendering of the building extracted by Ours(L2);
[0043] Figure 7 The following are comparison diagrams of local details of the embodiment, where a is an example remote sensing image, b is the rendering of the true value of the building extracted from the remote sensing image (a standard set of buildings extracted manually); c is the rendering of the building extracted by U-Net; d is the rendering of the building extracted by DeepLabv3+; e is the rendering of the building extracted by U-Net+L2; and f is the rendering of the building extracted by Ours(L2).
[0044] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0045] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to be used to explain the present invention, but should not be understood as limiting the present invention.
[0046] See also Figures 1 to 7 To achieve the above objectives, a first embodiment of the present invention provides a remote sensing image building extraction method combining U-Net and a segmentation model, comprising:
[0047] Step S10, acquiring remote sensing images, processing the remote sensing images through U-Net, and determining the first mask of each building;
[0048] Step S20: Determine the point prompt of each building based on the first mask of each building (see Figures 4a to 4c );
[0049] Step S30, input each point prompt into SAM segmentation to determine the second mask of each building;
[0050] Step S40, determining a differential mask of each building based on each first mask and each second mask;
[0051] Step S50, determining whether the area of the differential mask meets the preset area;
[0052] Step S60: when the preset area is met, the second mask becomes the final mask;
[0053] Step S70 : When the area does not meet the preset area, the differential mask is used as the first mask, and a step of determining a point prompt of each building is performed according to the first mask of each building.
[0054] Remote sensing imagery is processed using U-Net to generate point cues, which are then segmented using SAM. Finally, a differential mask is generated by comparison. This differential mask is iterated until it meets the preset area, at which point the final mask is used. This effectively improves the integrity of building segmentation and reduces the false positive rate without increasing runtime, effectively avoiding issues such as incomplete mask recognition and missing details.
[0055] Specifically, U-Net is a fully convolutional deep neural network. U-Net can run quickly on GPUs, and its reasoning speed is faster than DeepLabv3+. However, it has the disadvantages of smooth edges in the segmentation results and confusion of adjacent buildings, and its segmentation accuracy is slightly lower than DeepLabv3+. In order to increase the reasoning speed as much as possible, this application chooses the U-Net method instead of DeepLabv3+ as the building semantic extractor to generate a mask of the building for further generating point prompts. After training U-Net in the conventional way, the network parameter training results are retained and can be used for segmentation, thereby providing semantic prompts for EfficientViT-SAM.
[0056] Specifically, SAM is EfficientViT-SAM, which has strong generalization capabilities and can perform instance segmentation based on input point prompts, box prompts or text prompts. Since the data for training EfficientViT-SAM does not contain building annotations in high-resolution remote sensing images, it is impossible to directly segment buildings using text prompt schemes; the point prompt function is simple and fast, but it requires high-quality points. U-Net has the ability to quickly extract building masks, so this application proposes to use the point prompt segmentation function of EfficientViT-SAM to extract buildings. Combining the advantages of these two methods, U-Net is used as a semantic extractor and EfficientViT-SAM is used as a mask segmenter. Point prompts are obtained by processing the segmentation results of U-Net, and then the point prompts are input into EfficientViT-SAM to obtain high-quality segmentation results. This process is iterated until new point prompts can no longer be extracted from the difference map between the segmentation results of U-Net and the segmentation results of EfficientViT-SAM. The overall process is as follows Figure 2 shown.
[0057] The remote sensing image building extraction method combining U-Net and a segmentation model proposed in the second embodiment of the present invention is based on the first embodiment, and step S10 includes:
[0058] Step S11, acquiring a remote sensing image, processing the remote sensing image through U-Net, and determining a binary label for each pixel in the remote sensing image;
[0059] Step S12, performing a denoising operation on each pixel marked with a binary label to eliminate erroneous items in each pixel marked with a binary label;
[0060] Step S13 , processing each pixel after eliminating the error items by a connected component analysis algorithm to determine a first mask for each building.
[0061] In order to obtain high-quality building segmentation results using the point hint segmentation function of EfficientViT-SAM, we first need to generate point hints for each building from the semantic segmentation results of U-Net.
[0062] Since the U-Net semantic segmentation result essentially labels each pixel as a binary label of whether it is a building, rather than generating a mask for each building instance, it is necessary to first use the connected component analysis algorithm to obtain the building mask.
[0063] The Spaghetti Labeling 4-neighborhood connected region analysis is used to obtain the most detailed building masks possible.
[0064] The U-Net segmentation results inevitably contain noise (i.e., errors), which can lead to incorrect cue points. Therefore, before using the Connected Component Analysis algorithm, a denoising operation based on the preset area of the mask is required to eliminate the influence of these errors.
[0065] The remote sensing image building extraction method combining U-Net and a segmentation model proposed in the third embodiment of the present invention is based on the first embodiment, and step S20 includes:
[0066] Step S21 : According to each first mask, the center of gravity of the first mask and two preset collection points of the longest side of the minimum circumscribed rectangle of the first mask are determined as point prompts of each building.
[0067] The centroid of each connected component is extracted as a point hint.
[0068] Multiple point hints can achieve better segmentation accuracy and stability than single point hints. First, the centroid of each first mask is extracted as one of the hints.
[0069] See also Figure 3 Considering that the building mask is generally a rectangle with a large difference in length and width, the minimum circumscribed rectangle of the first mask is calculated, and two preset collection points are sampled in the direction of the long side of the rectangle as the remaining point prompts. The center of gravity of the first mask and the two preset collection points of the first mask's minimum circumscribed moment, a total of three image points, are point prompts. The length of the long side of the minimum rectangle outside the first mask is recorded as , long side The angle with the x-axis of the image coordinate system is denoted as .
[0070] The fourth embodiment of the present invention proposes a remote sensing image building extraction method combining U-Net and a segmentation model, based on the third embodiment, and the formula for the point prompt is as follows:
[0071] ;
[0072] in, The center of gravity and two preset collection points; is the center of gravity; One of the preset collection points; For another preset collection point; is the offset.
[0073] The method for extracting buildings from remote sensing images by combining U-Net and a segmentation model proposed in the fifth embodiment of the present invention is based on any one of the first to fourth embodiments, and the preset area is 25 pixels.
[0074] The point hints of each building are fed into EfficientViT-SAM in turn for refined segmentation, and the segmentation results are finally merged. However, the above strategy faces two major problems:
[0075] Due to the limitations of U-Net segmentation accuracy, masks of different buildings with similar distances may be connected, resulting in the point hints generated by the center not falling into every building, resulting in incomplete segmentation results.
[0076] With a small number of cue points, EfficientViT-SAM often only segments half of the roof containing the cue points.
[0077] See also Figures 5a to 5f ,Therefore, a logical judgment is performed based on the area of the differential mask, and steps S10 to S50 are iterated repeatedly until step S10 meets the preset area (i.e., 25 pixels), and the final structure mask is obtained.
[0078] The method for extracting buildings from remote sensing images by combining U-Net and a segmentation model, proposed in the sixth embodiment of the present invention, is based on any one of the first to fourth embodiments, and step S30 includes:
[0079] Step S31, input each point prompt into SAM for segmentation to determine the preliminary mask of each building;
[0080] Step S32, determining whether the edge straight lines of each preliminary mask meet a first preset condition;
[0081] Step S33, when the first preset condition is not met, removing the preliminary mask that does not meet the first preset condition;
[0082] Step S34 : when the first preset condition is met, the preliminary mask where the edge straight line meeting the first preset condition is located is determined as the second mask.
[0083] The method for extracting buildings from remote sensing images by combining U-Net and a segmentation model proposed in the seventh embodiment of the present invention is based on the sixth embodiment, and the first preset condition is that the length of the edge line is greater than 10 pixels, and the number of edge lines in the preliminary mask where the edge line is located is greater than or equal to 2.
[0084] The method for extracting buildings from remote sensing images by combining U-Net and a segmentation model, proposed in the eighth embodiment of the present invention, is based on the sixth embodiment, and step S31 includes:
[0085] Step S35, determining whether the percentage of the pixel area of each preliminary mask to the minimum circumscribed rectangle of each preliminary mask meets a second preset condition;
[0086] Step S36, when the second preset condition is not met, removing the preliminary mask that does not meet the second preset condition;
[0087] Step S37 : When the second preset condition is met, the preliminary mask meeting the second preset condition is determined as the second mask.
[0088] The method for extracting buildings from remote sensing images by combining U-Net and a segmentation model proposed in the ninth embodiment of the present invention is based on the eighth embodiment, and the second preset condition is that the pixel area of the preliminary mask accounts for a percentage greater than or equal to 30% of the minimum circumscribed rectangle of each preliminary mask.
[0089] In step S20, there will be erroneous points prompting the input of EfficientViT-SAM, resulting in two situations: no segmentation result or segmentation error. To eliminate these two erroneous segmentation results, the first preset bar and the second preset condition are used to perform exclusion filtering to ensure the integrity of the final mask and reduce the false detection rate.
[0090] Example:
[0091] Experimental dataset and configuration:
[0092] This application uses a community building dataset as a training and validation dataset. The community building dataset is a large dataset composed of multi-source remote sensing images. The size of each image is 512 pixels × 512 pixels. For an overview and examples, see Figures 2 to 7 There are 8,189 aerial images with a spatial resolution of approximately 0.075m, covering an area of approximately 450km2 in Christchurch, New Zealand. 2 , including rural, residential, cultural and educational, and industrial areas. 60% of the images in the dataset were randomly selected as the training set, 5% as the evaluation set, and the remaining 35% as the test set to evaluate the model performance.
[0093] The experimental hardware configuration for this application is: Intel(R) Core(TM) i7-11700 CPU @ 2.50GHz octa-core, 32GB of RAM, and Nvidia GTX 1660 6GB graphics card. The software configuration is: using the PyTorch 2.1 deep learning framework on Windows 10 system.
[0094] Accuracy evaluation indicators:
[0095] To evaluate the effectiveness of building extraction, the detection accuracy is evaluated using the intersection over union (IoU), precision, and recall. The formulas for calculating these three indicators using the building semantic segmentation results and the true building mask are shown in formulas (1), (2), and (3), respectively.
[0096] Where, formula (1) is as follows:
[0097] Intersection and Union ;
[0098] Formula (2) is as follows:
[0099] Accuracy ;
[0100] Formula (3) is as follows:
[0101] Recall ;
[0102] Among them, N TP is the number of true positive pixels, that is, the number of pixels whose true value is a building and the model prediction result also belongs to a building; N FN is the number of false negative pixels, that is, the number of pixels where the true value of the sample is a building but the model predicts it as a non-building; N FP is the number of false positive predictions, that is, the number of pixels where the true value of the sample is not a building but the model predicts it as a building.
[0103] Generally speaking, when precision is high, recall is low; when recall is high, precision is low.
[0104] Experiment and result analysis:
[0105] To complete the experiment, a U-Net was trained on aerial imagery from a community dataset; for comparison, a DeepLabv3+ network with improved accuracy was also trained. EfficientViT-SAM offers five pre-trained models, tailored to the image size and performance. Details are listed below:
[0106]
[0107] Given that the image size of a community building dataset is cropped to 512×512, we selected three pre-trained models, L0, L1, and L2, for comparative experiments, abbreviated as Ours(L0), Ours(L1), and Ours(L2), respectively. Experiments that used only the points generated by the U-Net mask as prompts for the EfficientViT-SAM input without iterative segmentation were abbreviated as U-Net+L0, U-Net+L1, and U-Net+L2, respectively. Furthermore, to demonstrate the efficiency of our proposed method, we also conducted comparative experiments using the ViT-H pre-trained model with the best accuracy for the classic SAM (abbreviated as Ours(ViT-H)). The test results are shown in the following table:
[0108]
[0109] As can be seen from the test results table, the iterative segmentation method using EfficientViT-SAM to refine the segmentation has achieved significant accuracy improvements compared to the direct use of the U-Net method and DeepLabv3+ method. Compared with DeepLabv3+, the method of this application using the L2 model improved the intersection-over-union ratio, precision, and recall from 75.36%, 88.35%, and 89.13% to 78.92%, 91.20%, and 89.73%. Although the U-Net+L0\L1\L2 method does not use an iterative strategy, the segmentation accuracy has also been significantly improved. This is because the mask edges of U-Net segmentation are usually blurred, and using EfficientViT-SAM can significantly improve the segmentation quality. The iterative segmentation method performs better than the non-iterative method on different pre-trained models, proving that the non-iterative U-Net+EfficientViT-SAM method improves the segmentation effect of buildings. However, it is affected by insufficient point cues and fails to fully utilize the semantic information of the U-Net segmentation results to completely segment all buildings. The use of an iterative strategy can effectively improve the utilization rate of the U-Net segmentation results and enhance the final segmentation accuracy.
[0110] Comparing the U-Net data and DeepLabv3+ data in the test results table shows that, as two classic deep segmentation networks, U-Net's segmentation performance is slightly inferior to DeepLabv3+. In other words, DeepLabv3+ extracts individual buildings more completely, but its recall is very close to that of U-Net. The advantage of the iterative strategy lies in its full utilization of semantic information. There is no significant difference in semantic extraction completeness between DeepLabv3+ and U-Net. Consequently, the accuracy difference between Ours (DeepLabv3+ / L2) and Ours (L2), which also use the iterative strategy, is not significant.
[0111] From the numerical point of view, the accuracy of Ours (DeepLabv3+L2) and Ours (ViT-H) are slightly higher than Ours (L2), and the advantage of Ours (ViT-H) is more obvious. Ours (ViT-H) and Ours (L2) are based on the same semantic network U-Net, and the segmentation accuracy results mainly depend on the difference in segmentation performance between the ViT-H and L2 pre-training models. In most scenarios, the segmentation effect of ViT-H is better than L2, so Ours (ViT-H) showed the highest accuracy in the research of this application. However, by comparing the running time and memory usage, it was found that ViT-H consumes too much computing power, and the running time is more than twenty times that of Ours (L2), which is not suitable for practical applications.
[0112] The segmentation effects of the four methods, U-Net, DeepLabv3+, U-Net+L2 and Ours(L2), are shown in the figure. Figure 6 As shown in Figure 2. The segmentation results of Ours (L2) are more complete than those of U-Net+L2, and the incomplete buildings are more complete, which proves the effectiveness and necessity of the iterative strategy. The local details are shown in Figure 2. Figure 7 shown.
[0113] In the description of this specification, reference to the terms "one embodiment", "another embodiment", "other embodiments", or "first embodiment to Xth embodiment" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention.
[0114] In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example.
[0115] Furthermore, the specific features, structures, materials, method steps, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0116] It should be noted that, in the text, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0117] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments. Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network equipment, etc.) to execute the methods described in the various embodiments of the present invention.
[0118] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.
Claims
1. A remote sensing image building extraction method combining U-Net and segmentation model, characterized in that: include: Acquire a remote sensing image, process the remote sensing image through U-Net, and determine a first mask for each building; Determine the point prompt of each building according to the first mask of each building; Input each of the point prompts into SAM segmentation to determine a second mask for each building; determining a differential mask of each building according to each of the first masks and each of the second masks; Determining whether the area of the differential mask meets a preset area; When the preset area is met, the second mask becomes the final mask; When the preset area is not met, the differential mask is used as the first mask, and the step of determining the point prompt of each building according to the first mask of each building is performed; The step of determining a point prompt for each building based on the first mask of each building includes: According to each of the first masks, determining the center of gravity of the first mask and two preset collection points of the longest side of the minimum circumscribed rectangle of the first mask as the point prompts of each building; The formula for the point prompt is as follows: ; in, The center of gravity and two preset collection points; is the center of gravity; One of the preset collection points; For another preset collection point; is the offset.
2. The remote sensing image building extraction method combining U-Net and segmentation model according to claim 1, characterized in that: The step of acquiring a remote sensing image, processing the remote sensing image through U-Net, and determining a first mask for each building includes: The remote sensing image is obtained, and the remote sensing image is processed by U-Net to determine the binary label of each pixel in the remote sensing image; performing a denoising operation on each of the pixels marked with the binary label to eliminate error items in each of the pixels marked with the binary label; The first mask of each building is determined by processing each pixel after eliminating error items using a connected component analysis algorithm.
3. The remote sensing image building extraction method combining U-Net and segmentation model according to claim 1 or 2, characterized in that: The preset area is 25 pixels.
4. The remote sensing image building extraction method combining U-Net and segmentation model according to claim 1 or 2, characterized in that: The step of inputting each of the point prompts into SAM for segmentation and determining the second mask of each building comprises: The point prompts are input into SAM for segmentation to determine the preliminary mask of each building; Determining whether the edge straight lines of each of the preliminary masks meet a first preset condition; When the first preset condition is not met, removing the preliminary mask that does not meet the first preset condition; When the first preset condition is met, the preliminary mask where the edge straight line meeting the first preset condition is located is determined as the second mask.
5. The remote sensing image building extraction method combining U-Net and segmentation model according to claim 4, characterized in that: The first preset condition is that the length of the edge straight line is greater than 10 pixels, and the number of the edge straight lines in the preliminary mask where the edge straight line is located is greater than or equal to 2.
6. The remote sensing image building extraction method combining U-Net and segmentation model according to claim 4, characterized in that: The step of inputting each of the point prompts into SAM for segmentation and determining a preliminary mask of each building comprises: Determining whether the percentage of the pixel area of each preliminary mask to the minimum circumscribed rectangle of each preliminary mask meets a second preset condition; When the second preset condition is not met, removing the preliminary mask that does not meet the second preset condition; When the second preset condition is met, the preliminary mask meeting the second preset condition is determined as the second mask.
7. The remote sensing image building extraction method combining U-Net and segmentation model according to claim 6, characterized in that: The second preset condition is that the percentage of the pixel area of the preliminary mask to the minimum circumscribed rectangle of each preliminary mask is greater than or equal to 30%.
Citation Information
Patent Citations
Remote sensing image building instance mask extraction method and system, medium and equipment
CN112991301A
Land parcel segmentation method, device and equipment and storage medium
CN118470316A