Sikuli API not recognizing image data

Asked by cod3assassin@gmail.com

Hi there!

I'm trying to use Sikuli in a Java FX project of mine. However, Sikuli fails to recognize any of the images I try to click on or wait for. Interestingly, the same images work will in the Sikuli IDE, but seem to fail when I use it externally with the API. Does anyone know why this might be the case and how I should fix it? Here's some of the code I have thus far:

" App app = new App("BlueStacks.app");
                app.focus();
                try {
                    s.wait(new Pattern("img/ps.png"));
                } catch (FindFailed ex) {
                    Logger.getLogger(AutoMessageSender.class.getName()).log(Level.SEVERE, null, ex);
                }"

The exception I am getting is: "FindFailed: can not find img/time.png in S(0)[0,0 1440x900]
  Line 2189, in file Region.java..."

I'd really appreciate if anyone could help me out here.

Thanks for your time,

CodeAssassin

Question information

Language:
English Edit question
Status:
Expired
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

Where have you stored the image files?

Revision history for this message
RaiMan (raimund-hocke) said :
#2

You should use the latest 1.1.1 (http://sikulix.com) and have a look at the docs about usage of SikuliX with Java.

Revision history for this message
cod3assassin@gmail.com (cod3assassin) said :
#3

I am using the latest version. I've stored the image files relative to my working directory in a folder called "img". I noticed that playing around with the similarities of a pattern match gets rid of the error, but it completely picks up the wrong image. I've tried limiting the search region, but that just indefinitely hangs the application. If you'd like I can provide the source images I'm working with.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.