The people counting algorithms are widely applied in many areas. The algorithms may have lower counting accuracy or higher time complexity. To improve that, a new and high-accuracy people counting algorithm is proposed in this paper. It analyzes a background image and series population original images to calculate an average proportion for one person and create a two-dimensional table. Then it uses the average proportion and the two-dimensional table to count the number of people in test images. And two thresholds are adopted to regulate accuracy in counting.