| With the rapid development of railway,the increase of train speed,the aggravation of operation burden and the influence of bad natural environment have caused irreversible damage to the rail and caused more and more defects to the rail.Due to the low efficiency and strong subjectivity of traditional manual inspection,and the high cost and low precision of ultrasonic inspection,magnetic particle method and eddy current inspection method,the track defect detection method based on machine vision arises at the historical moment and has become one of the research hotspots in recent years.Machine vision detection technology has the advantages of high precision,low cost,real time and so on,and has a broad application prospect.In this paper,based on the rail image data set collected and sorted by the laboratory,the relevant technology of rail surface defect detection is studied,and the following results are obtained.In order to highlight the defect part of the rail and facilitate the subsequent defect detection,a hierarchical image enhancement algorithm based on edge operator weighted guided filtering was proposed.The original image is filtered and layered,and the basic image and the detailed image are processed respectively to highlight the detailed information.The edge detection operator is introduced into the guided filter to preserve the edge information of the image to the maximum extent.AHE algorithm and Laplacian sharpening filter are used to overcome the problem of uneven brightness of the resulting image.Effectively improve the image contrast,enhance the detail information.A new LSD line detection algorithm based on bilateral filtering is proposed to improve Canny’s edge image extraction.Canny algorithm is used to extract edge images,and LSD line detection algorithm is used to extract line based on edge images.Considering that Gaussian filter is used in Canny edge detection,the image edge will be blurred while noise reduction,and bilateral filter has a better protection effect on the image edge,so the bilateral filter is used to replace Gaussian filter in Canny edge detection for edge image extraction.At the same time,the LSD straight line detection algorithm based on bilateral filtering improved Canny edge image extraction was applied to the rail surface boundary extraction.The rail surface boundary was extracted and marked,and the rail surface area was cut out to remove the interference of the rest of the image,to improve the efficiency of the subsequent defect detection algorithm.To solve the problems of low contrast and uneven illumination in rail images,and low contrast,intra-class difference and inter-class similarity in rail defects,a rail defect segmentation algorithm based on non-uniform illumination correction in rail images is proposed.Firstly,the image edge information is used to adjust the connection strength adaptively to improve the pulse coupled neural network,so as to correct the image illumination unevenness and retain the image edge information better,and then the gray scale transformation is carried out to further highlight the defects.The optimal image segmentation threshold after gray transformation is mainly determined by the target entropy,so the maximum entropy threshold segmentation is improved based on the image target entropy and the gray distribution probability of the background area,so that the segmentation threshold is more suitable for the segmentation of rail defects.Finally,through morphological processing,the image noise and small defects that do not threaten the safety of the train are removed to complete the defect detection of the rail.The proposed algorithm is compared with the related algorithms,and the results are evaluated from subjective evaluation and objective index.The proposed algorithm has a better effect and has a certain practical value in the field of orbit surface defect detection. |