Skip to content

Commit 6a58549

Browse files
committed
Fix HomeMenuDetector false positive on date time.
1 parent 1b19127 commit 6a58549

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_HomeMenuDetector.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ HomeMenuDetector::HomeMenuDetector(ConsoleHandle& console, Color color)
2626
, m_bottom_icons(0.70, 0.92, 0.28, 0.05)
2727
, m_bottom_left(0.02, 0.70, 0.15, 0.15)
2828
, m_bottom_right(0.83, 0.70, 0.15, 0.15)
29+
, m_bottom_middle(0.20, 0.70, 0.60, 0.15)
2930
, m_user_icons(0.05, 0.05, 0.2, 0.08)
3031
, m_game_slot(0.08, 0.25, 0.10, 0.38)
3132
{}
@@ -36,6 +37,7 @@ void HomeMenuDetector::make_overlays(VideoOverlaySet& items) const{
3637
items.add(m_color, m_bottom_icons);
3738
items.add(m_color, m_bottom_left);
3839
items.add(m_color, m_bottom_right);
40+
items.add(m_color, m_bottom_middle);
3941
items.add(m_color, m_user_icons);
4042
items.add(m_color, m_game_slot);
4143
}
@@ -106,6 +108,11 @@ bool HomeMenuDetector::detect_only(const ImageViewRGB32& screen){
106108
}
107109
}
108110

111+
ImageStats stats_bottom_middle = image_stats(extract_box_reference(screen, m_bottom_middle));
112+
if (stats_bottom_middle.stddev.sum() < 50){
113+
return false;
114+
}
115+
109116
// cout << euclidean_distance(stats_bottom_row.average, stats_bottom_left.average) << endl;
110117
if (euclidean_distance(stats_bottom_row.average, stats_bottom_left.average) > 20){
111118
// cout << "qwer = " << euclidean_distance(stats_bottom_row.average, stats_bottom_left.average) << endl;

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_HomeMenuDetector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class HomeMenuDetector : public StaticScreenDetector{
3535
ImageFloatBox m_bottom_icons;
3636
ImageFloatBox m_bottom_left;
3737
ImageFloatBox m_bottom_right;
38+
ImageFloatBox m_bottom_middle;
3839
ImageFloatBox m_user_icons;
3940
ImageFloatBox m_game_slot;
4041
};

0 commit comments

Comments
 (0)