drov0 / python-imagesearch

A wrapper around opencv2 and pyautogui to do image searching easily.
MIT License
279 stars 98 forks source link

gdi32.GetDIBits() failed #34

Open GarlicYum opened 3 years ago

GarlicYum commented 3 years ago

ScreenShotError exception is thrown when using region_grabber

GarlicYum commented 3 years ago

In fact, I can't use this library at all... Even just copying the simple example:

from python_imagesearch.imagesearch import imagesearch

pos = imagesearch(path) if pos[0] != -1: print("position : ", pos[0], pos[1]) else: print("image not found")

gives me an error: Exception has occurred: AttributeError 'NoneType' object has no attribute 'shape'

drov0 commented 3 years ago

@Yumtard I'm guessing your path is wrong, try with an absolute path to the image you want to search.