Rapid regularization method, device, equipment and storage medium for remote sensing building interpretation

Through the instance segmentation algorithm and the improved Douglas-Peukcer algorithm, the area difference and ratio of the remote sensing building image are calculated to obtain the accurate contour vertex coordinates of the building, which solves the problem that remote sensing images cannot accurately reflect the building profile and size in the existing technology, and achieves an accurate reflection of the shape and size of the building.

CN117115646BActive Publication Date: 2025-03-14叁农数据(广州)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311048714.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2025-03-14
Estimated Expiration
2043-08-18

AI Technical Summary

Technical Problem

In the prior art, the images after remote sensing images cannot accurately reflect the building profile and size, and it is difficult to directly apply to building drawings such as planning and disaster assessment.

Method used

The original segmentation result of the remote sensing building image is obtained through the instance segmentation algorithm, the original pixel area and the minimum external rectangle area of ​​each instance mask are calculated, the area difference is calculated and the ratio with the original pixel is compared. If the ratio is not less than the area deviation rate threshold, the contour vertex coordinates are obtained using the improved Douglas-Peukcer algorithm; otherwise, the rectangular vertex coordinates with the smallest difference from the original pixel area are directly obtained as the contour vertex coordinates.

Benefits of technology

Accurate reflection of the shape and size of the building profile is achieved, and more suitable regularization methods are provided to obtain the actual profile of the building, which is suitable for applications such as planning and disaster assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115646B_ABST
    Figure CN117115646B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of remote sensing image recognition, and discloses a fast regularization method for remote sensing building interpretation. The present invention obtains the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask by using an instance segmentation algorithm to perform original segmentation on the remote sensing building image, obtains the area difference according to the original pixel area and the minimum circumscribed rectangle area, compares the ratio of the area difference to the original pixel with the area deviation rate threshold, and obtains the contour vertex coordinates based on the improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, otherwise, directly obtains the rectangle vertex coordinates with the minimum difference from the original pixel area as the contour vertex coordinates. The building contour is obtained according to the contour vertex coordinates. The building contour is obtained by determining a regularization method that is more suitable for the current original segmentation result based on the original pixel area and the minimum circumscribed rectangle area of ​​the original segmentation result, and the building contour that can reflect the actual contour shape and size of the building is obtained.
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 recognition, and in particular to a rapid regularization method, device, equipment and storage medium for remote sensing building interpretation. Background Art

[0002] Semantic segmentation and instance segmentation algorithms are widely used in remote sensing object interpretation, especially in building extraction. Remote sensing images can be segmented by instance segmentation algorithms to obtain a single building mask. After the contour is extracted, there are problems such as irregular shapes, jagged edges, and inaccurate reflection of the shape and size of the building contour, which makes it difficult to directly apply it to architectural mapping such as planning and disaster assessment.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a rapid regularization method, device, equipment and storage medium for remote sensing building interpretation, aiming to solve the technical problem that the existing technology cannot accurately reflect the outline and size of the building in the image after remote sensing image segmentation.

[0005] To achieve the above object, the present invention provides a rapid regularization method for remote sensing building interpretation, the method comprising the following steps:

[0006] According to the original segmentation results of the remote sensing building image by the instance segmentation algorithm, the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask are obtained;

[0007] Obtaining an area difference according to the original pixel area and the minimum circumscribed rectangle area;

[0008] comparing the ratio of the area difference to the original pixel with an area deviation rate threshold;

[0009] When the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates are obtained based on the improved Douglas-Peukcer algorithm; otherwise, the coordinates of the rectangle vertex with the smallest area difference with the original pixel are directly obtained as the contour vertex coordinates;

[0010] The building outline is obtained according to the coordinates of the outline vertices.

[0011] Optionally, the original segmentation result of the remote sensing building image is obtained according to the instance segmentation algorithm to obtain the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask, including:

[0012] Read the original segmentation result according to the GDAL library;

[0013] Performing histogram calculation on the original segmentation result, marking connected areas with non-zero pixel values ​​as instances;

[0014] Obtaining the outermost contour of the building mask in the mask image according to the mask image of the example, and obtaining the original pixel area according to the outermost contour;

[0015] A minimum circumscribed rectangle is obtained according to the outermost contour, and the minimum circumscribed rectangle area is obtained according to the minimum circumscribed rectangle.

