Is there a Sikuli module I can import into my script to find an image match within a preset template?

Asked by TorMagnus

Let's say I have an image of a button and an image of the whole android app said button lives in. Is there a Sikuli module with which I can check if the image of the button, or something that's similar to it, exists in the image of the entire app?

In case it's relevant, I'm messing around with regression testing of android apps using MonkeyRunner, but the sameAs() method it provides is far from robust.

Bonus question: If the above is indeed possible, can I also get the pixel coordinates of the centre of the match?

Question information

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

see question: https://answers.launchpad.net/sikuli/+question/188383

the resulting match is relative to the image's top left corner (0,0).

Revision history for this message
TorMagnus (tm-rakvaag) said :
#2

Thanks, I think that covers my requirements. I am however running into all sorts of problems importing Sikuli. I've set all the env variables I can think of and tried sys.path.append(), and yet from sikuli import * in the jython interpreter yelds "ImportError: no module named sikuli". Am I missing something?

Revision history for this message
j (j-the-k) said :
#3

I think it's from sikuli.Sikuli import *, not from sikuli import *.
But I'm not sure if that's the problem in your case, sorry if my statement is not right.

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

Are you trying to use external Jython to run sikuli scripts?

In all cases it is
from sikuli import *
with Sikuli X 1.0rc3

sikuli-script.jar has to be in Jython's classpath. This should normally be sufficient.

Revision history for this message
TorMagnus (tm-rakvaag) said :
#5

Yes, I'm trying to import aspects of Sikuli to a jython script running externally.

I got my natve jython to recognize that the library exists, but since it's running 64 bit it's not working yet. A 64 bit version of sikuli would be useful. Anyway, thanks for the help.

Revision history for this message
TorMagnus (tm-rakvaag) said :
#6

Thanks RaiMan, that solved my question.

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

You might build your 64-Bit version from the sources (you only need target sikuli-script.jar).
https://github.com/sikuli/sikuli

source download: https://github.com/sikuli/sikuli/tarball/X1.0-rc3

Mac: easy
Linux: depends
Windows: possible, but more tricky