Method, device and electronic equipment for intelligent vectorization of building segmentation results

By performing corrosion operation and regularization on the raster diagram of the building segmentation results, targeted processing based on the area and complexity of the outline, the problems of jagged edges and abnormal angles in the traditional method are solved, and more accurate building vectorization is achieved.

CN119672097BActive Publication Date: 2025-08-22BEIJING AEROSPACE HONGTU INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411720659.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-08-22
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The traditional method of vectorization of building segmentation results has jagged edge problems and abnormal angles, making it difficult to accurately and reasonably vector representations of complex buildings, resulting in poor accuracy.

Method used

The erosion operation is used to disconnect the connection domain with edge spacing smaller than the preset pixel distance in the raster diagram after semantic segmentation. The building connection domain is determined and the outline pixel points collection is obtained. Different regularization processes are performed based on the area and complexity of the outline, including traditional and adaptive regularization algorithms, which are converted into geographical coordinates to obtain the building vectorization results.

Benefits of technology

It significantly improves the extraction accuracy of building boundaries and obtains more accurate and beautiful vectorization results, especially when dealing with complex structures and non-right-angle buildings, it has a significant competitive advantage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672097B_ABST
    Figure CN119672097B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and electronic device for intelligent vectorization of building segmentation results. In this method, different regularization processing is performed on the contour pixel point sets of each contour based on the area and complexity of each contour in the connected domain of each building. That is, for different contours, different regularization processing strategies are adopted to perform regularization processing on their corresponding contour pixel point sets. This method is highly targeted and more in line with the characteristics of each contour, so that the regularized contour pixel point sets of each contour in the connected domain of each building are more scientific, significantly improving the extraction accuracy of the building boundary, and the final building vectorization result is more accurate and beautiful. In particular, when dealing with the vectorization and regularization tasks of buildings with complex structures and non-rectangular features, it shows significant competitive advantages and practical value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of post-processing of deep learning results, and in particular to a method, device and electronic equipment for intelligent vectorization of building segmentation results. Background Art

[0002] As a core component of urban structures, buildings play a vital role in various fields, including urban planning, urban management, and urban emergency response. Currently, semantic segmentation results of buildings based on remote sensing imagery are generally generated in raster format. Compared to raster images, vector graphics offer lossless scaling, which is crucial for applications such as map services, urban planning, and architectural design, as it allows for infinite zooming in on details without sacrificing quality.

[0003] Traditional vectorization methods often suffer from jagged edges when processing building segmentation results, making them unsuitable for vectorization of building segmentation results. Furthermore, regularization methods for building vector maps are currently limited to techniques such as square-diagonalization, right-angle diagonalization, and polygon fitting. However, in practical applications, these methods often struggle to accurately and reasonably represent the outlines of complex buildings.

[0004] In summary, the traditional vectorization method has the problem of jagged edges when processing building segmentation results. After vectorizing the complex building segmentation results, the obtained vectorization results will have abnormal angles and poor accuracy. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a method, device and electronic device for intelligent vectorization of building segmentation results, so as to alleviate the technical problem that the vectorization results obtained by the existing building segmentation result vectorization method have abnormal angles and poor accuracy.

[0006] In a first aspect, an embodiment of the present invention provides a method for intelligently vectorizing building segmentation results, comprising:

[0007] Obtaining a semantically segmented grid image, and using an erosion operation to disconnect connected domains in the grid image whose edge intervals are less than a preset pixel distance, to obtain multiple connected domains;

[0008] Determine a building connected domain in the plurality of connected domains, and obtain a set of outline pixel points of an outline in each of the building connected domains;

[0009] Performing different regularization processing on the outline pixel point sets of each outline based on the area and complexity of each outline in the connected domain of each building to obtain the regularized outline pixel point sets of each outline in the connected domain of all buildings;

[0010] The pixel coordinates in the regularized outline pixel point set are converted into geographic coordinates to obtain a building vectorization result.

[0011] Furthermore, based on the area and complexity of each contour in the connected domain of each building, different regularization processes are performed on the contour pixel point sets of each contour, including:

[0012] The traditional contour simplification algorithm is used to simplify the contour pixel points in the contour pixel point set of each contour to obtain the initial contour pixel point set of each contour;

[0013] The area of ​​each contour is calculated based on the initial contour pixel point set of each contour, and the regularization strategy corresponding to each contour is determined based on the area of ​​each contour, a preset area threshold and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then the initial contour pixel point set of the corresponding contour is regularized according to the regularization strategy to obtain the regularized contour pixel point set of each contour in the connected domain of all buildings.

[0014] Furthermore, a regularization strategy corresponding to each contour is determined based on the area of ​​each contour, a preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then regularization processing is performed on the initial contour pixel point set of the corresponding contour according to the regularization strategy, including:

[0015] If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than a first preset number threshold, a traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set of the current contour, and an adaptive regularization algorithm is used to perform a first regularization process on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour;

[0016] If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is not greater than the first preset number threshold, then using an adaptive regularization algorithm to perform a first regularization process on the initial contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour;

[0017] If the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is less than a second preset number threshold, determining a minimum circumscribed rectangle of the primary regularized contour pixel point set of the current contour, and using four points of the minimum circumscribed rectangle of the primary regularized contour pixel point set of the current contour as the regularized contour pixel point set of the current contour;

[0018] If the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is not less than the second preset number threshold, and the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is less than the third preset number threshold, performing a second regularization process on the primary regularized contour pixel point set of the current contour using an adaptive regularization algorithm to obtain a regularized contour pixel point set of the current contour;

[0019] If the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is not less than the third preset number threshold, simplifying the initial contour pixel points in the initial contour pixel point set of the current contour using a traditional contour simplification algorithm, and using the simplified intermediate contour pixel point set of the current contour as the regularized contour pixel point set of the current contour;

[0020] If the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an outer contour, determining a minimum circumscribed rectangle of the contour pixel point set of the current contour, and using four points of the minimum circumscribed rectangle of the contour pixel point set of the current contour as a regularized contour pixel point set of the current contour;

[0021] If the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an inner contour, the contour pixel point set of the current contour is deleted, and the regularized contour pixel point set of the current contour is an empty set.

[0022] Furthermore, the process of regularizing the target contour pixel set using an adaptive regularization algorithm includes:

[0023] Connecting two adjacent contour pixel points in the target contour pixel point set in sequence, and screening the connected line segments according to a first preset distance threshold to obtain an initial line segment set, and calculating the length and direction angle of each initial line segment in the initial line segment set to obtain a length set of each initial line segment and a direction angle set of each initial line segment, wherein the target contour pixel point set includes: a simplified intermediate contour pixel point set of the current contour, an initial contour pixel point set of the current contour, and a first regularized contour pixel point set of the current contour;

[0024] The angle of the minimum circumscribed rectangle of the contour pixel point set of the current contour is used as the first contour transformation main direction, and the direction angle of the longest fitting line segment obtained by performing angle clustering according to the order of the initial line segments in the initial line segment set is used as the second contour transformation main direction;

[0025] If the first contour transformation main direction is the same as the second contour transformation main direction, transforming the initial line segments in the initial line segment set according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a first transformed line segment set, and then using the first transformed line segment set as the transformed line segment set;

[0026] If the first contour transformation main direction is different from the second contour transformation main direction, initial line segments in the initial line segment set are transformed according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a first transformed line segment set; and initial line segments in the initial line segment set are transformed according to the second contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a second transformed line segment set; and the first transformed line segment set and the second transformed line segment set are used as transformed line segment sets;

[0027] Determine a target line segment set according to a relationship between two adjacent line segments in the transformed line segment set;

[0028] Using the starting point of the target line segment in the target line segment set as the contour pixel point set for initial regularization processing;

[0029] The target regularized contour pixel point set is determined according to the intersection-and-union ratio of the initial regularized contour pixel point set and the contour pixel point set of the current contour.

[0030] Furthermore, transforming the initial line segments in the initial line segment set according to the first contour transformation main direction, the length set of each initial line segment, and the direction angle set of each initial line segment includes:

[0031] Setting the secondary direction as the primary direction of the first contour transformation;

[0032] Calculating a first angle difference between a direction angle of a first initial line segment in the initial line segment set and a first contour transformation main direction;

[0033] If the first angle difference is not greater than a first preset angle threshold, the first initial line segment is rotated about the center point to become a line segment parallel to the first contour transformation main direction, thereby obtaining a transformed line segment of the first initial line segment;

[0034] If the first angle difference is not greater than a second preset angle threshold, rotating the first initial line segment about the center point to form a line segment perpendicular to the first contour transformation main direction, thereby obtaining a transformed line segment of the first initial line segment;

[0035] If the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is not greater than the second preset distance threshold, a straight line with a slope equal to the main direction of the first contour transformation is drawn through the starting point of the first initial line segment, and a perpendicular line is drawn through the end point of the first initial line segment to the straight line, and the two line segments at the foot of the perpendicular are used as the transformed line segments of the first initial line segment;

[0036] If the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is greater than the second preset distance threshold, determining whether the secondary direction is equal to the first contour transformation main direction;

[0037] If the secondary direction is equal to the first contour transformation primary direction, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment;

[0038] If the secondary direction is not equal to the first contour transformation main direction, calculating a second angle difference between the direction angle of the first initial line segment and the secondary direction;

[0039] If the second angle difference is not greater than the first preset angle threshold, rotating the first initial line segment about the center point to become a line segment parallel to the secondary direction, thereby obtaining a transformed line segment of the first initial line segment;

[0040] If the second angle difference is not greater than the second preset angle threshold, rotating the first initial line segment about the center point to form a line segment perpendicular to the secondary direction, thereby obtaining a transformed line segment of the first initial line segment;

