From 8f9cfa555f1a25ab0fea09d7e165d5bc0122d320 Mon Sep 17 00:00:00 2001 From: Alexander Yee Date: Tue, 17 Dec 2024 21:04:05 -0800 Subject: [PATCH] Selection arrow debugging. --- .../DevPrograms/TestProgramSwitch.cpp | 15 ++++++++++++++- .../PokemonSwSh_SelectionArrowFinder.cpp | 5 +++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp index 5baad2725..6695bddf2 100644 --- a/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp +++ b/SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp @@ -146,6 +146,13 @@ namespace PokemonAutomation{ namespace NintendoSwitch{ +namespace PokemonSwSh{ + std::vector find_selection_arrows(const ImageViewRGB32& image, size_t min_area); +} + + + + StringSelectDatabase make_database(){ StringSelectDatabase ret; for (size_t c = 0; c < 1000; c++){ @@ -271,6 +278,12 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope& VideoOverlaySet overlays(overlay); + + ImageRGB32 image("Screenshot.png"); + + PokemonSwSh::find_selection_arrows(image, 10); + + // LifetimeSanitizer::terminate_with_dump(); // PokemonSV::AuctionFarmer farmer; @@ -319,7 +332,7 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope& ); #endif -#if 1 +#if 0 VideoSnapshot image = feed.snapshot(); // ImageRGB32 image("screenshot-20241124-135028529403.png"); diff --git a/SerialPrograms/Source/PokemonSwSh/Inference/PokemonSwSh_SelectionArrowFinder.cpp b/SerialPrograms/Source/PokemonSwSh/Inference/PokemonSwSh_SelectionArrowFinder.cpp index 1c27e4146..6ff30ca52 100644 --- a/SerialPrograms/Source/PokemonSwSh/Inference/PokemonSwSh_SelectionArrowFinder.cpp +++ b/SerialPrograms/Source/PokemonSwSh/Inference/PokemonSwSh_SelectionArrowFinder.cpp @@ -19,6 +19,10 @@ #include "CommonFramework/VideoPipeline/VideoOverlay.h" #include "PokemonSwSh_SelectionArrowFinder.h" +//#include +//using std::cout; +//using std::endl; + namespace PokemonAutomation{ namespace NintendoSwitch{ namespace PokemonSwSh{ @@ -87,6 +91,7 @@ std::vector find_selection_arrows(const ImageViewRGB32& image, si std::vector ret; WaterfillObject object; while (finder->find_next(object, true)){ +// cout << object.min_x << "-" << object.max_x << ", " << object.min_y << "-" << object.max_y << endl; if (is_selection_arrow(image, object)){ ret.emplace_back(object); }