Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

People counting using OpenCV

Tags:

opencv

I'm starting a search to implement a system that must count people flow of some place. The final idea is to have something like http://www.youtube.com/watch?v=u7N1MCBRdl0 . I'm working with OpenCv to start creating it, I'm reading and studying about. But I'd like to know if some one can give me some hints of source code exemples, articles and anything elese that can make me get faster on my deal.

I started with blobtrack.exe sample to study, but I got not good results.

Tks in advice.

like image 326
Rodrigo Farias Rezino Avatar asked Apr 06 '11 02:04

Rodrigo Farias Rezino


1 Answers

Blob detection is the correct way to do this, as long as you choose good threshold values and your lighting is even and consistent; but the real problem here is writing a tracking algorithm that can keep track of multiple blobs, being resistant to dropped frames. Basically you want to be able to assign persistent IDs to each blob over multiple frames, keeping in mind that due to changing lighting conditions and due to people walking very close together and/or crossing paths, the blobs may drop out for several frames, split, and/or merge.

To do this 'properly' you'd want a fuzzy ID assignment algorithm that is resistant to dropped frames (ie blob ID remains, and ideally predicts motion, if the blob drops out for a frame or two). You'd probably also want to keep a history of ID merges and splits, so that if two IDs merge to one, and then the one splits to two, you can re-assign the individual merged IDs to the resulting two blobs.

In my experience the openFrameworks openCv basic example is a good starting point.

like image 153
damian Avatar answered Sep 23 '22 10:09

damian