AirtestProject / AirtestIDE

226 stars 38 forks source link

python using("xx.air") 與 airtest IDE 執行結果不同 #727

Open ts00651266 opened 4 years ago

ts00651266 commented 4 years ago

Describe the bug 判斷同一張圖片的 confidence 結果不同: python: [06:07:55][DEBUG] try match with SIFTMatching [06:07:55][DEBUG] 'Target area is 5 times bigger or 0.2 times smaller than sch_img.' [06:07:55][DEBUG] match result: None [06:07:56][DEBUG] resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720) [06:07:56][DEBUG] try match with TemplateMatching [06:07:56][DEBUG] [Template] threshold=0.6, result={'result': (1447, 147), 'rectangle': ((1425, 134), (1425, 160), (1470, 160), (1470, 134)), 'confidence': 0.34906328241527074}

airtestIDE: [SIFT] threshold=0.6, result={'result': (127, 173), 'rectangle': [(93, 155), (93, 192), (162, 192), (162, 155)], 'confidence': 0.8853535594046116}

Expected behaviour 透過 python 與 airtestIDE 判斷結果的 confidence 值相近

AirtestIDE version: 1.2.3

Platform: macos 10.14.6

Smartphone (please complete the following information):  -Device: [vivo Y95]  -OS: [e.g. Android 8.1.0]

Additional context

  1. python 版本:3.7

  2. 如何讓python執行airtest路徑與airtestIDE一樣?

**目前分別執行的位置如下** python 執行 airtest的位置: Macintosh HD⁩ ▸ ⁨資源庫⁩ ▸ ⁨Frameworks⁩ ▸ ⁨Python.framework⁩ ▸ ⁨Versions⁩ ▸ ⁨3.7⁩ ▸ ⁨lib⁩ ▸ ⁨python3.7⁩ ▸ ⁨site-packages▸ airtest

airtestIDE執行的位置: Macintosh HD⁩ ▸ ⁨應用程式⁩ ▸ ⁨AirtestIDE.app⁩ ▸ ⁨Contents⁩ ▸ ⁨MacOS⁩▸ airtest

yimelia commented 4 years ago

hi @ts00651266

python:
[06:07:55][DEBUG]<airtest.core.api> try match with SIFTMatching
[06:07:55][DEBUG]<airtest.core.api> 'Target area is 5 times bigger or 0.2 times smaller than sch_img.'
[06:07:55][DEBUG]<airtest.core.api> match result: None
[06:07:56][DEBUG]<airtest.core.api> resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720)
[06:07:56][DEBUG]<airtest.core.api> try match with TemplateMatching
[06:07:56][DEBUG]<airtest.aircv.template_matching> [Template] threshold=0.6, result={'result': (1447, 147), 'rectangle': ((1425, 134), (1425, 160), (1470, 160), (1470, 134)), 'confidence': 0.34906328241527074}

在第一段log中,它說明用了兩種圖像識別算法,第一種是SIFT,在進行圖像縮放之後(因為用了兩台不同分辨率的手機,一台進行錄製,一台進行回放,所以需要進行分辨率縮放),這個算法在這次運行中沒有成功找到符合特征的的圖像 第二種算法是Template,它在相同分辨率的圖像查找上速度很快,但是因為這次是兩台不同分辨率的手機,所以得到的結果很不好

在airtest中,我們提供了幾種識別算法(介紹看這裡),但是SIFT應該是效果比較好的一種了,因此可以考慮看看調整截圖的內容,截取更清晰、更容易識別的圖像: 參考文檔:https://airtest.doc.io.netease.com/tutorial/9_Improved_compatibility/#21

如果有很多台不同分辨率的手機,可能某些截圖確實非常難以識別成功,這時候可以考慮直接保留多張圖片:https://airtest.doc.io.netease.com/tutorial/9_Improved_compatibility/#25

ts00651266 commented 4 years ago

感謝回答 不過問題是一樣的環境與手機,使用 pyhotn執行與直接使用airtestIDE執行的結果不同,兩者也是用了 SIFT去解析圖片,但是直接使用airtestIDE 使用 SIFT 卻判斷的到圖片,這是為什麼呢?

