A building outline recognition method and system based on cross-sectional view

By using cross-sectional view in the three-dimensional inclined model, the building contours are identified, which solves the problems of low efficiency and low accuracy in the prior art, and realizes the accurate and rapid identification and efficient extraction of building contours.

CN118781143BActive Publication Date: 2024-12-27WUHAN FENGLING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411256973.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2024-12-27
Estimated Expiration
2044-09-09

AI Technical Summary

Technical Problem

The prior art has low efficiency and low accuracy in building profile recognition in three-dimensional inclined models. It is difficult to accurately identify building profiles in the top viewing angle, resulting in unsatisfactory contours and difficult to apply to actual scenarios.

Method used

Using the building contour line recognition method based on cross-sectional view, the three-dimensional inclined model is used to slice the three-dimensional inclined model, and the best extraction surface is determined, and the line segment merge is used using the regional growth method to construct convex hull polygons, and then replace it through fitting. Get the outline polygon and finally display its segment vector.

Benefits of technology

It realizes accurate and rapid identification of building contour lines, greatly improves extraction efficiency, and is convenient for application in various scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118781143B_ABST
    Figure CN118781143B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for identifying building contour lines based on cross-sectional views, including slicing a three-dimensional inclined model according to preset slicing parameters, constructing a facet set, and determining the best extraction face; merging line segments of the facet set using a region growing method to obtain a line segment set, and performing topological faceting on the line segment set to obtain a convex hull polygon; determining a contour polygon based on the convex hull polygon; connecting the edges of the contour polygon in order to obtain a line segment vector, and displaying it according to the height corresponding to the line segment vector in the three-dimensional inclined model. The present invention slices a three-dimensional inclined model and determines the best extraction face, then merges line segments based on the facet set obtained by slicing, determines a convex hull polygon, and further determines a contour polygon, and finally obtains and displays a line segment vector, thereby accurately and quickly identifying the contour line of a building, greatly improving the extraction efficiency, and being convenient for application in various scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of geographic surveying technology, and in particular to a method and system for identifying building outlines based on cross-sectional views. Background Art

[0002] Drawing building outlines through 3D tilted models is widely used. Traditional algorithms are often drawn manually. This method is not only inefficient and labor-intensive, but also has poor drawing accuracy. In the prior art, there are also new intelligent recognition algorithms, most of which also use orthophotos or top views of 3D models for extraction. Figure 1 In the top view of the three-dimensional house shown, it can be seen that the model edge is not regular and has no obvious features compared with the surrounding pixels, making it difficult to accurately identify the building outline. Therefore, the obtained building outline is often not ideal and is not convenient to be applied in actual scenes. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a building outline recognition method and system based on a cross-sectional view in view of the deficiencies of the above-mentioned prior art.

[0004] The technical solution of the present invention to solve the above technical problem is as follows: A building outline recognition method based on a cross-sectional view comprises the following steps:

[0005] Slice the 3D tilted model according to preset slice parameters, construct a facet set, and determine the best extraction surface based on the wall radius and curvature of each facet;

[0006] Using a region growing method to merge line segments of the face set to obtain a line segment set, and topologically constructing the line segment set to obtain a convex hull polygon;

[0007] For each edge of the convex hull polygon, find the best fitting line segment from the line segment set to replace it, so as to obtain a contour polygon;

[0008] The edges of the contour polygon are connected in order to obtain line segment vectors, and the line segment vectors are displayed according to the heights corresponding to the line segment vectors in the three-dimensional tilted model.

[0009] The beneficial effects of the present invention are as follows: the building contour line recognition method based on cross-sectional view of the present invention, by slicing the three-dimensional inclined model and determining the best extraction surface, then merging line segments based on the facet set obtained by slicing, determining the convex hull polygon, and further determining the contour polygon, finally obtains and displays the line segment vector used to characterize the building contour line, can accurately and quickly identify the building contour line, greatly improves the extraction efficiency, and is convenient for application in various scenarios.

[0010] On the basis of the above technical solution, the present invention can also be improved as follows:

[0011] Further: the step of slicing the three-dimensional inclined model according to the preset slicing parameters, constructing a facet set, and calculating the thickest wall radius and maximum curvature of the extracted face specifically includes the following steps:

[0012] Set slice parameters, including the slice height radius and elevation range;

[0013] Traversing all facets in the three-dimensional tilted model, selecting a first facet set in which the Z coordinates of all points in the facets are within the elevation range;

[0014] Cutting the patches whose Z coordinates of some points in two horizontal plane patches whose elevation values ​​are equal to the upper and lower limits of the elevation range is performed within the elevation range to obtain a second patch set between the two horizontal planes;

[0015] Adding the first patch set and the second patch set to the initialized blank patch set respectively to obtain a patch set;

[0016] All vertices of each face in the face set are traversed, and a wall thickness set and a curvature set are constructed according to the vertices, and the cut surface with the smallest maximum value in the wall thickness set and the curvature set is respectively taken as the best extraction surface.

