In order to solve the moving target detecting and tracking in video sequence, the algorithm tracking follow detecting is proposed. First, it updated background model using the averaging background method, and detected the moving target. Then the size of the moving target was acquired by projection method. Finally, it tracked the moving target using the MeanShift tracking algorithm. During the object tracking, it programmed by the OpenCV to achieve the moving target detecting and tracking. The experiments show that the algorithm not only realize the detecting and tracking of the moving target exactly, but also reduce the amount of calculation and improve the tracking efficiency.