diff --git a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp index ab2d4da0f0..6e2a8dfbfb 100644 --- a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp +++ b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.cpp @@ -88,6 +88,7 @@ #include "Integrations/DiscordWebhook.h" #include "PokemonSV/Programs/TeraRaids/PokemonSV_JoinTracker.h" #include "PokemonSV/Inference/Boxes/PokemonSV_BoxDetection.h" +#include "PokemonSV/Inference/Map/PokemonSV_DestinationMarkerDetector.h" #include "CommonFramework/Environment/Environment.h" #include "Common/Cpp/PrettyPrint.h" #include "Common/Qt/TimeQt.h" @@ -173,10 +174,12 @@ TestProgramComputer_Descriptor::TestProgramComputer_Descriptor() {} TestProgramComputer::TestProgramComputer() : STATIC_TEXT("test text") + , IMAGE_PATH(false, "Path to image for testing", LockMode::UNLOCK_WHILE_RUNNING, "default.png", "default.png") , SCREEN_WATCHER("Capture Box", 0, 0, 1, 1) , MAC_ADDRESS(LockMode::UNLOCK_WHILE_RUNNING, 6, nullptr) { PA_ADD_OPTION(STATIC_TEXT); + PA_ADD_OPTION(IMAGE_PATH); // PA_ADD_OPTION(SCREEN_WATCHER); PA_ADD_OPTION(MAC_ADDRESS); } @@ -362,7 +365,16 @@ void TestProgramComputer::program(ProgramEnvironment& env, CancellableScope& sco // cout << random_u32(100, 115) << endl; +#if 0 + ImageRGB32 image(IMAGE_PATH); + DestinationMarkerDetector detector(COLOR_CYAN, {0.717, 0.165, 0.03, 0.061}, false); + cout << detector.detect(image) << endl; +#endif + + +#if 0 stress_test(logger, scope); +#endif diff --git a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.h b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.h index 88dac6a54c..1835047957 100644 --- a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.h +++ b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramComputer.h @@ -8,6 +8,7 @@ #define PokemonAutomation_Computer_TestProgram_H #include "Common/Cpp/Options/StaticTextOption.h" +#include "Common/Cpp/Options/StringOption.h" #include "Common/Cpp/Options/MacAddressOption.h" #include "CommonTools/Options/ScreenWatchOption.h" #include "ComputerPrograms/ComputerProgram.h" @@ -30,6 +31,7 @@ class TestProgramComputer : public ComputerProgramInstance{ private: StaticTextOption STATIC_TEXT; + StringOption IMAGE_PATH; ScreenWatchOption SCREEN_WATCHER; MacAddressCell MAC_ADDRESS; }; diff --git a/SerialPrograms/Source/PokemonSV/Inference/Map/PokemonSV_DestinationMarkerDetector.cpp b/SerialPrograms/Source/PokemonSV/Inference/Map/PokemonSV_DestinationMarkerDetector.cpp index b13b2c3cf3..599052e4e0 100644 --- a/SerialPrograms/Source/PokemonSV/Inference/Map/PokemonSV_DestinationMarkerDetector.cpp +++ b/SerialPrograms/Source/PokemonSV/Inference/Map/PokemonSV_DestinationMarkerDetector.cpp @@ -23,7 +23,7 @@ class DestinationMarkerMatcher : public ImageMatch::WaterfillTemplateMatcher{ public: DestinationMarkerMatcher() : WaterfillTemplateMatcher( - "PokemonSV/Map/DestinationMarkerIcon-Template.png", Color(180,80,0), Color(255, 130, 50), 50 + "PokemonSV/Map/DestinationMarkerIcon-Template.png", Color(180,80,0), Color(255, 130, 70), 50 ){ m_aspect_ratio_lower = 0.8; m_aspect_ratio_upper = 1.2; @@ -42,7 +42,7 @@ class DestinationMarkerYellowMatcher : public ImageMatch::WaterfillTemplateMatch public: DestinationMarkerYellowMatcher() : WaterfillTemplateMatcher( - "PokemonSV/Map/DestinationMarkerIcon-Yellow.png", Color(180,80,0), Color(255, 200, 50), 50 + "PokemonSV/Map/DestinationMarkerIcon-Yellow.png", Color(180,80,0), Color(255, 200, 70), 50 ){ m_aspect_ratio_lower = 0.8; m_aspect_ratio_upper = 1.2; @@ -82,7 +82,7 @@ bool DestinationMarkerDetector::detect(const ImageViewRGB32& screen){ std::vector DestinationMarkerDetector::detect_all(const ImageViewRGB32& screen) const{ const std::vector> filters = { - {combine_rgb(180, 80, 0), combine_rgb(255, 130, 50)}, + {combine_rgb(180, 80, 0), combine_rgb(255, 130, 70)}, }; @@ -119,7 +119,7 @@ std::vector DestinationMarkerDetector::detect_all(const ImageView std::vector DestinationMarkerDetector::detect_all_yellow(const ImageViewRGB32& screen) const{ const std::vector> filters = { - {combine_rgb(180, 100, 0), combine_rgb(255, 190, 50)}, // to detect the marker within the minimap, when the radar beam is covering the marker + {combine_rgb(180, 100, 0), combine_rgb(255, 190, 70)}, // to detect the marker within the minimap, when the radar beam is covering the marker };