[0017] The beneficial effect of the above further scheme is: by screening the first facet set whose Z coordinates are all within the elevation range, and cutting the facets whose Z coordinates of some points in two horizontal facets whose elevation values ​​are equal to the upper and lower elevation limits of the elevation range are within the elevation range, a second facet set between the two horizontal planes is obtained, and faces containing the set elevation range can be screened and constructed, thereby facilitating the determination of the optimal extraction face based on these facets.

[0018] Further: the step of constructing a wall thickness set and a curvature set according to the vertices specifically includes the following steps:

[0019] Set the threshold K and find the distance vertex p from the face set t The nearest K points, and the three-dimensional point set formed by the K points is recorded as the first point set Kset;

[0020] Map all points in the first point set Kset to the XOY plane, record the obtained two-dimensional point set as the second point set Kset2, and fit all points in the second point set Kset2 into a straight line l, record the vertex p t The perpendicular line to the straight line l is l1;

[0021] Calculate the vertex p respectively t The first distance between the straight line l and the vertex p t and the vertical line l1, and when the first distance and the second distance are respectively less than the corresponding thresholds, the corresponding vertex p t Construct the third point set Lset;

[0022] Calculate the distance between any two points in the third point set Lset, and take the maximum distance as the vertex p t The maximum thickness R at the point is added to the initialized wall thickness set Rset;

[0023] Calculate the centroid c of the first point set Kset and construct the covariance matrix C. The calculation formula is:

[0024]

[0025] Among them, p i is the i-th point in the first point set Kset, and N is the number of points in the first point set Kset;

[0026] Perform eigenvalue decomposition on the covariance matrix C to obtain eigenvalues ​​λ1 and λ2, and calculate the vertex p t The curvature C1 at is equal to (λ1+λ2) / 2, and the curvature C1 is added to the initialized curvature set Cset.

[0027] The beneficial effect of the above further solution is that by determining the vertex p t The corresponding three-dimensional first point set Kset is then mapped to the XOY plane to obtain the second point set Kset2, and then fitted to obtain the fitting line l, so that the vertex p t The first distance between the straight line l and the vertex p t The third point set Lset that meets the set distance requirement is constructed by using the second distance between the vertical line l1 and the vertical line l2, thereby accurately determining the vertex p t The maximum thickness R at the wall is obtained, and the wall thickness set is obtained. The covariance matrix C is constructed, and the vertex p is calculated according to the eigenvalue of the covariance matrix C. t The curvature C1 at , and then the curvature set Cset is obtained.

[0028] Further: after adding the first patch set and the second patch set to the initialized blank patch set to obtain the patch set, the following steps are also included:

[0029] All the facets in the facet set are projected onto the XOY plane to obtain a cross-sectional window.

[0030] The beneficial effect of the above further solution is that: by projecting all the facets in the facet set onto the XOY plane respectively, a cross-sectional window is obtained, which can be conveniently displayed in the window for manual viewing.

[0031] Further: the step of merging the line segments of the face set using the region growing method to obtain a line segment set, and performing topological faceting on the line segment set to obtain a convex hull polygon specifically includes the following steps:

[0032] Adding each edge of each face in the face patch set as a line segment to the initialized line segment set to obtain a first line segment set containing multiple line segments;

[0033] Merging the line segments in the first line segment set by using a region growing method to obtain a second line segment set;

[0034] The second line segment set is topologically faceted using the convex hull, and the convex hull of the second line segment set is calculated to obtain a convex hull polygon surrounded by the convex hull.

[0035] The beneficial effect of the above further scheme is: constructing a first line segment set through each edge of each face in the face set, and merging the line segments in the first line segment set to obtain a second line segment set, thereby topologically constructing the second line segment set to obtain a convex hull polygon, so that the contour polygon can be subsequently obtained based on the convex hull polygon.

[0036] Further: the step of merging the line segments in the first line segment set by using the region growing method to obtain the second line segment set specifically comprises the following steps:

[0037] Creating a state set for recording whether the line segments in the first line segment set have been merged; wherein, at an initial moment, the state of the line segments in the first line segment set is that they have not been merged;

[0038] Traverse each line segment in the first line segment set, if the status of the current line segment li is already merged, directly skip it and continue to traverse the remaining line segments, otherwise, take the current line segment li as a seed line segment for merging to obtain a new line segment, and mark the status of the current line segment li in the status set as processed;

[0039] When the states of all line segments in the state set have been merged, a second line segment set is generated based on the obtained new line segments.

[0040] The beneficial effect of the above further scheme is: by traversing each line segment in the first line segment set and merging them, it is ensured that each line segment in the first line segment set is processed and new line segments are obtained at the same time, thereby constructing a second line segment set for creating a convex hull polygon.

[0041] Further: the merging process of taking the current line segment li as the seed line segment specifically includes the following steps:

[0042] For each seed line segment in the first line segment set, create a line segment cluster;