[0016] Optionally, the performing histogram calculation on the original segmentation result and marking connected areas with non-zero pixel values ​​as instances includes:

[0017] Obtaining a minimum circumscribed rectangle according to the connected area of ​​non-zero pixel values;

[0018] Obtaining the length and width of the minimum circumscribed rectangle according to the minimum circumscribed rectangle;

[0019] When the number of pixel values ​​of the length and the width are not all less than the set number, the connected area is marked as an instance.

[0020] Optionally, after obtaining the length and width of the minimum circumscribed rectangle according to the minimum circumscribed rectangle, the method further includes:

[0021] When the number of pixel values ​​of the length and the width are both less than a set number, the connected area is filtered.

[0022] Optionally, when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates are obtained based on an improved Douglas-Peukcer algorithm, including:

[0023] Obtaining a distance threshold range of the Douglas-Peukcer algorithm;

[0024] Obtaining contour points of the outer contour of the building mask at each distance threshold according to the distance threshold range;

[0025] Calculate the corresponding area according to the contour points;

[0026] Subtract the area from the area corresponding to the previous contour point, and store the absolute value of the result of dividing the difference by the original pixel area into a list;

[0027] After all distance thresholds in the distance threshold range are calculated, traverse the list to obtain the index value corresponding to the maximum value in the list;

[0028] The previous distance threshold of the index value corresponding to the maximum value in the list is used to obtain the final distance threshold;

[0029] The building contour points are obtained according to the final distance, and the contour vertex coordinates of the building contour points are obtained.

[0030] Optionally, after comparing the ratio of the area difference to the original pixel with an area deviation rate threshold, the method further includes:

[0031] When the ratio of the area difference to the original pixel is less than the area deviation rate threshold, maintaining the aspect ratio of the minimum circumscribed rectangle, reducing the length and width of the minimum circumscribed rectangle, and obtaining the iterated length and width;

[0032] Calculate the pixel area of ​​the minimum bounding rectangle after iteration according to the length and width after iteration;

[0033] Obtaining a difference value set according to an absolute value of a difference between a pixel area of ​​the iterated minimum circumscribed rectangle and an original pixel area;

[0034] Select the length and width combination with the smallest absolute value from the difference set to obtain the optimal rectangle length and width;

[0035] The vertex coordinates of the optimal rectangle are obtained according to the length and width of the optimal rectangle.

[0036] Optionally, when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, after obtaining the contour vertex coordinates based on the improved Douglas-Peukcer algorithm, the method further includes:

[0037] The contour vertex coordinates are converted into corresponding geographic coordinates based on the affine transformation coefficients.

[0038] In addition, to achieve the above-mentioned purpose, the present invention also proposes a rapid regularization device for remote sensing building interpretation, the rapid regularization device for remote sensing building interpretation comprising:

[0039] The area acquisition module is used to obtain the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask based on the original segmentation result of the remote sensing building image according to the instance segmentation algorithm;

[0040] An area calculation module, used for obtaining an area difference according to the original pixel area and the minimum circumscribed rectangle area;

[0041] An area comparison module, used for comparing the ratio of the area difference to the original pixel with an area deviation rate threshold;

[0042] A coordinate determination module, configured to obtain the contour vertex coordinates based on an improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold; otherwise, directly obtain the coordinates of the rectangle vertex with the smallest area difference with the original pixel as the contour vertex coordinates;

[0043] The outline drawing module is used to obtain the building outline according to the coordinates of the outline vertices.

[0044] In addition, to achieve the above-mentioned purpose, the present invention also proposes a rapid regularization device for remote sensing building interpretation, the rapid regularization device for remote sensing building interpretation comprising: a memory, a processor, and a rapid regularization program for remote sensing building interpretation stored in the memory and executable on the processor, the rapid regularization program for remote sensing building interpretation being configured to implement the steps of the rapid regularization method for remote sensing building interpretation as described above.

[0045] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a rapid regularization program for remote sensing building interpretation is stored. When the rapid regularization program for remote sensing building interpretation is executed by a processor, the steps of the rapid regularization method for remote sensing building interpretation as described above are implemented.