(抱歉 python 的 log 沒有抓好,之後補上 )

yimelia commented 4 years ago

在這兩種運行方式下,可能需要排查是否連接手機時的參數不一樣,看一下在IDE中是否有勾選了use javacap之後再連手機? 在log中有一句:

[06:07:56][DEBUG]<airtest.core.api> resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720)

這裡做了一次尺寸轉換,應該是運行的時候,獲取到的手機截圖分辨率和當時截圖拿到的不一樣

ts00651266 commented 4 years ago

==== 在這兩種運行方式下,可能需要排查是否連接手機時的參數不一樣,看一下在IDE中是否有勾選了use javacap之後再連手機?====

測試部分我只有接上手機之後,就直接執行腳本,並沒有 connect 手機畫面來看。

==== 這裡做了一次尺寸轉換,應該是運行的時候,獲取到的手機截圖分辨率和當時截圖拿到的不一樣 ====

是的,我的確是從高解析的手機截圖拿來測試不同手機使用,也因為回應的印出的 log 有顯示 resize,所以圖片一定有判斷上的差異我是清楚的~

yimelia commented 4 years ago

重新建一個新腳本,只放這一個touch語句,然後在兩邊分別運行一次之後把所有的log都po上來看看? 順便可以查看一下本地裝的airtest版本號,如果不是最新的話可以更新到最新版再運行試試,IDE的1.2.3是最新的airtest版本

ts00651266 commented 4 years ago

======== 下面是我分別執行的畫面與結果 ============ python 無法判斷到 Keyword1.png 圖片 image

