Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -30,6 +31,7 @@ class TestProgramComputer : public ComputerProgramInstance{

private:
StaticTextOption STATIC_TEXT;
StringOption IMAGE_PATH;
ScreenWatchOption SCREEN_WATCHER;
MacAddressCell MAC_ADDRESS;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -82,7 +82,7 @@ bool DestinationMarkerDetector::detect(const ImageViewRGB32& screen){

std::vector<ImageFloatBox> DestinationMarkerDetector::detect_all(const ImageViewRGB32& screen) const{
const std::vector<std::pair<uint32_t, uint32_t>> filters = {
{combine_rgb(180, 80, 0), combine_rgb(255, 130, 50)},
{combine_rgb(180, 80, 0), combine_rgb(255, 130, 70)},

};

Expand Down Expand Up @@ -119,7 +119,7 @@ std::vector<ImageFloatBox> DestinationMarkerDetector::detect_all(const ImageView

std::vector<ImageFloatBox> DestinationMarkerDetector::detect_all_yellow(const ImageViewRGB32& screen) const{
const std::vector<std::pair<uint32_t, uint32_t>> 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
};


Expand Down