|
13 | 13 | #include "CommonFramework/ImageTools/ImageBoxes.h" |
14 | 14 | #include "CommonFramework/ImageTools/ImageStats.h" |
15 | 15 | #include "CommonFramework/Notifications/ProgramInfo.h" |
| 16 | +#include "CommonFramework/Tools/GlobalThreadPools.h" |
16 | 17 | #include "CommonTools/Images/ImageFilter.h" |
17 | 18 | #include "CommonTools/OCR/OCR_Routines.h" |
18 | 19 | #include "CommonTools/OCR/OCR_StringNormalization.h" |
@@ -262,7 +263,20 @@ void read_summary_screen( |
262 | 263 |
|
263 | 264 | VideoSnapshot screen = env.console.video().snapshot(); |
264 | 265 |
|
265 | | - const int dex_number = OCR::read_number_waterfill(env.console, extract_box_reference(screen, national_dex_number_box), 0xff808080, 0xffffffff); |
| 266 | + const std::vector<std::pair<uint32_t, uint32_t>> white_number_filters = { |
| 267 | + {0xff808080, 0xffffffff}, |
| 268 | + {0xff909090, 0xffffffff}, |
| 269 | + }; |
| 270 | + |
| 271 | + const int dex_number = OCR::read_number_waterfill_multifilter( |
| 272 | + env.console, |
| 273 | + GlobalThreadPools::computation_normal(), |
| 274 | + extract_box_reference(screen, national_dex_number_box), |
| 275 | + white_number_filters, |
| 276 | + true, |
| 277 | + true, |
| 278 | + 20 |
| 279 | + ); |
266 | 280 | if (dex_number <= 0 || dex_number > static_cast<int>(NATIONAL_DEX_SLUGS().size())) { |
267 | 281 | OperationFailedException::fire( |
268 | 282 | ErrorReport::SEND_ERROR_REPORT, |
@@ -295,7 +309,12 @@ void read_summary_screen( |
295 | 309 | env.console.log("Gender: " + gender_to_string(gender), COLOR_GREEN); |
296 | 310 | cur_pokemon_info.gender = gender; |
297 | 311 |
|
298 | | - const int ot_id = OCR::read_number_waterfill(env.console, extract_box_reference(screen, ot_id_box), 0xff808080, 0xffffffff); |
| 312 | + const int ot_id = OCR::read_number_waterfill_multifilter( |
| 313 | + env.console, |
| 314 | + GlobalThreadPools::computation_normal(), |
| 315 | + extract_box_reference(screen, ot_id_box), |
| 316 | + white_number_filters |
| 317 | + ); |
299 | 318 | if (ot_id < 0 || ot_id > 999'999) { |
300 | 319 | dump_image(env.console, ProgramInfo(), "ReadSummary_OT", screen); |
301 | 320 | } |
|
0 commit comments