drov0 / python-imagesearch

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

Can you use this to search for sprites and not just icons ? #21

Open Demokdawa opened 4 years ago

Demokdawa commented 4 years ago

I read all of your tutorial about you wakfu-bot, and i was wondering if you used this image-search function to actually search ressources on the screen, or if you just click on every position at random and wait for a collect icon to appear ?

Thx in advance for your answer !

drov0 commented 4 years ago

clicking on every position on the screen would be awfully inefficient, I search for the element I want to click and then once imagesearch gives me the position, I click on it.

Demokdawa commented 4 years ago

First, thanks for answering me !

Thats exactly what i though !

Before using your module, i tried to template match sprites using openCV, but i couldn't get things detected properly (like i was detecting the sprit, but also things in nearly black part of the screen and lots of noise, even if it not contains the sprite at all, or it's a totally different color). But i didn't worked.

So i'm trying now your approach (and looking at the code, it seems to be something lookalike), and i doesn't get anything on the screen. I think it would work perfectly on icons since they don't change, but for sprites, do i need to capture the sprite ? Or only a part of the sprite ? Or the sprite and the surrounding ?

I even used masks and it still catched things that are totally not lookalike the sprite :/

choux

choux_mask

testscreen10

Thanks in advance for being so quick to answer !