[0041] If the second angle difference is greater than the first preset angle threshold, or the second angle difference is greater than the second preset angle threshold, then the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment;

[0042] Traverse the next initial line segment in the initial line segment set, and use the next initial line segment as the first initial line segment, return to the step of calculating the first angle difference between the direction angle of the first initial line segment in the initial line segment set and the first angle difference between the main direction of the first contour transformation, until all the initial line segments in the initial line segment set are traversed, and the first transformed line segment set is obtained.

[0043] Furthermore, if the transformed line segment set is the first transformed line segment set, determining the target line segment set according to the relationship between two adjacent line segments in the transformed line segment set includes:

[0044] If two adjacent line segments in the first transformed line segment set are parallel, calculating the distance between the two adjacent line segments, wherein the two adjacent line segments include: two line segments with adjacent index numbers, the last line segment in the first transformed line segment set, and the first line segment;

[0045] If the distance between the two adjacent line segments is not less than a second preset distance threshold, calculating the midpoint between the end point of the first line segment and the starting point of the second line segment of the two adjacent line segments;

[0046] Calculating a first projection point from the midpoint to the preceding line segment, and calculating a second projection point from the midpoint to the succeeding line segment;

[0047] Changing the end point of the previous line segment to the first projection point, and changing the starting point of the next line segment to the second projection point;

[0048] Saving a line segment formed by the starting point of the previous line segment and the first projection point, and a line segment formed by the first projection point and the starting point of the next line segment as target line segments into the target line segment set;

[0049] If the distance between the two adjacent line segments is less than the second preset distance threshold, and the directions of the two adjacent line segments are consistent, calculating a third projection point of the end point of the latter of the two adjacent line segments on the former line segment;

[0050] Changing the end point of the previous line segment to the third projection point, and changing the starting point of the next line segment to the starting point of the previous line segment, and changing the end point of the next line segment to the third projection point;

[0051] If the distance between the two adjacent line segments is less than the second preset distance threshold, and the directions of the two adjacent line segments are inconsistent, calculating the midpoint between the end point of the first line segment and the starting point of the second line segment of the two adjacent line segments;

[0052] Calculating a first projection point from the midpoint to the preceding line segment, and calculating a second projection point from the midpoint to the succeeding line segment;

[0053] Changing the end point of the previous line segment to the first projection point, and changing the starting point of the next line segment to the second projection point;

[0054] Saving a line segment formed by the starting point of the previous line segment and the first projection point, and a line segment formed by the first projection point and the starting point of the next line segment as target line segments into the target line segment set;

[0055] If two adjacent line segments in the first transformed line segment set intersect, then calculating the intersection point of the two adjacent line segments;

[0056] Changing the end point of the first line segment of the two adjacent line segments to the intersection point, and changing the starting point of the second line segment of the two adjacent line segments to the intersection point;

[0057] The line segment formed by the starting point of the previous line segment and the intersection point is saved as a target line segment in the target line segment set;

[0058] The first target line segment in the target line segment set is deleted to obtain the target line segment set.

[0059] Furthermore, the initially regularized contour pixel set includes: a first initially regularized contour pixel set and a second initially regularized contour pixel set, wherein the first initially regularized contour pixel set is an initially regularized contour pixel set determined based on a target line segment set corresponding to the first transformed line segment set, and the second initially regularized contour pixel set is an initially regularized contour pixel set determined based on a target line segment set corresponding to the second transformed line segment set, and the target regularized contour pixel set is determined based on an intersection-and-union ratio of the initial regularized contour pixel set and the contour pixel set of the current contour, including:

[0060] Calculating a first intersection-and-union ratio of the first initial regularized contour pixel set and the contour pixel set of the current contour, and calculating a second intersection-and-union ratio of the second initial regularized contour pixel set and the contour pixel set of the current contour;

[0061] If the first intersection-and-union ratio is not less than the second intersection-and-union ratio, the first intersection-and-union ratio is used as the target contour pixel point set for regularization processing;

[0062] If the first intersection-of-union ratio is smaller than the second intersection-of-union ratio, the second intersection-of-union ratio is used as the target contour pixel point set for regularization processing.

[0063] In a second aspect, an embodiment of the present invention further provides a device for intelligently vectorizing building segmentation results, comprising:

[0064] an acquisition and disconnection unit, configured to acquire a raster image after semantic segmentation, and disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance by using an erosion operation, thereby obtaining a plurality of connected domains;

[0065] a determining and obtaining unit, configured to determine a building connected domain in the plurality of connected domains, and obtain a set of outline pixel points of an outline in each of the building connected domains;

[0066] A regularization processing unit is used to perform different regularization processing on the outline pixel point sets of each outline based on the area and complexity of each outline in the connected domain of each building, so as to obtain the regularized outline pixel point sets of each outline in the connected domain of all buildings;

[0067] The conversion unit is used to convert the pixel coordinates in the regularized outline pixel point set into geographic coordinates to obtain a building vectorization result.

[0068] In a third aspect, an embodiment of the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.

[0069] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute any method described in the first aspect above.

[0070] In an embodiment of the present invention, a method for intelligent vectorization of building segmentation results is provided, comprising: obtaining a raster image after semantic segmentation, and using an erosion operation to disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance to obtain multiple connected domains; determining a building connected domain in the multiple connected domains, and obtaining a contour pixel point set of the contour in each building connected domain; performing different regularization processing on the contour pixel point set of each contour based on the area and complexity of each contour in each building connected domain, to obtain a regularized contour pixel point set of each contour in all building connected domains; and converting pixel coordinates in the regularized contour pixel point set into geographic coordinates to obtain a building vectorization result. From the above description, it can be seen that in the method for intelligent vectorization of building segmentation results of the present invention, different regularization processing is performed on the contour pixel point sets of each contour based on the area and complexity of each contour in the connected domain of each building. That is, for different contours, different regularization processing strategies are adopted to perform regularization processing on their corresponding contour pixel point sets, which is highly targeted and more in line with the characteristics of each contour, so that the regularized contour pixel point sets of each contour in the connected domain of each building obtained are more scientific, significantly improving the extraction accuracy of the building boundary, and the final building vectorization results are more accurate and beautiful. In particular, when dealing with vectorization and regularization tasks of buildings with complex structures and non-right-angle features, it shows significant competitive advantages and practical value, and alleviates the technical problem that the vectorization results obtained by the traditional method of vectorizing building segmentation results have abnormal angles and poor accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0072] Figure 1 A flowchart of a method for intelligent vectorization of building segmentation results provided by an embodiment of the present invention;

[0073] Figure 2 A flowchart of regularizing the initial contour pixel point set of the corresponding contour according to the regularization strategy provided by an embodiment of the present invention;

[0074] Figure 3 A schematic diagram of a device for intelligent vectorization of building segmentation results provided by an embodiment of the present invention;

[0075] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0076] The following will clearly and completely describe the technical solutions of the present invention in conjunction with the embodiments. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0077] Traditional vectorization of building segmentation results often suffers from jagged edges. Furthermore, current vectorization methods often struggle to achieve horizontal and vertical alignment of building outlines, impacting the accuracy of the vectorized results. Furthermore, when dealing with complex building structures, it's often difficult to precisely simplify the actual outline, leading to the creation of unusual right angles.

[0078] Based on this, in the method for intelligent vectorization of building segmentation results of the present invention, different regularization processing is performed on the contour pixel point sets of each contour based on the area and complexity of each contour in the connected domain of each building. That is, for different contours, different regularization processing strategies are adopted to perform regularization processing on their corresponding contour pixel point sets, which is highly targeted and more in line with the characteristics of each contour, so that the regularized contour pixel point sets of each contour in the connected domain of each building are more scientific, significantly improving the extraction accuracy of the building boundary, and the final building vectorization result is more accurate and beautiful, especially when dealing with the vectorization and regularization tasks of buildings with complex structures and non-rectangular features, showing significant competitive advantages and practical value.

[0079] To facilitate understanding of this embodiment, a method for intelligent vectorization of building segmentation results disclosed in an embodiment of the present invention is first introduced in detail.

[0080] Example 1:

[0081] According to an embodiment of the present invention, an embodiment of a method for intelligent vectorization of building segmentation results is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown.

[0082] Figure 1 FIG. 1 is a flow chart of a method for intelligent vectorization of building segmentation results according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:

[0083] Step S102, obtaining a raster image after semantic segmentation, and using an erosion operation to disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance, to obtain multiple connected domains;

[0084] Specifically, in a segmented raster image, two connected domains are often identified as a single connected domain because the pixel distance between them is too close. This results in a semantic segmentation error. Therefore, an erosion operation can be used to disconnect connected domains whose edge spacing is less than a preset pixel distance. This means that a single connected domain is split into two, resulting in multiple connected domains. This erosion operation avoids abnormal depressions caused by intermediate adhesion in subsequent processes, improving accuracy.

[0085] Step S104, determining a building connected domain in the plurality of connected domains, and obtaining a set of outline pixel points of an outline in each building connected domain;

[0086] Specifically, determine the building connected domain S = [P1, P2, ..., P n ], where there are n connected building domains in the grid graph S, which are represented as P1, P2, ..., P n .

[0087] The method of finding contour points is used to obtain the contour pixel point set of the contour in the connected domain of each building. k , the set of contour pixels of each contour can be expressed as Among them, m=1 means that there is only a set of contour pixels of the outer contour When m>1, is the set of contour pixels of the outer contour, is the set of contour pixels of the inner contour. There may be multiple contours in a building connected domain. When there are multiple contours, the largest contour is the outer contour, and the contour surrounded by the largest contour is the inner contour. In fact, the area between the outer contour and the inner contour is the building area.

