新增支持逻辑分辨率为2.0的机型

This commit is contained in:
2025-11-13 19:31:09 +08:00
parent b9e2d86857
commit f799a6df77
7 changed files with 148 additions and 68 deletions

View File

@@ -86,7 +86,7 @@ class AiUtils(object):
# 模板匹配
res = cv2.matchTemplate(image, template, cv2.TM_CCOEFF_NORMED)
threshold = 0.7
threshold = 0.85
loc = np.where(res >= threshold)
# 放在 cv2.matchTemplate 之前
cv2.imwrite(f'/tmp/runtime_bg_{udid}.png', image)
@@ -1394,4 +1394,14 @@ class AiUtils(object):
@classmethod
def _screen_info(cls, udid: str):
try:
# 避免 c.home() 可能触发的阻塞,直接取 window_size
c = wda.USBClient(udid, wdaFunctionPort)
size = c.window_size()
print(f"[Screen] 成功获取屏幕 {int(size.width)}x{int(size.height)} {udid}")
return int(size.width), int(size.height), float(c.scale)
except Exception as e:
print(f"[Screen] 获取屏幕信息异常: {e} {udid}")
return 0, 0, 0.0