A system for counting a number of people or other moving objects entering or leaving a space has a camera which provides an image of an entrance to the space. A data processor identifies moving objects in the image. The data processor is configured to count people or other objects which enter or leave an area within the image for two or more segments of a boundary of the area. Accuracy of the counting system can be monitored by comparing the counts for the different segments.