Lane detection based on machine vision, a key application in intelligent transporta?tion,is generally characterized by gradient information of lane edge and plays an important role in advanced driver assistance systems (ADAS). However, gradient information varies with illumination changes. In the complex scenes of urban roads, highlight and shadow have effects on the detection, and non-lane objects also lead to false positives. In order to improve the accu?racy of detection and meet the robustness requirement, this paper proposes a method of using top-hat transformation to enhance the contrast and filter out the interference of non-lane ob?jects. And then the threshold segmentation algorithm based on local statistical information and Hough transform algorithm with polar angle and distance constraint are used for lane fitting. Fi?nally, Kalman filter is used to correct lane lines which are wrong detected or missed. The exper?imental results show that computation times meet the real-time requirements, and the overall detection rate of the proposed method is 95.63%.