← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #271019]: find is background color blind :(

 

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

RaiMan proposed the following answer:
In fact the 2 different images (yellowish and grey) differ in the returned score, but only after the third decimal place.
The values are also different depending on what image you use

Furthermore exists/find return other scores than findAll does.

I have to go deeper into that (but it is really a borderline case
(Grenzfall ;-), but nevertheless it should work)

Since any usage of exists/find however does not work, this is a solution
for your special case:

top = "top.png" # image of the header ("Aktionen")
yellow = "yellow.png" # yellowish button
grey = "grey.png" # grey button
mTop = find(top)
area = mTop.below(450)
area.highlight(2)
for reg in list(area.findAllByColumn(yellow)):
  reg = reg.grow(5)
  ms = list(reg.findAll(grey))
  if len(ms) > 0:
    print "grey" if ms[0].getScore() > 0.9999 else "yellow"

a zipped version of the .sikuli can be downloaded from here:
https://onedrive.live.com/redir?resid=A97EFAF6F659D9EE!1404&authkey=!AAPOjzrSgUSzye0&ithint=file%2czip

Interesting: in contrary to the general recommendation, to capture as
little background  as possible, in this case their should be some
background around the button symbols, but inside the button area.

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