[0043] Traverse the first line segment set, if the current line segment l in the first line segment set j If the status is not merged, then determine the current line segment l j and the corresponding seed segment l i Whether the preset merging condition is met, if so, the current line segment l j Adding to the corresponding line segment cluster until all line segments in the line segment cluster are traversed as seed line segments;

[0044] Merge all the line segments in the line segment cluster, and use the line segment whose length exceeds a preset threshold after merging as the new line segment;

[0045] Wherein, the preset merging condition is:

[0046] The current line segment l j is parallel to the corresponding seed line segment or the angle between them is less than the preset first angle threshold, and the current line segment l j The minimum distance between the corresponding seed line segment is less than a preset first distance threshold.

[0047] The beneficial effect of the above further scheme is: by traversing the first line segment set, it is ensured that the line segments in the first line segment set are all merged, and the line segments that meet the merging conditions are added to the line segment cluster, so that all line segments can be traversed as seed line segments, ensuring that no line segments are missed, and the corresponding new line segments are obtained after merging.

[0048] Further: after obtaining the second line segment set, the second line segment set is also squared, which specifically includes the following steps:

[0049] Traverse the second set of line segments and use the longest line segment as the reference edge;

[0050] Traversing the second line segment set, and calculating the angle between the current line segment and the reference edge;

[0051] If the difference between the angle between the current line segment and the reference edge and the horizontal angle is less than or lower than a preset second angle threshold, the current line segment is rotated to be parallel to the reference edge; if the difference between the angle between the current line segment and the reference edge and the vertical angle is less than or lower than a preset third angle threshold, the current line segment is rotated to be perpendicular to the reference edge; otherwise, the current line segment is regarded as an invalid line segment and discarded.

[0052] The beneficial effect of the above further solution is that by making the second line segment set square-angled, the characteristics of the building can be better met, and invalid line segments can be effectively removed, ensuring that the obtained second line segment set is more accurate.

[0053] Further: for each edge of the convex hull polygon, finding the best fitting line segment from the line segment set to replace it, and obtaining the contour polygon specifically comprises the following steps:

[0054] Traverse each edge of the convex hull polygon, and for the current edge s, its front end point and back end point are recorded as p1 and p2 respectively;

[0055] For the front point p1, searching from the second line segment set for the nearest line segment I_near1 whose endpoint is less than a preset second distance threshold from the front point p1;

[0056] The end of the nearest line segment I_near1 that is farther from p1 is recorded as A, the intersection point of the current edge s and the line where the nearest line segment I_near1 is located is O1, the angle between the vector O1p2 and the vector O1A is calculated, and when the angle between the two is less than the preset fourth angle threshold, the current edge s is replaced with the nearest line segment I_near1, and the newly inserted current edge s is recorded;

[0057] For the rear endpoint p2, searching from the second line segment set for the nearest line segment I_near2 whose endpoint and the rear endpoint p2 are less than a preset third distance threshold;

[0058] The end of the nearest line segment I_near2 that is farther from p2 is denoted as B, the intersection of the current edge s and the straight line where the nearest line segment I_near2 is located is O2, the angle between the vector O2p1 and the vector O2B is calculated, and when the angle between the two is less than a preset fourth angle threshold, the current line segment s is inserted into the position behind the current edge s of the convex hull polygon;

[0059] Repeat the above steps until no new edges are inserted into the convex hull polygon, thereby obtaining the contour polygon.

[0060] The beneficial effect of the above further scheme is: by traversing each edge of the convex hull polygon and replacing it when the angle between the line segment closest to the endpoint of each edge and the corresponding edge meets the set conditions, the best fitting of the line segment is achieved, and the contour polygon is obtained, thereby realizing the accurate extraction of the contour line of the building.

[0061] The present invention also provides a building outline recognition system based on cross-sectional views, comprising a slice calculation module, a merging topology module, a fitting replacement module and a connection display module;

[0062] The slice calculation module is used to slice the three-dimensional tilted model according to preset slice parameters, construct a face set, and calculate the thickest wall radius and maximum curvature of the extracted surface;

[0063] The merging topology module is used to merge the line segments of the face set by using the region growing method to obtain a line segment set, and to perform topological faceting on the line segment set to obtain a convex hull polygon;

[0064] The fitting replacement module is used to find the best fitting line segment from the line segment set for each edge of the convex hull polygon to replace it, so as to obtain a contour polygon;

[0065] The connection display module is used to connect the edges of the contour polygon in sequence to obtain line segment vectors, and display the line segment vectors according to the heights corresponding to the line segment vectors in the three-dimensional tilted model.

[0066] The building contour line recognition method based on cross-sectional view of the present invention performs cross-sectional slicing on the three-dimensional inclined model and determines the best extraction surface, then merges line segments based on the facet set obtained by slicing, determines the convex hull polygon, and further determines the contour polygon, and finally obtains and displays the line segment vector used to characterize the building contour line. The building contour line can be accurately and quickly identified, the extraction efficiency is greatly improved, and it is convenient to be applied to various scenes. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of a flow chart of a method for identifying building contours based on a cross-sectional view according to an embodiment of the present invention;

