Bridge plate size measurement method based on multi-model fusion

By employing a multi-model fusion method, including YOLOv8 and the Segment Anything model, the problems of variable lighting, interference from steel reinforcement and formwork, and large-scale splicing errors in bridge deck inspection were solved, achieving centimeter-level precision measurement and efficient automated inspection of bridge decks.

CN123181537APending Publication Date: 2026-11-27ZHEJIANG TIANSHENG BUILDING MATERIALS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611149983.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing technologies for bridge deck inspection suffer from problems such as variable lighting, interference from steel reinforcement and formwork, weak edge features, and cumulative errors from large-scale segmented splicing, resulting in insufficient measurement accuracy and making it difficult to meet centimeter-level requirements.

Method used

A multi-model fusion approach is adopted, including the YOLOv8 model for locating the main body area of ​​the bridge deck and extracting its edges, combined with the Segment Anything model for fine segmentation, and an adaptive feature matching network with high-precision mask prior enhancement is introduced to eliminate splicing errors and achieve high-fidelity seamless splicing.

Benefits of technology

It achieves centimeter-level positioning and measurement of bridge deck edges, eliminates geometric tearing and error accumulation at splicing boundaries, ensures high accuracy and stability of measurements, and meets the needs of engineering quality inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123181537A_ABST
    Figure CN123181537A_ABST
Patent Text Reader

Abstract

The application discloses a bridge plate size measurement method based on multi-model fusion and relates to bridge engineering quality detection technology in the field of machine vision. The application focuses on solving the core technical problems in high-fidelity splicing of long-distance sequence images: for the problem of high feature point mismatching rate caused by weak texture and repeated structure surface of the bridge plate, a boundary perception position encoding (BAPE) is proposed, and a SAM mask distance conversion field is integrated into feature point position encoding; for the problem of geometric tearing of the splicing boundary, a mask topological driving limited cross attention mechanism is proposed, and feature matching is constrained in a semantic consistent area by applying a cross-boundary penalty term; for the problem of multi-segment cumulative error of an ultralong bridge plate (>30 meters), a single total length calculation scheme is adopted in combination with IoU consistency filtering, so that the cumulative error is completely eliminated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of structural monitoring and engineering quality inspection in machine vision and computer vision, specifically involving a method for measuring the dimensions of bridge decks based on multi-model fusion. Background Technology

[0002] In traditional bridge deck and rebar inspection, manual contact measurements using measuring tapes or rangefinders are typically required. This process is time-consuming and cumbersome, and in challenging environments with varying lighting and interference from rebar and formwork, manual operation is highly subjective and accuracy is difficult to guarantee. While machine vision technology has rapidly developed, vision-based automated inspection systems are beginning to be applied to engineering component inspection. However, existing technologies still face challenges when dealing with high precision and complex environmental requirements.

[0003] Specifically, existing technologies face the following main technical challenges: (i) Complex on-site environment: The bridge deck measurement scenario involves variable lighting conditions such as direct sunlight, shadows, and nighttime supplemental lighting, as well as interfering elements such as reinforcing bars, formwork, and construction equipment. The complexity of the background and the reflective properties of the materials can easily lead to edge recognition deviations in visual measurement, affecting measurement accuracy.

[0004] (ii) Stringent dimensional accuracy requirements: The dimensional error of bridge decks is directly related to the structural load-bearing safety, and industry standards require that the measurement accuracy of key dimensions reach the centimeter level. Traditional manual measurement is difficult to reliably meet this requirement, and the measurement process is time-consuming and labor-intensive, which cannot adapt to the needs of large-scale construction schedules.

[0005] (iii) Variable dimensions and weak edge features: The bridge deck has a large span in length, width and height, and the edges of the deck are prone to wear, template residue and dust adhesion, resulting in blurred edge contours and increasing the difficulty of edge detection and precise positioning.

[0006] (iv) Potential Accumulated Errors in Large-Scale Segmented Stitching: Precast bridge slabs often have extremely large aspect ratios, making complete coverage impossible from a single viewpoint, necessitating segmented shooting using multiple cameras. However, the concrete surface of bridge slabs exhibits extremely weak texture characteristics and contains numerous repetitive local features (such as identical mold indentations and pores). When stitching together long-distance image sequences, traditional feature matching algorithms are highly susceptible to feature aliasing and mismatches, leading to drift in the calculated homography matrix and introducing significant nonlinear accumulated errors in full-length dimension measurements.

