An Adaptive Optimization Method for Semantic Segmentation Results of Building Images

By employing inverse polar coordinate transformation and color clustering target extraction, the outlines of buildings are automatically corrected, solving the problem of inaccurate semantic segmentation results of building images in existing technologies and achieving efficient automated optimization.

CN115546242BActive Publication Date: 2026-04-03CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-26
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In existing technologies, the post-processing of semantic segmentation results of building images relies on manual methods and the selection of parameters is highly empirical, resulting in inaccurate and inefficient results that are difficult to automate, especially when extracting large buildings.

Method used

A method combining inverse polar coordinate transformation and mean shift with color clustering target extraction is adopted. By leveraging the correspondence between Cartesian and polar coordinate systems, the building outline is automatically corrected. This includes inverse polar coordinate transformation, color clustering graph matching, and outline matching. The optimal color similarity threshold is then used for mean shift optimization.

Benefits of technology

It achieves precise, efficient, and automated correction of building outlines, improves the accuracy and efficiency of building semantic segmentation results, and reduces the input of human and material resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546242B_ABST
    Figure CN115546242B_ABST
Patent Text Reader

Abstract

This invention relates to an adaptive optimization method for semantic segmentation results of building images, comprising the following steps: performing an inverse polar coordinate transformation on the source building image to obtain an inverse polar transformation map; performing mean shift on the source building image and the inverse polar transformation map to obtain a source building cluster map and an inverse polar transformation cluster map; performing a forward polar coordinate transformation on the inverse polar transformation cluster map to obtain a quadratic transformation cluster map; extracting color clustering targets from the source building cluster map and the quadratic transformation cluster map to obtain a source building cluster extraction map and a quadratic transformation cluster extraction map; performing contour matching on the source building cluster extraction map and the quadratic transformation cluster extraction map to obtain an optimal color similarity threshold; performing mean shift on the source building image using the optimal color similarity threshold as a parameter to obtain a color clustering result map; and extracting color clustering targets from the color clustering result map to obtain a semantically corrected building extraction map. This invention can efficiently and automatically correct and extract building contours.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image segmentation, and more particularly to an adaptive optimization method for semantic segmentation results of building images. Background Technology

[0002] In the field of deep learning semantic segmentation, the extraction of large buildings is often inaccurate or even incorrect due to model size limitations. Therefore, adaptive optimization of building image semantic segmentation results is a pressing problem that needs to be solved in the post-processing of remote sensing image building semantic segmentation. Currently, the post-processing optimization of building image semantic segmentation results is usually performed manually, and the parameters of most algorithms are selected based on experience. This results in inaccurate and inefficient optimization of building image semantic segmentation results, requiring significant human and material resources and making it difficult to control the output ratio. Summary of the Invention

[0003] In view of this, and to address the problem that existing methods handle local color difference poorly, this invention provides an adaptive optimization method for semantic segmentation results of building images, specifically including the following steps:

[0004] S1: Perform an inverse polar coordinate transformation on the source building map to obtain the inverse polar transformation map;

[0005] S2: Simultaneously perform mean shift on the source building map and the inverse polar transformation map under different color similarity thresholds to obtain the source building cluster map and the inverse polar transformation cluster map;

[0006] S3: Perform a positive polar coordinate transformation on the inverse polar transformation cluster graph to obtain a quadratic transformation cluster graph.

[0007] S4: Extract color clustering targets from the source building cluster map and the second-order transformation cluster map to obtain the source building cluster extraction map and the second-order transformation cluster extraction map;

[0008] S5: Perform contour matching on the source building cluster extraction map and the quadratic transformation cluster extraction map to obtain the contour matching result value;

[0009] S6: Obtain the optimal color similarity threshold based on the contour matching result value;

[0010] S7: Perform mean shift on the source building map using the optimal color similarity threshold as a parameter to obtain the building color clustering result map;

[0011] S8: Extract the color clustering target from the color clustering result image to obtain the semantic correction extraction image of the building.

[0012] The beneficial effects provided by this invention are: by leveraging the correspondence between Cartesian coordinate system images and polar coordinate system images, the inverse polar transformation image can significantly eliminate the features of small clutter in color clustering, accurately, efficiently and automatically correct the extracted building outlines, and effectively assist in the automation of post-processing of building semantic segmentation results. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0014] Figure 2 It is a diagram of the original building;

[0015] Figure 3 It is a contour map of the semantic segmentation result;

[0016] Figure 4 It is a cluster diagram of source buildings;

[0017] Figure 5 This is a semantic correction extraction image of a building. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0019] Please refer to Figure 1 , Figure 1 This is a flowchart of the method of the present invention;

[0020] The present invention provides an adaptive optimization method for semantic segmentation results of building images, which specifically includes the following steps:

