This invention belongs to the field of
image segmentation technology and discloses a method,
system, medium, device, and terminal for extracting identification documents. The
system utilizes an embedded device to acquire multispectral images of the identification document; it models the document
image edge segments based on their straight-line geometric properties and infers from the
contextual information of the global image; it extracts global image features using a ResNet network and then encodes them using a Deformable DETR
encoder; in the first-stage decoding process, it predicts the document edge segments using an attention mechanism and learnable
line segment and position queries; in the second-stage decoding process, it compares the correlation between
line segment features and image features to predict the relative order between line segments, and obtains the complete edges, vertices, and bounding boxes of the document image through
perspective transformation. This invention uses a two-part matching method to predict line segments, avoiding pre- and post-
processing, simplifying the detection channel, and achieving true end-to-end
processing.