[0007] While existing single-stage object detection algorithms (such as YOLOv8) can locate the main body region, they lack fine semantic segmentation capabilities when faced with blurred outlines (weak edges) caused by wear, dust adhesion, or residual template marks on bridge deck edges. The localized bounding boxes often fail to perfectly match the actual physical edges of the deck, resulting in dimensional measurements that cannot meet centimeter-level accuracy requirements. Furthermore, precast bridge decks often have extremely large aspect ratios, making complete coverage impossible from a single viewpoint, necessitating segmented shooting using multiple cameras. However, the concrete surface of bridge decks exhibits extremely weak texture characteristics and contains numerous repetitive local features. When stitching together long-distance image sequences, traditional feature matching algorithms are prone to feature aliasing and mismatches, leading to drift in the calculated homography matrix and geometric tearing in non-overlapping areas, thus introducing significant nonlinear cumulative errors in full-length dimensional measurements. Summary of the Invention

[0008] The purpose of this invention is to provide a bridge deck size measurement method based on multi-model fusion. By fusing multiple models, the boundary of the bridge deck can be accurately located, achieving centimeter-level positioning.

[0009] To achieve the above objectives, the present invention provides the following technical solution: a method for measuring the dimensions of bridge decks based on multi-model fusion, characterized by comprising the following steps: To address the aforementioned technical challenges, this invention constructs an automated measurement solution encompassing "positioning-segmentation-calibration-assembly-measurement," comprising four core modules: a structural positioning module (using a YOLOv8 model to identify the main body area of ​​the bridge slab, automatically segmenting the slab outline, filtering background interference elements, and providing precise regional constraints for subsequent edge extraction); a high-precision edge extraction module (using the bounding box output by YOLOv8 as a prompt, utilizing Segmentation...) The Anything model implements fine segmentation of bridge deck edges and optimizes edge continuity through post-processing operations. It also includes a size calibration and calculation module (which introduces a calibration board to establish a "pixel-physical" distance transformation relationship and calculates the actual dimensions of the deck, such as length, width, and height, based on the edge line coordinate difference), and a prior-constrained image stitching module for large scale (which addresses the cumulative measurement error caused by long sequence segmented images by abandoning the traditional coarse accumulation method and introducing an adaptive feature matching network based on zero-sample high-precision mask prior enhancement. It uses the high-precision bridge contour extracted by SAM as the "boundary distance field" and "semantic attention mask" to guide the high-fidelity stitching of segmented images, eliminates arc drift in long-distance matching, and ensures the absolute accuracy of full-dimensional size measurement).

[0010] Step 1, Image Sampling: Place the bridge plate to be tested on the mold platform, and arrange industrial cameras on the top and sides to take segmented pictures of the bridge plate, and place the Aruco calibration plate in the shooting area. Step 2, Image Preprocessing: The acquired images are subjected to resolution unification processing and contrast-limited adaptive histogram equalization (CLAHE) enhancement. Step 3, Measurement of the main dimensions of the bridge deck: The YOLOv8 object detection model is used to coarsely locate the main body of the bridge deck and obtain the bounding box; the bounding box is enlarged by 5% and then input into the Segment Anything Model for fine edge extraction; the edge mask is optimized after morphological closing operation and Canny edge detection. Step 4, High-fidelity stitching of large-scale segmented images with prior enhancement: Based on the SuperPoint+LightGlue feature matching architecture, three innovative modules are adopted: boundary-aware position encoding, mask topology-driven restricted cross attention, and macro-edge overlap consistency filtering, to achieve high-fidelity seamless stitching of long-distance sequence images. Step 5, Size Conversion: Pixel-to-physical distance conversion coefficients are calculated by identifying corner points of the Aruco calibration board, and cumulative errors are eliminated by single total length calculation for ultra-long bridge boards. Step 6, Output Results: Generate a structured inspection report containing dimensional data and error ranges.

[0011] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) Solve the problem of mismatch in weak texture: By using boundary-aware position encoding (BAPE), semantic boundary information is integrated into the feature point description, enabling the algorithm to distinguish similar position features in weak texture and repetitive structure scenarios, thus significantly reducing the mismatch rate.