[0088] Step S106, performing different regularization processing on the outline pixel point sets of each outline based on the area and complexity of each outline in the connected domain of each building, to obtain the regularized outline pixel point sets of each outline in the connected domains of all buildings;

[0089] Specifically, the complexity is specifically reflected in the number of initial contour pixel points in the initial contour pixel point set of each contour.

[0090] For the building connectivity domain P k , the obtained regularized contour pixel set of each contour m′ is the building connectivity domain P k Regularization processing, including the number of contours.

[0091] Step S108 : converting the pixel coordinates in the regularized outline pixel point set into geographic coordinates to obtain a building vectorization result.

[0092] In an embodiment of the present invention, a method for intelligent vectorization of building segmentation results is provided, comprising: obtaining a raster image after semantic segmentation, and using an erosion operation to disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance to obtain multiple connected domains; determining a building connected domain in the multiple connected domains, and obtaining a contour pixel point set of the contour in each building connected domain; performing different regularization processing on the contour pixel point set of each contour based on the area and complexity of each contour in each building connected domain, to obtain a regularized contour pixel point set of each contour in all building connected domains; and converting pixel coordinates in the regularized contour pixel point set into geographic coordinates to obtain a building vectorization result. From the above description, it can be seen that in the method for intelligent vectorization of building segmentation results of the present invention, different regularization processing is performed on the contour pixel point sets of each contour based on the area and complexity of each contour in the connected domain of each building. That is, for different contours, different regularization processing strategies are adopted to perform regularization processing on their corresponding contour pixel point sets, which is highly targeted and more in line with the characteristics of each contour, so that the regularized contour pixel point sets of each contour in the connected domain of each building obtained are more scientific, significantly improving the extraction accuracy of the building boundary, and the final building vectorization results are more accurate and beautiful. In particular, when dealing with vectorization and regularization tasks of buildings with complex structures and non-right-angle features, it shows significant competitive advantages and practical value, and alleviates the technical problem that the vectorization results obtained by the traditional method of vectorizing building segmentation results have abnormal angles and poor accuracy.

[0093] The above content briefly introduces the method for intelligent vectorization of building segmentation results of the present invention. The specific contents involved are described in detail below.

[0094] In an optional embodiment of the present invention, different regularization processes are performed on the contour pixel sets of each contour based on the area and complexity of each contour in the connected domain of each building, specifically comprising the following steps:

[0095] (1) Simplifying the contour pixel points in the contour pixel point set of each contour using a traditional contour simplification algorithm to obtain the initial contour pixel point set of each contour;

[0096] Specifically, the building connected domain P k The set of contour pixels of the lth contour in The contour pixel points in the image are simplified using a traditional contour simplification algorithm (for example, the Douglas-Peucker algorithm. The embodiment of the present invention does not specifically limit the Douglas-Peucker algorithm, and any other contour simplification algorithm may also be used) to obtain the initial contour pixel point set F = [(a1, b1), (a2, b2), ..., (a c , b c )], where c is the number of points in the initial contour pixel set, (a i , b i ) is a point in the initial contour pixel set, i∈[0,c].

[0097] (2) The area of ​​each contour is calculated based on the initial contour pixel point set of each contour, and the regularization strategy corresponding to each contour is determined based on the area of ​​each contour, the preset area threshold and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then the initial contour pixel point set of the corresponding contour is regularized according to the regularization strategy to obtain the regularized contour pixel point set of each contour in the connected domain of all buildings.

[0098] Specifically, the area of ​​each contour is calculated based on the initial contour pixel point set of each contour (that is, the closed contour pixel area of ​​the initial contour pixel point set is calculated). The number c of initial contour pixel points in the initial contour pixel point set of each contour reflects the complexity of the corresponding contour.

[0099] For the initial contour pixel point set F of the lth contour, its corresponding regularized contour pixel point set is E = [(a′1, b′1), (a′2, b′2), ..., (a′ e , b′ e )], where e is the number of points after regularization, (a j , b j ) is the midpoint of the regularized contour pixel set, j∈[0,e].

[0100] The process of regularizing the initial contour pixel point set of the corresponding contour according to the regularization strategy is as follows: Figure 2 shown.

[0101] In an optional embodiment of the present invention, a regularization strategy corresponding to each contour is determined based on the area of ​​each contour, a preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then regularization processing is performed on the initial contour pixel point set of the corresponding contour according to the regularization strategy, specifically comprising the following steps:

[0102] (21) If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than the first preset number threshold, the traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set of the current contour, and the adaptive regularization algorithm is used to perform a first regularization process on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour;

[0103] Specifically, if the contour pixel set The corresponding current contour is the outer contour, and the corresponding preset area threshold is T s =256, if the contour pixel set The corresponding current contour is the inner contour, and the corresponding preset area threshold is

[0104] If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than the first preset number threshold, which may be 30, then the complexity of the current contour is considered to be average, and the traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set of the current contour, and the adaptive regularization algorithm is used to perform the first regularization processing on the simplified intermediate contour pixel point set of the current contour to obtain a regularized contour pixel point set of the current contour. Among them, e t is the number of points after the first regularization process, is a point in a regularized contour pixel set, h∈[0,e t ].

[0105] That is, the number of initial contour pixel points c in the initial contour pixel point set F is judged for the first time, and regularization operations are performed for different situations to obtain a regularized contour pixel point set after the first regularization.

[0106] (22) If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is not greater than the first preset number threshold, the adaptive regularization algorithm is used to perform a first regularization process on the initial contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour;

[0107] Specifically, if the number of initial contour pixel points in the initial contour pixel point set of the current contour is not greater than 30, the current contour complexity is considered simple, and the adaptive regularization algorithm is directly used to perform the first regularization processing on the initial contour pixel point set of the current contour to obtain the first regularized contour pixel point set of the current contour.

[0108] (23) if the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is less than a second preset number threshold, determining a minimum circumscribed rectangle of the first regularized contour pixel point set of the current contour, and using four points of the minimum circumscribed rectangle of the first regularized contour pixel point set of the current contour as the regularized contour pixel point set of the current contour;

[0109] Specifically, after completing the first regularization process, the regularized contour pixel set E after the first regularization algorithm is t The number of points in e t A second complexity judgment is performed, and regularization operations are performed according to different situations to obtain a regularized contour pixel point set E of the contour.

[0110] When implementing, if the number of regularized contour pixel points in the regularized contour pixel point set of the current contour is e t If the number of pixels is less than the second preset threshold (e.g., 3), the contour complexity is considered simple, and a regularized contour pixel set E of the current contour is found. t The minimum circumscribed rectangle of the regularized contour pixel point set of the current contour is taken as the regularized contour pixel point set E of the current contour.

[0111] (24) If the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is not less than the second preset number threshold, and the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is less than the third preset number threshold, then the first regularized contour pixel point set of the current contour is subjected to a second regularization process using an adaptive regularization algorithm to obtain a regularized contour pixel point set of the current contour;

[0112] When implementing, if the number of regularized contour pixel points in the regularized contour pixel point set of the current contour is e t If the number of pixels in the first regularized contour pixel point set of the current contour is not less than the second preset number threshold (e.g., 3), and the number of pixels in the first regularized contour pixel point set of the current contour is less than the third preset number threshold (e.g., 60), then the contour complexity is considered to be general, and an adaptive regularization algorithm is used to perform a second regularization process on the first regularized contour pixel point set of the current contour to obtain the regularized contour pixel point set E of the current contour.

[0113] (25) If the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is not less than a third preset number threshold, the initial contour pixel points in the initial contour pixel point set of the current contour are simplified using a traditional contour simplification algorithm, and the intermediate contour pixel point set of the current contour obtained by simplification is used as the regularized contour pixel point set of the current contour;

[0114] When implementing, if the number of regularized contour pixel points in the regularized contour pixel point set of the current contour is e t If the number of pixels is not less than the third preset threshold value (e.g., 60), the contour complexity is considered to be complex, and the traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set F of the current contour, and the simplified intermediate contour pixel point set of the current contour is used as the regularized contour pixel point set E of the current contour.

[0115] (26) If the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an outer contour, then determining the minimum circumscribed rectangle of the contour pixel point set of the current contour, and using the four points of the minimum circumscribed rectangle of the contour pixel point set of the current contour as the regularized contour pixel point set of the current contour;

[0116] Specifically, if the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an outer contour, the contour pixel point set of the current contour is determined. The minimum circumscribed rectangle of the contour pixel point set of the current contour is taken as the regularized contour pixel point set E of the current contour.

[0117] (27) If the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an inner contour, the contour pixel point set of the current contour is deleted, and the regularized contour pixel point set of the current contour is an empty set.

[0118] In an optional embodiment of the present invention, the process of regularizing the target contour pixel set using an adaptive regularization algorithm specifically includes the following steps:

[0119] a) sequentially connecting two adjacent contour pixel points in the target contour pixel point set, and screening the connected line segments according to a first preset distance threshold to obtain an initial line segment set, and calculating the length and direction angle of each initial line segment in the initial line segment set to obtain a length set of each initial line segment and a direction angle set of each initial line segment, wherein the target contour pixel point set includes: a simplified intermediate contour pixel point set of the current contour, an initial contour pixel point set of the current contour, and a first regularized contour pixel point set of the current contour;

[0120] Specifically, the process of regularization processing using the adaptive regularization algorithm includes three steps. Here, the target contour pixel point set is taken as an example to introduce the process of the adaptive regularization algorithm. As can be seen from the above content, the target contour pixel point set includes: the simplified intermediate contour pixel point set of the current contour, the initial contour pixel point set of the current contour, and the first regularized contour pixel point set of the current contour, that is, the above three sets are regularized separately.

