Abstract:The vehicle flow detection plays an important role in the field of the intelligent transportation systems(ITS).The vehicle flow detection focuses on detection and counting of the vehicles in the surveillance videos. However, it requires to present a kind of effective background modeling and accurate vehicle counting method.In this paper, we proposed the background subtraction (BS) and the Gaussian mixture model (GMM) for improving the detection quality of the moving vehicles. In addition, we set up the virtual loops for vehicle counting by the connected component analysis (CCA) method and the region gray average values (RAGV) method. The experiment results showed that the RAGV method was superior to the CCA method. The RAGV method could solve the problem of the missing vehicles. The accuracy of vehicle counting could be improved significantly and reach 94% by the RAGV method.