Surveillance cameras have been widely installed in cities all over the world in recent years. Counting pedestrians from cameras has become a very important issue in intelligent video surveillance. However, factors such as occlusions, noise, camera perspective, background clutter may affect the accuracy of pedestrian counting. This paper introduces a pedestrian counting method for high-density crowd scenes using cross-sectional flow statistics. The proposed method consists of a new foreground detection algorithm based on the gradient motion history image, an improved feature-based counting algorithm by an effective motion image, and a moving speed extraction algorithm using optical flows. The experimental results show that the proposed method is robust and effective for counting pedestrians.