Detection algorithm of lane line under the special condition is based on focal and difficult point of lane line departure warning system of computer vision. This article firstly deals with the image compression and grayscale, establishes reasonable region of interest, and remove the non-road information in the image; Then we proceed the probabilistic and statistical computing for the image pixels, draw the gray level histogram. By analyzing the dynamic gray level histogram, we identify the lane line and grey value of the road and automatically calculate the reasonable threshold to binarizate then denoise the images. Last we label the images to reach the goal of identification of lane line and establishment the space between lane line and vehicles. The test results show that: the algorithm mentioned in this paper can not only detect the lane line accurately in real time, but also it enjoys a wide range of applicability to provide reference for improvement of lane line departure warning system.