← Back to team overview

sikuli-driver team mailing list archive

[Question #247902]: Image recognition bug?

 

New question #247902 on Sikuli:
https://answers.launchpad.net/sikuli/+question/247902

I writing a script for a game.

When the health bar changes its color from green to grey i want character to stop attacking.

Here is crop of game screen with grey low health bar
http://i.piccy.info/i9/cfdf06e63c65f48fd439ce95b337d848/1398788298/13368/738243/yaboo.png

And here is the image of full health bar. while(if) which exists - I want to sikuli click on attack button:
http://i.piccy.info/i9/10348a092ffe4f968fba8e9d85e30527/1398788311/106/738243/health.png

Here is a script:
if exists (Pattern("health.png")):        
   click ("attack.png")
else:
   popup ("yabooo!")

What is strange. When I use Matching Preview - it doesn't identify grey bar and green bar as the same. But when the script works it ignores difference even with the high similarity ratio. Such high ratio results sometimes completely green bar not recognized and sikuli stops pressing attack.

What can be done here? I tried different matching ration settings. Are there some advice on image selection? Can I make this identification to work more accurate?


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.