[0012] (2) Eliminate geometric tearing at splicing boundaries: The mask topology-driven restricted cross-attention mechanism constrains feature matching to the semantically consistent region. Combined with the translation compensation constraint of IoU consistency filtering, it fundamentally solves the problem of geometric tearing at splicing boundaries and achieves high-fidelity seamless splicing.

[0013] (3) Eliminate error accumulation: For ultra-long bridge slabs, a single total length calculation scheme is adopted to avoid multi-segment cumulative error, and the measurement accuracy does not degrade with the increase of bridge length.

[0014] (4) Strong robustness: CLAHE preprocessing effectively copes with image quality degradation caused by low temperature environment and complex lighting (direct sunlight, shadow occlusion, nighttime supplementary lighting), ensuring the stability of measurement results.

[0015] (5) High-precision end-to-end automation: YOLOv8+SAM dual-stage detection and improved LCNN+DeepLSD angle measurement achieve high-precision automated size and angle measurement with edge integrity rate ≥99% and error ≤1 pixel, replacing traditional manual contact measurement.

[0016] (6) High-efficiency inference performance: Based on TensorRT accelerated inference, the segmentation time for a single image is ≤80ms, and the total time for YOLOv8 and SAM concatenation is ≤120ms, meeting the real-time detection requirements of engineering sites. In scenarios with plate wear and template residue, the edge extraction integrity rate is ≥99%, the edge pixel error is ≤1 pixel, which translates to an actual spatial error of ≤2mm, providing a solid foundation for high-precision size calculation. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the measurement steps of the present invention.

[0018] Figure 2 This is a diagram of the adaptive feature matching and splicing network architecture based on zero-sample mask prior enhancement of the present invention.

[0019] Figure 3 This is a schematic diagram of the improved LCNN process. Implementation To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.

[0020] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0021] Please see Figure 1-3 This invention provides a technical solution: a method for measuring the dimensions of bridge decks based on multi-model fusion, comprising the following steps: Step 1: Image Sampling High-resolution industrial cameras were used to capture images of the bridge deck in segments. The top camera, with a resolution of 5472×3648 and a 16mm focal length lens, was used to acquire top-view images of the bridge deck in the width direction; the side cameras, with 12mm focal length lenses, were used to acquire side-view images of the bridge deck in the height direction; all cameras maintained a uniform shooting height and distance.

[0022] The shooting covered various lighting conditions, including direct sunlight, shadows, and nighttime lighting, to ensure the model's robustness in real-world engineering environments (including low-temperature construction sites). Aruco calibration boards (30cm x 30cm for the side boards and 50cm x 50cm for the top boards) were placed in the shooting area for subsequent pixel-to-physical distance conversion coefficient calibration.

[0023] Step 2: Image Preprocessing and Enhancement The acquired images were processed as follows: — Resolution standardization: Adjust all images to a uniform resolution to meet the input requirements of subsequent neural network models; — CLAHE Enhancement: This method enhances the image by using a contrast-limited adaptive histogram equalization algorithm. The image is divided into several small blocks, and histogram equalization is calculated independently within each block. A contrast limit threshold is used to prevent over-enhancement that could lead to noise amplification. This processing method is particularly effective in compensating for scenarios where sensor sensitivity decreases and image contrast is reduced in low-temperature environments.

[0024] — Construct a dedicated bridge deck dataset containing 100 images, divide the training set and test set in an 8:2 ratio, and perform data augmentation processing such as Mosaic stitching, random flipping, scaling and cropping, brightness / contrast adjustment, and Gaussian blur.

[0025] Step 3: Measure the main dimensions of the bridge deck * (3.1) Coarse positioning of the main body in YOLOv8: * An improved YOLOv8 model is used to coarsely locate the main body of the bridge deck. The backbone network uses C2f modules instead of the traditional C3 modules, combined with SPPF spatial pyramid pooling layers; the neck network adopts a PAN-FPN structure; and the head adopts a decoupled structure to handle classification and regression tasks respectively.

[0026] Training parameters: input resolution 640×640, loss function CIoU Loss, training for 300 epochs, initial learning rate 0.01, Cosine Annealing learning rate decay strategy, weight decay coefficient 0.0005.

