fix fudai countdown full-line ocr

This commit is contained in:
Your Name committed 2026-06-23 23:32:20 +08:00
1 parent 008d7f82b3
commit 9062ee7204
6 files changed
+41 -387

No files matched your search

+4 -4
View File
@@ -249,7 +249,7 @@ class TestOcrCountdown:
2,
)
def test_read_countdown_digits_uses_cv_zero_when_ocr_ties(self):
def test_read_countdown_digits_tie_prefers_primary_over_cv_zero(self):
analyser = _mk_analyser()
analyser.operation.analyse_pic_digits = MagicMock(
side_effect=["09", "09", "09", "00", "00", "00"]
@@ -263,7 +263,7 @@ class TestOcrCountdown:
analyser,
"福袋倒计时_分钟_preprocessed",
fallback_picnames=("福袋倒计时_分钟",),
) == "00"
) == "09"
def test_read_countdown_digits_tie_prefers_consistent_preprocessed(self):
analyser = _mk_analyser()
@@ -281,7 +281,7 @@ class TestOcrCountdown:
fallback_picnames=("福袋倒计时_秒",),
) == "41"
def test_read_countdown_digits_cv_zero_can_override_wrong_ocr_majority(self):
def test_read_countdown_digits_cv_zero_cannot_override_nonzero_majority(self):
analyser = _mk_analyser()
analyser.operation.analyse_pic_digits = MagicMock(
side_effect=["09", "09", "09", "", "", ""]
@@ -295,7 +295,7 @@ class TestOcrCountdown:
analyser,
"福袋倒计时_分钟_preprocessed",
fallback_picnames=("福袋倒计时_分钟",),
) == "00"
) == "09"
def test_cv_detect_two_zero_digits_on_current_minute_crop(self):
assert _cv_detect_two_zero_digits("福袋倒计时_分钟") in ("", "00")