为什么我的代码中的搜索图像不起作用?

问题描述

这是我的代码

 import pyautogui


images = ['colordonkergrijsDCphrasev2.png'] #the image I want it to find
while True:
  for image in images: #search for the image in images
    pos = pyautogui.locateOnScreen(image,region=(740,870,50,20)) #search on the screen for the image
    if pos is not None: # this checks that the image was found   
      pyautogui.click(pos) # click the position of the image 

我希望我的代码在他看到该图像时点击一个特殊区域。 但是我的代码没有这样做,当图像不存在时,我的代码每次都会点击。我使用的图像与背景非常相似。但是我加了 confidence = 1 还是不行 有人知道如何解决吗? 我使用 Python 3.9.4 64 位。 我已经阅读了文档,但没有任何内容可以帮助我。 如果你想在这里文档是:https://pyautogui.readthedocs.io/en/latest/screenshot.html

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)