In order to solve the problem of rear-end collision on the road in foggy environment, this paper constructs an experimental platform to process the vehicle foggy images rapidly and measure distance of front vehicles in real-time. The existing studies on fog removal algorithm is directly applied to road images. This is easy to cause many problems, such as low brightness of the near road surface area and the far sky area, the degree of fog removal in the middle area is low and the real-time performance is poor. So, we first down sample the image based on the dark channel principle to improve the real-time performance of the algorithm. Second, we introduce a tolerance mechanism to deal with the bright regions that do not satisfy the dark channel prior. This tolerance mechanism corrects the misestimated refractive index of such a region and effectively solves problems of the color distortion and the low contrast. Then, we complete the vertical edges detection of the vehicle by using the ED algorithm and the improved Hough transform. Finally, we measure the safe distance of front vehicles by the measuring model. The result shows that the platform constructed in this paper is simple, effective and high real-time performance. And the details of traffic images are clearer. The maximum measured value of the front vehicle distance in foggy environment is increased. The platform we constructed can solve the rear-end problem in foggy environment effectively.