  Extracting building contours from remote sensing imagery is a significant
challenge due to buildings' complex and diverse shapes, occlusions, and noise.
Existing methods often struggle with irregular contours, rounded corners, and
redundancy points, necessitating extensive post-processing to produce regular
polygonal building contours. To address these challenges, we introduce a novel,
streamlined pipeline that generates regular building contours without
post-processing. Our approach begins with the segmentation of generic geometric
primitives (which can include vertices, lines, and corners), followed by the
prediction of their sequence. This allows for the direct construction of
regular building contours by sequentially connecting the segmented primitives.
Building on this pipeline, we developed P2PFormer, which utilizes a
transformer-based architecture to segment geometric primitives and predict
their order. To enhance the segmentation of primitives, we introduce a unique
representation called group queries. This representation comprises a set of
queries and a singular query position, which improve the focus on multiple
midpoints of primitives and their efficient linkage. Furthermore, we propose an
innovative implicit update strategy for the query position embedding aimed at
sharpening the focus of queries on the correct positions and, consequently,
enhancing the quality of primitive segmentation. Our experiments demonstrate
that P2PFormer achieves new state-of-the-art performance on the WHU, CrowdAI,
and WHU-Mix datasets, surpassing the previous SOTA PolyWorld by a margin of 2.7
AP and 6.5 AP75 on the largest CrowdAI dataset. We intend to make the code and
trained weights publicly available to promote their use and facilitate further
research.