[0046] The present invention obtains the original pixel area and the minimum circumscribed rectangular area of ​​each instance mask by using the instance segmentation algorithm to perform the original segmentation result of the remote sensing building image, obtains the area difference according to the original pixel area and the minimum circumscribed rectangular area, compares the ratio of the area difference to the original pixel with the area deviation rate threshold, and obtains the contour vertex coordinates based on the improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, otherwise, directly obtains the rectangle vertex coordinates with the minimum difference with the original pixel area as the contour vertex coordinates. The building contour is obtained according to the contour vertex coordinates. The regularization method that is more suitable for the current original segmentation result is determined by the original pixel area and the minimum circumscribed rectangular area of ​​the original segmentation result, thereby obtaining the building contour that can reflect the actual shape and size of the building contour. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a structural schematic diagram of a rapid regularization device for remote sensing building interpretation in a hardware operating environment involved in an embodiment of the present invention;

[0048] Figure 2 It is a flow chart of the first embodiment of the rapid regularization method for remote sensing building interpretation of the present invention;

[0049] Figure 3A flowchart of rapid regularization of remote sensing building interpretation according to an embodiment of a rapid regularization method for remote sensing building interpretation according to the present invention;

[0050] Figure 4 This is a comparison diagram of example segmentation algorithm processing of an embodiment of a fast regularization method for remote sensing building interpretation of the present invention;

[0051] Figure 5 It is a flow chart of a second embodiment of a rapid regularization method for remote sensing building interpretation according to the present invention;

[0052] Figure 6 It is an original single instance mask regularization comparison diagram of an embodiment of a fast regularization method for remote sensing building interpretation of the present invention;

[0053] Figure 7 A comparison diagram of the original mask before and after regularization of an embodiment of a rapid regularization method for remote sensing building interpretation of the present invention;

[0054] Figure 8 This is a structural block diagram of the first embodiment of the rapid regularization device for remote sensing building interpretation of the present invention.

[0055] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0057] Reference Figure 1 , Figure 1 The schematic diagram of the structure of the rapid regularization device for remote sensing building interpretation in the hardware operating environment involved in the embodiment of the present invention is shown.

[0058] like Figure 1As shown, the rapid regularization device for remote sensing building interpretation may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0059] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the rapid regularization device for remote sensing architectural interpretation, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0060] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a fast regularization program for remote sensing building interpretation.

[0061] exist Figure 1 In the fast regularization device for remote sensing building interpretation shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the fast regularization device for remote sensing building interpretation of the present invention can be set in the fast regularization device for remote sensing building interpretation, and the fast regularization device for remote sensing building interpretation calls the fast regularization program for remote sensing building interpretation stored in the memory 1005 through the processor 1001, and executes the fast regularization method for remote sensing building interpretation provided by the embodiment of the present invention.

[0062] The embodiment of the present invention provides a fast regularization method for remote sensing building interpretation, referring to Figure 2 , Figure 2 It is a flow chart of a first embodiment of a rapid regularization method for remote sensing building interpretation according to the present invention.

[0063] In this embodiment, the rapid regularization method for remote sensing building interpretation includes the following steps:

[0064] Step S10: According to the original segmentation result of the remote sensing building image using the instance segmentation algorithm, the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask are obtained.

[0065] It should be noted that the executor of this embodiment is a rapid regularization device for remote sensing building interpretation, wherein the rapid regularization device for remote sensing building interpretation has functions such as data processing, data communication and program running. The rapid regularization device for remote sensing building interpretation can be an integrated controller, a control computer and other devices, and of course it can also be other devices with similar functions, and this embodiment does not limit this.

[0066] It should be noted that the original segmentation of the remote sensing building image is performed through the instance segmentation algorithm to obtain the original segmentation result, which includes several instance masks. Read each instance mask in the instance segmentation result, calculate its original pixel area and the coordinates of the minimum enclosing rectangle, and obtain the area of ​​the minimum enclosing rectangle based on the coordinates of the minimum enclosing rectangle. The format of the minimum enclosing rectangle is ((x, y), (w, h), angle), where (x, y) is the center point of the minimum enclosing rectangle corresponding to the instance mask, (w, h) is the length and width of the minimum enclosing rectangle, and angle is the rotation angle of the minimum enclosing rectangle.

[0067] Furthermore, the original segmentation result of the remote sensing building image is obtained according to the instance segmentation algorithm to obtain the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask, including:

[0068] Read the original segmentation result according to the GDAL library;

