10
10
*/
11
11
#include " HumanDetector.h"
12
12
/* *
13
- * @brief
13
+ * @brief detection : Runs the neural network to detect humans.
14
14
*
15
- * @param net
16
- * @param blob
17
- * @return vector<cv:: Mat>
15
+ * @param net : DNN network object
16
+ * @param blob : A 4D matrix
17
+ * @return vector<Mat> A matrix with bounding boxes and scores
18
18
*/
19
19
vector<Mat> HumanDetector::detection (Net& net, Mat& blob) {
20
20
net.setInput (blob);
@@ -24,11 +24,13 @@ vector<Mat> HumanDetector::detection(Net& net, Mat& blob) {
24
24
return outs;
25
25
}
26
26
/* *
27
- * @brief
27
+ * @brief postProcess : Performs confidence thresholding and
28
+ * non-max suppression.
28
29
*
29
- * @param frame
30
- * @param outs
31
- * @return vector<cv::Rect>
30
+ * @param frame : Current camera frame
31
+ * @param outs : A matrix with bounding boxes and scores
32
+ * @return vector<Rect> : Dimensions of the bounding
33
+ * boxes for each human detected in frame.
32
34
*/
33
35
vector<Rect> HumanDetector::postProcess (Mat& frame, const vector<Mat>& outs) {
34
36
vector<int > classIds;
@@ -83,16 +85,17 @@ vector<Rect> HumanDetector::postProcess(Mat& frame, const vector<Mat>& outs) {
83
85
}
84
86
85
87
/* *
86
- * @brief
88
+ * @brief drawBoundingBoxes : Draws bouding boxes around each
89
+ * human detected in frame.
87
90
*
88
- * @param classId
89
- * @param confidence
90
- * @param left
91
- * @param top
92
- * @param right
93
- * @param bottom
94
- * @param frame
95
- * @return int
91
+ * @param confidence : Confidence for each detection
92
+ * @param left : bounding box dimension
93
+ * @param top : bounding box dimension
94
+ * @param right : bounding box dimension
95
+ * @param bottom : bounding box dimension
96
+ * @param frame : Current camera frame
97
+ * @param human_number : Number of humans detected
98
+ * @return int : flag for indication
96
99
*/
97
100
int HumanDetector::drawBoundingBoxes (double confidence, int left, int top,
98
101
int right, int bottom, Mat& frame, int human_number) {
@@ -117,9 +120,8 @@ int HumanDetector::drawBoundingBoxes(double confidence, int left, int top,
117
120
cv::FONT_HERSHEY_SIMPLEX, 0.75 , cv::Scalar (0 , 0 , 0 ), 1 );
118
121
return 0 ;
119
122
}
120
-
121
123
/* *
122
- * @brief
124
+ * @brief Get the Outputs Names object
123
125
*
124
126
* @param net
125
127
* @return vector<string>
0 commit comments