← Back to team overview

sikuli-driver team mailing list archive

[Question #404348]: Sikulix cannot find target image

 

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

I am using Sikulix.jar to search images in my project. My code is as follows:

Finder f;
Match m;
Points2D coords = new Point2D.Double(-1, -1);
try {
    f = new Finder(new Pattern(ImageIO.read(new File("my_large_image.png")).similar(0.7f))); 
    f.find(ImageIO.read("my_sub_image.png"));
    if (f.hasNext()) {
        m = f.next();
        coords.setLocation(m.getTarget().getX(), m.getTarget().getY());
    }
} catch (IOException e) {}
The image to be found is just a part of the large image. I set However the coords always returns (-1, -1). But it is working perfectly when I use Screen to click target image. Any helps about the implementation? Thank you.

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