Page 1 of 1

ImageSearch is not reliable compare to python's pyautogui

Posted: 22 Dec 2021, 06:14
by dsewq1LYJ
Hi all.

I trying to test AHK's ImageSearch to a function called locateOnScreen() from pyautogui

locateOnScreen() has a interesting parameter called "confidence", it's similar idea(maybe) to ImageSearch"s *n variation argument.

First of all, by using same image source, locateOnScreen() gives really reliable result, but with ImageSearch I will end up increasing the *n argument until it found result(although it's wrong)

~

So am I using it wrong ~ or there's a trick about using ImageSearch or maybe it's possible to implement a command like locateOnScreen()?

"pyautogui" (A python package based on pyscreeze (I guess pyscreeze based on CV2 and Pillow ~ and I sure Pillow used a lot of HDC stuff, which I think it's possible to implemet in AHK))

Re: ImageSearch is not reliable compare to python's pyautogui

Posted: 22 Dec 2021, 06:46
by swagfag
yeah, maybe... but most likely not. luckily u need not look any further than the source and docs to find out

https://github.com/asweigart/pyscreeze/blob/3c79c662e4db8e2f5d96220fffcccfa676ae1691/pyscreeze/__init__.py#L229-L231
https://docs.opencv.org/4.x/df/dfb/group__imgproc__object.html#ga586ebfb0a7fb604b35a23d85391329be
there's openCV 2(and now 4) available for ahk, so nothing stopping u using it