← Back to team overview

sikuli-driver team mailing list archive

[Question #676631]: cannot find image using find(image_path)

 

New question #676631 on Sikuli:
https://answers.launchpad.net/sikuli/+question/676631

I am trying to understand Sikuli's Region.find(PS) method and I understand how to use it when i input a pattern object (image) . However, when i try to ask sikuliX to find the image given the path i i input, I always seem to get an error. 

match = "/Users/ongyichong/Desktop/Screenshot_1544070692.png"
returnMatch = find(match)

Error:

[error] JythonScriptRunner: runPython: (match = "/Users/ongyichong/Desktop/Screenshot_1544070692.png"
returnMatch = find(match)
) raised: Traceback (most recent call last):
File "<string>", line 2, in <module>
]
at org.opencv.imgproc.Imgproc.matchTemplate_1(Native Method)
at org.opencv.imgproc.Imgproc.matchTemplate(Imgproc.java:2612)
at org.sikuli.script.Finder2.doFindMatch(Finder2.java:357)
at org.sikuli.script.Finder2.doFind(Finder2.java:327)
at org.sikuli.script.Finder2.find(Finder2.java:79)
at org.sikuli.script.Finder.find(Finder.java:267)
at org.sikuli.script.Region.runFinder(Region.java:2889)
at org.sikuli.script.Region.doFind(Region.java:2827)
at org.sikuli.script.Region.find(Region.java:2327)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.b

ase/java.lang.reflect.Method.invoke(Method.java:564)
org.opencv.core.CvException: CvException [org.opencv.core.CvException: cv::Exception: OpenCV(3.4.2) /Users/raimundhocke/SikuliX/OpenCV/opencv-3.4.2/modules/imgproc/src/templmatch.cpp:1107: error: (-215:Assertion failed) _img.size().height <= _templ.size().height && _img.size().width <= _templ.size().width in function 'matchTemplate'
]

The screenshot definitely exists in the path i specified. Please advice, or am i using the API wrongly ? 

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.