[0021] S1: Perform an inverse polar coordinate transformation on the source building map to obtain the inverse polar transformation map;

[0022] It should be noted that the source building image is read using the OpenCV library's API: the `imread()` function; please refer to [reference needed]. Figure 2 , Figure 2 It is a diagram of the original building;

[0023] The inverse polar coordinate transformation of the source building image is obtained by using the OpenCV library's API: warpPolar() function;

[0024] S2: Simultaneously perform mean shift on the source building map and the inverse polar transformation map under different color similarity thresholds to obtain the source building cluster map and the inverse polar transformation cluster map;

[0025] S3: Perform a positive polar coordinate transformation on the inverse polar transformation cluster graph to obtain a quadratic transformation cluster graph.

[0026] It should be noted that the inverse polar transformation clustering graph is transformed by polar coordinates using the OpenCV library's API: warpPolar() function to obtain the quadratic transformation clustering graph;

[0027] S4: Extract color clustering targets from the source building cluster map and the second-order transformation cluster map to obtain the source building cluster extraction map and the second-order transformation cluster extraction map;

[0028] It should be noted that the specific method for color clustering is as follows:

[0029] S41: Read the source building cluster diagram and the quadratic transformation cluster diagram;

[0030] S42: Input color area ratio threshold W;

[0031] It should be noted that the threshold for the area ratio of color pixels is set at 30% in this application;

[0032] S43: A deep learning-based building extraction model (based on the UNet model) is used to obtain the semantic segmentation contours of the source building map. These contours are then overlaid with the source building cluster map and the quadratic transformation cluster map, and their intersections are taken to obtain the overlaid source building map and the quadratic transformation overlaid map. Please refer to [reference needed]. Figure 3 , Figure 3 This is a contour map of the semantic segmentation result; please refer to it. Figure 4 , Figure 4 It is a cluster diagram of source buildings;

[0033] It should be noted that in this invention, the semantic segmentation result map obtained from the deep learning-based building extraction model is also rasterized and vectorized using the GDALWarp tool of the GDAL library to obtain the semantic segmentation result outline.

[0034] The obtained vector boundaries are converted into wkt strings using the API functions of the GDAL library: GetLayer(), GetFeature(), GetGeometryRef(), etc. The wkt strings are then used to clip the source building cluster map and the quadratic transformation cluster map obtained by the mean shift method to obtain the overlay map.

[0035] S44: Determine the percentage w of the total number of pixels (i.e., area) of each color block in the source building overlay map and the second-order transformation overlay map relative to the total number of pixels of the corresponding color block in the source building cluster map and the second-order transformation overlay map.

[0036] S45: Determine if w is greater than W. If it is, retain all pixels with that color; otherwise, discard them. This yields the preliminary extraction map of the source building cluster and the preliminary extraction map of the secondary transformation.

[0037] S46: Binarize the preliminary extraction map of the source building cluster and the preliminary extraction map of the second transformation to obtain the source building cluster extraction map and the second transformation cluster extraction map;

[0038] It should be noted that binarization is performed using the OpenCV library's API: threshold() function;

[0039] S5: Perform contour matching on the source building cluster extraction map and the quadratic transformation cluster extraction map to obtain the contour matching result value;

[0040] S6: Obtain the optimal color similarity threshold based on the contour matching result value;

[0041] Step S6 is as follows:

[0042] S61: Initialize the color similarity threshold color_radius, initialize the maximum color similarity threshold maxCR, and initialize the color similarity threshold change step CRStep; Step S61 is executed only once. In subsequent iterations, step S61 is not performed again, and the process proceeds directly to step S62.

[0043] S62: Use the contour matching result value as the key and the color similarity threshold as the value, and put the key-value pairs into set S in order of increasing color similarity threshold;

[0044] S63: Determine if color_radius is less than or equal to maxCR. If so, increment color_radius by CRStep and repeat steps S2 to S5. If it is greater than, continue to execute step S64.

[0045] S64: CRStep' = CRStep / 10 n Where n is the number of iterations; CRStep' is the step size of the updated color similarity threshold in each iteration; determine whether the value of CRStep' has reached the preset value. If so, traverse the set S and find the color similarity threshold corresponding to the smallest contour matching result value, which is the best color similarity threshold; otherwise, proceed to step S65.

[0046] It should be noted that the default value of CRStep' is set to 0.01 in this application;

[0047] S65: Traverse set S, calculate the absolute value of the difference between the contour matching results corresponding to adjacent color similarity thresholds, colorResult; and put it into set Q as a key-value pair, with colorResult as the key and the two corresponding color similarity thresholds as the values.

[0048] S66: Traverse the set Q, obtain the two color similarity thresholds corresponding to the smallest colorResult, and use them as the upper and lower boundaries of the color similarity threshold change, denoted as [m,n].