[0069] Performing histogram calculation on the original segmentation result, marking connected areas with non-zero pixel values ​​as instances;

[0070] Obtaining the outermost contour of the building mask in the mask image according to the mask image of the example, and obtaining the original pixel area according to the outermost contour;

[0071] A minimum circumscribed rectangle is obtained according to the outermost contour, and the minimum circumscribed rectangle area is obtained according to the minimum circumscribed rectangle.

[0072] In the specific implementation, refer to Figure 3 , Figure 3 This is a fast regularization flowchart for remote sensing building interpretation. The original segmentation results of the instance segmentation algorithm are read using the GDAL (Geospatial Data Abstraction Library) library. The original segmentation results are in TIFF format. Figure 4 , Figure 4 Processing comparison chart for instance segmentation algorithm. Figure 4 In the figure, the left image is the original remote sensing image, and the right image is the original mask image obtained by the instance segmentation algorithm. The GDAL data format is converted to the Opencv data format, and the Opencv data is histogram calculated. The calculated pixel range is 0 to 255, where the pixel value of 0 indicates that the connected domain is the background, and each connected domain with a non-zero pixel value represents an instance. The mask images of all instances are represented separately, and all mask images are stored in an array. Then the mask images in the array are traversed, and the findContours function in Opencv is used to obtain the outermost contour of the building mask in the mask image of a single instance. According to the outer circle library, the area of ​​the original pixel can be obtained. Then, the minimum enclosing rectangle of the building mask is obtained according to the minAreaRect function in Opencv. The format of the minimum enclosing rectangle is ((x,y),(w,h),angle), where (x,y) is the center point of rect, (w,h) is the length and width of rect, and angle is the rotation angle of rect. The original pixel area of ​​the building mask is obtained according to the contourArea function in Opencv.

[0073] Furthermore, the performing of histogram calculation on the original segmentation result and marking the connected areas with non-zero pixel values ​​as instances includes:

[0074] Obtaining a minimum circumscribed rectangle according to the connected area of ​​non-zero pixel values;

[0075] Obtaining the length and width of the minimum circumscribed rectangle according to the minimum circumscribed rectangle;

[0076] When the number of pixel values ​​of the length and the width are not all less than the set number, the connected area is marked as an instance.

[0077] In the specific implementation, after the minimum enclosing rectangle is obtained based on the connected area with non-zero pixel values, the length and width of the minimum enclosing rectangle need to be judged. If the length and width are too small, the obtained connected area needs to be filtered out. In the specific filtering process, the masks with a length or width less than 5 pixels are filtered, the masks with a length and width greater than 5 pixels are retained, and the area corresponding to the mask is marked as an instance.

[0078] Step S20: obtaining an area difference according to the original pixel area and the minimum circumscribed rectangle area.

[0079] In a specific implementation, after the original pixel area area and the minimum bounding rectangle area_rect are obtained, the area difference area_delta between the two areas can be obtained according to the original pixel area area and the minimum bounding rectangle area_rect.

[0080] Step S30: comparing the ratio of the area difference to the original pixel with an area deviation rate threshold.

[0081] In a specific implementation, in the process of comparing the ratio of the obtained area difference to the original pixel with the area deviation rate threshold delta_thr, the calculation formula of the area deviation rate threshold delta_thr is:

[0082] delta_the=1000 / acea*0.3

[0083] Among them, the reference area of ​​1000 and the reference threshold of 0.3 are empirical values ​​summarized from experiments.

[0084] When the ratio of the area difference to the original pixel area is less than the threshold delta_thr, the building shape is considered to be approximately rectangular, and the rectangle with the smallest area difference from the original pixel is used as its outline; otherwise, the improved DP (Douglas-Peukcer) algorithm is used to regularize its outline.

[0085] Step S40: when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates are obtained based on the improved Douglas-Peukcer algorithm; otherwise, the coordinates of the rectangle vertex with the smallest area difference with the original pixel are directly obtained as the contour vertex coordinates.

[0086] It should be noted that the area deviation threshold is used to determine the regularization method to be used according to the difference between the current original pixel area and the minimum circumscribed rectangle area.

