Files
douyi_guaji_main/tests
CodexandClaude Opus 4.7 a391c21f47 refactor(detection): 拆出 finder.py 模板匹配兜底(936→719,-217 行)
把 check_have_fudai_with_ready_screenshot 中"OpenCV 模板匹配兜底"块(226 行)抽到
template_match_helpers.template_match_fallback:
- 模板加载与缩放
- 搜索区域裁剪 + 边界保护
- cv2.matchTemplate + 双阈值判定
- 调试截图保存(last_match.png + 双截图记录)

新增 5 个单元测试覆盖:模板缺失 / 模板读取失败 / 阈值异常 / 不可达阈值 / 完美匹配。
1315 → 1320 用例全过。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 04:55:08 +08:00
..