Lane detection is the basic step of intelligent traffic monitoring and automatic driving. A real-time lane detection algorithm is proposed to improve its robustness and real-time performance for the automatic driving application in complex urban traffic scenes. The improved grayscale transformation highlights the lane feature and enhances the edge information of the lane line by the improved Gabor filtering algorithm. Finally, the multi-constrained Hough transform is used to obtain the parallel lane line to realize the real-time lane detection. The experimental results show that this method improves the accuracy and processing speed of lane detection under three different real traffic road scenarios, and our method can be applied to the real-time lane detection system.