[EDIT] remove unused methods
This commit is contained in:
@@ -36,42 +36,6 @@ namespace computervision
|
|||||||
return img;
|
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)
|
bool ObjectDetection::detectHand(Mat cameraFrame)
|
||||||
{
|
{
|
||||||
Mat inputFrame = generateHandMaskSquare(cameraFrame);
|
Mat inputFrame = generateHandMaskSquare(cameraFrame);
|
||||||
@@ -104,7 +68,7 @@ namespace computervision
|
|||||||
else if (key == 115) // s
|
else if (key == 115) // s
|
||||||
skinDetector.calibrate(inputFrame);
|
skinDetector.calibrate(inputFrame);
|
||||||
|
|
||||||
return true;
|
return fingers_amount > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectDetection::calculateDifference()
|
void ObjectDetection::calculateDifference()
|
||||||
|
|||||||
@@ -22,13 +22,7 @@ namespace computervision
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
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();
|
|
||||||
/**
|
/**
|
||||||
* @brief Displays an image of the current webcam-footage
|
* @brief Displays an image of the current webcam-footage
|
||||||
*
|
*
|
||||||
@@ -40,11 +34,6 @@ namespace computervision
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void calculateDifference();
|
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.
|
* @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.
|
* @brief detects a hand based on the given hand mask input frame.
|
||||||
*
|
*
|
||||||
* @param inputFrame the input frame from the camera
|
* @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);
|
bool detectHand(cv::Mat cameraFrame);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user