Merge branch 'feature/comments' into feature/objectdetection

This commit is contained in:
Sem van der Hoeven
2021-05-21 15:22:07 +02:00
3 changed files with 36 additions and 9 deletions

View File

@@ -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);
};
}

View File

@@ -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);
}

View File

@@ -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();
};