Pedestrian counting is already an important area, and the number of people is an important factor in the management and decision-making of public places, it plays a very important role in social security and control management. In this paper, we present a video surveillance system for automatic pedestrian counting, which includes pedestrian detection and pedestrian counting. The people flow is counted in the observation area, the foreground image of the moving person is obtained by foreground detection, and the morphological method is used to optimize, and then the adaboost classifier based on Haar-ike feature is used to detect the head, and use The CSRT tracker tracks the head ,and finally uses the tracking information to complete the counting work. Our results demonstrated a preliminary success with the accuracy of ~85%, indicating that our system may potentially be used in real scenarios.