[0068] Figure 2 is a schematic diagram of an example of an optimal extraction surface according to an embodiment of the present invention;

[0069] Figure 3 is a schematic diagram of an example of a second line segment set after being right-angled according to an embodiment of the present invention;

[0070] Figure 4 It is a schematic diagram of an example of a convex hull enclosing a polygon according to an embodiment of the present invention;

[0071] Figure 5 A schematic diagram of an example of a contour polygon according to an embodiment of the present invention;

[0072] Figure 6 It is a schematic diagram of an example of obtaining line segment vectors by connecting the outlines of the outline polygons in sequence according to an embodiment of the present invention;

[0073] Figure 7 A schematic structural diagram of a building outline recognition system based on a cross-sectional view according to an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0075] like Figure 1 As shown, a building outline recognition method based on a cross-sectional view comprises the following steps:

[0076] S1: Slice the 3D tilted model according to preset slice parameters, construct a facet set, and determine the best extraction surface based on the wall radius and curvature of each facet;

[0077] S2: using a region growing method to merge line segments of the face set to obtain a line segment set, and performing topological faceting on the line segment set to obtain a convex hull polygon;

[0078] S3: for each edge of the convex hull polygon, find the best fitting line segment from the line segment set to replace it, so as to obtain a contour polygon;

[0079] S4: Connecting the edges of the contour polygon in order to obtain line segment vectors, and displaying the line segment vectors according to the heights corresponding to the line segment vectors in the three-dimensional tilted model.

[0080] In one or more embodiments of the present invention, the steps of slicing the three-dimensional inclined model according to preset slicing parameters, constructing a facet set, and calculating the thickest wall radius and maximum curvature of the extracted face specifically include the following steps:

[0081] S11: Setting slice parameters, wherein the slice parameters include a slice height radius and an elevation range;

[0082] In the embodiment of the present invention, the height radius device is 0.2500m, and the elevation is set to 10m, so the elevation range is 9.75-10.25m.

[0083] S12: traverse all facets in the three-dimensional tilted model, and select a first facet set in which the Z coordinates of all points in the facets are within the elevation range;

[0084] For the three-dimensional inclined model, since the way to express data in the three-dimensional inclined model is to connect a large number of triangular faces or polygonal faces, for this embodiment, the facets with elevations between 9.75m and 10.25m in the model are cut out.

[0085] S13: using the patches whose Z coordinates of some points in two horizontal plane patches whose elevation values ​​are equal to the upper and lower limits of the elevation range to be cut within the elevation range, to obtain a second patch set between the two horizontal planes;

[0086] For the patches where some points are between 9.75m and 10.25m, the patches are cut using two horizontal planes z=9.75m and z=10.25m to find the part between 9.75m and 10.25m, thereby obtaining a second patch set.

[0087] S14: adding the first patch set and the second patch set to the initialized blank patch set respectively to obtain a patch set;

[0088] S16: traverse all vertices of each facet in the facet set, and construct a wall thickness set and a curvature set according to the vertices, and respectively take the section with the smallest maximum value in the wall thickness set and the curvature set as the best extraction surface.

[0089] By screening the first facet set whose Z coordinates are all within the elevation range, and cutting the facets whose Z coordinates of some points in two horizontal facets whose elevation values ​​are equal to the upper and lower elevation limits of the elevation range are within the elevation range, a second facet set between the two horizontal planes is obtained. Facets containing the set elevation range can be screened and constructed, and then the best extraction surface can be determined based on these facets, such as Figure 2 shown.

[0090] Optionally, in one or more embodiments of the present invention, after adding the first patch set and the second patch set to an initialized blank patch set to obtain the patch set, the following steps are further included:

[0091] S15: Project all the facets in the facet set onto the XOY plane to obtain a cross-sectional window.

[0092] By projecting all the facets in the facet set onto the XOY plane respectively, a cross-section window is obtained, which can be conveniently displayed in the window for manual viewing.

[0093] In an embodiment of the present invention, after the section mode is turned on, the maximum value R of the wall thickness set Rset and the maximum value C of the curvature set Cset in the current section will be displayed in the window. In the section mode, the front elevation value h can be adjusted in real time by sliding the mouse wheel or keyboard operation. The section window and the maximum value R of the wall thickness set Rset and the maximum value C of the curvature set Cset follow the changes. The smaller the maximum value R of the wall thickness set Rset and the maximum value C of the curvature set Cset, the flatter the wall, the fewer interferences on the surface, and the smaller the error between the final extracted contour and the final building contour.

[0094] It should be noted that, in practice, in addition to the above method, you can also set the gradient parameter (such as Δ = 0.1m), perform cross-section slicing every Δ height, and finally find the section with the maximum value R of the wall thickness set Rset and the maximum value C of the curvature set Cset and the minimum average value as the optimal extraction surface.

