Abstract:The vehicle counting algorithm based on virtual line inevitably exists the possibility of missing and error. Concerning this issue, this paper extracts and combines two types of image information- the virtual lines' relative positions with the objects and its pixel value variance, then a new vehicle segmentation and counting method is proposed. First, it determines the relative positions between the objects and the virtual lines, and combines with the variance of virtual lines' pixel value. With these information, it can improves the accuracy of the traffic flow by means of dividing vehicles. A testing system is developed for testing the performance of the method. The system has run in some kinds of weather, and its result is analyzed. The results show that the method has excellent performance both in real-time and accuracy in the daytime and the accuracy was above 95% for each lane of traffic. But the performance in the nighttime may not be optimal. Therefore, improvement is planned to make during following research.