我想知道如何找到这些坐标,这意味着如何定位屏幕上的特定区域,以便程序仅搜索该区域中的给定图像。
from python_imagesearch.imagesearch import imagesearch
pos = imagesearcharea("./github.png", 0, 0, 800, 600)
if pos[0] != -1:
print("position : ", pos[0], pos[1])
else:
print("image not found")
我想定位屏幕上的特定区域
获取您的屏幕分辨率(请参阅此线程),然后您至少可以使用百分比。否则你必须对一些数字进行硬编码。
如果我使用 pos = imagesearcharea("./github.png", 0, 0, 800, 600) 我收到错误“NameError:名称'imagesearcharea'未定义”