A priori information guided rural courtyard vector contour extraction method

By constructing a multimodal feature extraction module and a polygon optimization algorithm based on structural priors, the problems of boundary adhesion and false positives/false negatives in rural courtyard extraction were solved, and high-precision vector contour generation was achieved.

CN123160907APending Publication Date: 2026-11-24CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611385880.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing rural courtyard extraction techniques suffer from boundary adhesion, false positives and false negatives when dealing with densely packed layouts and areas with similar textures. They also perform poorly in environments with shadows from tall buildings and tree cover. Furthermore, multimodal fusion methods fail to fully utilize elevation information.

Method used

A multimodal feature extraction module is constructed. Through feature fusion of optical images and digital surface models, initial contour lines are generated using corner detection and line segment filters. Combined with a polygon optimization algorithm based on structural priors, closed vector contours of individual courtyard units are generated.

Benefits of technology

It improves the accuracy of courtyard contour extraction, solves the problems of boundary adhesion and false detection/missed detection, reduces the number of network parameters, and achieves efficient vector contour generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention discloses a method for extracting the vector contours of rural courtyards guided by prior information, relating to the fields of remote sensing image processing and computer vision. It comprises four parts: a multimodal feature extraction module, a contour initialization module, a courtyard polygon extraction module, and a courtyard polygon optimization algorithm. First, the multimodal feature extraction module extracts multimodal fusion features from optical images and a digital signal processing (DSM). Second, the contour initialization module predicts courtyard corner points, connects these corner points into lines, and filters them to obtain an initial set of contour lines. Subsequently, the courtyard polygon extraction module filters the initial contour lines to obtain initial courtyard polygons. Finally, the courtyard polygon optimization algorithm performs topology optimization and edge completion on the initial courtyard polygons to obtain closed vector contours of individual courtyard units. This invention effectively solves the problems of boundary adhesion and false positives / missed negatives in dense courtyard scenes using existing methods, ensuring the geometric integrity and regularity of the courtyard vector contours.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of remote sensing image processing and computer vision technology, and more specifically, to a method for extracting the vector contours of rural courtyards guided by prior information. Background Technology

[0002] The need for detailed surveys of the current land use status of rural homesteads and courtyards is becoming increasingly urgent. Unlike urban buildings with their standardized layouts and clear intervals, rural courtyards in northern China are characterized by their dense layout, shared boundaries, similar textures inside and outside the courtyard, and vegetation occlusion. Existing courtyard extraction technologies are mainly divided into pixel-based semantic segmentation methods and bounding box-based detection methods, but both have limitations in practical applications: On the one hand, pixel-based semantic segmentation methods generate binary masks by classifying pixels one by one, which easily leads to boundary adhesion problems when dealing with dense courtyards, making it impossible to distinguish adjacent individual courtyards. In addition, its output is raster data, requiring complex post-processing to generate the vector format required for production; on the other hand, bounding box-based detection methods can distinguish individual courtyards to some extent by introducing bounding box detection, but horizontal or rotated bounding boxes can only provide a rough range of the courtyard and cannot accurately depict the courtyard boundaries.

[0003] Furthermore, current courtyard extraction methods primarily rely on optical imagery, which performs poorly in environments with tall building shadows or tree occlusion. Digital spatial modeling (DSM) can provide the height difference between walls and the ground, thus reducing the interference of shadows and tree occlusion on courtyard extraction. However, existing multimodal fusion methods, when incorporating DSM, mostly employ simple channel stitching or feature addition. This approach ignores the inherent physical and geometric meaning of DSM, fails to fully exploit the potential of elevation information in assisting boundary localization, and is therefore inefficient. Summary of the Invention

[0004] To address the aforementioned problems, this invention provides a method for extracting the vector contours of rural courtyards guided by prior information. The method involves constructing a multimodal feature extraction module to obtain robust multimodal fusion features; constructing a contour initialization module to obtain an initial contour set; constructing a courtyard polygon extraction module to obtain initial courtyard polygons; and finally designing a courtyard polygon optimization algorithm based on structural priors to obtain the closed vector contours of individual courtyard units.