[0027] Furthermore, the YOLOv8 model adopts a modular architecture, with its core consisting of four parts: an input layer, a backbone network, a neck network, and a detection head. The input layer uses a fixed resolution of 640×640 and enhances the model's generalization ability through Mosaic data augmentation. The backbone network uses a C2f module instead of the traditional C3 module and combines SPPF spatial pyramid pooling to strengthen multi-scale feature extraction capabilities. The neck network uses a PAN-FPN structure to achieve upsampling and downsampling feature fusion, balancing edge details and semantic information. The detection head decouples the detection head from the classification and regression tasks and optimizes sample matching through AutoLabelAssigner dynamic label allocation.

[0028] In terms of dataset construction, 100 bridge slab images in different scenes (backlight, shadow, and rebar occlusion) were collected, covering real interference situations such as slab wear and template residue; they were divided into a training set (80 images) and a test set (20 images) in an 8:2 ratio to ensure data distribution consistency; data augmentation operations such as random horizontal flipping (probability 0.5), scaling and cropping (0.8-1.2 times), brightness / contrast adjustment (±15%), and Gaussian blur (3×3 kernel) were used; the LabelImg tool was used to label two types of bounding boxes, "top" and "side", with a labeling error of ≤1 pixel.

[0029] * (3.2) SAM fine edge extraction: * The bounding box output by YOLOv8 is expanded outward by 5% and used as a "Box Prompt" input to the prompt encoder of the SegmentAnything Model (SAM). SAM adopts a three-segment structure of "ViT-H image encoder - prompt encoder - mask decoder" to output a fine segmentation mask of the bridge slab body.

[0030] Specifically, the SAM model's image encoder uses ViT-H as its backbone network, transforming the image into 16×16 feature blocks through PatchEmbedding and extracting global features using a self-attention mechanism. The cue encoder uses the bounding boxes output by YOLOv8 as "box cues" to accurately define the segmentation region. The mask decoder fuses image features and cue features through cross-attention to generate multi-scale edge masks. In terms of model adaptation, the YOLOv8 bounding boxes are enlarged by 5% to avoid edge information loss due to localization errors. Inference is accelerated using TensorRT, with single-image segmentation time ≤80ms and the total time cascaded with YOLOv8 ≤120ms. In scenarios involving board wear and template residue, the edge extraction integrity rate is ≥99%, with an edge pixel error ≤1 pixel, translating to an actual spatial error ≤2mm.

[0031] * (3.3) Post-edge optimization: * Post-processing of the mask output by SAM: First, morphological closing operation is performed using a 3×3 kernel to fill the small holes at the edge of the mask to ensure edge continuity; then, the Canny edge detection algorithm (low threshold 50, high threshold 150) is used to extract fine edges, ultimately achieving an edge integrity rate ≥99% and a pixel error ≤1 pixel.

[0032] Step 4: High-fidelity stitching with prior enhancement for large-scale segmented images This step is the core of this invention in solving the problem of high-fidelity stitching of long-distance sequence images. It uses the SuperPoint+LightGlue feature matching architecture as a foundation and introduces three key innovative modules: * (4.1) Boundary-Aware Positional Encoding (BAPE): * Traditional feature matching methods, relying solely on local appearance descriptors in weakly textured scenes, fail to distinguish feature points with similar appearances but located in different semantic regions, leading to numerous false matches. BAPE incorporates semantic boundary information into feature point location encoding through the following steps: — ① Using the SAM mask obtained in step 3 as input, calculate the distance transform field from each pixel in the image to the nearest mask boundary. — ② Input the distance transformation field into a lightweight multilayer perceptron (MLP) for nonlinear mapping to obtain the boundary sensing encoding vector; — ③ Concatenate the boundary-aware encoding vector with the rotation position encoding (RoPE) tensor of the SuperPoint feature points to form an enhanced position encoding; After BAPE encoding, feature points located near the object boundary and feature points located inside the texture region are effectively distinguished in the position encoding space. Even if the local appearance descriptors of the two are similar, they can be correctly distinguished by the matching network, thereby reducing the mismatch rate in weak texture repetitive structure scenes.

[0033] Specifically, BAPE transforms the high-precision bridge slab mask output by SAM into a continuous spatial distance field, calculating the shortest topological distance from each high-frequency keypoint to the physical boundary. This distance is then mapped to high-dimensional features using a multilayer perceptron (MLP) and tensor-concatenated with the native two-dimensional rotational positional encoding (RoPE) to form the enhanced positional encoding that ultimately enters the matching network. This mechanism, at the network input level, endows previously isolated local feature points with global morphological prior properties, enabling the algorithm to distinguish similar positional features in weakly textured, repetitive structural scenes.