[0049] S67: Adjust color_radius to m and maxCR to n; clear set S and set Q, and return to step S2;

[0050] S7: Perform mean shift on the source building map using the optimal color similarity threshold as a parameter to obtain the building color clustering result map;

[0051] S8: Extract the color clustering target from the color clustering result image to obtain the semantic correction extraction image of the building.

[0052] It should be noted that a color pixel area ratio threshold of 30% was set, and a color clustering target extraction method was used to extract color clustering targets from the building color clustering result map to obtain the building semantic correction extraction map. Please refer to [reference needed]. Figure 5 , Figure 5 This is a semantic correction extraction image of a building.

[0053] In summary, the beneficial effects of this invention are: by leveraging the correspondence between Cartesian coordinate system images and polar coordinate system images, the inverse polar transformation image can significantly eliminate the features of small clutter in color clustering, accurately, efficiently and automatically correct the extracted building contours, and effectively assist in the automation of post-processing of building semantic segmentation results.

[0054] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An adaptive optimization method for semantic segmentation results of building images, characterized in that: Includes the following steps: S1: Perform an inverse polar coordinate transformation on the source building map to obtain the inverse polar transformation map; S2: Simultaneously perform mean shift on the source building map and the inverse polar transformation map under different color similarity thresholds to obtain the source building cluster map and the inverse polar transformation cluster map; S3: Perform a positive polar coordinate transformation on the inverse polar transformation cluster graph to obtain a quadratic transformation cluster graph; S4: Extract color clustering targets from the source building cluster map and the second-order transformation cluster map to obtain the source building cluster extraction map and the second-order transformation cluster extraction map; The specific process of extracting color clustering targets in step S4 is as follows: S41: Read the source building cluster diagram and the quadratic transformation cluster diagram; S42: Input color area ratio threshold W; S43: Use a deep learning-based building extraction model to obtain the semantic segmentation result contour of the source building map. Overlay the semantic segmentation result contour with the source building cluster map and the second transformation cluster map respectively, and take the intersection to obtain the source building overlay map and the second transformation overlay map. S44: Determine the percentage w of the total number of pixels of each color block in the source building overlay map and the second-order transformation overlay map relative to the total number of pixels of the corresponding color block in the source building cluster map and the second-order transformation overlay map; S45: Determine if w is greater than W. If it is greater, retain all pixels with that color; otherwise, discard them. This yields the preliminary extraction map of the source building cluster and the preliminary extraction map of the second transformation. S46: Binarize the preliminary extraction map of the source building cluster and the preliminary extraction map of the second transformation to obtain the source building cluster extraction map and the second transformation cluster extraction map; S5: Perform contour matching on the source building cluster extraction map and the quadratic transformation cluster extraction map to obtain the contour matching result value; S6: Obtain the optimal color similarity threshold based on the contour matching result value; S7: Perform mean shift on the source building map using the optimal color similarity threshold as a parameter to obtain the building color clustering result map; S8: Extract the color clustering target from the color clustering result image to obtain the semantic correction extraction image of the building.

2. The adaptive optimization method for semantic segmentation results of building images as described in claim 1, characterized in that: The process of obtaining the optimal color similarity threshold in step S6 is as follows: S61: Initialize the color similarity threshold color_radius, initialize the maximum color similarity threshold maxCR, and initialize the color similarity threshold change step CRStep; Step S61 is executed only once. In subsequent iterations, step S61 is not performed again, and the process proceeds directly to step S62. S62: Use the contour matching result value as the key and the color similarity threshold as the value, and put the key-value pairs into set S in order of increasing color similarity threshold; S63: Determine if color_radius is less than or equal to maxCR. If so, increment color_radius by CRStep and repeat steps S2 to S5. If it is greater than, continue to execute step S64. S64: CRStep'=CRStep / 10 n Where n is the number of iterations; CRStep' is the step size of the updated color similarity threshold in each iteration; determine whether the value of CRStep' has reached the preset value. If so, traverse the set S and find the color similarity threshold corresponding to the smallest contour matching result value, which is the best color similarity threshold; otherwise, proceed to step S65. S65: Traverse set S, calculate the absolute value of the difference between the contour matching results corresponding to adjacent color similarity thresholds, colorResult; and put it into set Q as a key-value pair, with colorResult as the key and the two corresponding color similarity thresholds as the values. S66: Traverse the set Q, obtain the two color similarity thresholds corresponding to the smallest colorResult, and use them as the upper and lower boundaries of the color similarity threshold change, denoted as [m, n]; S67: Adjust color_radius to m and maxCR to n; clear set S and set Q, and return to step S2.

Citation Information

Patent Citations

  • Automatic building information extraction method and system based on high-scene satellite image

    CN111178175A

  • Parameter self-optimization building semantic segmentation result correction and extraction method

    CN115457278A