This paper analyzed the features of nighttime complex traffic scenes,and proposed the HLEPT algorithm to collect nighttime traffic information.It contained a headlight extraction algorithm and regulations of pairing and tracking,integrating with two methods: pre-pairing headlights and post-tracking trajectories,pre-tracking headlights and post-pairing trajectories,and finally measured the traffic flow and velocity.Experiment results indicate that this algorithm is robust with low computational complexity and real-time performance,and its detection ratio reaches above 96% in fine condition,88% in a traffic jam at rainy night when inverted reflections of lights exist.