ImageSearch is not reliable compare to python's pyautogui

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dsewq1LYJ
Posts: 116
Joined: 26 Aug 2014, 23:21

ImageSearch is not reliable compare to python's pyautogui

22 Dec 2021, 06:14

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))
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

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

22 Dec 2021, 06:46

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

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: anselmopimiento1996, JoeWinograd, peter_ahk and 210 guests