← Back to team overview

sikuli-driver team mailing list archive

Re: [Bug 1857799] Image Size

 

image



in the IDE
v_Image = "/Users/Jeff/Documents/Sikuli_Live/SikuliScripts/Vikings/Code/Data/Images_Mac/Ruler.png"  # Location of the above ruler

setRect(733,836,39,47)
highlight(1)
if exists(v_Image):
    print "^ " * 40
    print "Found"
print "Done"
exit(0)

result


[log] highlight R[733,836 39x47]@S(0) for 1.0 secs
[error] script [ sikulitemp-6882804543996897290 ] stopped with error in line 4
[error] Error caused by: Traceback (most recent call last):
  File "/var/folders/8k/9ksc02xj1kq3jm3xs_wx2tz80000gn/T/Sikulix_408720900/SikulixIDETempTab1577627846866/sikulitemp-6882804543996897290.py", line 4, in <module>
    if exists(v_Image):
]
	at org.opencv.imgproc.Imgproc.matchTemplate_1(Native Method)
	at org.opencv.imgproc.Imgproc.matchTemplate(Imgproc.java:2616)
	at org.sikuli.script.Finder$Finder2.doFindMatch(Finder.java:898)
	at org.sikuli.script.Finder$Finder2.doFind(Finder.java:868)
	at org.sikuli.script.Finder$Finder2.find(Finder.java:617)
	at org.sikuli.script.Finder.find(Finder.java:280)
	at org.sikuli.script.Region.runFinder(Region.java:2905)
	at org.sikuli.script.Region.doFind(Region.java:2841)
	at org.sikuli.script.Region.access$300(Region.java:23)
	at org.sikuli.script.Region$RepeatableFind.run(Region.java:3122)
	at org.sikuli.script.Region$Repeatable.repeat(Region.java:3073)
	at org.sikuli.script.Region.exists(
Region.java:2385)
	at org.sikuli.script.Region.exists(Region.java:2409)
	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.base/java.lang.reflect.Method.invoke(Method.java:567)
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'
]


I cannot reproduce in my existing code now that I have changed to
setRect to region of main screen


Regards
Jeff





> On 29 Dec 2019, at 08:58:40, RaiMan <sikulix@xxxxxxxxxxx> wrote:
> 
> I need a code snippet and the image used.
> 
> You could add a zip file here.
> 
> -- 
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1857799
> 
> Title:
>  Image Size
> 
> Status in Sikuli:
>  New
> 
> Bug description:
>  2.0.1-2019-11-22_16:54/Mac10.15.2/Java13(64)13.0.1+9
> 
>  setRect Smaller than size of image in exists
>  e.g.
>    highlight R[733,836 39x47]@S(0) for 1.0 secs
>    image size is over  50x50 - bigger than the 39x47 above 
> 
>  	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
>  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'
>  ]
> 
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/sikuli/+bug/1857799/+subscriptions


** Attachment added: "Ruler.png"
   https://bugs.launchpad.net/bugs/1857799/+attachment/5316232/+files/Ruler.png

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1857799

Title:
  Image Size

Status in Sikuli:
  New

Bug description:
  2.0.1-2019-11-22_16:54/Mac10.15.2/Java13(64)13.0.1+9

  setRect Smaller than size of image in exists
  e.g.
    highlight R[733,836 39x47]@S(0) for 1.0 secs
    image size is over  50x50 - bigger than the 39x47 above 

  	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
  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'
  ]

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1857799/+subscriptions


Follow ups

References