| In recent years,railways have become an important means of transportation for the country,bringing great convenience to the masses and promoting the economic development of the country.The rails play an important role in the operation of the train.A qualified rail should be good enough in terms of strength,toughness,wear resistance,and the like.Due to the vigorous development of China’s railway transportation industry,the requirements for rails are getting higher and higher,and the damage and defects of rails will seriously affect the driving safety of trains.Therefore,this paper uses some image processing methods to detect the surface defects of the rails,and designs the detection system to focus on the identification,segmentation and classification of the surface defects of the rails.The main work is as follows:Firstly,according to the environmental requirements,an image acquisition defect recognition system was designed,and the types of equipment of the image acquisition system were selected.The image is then processed using an image acquisition module and displayed on a computer.Secondly,in the rail image preprocessing part,the image rail area extraction is selected by drawing the direction discrete map.The denoising method uses improved Wiener filtering,and its local mean term is calculated according to the bimodal detection result in different ways.The image enhancement method adopts nonlinear adjustment gamma correction.This method uses a nonlinear function to perform amplitude control on various types of pixel points to perform adaptive control of curvature.Then,in the rail image segmentation part,the parameters of the firefly algorithm are adjusted,and the initial randomized firefly points are matrix transformed.Experiments show that the improved firefly algorithm is superior to the basic firefly algorithm in accuracy and time.The improved firefly algorithm optimizes the maximum entropy image segmentation algorithm.The optimized algorithm is used to process the image of the rail defect image,which can effectively identify the defect of the image and is suitable for real-time situations.The Kirsch operator is used to segment the rail image.The disadvantage of this method is that because the threshold is artificially set and the edge point has a certain range of gray value floating,if the threshold setting is unreasonable,the points at both ends of the threshold will be partially erased.Therefore,the complete edge image is not obtained.Therefore,the threshold part of the Kirsch operator is improved,and the gray scale of the rail gray image is converted to the range suitable for human eye observation by linear transformation,and the interval boundary tracking algorithm is used.The regional connection solves the problem of the breakpoint of the segmentation boundary.This method is suitable for occasions with high precision requirements and has a good recognition effect for wave wear defects.Finally,different feature analysis methods are applied to the rail defects,and the geometric features and gray scale features of the defects are extracted and the improved BP neural network is used as the classifier to correctly classify the defect images. |