Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Location Box() that locate functions return don't quite describe the region the image was found at. #118

Open
kito323 opened this issue Feb 29, 2024 · 0 comments

Comments

@kito323
Copy link

kito323 commented Feb 29, 2024

yield Box(matchx + region[0], y + region[1], needleWidth, needleHeight)

I had a situation where I needed to search a needle image at high frequency so I first located it from the whole screen and then spam-searched it again in that found Box() by using the found location as the region parameter in locate functions. To my surprise it couldn't find it there again. Then I lowered the confidence parameter in the locate functions (meaning it now needed also the OpenCV library) and it was only until 0.8 or lower that it found it again. The problem then was that one of the cases actually needed very high confidence level for my situation (it looked very similar most of the time but I needed to know when it only slightly changed). I then tried to increase the initial location Box() dimensions manually a few pixels each direction and it then worked at higher confidence levels again. So what I concluded was that there is somewhat inconsistency in this region parameter that is worth considering to be fixed. I think it is not exactly "one-off" problem as well, because when I first tried to increase the box by one pixel to each direction, it still failed. Kind of unexpected IMHO that the region that an image was found in cannot be expected to be used to subset initial haystack image to faster find the same needle image again...

If this is not possible then perhaps add a functionality/method to the Box() object that would allow it easily expand/shrink, as currently it is kind of annoying requiring duplicate code and recreation of tuples when doing it manually.

Note: I used pyautogui library but as far as I understood it very straightforward uses locate functions from this pysreeze library and the returned Box() object has type descriptions from this library as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant