sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #45084
Re: [Question #661969]: [1.1.2] findAnyList(): possible to find all matches? --- no, workaround
Question #661969 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/661969
Summary changed to:
[1.1.2] findAnyList(): possible to find all matches? --- no, workaround
Description changed to:
------------------ workaround
--1: loop around a Finder::findAll()
finder = Finder(capture(aRegion))
patterns = [pat1, pat2, pat3]
matches = []
for pat in patterns:
matches.append(finder.findAll(pat))
for match in matches:
# evaluate the returned matches
--2; distribute the single findAlll() to threads
# select a threading feature
baseImage = capture(aRegion)
# per thread do this:
finder = Finder(baseImage) # Finder is not thread safe
matches = finder.findAll(pat))
# return some result
# in each thread do nothing else but findAll()
------------------------------------------------------------------------------------------------
Hi,
I read document below and know that findAnyList() returns match list of
given patterns.
http://sikulix-2014.readthedocs.io/en/latest/region.html#find-more-than-
one-image-in-a-region-at-the-same-time
However, returned match list seems provide only best match of each
pattern. Is there any way to get 'all' matches of given patterns? For
example, if there are 2 matches with img0, 1 match with img2 and 1 match
with img3, findAnyList() returns 3 best matches only.
images = [img0, img1, img2, img3]
matches = findAnyList(images)
for match in matches:
print match.getIndex(), match.getScore(), match.toStringShort()
# prints out something like:
0 0.999999761581 M[137,46 136x28]@S(0)
2 0.999999761581 M[368,99 124x27]@S(0)
3 0.999994277954 M[489,72 220x29]@S(0)
I would like to know if there have any API that can return 4 matches like below:
0 0.999999761581 M[137,46 136x28]@S(0)
0 0.999999666666 M[237,56 136x28]@S(0) // <-- just an example
2 0.999999761581 M[368,99 124x27]@S(0)
3 0.999994277954 M[489,72 220x29]@S(0)
Currently, I do it by findAll() API, and then loop it on each patterns.
But is not so efficient.
--
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.