Skip to content

Commit 9eb635e

Browse files
committed
Add an extra waterfill filter for MMO question mark detection.
1 parent 763cb1c commit 9eb635e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

SerialPrograms/Source/CommonFramework/ImageTools/WaterfillUtilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ bool match_template_by_waterfill(
9393

9494
bool detected = false;
9595
bool stop_match = false;
96-
for(PokemonAutomation::PackedBinaryMatrix &matrix : matrices){
96+
for (PokemonAutomation::PackedBinaryMatrix &matrix : matrices){
9797
if (PreloadSettings::debug().IMAGE_TEMPLATE_MATCHING){
9898
ImageRGB32 binaryImage = image.copy();
9999
filter_by_mask(matrix, binaryImage, Color(COLOR_BLACK), true);

SerialPrograms/Source/PokemonLA/Inference/Objects/PokemonLA_MMOQuestionMarkDetector.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,19 @@ bool detect_MMO_question_mark(const PokemonAutomation::ImageViewRGB32 &frame, co
102102
};
103103

104104
bool detected = match_template_by_waterfill(
105-
image, MMOQuestionMarkBackgroundMatcher::instance(),
106-
{{combine_rgb(0, 10, 30), combine_rgb(60, 90, 130)}},
107-
{scale(min_bg_size), scale(max_bg_size)}, 90,
105+
image,
106+
MMOQuestionMarkBackgroundMatcher::instance(),
107+
{
108+
{combine_rgb(0, 0, 0), combine_rgb(127, 127, 127)},
109+
{combine_rgb(0, 10, 30), combine_rgb(60, 90, 130)},
110+
},
111+
{scale(min_bg_size), scale(max_bg_size)},
112+
90,
108113
[](WaterfillObject&) { return true; }
109114
);
110115

116+
// cout << "detected = " << detected << endl;
117+
111118
if (detected){
112119
const size_t min_curve_size = 250;
113120
const size_t max_curve_size = 450;

0 commit comments

Comments
 (0)