Use of a Mask

Asked by Mark McGuinn on 2019-12-31

Hi,

  I am trying to use the Pattern mask feature to search for an image. Below is the code I have written, but this code causes an exception, is there something wrong with the code?

new_img = Pattern("1577396415423.png").mask
if exists ( new_img ):
    print("found it")

The exceptions is:

[error] script [ tepm ] stopped with error in line 6
[error] java.lang.RuntimeException ( sikulix.RuntimeException: find, wait, exists: invalid parameter: <bound method Pattern.mask of P(1577396415423.png) S: 0.7> )

This is on 2.0.1 on Windows 10.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
Mark McGuinn
Solved:
2020-01-01
Last query:
2020-01-01
Last reply:
2020-01-01
masuo (masuo-ohara) said : #1

Add parenthesis?
new_img = Pattern("1577396415423.png").mask
==> new_img = Pattern("1577396415423.png").mask()

Mark McGuinn (mmcguinn) said : #2

Many, many thanks for the quick response which appears to have sorted out the problem.