[0095] In one or more embodiments of the present invention, constructing a wall thickness set and a curvature set according to the vertices specifically comprises the following steps:

[0096] S161: Set a threshold K (in the embodiment of the present invention, the default value is 16), and find the distance vertex p from the face set. t The nearest K points, and the three-dimensional point set formed by the K points is recorded as the first point set Kset;

[0097] S162: Map all points in the first point set Kset to the XOY plane, record the obtained two-dimensional point set as the second point set Kset2, and fit all points in the second point set Kset2 into a straight line l, record the vertex p t The perpendicular line to the straight line l is l1;

[0098] Here, the least square method in the prior art is used to fit all points in the second point set Kset2 into a straight line l.

[0099] S163: Calculate the vertices p respectively t The first distance between the straight line l and the vertex p t and the vertical line l1, and when the first distance and the second distance are respectively less than corresponding thresholds (in the present invention, the first distance threshold is 0.05m and the second distance threshold is 1m), based on the corresponding vertex p t Construct the third point set Lset;

[0100] S164: Calculate the distance between any two points in the third point set Lset, and take the maximum distance as the vertex p t The maximum thickness R at the point is added to the initialized wall thickness set Rset;

[0101] S165: Calculate the centroid c of the first point set Kset and construct a covariance matrix C. The calculation formula is:

[0102]

[0103] Among them, p i is the i-th point in the first point set Kset, and N is the number of points in the first point set Kset;

[0104] S166: Perform eigenvalue decomposition on the covariance matrix C to obtain eigenvalues ​​λ1 and λ2, and calculate the vertex p t The curvature C1 at is equal to (λ1+λ2) / 2, and the curvature C1 is added to the initialized curvature set Cset.

[0105] By determining the vertex p t The corresponding three-dimensional first point set Kset is then mapped to the XOY plane to obtain the second point set Kset2, and then fitted to obtain the fitting line l, so that the vertex p t The first distance between the straight line l and the vertex p t The third point set Lset that meets the set distance requirement is constructed by using the second distance between the vertical line l1 and the vertical line l2, thereby accurately determining the vertex p t The maximum thickness R at the wall is obtained, and the wall thickness set is obtained. The covariance matrix C is constructed, and the vertex p is calculated according to the eigenvalue of the covariance matrix C. t The curvature C1 at , and then the curvature set Cset is obtained.

[0106] In one or more embodiments of the present invention, the step of merging line segments of the face set using the region growing method to obtain a line segment set, and performing topological faceting on the line segment set to obtain a convex hull polygon specifically includes the following steps:

[0107] S21: adding each edge of each face in the face patch set as a line segment to the initialized line segment set to obtain a first line segment set including a plurality of line segments;

[0108] S22: merging the line segments in the first line segment set by using a region growing method to obtain a second line segment set;

[0109] In one or more embodiments of the present invention, merging the line segments in the first line segment set by using the region growing method to obtain the second line segment set specifically comprises the following steps:

[0110] S221: creating a state set for recording whether the line segments in the first line segment set have been merged; wherein, at an initial moment, the state of the line segments in the first line segment set is that they have not been merged;

[0111] In one or more embodiments of the present invention, the merging process of taking the current line segment li as the seed line segment specifically includes the following steps:

[0112] S2221: creating a line segment cluster for each seed line segment in the first line segment set;

[0113] S2222: Traverse the first line segment set. If the current line segment l in the first line segment setj If the status is not merged, then determine the current line segment l j and the corresponding seed segment meet the preset merging conditions. If yes, the current segment l j Adding to the corresponding line segment cluster until all line segments in the line segment cluster are traversed as seed line segments;

[0114] S2223: merging all the line segments in the line segment cluster, and taking the line segment whose length after merging exceeds a preset threshold (in this embodiment, 0.5 m) as the new line segment;

[0115] Wherein, the preset merging condition is:

[0116] The current line segment l j is parallel to the corresponding seed line segment or the angle between them is less than a preset first angle threshold (in this embodiment, 2 degrees), and the current line segment l j The minimum distance between the corresponding seed line segment is less than a preset first distance threshold (in this embodiment, 0.1 m).

[0117] By traversing the first line segment set, it is ensured that all line segments in the first line segment set are merged, and the line segments that meet the merging conditions are added to the line segment cluster, so that all line segments can be traversed as seed line segments to ensure that no line segments are missed, and the corresponding new line segments are obtained after merging.

[0118] S222: traverse each line segment in the first line segment set, and if the status of the current line segment li is that it has been merged, directly skip it and continue to traverse the remaining line segments; otherwise, take the current line segment li as a seed line segment for merging to obtain a new line segment, and mark the status of the current line segment li in the status set as processed;

[0119] S223: When the states of all line segments in the state set have been merged, a second line segment set is generated based on the obtained new line segments.

[0120] By traversing each line segment in the first line segment set and performing merging processing, it is ensured that each line segment in the first line segment set is processed and a new line segment is obtained, thereby constructing a second line segment set for creating a convex hull polygon.