[0034] * (4.2) Mask-Topology-Driven Constrained Cross-Attention: * In LightGlue's cross-attention computation, attention penalties are applied to feature point pairs that cross the boundaries of different semantic mask regions: — ① For a matching pair consisting of two feature points from different mask regions (i.e., across mask boundaries), apply a penalty value that tends to negative infinity at the corresponding position in the cross-attention matrix; — ② This penalty value forces the attention weights to approach zero after Softmax normalization, meaning that the network will automatically ignore unreasonable cross-regional matching when performing feature aggregation; — ③ The above constraints ensure that the final feature matching point pairs are all located within semantically consistent regions, fundamentally eliminating cross-regional pseudo-matches caused by the repetitive structure on the bridge deck surface.

[0035] Specifically, to eliminate the interference of complex background (such as construction supports and shaded ground) feature points on the bridge deck's ontological feature points, this method constructs a restricted attention aggregation network driven by semantic boundaries. Based on the SAM mask, a Boolean penalty term is generated, and this penalty term is dynamically introduced into the calculation formula of cross-attention: feature points within the SAM mask maintain normal attention weights when matching, while the penalty term for matching across the mask boundary tends to infinity. This mechanism mathematically forces the blocking of feature interactions across the mask boundary, allowing only "ontology matching ontology" and "background matching background," fundamentally eliminating matching drift caused by dynamic background interference.

[0036] *(4.3) Macro-level edge overlap consistency filtering (IoU-Consistency Filtering):* After completing feature point matching and estimating the homography matrix, the following consistency verification is performed to eliminate residual spurious matching points and prevent geometric tearing: — ① Transform and align the bridge deck edge masks of two adjacent images using the estimated homography matrix, and calculate the intersection-over-union ratio (IoU) of the aligned edge masks. — ② If the IoU is lower than the preset threshold, it is determined that there are residual pseudo-matching points in the current matching. The matching point pairs with the lowest IoU contribution are eliminated iteratively until the IoU meets the threshold requirement. — ③ In the final image fusion stage, a translation compensation constraint is applied: the homography matrix is ​​corrected and compensated based on the macroscopic alignment result of the edge mask to prevent boundary geometric tearing caused by local feature errors.

[0037] Furthermore, in the macro-edge overlap consistency filtering, the matching confidence prediction mechanism introduces macro-contour consistency constraints. When solving the local homography transformation matrix between two segmented images, not only is the reprojection residual of feature points calculated, but the transformation matrix is ​​also directly applied to the SAM segmentation contours of the two frames. By calculating the spatial intersection-over-union (IoU) ratio of the reprojected contours, the system adaptively eliminates pseudo-matching points that, although locally similar in texture, violate macro-rigid geometry properties, ensuring that the spliced ​​bridge deck maintains absolute "straightness" and physical scaling consistency.

[0038] Through the synergistic effect of the three innovative modules mentioned above, this invention achieves high-fidelity seamless stitching in large scenes with weak textures, eliminating the problems of feature mismatch, boundary tearing and error accumulation that are common in traditional methods for stitching long-distance sequence images.

[0039] In addition, to address the cumulative measurement error caused by long sequence segmented images, the traditional coarse accumulation method is abandoned, and an adaptive feature matching network based on zero-sample high-precision mask prior enhancement is introduced.

[0040] To address the issues of feature aliasing and pose drift in the segmented splicing of large-scale, weakly textured bridge slabs, this system performs deep network structure reconstruction in the feature matching stage (based on the SuperPoint and LightGlue architecture), directly injecting the macroscopic geometric priors and semantic constraints extracted by SAM into the matching process.

[0041] Boundary-Aware Positional Encoding (BAPE) The native matching network relies solely on two-dimensional relative coordinates, making it highly susceptible to failure in homogeneous texture regions. This method transforms the high-precision bridge slab mask output by SAM into a continuous spatial distance field, calculating the shortest topological distance from each high-frequency keypoint to the physical boundary. Subsequently, it maps this distance to high-dimensional features using a multilayer perceptron (MLP) and performs tensor concatenation with the native two-dimensional rotation position encoding (RoPE).

