Skip to content

Commit 2c56684

Browse files
authored
Merge pull request #10 from llDev-Rootll/development
Development -> Master
2 parents 52982dc + 7703b7b commit 2c56684

File tree

8 files changed

+47
-10
lines changed

8 files changed

+47
-10
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23

34
# Human_Detection_Tracking-CPP
45
[![Build Status](https://app.travis-ci.com/llDev-Rootll/Human_Detection_Tracking-CPP.svg?branch=master)](https://app.travis-ci.com/llDev-Rootll/Human_Detection_Tracking-CPP)
@@ -9,18 +10,27 @@ A C++ module to detect and track humans which outputs location information direc
910

1011
## Authors
1112
Sprint 1 -
12-
- Arunava Basu (Navigator)
13-
- Aditi Ramadwar (Driver)
13+
- [Arunava Basu](https://www.linkedin.com/in/abasu713/) (Navigator)
14+
- [Aditi Ramadwar](https://st1.zoom.us/web_client/5g6glw/html/externalLinkPage.html?ref=https://www.linkedin.com/in/aditiramadwar/) (Driver)
1415

1516
Sprint 2 -
16-
- Arunava Basu (Driver)
17-
- Aditi Ramadwar (Navigator)
17+
- [Arunava Basu](https://www.linkedin.com/in/abasu713/) (Driver)
18+
- [Aditi Ramadwar](https://st1.zoom.us/web_client/5g6glw/html/externalLinkPage.html?ref=https://www.linkedin.com/in/aditiramadwar/) (Navigator)
1819
## Introduction
1920
Human detection or person detection is the computer vision task of the localization and classification of human being(s) in an image. This is a key part in robotic applications for various reasons such as safety, obstacle avoidance, collaborative robotics, etc.
2021

2122
We aim to design and deliver a robust robust human obstacle detector and tracker using a monocular camera, directly usable in a robot’s reference frame according to the requirement specifications provided to us by ACME robotics's RnD division for integration into a future product.
2223

23-
Our system is built using C++ and will employ the robust YOLOv3 neural network model trained on the COCO dataset for human detection and tracking as it is one of the most accurate real-time object detection algorithms. A one time calibration is performed to calculate certain calibration metrics for the transformation of location info into the camera frame. An image from a monocular camera is pre-processed and passed to the model which outputs the location info in the image frame. It is then converted to the camera frame by using the calibration constants and then transformed into the robot's frame.
24+
Our system is built using C++ and will employ the robust YOLOv3 neural network model trained on the COCO dataset for human detection and tracking as it is one of the most accurate real-time object detection algorithms. An image from a monocular camera is pre-processed and passed to the model which outputs the location info in the image frame. It is then converted to the camera frame by using the calibration constants and then transformed into the robot's frame.
25+
26+
## Sample result
27+
The boxes in the image frame can be seen as :
28+
29+
<img alt="demo" src="assets/demo.png" width="75%" />
30+
31+
The location information in the robot frame can be seen as :
32+
33+
<img alt="demo_loc" src="assets/demo_loc.png" width="75%" />
2434

2535
## Project Collaterals
2636
The Agile Iterative Process will be used for the development of this system consisting of two sprints.
@@ -52,13 +62,21 @@ sh install_dependencies.sh
5262

5363
## System Architecture
5464
The following shows the activity diagram for our proposed schema :
55-
<img alt="activity" src="assets/activity.png" width="75%" />
65+
<img alt="activity" src="assets/activity_diag.png" width="75%" />
5666

5767
*Fig 1 : Activity Diagram*
5868

5969
The corresponding class diagram can be found [here](https://github.com/llDev-Rootll/Human_Detection_Tracking-CPP/blob/development/UML/revised/Revised_Class_Diagram.pdf).
6070

61-
## Output Data Explained
71+
## Few key points in the implementation
72+
### Depth estimation in monocular camera
73+
The depth was calculated by estimating the focal length of a camera using the pixel height of a bounding box enclosing a human and considering the real-life height to be 171.45 cm which is the mean height of a person in the US. The focal length can be changed using the setter function as per need.
74+
75+
Consequently the distance is calculated for each detected human as :
76+
77+
Depth = 171.45 * Estimated_focal_length / Pixel_height_of_bbox_around_a_human
78+
79+
### Output data format explained
6280
At the output of the Human Detection module from the `detectHumans` method we get a vector of Rects ('Rect' is a data type in OpenCV).
6381

6482
The structure of Rect is: (x, y, z, redundant); It has four parameters,
@@ -81,19 +99,22 @@ Example for location extraction of one of the coordinates of the first human:
8199
> y = position[0] (1)
82100
> z = position[0] (2)
83101
84-
## Steps to Run the application
102+
## Steps to Run the demo application
85103
Run the following commands in the root folder to build and run the Human Detector and Tracker
86104

87105
sh getModels.sh
88106
sh build_with_coverage.sh
89107
sh run_app.sh
108+
With the output window in focus, press `Esc` to terminate the application.
90109

91110
## Running Unit tests
92111
Unit Testing will be used to test each submodule and ensure complete code coverage. For this Google Gtest will be leveraged and identical test classes and methods will be created with minimal modification in order to facilitate testing.
93112
Execute these commands in the root folder to run the test cases:
94113
```
95114
sh run_tests.sh
96115
```
116+
A final test case was written to check for the accuracy of detection with a certain margin of error by calculating the euclidean distance between the detected centroids and the ground truth centroids. Ground truth data was obtained by manually annotating the capture image using [Labelmg](https://github.com/tzutalin/labelImg).
117+
97118
## Running cpplint & cppcheck tests
98119
Run the following command in the root directory to generate cpplint results in **results** folder
99120

@@ -116,14 +137,30 @@ sudo apt-get install lcov
116137
sh build_with_coverage.sh
117138
```
118139
## Generate Doxygen documentation
119-
Run the following command in the root folder:
140+
Run the following command in the root folder to generate the documentation in the `docs` folder:
120141

121142
sh create_doxy_docs.sh
143+
## Known Issues and bugs
144+
145+
- Depth estimation assumes that the camera and the human are on the same plane, the human is standing upright and there is no occlusion present.
146+
- API can be made more robust by using more complex methods of depth estimation.
147+
- Average human height is assumed to be 171.45 cm, which is the average in the US.
122148

123149
## Phase 1
124150

125151
- Defined Robot, HumanDetector and test classes according to the UML diagrams.
126152
- Implemented all Robot and HumanDetector methods except for transformToRobotFrame method.
127153
- Definition and implementation of test cases are planned for Phase 2.
128-
Please refer to the backlog table, [here](https://docs.google.com/spreadsheets/d/1tjJKUd9B4bBSYAHnrwuMjWNl_lUBmqeB6lw7iTNKZSg/edit?usp=sharing), for an exhaustive list tasks completed in Phase 1.
154+
Please refer to the backlog table, [here](https://docs.google.com/spreadsheets/d/1tjJKUd9B4bBSYAHnrwuMjWNl_lUBmqeB6lw7iTNKZSg/edit?usp=sharing), for an exhaustive list of tasks completed in Phase 1.
155+
## Phase 2
156+
- Test classes created in Phase 1 were removed after careful considerations
157+
- Setter and getter methods were created for helper functions
158+
- A proper structure for testing each class was created
159+
- transformToRobotFrame was implemented
160+
- A method for depth calculation was created
161+
- Unit tests for all methods were created
162+
- UMLs were revised
163+
- Generated github and doxygen documentation
164+
- All requirements were successfully delivered
165+
Please refer to the backlog table, [here](https://docs.google.com/spreadsheets/d/1tjJKUd9B4bBSYAHnrwuMjWNl_lUBmqeB6lw7iTNKZSg/edit?usp=sharing), for an exhaustive list of tasks completed in Phase 2.
129166

-34.7 KB
Binary file not shown.
34.2 KB
Binary file not shown.
-3.86 KB
Binary file not shown.

assets/activity.png

-62.1 KB
Binary file not shown.

assets/activity_diag.png

63.6 KB
Loading

assets/demo.png

1.8 MB
Loading

assets/demo_loc.png

68.7 KB
Loading

0 commit comments

Comments
 (0)