| As the main artery of transportation,railway plays a vital role in economic and social development.With the continuous improvement of the mileage,speed and density of railways,the defects generated on the surface of the rail can threaten driving safety and even endanger people’s property and life safety.At present,there are already defect detection methods,such as artificial detection method,electromagnetic vortex detection method,and ultrasonic detection.In view of the above problems,this thesis designed a rail surface defect detection system based on image processing,and carried out in-depth research on how to improve the detection speed and take into account the detection accuracy.The specific research work is as follows:(1)A set of hardware system is designed and built,which drives the rail to move horizontally through the motion platform.The industrial camera directly above the rail takes real-time photos of the rail surface.Considering the problem of light at night,a light source is placed on the slant of the rail to supplement the light,and the hardware involved in the hardware system is selected.(2)In view of the problem that external interference will lead to poor image quality,image preprocessing method is adopted to reduce the interference of external factors.Firstly,the image of rail surface is enhanced by nonlinear gray transform to enhance the contrast between the surface area and the background area.Secondly,the images of the rail images are performed through bilateral filtering to reduce the effect of noise on rail defect detection.After that,image deblurring is performed on the rail image through Wiener filtering,reducing the impact of motion blur on rail defect detection.Finally,the line segment detector(LSD)and vertical projection points are used to extract the rail area.The adaptive extraction of the edge coordinate information of the rail rails and cutting it to reduce the interference of the background environment of the rail rails,improve the accuracy of subsequent image detection.(3)In view of the fact that rail defects account for a small proportion in the image and the speed of the rail inspection vehicle is fast in the actual scene,this thesis proposes a defect detection method.First,the input image is processed with T2 T module to reduce the feature loss of the network model.After that,the lightweight Shufflenet module is used in the backbone network to improve the detection speed of the network and add the convolutional block attention module(CBAM)after the convolution module.CBAM emphasizes the feature map output by the convolution module.It can improve the extraction of judgment characteristics.Finally,add the TPH module to the 76*76 feature layer used to detect small targets to improve the accuracy of the network on small target defect detection.Through the comparative analysis of experiments,the m AP of this method is about 1.1% and 5.9% higher than that of YOLOv5 and YOLOv4,and the inference speed is about 20% and 27% higher.(4)The software system design is performed according to the detection system scheme to display the processing interface of the human-machine interaction.The software system calls the pre-processing algorithm and the detection algorithm of this article and conduct real-time testing of the track of the motion.After actual testing,the rail defect detection system designed in this article meets the requirements of defective real-time testing in terms of accuracy,real-time and robustness. |