[1.1.4]Is the masked pattern valid for findAll()?

Asked by masuo on 2018-08-26

code1: worked
code2: FindFailed exception occurred

maskImg = Pattern("cone-mask.png").asMask()
maskedPtn = Pattern("safety-cone.png").withMask(maskImg)

maskImg = Pattern("cone-mask.png").asMask()
maskedPtn = Pattern("safety-cone.png").withMask(maskImg)
res = findAll(maskedPtn)
while True:
    if res.hasNext():
        m = res.next()


Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
RaiMan (raimund-hocke) said : #1

LOL, you are my best tester ;-)

right, findAll with mask patterna does not yet work.

I make it a bug, since I found additionally, that the mask handling can be a bit easier.
So it takes a bit more time.

Thanks a lot.

masuo (masuo-ohara) said : #2

Thanks RaiMan, that solved my question.

masuo (masuo-ohara) said : #3

Evidence of executing the script

The result of code 4 is not what I expected.

RaiMan (raimund-hocke) said : #4

please send me the images and a screenshot of the relevant part.

Mail: sikulix---at---outlook---dot---com

RaiMan (raimund-hocke) said : #5

- added a simpler .mask() and .mask(ImageOrPattern) (see docs)

- there is a findAllList():

matches = findAllList(image)
for match in matches:

masuo (masuo-ohara) said : #6

I'm sorry, I did not notice that the document was changed. asMask and withMask are removed from the document and there is only mask. So I will use mask from now on.

RaiMan (raimund-hocke) said : #7

No need to be sorry.

Sometimes the docs tell you nothing about something and then they change without notice ;-)

In this case, the first solution (asMask/withMask) was a bit too detailed and not really straight forward.
So I made it a bit more convenient.

Thanks for your continuous contributions.

RaiMan (raimund-hocke) said : #8

BTW: I would like to use your example with the map and cones as a more general example for the docs.

Is that ok?

Best RaiMan (raimund-hocke) said : #9

The latest build from today should do what you expect.

masuo (masuo-ohara) said : #10

Please use it.

I confirmed it worked.

masuo (masuo-ohara) said : #11

Thanks RaiMan, that solved my question.