Skip to content

Commit 0bdd2c4

Browse files
committed
Added doxygen comments
1 parent d305381 commit 0bdd2c4

File tree

2 files changed

+59
-21
lines changed

2 files changed

+59
-21
lines changed

include/HumanDetector.h

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,53 @@ using cv::dnn::Net;
2525
using cv::Rect;
2626
using cv::Size;
2727
/**
28-
* @brief
29-
*
28+
* @brief HumanDetector Class
29+
* A class for human detection and drawing bounding boxes
3030
*/
3131
class HumanDetector {
3232
private:
3333
float confidence_threshold = 0.5;
3434
float nms_threshold = 0.4;
35+
/**
36+
* @brief Get the Outputs Names object
37+
*
38+
* @param net
39+
* @return vector<string>
40+
*/
3541
vector<string> getOutputsNames(const Net& net);
3642
public:
43+
/**
44+
* @brief detection : Runs the neural network to detect humans.
45+
*
46+
* @param net : DNN network object
47+
* @param blob : A 4D matrix
48+
* @return vector<Mat> A matrix with bounding boxes and scores
49+
*/
3750
vector<Mat> detection(Net& net, Mat& blob);
51+
52+
/**
53+
* @brief postProcess : Performs confidence thresholding and
54+
* non-max suppression.
55+
*
56+
* @param frame : Current camera frame
57+
* @param outs : A matrix with bounding boxes and scores
58+
* @return vector<Rect> : Dimensions of the bounding
59+
* boxes for each human detected in frame.
60+
*/
3861
vector<Rect> postProcess(Mat& frame, const vector<Mat>& outs);
62+
/**
63+
* @brief drawBoundingBoxes : Draws bouding boxes around each
64+
* human detected in frame.
65+
*
66+
* @param confidence : Confidence for each detection
67+
* @param left : bounding box dimension
68+
* @param top : bounding box dimension
69+
* @param right : bounding box dimension
70+
* @param bottom : bounding box dimension
71+
* @param frame : Current camera frame
72+
* @param human_number : Number of humans detected
73+
* @return int : flag for indication
74+
*/
3975
int drawBoundingBoxes(double confidence, int left, int top,
4076
int right, int bottom, Mat& frame, int human_number);
4177
};

src/HumanDetector.cpp

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
*/
1111
#include "HumanDetector.h"
1212
/**
13-
* @brief
13+
* @brief detection : Runs the neural network to detect humans.
1414
*
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
1818
*/
1919
vector<Mat> HumanDetector::detection(Net& net, Mat& blob) {
2020
net.setInput(blob);
@@ -24,11 +24,13 @@ vector<Mat> HumanDetector::detection(Net& net, Mat& blob) {
2424
return outs;
2525
}
2626
/**
27-
* @brief
27+
* @brief postProcess : Performs confidence thresholding and
28+
* non-max suppression.
2829
*
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.
3234
*/
3335
vector<Rect> HumanDetector::postProcess(Mat& frame, const vector<Mat>& outs) {
3436
vector<int> classIds;
@@ -83,16 +85,17 @@ vector<Rect> HumanDetector::postProcess(Mat& frame, const vector<Mat>& outs) {
8385
}
8486

8587
/**
86-
* @brief
88+
* @brief drawBoundingBoxes : Draws bouding boxes around each
89+
* human detected in frame.
8790
*
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
9699
*/
97100
int HumanDetector::drawBoundingBoxes(double confidence, int left, int top,
98101
int right, int bottom, Mat& frame, int human_number) {
@@ -117,9 +120,8 @@ int HumanDetector::drawBoundingBoxes(double confidence, int left, int top,
117120
cv::FONT_HERSHEY_SIMPLEX, 0.75, cv::Scalar(0, 0, 0), 1);
118121
return 0;
119122
}
120-
121123
/**
122-
* @brief
124+
* @brief Get the Outputs Names object
123125
*
124126
* @param net
125127
* @return vector<string>

0 commit comments

Comments
 (0)