[0121] In one or more embodiments of the present invention, after obtaining the second line segment set, the method further includes square-angling the second line segment set, which specifically includes the following steps:

[0122] S231: traverse the second set of line segments, and use the longest line segment among them as a reference edge;

[0123] S232: traverse the second line segment set, and calculate the angle between the current line segment and the reference edge;

[0124] S233: If the difference between the angle between the current line segment and the reference side and the horizontal angle is less than or lower than a preset second angle threshold (in this embodiment, 3 degrees), the current line segment is rotated to be parallel to the reference side; if the difference between the angle between the current line segment and the reference side and the vertical angle is less than or lower than a preset third angle threshold (in this embodiment, 3 degrees), the current line segment is rotated to be perpendicular to the reference side; otherwise, the current line segment is regarded as an invalid line segment and discarded.

[0125] By making the second line segment set square, the characteristics of the building can be better met, and invalid line segments can be effectively removed to ensure that the obtained second line segment set is more accurate. Figure 3 As shown, this is the second set of line segments after being right-angled.

[0126] S24 uses the convex hull to perform topological faceting on the second line segment set, and calculates the convex hull of the second line segment set to obtain a convex hull polygon surrounded by the convex hull.

[0127] A first line segment set is constructed through each edge of each face in the face set, and the line segments in the first line segment set are merged to obtain a second line segment set, thereby topologically constructing the second line segment set to obtain a convex hull polygon, so that a contour polygon can be subsequently obtained based on the convex hull polygon.

[0128] Here, the second line segment set is topologically constructed. In this application, the convex hull method is used to perform initial construction. The convex hull of the second line segment set is calculated through the opencv open source method to obtain the convex hull enclosing polygon, such as Figure 4 shown.

[0129] In one or more embodiments of the present invention, for each edge of the convex hull polygon, finding the best fitting line segment from the line segment set to replace it to obtain the contour polygon specifically comprises the following steps:

[0130] S31: traverse each edge of the convex hull polygon, and for the current edge s, its front end point and rear end point are recorded as p1 and p2 respectively;

[0131] S32: for the front end point p1, searching from the second line segment set for the nearest line segment I_near1 whose endpoint is less than a preset second distance threshold (in this embodiment, 0.5 m) from the front end point p1;

[0132] S33: The end of the nearest line segment I_near1 that is farther from p1 is recorded as A, and the intersection point of the current edge s and the line where the nearest line segment I_near1 is located is O1, and the angle between the vector O1p2 and the vector O1A is calculated, and when the angle between the two is less than a preset fourth angle threshold (in this embodiment, 90 degrees), the current edge s is replaced with the nearest line segment I_near1, and the newly inserted current edge s is recorded;

[0133] S34: for the rear endpoint p2, searching from the second line segment set for the nearest line segment I_near12 whose endpoint is less than a preset third distance threshold (in this embodiment, 0.5 m) from the rear endpoint p2;

[0134] S35: The end of the nearest line segment I_near2 that is farther from p2 is recorded as B, and the intersection point of the current edge s and the straight line where the nearest line segment I_near2 is located is O2, and the angle between the vector O2p1 and the vector O2B is calculated, and when the angle between the two is less than a preset fourth angle threshold (in this embodiment, 90 degrees), the current line segment s is inserted into the position behind the current edge s of the convex hull polygon;

[0135] S36: Repeat the above steps until no new edges are inserted into the convex hull polygon, thereby obtaining the contour polygon.

[0136] It should be noted that, here, after obtaining all the sequentially connected edges, the adjacent edges are connected. If two adjacent edges do not intersect, the two edges are extended until they intersect. If the two edges have intersected, the part outside the intersection of the adjacent edges and inside the polygon is deleted, and finally the contour polygon is obtained, such as Figure 5 shown.

[0137] By traversing each edge of the convex hull polygon and replacing the line segment closest to the endpoint of each edge when the angle between the corresponding edge meets the set conditions, the best fitting of the line segment is achieved, and the contour polygon is obtained, thereby achieving accurate extraction of the building's contour line.

[0138] In one or more embodiments of the present invention, after obtaining the contour polygon, the contours are connected in sequence to obtain line segment vectors, such as Figure 6 As shown, by setting an appropriate height on the three-dimensional model, it can be displayed and the fit can be observed.

[0139] like Figure 7 As shown, the present invention also provides a building outline recognition system based on a cross-sectional view, comprising a slice calculation module, a merging topology module, a fitting replacement module and a connection display module;

[0140] The slice calculation module is used to slice the three-dimensional tilted model according to preset slice parameters, construct a face set, and calculate the thickest wall radius and maximum curvature of the extracted surface;

[0141] The merging topology module is used to merge the line segments of the face set by using the region growing method to obtain a line segment set, and to perform topological faceting on the line segment set to obtain a convex hull polygon;

