I'd like to use OpenCV functions, like Hough Transform and Corner Detection, in Sikuli.

I tried the OpenCV installation instructions for CPython on Sikuli and it's a no go.

I understand that Sikuli is Jython and this might be the hard way to do things. What are the easier alternatives?

I'd still like to use Sikuli & Python because the code I write just works; but maybe I'm hitting the limits of Sikuli.

有帮助吗?

解决方案

You could use Automa as an alternative to Sikuli. It is a pure Python library (so you can use any other Python library with it) and its image search algorithms are fully compatible with Sikuli. In fact, it uses OpenCV's Python bindings itself, and thus ships with them.

Disclaimer: I'm one of Automa's developers.

其他提示

Generally spoken: Python modules containing C-based code (which is the case for Python OpenCV) cannot be used in the Sikuli Script (Jython).

The integration of some OpenCV features in Sikuli is realized using the Java-To-C interface (JNI) and the usage of OpenCV features itself is coded in C++.

If you want to use OpenCV features not supported by Sikuli, then you either have to use the above mentioned JNI approach or use the Java implementation of OpenCV (javacv) (Java stuff can be used seamlessly from Jython scripts).

Another option of course is to implement the additional things in plain Python scripts using the Python/OpenCV and call these scripts via the C-Python interpreter in a subprocess.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top