[0121] The first preset distance threshold can be specifically T d / 2, T d is the second preset distance threshold, T d The value of can be 8, and the line segments smaller than the first preset distance threshold are deleted from the connected line segments according to the first preset distance threshold to obtain the initial line segment set L = [l1, l2, ..., l c ], where c is the number of points. Calculate the length and direction angle of each initial line segment in the initial line segment set to obtain the length set L of each initial line segment. d =[d1, d2, ..., d n ] and the direction angle set L of each initial line segment a =[a1, a2, ..., a n ].

[0122] b) using the angle of the minimum circumscribed rectangle of the contour pixel set of the current contour as the first contour transformation main direction, and using the direction angle of the longest fitting line segment obtained by performing angle clustering according to the order of the initial line segments in the initial line segment set as the second contour transformation main direction;

[0123] Specifically, the first contour transform main direction M d1 The set of contour pixels of the current contour The angle of the minimum circumscribed rectangle of the second contour transformation main direction M d2 It is the direction angle of the longest fitted segment obtained after angle clustering according to the order of the initial segments in the initial segment set.

[0124] c) if the first contour transformation main direction is the same as the second contour transformation main direction, transforming the initial line segments in the initial line segment set according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a first transformed line segment set, and further using the first transformed line segment set as the transformed line segment set;

[0125] d) if the first contour transformation main direction is different from the second contour transformation main direction, transforming the initial line segments in the initial line segment set according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a first transformed line segment set; and transforming the initial line segments in the initial line segment set according to the second contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a second transformed line segment set; and then using the first transformed line segment set and the second transformed line segment set as the transformed line segment set;

[0126] Specifically, if M d1 ≠M d2 , then the initial line segments in the initial line segment set L are respectively divided according to M d1 and M d2 Perform the transformation to obtain the first transformed line segment set L′1 and the second transformed line segment set L′2; if M d1 =M d2 , then the initial line segments in the initial line segment set L are respectively divided according to M d1 or M d2 Perform a corresponding transformation, that is, after the transformation, L′1=L′2.

[0127] e) determining a target line segment set based on a relationship between two adjacent line segments in the transformed line segment set;

[0128] Specifically, the target segment set L is determined based on the relationship between two adjacent segments in the transformed segment sets L′1 and L′2. e .

[0129] f) taking the starting point of the target line segment in the target line segment set as the contour pixel point set for initial regularization processing;

[0130] Specifically, the target segment set L e The starting point of the target line segment is used as the initial regularized contour pixel point set E′=E′1 (corresponding to the line segment set L′1 after the first transformation) and E′=E′2 (corresponding to the line segment set L′1 after the second transformation).

[0131] g) determining a target regularized contour pixel set according to an intersection-and-union ratio of an initial regularized contour pixel set and a current contour pixel set.

[0132] Specifically, when the target contour pixel point set is the intermediate contour pixel point set of the simplified current contour, the target regularized contour pixel point set is the first regularized contour pixel point set of the current contour; when the target contour pixel point set is the initial contour pixel point set of the current contour, the target regularized contour pixel point set is the first regularized contour pixel point set of the current contour; when the target contour pixel point set is the first regularized contour pixel point set of the current contour, the target regularized contour pixel point set is the regularized contour pixel point set of the current contour.

[0133] In an optional embodiment of the present invention, the initial line segments in the initial line segment set are transformed according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments, specifically comprising the following steps:

[0134] (1) Set the secondary direction as the primary direction of the first contour transformation;

[0135] Specifically, the first contour transformation main direction is used as an example for explanation here. For the second contour transformation main direction, the transformation process is the same and will not be described in detail here.

[0136] When implementing, first set the secondary direction S d =M d1 .

[0137] (2) calculating a first angle difference between the direction angle of the first initial line segment in the initial line segment set and the first contour transformation main direction;

[0138] Specifically, find the first angle difference Δ between a1 and the first contour transformation main direction a1 .

[0139] (3) If the first angle difference is not greater than a first preset angle threshold, the first initial line segment is rotated about the center point to become a line segment parallel to the first contour transformation main direction, thereby obtaining a transformed line segment of the first initial line segment;

[0140] Specifically, the first preset angle threshold T a It can be 25, if the first angle difference Δ a1 Not greater than the first preset angle threshold T a , then the first initial line segment l1 is rotated about the center point to become a line segment parallel to the main direction of the first contour transformation, and the transformed line segment of the first initial line segment is obtained.

[0141] (4) If the first angle difference is not greater than a second preset angle threshold, the first initial line segment is rotated about the center point to become a line segment perpendicular to the first contour transformation main direction, thereby obtaining a transformed line segment of the first initial line segment;

[0142] Specifically, the second preset angle threshold can be T a +90, that is, 115, if the first angle difference Δ a1 Not greater than the second preset angle threshold T a +90, the first initial line segment l1 is rotated about the center point to become a line segment perpendicular to the main direction of the first contour transformation, thereby obtaining a transformed line segment of the first initial line segment.

[0143] (5) If the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is not greater than the second preset distance threshold, a straight line with a slope equal to the main direction of the first contour transformation is drawn through the starting point of the first initial line segment, and a perpendicular line is drawn through the end point of the first initial line segment to the straight line, and the two line segments at the foot of the perpendicular position are used as the transformed line segments of the first initial line segment;

[0144] Specifically, if the first angle difference Δ a1 Greater than the first preset angle threshold T a , or the first angle difference Δ a1 Greater than the second preset angle threshold T a +90, and the length d1 of the first initial line segment l1 is not greater than the second preset distance threshold T d , then the slope of the first contour transformation main direction M is made through the starting point of the first initial line segment l1 d1 A straight line is drawn, and a perpendicular line is drawn through the end point of the first initial line segment l1, and then the two line segments at the foot of the perpendicular are used as the transformed line segments of the first initial line segment.

[0145] (6) if the first angle difference is greater than a first preset angle threshold, or the first angle difference is greater than a second preset angle threshold, and the length of the first initial line segment is greater than a second preset distance threshold, determining whether the secondary direction is equal to the first contour transformation primary direction;

[0146] Specifically, if the first angle difference Δ a1 Greater than the first preset angle threshold T a , or the first angle difference Δ a1 Greater than the second preset angle threshold T a +90, and the length d1 of the first initial line segment l1 is greater than the second preset distance threshold T d , then determine the secondary direction S d Is it equal to the first contour transformation main direction M d1 .

[0147] (7) If the secondary direction is equal to the primary direction of the first contour transformation, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment;

[0148] Specifically, if Sd =M d , then the first initial line segment l1 is not transformed, the transformed line segment of the first initial line segment is still the first initial line segment, and the secondary direction S d Set as the direction angle a1 of the first initial line segment, that is, S d =a1.

[0149] (8) If the secondary direction is not equal to the first contour transformation main direction, calculate the second angle difference between the direction angle of the first initial line segment and the secondary direction;

[0150] Specifically, if S d ≠M d , then calculate the direction angle a1 and secondary direction S of the first initial line segment d The second angle difference Δ′ a1 .

[0151] (9) If the second angle difference is not greater than the first preset angle threshold, the first initial line segment is rotated about the center point to be a line segment parallel to the secondary direction, thereby obtaining a transformed line segment of the first initial line segment;

[0152] Specifically, if |Δ′ a1 |≤T a , then the first initial line segment l1 rotates around the center point and rotates parallel to the secondary direction S d , and obtain the transformed line segment of the first initial line segment.

[0153] (10) If the second angle difference is not greater than the second preset angle threshold, the first initial line segment is rotated about the center point to form a line segment perpendicular to the secondary direction, thereby obtaining a transformed line segment of the first initial line segment;

[0154] Specifically, if |Δ′ a1 |≤T a +90, the first initial line segment l1 is rotated about the center point to be perpendicular to the secondary direction S d , and obtain the transformed line segment of the first initial line segment.

[0155] (11) If the second angle difference is greater than the first preset angle threshold, or the second angle difference is greater than the second preset angle threshold, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment;

[0156] Specifically, the first initial line segment is not transformed, and the transformed line segment of the first initial line segment is still the first initial line segment, and the secondary direction is set to the direction angle of the first initial line segment, that is, S d =a1.

[0157] (12) Traverse the next initial line segment in the initial line segment set, and use the next initial line segment as the first initial line segment, return to the step of calculating the first angle difference between the direction angle of the first initial line segment in the initial line segment set and the first main direction of the first contour transformation, until all the initial line segments in the initial line segment set are traversed, and the first transformed line segment set is obtained.

[0158] Specifically, the line segment set after the first transformation ,in, is the transformed line segment, r∈[1,c′], is the starting point of the line segment, is the end point of the line segment, and c′ is the number of line segments after transformation.

[0159] Similarly, for the second contour transformation main direction, the obtained line segment set L′2 after the first transformation is obtained.

[0160] In an optional embodiment of the present invention, if the transformed line segment set is the first transformed line segment set, determining the target line segment set according to the relationship between two adjacent line segments in the transformed line segment set specifically includes the following steps:

[0161] (1) If two adjacent line segments in the first transformed line segment set are parallel, then the distance between the two adjacent line segments is calculated, where the two adjacent line segments include: two line segments with adjacent index numbers, the last line segment in the first transformed line segment set, and the first line segment;

[0162] Specifically, the same operation is performed for the second transformed segment set. Here, the first transformed segment set is used as an example for explanation. Input the first transformed segment set, i.e., L′=L′1. If two adjacent segments in the first transformed segment set are and Parallel, calculate two adjacent line segments and The distance between them, where r∈[1,c′].

[0163] (2) If the distance between the two adjacent line segments is not less than a second preset distance threshold, calculate the midpoint between the end point of the first line segment and the starting point of the second line segment;

[0164] Specifically, if the distance is not less than the second preset distance threshold T d , then calculate the first line segment l′ between the two adjacent line segments r The end and the next line segment l′ r+1 Starting point The midpoint p t .

[0165] (3) Calculate the first projection point of the midpoint to the previous line segment, and calculate the second projection point of the midpoint to the next line segment;

[0166] Specifically, calculate the midpoint p t To the previous line segment l′ r The first projection point of And calculate the midpoint p t To the next line segment l′ r+1 The second projection point of

[0167] (4) Change the end point of the previous line segment to the first projection point, and change the starting point of the next line segment to the second projection point;

[0168] Specifically, the previous line segment l′ r The end Change to first projection point That is, l′ in the line segment set L′ after the first transformation r Modified to And the next line segment l′ r+1 Starting point Change to the second projection point That is, l′ in the line segment set L′ after the first transformation r+1 Modified to

[0169] (5) saving the line segment formed by the starting point of the previous line segment and the first projection point, and the line segment formed by the first projection point and the starting point of the next line segment as target line segments into the target line segment set;

[0170] Specifically, the line segment formed by the starting point of the previous line segment and the first projection point The line segment formed by the first projection point and the starting point of the next line segment Save as target segment to target segment set L e .

[0171] (6) If the distance between the two adjacent line segments is less than a second preset distance threshold and the directions of the two adjacent line segments are consistent, then calculate the third projection point of the end point of the latter of the two adjacent line segments on the former line segment;

[0172] Specifically, if the distance is less than the second preset distance threshold T d , and the directions of the two adjacent line segments are the same, then calculate the latter line segment l' of the two adjacent line segments r+1 The end On the previous line segment l′ r The third projection point on

[0173] (7) Change the end point of the previous line segment to the third projection point, and change the starting point of the next line segment to the starting point of the previous line segment, and change the end point of the next line segment to the third projection point;

[0174] Specifically, the previous line segment l′ r The end Change to the third projection point That is, l′ in the line segment set L′ after the first transformation r Modified to And the next line segment l′ r+1 Starting point Change to the starting point of the previous segment The next line segment l′ r+1 The end Change to the third projection point That is, after the first transformation, the line segment set L′ is modified to

[0175] (8) If the distance between two adjacent line segments is less than a second preset distance threshold, and the directions of the two adjacent line segments are inconsistent, then calculate the midpoint between the end point of the first line segment and the starting point of the second line segment;

[0176] Specifically, if the distance is less than the second preset distance threshold T d , and the directions of the two adjacent line segments are inconsistent, then calculate the previous line segment l′ between the two adjacent line segments r The end and the next line segment l′ r+1 Starting point midpoint.

[0177] (9) Calculate the first projection point of the midpoint to the previous line segment, and calculate the second projection point of the midpoint to the next line segment;

[0178] (10) Change the end point of the previous line segment to the first projection point, and change the starting point of the next line segment to the second projection point;

[0179] (11) saving the line segment formed by the starting point of the previous line segment and the first projection point, and the line segment formed by the first projection point and the starting point of the next line segment as target line segments into the target line segment set;

[0180] (12) If two adjacent line segments in the line segment set after the first transformation intersect, then calculate the intersection point of the two adjacent line segments;

[0181] Specifically, if l′ r and l′ r+1 If they intersect, calculate the intersection point of the two

[0182] (13) changing the end point of the first of the two adjacent line segments to the intersection point, and changing the starting point of the second of the two adjacent line segments to the intersection point;

[0183] Specifically, the first line segment l′ of the two adjacent line segments r The end Change to Intersection That is l′ r Modified to And the latter line segment l' of the two adjacent line segments r+1 Starting point Change to Intersection That is l′ r+1 Modified to

[0184] (14) The line segment formed by the starting point and the intersection point of the previous line segment is saved as the target line segment in the target line segment set;

[0185] Specifically, the line segment formed by the starting point and intersection point of the previous line segment Save as target segment to target segment set L e .

[0186] (15) Delete the first target line segment in the target line segment set to obtain the target line segment set.

[0187] Specifically, delete L e The first target line segment Get the target segment set Among them, c e is the number of target segments.

[0188] In an optional embodiment of the present invention, the contour pixel point set subjected to initial regularization includes: a first contour pixel point set subjected to initial regularization and a second contour pixel point set subjected to initial regularization, the first contour pixel point set subjected to initial regularization being a contour pixel point set subjected to initial regularization determined based on a target line segment set corresponding to the first transformed line segment set, the second contour pixel point set subjected to initial regularization being a contour pixel point set subjected to initial regularization determined based on a target line segment set corresponding to the second transformed line segment set, and the target contour pixel point set subjected to initial regularization being determined based on an intersection-and-union ratio of the contour pixel point set subjected to initial regularization and a contour pixel point set of a current contour, specifically comprising the following steps:

[0189] (1) calculating a first intersection-and-union ratio of the first initial regularized contour pixel set and the contour pixel set of the current contour, and calculating a second intersection-and-union ratio of the second initial regularized contour pixel set and the contour pixel set of the current contour;

[0190] Specifically, the first initial regularized contour pixel set E′1 and the current contour pixel set The first intersection and union of And calculate the second initial regularized contour pixel set E′2 and the current contour pixel set The second intersection and comparison

[0191] (2) If the first IoU is not less than the second IoU, the first IoU is used as the target contour pixel set for regularization processing;

[0192] Specifically, if Then the target regularized contour pixel set is

[0193] (3) If the first IoU is smaller than the second IoU, the second IoU is used as the target contour pixel set for regularization.

[0194] Specifically, if Then the target regularized contour pixel set is

[0195] The method for intelligent vectorization of building segmentation results of the present invention is a fine-grained extraction and classification method for buildings, which can significantly improve the extraction accuracy of building boundaries and optimize the accuracy of classification results. The method focuses on the intelligent vectorization processing of building segmentation results, ensuring that each step of operation is not only clear and definite in theoretical terms, but also accurate in geometric terms, thereby ensuring the unique certainty of the calculation result. The stability and applicability of the method are both excellent, especially when dealing with vectorization and regularization tasks of buildings with complex structures and non-right-angle features, showing significant competitive advantages and practical value. That is, the present invention can intelligently convert the building semantic segmentation results into vector form, ensure that the generated building vector graphics are horizontal and vertical, and accurately fit the original outline of the building, thereby significantly improving the accuracy and aesthetics of the vectorization results.

[0196] Example 2:

[0197] An embodiment of the present invention further provides a device for intelligently vectorizing building segmentation results. The device for intelligently vectorizing building segmentation results is mainly used to execute the method for intelligently vectorizing building segmentation results provided in the first embodiment of the present invention. The device for intelligently vectorizing building segmentation results provided in the embodiment of the present invention is specifically introduced below.

[0198] Figure 3 is a schematic diagram of a device for intelligent vectorization of building segmentation results according to an embodiment of the present invention. Figure 3 As shown, the device mainly includes: an acquisition and disconnection unit 10, a determination and acquisition unit 20, a regularization processing unit 30, and a conversion unit 40, wherein:

[0199] An acquisition and disconnection unit is used to acquire a raster image after semantic segmentation, and use an erosion operation to disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance to obtain multiple connected domains;

[0200] A determination and acquisition unit, configured to determine a building connected domain in a plurality of connected domains, and to acquire a set of outline pixel points of an outline in each building connected domain;

[0201] A regularization processing unit is used to perform different regularization processing on the outline pixel point sets of each outline based on the area and complexity of each outline in the connected domain of each building, so as to obtain the regularized outline pixel point sets of each outline in the connected domains of all buildings;

[0202] The conversion unit is used to convert the pixel coordinates in the regularized contour pixel point set into geographic coordinates to obtain the building vectorization result.

[0203] In an embodiment of the present invention, a device for intelligent vectorization of building segmentation results is provided, comprising: obtaining a raster image after semantic segmentation, and using an erosion operation to disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance to obtain multiple connected domains; determining a building connected domain in the multiple connected domains, and obtaining a contour pixel point set of the contour in each building connected domain; performing different regularization processing on the contour pixel point set of each contour based on the area and complexity of each contour in each building connected domain, to obtain a regularized contour pixel point set of each contour in all building connected domains; and converting pixel coordinates in the regularized contour pixel point set into geographic coordinates to obtain a building vectorization result. From the above description, it can be seen that in the device for intelligent vectorization of building segmentation results of the present invention, different regularization processing will be performed on the contour pixel point sets of each contour based on the area and complexity of each contour in the connected domain of each building. That is, for different contours, different regularization processing strategies are adopted to perform regularization processing on their corresponding contour pixel point sets, which is highly targeted and more in line with the characteristics of each contour, so that the regularized contour pixel point sets of each contour in the connected domain of each building obtained are more scientific, significantly improving the extraction accuracy of the building boundary, and the final building vectorization results are more accurate and beautiful. Especially when dealing with vectorization and regularization tasks of buildings with complex structures and non-right-angle features, it shows significant competitive advantages and practical value, and alleviates the technical problem that the vectorization results obtained by the traditional method of vectorizing building segmentation results have abnormal angles and poor accuracy.

