Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Count the number of people in the video

I am working on image processing and computer vision project. The project is to count the number of people entering the conference. This need to done in OpenCV or Python.

I have already tried the Haar Cascade that is available in OpenCV for Upper body: Detect upper body portion using OpenCV

However, it does not address the requirement. The link of the videos is as follows:

https://drive.google.com/open?id=0B3LatSCwKo2benZyVXhKLXV6R0U

If you view the sample1 file, at 0:16 secs a person is entering the room, that would always be the way. The camera is on top of the door.

like image 944
rahul_champ Avatar asked May 05 '16 21:05

rahul_champ


Video Answer


1 Answers

Identifying People from this Aerial Video Stream

I think there is a simple way of approaching this problem. Background subtraction methods for detecting moving objects are just what you need because the video you provided seems to only have one moving object at any point: the person walking through the door. Thus, if you follow this tutorial in Python, you should be able to implement a satisfying solution for your problem.

Counting People Entering / Exiting

Now, the first question that pops to my mind is what might I do to count if multiple people are walking through the door at separate time intervals (one person walks in 10 seconds into the video and a second person walks in 20 seconds into the video)? Here's the simplest solution to this consideration that I can think of. Once you've detected the blob(s) via background subtraction, you only have to track the blob until it goes off the frame. Once it leaves the frame, the next blob you detect must be a new person entering the room and thus you can continue counting. If you aren't familiar with how to track objects once they have been detected, give this tutorial a read. In this manner, you'd avoid counting the same blob (i.e., the same person) entering too many times.

The Difficulties in Processing Complex Dynamic Environments

If you think that there is a high level of traffic through that doorway, then the problem becomes much more difficult. This is because in that case there may not be much stationary background to subtract at any given moment, and further there may be a lot of overlap between detected blobs. There is a lot of active research in the area of autonomous pedestrian tracking and identification - so, in short, it's a difficult question that doesn't have a straightforward easy-to-implement solution. However, if you're interested in reading about some of the potential approaches you could take to solving these more challenging problems in pedestrian detection from an aerial view, I'd recommend reading the answers to this question.

I hope this helps, good luck coding!

like image 102
Vladislav Martin Avatar answered Oct 06 '22 19:10

Vladislav Martin