[1.1.2] findAnyList(): possible to find all matches? --- no, workaround
------------------ workaround
--1: loop around a Finder::findAll()
finder = Finder(
patterns = [pat1, pat2, pat3]
matches = []
for pat in patterns:
matches.
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.
# 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.
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.toStringS
# 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.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- RaiMan
- Solved:
- Last query:
- Last reply: