AirtestProject / AirtestProject/Airtest
AirtestIDE 1.2.2中使用本地环境(airtest1.1.0),rgb识别貌似失灵了。
- 主要语言
- Python
- 星标
- 9.6k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
描述
**描述问题bug**
我遇到了一个场景,应用中可以切换debug环境和正式环境,不同环境顶部用户中心界面的背景颜色会不同,debug环境为蓝色,正式环境为红色。
于是我使用了rgb识别,threshold 0.95,图片识别语句如下:
`exists(Template(r"tpl1571663529674.png", threshold=0.95, rgb=True, record_pos=(-0.003, -0.747), resolution=(1080, 1920)))`
返回结果竟然命中了,甚至我把threshold设为1,也命中了。log如下:
```
`[09:43:24][DEBUG] try match with SURFMatching
[09:43:24][DEBUG] [SURF] threshold=0.95, result={'result': (446, 152), 'rectangle': [(303, 101), (303, 204), (590, 204), (590, 101)], 'confidence': 0.9177039604187012}
[09:43:24][DEBUG] find_best_result() run time is 0.58 s.
[09:43:24][DEBUG] try match with TemplateMatching
[09:43:24][DEBUG] [Template] threshold=0.95, result={'result': (447, 153), 'rectangle': ((303, 102), (303, 205), (591, 205), (591, 102)), 'confidence': 0.9207895016074179}
[09:43:24][DEBUG] find_best_result() run time is 0.11 s.
[09:43:24][DEBUG] try match with BRISKMatching
[09:43:25][DEBUG] [BRISK] threshold=0.95, result={'result': (447, 153), 'rectangle': [(304, 102), (304, 204), (591, 204), (591, 102)], 'confidence': 0.959229315072298}
[09:43:25][DEBUG] find_best_result() run time is 0.34 s.
[09:43:25][DEBUG] match result: {'result': (447, 153), 'rectangle': [(304, 102), (304, 204), (591, 204), (591, 102)], 'confidence': 0.959229315072298}`
```
**相关截图**
应用场景:

代码:

代码(转文字):

匹配结果:

命中测试截图:


**预期效果**
正常来说,如果开启rgb识别,就算识别度再低,阈值设置到了0.95(甚至是1),也不至于匹配吧。
**python 版本:** `python3.6`
**airtest 版本:** `1.1.0`
> airtest版本通过`pip freeze`可以命令可以查到
**设备:**
mumu模拟器,Android6.0.1,mi6
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。