Use a human detector applied on each frame for basic statistic exports:
OpenCV has one already:
http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html
All you have to do is replace the face model with a human body (_fullbody.xml
):
https://github.com/Itseez/opencv/tree/master/data/haarcascades
You can now export some statistics such as how many people per frame there are. To find how many unique individuals appeared in a sequence, you'll need a tracker. From there things get more difficult. You'll have to find something that suits your case. Tip: google for "multi-target tracking code" or similar.