| With the continuous development of railways and the increasing mileage and train speed,ensuring the safe operation of trains is particularly important.Research has shown that foreign object intrusion in railway track areas is one of the important reasons affecting railway safety,so foreign object detection and forewarning in railway track areas can be an effective solution.After dividing the hazardous areas of railway tracks that require foreign object intrusion detection,this thesis optimizes the existing detection algorithms to make them more suitable for the railway environment,and conducts relevant research on whether the detected foreign objects require forewarning.The main research content of the thesis is as follows:(1)Division of hazardous areas on railway tracks.This thesis uses the improved Canny algorithm for rail edge detection,and calculates the curve equation for dividing the hazardous area based on the detection results.To solve the problem that Gaussian filter in Canny algorithm may cause edge loss,median filter is used instead.According to the principle that edge information belongs to high-frequency signals in the frequency domain,it is filtered in the frequency domain to enhance image edge information.3×3 gradient operator for gradient calculation,using linear interpolation method to improve the non maximum suppression method.The Otsu algorithm is used for threshold calculation,eliminating the difficulty of manually setting thresholds.The obtained threshold is used for improved edge search.Eliminate useless edges based on the characteristics of the rail edges,obtain edge images and conduct experimental comparison and verification.For two cases whether or not the edge image of the rail can be accurately obtained,the least squares method is used to fit the curve using different methods to obtain the curve equation.Design a curve equation for dividing hazardous areas based on the curve equation,divide the hazardous areas and conduct experimental verification.(2)Research on improving the Visual Background Extractor(Vi Be)algorithm for detecting foreign objects in railway tracks.To address the ghost shadows problem of the Vi Be algorithm and the issue of slight camera shake caused by wind or train passing that affects the detection performance,improvements have been made to the Vi Be algorithm.The Lucas-Kanade Derivative of Gaussian(LKDo G)method is used to detect optical flow points in each image frame.Based on the characteristics of ghost shadows not producing optical flow points and the small amplitude of optical flow points generated by jitter,remove optical flow points with small amplitude.Using the Vi Be algorithm for detection,only the connected areas that coincide with the larger amplitude optical flow points are retained for the detection results.Perform ghost shadows removal and jitter impact elimination on videos in railway scenes containing ghosts shadows and jitters,and complete experimental verification and comparative analysis of foreign object detection.(3)Research on improving YOLOv4-tiny algorithm for detecting foreign objects in railway tracks.Utilize network resources to collect images containing foreign objects in railway scenes,expand and annotate them,then combine them with the VOC2007 dataset to establish a new dataset.The network structure of YOLOv4-iny algorithm has been improved by adding a Spatial Pyramid Pooling(SPP)network and a detection head to better utilize feature images.Due to the impact of the original detection head combining regression and classification on experimental results,a new type of detection head is designed to separate the two,and a Convolutional Block Attention Module(CBAM)is added to make the network pay more attention to the objects that need to be detected.In order to solve the problem of small data set and reduce training time,transfer learning is introduced to train the network.Design relevant experiments for verification and analysis.(4)Forewarning research.Combined with the characteristics of the binary image of the detection result of the improved Vi Be algorithm,calculate the proportion of the area of foreign matters in the hazardous area and the area of the hazardous area,and compare with the threshold value to determine whether forewarning is needed.Based on the characteristics of foreign object coordinates obtained by the improved YOLOv4 tiny algorithm,analyze and retrieve whether the foreign object coordinate points are within the hazardous area,and determine whether forewarning is necessary.Conduct experimental verification on the warning design of two algorithms. |