To improve the robustness of rail defect segmentation to noise,a rail defect segmentation method based on improved Markov random field(MRF)was proposed.The background difference method was used to pre-process the gray level,eliminating the interference of uneven distribution of gray level.For the premise part of the fuzzy IF-THEN rule,Markov random field was used to utilize the spatial constraints in the image,and the result part specified the distance map algorithm of the pixels.By incorporating local spatial information between adjacent pixel images using Markov random field(MRF),a new autom...