This is a simple example to show you how to count the flow of pedestrian by opencv. Since this algorithm rely on tracking algorithm, we can expect the limitation of tracking algorithms apply on it too.
- Camera must be fixed
- Occlusion
- Crowded scenes
- Object cannot move too fast
- Frame rate cannot be too low and need to be stable
Although there are many limitations, I think this is still a good start for pedestrian flow counter. To make things easier to understand, I design the api careful and separate the operations into different modules.
##How to compile 0. This project rely on makefile generator of Qt5, please install latest Qt5 in your pc
- Create a folder on your pc, let us assume it called my_folder
- Go to my_folder, open your terminal and type "git clone https://github.com/stereomatchingkiss/ocv_libs", you do not need to build the whole lib because I use some headers of this lib only
- Type "git clone https://github.com/stereomatchingkiss/pri"
- Type "git clone https://github.com/stereomatchingkiss/pedestrian_flow_counter_by_opencv"
- If your opencv do not compile with tbb, remove the "include(../pri/tbb.pri)" in "people_counter.pro"
- If your opencv do not compile with cuda, remove "DEFINES += OPENCV_USE_CUDA" in "people_counter.pro"
- Install opencv3.2 on your pc, set the include path and link to the libraries. The keywords you need to know are "qmake INCLUDEPATH" and "qmake LIBS"
- Use QtCreator to open "people_counter.pro"
- Click "Project" icon on left sidebar
- Click "Run" text on left sidebar
- Enter video link in "command line arguments"(ex : /home/ramsus/Qt/computer_vision_dataset/human_count/peopleCounter.avi)
- Change to release and click run(on left sidebar)
- If you still cannot figure out how to compile this project, please open an issue on github
##Links