[0005] The technical solution of the present invention is as follows:

[0006] A method for extracting the vector contour of rural courtyards guided by prior information includes the following steps:

[0007] Step 1: Construct a multimodal feature extraction module to extract multimodal fusion features from optical images and digital surface models (DSMs);

[0008] Step 2: Construct a contour line initialization module. Use a corner detector to extract courtyard corners based on the multimodal fusion features described in Step 1. Combine the courtyard corners in pairs to obtain a candidate line set. Then, use a line segment filter to roughly screen the candidate lines to obtain an initial contour line set.

[0009] Step 3: Construct a courtyard polygon extraction module, use the line segment refiner to finely filter the initial outline set described in Step 2, and then use the polygon builder to obtain the initial courtyard polygon;

[0010] Step 4: Design a courtyard polygon optimization algorithm based on structural priors to perform topology optimization and edge completion on the initial courtyard polygon described in Step 3, and obtain the closed vector contour of the courtyard unit.

[0011] In this invention, the multimodal feature extraction module in step 1 includes an optical semantic feature encoding branch, a deep geometric feature encoding branch, and a gated feature fusion unit. The optical semantic feature encoding branch utilizes a convolutional neural network to extract multi-scale optical semantic features from optical images. , means as follows:

[0012]

[0013] in, and Indicates the length and width of the input image. Indicates the first The number of channels in a scale feature map.

[0014] The deep geometric feature encoding branch first uses the Sobel operator to calculate the gradient features of the DSM in the x and y directions, and then concatenates them with the z-direction component features, which are always 1, in the channel dimension. Physical prior information is obtained after normalization. Simultaneously, a convolutional module is used to extract shallow geometric features of the DSM. and deep geometric features Then physical priors With features Concatenation as query vector, features With features The concatenated vectors, serving as both key and value vectors, are fed into a cross-attention module for feature interaction, yielding initial depth geometric features. Finally, bilinear interpolation is used to sample these initial depth geometric features, resulting in multi-scale depth geometric features. , means as follows:

[0015]

[0016] in, and Indicates the length and width of the input image. Indicates the first The number of channels in a scale feature map.

[0017] Gated feature fusion device utilizes features Generate gate weights and And calculate depth confidence. Features are fused in the following way With features Output multimodal fusion features :

[0018]

[0019] in, This represents element-wise multiplication of feature maps.

[0020] In this invention, the specific process of the contour initialization module in step 2 is as follows: First, the corner detector uses a deformable Transformer encoder to initialize the features described in step 1. Enhancement is performed to obtain encoded features containing global context information; then, the encoded features are fed into the deformable Transformer decoder, and the corner features are aggregated using a cross-attention mechanism to obtain the decoded feature vector; the feature vector is upsampled and outputs a corner probability heatmap, and the local maxima points in the heatmap are taken as the courtyard corners;

[0021] Secondly, the candidate line sets are obtained by pairwise combining the corner points of the courtyard. ;

[0022] Finally, the segment filter introduces a length threshold. Set of rejection lines The excessively long line segment; concatenate the position feature vectors of the two endpoints of the remaining line segment as the query vector, and use the features described in step 1. After being enhanced by the deformable Transformer encoder, the resulting value vector is fed into the deformable Transformer decoder for interaction, aggregating contextual information near the line segment; the feature vector output by the decoder... After processing by a multilayer perceptron and the Softmax function, the confidence scores of the line segments are obtained. Invalid candidate lines with low confidence scores are filtered out, and line segments with high confidence scores are retained as the initial set of contour lines. .

[0023] In this invention, the courtyard polygon extraction module in step 3 includes a line segment refiner and a polygon builder. The line segment refiner is built based on the DAB-DETR model and includes a deformable Transformer encoder, an image-aware decoder, and a geometric constraint decoder; it extracts the contour line set described in step 2. As a location query vector The vector As a content query vector The line segment is fed to the line segment refiner for fine screening of the contour line set. The filtered line segments are fed into the polygon builder to obtain the initial courtyard polygon.

