[ADD] hand detection in startup scene

This commit is contained in:
Sem van der Hoeven
2021-06-18 17:15:26 +02:00
parent c1ba33e55b
commit 7c3d68a742
7 changed files with 59 additions and 73 deletions

View File

@@ -23,6 +23,7 @@ namespace computervision
bool background_calibrated = false;
bool skin_calibrated = false;
bool hand_open = false;
ObjectDetection::ObjectDetection()
{
@@ -94,6 +95,7 @@ namespace computervision
skin_calibrated = true;
hand_calibrator.SetSkinCalibration(skin_calibrated);
time = 0;
calibration_callback();
}
}
@@ -126,8 +128,8 @@ namespace computervision
hand_present = hand_calibrator.CheckIfHandPresent(handMask, handcalibration::HandDetectionType::MENU);
hand_calibrator.SetHandPresent(hand_present);
return fingers_amount > 0;
hand_open = fingers_amount > 0;
return hand_open;
}
void ObjectDetection::CalculateDifference()
@@ -187,5 +189,15 @@ namespace computervision
time += delt_time;
}
bool ObjectDetection::IsHandOpen()
{
return hand_open;
}
bool ObjectDetection::IsCalibrated()
{
return background_calibrated && skin_calibrated;
}
}