[EDIT] remove unused methods
This commit is contained in:
@@ -36,42 +36,6 @@ namespace computervision
|
||||
return img;
|
||||
}
|
||||
|
||||
bool ObjectDetection::setup()
|
||||
{
|
||||
if (!cap.isOpened()) {
|
||||
cout << "Can't find camera!" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
cap.read(frame);
|
||||
frameOut = frame.clone();
|
||||
|
||||
skinDetector.drawSkinColorSampler(frameOut);
|
||||
|
||||
foreground = backgroundRemover.getForeground(frame);
|
||||
|
||||
faceDetector.removeFaces(frame, foreground);
|
||||
handMask = skinDetector.getSkinMask(foreground);
|
||||
fingerCountDebug = fingerCount.findFingersCount(handMask, frameOut);
|
||||
|
||||
//backgroundRemover.calibrate(frame);
|
||||
|
||||
|
||||
imshow("output", frameOut);
|
||||
imshow("foreground", foreground);
|
||||
imshow("handMask", handMask);
|
||||
imshow("handDetection", fingerCountDebug);
|
||||
|
||||
int key = waitKey(1);
|
||||
|
||||
if (key == 98) // b
|
||||
backgroundRemover.calibrate(frame);
|
||||
else if (key == 115) // s
|
||||
skinDetector.calibrate(frame);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ObjectDetection::detectHand(Mat cameraFrame)
|
||||
{
|
||||
Mat inputFrame = generateHandMaskSquare(cameraFrame);
|
||||
@@ -104,7 +68,7 @@ namespace computervision
|
||||
else if (key == 115) // s
|
||||
skinDetector.calibrate(inputFrame);
|
||||
|
||||
return true;
|
||||
return fingers_amount > 0;
|
||||
}
|
||||
|
||||
void ObjectDetection::calculateDifference()
|
||||
|
||||
@@ -22,13 +22,7 @@ namespace computervision
|
||||
*
|
||||
*/
|
||||
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();
|
||||
|
||||
/**
|
||||
* @brief Displays an image of the current webcam-footage
|
||||
*
|
||||
@@ -40,11 +34,6 @@ namespace computervision
|
||||
*
|
||||
*/
|
||||
void calculateDifference();
|
||||
/**
|
||||
* @brief Listens for keypresses and handles them
|
||||
*
|
||||
*/
|
||||
void detect();
|
||||
|
||||
/**
|
||||
* @brief generates the square that will hold the mask in which the hand will be detected.
|
||||
@@ -65,7 +54,7 @@ namespace computervision
|
||||
* @brief detects a hand based on the given hand mask input frame.
|
||||
*
|
||||
* @param inputFrame the input frame from the camera
|
||||
* @return true if the webcam is connected, false if not.
|
||||
* @return true if hand is open, false if hand is closed
|
||||
*/
|
||||
bool detectHand(cv::Mat cameraFrame);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user