LOG: bash-3.2$ cd /Users/x.lin/Desktop/x/all_brand_game/test ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 /usr/local/bin/python3 /Users/x.lin/.vscode/extensions/ms-python.python-2020.2.64397/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 56050 /Users/x.lin/Desktop/x/all_brand_game/test/c.air/c.py ======>> Airtest <<==================== [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb devices [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb devices [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb wait-for-device [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell getprop ro.build.version.sdk [02:36:26][INFO] Try finding: Template(/Users/x.lin/Desktop/x/all_brand_game/test/c.air/Keyword1.png) [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell pm path jp.co.cyberagent.stf.rotationwatcher [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell export CLASSPATH=/data/app/jp.co.cyberagent.stf.rotationwatcher-_W6aK_VKq5-1_kCFykKDRg==/base.apk;exec app_process /system/bin jp.co.cyberagent.stf.rotationwatcher.RotationWatcher [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell ls /data/local/tmp/minicap [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell ls /data/local/tmp/minicap.so [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -v 2>&1 [02:36:28][DEBUG] version:6 [02:36:28][DEBUG] skip install minicap [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --no-rebind tcp:19668 localabstract:minicap_19668 [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell dumpsys window displays [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_19668' -P 720x1520@720x1520/270 -l 2>&1 [02:36:28][DEBUG] [minicap_server]b'PID: 21972' [02:36:28][DEBUG] [minicap_server]b'INFO: Using projection 720x1520@720x1520/3' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:492) New client connection' [02:36:28][DEBUG] (1, 24, 21972, 720, 1520, 720, 1520, 3, 2) [02:36:28][DEBUG] quirk_flag found, going to resetup [02:36:28][DEBUG] minicap stream ends [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --remove tcp:19668 [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --no-rebind tcp:12849 localabstract:minicap_12849 [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell dumpsys window displays [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_12849' -P 1520x720@1520x720/0 -l 2>&1 [02:36:28][DEBUG] [minicap_server]b'PID: 21985' [02:36:28][DEBUG] [minicap_server]b'INFO: Using projection 1520x720@1520x720/0' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:492) New client connection' [02:36:28][DEBUG] (1, 24, 21985, 1520, 720, 1520, 720, 0, 2) [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell dumpsys window displays [02:36:28][DEBUG] resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720) [02:36:28][DEBUG] try match with TemplateMatching [02:36:28][DEBUG] [Template] threshold=0.6, result={'result': (1447, 147), 'rectangle': ((1425, 134), (1425, 160), (1470, 160), (1470, 134)), 'confidence': 0.34906328241527074} [02:36:28][DEBUG] find_best_result() run time is 0.03 s. [02:36:28][DEBUG] try match with BRISKMatching [02:36:29][DEBUG] 'Not enough feature points in input images !' [02:36:29][DEBUG] try match with SIFTMatching [02:36:29][DEBUG] 'Target area is 5 times bigger or 0.2 times smaller than sch_img.' [02:36:29][DEBUG] match result: None 找到的結果:False [02:36:29][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --remove tcp:12849 [02:36:29][DEBUG] orientationWatcher has ended bash-3.2$

airtestIDE 可以判斷到 Keyword1.png 圖片 image

LOG: "/Applications/AirtestIDE.app/Contents/MacOS/AirtestIDE" runner "/Users/x.lin/Desktop/x/all_brand_game/test/c.air" --device Android://127.0.0.1:5037/4debe2cb --log "/var/folders/02/n9_n36mj32xdvqz8jnx_4bc80_n5_m/T/AirtestIDE/scripts/7f6d2a62b4c23efa715e36d9964b9bdf"

[Start running..] save log in '/var/folders/02/n9_n36mj32xdvqz8jnx_4bc80_n5_m/T/AirtestIDE/scripts/7f6d2a62b4c23efa715e36d9964b9bdf' [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb wait-for-device [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell getprop ro.build.version.sdk ======>> Airtest <<==================== [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb devices [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb devices [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -s 4debe2cb wait-for-device [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell getprop ro.build.version.sdk [02:40:22][WARNING] Device:4debe2cb updated <airtest.core.android.android.Android object at 0x7fbab0dfc8d0> -> <airtest.core.android.android.Android object at 0x7fba9836f908> [02:40:22][INFO] Try finding:Template(/Users/x.lin/Desktop/x/all_brand_game/test/c.air/Keyword1.png) [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell pm path jp.co.cyberagent.stf.rotationwatcher [02:40:23][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell export CLASSPATH=/data/app/jp.co.cyberagent.stf.rotationwatcher-_W6aK_VKq5-1_kCFykKDRg==/base.apk;exec app_process /system/bin jp.co.cyberagent.stf.rotationwatcher.RotationWatcher [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell ls /data/local/tmp/minicap [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell ls /data/local/tmp/minicap.so [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -v 2>&1 [02:40:24][DEBUG] version:6 [02:40:24][DEBUG] skip install minicap [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --no-rebind tcp:11750 localabstract:minicap_11750 [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell dumpsys window displays [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_11750' -P 720x1520@720x1520/270 -l 2>&1 [02:40:24][DEBUG] [minicap_server]b'PID: 22247' [02:40:24][DEBUG] [minicap_server]b'INFO: Using projection 720x1520@720x1520/3' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:40:24][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:40:24][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:40:24][DEBUG] (1, 24, 22247, 720, 1520, 720, 1520, 3, 2) [02:40:24][DEBUG] quirk_flag found, going to resetup [02:40:24][DEBUG] minicap stream ends [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --remove tcp:11750 [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --no-rebind tcp:13615 localabstract:minicap_13615 [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell dumpsys window displays [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_13615' -P 1520x720@1520x720/0 -l 2>&1 [02:40:24][DEBUG] [minicap_server]b'PID: 22260' [02:40:24][DEBUG] [minicap_server]b'INFO: Using projection 1520x720@1520x720/0' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:40:25][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:40:25][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:40:25][DEBUG] (1, 24, 22260, 1520, 720, 1520, 720, 0, 2) [02:40:25][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:492) New client connection' [02:40:25][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:40:25][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell dumpsys window displays [02:40:25][DEBUG] resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720) [02:40:25][DEBUG] try match with TemplateMatching [02:40:25][DEBUG] [Template] threshold=0.6, result={'result': (1447, 147), 'rectangle': ((1425, 134), (1425, 160), (1470, 160), (1470, 134)), 'confidence': 0.3494896601587534} [02:40:25][DEBUG] find_best_result() run time is 0.06 s. [02:40:25][DEBUG] try match with BRISKMatching [02:40:26][DEBUG] 'Not enough feature points in input images !' [02:40:26][DEBUG] try match with SIFTMatching [02:40:28][DEBUG] [SIFT] threshold=0.6, result={'result': [117, 170], 'rectangle': [(94, 149), (94, 190), (139, 190), (139, 149)], 'confidence': 0.6271888963803649} [02:40:28][DEBUG] find_best_result() run time is 2.42 s. [02:40:28][DEBUG] match result: {'result': [117, 170], 'rectangle': [(94, 149), (94, 190), (139, 190), (139, 149)], 'confidence': 0.6271888963803649} 找到的結果:[117, 170]

Ran 1 test in 5.887s

OK [02:40:28][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --remove tcp:13615 [02:40:28][DEBUG] orientationWatcher has ended [Finished]

ts00651266 commented 4 years ago

小弟已經是1.2.3版本摟~

ts00651266 commented 4 years ago

======== 下面是我分別執行的畫面與結果 ============ python 無法判斷到 Keyword1.png 圖片 image

LOG: bash-3.2$ cd /Users/x.lin/Desktop/x/all_brand_game/test ; env PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 /usr/local/bin/python3 /Users/x.lin/.vscode/extensions/ms-python.python-2020.2.64397/pythonFiles/ptvsd_launcher.py --default --client --host localhost --port 56050 /Users/x.lin/Desktop/x/all_brand_game/test/c.air/c.py ======>> Airtest <<==================== [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb devices [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb devices [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb wait-for-device [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell getprop ro.build.version.sdk [02:36:26][INFO] Try finding: Template(/Users/x.lin/Desktop/x/all_brand_game/test/c.air/Keyword1.png) [02:36:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell pm path jp.co.cyberagent.stf.rotationwatcher [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell export CLASSPATH=/data/app/jp.co.cyberagent.stf.rotationwatcher-_W6aK_VKq5-1_kCFykKDRg==/base.apk;exec app_process /system/bin jp.co.cyberagent.stf.rotationwatcher.RotationWatcher [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell ls /data/local/tmp/minicap [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell ls /data/local/tmp/minicap.so [02:36:27][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -v 2>&1 [02:36:28][DEBUG] version:6 [02:36:28][DEBUG] skip install minicap [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --no-rebind tcp:19668 localabstract:minicap_19668 [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell dumpsys window displays [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_19668' -P 720x1520@720x1520/270 -l 2>&1 [02:36:28][DEBUG] [minicap_server]b'PID: 21972' [02:36:28][DEBUG] [minicap_server]b'INFO: Using projection 720x1520@720x1520/3' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:492) New client connection' [02:36:28][DEBUG] (1, 24, 21972, 720, 1520, 720, 1520, 3, 2) [02:36:28][DEBUG] quirk_flag found, going to resetup [02:36:28][DEBUG] minicap stream ends [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --remove tcp:19668 [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --no-rebind tcp:12849 localabstract:minicap_12849 [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell dumpsys window displays [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_12849' -P 1520x720@1520x720/0 -l 2>&1 [02:36:28][DEBUG] [minicap_server]b'PID: 21985' [02:36:28][DEBUG] [minicap_server]b'INFO: Using projection 1520x720@1520x720/0' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:36:28][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:36:28][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:492) New client connection' [02:36:28][DEBUG] (1, 24, 21985, 1520, 720, 1520, 720, 0, 2) [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:36:28][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell dumpsys window displays [02:36:28][DEBUG] resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720) [02:36:28][DEBUG] try match with TemplateMatching [02:36:28][DEBUG] [Template] threshold=0.6, result={'result': (1447, 147), 'rectangle': ((1425, 134), (1425, 160), (1470, 160), (1470, 134)), 'confidence': 0.34906328241527074} [02:36:28][DEBUG] find_best_result() run time is 0.03 s. [02:36:28][DEBUG] try match with BRISKMatching [02:36:29][DEBUG] 'Not enough feature points in input images !' [02:36:29][DEBUG] try match with SIFTMatching [02:36:29][DEBUG] 'Target area is 5 times bigger or 0.2 times smaller than sch_img.' [02:36:29][DEBUG] match result: None 找到的結果:False [02:36:29][DEBUG] /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/airtest/core/android/static/adb/mac/adb -s 4debe2cb forward --remove tcp:12849 [02:36:29][DEBUG] orientationWatcher has ended bash-3.2$

airtestIDE 可以判斷到 Keyword1.png 圖片 image

LOG:

"/Applications/AirtestIDE.app/Contents/MacOS/AirtestIDE" runner "/Users/x.lin/Desktop/x/all_brand_game/test/c.air" --device Android://127.0.0.1:5037/4debe2cb --log "/var/folders/02/n9_n36mj32xdvqz8jnx_4bc80_n5_m/T/AirtestIDE/scripts/7f6d2a62b4c23efa715e36d9964b9bdf"

[Start running..]

save log in '/var/folders/02/n9_n36mj32xdvqz8jnx_4bc80_n5_m/T/AirtestIDE/scripts/7f6d2a62b4c23efa715e36d9964b9bdf' [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb wait-for-device [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell getprop ro.build.version.sdk ======>> Airtest <<==================== [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb devices [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb devices [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -s 4debe2cb wait-for-device [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -s 4debe2cb shell getprop ro.build.version.sdk [02:40:22][WARNING] Device:4debe2cb updated <airtest.core.android.android.Android object at 0x7fbab0dfc8d0> -> <airtest.core.android.android.Android object at 0x7fba9836f908> [02:40:22][INFO] Try finding:Template(/Users/x.lin/Desktop/x/all_brand_game/test/c.air/Keyword1.png) [02:40:22][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell pm path jp.co.cyberagent.stf.rotationwatcher [02:40:23][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell export CLASSPATH=/data/app/jp.co.cyberagent.stf.rotationwatcher-_W6aK_VKq5-1_kCFykKDRg==/base.apk;exec app_process /system/bin jp.co.cyberagent.stf.rotationwatcher.RotationWatcher [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell ls /data/local/tmp/minicap [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell ls /data/local/tmp/minicap.so [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -v 2>&1 [02:40:24][DEBUG] version:6 [02:40:24][DEBUG] skip install minicap [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --no-rebind tcp:11750 localabstract:minicap_11750 [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell dumpsys window displays [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_11750' -P 720x1520@720x1520/270 -l 2>&1 [02:40:24][DEBUG] [minicap_server]b'PID: 22247' [02:40:24][DEBUG] [minicap_server]b'INFO: Using projection 720x1520@720x1520/3' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:40:24][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:40:24][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:40:24][DEBUG] (1, 24, 22247, 720, 1520, 720, 1520, 3, 2) [02:40:24][DEBUG] quirk_flag found, going to resetup [02:40:24][DEBUG] minicap stream ends [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --remove tcp:11750 [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --no-rebind tcp:13615 localabstract:minicap_13615 [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell dumpsys window displays [02:40:24][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -n 'minicap_13615' -P 1520x720@1520x720/0 -l 2>&1 [02:40:24][DEBUG] [minicap_server]b'PID: 22260' [02:40:24][DEBUG] [minicap_server]b'INFO: Using projection 1520x720@1520x720/0' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:241) Creating SurfaceComposerClient' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:244) Performing SurfaceComposerClient init check' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:255) Creating virtual display' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:261) Creating buffer queue' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:264) Setting buffer options' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:268) Creating CPU consumer' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:272) Creating frame waiter' [02:40:24][DEBUG] [minicap_server]b'INFO: (external/MY_minicap/src/minicap_27.cpp:276) Publishing virtual display' [02:40:25][DEBUG] [minicap_server]b'INFO: (jni/minicap/JpgEncoder.cpp:64) Allocating 3285252 bytes for JPG encoder' [02:40:25][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:489) Server start' [02:40:25][DEBUG] (1, 24, 22260, 1520, 720, 1520, 720, 0, 2) [02:40:25][DEBUG] [minicap_server]b'INFO: (jni/minicap/minicap.cpp:492) New client connection' [02:40:25][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -i [02:40:25][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb shell dumpsys window displays [02:40:25][DEBUG] resize: (68, 40)->(45, 26), resolution: (2520.0, 1080.0)=>(1520, 720) [02:40:25][DEBUG] try match with TemplateMatching [02:40:25][DEBUG] [Template] threshold=0.6, result={'result': (1447, 147), 'rectangle': ((1425, 134), (1425, 160), (1470, 160), (1470, 134)), 'confidence': 0.3494896601587534} [02:40:25][DEBUG] find_best_result() run time is 0.06 s. [02:40:25][DEBUG] try match with BRISKMatching [02:40:26][DEBUG] 'Not enough feature points in input images !' [02:40:26][DEBUG] try match with SIFTMatching [02:40:28][DEBUG] [SIFT] threshold=0.6, result={'result': [117, 170], 'rectangle': [(94, 149), (94, 190), (139, 190), (139, 149)], 'confidence': 0.6271888963803649} [02:40:28][DEBUG] find_best_result() run time is 2.42 s. [02:40:28][DEBUG] match result: {'result': [117, 170], 'rectangle': [(94, 149), (94, 190), (139, 190), (139, 149)], 'confidence': 0.6271888963803649} 找到的結果:[117, 170] Ran 1 test in 5.887s

OK [02:40:28][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 4debe2cb forward --remove tcp:13615 [02:40:28][DEBUG] orientationWatcher has ended [Finished]

抱歉不小心 close

yimelia commented 4 years ago

2025*1080是否是當時截出Keyword1.png的那張圖所用的手機呢?

ts00651266 commented 4 years ago

2025*1080是否是當時截出Keyword1.png的那張圖所用的手機呢?

是的,Huawei Mate20X 擷取

yimelia commented 4 years ago

pip list看一下python環境中的airtest的版本號是多少?

ts00651266 commented 4 years ago

pip list看一下python環境中的airtest的版本號是多少?

=== pip3 list ==== airtest 1.1.3 opencv-contrib-python 3.4.2.16

=== airtestIDE ==== airtest 1.2.3 opencv-contrib-python 3.2.0

yimelia commented 4 years ago

1.2.3是AirtestIDE的版本號 airtest版本號可以通過pip list查看,或者是執行airtest version查看(只有最新版才支持這個指令)

ts00651266 commented 4 years ago

1.2.3是AirtestIDE的版本號 airtest版本號可以通過pip list查看,或者是執行airtest version查看(只有最新版才支持這個指令)

image

yimelia commented 4 years ago

從目前的情況來看暫時沒有想到原因,試一下分別生成2份報告,看一下報告里的截圖有沒有問題

ts00651266 commented 4 years ago

從目前的情況來看暫時沒有想到原因,試一下分別生成2份報告,看一下報告里的截圖有沒有問題

請問報告指的是系統產生的 html 嗎?

p.s python 與 AirtestIDE 的 opencv-contrib-python 版本號不同,並不會影響圖示判斷的結果摟?

yimelia commented 4 years ago

IDE里的應該也是3.4.2版本。。 報告就是在運行結束后用report那個指令生成的html,IDE里可以直接生成,python下需要運行那個airtest report

ts00651266 commented 4 years ago

pip3 list 查詢結果 opencv-contrib-python b

AirtestIDE 查詢結果 opencv-contrib-python a

yimelia commented 4 years ago

抱歉我記錯了,在mac上面的版本確實是3.2.0.7,但是這個版本python3.7以上不支持,暫時也不能確定是不是它導致的問題。 如果可以的話,確實可以試一下重新裝一個python3.6環境,然後pip install opencv-contrib-python==3.2.0.7(可以在安裝airtest完畢后,卸載掉它,重新pip install安裝),然後再試試。

yimelia commented 4 years ago

或者如果方便的話,你也可以直接提供你的原圖像、截出來的Keyword1.png給我們試一試