Skip to content

Commit

Permalink
Add an extra waterfill filter for MMO question mark detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticial committed Dec 11, 2024
1 parent 763cb1c commit 9eb635e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ bool match_template_by_waterfill(

bool detected = false;
bool stop_match = false;
for(PokemonAutomation::PackedBinaryMatrix &matrix : matrices){
for (PokemonAutomation::PackedBinaryMatrix &matrix : matrices){
if (PreloadSettings::debug().IMAGE_TEMPLATE_MATCHING){
ImageRGB32 binaryImage = image.copy();
filter_by_mask(matrix, binaryImage, Color(COLOR_BLACK), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,19 @@ bool detect_MMO_question_mark(const PokemonAutomation::ImageViewRGB32 &frame, co
};

bool detected = match_template_by_waterfill(
image, MMOQuestionMarkBackgroundMatcher::instance(),
{{combine_rgb(0, 10, 30), combine_rgb(60, 90, 130)}},
{scale(min_bg_size), scale(max_bg_size)}, 90,
image,
MMOQuestionMarkBackgroundMatcher::instance(),
{
{combine_rgb(0, 0, 0), combine_rgb(127, 127, 127)},
{combine_rgb(0, 10, 30), combine_rgb(60, 90, 130)},
},
{scale(min_bg_size), scale(max_bg_size)},
90,
[](WaterfillObject&) { return true; }
);

// cout << "detected = " << detected << endl;

if (detected){
const size_t min_curve_size = 250;
const size_t max_curve_size = 450;
Expand Down

0 comments on commit 9eb635e

Please sign in to comment.