有哪位大佬会,Python的opencv模块吗,我写的代码没有报错也没执行
import cv2
import pyautogui
def test1():
pyautogui.screenshot().save('F:/screen')
img=cv2.imread('F:/screen')
a=cv2.imread('D:/photo/a.png')
height,width,channel=a.shape
result=cv2.matchTemplate(img,a,cv2.TM_SQDIFF_NORMED)
l=cv2.minMaxLoc(result)[2]
r=(l[0]+width,l[1]+height)
avg=(int((l[0]+r[0])/2),int((l[1]+r[1])/2))
return avg
def test2():
pyautogui.click(var_avg[0],var_avg[1],button='left')
def test3():
avg=test1()
auto_click(avg)
routine('D:/photo/a.png')
...全文