[0204] Optionally, the regularization processing unit is also used to: use a traditional contour simplification algorithm to simplify the contour pixel points in the contour pixel point set of each contour to obtain the initial contour pixel point set of each contour; calculate the area of ​​each contour based on the initial contour pixel point set of each contour, and determine the regularization strategy corresponding to each contour based on the area of ​​each contour, a preset area threshold and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then regularize the initial contour pixel point set of the corresponding contour according to the regularization strategy to obtain the regularized contour pixel point set of each contour in the connected domain of all buildings.

[0205] Optionally, the regularization processing unit is further used for: if the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than the first preset number threshold, then the traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set of the current contour, and the adaptive regularization algorithm is used to perform a first regularization process on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour; if the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than the first preset number threshold, then the adaptive regularization algorithm is used to perform a first regularization process on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour; If the number of initial contour pixel points of the current contour is not greater than the first preset number threshold, the adaptive regularization algorithm is used to perform the first regularization processing on the initial contour pixel point set of the current contour to obtain the first regularized contour pixel point set of the current contour; if the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is less than the second preset number threshold, the minimum circumscribed rectangle of the first regularized contour pixel point set of the current contour is determined, and the four points of the minimum circumscribed rectangle of the first regularized contour pixel point set of the current contour are used as the regularized contour pixel point set of the current contour; if the first regularized contour pixel point set of the current contour is less than the second preset number threshold, the minimum circumscribed rectangle of the first regularized contour pixel point set of the current contour is determined, and the four points of the minimum circumscribed rectangle of the first regularized contour pixel point set of the current contour are used as the regularized contour pixel point set of the current contour; If the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is not less than the second preset number threshold, and the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is less than the third preset number threshold, then the adaptive regularization algorithm is used to perform a second regularization process on the first regularized contour pixel point set of the current contour to obtain the regularized contour pixel point set of the current contour; if the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is not less than the third preset number threshold, then the traditional contour simplification algorithm is used to perform a second regularization process on the initial contour pixel point set of the current contour. The pixels are simplified, and the middle contour pixel point set of the simplified current contour is used as the regular contour pixel point set of the current contour; if the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an outer contour, the minimum circumscribed rectangle of the contour pixel point set of the current contour is determined, and the four points of the minimum circumscribed rectangle of the contour pixel point set of the current contour are used as the regular contour pixel point set of the current contour; if the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an inner contour, the contour pixel point set of the current contour is deleted, and the regular contour pixel point set of the current contour is an empty set.

[0206] Optionally, the regularization processing unit is also used to: connect two adjacent contour pixel points in the target contour pixel point set in sequence, and filter the connected line segments according to a first preset distance threshold to obtain an initial line segment set, and calculate the length and direction angle of each initial line segment in the initial line segment set to obtain a length set of each initial line segment and a direction angle set of each initial line segment, wherein the target contour pixel point set includes: a simplified intermediate contour pixel point set of the current contour, an initial contour pixel point set of the current contour, and a regularized contour pixel point set of the current contour; use the angle of the minimum circumscribed rectangle of the contour pixel point set of the current contour as the first contour transformation main direction, and use the direction angle of the longest fitting line segment obtained after angle clustering in the order of the initial line segments in the initial line segment set as the second contour transformation main direction; if the first contour transformation main direction is the same as the second contour transformation main direction, the initial line segment set is transformed according to the first contour transformation main direction, the length set of each initial line segment and the direction angle set of each initial line segment. The initial line segments in the initial line segment set are transformed to obtain a first transformed line segment set, and the first transformed line segment set is then used as the transformed line segment set; if the first contour transformation main direction is different from the second contour transformation main direction, the initial line segments in the initial line segment set are transformed according to the first contour transformation main direction, the length set of each initial line segment, and the direction angle set of each initial line segment to obtain a first transformed line segment set, and the initial line segments in the initial line segment set are transformed according to the second contour transformation main direction, the length set of each initial line segment, and the direction angle set of each initial line segment to obtain a second transformed line segment set, and the first transformed line segment set and the second transformed line segment set are then used as the transformed line segment set; a target line segment set is determined according to the relationship between two adjacent line segments in the transformed line segment set; the starting point of the target line segment in the target line segment set is used as the initial regularized contour pixel set; and the target regularized contour pixel set is determined according to the intersection-and-union ratio of the initial regularized contour pixel set and the contour pixel set of the current contour.

[0207] Optionally, the regularization processing unit is further used to: set the secondary direction as the first contour transformation main direction; calculate the first angle difference between the direction angle of the first initial line segment in the initial line segment set and the first contour transformation main direction; if the first angle difference is not greater than a first preset angle threshold, the first initial line segment is rotated with the center point to be a line segment parallel to the first contour transformation main direction, and the transformed line segment of the first initial line segment is obtained; if the first angle difference is not greater than a second preset angle threshold, the first initial line segment is rotated with the center point to be a line segment perpendicular to the first contour transformation main direction, and the transformed line segment of the first initial line segment is obtained. line segment; if the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is not greater than the second preset distance threshold, then a straight line with a slope of the first contour transformation main direction is made through the starting point of the first initial line segment, and a perpendicular line of the straight line is made through the end point of the first initial line segment, and then the two line segments at the perpendicular foot position are used as the transformed line segments of the first initial line segment; if the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is greater than the second preset distance threshold, then it is determined whether the secondary direction is equal to the first round The main direction of the contour transformation is calculated; if the secondary direction is equal to the main direction of the first contour transformation, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment; if the secondary direction is not equal to the main direction of the first contour transformation, the second angle difference between the direction angle of the first initial line segment and the secondary direction is calculated; if the second angle difference is not greater than the first preset angle threshold, the first initial line segment is rotated about the center point to be a line segment parallel to the secondary direction, and the transformed line segment of the first initial line segment is obtained; if the second angle difference is not greater than the second preset angle threshold, the first initial line segment is rotated about the center point to be perpendicular to the secondary direction direction of the line segment to obtain the transformed line segment of the first initial line segment; if the second angle difference is greater than the first preset angle threshold, or the second angle difference is greater than the second preset angle threshold, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment; the next initial line segment in the initial line segment set is traversed, and the next initial line segment is used as the first initial line segment, and the step of calculating the direction angle of the first initial line segment in the initial line segment set and the first angle difference of the first contour transformation main direction is returned to execute, until all the initial line segments in the initial line segment set are traversed, and the first transformed line segment set is obtained.

[0208] Optionally, if the transformed line segment set is the first transformed line segment set, the regularization processing unit is further configured to: if two adjacent line segments in the first transformed line segment set are parallel, calculate the distance between the two adjacent line segments, wherein the two adjacent line segments include: two line segments with adjacent index numbers, the last line segment and the first line segment in the first transformed line segment set; if the distance between the two adjacent line segments is not less than a second preset distance threshold, calculate the midpoint between the end point of the previous line segment and the starting point of the next line segment in the two adjacent line segments; calculate the first projection point of the midpoint to the previous line segment, and Calculate the second projection point from the midpoint to the next line segment; change the end point of the previous line segment to the first projection point, and change the starting point of the next line segment to the second projection point; save the line segment formed by the starting point of the previous line segment and the first projection point, and the line segment formed by the first projection point and the starting point of the next line segment as target line segments to the target line segment set; if the distance between the two adjacent line segments is less than the second preset distance threshold, and the directions of the two adjacent line segments are the same, calculate the third projection point of the end point of the next line segment on the previous line segment; change the end point of the previous line segment to the first projection point. Three projection points, and change the starting point of the latter line segment to the starting point of the previous line segment, and change the end point of the latter line segment to the third projection point; if the distance between the two adjacent line segments is less than the second preset distance threshold, and the directions of the two adjacent line segments are inconsistent, calculate the midpoint of the end point of the previous line segment and the starting point of the next line segment in the two adjacent line segments; calculate the first projection point from the midpoint to the previous line segment, and calculate the second projection point from the midpoint to the next line segment; change the end point of the previous line segment to the first projection point, and change the starting point of the next line segment to the second projection point; change the previous line segment The line segment formed by the starting point of the first line segment and the first projection point, and the line segment formed by the first projection point and the starting point of the next line segment are saved as target line segments in the target line segment set; if two adjacent line segments in the line segment set intersect after the first transformation, the intersection point of the two adjacent line segments is calculated; the end point of the previous line segment of the two adjacent line segments is changed to the intersection point, and the starting point of the next line segment of the two adjacent line segments is changed to the intersection point; the line segment formed by the starting point and the intersection point of the previous line segment is saved as the target line segment in the target line segment set; the first target line segment in the target line segment set is deleted to obtain the target line segment set.

[0209] Optionally, the contour pixel point set for initial regularization processing includes: a first contour pixel point set for initial regularization processing and a second contour pixel point set for initial regularization processing, the first contour pixel point set for initial regularization processing is the contour pixel point set for initial regularization processing determined according to the target line segment set corresponding to the first transformed line segment set, and the second contour pixel point set for initial regularization processing is the contour pixel point set for initial regularization processing determined according to the target line segment set corresponding to the second transformed line segment set, and the regularization processing unit is also used to: calculate a first intersection-and-union ratio of the contour pixel point set for initial regularization processing and the contour pixel point set of the current contour, and calculate a second intersection-and-union ratio of the contour pixel point set for initial regularization processing and the contour pixel point set of the current contour; if the first intersection-and-union ratio is not less than the second intersection-and-union ratio, the first intersection-and-union ratio is used as the target contour pixel point set for regularization processing; if the first intersection-and-union ratio is less than the second intersection-and-union ratio, the second intersection-and-union ratio is used as the target contour pixel point set for regularization processing.

[0210] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding content in the aforementioned method embodiment.

[0211] like Figure 4 As shown, an electronic device 600 provided in an embodiment of the present application includes: a processor 601, a memory 602 and a bus, wherein the memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 through the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the method for intelligent vectorization of building segmentation results as described above.

