【发布时间】:2021-06-04 23:44:16
【问题描述】:
我正在尝试使用 PyAutoGUI 查找特定图像,它工作得很好,但我似乎无法使用 'confidence'、'grayscale' 或其他 OpenCV 提供的关键字。我试过重新导入包/库,但它仍然不起作用。知道是什么原因造成的吗?
import pygetwindow as gw
import pyautogui as ag
import cv2
lol = gw.getWindowsWithTitle('League Of Legends')[0]
r = 0
while True:
try:
while r == 0:
if lol.isActive:
print("lol is active")
ag.locateOnScreen('findmatch.png', confidence=.9)
ag.click('findmatch.png')
break
except:
r = 1
print("Image not found")
break
【问题讨论】: