A roof structure LoD2 three-dimensional reconstruction method based on lightweight corner-edge relationship reasoning
Patent Information
- Application Number
- CN202610715150.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-22
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]针对现有技术中高分辨率遥感影像大规模处理的计算开销大、多边形闭合失败、拓扑不一致、三维模型结构失真等影响建筑重建精准度的问题,本申请提供一种基于轻量化角点-边关系推理的屋顶结构LoD2三维重建方法,能够轻量化高分辨率遥感影像的规模化处理、提高角点与边的预测精度以及多边形拓扑一致性
1.本申请通过设置角点预测分支对目标建筑融合特征的各空间位置进行二分类或概率估计,生成角点置信图,再通过设置边关系预测分支基于同一目标建筑融合特征提取顶点对之间的结构关联关系,从而生成边邻接关系矩阵,通过角点置信图和边邻接关系矩阵的联合推理,能够同时得到候选屋顶顶点位置集合和候选顶点之间的连接拓扑关系,再基于角点置信图和边邻接关系矩阵进行顺序角点解码以确定顶点顺序和连接拓扑,在几何约束条件下完成平面图构建与多边形化处理,构建屋顶平面矢量结构,并配合高程信息进行LoD2三维建模,相较于仅输出平行角点或边预测结果的方式,本申请通过降低多边形无序、闭合失败和拓扑不一致的概率,来提高角点与边的预测精度及多边形拓扑一致性。
Smart Images

