Considering some existing shortcomings in traffic flow statistics algorithm based on background subtraction and virtual loop, according to the change discipline of inter-frame similarity while vehicles passing in and out the virtual loop, we come up with a traffic flow statistics algorithm based on inter - frame similarity, which is able to overcome two problems: one is missed inspection since some detection targets are close to background color; the other one is repeated detection resulting from over-low speed, then we carry out the experimental results by using the algorithm.