[0212] Specifically, the memory 602 and processor 601 can be general-purpose memories and processors, which are not specifically limited here. When the processor 601 runs the computer program stored in the memory 602, the method for intelligent vectorization of building segmentation results can be executed.

[0213] The processor 601 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 601 or by instructions in the form of software. The above-mentioned processor 601 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 602, and processor 601 reads the information in memory 602 and performs the steps of the above method in conjunction with its hardware.

[0214] Corresponding to the above-mentioned method for intelligent vectorization of building segmentation results, an embodiment of the present application also provides a computer-readable storage medium, which stores machine-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned method for intelligent vectorization of building segmentation results.

[0215] The device for intelligent vectorization of building segmentation results provided in the embodiments of the present application can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiments of the present application are the same as those of the aforementioned method embodiments. For the sake of brief description, any part not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiments. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0216] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0217] For another example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0218] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0219] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0220] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling an electronic device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method for intelligent vectorization of building segmentation results described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.

[0221] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0222] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. However, these modifications, changes, or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application. They should all be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for intelligent vectorization of building segmentation results, characterized in that: include: Obtaining a semantically segmented grid image, and using an erosion operation to disconnect connected domains in the grid image whose edge intervals are less than a preset pixel distance, to obtain multiple connected domains; Determine a building connected domain in the plurality of connected domains, and obtain a set of outline pixel points of an outline in each of the building connected domains; Performing different regularization processing on the outline pixel point sets of each outline based on the area and complexity of each outline in the connected domain of each building to obtain the regularized outline pixel point sets of each outline in the connected domain of all buildings; Converting pixel coordinates in the regularized outline pixel point set into geographic coordinates to obtain a building vectorization result; The different regularization processes are performed on the contour pixel sets of each contour based on the area and complexity of each contour in the connected domain of each building, including: The traditional contour simplification algorithm is used to simplify the contour pixel points in the contour pixel point set of each contour to obtain the initial contour pixel point set of each contour; Calculating the area of ​​each contour based on the initial contour pixel point set of each contour, and determining a regularization strategy corresponding to each contour based on the area of ​​each contour, a preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then regularizing the initial contour pixel point set of the corresponding contour according to the regularization strategy to obtain a regularized contour pixel point set of each contour in the connected domain of all buildings; The regularization strategy corresponding to each contour is determined based on the area of ​​each contour, a preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of each contour, and then the initial contour pixel point set of the corresponding contour is regularized according to the regularization strategy, including: If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than a first preset number threshold, a traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set of the current contour, and an adaptive regularization algorithm is used to perform a first regularization process on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour; If the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is not greater than the first preset number threshold, then using an adaptive regularization algorithm to perform a first regularization process on the initial contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour; If the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is less than a second preset number threshold, determining a minimum circumscribed rectangle of the primary regularized contour pixel point set of the current contour, and using four points of the minimum circumscribed rectangle of the primary regularized contour pixel point set of the current contour as the regularized contour pixel point set of the current contour; If the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is not less than the second preset number threshold, and the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is less than the third preset number threshold, performing a second regularization process on the primary regularized contour pixel point set of the current contour using an adaptive regularization algorithm to obtain a regularized contour pixel point set of the current contour; If the number of the primary regularized contour pixel points in the primary regularized contour pixel point set of the current contour is not less than the third preset number threshold, simplifying the initial contour pixel points in the initial contour pixel point set of the current contour using a traditional contour simplification algorithm, and using the simplified intermediate contour pixel point set of the current contour as the regularized contour pixel point set of the current contour; If the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an outer contour, determining a minimum circumscribed rectangle of the contour pixel point set of the current contour, and using four points of the minimum circumscribed rectangle of the contour pixel point set of the current contour as a regularized contour pixel point set of the current contour; If the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an inner contour, the contour pixel point set of the current contour is deleted, and the regularized contour pixel point set of the current contour is an empty set; The process of regularizing the target contour pixel set using the adaptive regularization algorithm includes: Connecting two adjacent contour pixel points in the target contour pixel point set in sequence, and screening the connected line segments according to a first preset distance threshold to obtain an initial line segment set, and calculating the length and direction angle of each initial line segment in the initial line segment set to obtain a length set of each initial line segment and a direction angle set of each initial line segment, wherein the target contour pixel point set includes: a simplified intermediate contour pixel point set of the current contour, an initial contour pixel point set of the current contour, and a first regularized contour pixel point set of the current contour; The angle of the minimum circumscribed rectangle of the contour pixel point set of the current contour is used as the first contour transformation main direction, and the direction angle of the longest fitting line segment obtained by performing angle clustering according to the order of the initial line segments in the initial line segment set is used as the second contour transformation main direction; If the first contour transformation main direction is the same as the second contour transformation main direction, transforming the initial line segments in the initial line segment set according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a first transformed line segment set, and then using the first transformed line segment set as the transformed line segment set; If the first contour transformation main direction is different from the second contour transformation main direction, initial line segments in the initial line segment set are transformed according to the first contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a first transformed line segment set; and initial line segments in the initial line segment set are transformed according to the second contour transformation main direction, the set of lengths of the initial line segments, and the set of direction angles of the initial line segments to obtain a second transformed line segment set; and the first transformed line segment set and the second transformed line segment set are used as transformed line segment sets; Determine a target line segment set according to a relationship between two adjacent line segments in the transformed line segment set; Using the starting point of the target line segment in the target line segment set as the contour pixel point set for initial regularization processing; Determine a target regularized contour pixel set according to an intersection-and-union ratio of the initial regularized contour pixel set and the contour pixel set of the current contour; The step of transforming the initial line segments in the initial line segment set according to the first contour transformation main direction, the length set of each initial line segment, and the direction angle set of each initial line segment includes: Setting the secondary direction as the primary direction of the first contour transformation; Calculating a first angle difference between a direction angle of a first initial line segment in the initial line segment set and a first contour transformation main direction; If the first angle difference is not greater than a first preset angle threshold, rotating the first initial line segment about the center point to become a line segment parallel to the first contour transformation main direction, thereby obtaining a transformed line segment of the first initial line segment; If the first angle difference is not greater than a second preset angle threshold, rotating the first initial line segment about the center point to form a line segment perpendicular to the first contour transformation main direction, thereby obtaining a transformed line segment of the first initial line segment; If the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is not greater than the second preset distance threshold, a straight line with a slope equal to the main direction of the first contour transformation is drawn through the starting point of the first initial line segment, and a perpendicular line is drawn through the end point of the first initial line segment to the straight line, and the two line segments at the foot of the perpendicular are used as the transformed line segments of the first initial line segment; If the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is greater than the second preset distance threshold, determining whether the secondary direction is equal to the first contour transformation main direction; If the secondary direction is equal to the first contour transformation primary direction, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment; If the secondary direction is not equal to the first contour transformation main direction, calculating a second angle difference between the direction angle of the first initial line segment and the secondary direction; If the second angle difference is not greater than the first preset angle threshold, rotating the first initial line segment about the center point to become a line segment parallel to the secondary direction, thereby obtaining a transformed line segment of the first initial line segment; If the second angle difference is not greater than the second preset angle threshold, rotating the first initial line segment about the center point to form a line segment perpendicular to the secondary direction, thereby obtaining a transformed line segment of the first initial line segment; If the second angle difference is greater than the first preset angle threshold, or the second angle difference is greater than the second preset angle threshold, then the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment; Traverse the next initial line segment in the initial line segment set, and use the next initial line segment as the first initial line segment, return to the step of calculating the first angle difference between the direction angle of the first initial line segment in the initial line segment set and the first angle difference between the main direction of the first contour transformation, until all the initial line segments in the initial line segment set are traversed, and the first transformed line segment set is obtained.

2. The method according to claim 1, characterized in that If the transformed line segment set is the first transformed line segment set, determining a target line segment set according to a relationship between two adjacent line segments in the transformed line segment set includes: If two adjacent line segments in the first transformed line segment set are parallel, calculating the distance between the two adjacent line segments, wherein the two adjacent line segments include: two line segments with adjacent index numbers, the last line segment in the first transformed line segment set, and the first line segment; If the distance between the two adjacent line segments is not less than a second preset distance threshold, calculating the midpoint between the end point of the first line segment and the starting point of the second line segment of the two adjacent line segments; Calculating a first projection point from the midpoint to the preceding line segment, and calculating a second projection point from the midpoint to the succeeding line segment; Changing the end point of the previous line segment to the first projection point, and changing the starting point of the next line segment to the second projection point; Saving a line segment formed by the starting point of the previous line segment and the first projection point, and a line segment formed by the first projection point and the starting point of the next line segment as target line segments into the target line segment set; If the distance between the two adjacent line segments is less than the second preset distance threshold, and the directions of the two adjacent line segments are consistent, calculating a third projection point of the end point of the latter of the two adjacent line segments on the former line segment; Changing the end point of the previous line segment to the third projection point, and changing the starting point of the next line segment to the starting point of the previous line segment, and changing the end point of the next line segment to the third projection point; If the distance between the two adjacent line segments is less than the second preset distance threshold, and the directions of the two adjacent line segments are inconsistent, calculating the midpoint between the end point of the first line segment and the starting point of the second line segment of the two adjacent line segments; Calculating a first projection point from the midpoint to the preceding line segment, and calculating a second projection point from the midpoint to the succeeding line segment; Changing the end point of the previous line segment to the first projection point, and changing the starting point of the next line segment to the second projection point; Saving a line segment formed by the starting point of the previous line segment and the first projection point, and a line segment formed by the first projection point and the starting point of the next line segment as target line segments into the target line segment set; If two adjacent line segments in the first transformed line segment set intersect, then calculating the intersection point of the two adjacent line segments; Changing the end point of the first line segment of the two adjacent line segments to the intersection point, and changing the starting point of the second line segment of the two adjacent line segments to the intersection point; The line segment formed by the starting point of the previous line segment and the intersection point is saved as a target line segment in the target line segment set; The first target line segment in the target line segment set is deleted to obtain the target line segment set.

