Skip to content

Commit af9f629

Browse files
committed
2 parents fbda52a + ab58f1b commit af9f629

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

README.md

+30-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Human detection and Tracking
22
## Introduction
3-
_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](http://opencv.org)._**This code is built on opencv 3.1.1 and python 3.4**
3+
_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](http://opencv.org)._**This code is built on opencv 3.1.1, python 3.4 and C++.**
44
## Requirements
55
* **opencv**
66
* **Installation in linux:**
@@ -16,6 +16,8 @@ _In this project we have worked on the problem of human detection,face detection
1616
* Imutils
1717
* numpy
1818

19+
* **C++**
20+
1921
## Approach
2022
* The code follows the steps given below:
2123
1. First it reads a video and process each frame one by one.
@@ -24,15 +26,39 @@ _In this project we have worked on the problem of human detection,face detection
2426
4. if a human face is detected it tries to recognize it with a pre-trained model file.
2527
5. If human face is recognized it puts the label on that human face else it moves to step 2 again for next frame
2628
* The repository is structured as follows:
27-
* `main.py` : This is the main file that detects and recognizes humans.
29+
* `main.py` : This is the main python file that detects and recognizes humans.
30+
* `main.cpp` : This is the main C++ file that detects and recognizes humans.
2831
* 'create_face_model.py' : This python script is used to create model file using the given data in `data/` folder
2932
* 'model.yaml' : This file contains trained model for given data. This trained model contains LBPH features of each and every face for given data.
3033
* `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.
3134
* `scripts/` : This directory contains some useful scripts that we used to work on different problems.
35+
* `video/` : This directory contains some of the videos that we used to while testing.
3236

3337
## Installation
34-
* To run the code you have put all the input videos in one folder and then provide the path of that folder as command line argument.
35-
`python3 main.py /path/to/input/videos/`
38+
* To run the python version of the code you have to put all the input videos in one folder and then provide the path of that folder as command line argument:
39+
```sh
40+
python3 main.py /path/to/input/videos/
41+
```
42+
Example- for our directory structure it is:
43+
```sh
44+
python3 main.py /video
45+
```
46+
* To compile the C++ version of the code with openCV the command is:
47+
```sh
48+
g++ -ggdb `pkg-config --cflags opencv` -o `basename name_of_file.cpp .cpp` name_of_file.cpp `pkg-config --libs opencv`
49+
```
50+
Example- for our directory structure it is:
51+
```sh
52+
g++ -ggdb `pkg-config --cflags opencv` -o `basename main.cpp .cpp` main.cpp `pkg-config --libs opencv`
53+
```
54+
* To run the C++ version of the code you have to put all the input videos in one folder and then provide the path of that video as command line argument:
55+
```sh
56+
./name_of_file /path/to/input/video_file
57+
```
58+
Example- for our directory structure it is:
59+
```sh
60+
./main /video/2.mp4
61+
```
3662
* creating your own model file; just follow the steps given below to create your own model file:
3763
* for each individual rename the images as `subjectx.y.jpg` for example for person 1 images should be named as 'subject01.0.jpg' , `subject01.1.jpg` and so on.
3864
* put all the images of all the persons in a single folder then run this command given below:

0 commit comments

Comments
 (0)