← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #239578]: Search for images other than current .sikuli folder

 

Question #239578 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/239578

    Status: Open => Answered

RaiMan proposed the following answer:
Uuups, though all of your questions are answered already most of them
more than once here in this launchpad section including the faqs, I will
answer shortly (maybe to motivate you to go further into details
yourself).

at 1.
I cannot test it currently on Windows with RC3, since I am busy with the new version 1.1 and all is 64-Bit.
The mentioned technique works with version 1.0.1 and should work with the latest RC3 version too (though I remember, that there are some bugs with path's on Windows).
latest RC3: http://www.sikuli.org/downloadrc3.html
for version 1.0.1 start here and read carefully, things have changed a bit against RC3:
http://www.sikuli.org/download.html

at 2:
RC3 contains Jython 2.5, which is at language level Python 2.5 and contains all standard modules, that come with standard Python 2.5. For any additional Python modules, there is either a port to Jython (not many though), or it can be used with Jython (like xlrd) that are written in Python only. Any Python modules containing any C-based stuff (like Win32API) cannot be directly used in Jython, because it is Java based. There are some bridging solutions available, but these are very complex to handle.
The easiest solution is to implement a Python XML-RPC server, that dispatches the execution of Python stuff on request from an XML-RPC client in your Sikuli/Jython environment. On the same machine, this is rather fast.
Version 1.1 will contain Jython 2.7 which is on language level 2.7.

Feel free already now run your sikuli scripts with an external Jython
(e.g. 2.7) if this has advantages for you.

at 3: not implemented from the beginning since this is the complex solution I was talking about: in every possible environment you have to emulate the specific rendering process used in this environment. The browser scene alone would require tons of coding, would produce tons of bugs and create the need for update nearly every month.
We should be satisfied, that Sikuli is already available for Windows, Mac and Linux ;-)
But as already mentioned: I will add some convenience features, to better prepare for and control different image environments.

at 4:
* how it searches for images
using OpenCV's matchTemplate feature with some press and posts around

* where it searches for images
matchTemplate simply searches for a smaller image in a larger one. with Sikuli you have different approaches to use this. The most often used is to search on the screen or a part of it (a region). Internally to achieve that, we simply make a screenshot image (Java Robot) and use it as image to search in.

* how it runs python script
using the Jython interpreter class of the bundled Jython

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.