0

I have been trying to detect multiple people in a small space and hence track them.

Input: CCTV feed from a camera mounted in a small room.

Expected Output: Track and hence store the path that people take while moving from one end of the room to the other.

I tried to implement some of the basic methods like background subtraction and pedestrian detection. But the results are not as desired.

In the results obtained by implementing background subtraction, due to occlusion the blob is not one single entity(the blob of one person is broken into multiple small blobs) hence, detecting it as a single person is very difficult. Now, consider the case when there are many people standing close to each other. In this case detecting people using simple background subtraction is a complete disaster.

Is there a better way to detect multiple people? Or maybe is there a way to improve the result of background subtraction?

And please suggest a good way for tracking multiple people?

sinhar303
  • 11
  • 6
  • This is a very broad question and a difficult underlying problem. Consider if some people are not moving, they become part of the background too. So each tracked person has to be tracked in the context of a different background. Possibly. [This answer](http://stackoverflow.com/a/16674197/2065121) has some useful links. – Roger Rowland Jan 08 '14 at 05:49
  • You are right Sir. People not moving do become a part of the background. Thank you for the link. I have already seen some of the methods discussed, like shape matching and all. But to be very frank I get the idea, but I am still not sure how to implement all this. Can you please help me with some samples? – sinhar303 Jan 08 '14 at 06:04
  • There is [some sample code here](https://bitbucket.org/rodrigob/doppia) - it is cutting-edge research, this is not a trivial problem and your question is way too broad for StackOverflow. – Roger Rowland Jan 08 '14 at 06:13
  • Thank you. I'll try and make my question more specific. – sinhar303 Jan 08 '14 at 06:17

1 Answers1

2

that's a quite hard problem and there is no out-of-the-box solution, so you might have to try different methods.

In the beginning you will want to make some assumptions like static camera position and everything that's not background is a person or part of a person, maybe multiple persons. Persons can't appear within the image but they will have to 'enter' it (and are detected on entering and tracked after detection).

Detection and tracking can both be difficult problems so you might want to focus on one of them first. I would start with tracking and choose a probabilisic tracking method, since simple tracking methods like tracking by detection probably can't handle overlap and multiple targets very well.

Tracking: I would try a particle filter, like http://www.irisa.fr/vista/Papers/2002/perez_hue_eccv02.pdf which is capable to track multiple targets.

Detection: There is a HoG Person Detector in OpenCV which works quite fine for upright persons

HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());

but it's good to know the approximate size of a person in the image and scale the image accordingly. You can do this after background subtraction by scaling the blobs or combination of blobs, or you use a calibration of your camera and scale image parts of size 1.6m to 2.0m to your HoG detector size. Otherwise you might have many misses and many false alarms.

In the end you will have to work and research for some time to get the things running, but don't expect early success or 100% hit rates ;)

I would create a sample video and work on that, manually masking entering people as detection and implement the tracker with those detections.

Micka
  • 19,585
  • 4
  • 56
  • 74