[0024] The image-aware decoder comprises six stacked layers, each consisting of a self-attention layer and a cross-attention layer; firstly, in the self-attention layer, the vectors are... sum vector The summed query vector and key vector are used as inputs, and the vectors are then... The input vector serves as the value vector; the output features of the self-attention layer are connected to the input via skip connections. After addition and layer normalization, we get Then, the features As a query vector, the feature described in claim 2 After being enhanced by a deformable Transformer encoder, the vector is fed into a cross-attention layer for interaction. The center point of the line segment is used as a reference point to guide the decoder to focus on key features near the line segment. Finally, the decoder's output is passed through a multilayer perceptron to output the category score of the line segment. .

[0025] The structure of the geometric constraint decoder is similar to that of the image-aware decoder, using the same set of contour lines. They share the same network architecture and parameters, and only retain the self-attention layer in the decoder to explicitly model the geometric relationships of line segments such as collinearity, parallelism, and adjacency. The geometric reasoning ability of the image perception decoder is enhanced through the parameter sharing mechanism.

[0026] Finally, the category scores are calculated. The data is fed into the polygon builder, where it is processed by the Softmax function to obtain the line segment confidence scores. Line segments with a confidence score greater than 0.5 are retained to obtain the initial courtyard polygons.

[0027] In this invention, the specific process of the courtyard polygon optimization algorithm based on structural priors in step 4 is as follows: Based on the initial courtyard polygon constructed in step 3, a line adjacency matrix is ​​created. A polygon optimization algorithm is then used to search all closed loops in all adjacency matrices, locating isolated line segments not in closed loops and their endpoints. Then, the distance between the two endpoints of the isolated line segments is calculated. And construct the distance matrix between the endpoints of the isolated line segment and the adjacent points. Finally, calculate the above. Each distance value and If the difference satisfies the preset threshold condition and the isolated edge line satisfies the high confidence and topological connection quantity constraints, then edge lines are added between the corner point pairs corresponding to the difference to generate a closed courtyard unit vector outline.

[0028] Compared with the prior art, the advantages of the present invention are:

[0029] (1) This invention provides a method for extracting courtyard vector contours guided by prior information. This method does not rely on traditional pixel segmentation and coarse target box localization, effectively solving the problems of boundary adhesion in scenes with closely arranged courtyards and false detection and missed detection in areas with similar textures, thereby improving the extraction accuracy of courtyard contours.

[0030] (2) This invention designs a multimodal feature extraction module based on physical priors. It uses convolutional networks to extract multi-scale optical semantic features of optical images, extracts multi-scale depth geometric features of digital surface models based on physical priors, and introduces a gated feature fusion unit to adaptively fuse semantic and geometric features, thereby reducing the number of network parameters.

[0031] (3) This invention designs a courtyard polygon optimization algorithm based on structural priors. It uses the common structural characteristics and distribution patterns of courtyards to automatically locate and complete the missed edges, and outputs the closed vector contour of the courtyard unit. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the process of the present invention.

[0033] Figure 2 This is a schematic diagram of the multimodal feature extraction module of the present invention.

[0034] Figure 3 This is a schematic diagram of the deep geometric feature encoding branch of the present invention.

[0035] Figure 4 This is a schematic diagram of the courtyard polygon extraction module of the present invention.

[0036] Figure 5 This is a flowchart illustrating the courtyard polygon optimization algorithm of the present invention. Detailed Implementation

[0037] The embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0038] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0039] It should be noted that the terminology used herein is for describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. Unless otherwise specified, embodiments and features within these embodiments may be combined with each other.

