Skip to content

Commit 973a4ed

Browse files
committed
Increase tolerance of the black dialog box detector.
1 parent 71b467f commit 973a4ed

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@
139139
#include "PokemonSwSh/MaxLair/Inference/PokemonSwSh_MaxLair_Detect_PathSide.h"
140140
#include "PokemonSwSh/MaxLair/Inference/PokemonSwSh_MaxLair_Detect_PathMap.h"
141141
#include "NintendoSwitch/Inference/NintendoSwitch_SelectedSettingDetector.h"
142+
#include "PokemonSV/Inference/Boxes/PokemonSV_BoxShinyDetector.h"
143+
#include "PokemonSwSh/Inference/PokemonSwSh_DialogBoxDetector.h"
142144

143145
#include <QPixmap>
144146
#include <QVideoFrame>
@@ -260,10 +262,23 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
260262

261263
auto screenshot = feed.snapshot();
262264

263-
YCommIconDetector detector(true);
265+
PokemonSwSh::BlackDialogBoxDetector detector(true);
266+
detector.make_overlays(overlays);
264267
cout << detector.process_frame(screenshot, current_time()) << endl;
265268

266269

270+
271+
// PokemonSV::BoxShinyDetector detector;
272+
// cout << detector.detect(screenshot) << endl;
273+
274+
275+
276+
277+
#if 0
278+
YCommIconDetector detector(true);
279+
cout << detector.process_frame(screenshot, current_time()) << endl;
280+
#endif
281+
267282
#if 0
268283
bool switch2 = true;
269284
ImageFloatBox key1_box;

SerialPrograms/Source/PokemonSV/Inference/Boxes/PokemonSV_BoxShinyDetector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "CommonFramework/ImageTools/ImageBoxes.h"
1212
#include "CommonTools/InferenceCallbacks/VisualInferenceCallback.h"
1313
#include "CommonTools/VisualDetector.h"
14-
#include "PokemonSV/Inference/Boxes/PokemonSV_BoxDetection.h"
14+
//#include "PokemonSV/Inference/Boxes/PokemonSV_BoxDetection.h"
1515

1616
namespace PokemonAutomation{
1717
namespace NintendoSwitch{

SerialPrograms/Source/PokemonSwSh/Inference/PokemonSwSh_DialogBoxDetector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ void BlackDialogBoxDetector::make_overlays(VideoOverlaySet& items) const{
5050

5151
bool BlackDialogBoxDetector::process_frame(const ImageViewRGB32& frame, WallClock timestamp){
5252
bool detected = true;
53-
for(const auto& box : BLACK_BOXES){
54-
if (is_black(extract_box_reference(frame, box), 180, 35) == false){
53+
for (const auto& box : BLACK_BOXES){
54+
if (is_black(extract_box_reference(frame, box), 200, 35) == false){
5555
detected = false;
5656
break;
5757
}

0 commit comments

Comments
 (0)