Skip to content

Commit f417efc

Browse files
committed
Migrate BDSP dialog detector to use watcher. Require multiple frames before returning true.
1 parent bdd38f7 commit f417efc

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace PokemonAutomation{
2626
const bool IS_BETA_VERSION = true;
2727
const int PROGRAM_VERSION_MAJOR = 0;
2828
const int PROGRAM_VERSION_MINOR = 54;
29-
const int PROGRAM_VERSION_PATCH = 18;
29+
const int PROGRAM_VERSION_PATCH = 19;
3030

3131
const std::string PROGRAM_VERSION_BASE =
3232
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/PokemonBDSP/Inference/PokemonBDSP_DialogDetector.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ bool ShortDialogDetector::detect(const ImageViewRGB32& screen){
5959
}
6060

6161

62-
ShortDialogWatcher::ShortDialogWatcher(Color color)
63-
: ShortDialogDetector(color)
64-
, VisualInferenceCallback("ShortDialogWatcher")
65-
{}
66-
void ShortDialogWatcher::make_overlays(VideoOverlaySet& items) const{
67-
ShortDialogDetector::make_overlays(items);
68-
}
69-
bool ShortDialogWatcher::process_frame(const ImageViewRGB32& frame, WallClock){
70-
return detect(frame);
71-
}
72-
7362

7463

7564

SerialPrograms/Source/PokemonBDSP/Inference/PokemonBDSP_DialogDetector.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,11 @@ class ShortDialogDetector : public StaticScreenDetector{
3333
ImageFloatBox m_right_white;
3434
ImageFloatBox m_right;
3535
};
36-
class ShortDialogWatcher : public ShortDialogDetector, public VisualInferenceCallback{
36+
class ShortDialogWatcher : public DetectorToFinder<ShortDialogDetector>{
3737
public:
38-
ShortDialogWatcher(Color color = COLOR_RED);
39-
40-
virtual void make_overlays(VideoOverlaySet& items) const override;
41-
virtual bool process_frame(const ImageViewRGB32& frame, WallClock timestamp) override;
38+
ShortDialogWatcher(Color color = COLOR_RED)
39+
: DetectorToFinder("ShortDialogWatcher", std::chrono::milliseconds(250), color)
40+
{}
4241
};
4342

4443

0 commit comments

Comments
 (0)