[0040] This invention provides a method for extracting the vector contours of rural courtyards guided by prior information. For example... Figure 1 As shown, the method comprises four parts: a multimodal feature extraction module, a contour initialization module, a courtyard polygon extraction module, and a courtyard polygon optimization algorithm. First, the multimodal feature extraction module extracts semantic and geometric features from optical images and DSM respectively and fuses them. Second, the contour initialization module predicts courtyard corner points and combines them to obtain a candidate line set, which is then filtered to obtain an initial contour line set. Next, the courtyard polygon extraction module uses a line segment refiner containing a geometric constraint decoder and an image-aware decoder to filter the initial contour lines, and obtains the initial courtyard polygons through a polygon builder. Finally, the courtyard polygon optimization algorithm supplements missed edge lines based on the adjacency relationships between courtyard lines, outputting a closed courtyard unit vector contour.

[0041] Step 1: Construct a multimodal feature extraction module to extract multimodal fusion features from optical images and DSM. For example... Figure 2 As shown, the multimodal feature extractor comprises three parts: an optical semantic feature encoding branch, a deep geometric feature encoding branch, and a gated feature fusion unit.

[0042] The optical semantic feature encoding branch utilizes a ResNet-50 convolutional neural network to extract multi-scale optical semantic features. Specifically, the input image is a [image size missing]. RGB images were used to obtain multi-scale optical semantic features. , means as follows:

[0043]

[0044] in, and Indicates the length and width of the input image. Indicates the first The number of channels in a scale feature map.

[0045] The structure of the deep geometric feature encoding branch is as follows: Figure 3 As shown. First, the gradient features of the DSM in the x and y directions are calculated using the Sobel operator, and then concatenated with the z-direction component features (which are always 1) in the channel dimension. Physical prior information is obtained after normalization. Simultaneously, a convolutional module is used to extract shallow geometric features of the DSM. and deep geometric features Next, the physical priors With features Concatenation is used as the query vector to extract features. With features The concatenated vectors, serving as key and value vectors, are fed into a cross-attention module for feature interaction to obtain initial depth geometric features. Finally, bilinear interpolation is used to sample the initial depth geometric features to obtain multi-scale depth geometric features. .

[0046]

[0047] in, and Indicates the length and width of the input image. Indicates the first The number of channels in a scale feature map.

[0048] The gated feature fusion unit is used to implement semantic features. and geometric features Adaptive fusion. First, based on semantic features. Generate modal weights graph and Each weighted graph is composed of features The result is obtained after processing with two layers of 1×1 convolution and the Sigmoid function; subsequently, this example introduces a depth confidence factor. To suppress noise interference in the DSM; this confidence factor is composed of features The results are obtained after global average pooling, two layers of 1×1 convolution, and processing with the sigmoid function. Finally, weighted fusion is performed using the following formula to output the multimodal fusion features. :

[0049]

[0050] in, This represents element-wise multiplication of feature maps.

[0051] Step 2: Construct the contour initialization module. First, this step is based on the fusion features obtained in Step 1. Extract the corner points of the courtyard and combine them to obtain a set of candidate lines. Then, a line segment filter is introduced to filter out invalid candidate lines to obtain the initial contour line set. .

[0052] First, the corner detector will use the fused features obtained in step 1. As input, the corner features are enhanced using a deformable Transformer encoder to obtain encoded features containing global context information. Then, the encoded features are fed into a deformable Transformer decoder, where a cross-attention mechanism is used to aggregate corner features, resulting in a decoded feature vector. Next, the feature vector is upsampled to output a corner probability heatmap, with local maxima points in the heatmap used as courtyard corners. Finally, the corners are paired to obtain a set of candidate lines. .

[0053] Line segment filters are used to filter line sets. Invalid lines. First, introduce a length threshold. In the set of rejection lines The excessively long line segment; then, the position feature vectors of the two endpoints of the remaining line segment are concatenated as the query vector, and the fused features obtained in step 1 are used. The features are enhanced by a deformable Transformer encoder; the enhanced features, as a value vector, are fed into a deformable Transformer decoder for interaction, aggregating contextual information near the line segment; finally, the decoder outputs a feature vector. After processing by a multilayer perceptron and the Softmax function, the confidence scores of the line segments are obtained. Invalid candidate lines with low confidence scores are filtered out, and line segments with high confidence scores are retained as the initial set of contour lines. .

