0

I'm using PyAutoGUI's built in OpenCV image matching like this and it returns None every time:

pyautogui.locateOnScreen('img.png', greyscale=True, confidence=0.5)
  • I've tried many different confidences

  • I've confirmed that python-opencv is installed on my machine

  • I've tested it on Windows and Linux with no luck

  • I've made sure that the images are on the screen

  • I read through all of the questions I could find to try and fix this with no luck

I'm using the libreoffice icon to test it with no luck. I can't think of what else I would be doing wrong.

Image I'm matching:

enter image description here

locateOnScreen() just takes a screenshot I believe, so this is the screen it would of been seeing (The screenshot came from pyautogui's screenshot function):

enter image description here

I also tried this with no luck:

pyautogui.screenshot()
pyautogui.locateOnScreen('test2.png', confidence=0.5, greyscale=True)

Test2.png

Test2.png

The screenshot that pyautogui takes right before matching:

enter image description here

Holabola
  • 143
  • 1
  • 3
  • 11

0 Answers0