[0087] In the specific implementation, when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates can be obtained by the improved Douglas-Peukcer algorithm (DP algorithm). The traditional DP algorithm uses only one distance threshold to filter points, but the area of ​​buildings varies, and the shapes vary, so it is impossible to find a suitable threshold to adapt to all buildings. The improved DP algorithm sets a threshold range, calculates the polygon point set corresponding to each threshold in the threshold range, calculates the area corresponding to each polygon point set and its change value relative to the area of ​​the previous polygon point set, and the absolute value of the change rate of the change value corresponding to the original area, and then calculates the first peak value in the change rate and the corresponding index. The DP threshold is the value corresponding to the previous index of the index, and the polygon point set corresponding to the threshold is the contour point corresponding to the building, and the contour coordinates are obtained according to the corresponding contour points. When the ratio of the area difference to the original pixel is less than the area deviation rate threshold, the coordinates of the rectangular vertex with the smallest area difference with the original pixel are directly obtained as the contour vertex coordinates.

[0088] Step S50: obtaining the building outline according to the coordinates of the outline vertices.

[0089] It should be noted that the area enclosed by the corresponding contour can be obtained according to the coordinates of the contour vertices, wherein the formed area is the building contour.

[0090] This embodiment obtains the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask by using the instance segmentation algorithm to perform the original segmentation results of the remote sensing building image, obtains the area difference according to the original pixel area and the minimum circumscribed rectangle area, compares the ratio of the area difference to the original pixel with the area deviation rate threshold, and obtains the contour vertex coordinates based on the improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, otherwise, directly obtains the rectangle vertex coordinates with the minimum difference with the original pixel area as the contour vertex coordinates. The building contour is obtained according to the contour vertex coordinates. The regularization method that is more suitable for the current original segmentation result is determined by the original pixel area and the minimum circumscribed rectangle area of ​​the original segmentation result, and then the building contour that can reflect the actual shape and size of the building contour is obtained.

[0091] refer to Figure 5 , Figure 5 It is a flow chart of a second embodiment of a rapid regularization method for remote sensing building interpretation according to the present invention.

[0092] Based on the first embodiment described above, the rapid regularization method for remote sensing building interpretation in this embodiment further comprises, in step S40:

[0093] Step S401: Obtain the distance threshold range of the Douglas-Peukcer algorithm.

[0094] Step S402: Obtaining contour points of the outer contour of the building mask at various distance thresholds according to the distance threshold range.

[0095] Step S403: Calculate the corresponding area according to the contour points.

[0096] Step S404: Subtract the area from the area corresponding to the previous contour point, and store the absolute value of the result of dividing the difference by the original pixel area into a list.

[0097] Step S405: After all distance thresholds in the distance threshold range are calculated, the list is traversed to obtain the index value corresponding to the maximum value in the list.

[0098] Step S406: obtain the final distance threshold by taking the previous distance threshold of the index value corresponding to the maximum value in the list.

[0099] Step S407: Obtain building contour points according to the final distance, and obtain contour vertex coordinates of the building contour points.

[0100] In the specific implementation, the range of the DP distance threshold is set to dp_thrs = [2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6]. According to the outer contour of the building mask, the DP algorithm is used to obtain its simplified contour points under different distance thresholds, and then the contourArea function of opencv is called to calculate its area; then the difference between the contour area corresponding to the previous distance threshold is calculated, and the difference is divided by the original pixel area (area), and the absolute value is taken and stored in a list; finally, the list is traversed to obtain the index i corresponding to the maximum value of the list, indicating that the distance threshold dp_thrs[i] corresponding to its index has a greater impact on the shape of the building contour. The distance threshold dp_thrs[i-1] corresponding to the previous index is taken as the final distance threshold, and the corresponding contour point is taken as the contour point of the building.

[0101] Further, after comparing the ratio of the area difference to the original pixel with the area deviation rate threshold, the method further includes:

[0102] When the ratio of the area difference to the original pixel is less than the area deviation rate threshold, maintaining the aspect ratio of the minimum circumscribed rectangle, reducing the length and width of the minimum circumscribed rectangle, and obtaining the iterated length and width;

[0103] Calculate the pixel area of ​​the minimum bounding rectangle after iteration according to the length and width after iteration;

[0104] Obtaining a difference value set according to an absolute value of a difference between a pixel area of ​​the iterated minimum circumscribed rectangle and an original pixel area;

[0105] Select the length and width combination with the smallest absolute value from the difference set to obtain the optimal rectangle length and width;

