You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
20
21
21
22
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.
22
23
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
+
<imgalt="demo"src="assets/demo.png"width="75%" />
30
+
31
+
The location information in the robot frame can be seen as :
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).
60
70
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 :
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).
63
81
64
82
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:
81
99
> y = position[0] (1)
82
100
> z = position[0] (2)
83
101
84
-
## Steps to Run the application
102
+
## Steps to Run the demo application
85
103
Run the following commands in the root folder to build and run the Human Detector and Tracker
86
104
87
105
sh getModels.sh
88
106
sh build_with_coverage.sh
89
107
sh run_app.sh
108
+
With the output window in focus, press `Esc` to terminate the application.
90
109
91
110
## Running Unit tests
92
111
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.
93
112
Execute these commands in the root folder to run the test cases:
94
113
```
95
114
sh run_tests.sh
96
115
```
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
+
97
118
## Running cpplint & cppcheck tests
98
119
Run the following command in the root directory to generate cpplint results in **results** folder
99
120
@@ -116,14 +137,30 @@ sudo apt-get install lcov
116
137
sh build_with_coverage.sh
117
138
```
118
139
## 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:
120
141
121
142
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.
122
148
123
149
## Phase 1
124
150
125
151
- Defined Robot, HumanDetector and test classes according to the UML diagrams.
126
152
- Implemented all Robot and HumanDetector methods except for transformToRobotFrame method.
127
153
- 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.
0 commit comments