Skip to content

Commit

Permalink
Selection arrow debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticial committed Dec 18, 2024
1 parent 7bce796 commit 8f9cfa5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ namespace PokemonAutomation{
namespace NintendoSwitch{


namespace PokemonSwSh{
std::vector<ImagePixelBox> find_selection_arrows(const ImageViewRGB32& image, size_t min_area);
}




StringSelectDatabase make_database(){
StringSelectDatabase ret;
for (size_t c = 0; c < 1000; c++){
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#include "CommonFramework/VideoPipeline/VideoOverlay.h"
#include "PokemonSwSh_SelectionArrowFinder.h"

//#include <iostream>
//using std::cout;
//using std::endl;

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSwSh{
Expand Down Expand Up @@ -87,6 +91,7 @@ std::vector<ImagePixelBox> find_selection_arrows(const ImageViewRGB32& image, si
std::vector<ImagePixelBox> 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);
}
Expand Down

0 comments on commit 8f9cfa5

Please sign in to comment.