[0106] The vertex coordinates of the optimal rectangle are obtained according to the length and width of the optimal rectangle.

[0107] In the specific implementation, refer to Figure 6 Figure 7 , Figure 6 is the regularized comparison image of the original single instance mask, Figure 7 It is a comparison chart of the original mask before and after regularization. When the ratio of the area difference to the original pixel is less than the area deviation rate threshold, the absolute value of the difference between the pixel area of ​​the minimum circumscribed rectangle and the original pixel area is used as the basic difference delta, wherein the absolute value of the difference between the pixel area of ​​the minimum circumscribed rectangle and the original pixel area is calculated as decta=|aeea-area_rect|. On the basis of maintaining the aspect ratio of the rectangle, the long side of the rectangle long_side is used as the iteration benchmark, and a new rectangle is obtained by continuously reducing the length and width values, wherein the field edge variation range i is 1 to long_side / 4, and the corresponding length and width are calculated as follows

[0108]

[0109]

[0110] Among them, w t 、h t is the length and width of the new rectangle. The absolute value of the difference between the pixel area of ​​the new rectangle and the original pixel area is obtained through iterative calculation, and the length and width corresponding to the minimum absolute value of the difference are selected as the optimal rectangle length and width of the instance mask. The points function in Opencv is used to calculate the coordinates of the four vertices of each optimal rectangle.

[0111] After obtaining the vertex coordinates of the minimum enclosing rectangle and the contour points of the corresponding building outline, the pixel coordinates are converted to geographic coordinates through the coordinate transformation relationship. The GDAL library can be used to obtain the affine transformation coefficient geoTransform for the conversion between raster space and projection coordinate space. The transformation formula is:

[0112]

[0113] Where X p , Y p is the geographic coordinate, and x and y are the grid space coordinates.

[0114] This embodiment determines the method of regularizing the original mask according to the size relationship between the area difference and the area deviation rate threshold. When the area difference is less than the area deviation rate threshold, the contour points under each threshold are obtained according to the improved DP algorithm, and the calculated point is calculated with the contour point obtained by the previous distance threshold. The difference is recorded, and the maximum difference is determined according to the difference. The index value corresponding to the maximum difference has a greater impact on the building contour. The final contour point of the building is obtained by taking the previous index as the final threshold, so that the details of the building contour are retained.

[0115] In addition, an embodiment of the present invention further proposes a storage medium on which a rapid regularization program for remote sensing building interpretation is stored. When the rapid regularization program for remote sensing building interpretation is executed by a processor, the steps of the rapid regularization method for remote sensing building interpretation as described above are implemented.

[0116] Reference Figure 8 , Figure 8 This is a structural block diagram of the first embodiment of the rapid regularization device for remote sensing building interpretation of the present invention.

[0117] like Figure 8 As shown, the fast regularization device for remote sensing building interpretation proposed in the embodiment of the present invention includes:

[0118] The area acquisition module 10 is used to obtain the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask according to the original segmentation result of the remote sensing building image according to the instance segmentation algorithm;

[0119] An area calculation module 20, configured to obtain an area difference according to the original pixel area and the minimum circumscribed rectangle area;

[0120] An area comparison module 30, configured to compare a ratio of the area difference to the original pixel with an area deviation rate threshold;

[0121] A coordinate determination module 40 is used to obtain the contour vertex coordinates based on the improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold; otherwise, directly obtain the coordinates of the rectangle vertex with the smallest area difference with the original pixel as the contour vertex coordinates;

[0122] The outline drawing module 50 is used to obtain the building outline according to the coordinates of the outline vertices.

[0123] This embodiment obtains the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask by using the instance segmentation algorithm to perform the original segmentation results of the remote sensing building image, obtains the area difference according to the original pixel area and the minimum circumscribed rectangle area, compares the ratio of the area difference to the original pixel with the area deviation rate threshold, and obtains the contour vertex coordinates based on the improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, otherwise, directly obtains the rectangle vertex coordinates with the minimum difference with the original pixel area as the contour vertex coordinates. The building contour is obtained according to the contour vertex coordinates. The regularization method that is more suitable for the current original segmentation result is determined by the original pixel area and the minimum circumscribed rectangle area of ​​the original segmentation result, and then the building contour that can reflect the actual shape and size of the building contour is obtained.