[0042] Pi = RoPE(xi,yi) ⊕ MLP(DTSAM(xi,yi)) (Where, DTSAM represents the range transform field based on the SAM mask) This mechanism endows previously isolated local feature points with global morphological prior attributes at the network input level.

[0043] Mask topology-driven restricted cross-attention module To eliminate the interference of feature points from complex backgrounds (such as construction supports and shaded ground) on the feature points of the bridge deck itself, this method constructs a constrained attention aggregation network driven by semantic boundaries. A Boolean penalty term, Msem, is generated based on a SAM mask, and this mask penalty term is dynamically introduced into the calculation formula of cross-attention.

[0044] Attention(Q,K,V)=Softmax(QKTdk+γMsem) (When feature points inside the SAM mask match each other, Msem=0; the matching penalty term that crosses the mask boundary tends to an infinitely negative value.) This mechanism mathematically blocks feature interactions across mask boundaries, allowing only "ontology matching ontology" and "background matching background," thus fundamentally eliminating matching drift caused by dynamic background interference.

[0045] Macro-edge overlap consistency filtering In the matching confidence prediction mechanism, a macroscopic contour consistency constraint is introduced. When solving the local homography transformation matrix between two segmented images, not only is the reprojection residual of feature points calculated, but the transformation matrix is ​​also directly applied to the SAM segmentation contours of the two frames. By calculating the spatial intersection-over-union (IoU) ratio of the reprojected contours, the system adaptively eliminates pseudo-matching points that, although locally similar in texture, violate macroscopic rigid body geometric properties, ensuring that the spliced ​​bridge deck maintains absolute "straightness" and physical scaling consistency.

[0046] Step 5: Measure the angle of rebar exposure (optional step) For applications that require simultaneous detection of the exposed angle of the rebar, perform this step: * (5.1) Improved LCNN model training: * Fine-tuning the LCNN model on a customized bridge structure dataset: — Optimizer: AdamW; — Initial learning rate: 1×10 -5 ; — Learning rate decay: Cosine Annealing; — Loss function: Joint optimization of L1 Loss and binary classification Loss; — Training cycles: 50 epochs.

[0047] The LCNN network structure is improved as follows: — Replace the original Stem Conv with a Large-Kernel Stem to increase the receptive field; — Replace Stacked Hourglass with Dilated Hourglass and use dilated convolution to expand the feature perception range; — Introduce the FPN cross-layer fusion mechanism to fuse feature information at different scales; — Introducing the ASPP (Atrous Spatial Pyramid Pooling) global context module to enhance global semantic awareness capabilities; — Introduce the Coordinate Attention mechanism to enhance the network's attention to spatial location; — It adopts a dual-head prediction structure, including a line segment heatmap head and a direction / continuity auxiliary head, which predict the position and direction of the line segment respectively.

[0048] * (5.2) Parallel processing of DeepLSD: * Parallel loading of a pre-trained DeepLSD model trained on a Wireframe Dataset complements the improved LCNN, enhancing the recall rate of line segment detection.

[0049] *(5.3) ROI dual-region screening:* Define two regions of interest (ROIs): — ROI 1: Covers the main edge area of ​​the bridge deck, used to extract the edge line segments of the bridge deck; — ROI 2: Covers the extended area of ​​the reinforcing bars, used to extract the reinforcing bar segments; The detected line segments within the two ROIs are matched, and effective edge lines and rebar lines are selected through context-enhanced line segment verification, long line fusion, and NMS post-processing.

[0050] *(5.4) Angle Calculation:* Let the direction vector of the bridge slab edge be v1, and the direction vector of the rebar segment be v2. The rebar exposure angle θ is calculated using the following formula: θ = arccos((v1·v2) / (‖v1‖ × ‖v2‖)) Step 6: Size Conversion and Error Correction *(6.1) Calibration of conversion coefficients:* The four corner points of the Aruco calibration board in the image are identified using a corner detection algorithm. The correspondence between pixel coordinates and physical coordinates is calculated to obtain the pixel-to-physical distance conversion coefficient. Conversion factor = Physical size of calibration board (cm) / Number of pixels corresponding to calibration board Example: If a 30cm calibration board corresponds to 200 pixels, then the conversion factor = 0.15cm / pixel.

