Q:

Count people standing in front of our Kinect

We are making an interactive installation with a Kinect, and we need to know how many people are standing / walking slowly in front of our installation.
We will count up to 5 people, if there is more we don't care.
To do that we take the total volume of blobs detected by the Kinect, divide it by the approximative volume of 1 person.
count = Vtotal / Vperson;

Finally, to smoothen the count, we calculate the average count on 2 seconds.
countAvg = Vtotalavg / Vperson;

This works OK-ish for 2-3 people, but when there is more, the blobs overlap, and the total volume doesn't seem to be relevant anymore.
Does somebody have an idea how we could solve this and have a reliable count ... either by using the same blob volume method, or something smarter !?

A:

Ceiling-mount the kinect. Point it straight down at the floor. Take raw depth data and filter any pixels further away than a certain threshold that tends to capture heads and shoulders only. (Try everything higher than 4 feet.) Of those pixels, examine each group of contiguous pixels and get a total pixel count for that group. If the group pixel count is less than a minimum threshold, ignore it. You could now just count each group as one person, but a further refinement helps catch people standing very close: divide the group pixel count by an average-pixels-per-person constant and round to nearest value.
It works.