[0054] Step 3: Construct a polygon extraction module for the courtyard and filter the set of outlines obtained in Step 2. This yields the initial courtyard polygon.

[0055] like Figure 4 As shown, the courtyard polygon extraction module consists of a line segment refiner and a polygon builder; the line segment refiner is built based on the DAB-DETR model, including a deformable Transformer encoder, an image-aware decoder, and a geometric constraint decoder, with the two decoders sharing the network architecture and parameters; the contour line set obtained in step 2 is then processed. As a location query vector The vector obtained in step 2 As a content query vector The lines are fed to the line segment refiner to filter the initial outlines; then, the filtered outlines are fed to the polygon builder to obtain the initial courtyard polygons.

[0056] The image-aware decoder consists of six stacked layers, each composed of a self-attention layer and a cross-attention layer; firstly, in the self-attention layer, the vectors are... sum vector The summed query vector and key vector are used as inputs, and the vectors are then... The input vector serves as the value vector; the output features of the self-attention layer are connected to the input via skip connections. The features are obtained by adding them together and then performing layer normalization. Then, the features As a query vector, the feature described in claim 2 After being enhanced by a deformable Transformer encoder, the vector is fed into a cross-attention layer for interaction. The center point of the line segment is used as a reference point to guide the decoder to focus on key features near the line segment. Finally, the decoder's output is passed through a multilayer perceptron to output the category score of the line segment. .

[0057] The structure of the geometric constraint decoder is similar to that of the image-aware decoder. It uses the same initial set of contour lines, network architecture and shares parameters. It only retains the self-attention layer to model the collinear, parallel and adjacency geometric relationships of line segments. The geometric reasoning ability of the image-aware decoder is enhanced through the parameter sharing mechanism.

[0058] Finally, the category scores are calculated. The data is fed into the polygon builder, where it is processed by the Softmax function to obtain the line segment confidence scores. Line segments with a confidence score greater than 0.5 are retained to obtain the initial courtyard polygons.

[0059] Step 4: Design a courtyard polygon optimization algorithm based on structural priors to complete the initial courtyard polygon described in Step 3, and output the closed vector contour of each courtyard unit, such as... Figure 5 As shown. The specific process is as follows:

[0060] First, based on the initial courtyard polygons obtained in step 3, a courtyard line adjacency matrix is ​​constructed. A polygon optimization algorithm is used to perform a loop search on the adjacency matrix, extracting all closed loops in the adjacency matrix, and determining the edge E that does not belong to any closed loop as an isolated edge.

