Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Sikuli's sensitivity?

Tags:

python

sikuli

I've been using sikuli for awhile, however I have an issue with it... It's not sensitive enough. I'm trying to match something on the screen that is -EXACT-, and there are a few other items on the screen that look similar enough that sikuli is mistaking them for what I'm actually looking for, so I need to make it look for ONLY this item with no variances at all.

How can I do this?

Oh and to explain my issue a bit further, I am writing a loop for a game, once a progress bar has reached 100% - it needs to allow the loop to finish (And start over again), however the progress bar is just a plain bar - so when sikuli looks for it on the screen, it finds the partially complete bar (Since apparently it matches different lengths/widths/sizes of the image it is looking for), and triggers.

like image 889
Jon Avatar asked Mar 09 '10 07:03

Jon


2 Answers

You can do the following in the Sikuli IDE:

  • Click on the image
  • In Pattern Settings > Matching Preview, drag the Similarity bar to 1.0 (all the way to the right)
  • Click OK
like image 150
Roy Tinker Avatar answered Sep 29 '22 00:09

Roy Tinker


If you are using Sikuli IDE click image miniature, for which you want to change sensitivity. You will be presented screenshot of your desktop with and occurrences of pattern(your image). Below there is a slider witch changes sensitivity. While changing it you will notice that highlighted occurrences of the pattern increase or decrease accordingly.
This method assumes that you have your game on screen (so windowed mode, not fullscreen), but even if you don't you still can adjust sensitivity, just you won't see 'live' results of search.

If you call sikuli from Java code, you have to use Pattern(image.png).similar(y.xx)
where the argument of simmilar is something between 0.00 and 1.00.
I haven't used second method so you may need to experiment with it.

like image 37
yoosiba Avatar answered Sep 30 '22 00:09

yoosiba