[0142] The fitting replacement module is used to find the best fitting line segment from the line segment set for each edge of the convex hull polygon to replace it, so as to obtain a contour polygon;

[0143] The connection display module is used to connect the edges of the contour polygon in sequence to obtain line segment vectors, and display the line segment vectors according to the heights corresponding to the line segment vectors in the three-dimensional tilted model.

[0144] The building contour line recognition method based on cross-sectional view of the present invention performs cross-sectional slicing on the three-dimensional inclined model and determines the best extraction surface, then merges line segments based on the facet set obtained by slicing, determines the convex hull polygon, and further determines the contour polygon, and finally obtains and displays the line segment vector used to characterize the building contour line. The building contour line can be accurately and quickly identified, the extraction efficiency is greatly improved, and it is convenient to be applied to various scenes.

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

Claims

1. A building outline recognition method based on cross-sectional views, characterized in that: The steps include: Slice the 3D tilted model according to preset slice parameters, construct a facet set, and determine the best extraction surface based on the wall radius and curvature of each facet; Using a region growing method to merge line segments of the face set to obtain a line segment set, and topologically constructing the line segment set to obtain a convex hull polygon; For each edge of the convex hull polygon, find the best fitting line segment from the line segment set to replace it, so as to obtain a contour polygon; Connecting the edges of the outline polygon in order to obtain line segment vectors, and displaying the line segment vectors according to their corresponding heights in the three-dimensional tilted model; The method of slicing the three-dimensional tilted model according to preset slicing parameters, constructing a facet set, and determining the best extraction surface based on the wall radius and curvature of each facet specifically includes the following steps: Set slice parameters, including the slice height radius and elevation range; Traversing all facets in the three-dimensional tilted model, selecting a first facet set in which the Z coordinates of all points in the facets are within the elevation range; Cutting the patches whose Z coordinates of some points in two horizontal plane patches whose elevation values ​​are equal to the upper and lower limits of the elevation range is performed within the elevation range to obtain a second patch set between the two horizontal planes; Adding the first patch set and the second patch set to the initialized blank patch set respectively to obtain a patch set; All vertices of each face in the face set are traversed, and a wall thickness set and a curvature set are constructed according to the vertices, and the section with the smallest average value of the maximum value of the wall thickness set and the maximum value of the curvature set is respectively taken as the best extraction surface.

2. The building outline recognition method based on cross-sectional view according to claim 1, characterized in that: The step of constructing a wall thickness set and a curvature set according to the vertices specifically includes the following steps: Set the threshold K and find the distance vertex p from the face set t The nearest K points, and the three-dimensional point set formed by the K points is recorded as the first point set Kset; Map all points in the first point set Kset to the XOY plane, record the obtained two-dimensional point set as the second point set Kset2, and fit all points in the second point set Kset2 into a straight line l, record the vertex p t The perpendicular line to the straight line l is l1; Calculate the vertex p respectively t The first distance between the straight line l and the vertex p t and the vertical line l1, and when the first distance and the second distance are respectively less than the corresponding thresholds, the corresponding vertex p t Construct the third point set Lset; Calculate the distance between any two points in the third point set Lset, and take the maximum distance as the vertex p t The maximum thickness R at the point is added to the initialized wall thickness set Rset; Calculate the centroid c of the first point set Kset and construct the covariance matrix C. The calculation formula is: Among them, p i is the i-th point in the first point set Kset, and N is the number of points in the first point set Kset; Perform eigenvalue decomposition on the covariance matrix C to obtain eigenvalues ​​λ1 and λ2, and calculate the vertex p t The curvature C1 at is equal to (λ1+λ2) / 2, and the curvature C1 is added to the initialized curvature set Cset.

3. The building outline recognition method based on cross-sectional view according to claim 1, characterized in that: After the first patch set and the second patch set are added to the initialized blank patch set to obtain the patch set, the following steps are further included: All the facets in the facet set are projected onto the XOY plane to obtain a cross-sectional window.

4. The building outline recognition method based on cross-sectional view according to claim 1, characterized in that: The step of using the region growing method to merge the line segments of the face set to obtain a line segment set, and performing topological faceting on the line segment set to obtain a convex hull polygon specifically includes the following steps: Adding each edge of each face in the face patch set as a line segment to the initialized line segment set to obtain a first line segment set containing multiple line segments; Merging the line segments in the first line segment set by using a region growing method to obtain a second line segment set; The second line segment set is topologically faceted using the convex hull, and the convex hull of the second line segment set is calculated to obtain a convex hull polygon surrounded by the convex hull.

5. The building outline recognition method based on cross-sectional view according to claim 4, characterized in that: The step of merging the line segments in the first line segment set by using the region growing method to obtain the second line segment set specifically comprises the following steps: Creating a state set for recording whether the line segments in the first line segment set have been merged; wherein, at an initial moment, the state of the line segments in the first line segment set is that they have not been merged; Traverse each line segment in the first line segment set, if the status of the current line segment li is already merged, directly skip it and continue to traverse the remaining line segments, otherwise, take the current line segment li as a seed line segment for merging to obtain a new line segment, and mark the status of the current line segment li in the status set as processed; When the states of all line segments in the state set have been merged, a second line segment set is generated based on the obtained new line segments.

