| Turnout is the critical track equipment of the Railway to achieve train lane running, an important factor of affecting turnout’s high-precision and smoothness is the manufacturing precision of the related size of turnout’s parts. Currently, to measure the size of turnout end face we usually use steel tape or other tools manually, however, the steel tape itself has indication error, and when measuring the tension change may cause reading error, what else, temperature changes may also lead to error. Each of them may result in the final measurement error. To solve the problems of manual measurement, like the accuracy is poor, low efficiency and poor consistency and so on, there proposed a size measurement of rail end face based on machine vision.Firstly, select suitable industrial cameras and lenses according to the experimental requirements and the actual situation. The choice of camera is DH-HV5051UM-M black and white industrial digital camera Daheng Image. The choice of lens is 5 megapixels low distortion lens fixed focus series(compact)- M2518-MPW2 of Computer. According to the purpose and environment of the experiment, with the assist of the light, use the way of forward lighting to collect the images of the rail end face.Secondly, do the processing on the rail end face images. Proposed a rail end face contour extraction algorithm combined with mathematical morphology and dynamic threshold. The process includes Median filter; designed a rice-shaped structural elements based on Mathematical Morphology on the image denoising; then use an improved OTSU algorithm combined with the gradient magnitude histogram automatically determine the threshold, by dual threshold detection, extract a complete clear contour of the rail end face.Thirdly, use Hough transform to extract lines on the contour image. For the case of the occurrence of a plurality of straight lines of same position, use K-means clustering algorithm and fitted them into a straight line. And based on the principle of least squares curve fitting, and then get the relevant parts of the rail end face of the pixel size.Finally, the camera calibration. Zhang Zhengyou calibration method by extracting corners of the Reversing calibration plate, get the internal and external parameters of the camera. Combining the results of the calibration to calculate the actual size of the end face of the rail and do the error analysis on measurement results. |