Hello! I've been stuck with this for the last couple of days, I have a PDF with some fields I need to click, the fields are light blue, so I search these using pyautogui.locateCenterOnScreen, but as I tracked down to pyscreeze._locateAll_opencv, I will use this on demo code
What happens is:
When using cv.matchTemplate, it finds the correct position: Box(left=30, top=243, width=8, height=9)
When using pyscreeze it finds many boxes at top of image but none is correct
I'm glad to help if needed, but atm I don't know what to do anymore besides using matchTemplate for this exact set of needle/haystack, this might be a bug, so I guess I should open this issue
Hello! I've been stuck with this for the last couple of days, I have a PDF with some fields I need to click, the fields are light blue, so I search these using
pyautogui.locateCenterOnScreen
, but as I tracked down topyscreeze._locateAll_opencv
, I will use this on demo codeWhat happens is:
Box(left=30, top=243, width=8, height=9)
I'm glad to help if needed, but atm I don't know what to do anymore besides using matchTemplate for this exact set of needle/haystack, this might be a bug, so I guess I should open this issue
Some info:
Windows 10 Pro Version 21H2
3.9.13
0.9.53
0.1.28
The code:
import pyscreeze import cv2
def template_match(haystack, needle): """from: https://stackoverflow.com/questions/7853628/how-do-i-find-an-image-contained-within-an-image"""
if name == 'main':