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 { class FaceDetector {
public: public:
/**
* @brief Constructor for the class FaceDetector, loads training data from a file
*
*/
FaceDetector(void); 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); void removeFaces(Mat input, Mat output);
}; };
} }

View File

@@ -58,11 +58,6 @@ namespace computervision
return true; return true;
} }
void ObjectDetection::readWebcam()
{
cap.read(img);
}
void ObjectDetection::calculateDifference() void ObjectDetection::calculateDifference()
{ {
cap.read(img); cap.read(img);
@@ -79,11 +74,11 @@ namespace computervision
void ObjectDetection::detect() void ObjectDetection::detect()
{ {
int key = waitKey(1); int key = waitKey(1);
if (key == 115) if (key == 98) // b
backgroundRemover.calibrate(frame);
else if (key == 115) // s
skinDetector.calibrate(frame); skinDetector.calibrate(frame);
} }

View File

@@ -17,11 +17,33 @@ namespace computervision
private: private:
public: public:
/**
* @brief default constructor of ObjectDetection
*
*/
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(); bool setup();
void readWebcam(); /**
* @brief Displays an image of the current webcam-footage
*
*/
void showWebcam(); void showWebcam();
/**
* @brief Calculates the difference between two images
* and outputs an image that only shows the difference
*
*/
void calculateDifference(); void calculateDifference();
/**
* @brief Listens for keypresses and handles them
*
*/
void detect(); void detect();
}; };