[ADD] added comments to the classes FaceDetector and ObjectDetection
This commit is contained in:
@@ -15,7 +15,17 @@ namespace computervision
|
||||
{
|
||||
class FaceDetector {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor for the class FaceDetector, loads training data from a file
|
||||
*
|
||||
*/
|
||||
FaceDetector(void);
|
||||
/**
|
||||
* @brief Detects faces on an image and blocks them with a black rectangle
|
||||
*
|
||||
* @param input Input image
|
||||
* @param output Output image
|
||||
*/
|
||||
void removeFaces(Mat input, Mat output);
|
||||
};
|
||||
}
|
||||
@@ -58,11 +58,6 @@ namespace computervision
|
||||
return true;
|
||||
}
|
||||
|
||||
void ObjectDetection::readWebcam()
|
||||
{
|
||||
cap.read(img);
|
||||
}
|
||||
|
||||
void ObjectDetection::calculateDifference()
|
||||
{
|
||||
cap.read(img);
|
||||
@@ -79,11 +74,11 @@ namespace computervision
|
||||
|
||||
void ObjectDetection::detect()
|
||||
{
|
||||
|
||||
|
||||
int key = waitKey(1);
|
||||
|
||||
if (key == 115)
|
||||
if (key == 98) // b
|
||||
backgroundRemover.calibrate(frame);
|
||||
else if (key == 115) // s
|
||||
skinDetector.calibrate(frame);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,11 +17,33 @@ namespace computervision
|
||||
private:
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief default constructor of ObjectDetection
|
||||
*
|
||||
*/
|
||||
ObjectDetection();
|
||||
/**
|
||||
* @brief Initializes the object detection, captures a frame and modifies it
|
||||
* so it is ready to use for object detection
|
||||
*
|
||||
* @return return true if webcam is connected, returns false if it isn't
|
||||
*/
|
||||
bool setup();
|
||||
void readWebcam();
|
||||
/**
|
||||
* @brief Displays an image of the current webcam-footage
|
||||
*
|
||||
*/
|
||||
void showWebcam();
|
||||
/**
|
||||
* @brief Calculates the difference between two images
|
||||
* and outputs an image that only shows the difference
|
||||
*
|
||||
*/
|
||||
void calculateDifference();
|
||||
/**
|
||||
* @brief Listens for keypresses and handles them
|
||||
*
|
||||
*/
|
||||
void detect();
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user