Abstract:
To address the issue of classic edge detection algorithms being susceptible to interference from markings, water stains, and uneven lighting in complex bridge scenes, this paper constructs a real bridge image dataset and proposes a directional improvement method for the Canny and Sobel algorithms. The Canny algorithm is optimized using dynamic Gaussian smoothing, adaptive dual thresholding, and morphological post-processing. The Sobel algorithm is improved by introducing median filtering, lighting compensation preprocessing, multi-directional gradient weighting, and adaptive threshold mechanism. The traditional and improved algorithms are compared and analyzed. The results showed that traditional Canny caused edge breakage and detail loss due to fixed parameters, while traditional Sobel had weaker suppression of horizontal markings and more false edges in dark areas; After improvement, the edge continuity and light adaptability of Canny algorithm are significantly enhanced, and the anti marking and water stain interference ability of Sobel algorithm is effectively improved. In addition, the improved Sobel is suitable for fast response and on-site initial screening, while the improved Canny is suitable for high-precision later detailed investigation. The advantages of the two complement each other and can be flexibly selected according to real-time and accuracy requirements. The method proposed in this article effectively overcomes the limitations of traditional algorithms and provides a practical and reliable solution for bridge appearance detection, with good engineering application value.