sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #13406
Re: [Question #208900]: counting icons
Question #208900 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/208900
Status: Needs information => Answered
RaiMan proposed the following answer:
This is the principle based on your screenshot:
cross = "1348735556699.png"
check = "1348735653726.png"
#print selectRegion() # had to define the column region on my screen
reg = Region(0, 110, 40, 500)
# in real life, this should be defined relative to some key visual
reg.highlight(1)
crosses = sorted(list(reg.findAll(Pattern(cross).similar(0.95))), key= lambda m: m.y)
checks = sorted(list(reg.findAll(Pattern(check).similar(0.90))), key= lambda m: m.y)
for e in crosses: e.highlight(1)
for e in checks: e.highlight(1)
crosses and checks contain a sorted list of the corresponding matches.
Come back if you need more help.
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.