The gauge detection between high signal and contact net is an important part in railway safety production. According to the detection nature, this paper designed a visual detection system to solve the problem of gauge detection between high signal and contact net. Using template matching method to break up the gray target image, and using discovering turning point method to rebuild target in space. Then according to the principle, it prepared detection system based on VC++2008 and OpenCV. The experiment results showed that: measurement error was within士15mm, when detection distance was arrange from 45.0m to 55.0m. Detection system which had high accuracy and good reliability, met system design requirements.