Figure CN122597702A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of building 3D reconstruction, and in particular to a roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning. Background Technology
[0002] Existing methods for 3D reconstruction of urban buildings mainly include LiDAR-based, photogrammetric, multi-view stereo reconstruction, and deep learning segmentation. Traditional multi-view stereo reconstruction can generate dense point clouds, but its output is usually an unstructured representation, which has problems such as high storage costs, poor editability, and difficulty in directly connecting with CAD / GIS workflows. It is difficult to meet the needs of smart cities, digital twins, and urban surveying for structured building models.
[0003] In roof structure reconstruction scenarios, corner points are key structural primitives for forming roof boundaries, establishing roof planar topological relationships, and completing regular polygon reconstruction. However, traditional corner detection methods such as Harris, FAST, and SIFT are easily affected by shadows, occlusions, repeated textures, and weak texture areas in complex roof images, resulting in unstable corner point localization, significant false positives and false negatives, and difficulty in directly using them for the structured representation of complex roofs.
[0004] While existing deep learning-based structured reconstruction methods can improve the accuracy of corner and edge prediction, they still generally suffer from two prominent problems: First, the model structure is too heavy, resulting in high computational overhead, which is not conducive to large-scale processing of high-resolution remote sensing images; second, many methods rely on grid boundaries or segmentation masks to indirectly infer polygon vertices, lacking explicit modeling of vertex ordering and edge connectivity, which can easily lead to polygon closure failure, topological inconsistencies, and distortion of the 3D model structure. Summary of the Invention
[0005] To address the problems affecting the accuracy of building reconstruction, such as high computational cost, polygon closure failure, topological inconsistency, and 3D model structural distortion in existing technologies for large-scale processing of high-resolution remote sensing images, this application provides a LoD2 3D reconstruction method for roof structures based on lightweight corner-edge relationship reasoning. This method can reduce the scaled processing of high-resolution remote sensing images, improve the prediction accuracy of corners and edges, and enhance polygon topological consistency.
[0006] The above-mentioned inventive objective of this application is achieved through the following technical solutions: A LoD2 3D reconstruction method for roof structures based on lightweight corner-edge relationship reasoning, the method comprising: Acquire target building image data and extract target building fusion features, calculate corner confidence based on the target building fusion features, generate corresponding corner confidence maps by combining the spatial location mapping of the target building image, and filter candidate corners based on the corner confidence maps to obtain a candidate corner set; Based on the features of candidate corner points, the confidence value between two candidate corner points that have a structural relationship in the candidate corner point set is calculated, and an edge adjacency relationship matrix is constructed based on the confidence value calculation results; By combining the candidate corner point set and the edge adjacency matrix, the roof vertices are predicted. Based on the prediction results, the relevant candidate corner points are decoded sequentially, and a roof plan is constructed and polygonized under geometric constraints to obtain the roof plan vector structure. The elevation information of the roof planar vector structure is obtained, and LoD2 modeling is performed based on the elevation information and the roof planar vector structure to generate a LoD2 three-dimensional roof structure model with real spatial coordinates and structural topological relationships.
[0007] In a preferred embodiment, this application can be further configured as follows: acquiring target building image data and extracting target building fusion features, calculating corner confidence based on the target building fusion features, generating a corresponding corner confidence map by combining the target building image spatial location mapping, and filtering candidate corners based on the corner confidence map to obtain a candidate corner set, specifically including: Based on the target building fusion features, corner confidence is calculated for each spatial location, and corresponding confidence convolution mapping is performed according to the spatial location of the target building image to construct a corner confidence map; Activate the corner confidence map, filter candidate corners on the corner confidence map according to the preset corner confidence threshold, and perform local maximum suppression processing on the filtered candidate corners to obtain a set of candidate corners.
[0008] In a preferred embodiment, this application can be further configured as follows: Based on the candidate corner features, calculating the confidence value between two candidate corners in the candidate corner set that have a structural relationship, and constructing an edge adjacency matrix based on the confidence value calculation result, specifically includes: Obtain the candidate corner features from the candidate corner set, and analyze whether there is a structural relationship between the candidate corners based on the candidate corner features. The candidate corner features include local features, global fusion features, or vertex pair combination features. Based on the analysis results, the confidence value between two candidate corner points that have a structural relationship is calculated, and an edge adjacency matrix is constructed based on the confidence value.
[0009] In a preferred embodiment, this application can be further configured as follows: the roof vertices are predicted by jointly using the candidate corner point set and the edge adjacency matrix; based on the prediction results, relevant candidate corner points are sequentially decoded; and a roof plan view and polygonization processing are performed under geometric constraints to obtain the roof plan vector structure. Specifically, this includes: By combining the candidate corner point set and the edge adjacency matrix, the roof vertex positions and vertex pair connection topology are inferred and predicted to obtain the candidate roof vertex position set and vertex pair connection topology. A connection graph between candidate roof vertices is established based on the set of candidate roof vertex locations and the topological relationship of vertex pairs. Starting with high-confidence candidate corner points or height number corner points, adjacent vertices are traversed sequentially according to edge adjacency and local geometric continuity constraints to obtain an ordered vertex sequence. Based on the vertex sequence and the topological relationship of the vertex pairs, a roof plan diagram is constructed and polygonized under geometric constraints to obtain the roof plan vector structure.
[0010] In a preferred embodiment, this application can be further configured such that: the step of establishing a connection graph between candidate roof vertices based on the candidate roof vertex location set and the vertex pair connection topology also includes: When the confidence value between candidate roof vertex pairs is higher than a preset connection threshold, candidate edges are established between the corresponding candidate roof vertex pairs to supplement the connection graph with candidate edges.
[0011] In a preferred embodiment, this application can be further configured as follows: the step of starting with a high-confidence candidate corner point or a height-number corner point, and sequentially traversing adjacent vertices according to edge adjacency relationships and local geometric continuity constraints to obtain an ordered vertex sequence, further includes: When there are multiple candidate adjacent vertices, the comprehensive connection score is calculated based on edge connection confidence, directional continuity, distance constraint, closure constraint and topological legality. The candidate adjacent vertex with the highest comprehensive connection score and satisfying geometric constraints is selected as the next vertex, and an ordered closed vertex sequence is obtained step by step.
[0012] In a preferred embodiment, this application can be further configured as follows: obtaining the elevation information of the roof planar vector structure, performing LoD2 modeling based on the elevation information and the roof planar vector structure, and generating a LoD2 three-dimensional roof structure model with real spatial coordinates and structural topological relationships, specifically includes: Obtain the elevation values of the roof polygon in the roof plane vector structure, and perform multi-directional elevation fitting on the same roof surface to obtain a two-dimensional roof polygon. The building base height is obtained, and a three-dimensional roof surface is mapped by combining the two-dimensional roof polygon. Under the constraints of the building's outer contour and the roof surface, the solid is stretched along the height direction to construct a LoD2 three-dimensional roof structure model.
[0013] In a preferred embodiment, this application can be further configured as follows: the process of acquiring target building image data and extracting target building fusion features, calculating corner confidence based on the target building fusion features, generating a corresponding corner confidence map by combining the target building image spatial location mapping, and filtering candidate corners based on the corner confidence map to obtain the target building fusion features in the candidate corner set specifically includes: Multi-scale convolution processing is performed on the target building image data to extract multi-layer multi-scale features. The multi-layer multi-scale features are then subjected to bidirectional feature fusion processing of forward semantic propagation and reverse geometric feedback to obtain multi-scale fused features. The multi-scale fusion features are subjected to hybrid attention enhancement processing combining channel attention and spatial attention to obtain the target building fusion features.
[0014] In a preferred embodiment, this application can be further configured as follows: the multi-scale convolution processing of the target building image data to extract multi-layer multi-scale features, and the bidirectional feature fusion processing of the multi-layer multi-scale features involving forward semantic propagation and backward geometric feedback to obtain the bidirectional feature fusion processing process in the multi-scale fused features, specifically includes: The first-level features are spatially aligned with the second-level features, and then spliced and fused or element-wise weighted fused with the second-level features to obtain the first intermediate fused features; The first intermediate fusion feature and the third-level feature are spatially scale aligned, and then fused again with the third-level feature to obtain the semantic propagation fusion feature; The semantic propagation fusion feature is subjected to stride convolution or pooling and spatially aligned with the second-level feature, and then fused with the first intermediate fusion feature again to obtain the first geometric enhancement feature; The first geometric enhancement feature and the first-level feature are re-aligned in spatial scale, and then fused again with the first-level feature to obtain a multi-scale fused feature.
[0015] In a preferred embodiment, this application can be further configured as follows: the multi-scale fusion features are subjected to hybrid attention enhancement processing combining channel attention and spatial attention to obtain the target building fusion features, specifically including: The multi-scale fusion features are globally pooled to obtain channel description vectors, and the channel description vectors are convolved and mapped to obtain the channel weight coefficients corresponding to each channel. The channel weight coefficients are multiplied one-to-one with the multi-scale fusion features of the corresponding channels to obtain the channel attention enhancement features after channel recalibration. The channel attention enhancement features are pooled again in the corresponding channel dimension to construct and activate a two-dimensional spatial response map to obtain a spatial weight map. The spatial weight map is multiplied position by position with the channel attention enhancement feature to obtain the target building fusion feature after hybrid attention enhancement.
[0016] In summary, this application includes at least one of the following beneficial technical effects: 1. This application generates a corner confidence map by setting a corner prediction branch to perform binary classification or probability estimation on the spatial locations of the target building's fusion features. Then, it extracts the structural association between vertex pairs based on the same target building's fusion features by setting an edge relationship prediction branch, thereby generating an edge adjacency matrix. Through joint reasoning of the corner confidence map and the edge adjacency matrix, it can simultaneously obtain the set of candidate roof vertex locations and the connection topology between candidate vertices. Then, based on the corner confidence map and the edge adjacency matrix, it performs sequential corner decoding to determine the vertex order and connection topology. Under geometric constraints, it completes the planar map construction and polygonization processing, constructs the roof planar vector structure, and performs LoD2 3D modeling in conjunction with elevation information. Compared with the method of only outputting parallel corner or edge prediction results, this application improves the prediction accuracy of corners and edges and the topological consistency of polygons by reducing the probability of polygon disorder, closure failure, and topological inconsistency.
[0017] 2. Unlike existing technologies that rely on segmentation results to indirectly infer polygon vertices, this solution directly outputs corner confidence and edge connectivity, enabling more stable vertex localization and boundary recovery results in complex roof scenes, with higher accuracy in corner and edge prediction. 3. By decoding sequential corner points and polygonizing geometrically constrained structures, we can obtain roof plan vector structures with better closure, better geometric constraints, and stronger regularity. This has the effect of improving the topological consistency of polygons, thereby enhancing the quality of subsequent 3D modeling. 4. By organically integrating corner detection, roof vectorization, and elevation fitting, the model structure becomes clearer, and LoD2 building models in various formats can be output as needed, making them easy to edit and compatible with CAD / GIS workflows. 5. This application adopts a lightweight CSPDarknet-Light backbone network, combined with bidirectional feature fusion and hybrid attention mechanism, which reduces training and inference overhead while ensuring structural expressiveness, making it more suitable for large-scale processing of high-resolution remote sensing images and achieving lightweight and efficient results. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. The elements or parts in the drawings are not necessarily drawn to scale.
[0019] Figure 1 This is a flowchart illustrating the implementation of the LoD2 3D reconstruction method for the roof structure in this embodiment.
[0020] Figure 2 This is a schematic diagram of the data processing of the LoD2 three-dimensional reconstruction method for the roof structure in this embodiment.
[0021] Figure 3 This is a schematic diagram of the bidirectional feature fusion and hybrid attention enhancement processing in this embodiment.
[0022] Figure 4 This is a schematic diagram of the process for generating and vectorizing roof polygons based on corner-edge relationship reasoning in this embodiment.
[0023] Figure 5 This is a comparison chart of the roof structure LoD2 3D reconstruction method in this embodiment with the traditional roof structure reconstruction and LoD2 modeling effects. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] It should be understood that, when used in this specification, the terms “comprising” and “including” indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0026] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification, unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “the” are intended to include the plural forms.
[0027] It should also be further understood that the term "and / or" as used in this specification refers to any combination of one or more of the associated listed items, as well as all possible combinations, and includes such combinations.
[0028] In one embodiment, this application discloses a LoD2 3D reconstruction method for roof structures based on lightweight corner-edge relationship reasoning, the implementation flowchart of which is shown below. Figure 1 As shown, the data processing diagram is as follows: Figure 2 As shown, the specific steps include the following: S1: Acquire target building image data and extract target building fusion features, calculate corner confidence based on target building fusion features, generate corresponding corner confidence maps by combining target building image spatial location mapping, filter candidate corners based on corner confidence maps, and obtain candidate corner set.
[0029] Specifically, the structural diagram of the bidirectional feature fusion and hybrid attention enhancement processing in this embodiment is as follows: Figure 3 As shown, the process of obtaining the target building fusion features in step S1 specifically includes: S11: Perform multi-scale convolution processing on the target building image data to extract multi-layer multi-scale features. Then, perform bidirectional feature fusion processing on the multi-layer multi-scale features through forward semantic propagation and reverse geometric feedback to obtain multi-scale fused features.
[0030] Specifically, image data of the building to be constructed is acquired through satellite imagery or oblique drone photography. The image data is then subjected to image adjustments such as cropping, brightness adjustment, contrast adjustment, rotation, affine transformation, noise injection, and resolution enhancement or degradation. The adjusted images are then normalized to improve the model's adaptability to different lighting, scale, and imaging conditions, resulting in preprocessed image data.
[0031] The preprocessed image data is input into the lightweight CSPDarknet-Light backbone network. Initial texture encoding is performed on the image data through convolutional stem layers. Subsequently, it undergoes multiple feature extraction stages containing Cross-Stage Partial structures for multi-level feature extraction. By using stride convolution or downsampling operations, the receptive field is gradually expanded and the spatial resolution reduced, thus forming a multi-level feature representation and obtaining multi-level, multi-scale features. In this embodiment, the multi-level, multi-scale features are multi-level feature tensors. Each feature tensor contains spatial and channel dimensions. The spatial dimension represents the positional distribution of the target in the image, while the channel dimension encodes edge responses, corner responses, line segment direction responses, ridge / eave structure responses, and semantic responses of the roof region.
[0032] In one embodiment, the backbone network outputs at least three layers of multi-scale features: the first layer being high-resolution shallow features. The size is This is used to preserve fine-grained geometric information such as roof boundaries, corners, line intersections, and minor structures; the second layer features medium-resolution details. The size is This is used to characterize local roof components, edge connections, and local structural combinations; the third layer is a low-resolution deep feature layer. The size is It is used to characterize the high-level semantic information of buildings / roof areas, complex roof layouts and their global contextual relationships.
[0033] Preferably, at the standard input size, the above three layers of features can be represented as multi-scale feature maps of 52×52×128, 26×26×256, and 13×13×512, respectively. This embodiment uses three-layer multi-scale features as an example.
[0034] Furthermore, bidirectional feature fusion is achieved through top-down semantic propagation and bottom-up geometric feedback fusion to reduce the attenuation of fine-grained features in deep networks. Before feature fusion, 1×1 convolutions are used to align the channels of multi-layer, multi-scale features, ensuring that features at different scales have matching channel dimensions. A top-down semantic propagation path and a bottom-up geometric feedback propagation path are then constructed to perform bidirectional feature fusion processing, specifically including: S111: Align the first-level features with the second-level features in terms of spatial scale, and then perform splicing and fusion or element-wise weighted fusion with the second-level features to obtain the first intermediate fused feature.
[0035] Specifically, low-resolution features are used as the first-level features, medium-resolution features as the second-level features, and high-resolution features as the third-level features. The low-resolution features... Upsampling to Same spatial scale, and with By concatenating or summing element-wise and then performing convolutional fusion, the first intermediate fused feature is obtained. .
[0036] S112: Spatial scale alignment is performed between the first intermediate fusion feature and the third-level feature, and then the feature is fused again with the third-level feature to obtain the semantic propagation fusion feature.
[0037] Specifically, the first intermediate fusion feature Upsampling to the third-level features Same spatial scale, and with third-level features Fusion, resulting in high-resolution fusion features This refers to the semantic propagation fusion feature.
[0038] S113: Perform stride convolution or pooling on the semantic propagation fusion features and re-align them with the spatial scale of the second-level features, and then fuse them again with the first intermediate fusion features to obtain the first geometric enhancement features.
[0039] Specifically, after completing the top-down semantic propagation, the high-resolution fused features are further fused through a bottom-up geometric feedback path. The features are downsampled to a medium resolution scale using stride convolution or pooling and then fused with the first intermediate feature. The layers are then fused again to obtain geometrically enhanced mid-layer features. This refers to the first geometric enhancement feature.
[0040] S114: Align the first geometric enhancement feature with the first level feature in terms of spatial scale again, and then fuse it with the first level feature again to obtain a multi-scale fused feature.
[0041] Specifically, the first geometric enhancement feature Downsampling to a low-resolution scale and comparing with low-resolution deep features Fusion yields low-resolution fused features. This refers to multi-scale fusion features.
[0042] Through the aforementioned dual-path coupling mechanism, the semantic and global contextual information of the roof region in the deep features can be transferred to the shallow high-resolution features, while the boundary, corner, line segment intersection, and weak texture geometric information in the shallow features can also be fed back to the deep features, thus forming a multi-scale fusion feature that combines local geometric sensitivity and global structural discrimination capability. .
[0043] S12: Perform hybrid attention enhancement processing of channel attention and spatial attention on the multi-scale fusion features to obtain the target building fusion features.
[0044] Specifically, to enhance the expressive power of small-scale roof corners and edge structures, multi-scale fusion features are used. Embedded channel attention module (CAM) and spatial attention module (SAM) to generate attention-enhanced features. The details are as follows: S121: Perform global pooling on the multi-scale fusion features to obtain channel description vectors, and perform convolution mapping on the channel description vectors to obtain the channel weight coefficients corresponding to each channel.
[0045] Specifically, global average pooling and / or global max pooling are performed on the multi-scale fusion features to obtain channel description vectors. These channel description vectors are then input into a shared multilayer perceptron or convolutional mapping layer for convolutional mapping to obtain the channel weight coefficients corresponding to each channel.
[0046] S122: Multiply the channel weight coefficients with the corresponding multi-scale fusion features of the channel one by one to obtain the channel attention enhancement features after channel recalibration.
[0047] Specifically, the channel weight coefficients are multiplied one-to-one with the corresponding multi-scale fusion features of each channel to obtain the channel attention enhancement features after channel recalibration. It is used to enhance discriminative channels that are sensitive to corner points, ridge intersections, polygonal endpoints, and boundary abrupt changes, while suppressing non-discriminative channels that have a strong response to homogeneous roof areas, shaded areas, and background noise.
[0048] S123: The channel attention enhancement features are pooled again in the corresponding channel dimension to construct and activate a two-dimensional spatial response map to obtain a spatial weight map.
[0049] Specifically, the channel attention enhancement features are processed by average pooling and / or max pooling in the corresponding channel dimension to construct a two-dimensional spatial response map, which is then subjected to convolutional mapping and... Function activation yields a spatial weighted graph.
[0050] S124: Multiply the spatial weight map and the channel attention enhancement feature position by position to obtain the target building fusion feature after hybrid attention enhancement.
[0051] Specifically, the spatial weight map is multiplied position-by-position with the channel attention enhancement features to obtain the spatially enhanced attention enhancement features. , This approach highlights spatial regions that may contain roof intersections, polygon endpoints, boundary transitions, and ridge junctions, while suppressing large areas of homogeneous roofs, background features, and unstructured edges. The identification of spatial regions potentially containing roof intersections and polygon endpoints is not based on directly specified manual rules. Instead, the network adaptively learns the importance of different spatial locations for corner discrimination tasks through corner and edge connectivity supervision from training samples, generating corresponding spatial weight maps during forward propagation. Finally, through the sequential or cascaded interaction of CAM and SAM, attention-enhanced features that combine channel discrimination enhancement and spatial saliency enhancement are obtained. This is used for the joint prediction of subsequent corner confidence maps and edge adjacency matrices.
[0052] It should be noted that the bidirectional feature pyramid fusion structure in this embodiment can be replaced with other multi-scale feature aggregation structures, and the hybrid attention module can also adopt equivalent channel attention, spatial attention or joint attention implementation methods.
[0053] In this embodiment, the lightweight backbone network can be replaced with other lightweight convolutional backbone networks or lightweight Transformer backbone networks, as long as it can complete multi-scale roof feature extraction.
[0054] Specifically, step S1 includes: S13: Calculate the corner confidence score for each spatial location based on the target building fusion features, and perform corresponding confidence convolution mapping according to the spatial location of the target building image to construct a corner confidence map.
[0055] Specifically, the spatial location corresponding to the fused features of the target building is subjected to binary classification or probability estimation to calculate corner confidence. Then, according to the spatial location of the target building image, the corresponding corner confidence is convolutionally mapped, and the output is a two-dimensional corner confidence map that corresponds one-to-one with the spatial location of the input image. Corner confidence plot The value of each pixel position represents the probability or confidence level that the position is a candidate vertex of the roof. The larger the value, the more likely the position is to be a real corner point.
[0056] S14: Activate the corner confidence map, filter candidate corners according to the preset corner confidence threshold, perform local maximum suppression processing on the selected candidate corners, and obtain a set of candidate corners.
[0057] Specifically, through Function activation corner confidence plot Candidate corner points are selected based on a preset corner point confidence threshold. Those corner points with a confidence level greater than the threshold are selected, and local maximum suppression is applied to the selected corner points to obtain a set of candidate corner points. .
[0058] S2: Based on the features of candidate corner points, calculate the confidence value between two candidate corner points that have a structural relationship in the candidate corner point set, and construct the edge adjacency relationship matrix based on the confidence value calculation results.
[0059] Specifically, step S2 includes: S21: Obtain the candidate corner features in the candidate corner set, and analyze whether there is a structural relationship between the candidate corners based on the candidate corner features. The candidate corner features include local features, global fusion features, or vertex pair combination features. The vertex pair combination features include one or more of the following: local features of two candidate corners, feature differences, spatial distance, line direction angle, and relative coordinate relationship.
[0060] Specifically, the local features, global fusion features, or vertex pair combination features of the candidate corner points are used as inputs to analyze whether there are structural relationships between the candidate corner points, i.e., whether there is a connection topology.
[0061] S22: Calculate the confidence value between two candidate corner points that have a structural relationship based on the analysis results, and construct the edge adjacency relationship matrix based on the confidence value.
[0062] Specifically, the confidence value between two candidate corner points with structural relationships is calculated, and edge connection topology relationships are established for candidate corner points that have obtained a preset connection confidence threshold. The result is then output as an edge adjacency matrix. , where matrix elements Show candidate vertices and Whether there is a roof edge connection relationship or the degree of confidence in the connection.
[0063] S3: Combine the candidate corner point set and the edge adjacency matrix to predict the roof vertices. Based on the prediction results, sequentially decode the relevant candidate corner points and construct the roof plan map and perform polygonization under geometric constraints to obtain the roof plan vector structure.
[0064] Specifically, step S3 includes: S31: Combine the candidate corner point set and the edge adjacency matrix to infer and predict the roof vertex position and vertex pair connection topology, and obtain the candidate roof vertex position set and vertex pair connection topology.
[0065] Specifically, the joint candidate corner set and edge adjacency matrix The positions of roof vertices and the topological relationships of vertex pairs are inferred and predicted. For example, the vertices are selected from the candidate corner points with higher confidence, and the topological relationships between vertices and their adjacent vertices are used as the topological relationships of vertex pairs.
[0066] S32: Establish a connection graph between candidate roof vertices based on the set of candidate roof vertex locations and the topological relationship of vertex pair connections.
[0067] Specifically, based on the set of candidate roof vertex locations and the topological relationships connecting vertex pairs, a connection graph is established between candidate roof vertices. Furthermore, if the confidence value between candidate roof vertex pairs is higher than the preset connection threshold, candidate edges are established between the corresponding candidate roof vertex pairs to supplement the connection graph with candidate edges.
[0068] S33: Starting with a high-confidence candidate corner or a corner with a high number of heights, traverse adjacent vertices sequentially according to edge adjacency and local geometric continuity constraints to obtain an ordered vertex sequence.
[0069] Specifically, starting with a high-confidence candidate corner or a key corner with a high height number, the adjacent vertices near the starting vertex are traversed sequentially according to edge adjacency and local geometric continuity constraints to obtain an ordered vertex sequence. Further, when multiple candidate adjacent vertices exist, a comprehensive connection score is calculated based on edge connection confidence, directional continuity, distance constraints, closure constraints, and topological legality. The candidate adjacent vertex with the highest comprehensive connection score and satisfying the geometric constraints is selected as the next vertex, gradually obtaining an ordered closed vertex sequence. In this embodiment, adjacent vertices with small changes in the angle between their direction and the current edge, high edge connection confidence, and satisfying geometric constraints are preferentially selected as the next vertex, thus obtaining an ordered closed vertex sequence.
[0070] S34: Based on the vertex sequence and vertex pair connection topology, construct the roof plan diagram and perform polygonization under geometric constraints to obtain the roof plan vector structure.
[0071] Specifically, based on the vertex sequence and the topological relationship connecting vertex pairs, a roof plan is constructed and polygonized under geometric constraints. The geometric constraints must include at least one of the following: (1) Collinear constraint: If the direction difference of several consecutive edge segments is less than the preset angle threshold, and the distance from their endpoints to the same straight line is less than the preset distance threshold, then the corresponding vertices are considered collinear, and edge segments are merged or intermediate redundant points are eliminated. (2) Orthogonal constraint: For a near-vertical side in the roof of a regular building, if the included angle between the two sides is close to 90° or 180°, its direction is adjusted to be orthogonal or parallel to improve the regularity of the roof outline. (3) Geometric consistency constraint: The polygon generated by the constraint satisfies the following conditions: closure, non-self-intersection of boundaries, continuous connection of adjacent edges, consistent vertex order, and overall consistency with the original corner / edge prediction results.
[0072] Through the above sequential decoding and constraint optimization, a regularized roof planar vector structure is obtained, which serves as the two-dimensional basis for subsequent LoD2 3D modeling. The flowchart for roof polygon generation and vectorization based on corner-edge relationship reasoning in this embodiment is as follows: Figure 4 As shown.
[0073] S4: Obtain the elevation information of the roof plan vector structure, perform LoD2 modeling based on the elevation information and the roof plan vector structure, and generate a LoD2 three-dimensional roof structure model with real spatial coordinates and structural topological relationships.
[0074] Specifically, step S4 includes: S41: Obtain the elevation values of the roof polygon in the roof plane vector structure, perform multi-directional elevation fitting on the same roof surface, and obtain a two-dimensional roof polygon. Specifically, the roof planar vector structure is matched with the height information in DSM, DTM, nDSM, laser point cloud, stereo matching results or existing geographic databases to obtain the elevation values corresponding to the vertices and boundaries. The roof vertices are assigned initial height attributes, and multi-directional fitting processes such as planar fitting, segmented height fitting or average elevation fitting are performed on the same roof surface to obtain a two-dimensional roof polygon.
[0075] It should be noted that the height information in this embodiment can be provided by any one or more of DSM, DTM, LiDAR point cloud, stereo matching results, or existing GIS geographic databases.
[0076] S42: Obtain the building base height, combine the two-dimensional roof polygon to perform three-dimensional roof surface mapping, and stretch the solid along the height direction under the constraints of the building's outer contour and the roof surface to construct a LoD2 three-dimensional roof structure model.
[0077] Specifically, the building base height is determined based on ground elevation information. The roof elevation parameters and the building base height are mapped to a three-dimensional space to perform three-dimensional top surface modeling. Under the constraints of the building outline and the roof surface, solid extrusion is performed along the height direction to generate the walls and the main building body, resulting in a LoD2 level three-dimensional building model with real spatial coordinates and structural topological relationships.
[0078] In this embodiment, the generated LoD2 level 3D building model undergoes redundant point removal, geometric constraint optimization, and structural consistency correction, and is output as required in CityGML, OBJ, Shapefile, or other CAD / GIS-compatible formats.
[0079] Specifically, redundant point removal includes: determining the distance between adjacent vertices in the polygon vertex sequence; if the distance between two adjacent vertices is less than a preset distance threshold, they are considered duplicate points or near-duplicate points and merged; if a vertex is approximately collinear with its two adjacent sides, and the distance from the vertex to the straight line formed by the two adjacent points is less than a preset threshold, the vertex is identified as a redundant turning point and deleted; if multiple consecutive edge segments have basically the same direction, they are merged into a single edge segment and the intermediate redundant vertices are deleted. Geometric constraint optimization includes: regularizing the edge directions to adjust the edges that satisfy the prior knowledge of the building structure to parallel, perpendicular, or approximately collinear relationships; fine-tuning the vertex positions to ensure that the corrected vertices maintain the original prediction results as much as possible while satisfying boundary closure and local geometric consistency; and uniformly correcting the polygon side lengths, included angles, and intersection positions to reduce jagged edges, short edges, and local distortion phenomena. Structural consistency correction includes checking whether the generated polygons are closed, whether they self-intersect, whether they have duplicate edges, whether they have overhanging edges, and whether there are unreasonable gaps or overlaps between adjacent roof surfaces. For structures with topological anomalies, correction is preferably performed by reordering vertices, deleting abnormal edges, merging common edges, completing missing connections, and unifying the shared vertex coordinates of adjacent surfaces. After completing the 2D polygon optimization, the roof planar vector structure and height information are jointly modeled to obtain a LoD2 3D roof structure model; and output in CityGML, OBJ, Shapefile, or other CAD / GIS-compatible formats according to application requirements.
[0080] In a preferred embodiment, a bidirectional feature pyramid fusion structure is used to simultaneously preserve shallow geometric details and deep semantic consistency, thereby reducing the loss of fine-grained corner information caused by conventional unidirectional feature fusion. Hybrid attention enhancement employs a cascaded or embedded combination of channel attention modules and spatial attention modules to improve the recognition ability of occluded areas, weakly textured areas, and densely connected roof areas in complex urban environments. Sequential corner decoding is used to explicitly model vertex ordering relationships, which, compared to methods that only output parallel corner or edge prediction results, can reduce polygon disorder, closure failure, and topological inconsistency problems. A comparison of the results with traditional roof structure reconstruction and LoD2 modeling in this embodiment is shown in the figure below. Figure 5 As shown.
[0081] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0082] Those skilled in the art will recognize that the units of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application of the technical solution and the constraints involved. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of the invention.
[0083] In the embodiments provided by the present invention, it should be understood that the division of units is only a logical functional division. In actual implementation, there may be other division methods, such as multiple units can be combined into one unit, one unit can be split into multiple units, or some features can be ignored.
[0084] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0085] If the integrated unit is implemented as 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 invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A method for LoD2 3D reconstruction of roof structures based on lightweight corner-edge relationship reasoning, characterized in that, The method includes: Acquire target building image data and extract target building fusion features, calculate corner confidence based on the target building fusion features, generate corresponding corner confidence maps by combining the spatial location mapping of the target building image, and filter candidate corners based on the corner confidence maps to obtain a candidate corner set; Based on the features of candidate corner points, the confidence value between two candidate corner points that have a structural relationship in the candidate corner point set is calculated, and an edge adjacency relationship matrix is constructed based on the confidence value calculation results; By combining the candidate corner point set and the edge adjacency matrix, the roof vertices are predicted. Based on the prediction results, the relevant candidate corner points are decoded sequentially, and a roof plan is constructed and polygonized under geometric constraints to obtain the roof plan vector structure. The elevation information of the roof planar vector structure is obtained, and LoD2 modeling is performed based on the elevation information and the roof planar vector structure to generate a LoD2 three-dimensional roof structure model with real spatial coordinates and structural topological relationships.
2. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 1, characterized in that, The process of acquiring target building image data and extracting target building fusion features, calculating corner confidence based on the target building fusion features, generating a corresponding corner confidence map by combining the target building image spatial location mapping, and filtering candidate corners based on the corner confidence map to obtain a candidate corner set specifically includes: Based on the target building fusion features, corner confidence is calculated for each spatial location, and corresponding confidence convolution mapping is performed according to the spatial location of the target building image to construct a corner confidence map; Activate the corner confidence map, filter candidate corners on the corner confidence map according to the preset corner confidence threshold, and perform local maximum suppression processing on the filtered candidate corners to obtain a set of candidate corners.
3. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 1, characterized in that, The process of calculating the confidence value between two candidate corners with structural relationships in the candidate corner set based on candidate corner features, and constructing an edge adjacency matrix based on the confidence value calculation results, specifically includes: Obtain the candidate corner features from the candidate corner set, and analyze whether there is a structural relationship between the candidate corners based on the candidate corner features. The candidate corner features include local features, global fusion features, or vertex pair combination features. Based on the analysis results, the confidence value between two candidate corner points that have a structural relationship is calculated, and an edge adjacency matrix is constructed based on the confidence value.
4. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 1, characterized in that, The method involves jointly predicting roof vertices using the candidate corner point set and the edge adjacency matrix, sequentially decoding relevant candidate corner points based on the prediction results, and constructing a roof plan map and performing polygonization under geometric constraints to obtain the roof plan vector structure. Specifically, this includes: By combining the candidate corner point set and the edge adjacency matrix, the roof vertex positions and vertex pair connection topology are inferred and predicted to obtain the candidate roof vertex position set and vertex pair connection topology. A connection graph between candidate roof vertices is established based on the set of candidate roof vertex locations and the topological relationship of vertex pairs. Starting with high-confidence candidate corner points or height number corner points, adjacent vertices are traversed sequentially according to edge adjacency and local geometric continuity constraints to obtain an ordered vertex sequence. Based on the vertex sequence and the topological relationship of the vertex pairs, a roof plan diagram is constructed and polygonized under geometric constraints to obtain the roof plan vector structure.
5. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 4, characterized in that, The step of establishing a connection graph between candidate roof vertices based on the candidate roof vertex location set and the vertex pair connection topology also includes: When the confidence value between candidate roof vertex pairs is higher than a preset connection threshold, candidate edges are established between the corresponding candidate roof vertex pairs to supplement the connection graph with candidate edges.
6. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 4, characterized in that, The process of starting with high-confidence candidate corner points or height-number corner points, and sequentially traversing adjacent vertices according to edge adjacency relationships and local geometric continuity constraints to obtain an ordered vertex sequence, further includes: When there are multiple candidate adjacent vertices, the comprehensive connection score is calculated based on edge connection confidence, directional continuity, distance constraint, closure constraint and topological legality. The candidate adjacent vertex with the highest comprehensive connection score and satisfying geometric constraints is selected as the next vertex, and an ordered closed vertex sequence is obtained step by step.
7. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 1, characterized in that, The process of obtaining the elevation information of the roof planar vector structure, performing LoD2 modeling based on the elevation information and the roof planar vector structure, and generating a LoD2 three-dimensional roof structure model with realistic spatial coordinates and structural topological relationships specifically includes: Obtain the elevation values of the roof polygon in the roof plane vector structure, and perform multi-directional elevation fitting on the same roof surface to obtain a two-dimensional roof polygon. The building base height is obtained, and a three-dimensional roof surface is mapped by combining the two-dimensional roof polygon. Under the constraints of the building's outer contour and the roof surface, the solid is stretched along the height direction to construct a LoD2 three-dimensional roof structure model.
8. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 1, characterized in that, The process of acquiring target building image data and extracting target building fusion features, calculating corner confidence based on the target building fusion features, generating a corresponding corner confidence map by combining the target building image spatial location mapping, and filtering candidate corners based on the corner confidence map to obtain the target building fusion features in the candidate corner set specifically includes: Multi-scale convolution processing is performed on the target building image data to extract multi-layer multi-scale features. The multi-layer multi-scale features are then subjected to bidirectional feature fusion processing of forward semantic propagation and reverse geometric feedback to obtain multi-scale fused features. The multi-scale fusion features are subjected to hybrid attention enhancement processing combining channel attention and spatial attention to obtain the target building fusion features.
9. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 8, characterized in that, The process of performing multi-scale convolution processing on the target building image data to extract multi-layer multi-scale features, and then performing bidirectional feature fusion processing on these multi-layer multi-scale features through forward semantic propagation and backward geometric feedback to obtain the bidirectional feature fusion process in the multi-scale fused features, specifically includes: The first-level features are spatially aligned with the second-level features, and then spliced and fused or element-wise weighted fused with the second-level features to obtain the first intermediate fused features; The first intermediate fusion feature and the third-level feature are spatially scale aligned, and then fused again with the third-level feature to obtain the semantic propagation fusion feature; The semantic propagation fusion feature is subjected to stride convolution or pooling and spatially aligned with the second-level feature, and then fused with the first intermediate fusion feature again to obtain the first geometric enhancement feature; The first geometric enhancement feature and the first-level feature are re-aligned in spatial scale, and then fused again with the first-level feature to obtain a multi-scale fused feature.
10. The roof structure LoD2 3D reconstruction method based on lightweight corner-edge relationship reasoning according to claim 8, characterized in that, The process of performing hybrid attention enhancement processing (channel attention and spatial attention) on the multi-scale fusion features to obtain the target building fusion features specifically includes: The multi-scale fusion features are globally pooled to obtain channel description vectors, and the channel description vectors are convolved and mapped to obtain the channel weight coefficients corresponding to each channel. The channel weight coefficients are multiplied one-to-one with the multi-scale fusion features of the corresponding channels to obtain the channel attention enhancement features after channel recalibration. The channel attention enhancement features are pooled again in the corresponding channel dimension to construct and activate a two-dimensional spatial response map to obtain a spatial weight map. The spatial weight map is multiplied position by position with the channel attention enhancement feature to obtain the target building fusion feature after hybrid attention enhancement.