[0051] * (6.2) Error elimination for ultra-long bridge slabs: * For ultra-long bridge slabs exceeding 30 meters in length, traditional segmented accumulation methods introduce an error accumulation effect. This invention adopts a single total length calculation scheme: based on a complete image after high-fidelity stitching, the entire length is measured and calculated in one go, completely eliminating multi-segment accumulation errors and ensuring the measurement accuracy of ultra-long dimensions.

[0052] Specifically, the detailed process of top-level panoramic stitching and total length measurement is as follows: To meet the requirements for measuring the long span of the bridge deck, after acquiring sequential images of the two ends and the middle section, the system first uses YOLOv8 to determine local regions and extracts high-precision edge masks for each segment using SAM. Subsequently, the high-frequency features of the images and the edge masks are simultaneously fed into a priori enhanced feature matching network. Utilizing boundary-aware position encoding and a restricted cross-attention mechanism, the overlapping areas of adjacent images are accurately matched, and the homography matrix, strictly constrained by edge straightness, is calculated. Finally, the local segments are losslessly projected onto a unified global physical coordinate system. Combined with the transformation coefficients of the Aruco calibration plate, the total length L is directly calculated across points in the stitched panoramic high-fidelity feature field, effectively eliminating the nonlinear drift error generated by the traditional segmented direct accumulation method.

[0053] The overall workflow of this invention adopts a dual-branch parallel processing architecture: the input layer consists of two sets of image data, one for the side and one for the top. The top image is captured by cameras at two ends at a fixed distance, adapting to long-span bridge slab measurement scenarios. Both the side and top images follow the core process of "YOLOv8 positioning → SAM segmentation → spatial calibration → dimension calculation," ensuring the independence and accuracy of measurements in each dimension. The key technologies are integrated into the core role of YOLOv8's regional positioning and SAM's high-precision edge extraction capabilities. The top branch explicitly incorporates a "fixed middle section distance" design, simplifying the measurement process while ensuring accuracy. The output closed loop summarizes the width / height results of the side branch and the summed length of the top branch to form the complete three-dimensional dimensions of the bridge slab, meeting the actual needs of engineering quality inspection.

[0054] Step 7: Output Results Generate a structured inspection report, including: — Basic information: Inspection date, bridge deck number, inspection personnel, etc.; — Key data: Plate length (mm), plate width (mm), plate height (mm), rebar exposure angle (°), and error range of each measurement value; — Visual annotation: Overlays detected edges, measured line segments, and dimension annotations onto the image; — Supports export in CSV / JSON format for easy integration with engineering management systems.

Claims

1. A method for measuring the dimensions of bridge decks based on multi-model fusion, characterized in that, Includes the following steps: Step 1, Image Sampling: Place the bridge plate to be tested on the mold platform, and arrange industrial cameras on the top and sides to take segmented pictures of the bridge plate, and place the Aruco calibration plate in the shooting area. Step 2, Image Preprocessing: The acquired images are subjected to resolution unification processing and contrast-limited adaptive histogram equalization (CLAHE) enhancement. Step 3, Measurement of the main dimensions of the bridge deck: The YOLOv8 object detection model is used to coarsely locate the main body of the bridge deck and obtain the bounding box; the bounding box is enlarged by 5% and then input into the Segment Anything Model for fine edge extraction; the edge mask is optimized after morphological closing operation and Canny edge detection. Step 4, High-fidelity stitching of large-scale segmented images with prior enhancement: Based on the SuperPoint+LightGlue feature matching architecture, three innovative modules are adopted: boundary-aware position encoding, mask topology-driven restricted cross attention, and macro-edge overlap consistency filtering, to achieve high-fidelity seamless stitching of long-distance sequence images. Step 5, Size Conversion: Pixel-to-physical distance conversion coefficients are calculated by identifying corner points of the Aruco calibration board, and cumulative errors are eliminated by single total length calculation for ultra-long bridge boards. Step 6, Output Results: Generate a structured inspection report containing dimensional data and error ranges.

2. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, In step one, the top camera has a resolution of 5472×3648 and is equipped with a 16mm focal length lens; the side camera is equipped with a 12mm focal length lens; all cameras maintain a uniform shooting height and distance; the side Aruco calibration plate has a size of 30cm×30cm, and the top Aruco calibration plate has a size of 50cm×50cm.

3. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, In step three, the backbone network of the YOLOv8 model adopts a C2f module combined with an SPPF spatial pyramid pooling layer, the neck adopts a PAN-FPN structure, and the detection head adopts a decoupled structure. The training parameters are as follows: input resolution 640×640, CIoU Loss, training for 300 epochs, initial learning rate 0.01, Cosine Annealing learning rate decay, and weight decay of 0.0005. In the post-optimization step, the morphological closing kernel size is 3×3, the Canny edge detection low threshold is 50, and the high threshold is 150, achieving an edge integrity rate of ≥99% and an error of ≤1 pixel.

4. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, In step four, the boundary-aware position coding (BAPE) is implemented as follows: the distance transformation field from each pixel in the image to the nearest mask boundary is calculated using the edge mask output by SAM; the distance transformation field is input into a lightweight multilayer perceptron (MLP) for nonlinear mapping to obtain the boundary-aware coding vector; the boundary-aware coding vector is concatenated with the rotation position coding (RoPE) tensor of the SuperPoint feature points to form the enhanced position coding.

5. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, In step four, the mask topology-driven restricted cross attention is implemented as follows: In the LightGlue cross attention calculation, for feature point matching pairs from different mask regions, a penalty value approaching negative infinity is applied to the corresponding position of the attention matrix, so that the attention weights approach zero after Softmax normalization, thereby constraining feature matching to semantically consistent regions.

6. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, In step four, the macro-edge overlap consistency filtering is implemented as follows: the bridge plate edge masks of adjacent images are aligned using the estimated homography matrix, and the intersection-over-union ratio (IoU) of the aligned masks is calculated; if the IoU is lower than a preset threshold, the matching point pairs with the lowest IoU contribution are iteratively removed; in the image fusion stage, a translation compensation constraint is applied to the homography matrix based on the macro-alignment result of the edge mask to prevent geometric tearing of the splicing boundary.

7. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, It also includes an optional step between steps four and five: the rebar exposure angle measurement step, which includes: using the improved LCNN model and the DeepLSD model for parallel processing, based on the dual-region screening and matching of the bridge main body edge ROI region (ROI 1) and the rebar extension region ROI (ROI 2), the rebar exposure angle θ is calculated according to the formula θ=arccos((v1·v2) / (‖v1‖‖v2‖)), where v1 is the direction vector of the bridge slab edge and v2 is the direction vector of the rebar line segment.

8. The bridge deck size measurement method based on multi-model fusion according to claim 7, characterized in that, The improved LCNN model incorporates the following improvements over the original LCNN model: Large-Kernel Stem replaces the original StemConv; Dilated Hourglass replaces Stacked Hourglass; FPN cross-layer fusion mechanism is introduced; ASPP global context module is introduced; and... Coordinate Attention mechanism; employs a dual-head prediction structure, including a line segment heatmap head and a direction / continuity auxiliary head; Fine-tuning the training parameters: optimizer AdamW, initial learning rate 1×10⁻⁶. -5 Cosine Annealing learning rate decay, L1 Loss and binary classification Loss jointly optimized, training for 50 epochs.

9. The bridge deck size measurement method based on multi-model fusion according to claim 1, characterized in that, Step 4) includes the following sub-steps: Step S1: Obtain multiple sequence images of the large-scale beam slab to be tested, wherein the multiple sequence images include overlapping areas between adjacent images; Step S2: Use an object detection model to locate the main beam and slab region of each segment of the sequence image and output the beam and slab bounding box; Step S3: Using the beam-slab boundary box as the input prompt, perform high-precision semantic segmentation of the main body of the beam-slab using the segmentation large model to generate the beam-slab mask; Step S4: Inject the beam-plate mask as a geometric prior into the feature matching network to construct an adaptive feature matching network enhanced by the mask prior, and perform feature extraction and matching on the overlapping areas of adjacent images; wherein, the adaptive feature matching network enhanced by the mask prior applies macroscopic geometric constraints to the matching process using the beam-plate mask to suppress false matching and background interference in weak texture areas. Step S5: Based on the feature matching results, calculate the homography transformation matrix between adjacent sequences and images, and stitch the multiple sequence images into a panoramic image; Step S6: Based on the spatial calibration parameters, directly calculate the actual physical dimensions of the beam and slab on the panoramic image.