Abstract:In view of the shortcomings of traditional LSD line detection algorithm, such as the tendency to lose details and discontinuity of line extraction, this paper presents an LSD line detection algorithm based on bilateral filter proposed to improve Canny edge image extraction. The Canny algorithm was used to extract the edge image, based on which LSD line detection algorithm is used to extract the line. For the Canny edge detection using gaussian filtering, the image edge will be blurred while reducing the noise. The bilateral filtering has a better protection effect on the edge of the image. Therefore, the algorithm adopts bilateral filtering instead of Gaussian filtering in the Canny edge detection to extract the edge image. At the same time, the LSD line detection algorithm based on bilateral filter to improve Canny edge image extraction was applied to the rail surface boundary extraction. The results show that LSD linear extraction algorithm based on Canny edge detection and edge image extraction based on bilateral filtering was better for the linear extraction of rail surface boundary. The relevant evaluation indexes have been greatly improved and the peak signal-to-noise ratio of the experimental images increased by 6.49% and 13.58% respectively. It lays a foundation for the subsequent identification of rail surface defects and has certain practical value.