I was getting an error and couldn’t find anything on it
code is from https://github.com/KianBrose/Image-Recognition-Botting-Tutorial/blob/master/stickman.py
#This script locates the image stickman.png in the region we give it and tell you if it can see it
from pyautogui import *
import pyautogui
import time
import keyboard
import random
import win32api, win32con
while 1:
if pyautogui.locateOnScreen('hope.png', region=(150,175,350,600), grayscale=True, confidence=0.8) != None:
print("I can see it")
time.sleep(0.5)
else:
print("I am unable to see it")
time.sleep(0.5)
after running module i’m given this error
Traceback (most recent call last):
File "R:\hhhh\i wish.py", line 11, in <module>
if pyautogui.locateOnScreen('hope.png', region=(150,175,350,600), grayscale=True, confidence=0.8) != None:
File "C:\Users\polan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 172, in wrapper
return wrappedFunction(*args, **kwargs)
File "C:\Users\polan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyautogui\__init__.py", line 210, in locateOnScreen
return pyscreeze.locateOnScreen(*args, **kwargs)
File "C:\Users\polan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyscreeze\__init__.py", line 405, in locateOnScreen
retVal = locate(image, screenshotIm, **kwargs)
File "C:\Users\polan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyscreeze\__init__.py", line 383, in locate
points = tuple(locateAll(needleImage, haystackImage, **kwargs))
File "C:\Users\polan\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyscreeze\__init__.py", line 241, in _locateAll_opencv
raise ValueError('needle dimension(s) exceed the haystack image or region dimensions')
ValueError: needle dimension(s) exceed the haystack image or region dimensions
I am not at all experienced