[0061] Next, let the two endpoints of E be the problem corner pair ( ), calculate corner pairs ( The Euclidean distance d between them. and Let the adjacent corner points be the candidate set: The set of adjacent corner points is { },and The set of adjacent corner points is Based on this, construct the distance matrix. The matrix elements are defined as follows:

[0062]

[0063] in, Indicates Euclidean distance; and These are the two endpoints of the isolated edge line E; Endpoints The set of adjacent corner points, where m is the number of its adjacent corner points; Endpoints The set of adjacent corner points, where n is the number of its adjacent corner points; Let be the distance matrix, and its elements Indicates candidate corner pairs ( (pixel distance).

[0064] Then, further calculations were performed. The difference between each element in the matrix and d. When there are candidate corner pairs ( Make the difference satisfy the tolerance threshold When the preset value is 10 pixels, the candidate corner pair is connected as a potential edge J. To avoid introducing erroneous edges, this embodiment only performs edge completion operations on isolated edges that meet the topological constraints, which include: (1) High confidence constraint: only when the isolated edge is greater than the confidence threshold. (1) Completion is only allowed when the default value is 0.7; (2) Connection quantity constraint: the number of adjacent edges that can be connected to any corner point shall not exceed 5; (3) Angle constraint: the angle between the supplemented edge and any existing courtyard edge at its endpoint shall not be less than 5. .

[0065] Finally, when the candidate corner points are ( When both the distance threshold condition and the topological constraint condition are met, a side line J is added between the corner point pairs. After performing the above completion process on all isolated side lines in sequence, a closed vector outline of the courtyard unit that satisfies the topological rules can be obtained.

[0066] To verify the effectiveness of this invention, this embodiment constructed a courtyard outline dataset covering seven rural areas for experimentation. This dataset has an image resolution of 0.15 meters and contains 1315 images with a size of 512×512. This invention employs evaluation metrics at both the pixel and instance levels, selecting Intersection over Union (IoU), Precision, Recall, and F1 score (F-1) as evaluation metrics. Higher values ​​for these metrics indicate better extraction performance.

[0067] Precision is calculated as the proportion of correctly predicted positive samples out of all predicted positive samples, measuring the precision of the extraction results. Recall is calculated as the proportion of correctly predicted positive samples out of the total number of true positive samples, reflecting the network's recall rate for the courtyard target. The F1 score is the harmonic mean of precision and recall, used to comprehensively reflect the network's balanced performance in precision and recall. Intersection over Union (IoU) is calculated as the ratio of the intersection and union of the predicted region and the true label region, measuring the spatial overlap accuracy between the extracted contour and the true contour. The experimental results are shown in Table 1. Compared with mainstream semantic segmentation methods (such as U-Net, DeepLabv3+), instance segmentation methods (MaskR-CNN), rotated box detection methods (BBAVectors, YOLOv11), and line detection methods (F-Clip, HEAT), the method of this invention achieves the best performance in all indicators and is superior to other methods.

[0068] Table 1. Quantitative comparison of various methods on the courtyard outline dataset.

[0069]

[0070] It should be understood that the above embodiments are merely preferred embodiments of the present invention, and the execution order of each step can be flexibly adjusted according to logical functions and is not limited to the description herein; in practical applications, each step can also be selectively or partially executed according to requirements. Furthermore, the technical features in each embodiment can be freely combined to form new technical solutions without conflict. Any modifications, equivalent substitutions, or improvements made based on the concept of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for extracting the vector contour of rural courtyards guided by prior information, characterized in that, Includes the following steps: Step 1: Construct a multimodal feature extraction module to extract multimodal fusion features from optical images and digital surface models (DSMs); Step 2: Construct a contour line initialization module. Use a corner detector to extract courtyard corners based on the multimodal fusion features described in Step 1. Combine the courtyard corners in pairs to obtain a candidate line set. Then, use a line segment filter to roughly screen the candidate lines to obtain an initial contour line set. Step 3: Construct a courtyard polygon extraction module, use the line segment refiner to finely filter the initial outline set described in Step 2, and then use the polygon builder to obtain the initial courtyard polygon; Step 4: Design a courtyard polygon optimization algorithm based on structural priors to perform topology optimization and edge completion on the initial courtyard polygon described in Step 3, and obtain the closed vector contour of the courtyard unit.

2. The method for extracting the vector contour of rural courtyards guided by prior information according to claim 1, characterized in that, The multimodal feature extraction module in step 1 includes an optical semantic feature encoding branch, a deep geometric feature encoding branch, and a gated feature fusion unit. The specific process is as follows: The optical semantic feature encoding branch utilizes convolutional neural networks to extract multi-scale optical semantic features from optical images. , means as follows: , in, and Indicates the length and width of the input image. Indicates the first The number of channels in a scale feature map; The deep geometric feature encoding branch first uses the Sobel operator to calculate the gradient features of the DSM in the x and y directions, and then concatenates them with the z-direction component features, which are always 1, in the channel dimension. Physical prior information is obtained after normalization. Next, a convolutional module is used to extract the shallow geometric features of the DSM. and deep geometric features Then, the prior information With features Concatenation as a query vector and The concatenated vectors, serving as both key and value vectors, are fed into a cross-attention module for feature interaction, yielding initial depth geometric features. Finally, bilinear interpolation is used to sample these initial depth geometric features, resulting in multi-scale depth geometric features. , means as follows: , in, and Indicates the length and width of the input image. Indicates the first The number of channels in a scale feature map; Gated feature fusion device utilizes features Generate gate weights and And calculate depth confidence. Features are fused in the following way With features Output multimodal fusion features : , in, This represents element-wise multiplication of feature maps.

3. The method for extracting the vector contour of rural courtyards guided by prior information according to claim 1, characterized in that, The specific process of the contour initialization module in step 2 is as follows: First, the corner detector uses a deformable Transformer encoder to initialize the feature described in claim 2. Enhancement is performed to obtain encoded features containing global context information; then, the encoded features are fed into the deformable Transformer decoder, and the corner features are aggregated using a cross-attention mechanism to obtain the decoded feature vector; the feature vector is upsampled and outputs a corner probability heatmap, and the local maxima points in the heatmap are taken as the courtyard corners; Secondly, the candidate line sets are obtained by pairwise combining the corner points of the courtyard. ; Finally, the segment filter introduces a length threshold. Set of rejection lines The excessively long line segment; the position feature vectors of the two endpoints of the remaining line segment are concatenated as a query vector, and the feature vector described in claim 2 is used. After being enhanced by the deformable Transformer encoder, it is used as a value vector and fed to the deformable Transformer decoder for interaction, aggregating the context information near the line segment; Feature vector output by the decoder After processing by a multilayer perceptron and the Softmax function, the confidence scores of the line segments are obtained. Invalid candidate lines with low confidence scores are filtered out, and line segments with high confidence scores are retained as the initial set of contour lines. .

4. The method for extracting the vector contour of rural courtyards guided by prior information according to claim 1, characterized in that, The courtyard polygon extraction module in step 3 includes a line segment refiner and a polygon builder; the line segment refiner is built based on the DAB-DETR model and includes a deformable Transformer encoder, an image-aware decoder, and a geometric constraint decoder. The contour line set as described in claim 3 As a location query vector The vector of claim 3 As a content query vector The feed is sent to the line segment refiner for fine screening of the line assembly. ; The selected line segments are fed into the polygon builder to obtain the initial courtyard polygon; The image-aware decoder consists of six stacked layers, each composed of a self-attention layer and a cross-attention layer; firstly, in the self-attention layer, the vectors are... sum vector The summed query vector and key vector are used as inputs, and the vectors are then... The input vector serves as the value vector; the output features of the self-attention layer are connected to the input via skip connections. After addition and layer normalization, we get Then, the features As a query vector, the feature described in claim 2 After being enhanced by a deformable Transformer encoder, the vector is fed into a cross-attention layer for interaction. The center point of the line segment is used as a reference point to guide the decoder to focus on key features near the line segment. Finally, the decoder's output is passed through a multilayer perceptron to output the category score of the line segment. ; The structure of the geometric constraint decoder is similar to that of the image-aware decoder, using the same set of contour lines. The network architecture shares parameters, retaining only the self-attention layer, which is used to model the collinear, parallel, and adjacency geometric relationships of line segments. The parameter sharing mechanism enhances the geometric reasoning ability of the image perception decoder. Category scores The data is fed into the polygon builder, where it is processed by the Softmax function to obtain the line segment confidence scores. Line segments with a confidence score greater than 0.5 are retained to obtain the initial courtyard polygons.

5. The method for extracting the vector contour of rural courtyards guided by prior information according to claim 1, characterized in that, The specific process of the courtyard polygon optimization algorithm based on structural priors in step 4 is as follows: First, according to claim 4, the initial courtyard polygon construction line adjacency matrix is ​​used, and the polygon optimization algorithm is used to search for all closed loops in the adjacency matrix to locate isolated line segments not in closed loops and their endpoints; then, the distance between the two endpoints of the isolated line segments is calculated. And construct the distance matrix between the endpoints of the isolated line segment and the adjacent points. Finally, calculate the above. Each distance value and If the difference satisfies the preset threshold condition and the isolated edge line satisfies the high confidence and topological connection quantity constraints, then edge lines are added between the corner point pairs corresponding to the difference to generate a closed courtyard unit vector outline.