6. The building outline recognition method based on cross-sectional view according to claim 5, characterized in that: The merging process of taking the current line segment li as the seed line segment specifically includes the following steps: For each seed line segment in the first line segment set, create a line segment cluster; Traverse the first line segment set, if the current line segment l in the first line segment set j If the status is not merged, then determine the current line segment l j and the corresponding seed segment l i Whether the preset merging condition is met, if so, the current line segment l j Adding to the corresponding line segment cluster until all line segments in the line segment cluster are traversed as seed line segments; Merge all the line segments in the line segment cluster, and use the line segment whose length exceeds a preset threshold after merging as the new line segment; Wherein, the preset merging condition is: The current line segment l j is parallel to the corresponding seed line segment or the angle between them is less than the preset first angle threshold, and the current line segment l j The minimum distance between the corresponding seed line segment is less than a preset first distance threshold.

7. The building outline recognition method based on cross-sectional view according to claim 4, characterized in that: After obtaining the second line segment set, the method further includes square-angling the second line segment set, which specifically includes the following steps: Traverse the second set of line segments and use the longest line segment as the reference edge; Traversing the second line segment set, and calculating the angle between the current line segment and the reference edge; If the difference between the angle between the current line segment and the reference edge and the horizontal angle is less than or lower than a preset second angle threshold, the current line segment is rotated to be parallel to the reference edge; if the difference between the angle between the current line segment and the reference edge and the vertical angle is less than or lower than a preset third angle threshold, the current line segment is rotated to be perpendicular to the reference edge; otherwise, the current line segment is regarded as an invalid line segment and discarded.

8. The building outline recognition method based on cross-sectional view according to claim 4, characterized in that: The step of replacing each edge of the convex hull polygon with the best fitting line segment from the line segment set to obtain the contour polygon specifically comprises the following steps: Traverse each edge of the convex hull polygon, and for the current edge s, its front end point and back end point are recorded as p1 and p2 respectively; For the front point p1, searching from the second line segment set for the nearest line segment I_near1 whose endpoint is less than a preset second distance threshold from the front point p1; The end of the nearest line segment I_near1 that is farther from p1 is recorded as A, the intersection point of the current edge s and the line where the nearest line segment I_near1 is located is O1, the angle between the vector O1p2 and the vector O1A is calculated, and when the angle between the two is less than a preset fourth angle threshold, the current edge s is replaced by the nearest line segment I_near1; For the rear endpoint p2, searching from the second line segment set for the nearest line segment I_near2 whose endpoint and the rear endpoint p2 are less than a preset third distance threshold; The end of the nearest line segment I_near2 that is farther from p2 is denoted as B, and the intersection of the current edge s and the straight line where the nearest line segment I_near2 is located is O2, the angle between the vector O2p1 and the vector O2B is calculated, and when the angle between the two is less than a preset fourth angle threshold, the nearest line segment I_near2 is inserted into the position behind the current edge s of the convex hull polygon; Repeat the above steps until no new edges are inserted into the convex hull polygon, thereby obtaining the contour polygon.

9. A building outline recognition system based on cross-sectional views, characterized in that: It includes a slice calculation module, a merge topology module, a fitting replacement module and a connection display module; The slice calculation module is used to slice the three-dimensional tilted model according to preset slice parameters, construct a face set, and calculate the thickest wall radius and maximum curvature of the extracted surface; The merging topology module is used to merge the line segments of the face set by using the region growing method to obtain a line segment set, and to perform topological faceting on the line segment set to obtain a convex hull polygon; The fitting replacement module is used to find the best fitting line segment from the line segment set for each edge of the convex hull polygon to replace it, so as to obtain a contour polygon; The connection display module is used to connect the edges of the outline polygon in order to obtain line segment vectors, and display the line segment vectors according to the heights corresponding to the line segment vectors in the three-dimensional tilted model; The method of slicing the three-dimensional tilted model according to preset slicing parameters, constructing a facet set, and determining the best extraction surface based on the wall radius and curvature of each facet specifically includes the following steps: Set slice parameters, including the slice height radius and elevation range; Traversing all facets in the three-dimensional tilted model, selecting a first facet set in which the Z coordinates of all points in the facets are within the elevation range; Cutting the patches whose Z coordinates of some points in two horizontal plane patches whose elevation values ​​are equal to the upper and lower limits of the elevation range is performed within the elevation range to obtain a second patch set between the two horizontal planes; Adding the first patch set and the second patch set to the initialized blank patch set respectively to obtain a patch set; All vertices of each face in the face set are traversed, and a wall thickness set and a curvature set are constructed according to the vertices, and the section with the smallest average value of the maximum value of the wall thickness set and the maximum value of the curvature set is respectively taken as the best extraction surface.