[0124] In one embodiment, the area acquisition module 10 is further used to read the original segmentation result according to the GDAL library; perform histogram calculation on the original segmentation result, and mark the connected areas with non-zero pixel values ​​as instances; obtain the outermost contour of the building mask in the mask image according to the mask image of the instance, and obtain the original pixel area according to the outermost contour; obtain the minimum enclosing rectangle according to the outermost contour, and obtain the minimum enclosing rectangle area according to the minimum enclosing rectangle.

[0125] In one embodiment, the area acquisition module 10 is further used to obtain a minimum enclosing rectangle based on the connected area of ​​non-zero pixel values; obtain the length and width of the minimum enclosing rectangle based on the minimum enclosing rectangle; and mark the connected area as an instance when the number of pixel values ​​of the length and width are not all less than a set number.

[0126] In one embodiment, the area acquisition module 10 is further configured to filter the connected area when the number of pixel values ​​of the length and the width are both less than a set number.

[0127] In one embodiment, the coordinate determination module 40 is further used to obtain the distance threshold range of the Douglas-Peukcer algorithm; obtain the contour points of the outer contour of the building mask at each distance threshold according to the distance threshold range; calculate the corresponding area according to the contour points; subtract the area from the area corresponding to the previous contour point, and store the absolute value of the result of dividing the difference by the original pixel area into a list; after all distance thresholds in the distance threshold range are calculated, traverse the list to obtain the index value corresponding to the maximum value in the list; obtain the final distance threshold by the previous distance threshold of the index value corresponding to the maximum value in the list; obtain the building contour point according to the final distance, and the contour vertex coordinates of the building contour point according to the final distance.

[0128] In one embodiment, the coordinate determination module 40 is further used to maintain the aspect ratio of the minimum enclosing rectangle, reduce the length and width of the minimum enclosing rectangle, and obtain the iterative length and width when the ratio of the area difference to the original pixel is less than the area deviation rate threshold; calculate the pixel area of ​​the iterative minimum enclosing rectangle based on the iterative length and width; obtain a difference set based on the absolute value of the difference between the pixel area of ​​the iterative minimum enclosing rectangle and the original pixel area; select the length and width combination with the smallest absolute value from the difference set to obtain the optimal rectangle length and width; and obtain the vertex coordinates of the optimal rectangle based on the optimal rectangle length and width.

[0129] In one embodiment, the coordinate determination module 40 is further configured to obtain corresponding geographic coordinates from the contour vertex coordinates based on affine transformation coefficients.

[0130] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.

[0131] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0132] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0133] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0134] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an 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, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0136] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A fast regularization method for remote sensing architectural interpretation, characterized in that: The rapid regularization method for remote sensing architectural interpretation includes: According to the original segmentation results of the remote sensing building image by the instance segmentation algorithm, the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask are obtained; Obtaining an area difference according to the original pixel area and the minimum circumscribed rectangle area; comparing the ratio of the area difference to the original pixel with an area deviation rate threshold; When the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates are obtained based on the improved Douglas-Peukcer algorithm; otherwise, the coordinates of the rectangle vertex with the smallest area difference with the original pixel are directly obtained as the contour vertex coordinates; Obtaining a building outline according to the coordinates of the outline vertices; Wherein, when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates are obtained based on the improved Douglas-Peukcer algorithm, including: Obtaining a distance threshold range of the Douglas-Peukcer algorithm; Obtaining contour points of the outer contour of the building mask at each distance threshold according to the distance threshold range; Calculate the corresponding area according to the contour points; Subtract the area from the area corresponding to the previous contour point, and store the absolute value of the result of dividing the difference by the original pixel area into a list; After all distance thresholds in the distance threshold range are calculated, traverse the list to obtain the index value corresponding to the maximum value in the list; The previous distance threshold of the index value corresponding to the maximum value in the list is used to obtain the final distance threshold; The building contour points are obtained according to the final distance, and the contour vertex coordinates of the building contour points are obtained.

2. The method according to claim 1, characterized in that The original segmentation result of the remote sensing building image is obtained according to the instance segmentation algorithm to obtain the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask, including: Read the original segmentation result according to the GDAL library; Performing histogram calculation on the original segmentation result, marking connected areas with non-zero pixel values ​​as instances; Obtaining the outermost contour of the building mask in the mask image according to the mask image of the example, and obtaining the original pixel area according to the outermost contour; A minimum circumscribed rectangle is obtained according to the outermost contour, and the minimum circumscribed rectangle area is obtained according to the minimum circumscribed rectangle.