3. The method according to claim 1, characterized in that The initially regularized contour pixel set includes: a first initially regularized contour pixel set and a second initially regularized contour pixel set, wherein the first initially regularized contour pixel set is an initially regularized contour pixel set determined based on a target line segment set corresponding to the first transformed line segment set, and the second initially regularized contour pixel set is an initially regularized contour pixel set determined based on a target line segment set corresponding to the second transformed line segment set, and the target regularized contour pixel set is determined based on an intersection-and-union ratio of the initial regularized contour pixel set and the contour pixel set of the current contour, including: Calculating a first intersection-and-union ratio of the first initial regularized contour pixel set and the contour pixel set of the current contour, and calculating a second intersection-and-union ratio of the second initial regularized contour pixel set and the contour pixel set of the current contour; If the first intersection-and-union ratio is not less than the second intersection-and-union ratio, the first intersection-and-union ratio is used as the target contour pixel point set for regularization processing; If the first intersection-of-union ratio is smaller than the second intersection-of-union ratio, the second intersection-of-union ratio is used as the target contour pixel point set for regularization processing.

4. A device for intelligent vectorization of building segmentation results, characterized in that: include: an acquisition and disconnection unit, configured to acquire a raster image after semantic segmentation, and disconnect connected domains in the raster image whose edge intervals are less than a preset pixel distance by using an erosion operation, thereby obtaining a plurality of connected domains; a determining and obtaining unit, configured to determine a building connected domain in the plurality of connected domains, and obtain a set of outline pixel points of an outline in each of the building connected domains; A regularization processing unit is used to perform different regularization processing on the outline pixel point sets of each outline based on the area and complexity of each outline in the connected domain of each building, so as to obtain the regularized outline pixel point sets of each outline in the connected domain of all buildings; a conversion unit, configured to convert pixel coordinates in the regularized outline pixel point set into geographic coordinates to obtain a building vectorization result; The regularization processing unit is further configured to: simplify the contour pixel points in the contour pixel point set of each contour using a conventional contour simplification algorithm to obtain an initial contour pixel point set of each contour; calculate the area of ​​each contour based on the initial contour pixel point set of each contour, and determine a regularization strategy corresponding to each contour based on the area of ​​each contour, a preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of each contour; and then perform regularization processing on the initial contour pixel point set of the corresponding contour according to the regularization strategy to obtain a regularized contour pixel point set of each contour in the connected domain of all buildings; Wherein, the regularization processing unit is further used for: if the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than the first preset number threshold, then using the traditional contour simplification algorithm to simplify the initial contour pixel points in the initial contour pixel point set of the current contour, and using the adaptive regularization algorithm to perform the first regularization processing on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour; if the area of ​​the current contour is greater than the corresponding preset area threshold, and the number of initial contour pixel points in the initial contour pixel point set of the current contour is greater than the first preset number threshold, then using the adaptive regularization algorithm to perform the first regularization processing on the simplified intermediate contour pixel point set of the current contour to obtain a first regularized contour pixel point set of the current contour; If the number of outline pixel points is not greater than the first preset number threshold, the adaptive regularization algorithm is used to perform the first regularization processing on the initial outline pixel point set of the current outline to obtain the first regularized outline pixel point set of the current outline; if the number of the first regularized outline pixel points in the first regularized outline pixel point set of the current outline is less than the second preset number threshold, the minimum circumscribed rectangle of the first regularized outline pixel point set of the current outline is determined, and the four points of the minimum circumscribed rectangle of the first regularized outline pixel point set of the current outline are used as the regularized outline pixel point set of the current outline; if the first regularized outline pixel point set of the current outline is less than the second preset number threshold, the minimum circumscribed rectangle of the first regularized outline pixel point set of the current outline is determined, and the four points of the minimum circumscribed rectangle of the first regularized outline pixel point set of the current outline are used as the regularized outline pixel point set of the current outline; If the number of the first regularized contour pixel points in the pixel point set is not less than the second preset number threshold, and the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is less than the third preset number threshold, then the adaptive regularization algorithm is used to perform a second regularization process on the first regularized contour pixel point set of the current contour to obtain the regularized contour pixel point set of the current contour; if the number of the first regularized contour pixel points in the first regularized contour pixel point set of the current contour is not less than the third preset number threshold, then the traditional contour simplification algorithm is used to simplify the initial contour pixel points in the initial contour pixel point set of the current contour. The pixel points are simplified, and the simplified middle contour pixel point set of the current contour is used as the regular contour pixel point set of the current contour; if the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an outer contour, the minimum circumscribed rectangle of the contour pixel point set of the current contour is determined, and the four points of the minimum circumscribed rectangle of the contour pixel point set of the current contour are used as the regular contour pixel point set of the current contour; if the area of ​​the current contour is not greater than the corresponding preset area threshold, and the current contour is an inner contour, the contour pixel point set of the current contour is deleted, and the regular contour pixel point set of the current contour is an empty set; Wherein, the regularization processing unit is further used to: connect two adjacent contour pixel points in the target contour pixel point set in sequence, and screen the connected line segments according to a first preset distance threshold to obtain an initial line segment set, and calculate the length and direction angle of each initial line segment in the initial line segment set to obtain a length set of each initial line segment and a direction angle set of each initial line segment, wherein the target contour pixel point set includes: a simplified intermediate contour pixel point set of the current contour, an initial contour pixel point set of the current contour, and a regularized contour pixel point set of the current contour; use the angle of the minimum circumscribed rectangle of the contour pixel point set of the current contour as the first contour transformation main direction, and use the direction angle of the longest fitting line segment obtained after angular clustering in the order of the initial line segments in the initial line segment set as the second contour transformation main direction; if the first contour transformation main direction is the same as the second contour transformation main direction, the initial line segments in the initial line segment set are clustered according to the first contour transformation main direction, the length set of each initial line segment and the direction angle set of each initial line segment. The first transformed line segment set is transformed to obtain a first transformed line segment set, and the first transformed line segment set is then used as the transformed line segment set; if the first contour transformation main direction is different from the second contour transformation main direction, the initial line segments in the initial line segment set are transformed according to the first contour transformation main direction, the length set of each initial line segment, and the direction angle set of each initial line segment to obtain a first transformed line segment set, and the initial line segments in the initial line segment set are transformed according to the second contour transformation main direction, the length set of each initial line segment, and the direction angle set of each initial line segment to obtain a second transformed line segment set, and the first transformed line segment set and the second transformed line segment set are then used as the transformed line segment set; a target line segment set is determined according to the relationship between two adjacent line segments in the transformed line segment set; the starting point of the target line segment in the target line segment set is used as the initial regularized contour pixel point set; and a target regularized contour pixel point set is determined according to the intersection-and-union ratio of the initial regularized contour pixel point set and the contour pixel point set of the current contour; Wherein, the regularization processing unit is further used for: setting the secondary direction as the first contour transformation main direction; calculating the first angle difference between the direction angle of the first initial line segment in the initial line segment set and the first contour transformation main direction; if the first angle difference is not greater than a first preset angle threshold, the first initial line segment is rotated with the center point to be a line segment parallel to the first contour transformation main direction, and the transformed line segment of the first initial line segment is obtained; if the first angle difference is not greater than a second preset angle threshold, the first initial line segment is rotated with the center point to be a line segment perpendicular to the first contour transformation main direction, and the transformed line segment of the first initial line segment is obtained; if the first If the angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is not greater than the second preset distance threshold, a straight line with a slope equal to the first contour transformation main direction is drawn through the starting point of the first initial line segment, and a perpendicular line to the straight line is drawn through the end point of the first initial line segment, and the two line segments at the perpendicular foot position are used as the transformed line segments of the first initial line segment; if the first angle difference is greater than the first preset angle threshold, or the first angle difference is greater than the second preset angle threshold, and the length of the first initial line segment is greater than the second preset distance threshold, then it is determined whether the secondary direction is equal to the first contour transformation main direction. direction; if the secondary direction is equal to the first contour transformation main direction, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment; if the secondary direction is not equal to the first contour transformation main direction, the second angle difference between the direction angle of the first initial line segment and the secondary direction is calculated; if the second angle difference is not greater than the first preset angle threshold, the first initial line segment is rotated about the center point to be a line segment parallel to the secondary direction, and the transformed line segment of the first initial line segment is obtained; if the second angle difference is not greater than the second preset angle threshold, the first initial line segment is rotated about the center point to be perpendicular to the The transformed line segment of the first initial line segment is obtained by traversing the secondary direction; if the second angle difference is greater than the first preset angle threshold, or the second angle difference is greater than the second preset angle threshold, the first initial line segment is not transformed, and the secondary direction is set to the direction angle of the first initial line segment; the next initial line segment in the initial line segment set is traversed, and the next initial line segment is used as the first initial line segment, and the step of calculating the direction angle of the first initial line segment in the initial line segment set and the first angle difference of the first contour transformation main direction is returned to execute, until all the initial line segments in the initial line segment set are traversed, and the first transformed line segment set is obtained.

5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.

6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to execute the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Remote sensing image building extraction method based on deep learning and contour regularization

    CN115984693A

  • Real estate surveying and mapping method

    CN118501878A