Human-detection-and-Tracking
In this project we have worked on the problem of human detection,face detection, face recognition and tracking an individual. Our project is capable of detecting a human and its face in a given video and storing Local Binary Pattern Histogram (LBPH) features of the detected faces. LBPH features are the key points extracted from an image which is used to recognize and categorize images. Once a human is detected in video, we have tracked that person assigning him a label. We have used the stored LBPH features of individuals to recognize them in any other videos. After scanning through various videos our program gives output like- person labeled as subject1 is seen in video taken by camera1, subject1 is seen in video by camera2. In this way we have tracked an individual by recognizing him/her in the video taken by multiple cameras. Our whole work is based on the application of machine learning and image processing with the help of openCV.This code is built on opencv 3.1.1, python 3.4 and C++, other versions of opencv are NOT SUPPORTED.
For complete installation of opencv in ubuntu you can refer [here](http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/).
For complete installation of opencv in windows you can refer [here](https://putuyuwono.wordpress.com/2015/04/23/building-and-installing-opencv-3-0-on-windows-7-64-bit/)
sudo apt-get install python3
python libraries:
Here is a list of all the python dependencies
C++
main.py
: This is the main python file that detects and recognizes humans.main.cpp
: This is the main C++ file that detects and recognizes humans.create_face_model.py
: This python script is used to create model file using the given data in data/
folder model.yaml
: This file contains trained model for given data. This trained model contains LBPH features of each and every face for given data.face_cascades/
: This directory contains sample data for testing our codes. This data is prepared by extracting face images of a praticular person from some videos.scripts/
: This directory contains some useful scripts that we used to work on different problems.video/
: This directory contains some of the videos that we used to while testing.Don’t forget to install the necessary libraries described in the install paragraph above.
First you need to run the create_face_model.py file, which uses the images in /data to create a .yaml file
python create_face_model.py
Example- for our directory structure it is:
python3 main.py -v /path/to/input/videos/
python3 main.py -v /video
Example- for our directory structure it is:
g++ -ggdb `pkg-config --cflags opencv` -o `basename name_of_file.cpp .cpp` name_of_file.cpp `pkg-config --libs opencv`
g++ -ggdb `pkg-config --cflags opencv` -o `basename main.cpp .cpp` main.cpp `pkg-config --libs opencv`
Example- for our directory structure it is:
./name_of_file /path/to/input/video_file
./main /video/2.mp4
subjectx.y.jpg
for example for person 1 images should be named as subject01.0.jpg
, subject01.1.jpg
and so on.data\
folder then run this command given below:python3 create_face_model.py -i /path/to/persons_images/
You can find project report here