← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #272621]: Undesired match of grayed out image

 

Question #272621 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/272621

    Status: Open => Answered

RaiMan proposed the following answer:
something like that:

# script to evaluate the scores:

# colored situation
colored = "colored.png"
greyed = "greyed.png"
reg = Region(0,20,100,50)
mc = reg.find(colored)
mg = reg.find(greyed)
print "colo", mc.getScore()
print "grey", mg.getScore()

do the same for the greyed situation and you will get the exact score
values for each of the 4 cases.

now decide for your personal approach like this:

m = reg.find(colred)
scoreColoredShouldBe = 0.99995 # the appropriate score from the evaluations before
if m.getScore() > scoreColoredShouldBe:
  print "is colored"
else:
  print "is greyed"

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.