In the paper ,linear light source of the near-infrared laser ,CCD technology and computer image processing technology have been applied , and the real-time image of rail cross-section has been acquisitioned. At the same time ,the parameter value of rail cross-section abrasion has been obtained fast and accurately. Importantly ,the reliable data has been provided for safety running of the railway.