3. The method according to claim 2, characterized in that The performing histogram calculation on the original segmentation result and marking the connected areas with non-zero pixel values ​​as instances includes: Obtaining a minimum circumscribed rectangle according to the connected area of ​​non-zero pixel values; Obtaining the length and width of the minimum circumscribed rectangle according to the minimum circumscribed rectangle; When the number of pixel values ​​of the length and the width are not all less than the set number, the connected area is marked as an instance.

4. The method according to claim 3, characterized in that After obtaining the length and width of the minimum circumscribed rectangle according to the minimum circumscribed rectangle, the method further includes: When the number of pixel values ​​of the length and the width are both less than a set number, the connected area is filtered.

5. The method according to claim 1, characterized in that After comparing the ratio of the area difference to the original pixel with the area deviation rate threshold, the method further includes: When the ratio of the area difference to the original pixel is less than the area deviation rate threshold, maintaining the aspect ratio of the minimum circumscribed rectangle, reducing the length and width of the minimum circumscribed rectangle, and obtaining the iterated length and width; Calculate the pixel area of ​​the minimum bounding rectangle after iteration according to the length and width after iteration; Obtaining a difference value set according to an absolute value of a difference between a pixel area of ​​the iterated minimum circumscribed rectangle and an original pixel area; Select the length and width combination with the smallest absolute value from the difference set to obtain the optimal rectangle length and width; The vertex coordinates of the optimal rectangle are obtained according to the length and width of the optimal rectangle.

6. The method according to any one of claims 1 to 5, characterized in that When the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, after obtaining the contour vertex coordinates based on the improved Douglas-Peukcer algorithm, the method further includes: The contour vertex coordinates are converted into corresponding geographic coordinates based on the affine transformation coefficients.

7. A rapid regularization device for remote sensing architectural interpretation, characterized in that: The rapid regularization device for remote sensing architectural interpretation comprises: The area acquisition module is used to obtain the original pixel area and the minimum circumscribed rectangle area of ​​each instance mask based on the original segmentation result of the remote sensing building image according to the instance segmentation algorithm; An area calculation module, used for obtaining an area difference according to the original pixel area and the minimum circumscribed rectangle area; An area comparison module, used for comparing the ratio of the area difference to the original pixel with an area deviation rate threshold; A coordinate determination module, configured to obtain the contour vertex coordinates based on an improved Douglas-Peukcer algorithm when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold; otherwise, directly obtain the coordinates of the rectangle vertex with the smallest area difference with the original pixel as the contour vertex coordinates; A contour drawing module, used for obtaining the building contour according to the coordinates of the contour vertices; Wherein, when the ratio of the area difference to the original pixel is not less than the area deviation rate threshold, the contour vertex coordinates are obtained based on the improved Douglas-Peukcer algorithm, including: Obtaining a distance threshold range of the Douglas-Peukcer algorithm; Obtaining contour points of the outer contour of the building mask at each distance threshold according to the distance threshold range; Calculate the corresponding area according to the contour points; Subtract the area from the area corresponding to the previous contour point, and store the absolute value of the result of dividing the difference by the original pixel area into a list; After all distance thresholds in the distance threshold range are calculated, traverse the list to obtain the index value corresponding to the maximum value in the list; The previous distance threshold of the index value corresponding to the maximum value in the list is used to obtain the final distance threshold; The building contour points are obtained according to the final distance, and the contour vertex coordinates of the building contour points are obtained.

8. A rapid regularization device for remote sensing architectural interpretation, characterized in that: The device includes: a memory, a processor, and a fast regularization program for remote sensing building interpretation stored in the memory and executable on the processor, wherein the fast regularization program for remote sensing building interpretation is configured to implement the steps of the fast regularization method for remote sensing building interpretation as described in any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores a rapid regularization program for remote sensing building interpretation, and when the rapid regularization program for remote sensing building interpretation is executed by a processor, the steps of the rapid regularization method for remote sensing building interpretation as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Building regular contour extraction method and system based on deep learning

    CN114549566A

  • Rapid regularization method for remote sensing building interpretation

    CN115171106A