In this paper, a computer vision based person counting system is presented which not only counts the number of persons in the scene but also keeps track on the number of persons entering and leaving the scene. The proposed system analyzes the video sequences which are captured by an overhead camera installed at about 7 meters height. Several background subtraction algorithms were compared and the best suited and efficient algorithm i.e Mixture of Gaussian (MoG) is selected for person counting from an overhead view. Whereas, a rectangular virtual zone, which covers all sides of the scene, is defined for counting the persons leaving and entering the scene. Moreover, in the proposed system a new real-life dataset is created using a single overhead camera. Ground truth is used for evaluation of the proposed system. The proposed algorithm achieves an accuracy of 98% for person counting and 95% for persons entering and leaving in the virtual zone. The overall average accuracy of the proposed system is 96%.