RaiMan / SikuliX-2014

SikuliX version 1.1.2 (until February 2018)
http://sikulix.com
805 stars 235 forks source link

failing to identify the image #297

Closed kushalbn closed 6 years ago

kushalbn commented 6 years ago

I am trying to identify this image: image 1 on the desktop which looks like this: desktop

but, it is not recognizing it. I have tried to capture image by zooming in, covering more backgroundarea in the image to be recognized, covering very less background area(white background), but none of them seem to be working.

Please Let me know if you have any solution.

RaiMan commented 6 years ago

capture as little background as possible! ... just the max rectangle inside the blue circle

kushalbn commented 6 years ago

well thanks for suggestion, but there are times when greencircle with heart might not appear, so i need to verify if that heart inside green circle is present along with that blue circle...

RaiMan commented 6 years ago

Those situations are a bit tricky, but this is a possible solution:

after having found the base image as suggested, just check wether the heart is there in an appropriate region at the top right of the match:

match = exists(baseImage)
if match:
    regHeart = match.getTopRight().grow(100)
    if regHeart exists(heartImage):
       # do what is needed
    else:
       # do something else
kushalbn commented 6 years ago

ok thankyou..