diff --git a/src/computervision/BackgroundRemover.cpp b/src/computervision/background_remover.cpp similarity index 97% rename from src/computervision/BackgroundRemover.cpp rename to src/computervision/background_remover.cpp index ebae572..e9a19e1 100644 --- a/src/computervision/BackgroundRemover.cpp +++ b/src/computervision/background_remover.cpp @@ -1,4 +1,4 @@ -#include "BackgroundRemover.h" +#include "background_remover.h" /* Author: Pierfrancesco Soffritti https://github.com/PierfrancescoSoffritti diff --git a/src/computervision/BackgroundRemover.h b/src/computervision/background_remover.h similarity index 100% rename from src/computervision/BackgroundRemover.h rename to src/computervision/background_remover.h diff --git a/src/computervision/FingerCount.cpp b/src/computervision/finger_count.cpp similarity index 99% rename from src/computervision/FingerCount.cpp rename to src/computervision/finger_count.cpp index bdd1938..0bc4409 100644 --- a/src/computervision/FingerCount.cpp +++ b/src/computervision/finger_count.cpp @@ -1,4 +1,4 @@ -#include "FingerCount.h" +#include "finger_count.h" #include "opencv2/imgproc.hpp" #include "opencv2/highgui.hpp" diff --git a/src/computervision/FingerCount.h b/src/computervision/finger_count.h similarity index 100% rename from src/computervision/FingerCount.h rename to src/computervision/finger_count.h diff --git a/src/computervision/HandDetectRegion.cpp b/src/computervision/hand_detect_region.cpp similarity index 92% rename from src/computervision/HandDetectRegion.cpp rename to src/computervision/hand_detect_region.cpp index 1d1221f..b2c61f2 100644 --- a/src/computervision/HandDetectRegion.cpp +++ b/src/computervision/hand_detect_region.cpp @@ -1,5 +1,5 @@ -#include "HandDetectRegion.h" +#include "hand_detect_region.h" #define TIME_DURATION 1.0f namespace computervision { @@ -83,7 +83,14 @@ namespace computervision std::string calibration_text = (!background_calibrated ? "calibrating background in " : (!skin_calibrated ? "calibrating skin in " : "")); calibration_text += std::to_string(seconds_left); if (!background_calibrated || !skin_calibrated) + { + cv::rectangle(camera_frame, cv::Rect(0, camera_frame.rows - 130, 600, 60), cv::Scalar(0, 0, 0), -1); cv:putText(camera_frame, calibration_text, cv::Point(5, 400), cv::FONT_HERSHEY_COMPLEX, 1.0, cv::Scalar(255, 0, 255), 2); + } + if (background_calibrated && !skin_calibrated) + { + cv::putText(camera_frame, "put your hand in the left square", cv::Point(5, camera_frame.rows - 105), cv::FONT_HERSHEY_COMPLEX, 1.0, cv::Scalar(255, 0, 255), 2); + } } diff --git a/src/computervision/HandDetectRegion.h b/src/computervision/hand_detect_region.h similarity index 94% rename from src/computervision/HandDetectRegion.h rename to src/computervision/hand_detect_region.h index da7cc1b..3281ce9 100644 --- a/src/computervision/HandDetectRegion.h +++ b/src/computervision/hand_detect_region.h @@ -6,9 +6,9 @@ #include "async/StaticCameraInstance.h" #include "calibration/HandCalibrator.h" -#include "BackgroundRemover.h" -#include "SkinDetector.h" -#include "FingerCount.h" +#include "background_remover.h" +#include "skin_detector.h" +#include "finger_count.h" namespace computervision { class HandDetectRegion diff --git a/src/computervision/ObjectDetection.cpp b/src/computervision/object_detection.cpp similarity index 89% rename from src/computervision/ObjectDetection.cpp rename to src/computervision/object_detection.cpp index 6824eb5..f52fc43 100644 --- a/src/computervision/ObjectDetection.cpp +++ b/src/computervision/object_detection.cpp @@ -4,10 +4,10 @@ #include #include -#include "ObjectDetection.h" -#include "BackgroundRemover.h" -#include "SkinDetector.h" -#include "FingerCount.h" +#include "object_detection.h" +#include "background_remover.h" +#include "skin_detector.h" +#include "finger_count.h" #include "async/StaticCameraInstance.h" #include "calibration/HandCalibrator.h" @@ -116,8 +116,15 @@ namespace computervision std::string calibration_text = (!background_calibrated ? "calibrating background in " : (!skin_calibrated ? "calibrating skin in " : "")); calibration_text += std::to_string(seconds_left); if (!background_calibrated || !skin_calibrated) - cv:putText(camera_frame, calibration_text, cv::Point(5, 400), cv::FONT_HERSHEY_COMPLEX, 1.0, cv::Scalar(255, 0, 255), 2); + { + cv::rectangle(camera_frame, cv::Rect(0, camera_frame.rows - 120, 500, 50), cv::Scalar(0, 0, 0), -1); + cv::putText(camera_frame, calibration_text, cv::Point(5, camera_frame.rows-80), cv::FONT_HERSHEY_COMPLEX, 1.0, cv::Scalar(255, 0, 255), 2); + } + if (background_calibrated && !skin_calibrated) + { + cv::putText(camera_frame, "put your hand in the square", cv::Point(5, camera_frame.rows - 100), cv::FONT_HERSHEY_COMPLEX, 1.0, cv::Scalar(255, 0, 255), 2); + } imshow("camera", camera_frame); /*imshow("output", frame_out); diff --git a/src/computervision/ObjectDetection.h b/src/computervision/object_detection.h similarity index 100% rename from src/computervision/ObjectDetection.h rename to src/computervision/object_detection.h diff --git a/src/computervision/SkinDetector.cpp b/src/computervision/skin_detector.cpp similarity index 99% rename from src/computervision/SkinDetector.cpp rename to src/computervision/skin_detector.cpp index 100f25f..64c21bc 100644 --- a/src/computervision/SkinDetector.cpp +++ b/src/computervision/skin_detector.cpp @@ -1,4 +1,4 @@ -#include "SkinDetector.h" +#include "skin_detector.h" #include /* diff --git a/src/computervision/SkinDetector.h b/src/computervision/skin_detector.h similarity index 100% rename from src/computervision/SkinDetector.h rename to src/computervision/skin_detector.h diff --git a/src/main.cpp b/src/main.cpp index be9e1bc..887ec1d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,7 +28,7 @@ #include "scenes/in_Game_Scene.h" #include "scenes/startup_Scene.h" -#include "computervision/ObjectDetection.h" +#include "computervision/object_detection.h" //#include "computervision/OpenPoseImage.h" #include "computervision/OpenPoseVideo.h" diff --git a/src/scenes/in_Game_Scene.cpp b/src/scenes/in_Game_Scene.cpp index 227e573..e290061 100644 --- a/src/scenes/in_Game_Scene.cpp +++ b/src/scenes/in_Game_Scene.cpp @@ -19,8 +19,8 @@ #include #include #include -#include "../computervision/HandDetectRegion.h" -#include "../computervision/ObjectDetection.h" +#include "../computervision/hand_detect_region.h" +#include "../computervision/object_detection.h" #include #define MAX_MODEL_DEQUE_SIZE 6 // max amount of models to load at the same time diff --git a/src/scenes/startup_Scene.cpp b/src/scenes/startup_Scene.cpp index b734214..4d69e21 100644 --- a/src/scenes/startup_Scene.cpp +++ b/src/scenes/startup_Scene.cpp @@ -14,8 +14,8 @@ #include "../gui/gui_interactable.h" #include "../toolbox/toolbox.h" #include "../computervision/MenuTest.h" -#include "../computervision/ObjectDetection.h" -#include "../computervision/HandDetectRegion.h" +#include "../computervision/object_detection.h" +#include "../computervision/hand_detect_region.h" diff --git a/wk2_fps.vcxproj b/wk2_fps.vcxproj index f9065d6..1d9710c 100644 --- a/wk2_fps.vcxproj +++ b/wk2_fps.vcxproj @@ -23,15 +23,15 @@ - + - + - - - + + + @@ -54,17 +54,17 @@ - + - - + + - - + + diff --git a/wk2_fps.vcxproj.filters b/wk2_fps.vcxproj.filters index 0b8c679..3d92163 100644 --- a/wk2_fps.vcxproj.filters +++ b/wk2_fps.vcxproj.filters @@ -4,11 +4,11 @@ - + - - - + + + @@ -23,7 +23,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -126,11 +126,11 @@ - - + + - - + +