[request] Ubuntu 12.04: Sikuli should work with OpenCV 2.3

Bug #949808 reported by Zhi
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Wishlist
RaiMan

Bug Description

Failed to import the module sikuli.Sikuli in jython in Ubuntu 12.04, it seems that it depends on opencv2.1 however opencv2.3 is installed in Ubuntu 12.04.

Error:
 File "/home/administrator/Linux/lib/clientgui.py", line 4, in <module>
    from sikuli_utils import *
  File "/home/administrator/Linux/lib/sikuli_utils.py", line 6, in <module>
    from sikuli.Sikuli import *
  File "/home/administrator/Linux/lib/sikuli_utils.py", line 6, in <module>
    from sikuli.Sikuli import *
  File "/home/administrator/Linux/lib/libsikuli/sikuli/__init__.py", line 1, in <module>
    from Sikuli import *
  File "/home/administrator/Linux/lib/libsikuli/sikuli/Sikuli.py", line 20, in <module>
    from org.sikuli.script import Finder
java.lang.UnsatisfiedLinkError: /tmp/tmplib/libVisionProxy.so: libml.so.2.1: cannot open shared object file: No such file or directory
 at java.lang.ClassLoader$NativeLibrary.load(Native Method)
 at java.lang.ClassLoader.loadLibrary0(Unknown Source)
 at java.lang.ClassLoader.loadLibrary(Unknown Source)
 at java.lang.Runtime.load0(Unknown Source)
 at java.lang.System.load(Unknown Source)
 at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44)
 at org.sikuli.script.Finder.<clinit>(Finder.java:28)

........ and more stuff

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: /tmp/tmplib/libVisionProxy.so: libml.so.2.1: cannot open shared object file: No such file or directory File

Installed Packages can be found in the attachment "packages.txt".

Tags: ubuntu
Revision history for this message
Zhi (linzhi1998) wrote :
Revision history for this message
RaiMan (raimund-hocke) wrote :

You either fix it, by making appropriate links to the OpenCV 2.3 libraries (do not know, wether this works - I heard, that one module is now integrated and missing).

Or you install the OpenCV 2.1 version in parallel.

Or you have to build Sikuli from source (at least with OpenCV 2.2 this is possible).

description: updated
RaiMan (raimund-hocke)
summary: - Sikuli does not work in Ubuntu 12.04
+ [request] Ubuntu 12.04: Sikuli should work with OpenCV 2.3
Changed in sikuli:
importance: Undecided → Wishlist
Zhi (linzhi1998)
description: updated
Revision history for this message
Zhi (linzhi1998) wrote :

Thanks for your indication, RaiMan.

> Or you have to build Sikuli from source (at least with OpenCV 2.2 this is possible).
The following error came to me; do you have any idea about this ?

administrator@ubuntu120402:~/sikuli_source/sikuli-sikuli-699d404/sikuli-script/build$ cmake ..
Tesseract-OCR Data Path: TESSERACT_DATA_DIR-NOTFOUND
Tesseract-OCR Data Path: TESSERACT_DATA_DIR-NOTFOUND
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY
  JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindJNI.cmake:240 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/main/native/CMakeLists.txt:27 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

Revision history for this message
RaiMan (raimund-hocke) wrote :

Tessaract OCR 2.04 is not installed as it should be.

Revision history for this message
Zhi (linzhi1998) wrote :

It works after making appropriate links to the OpenCV 2.3 libraries and partial installation of OpenCV2.1.
Thanks RaiMan.

Revision history for this message
tiddy (tiddy-xiong) wrote :

Though this solution works, sikuli will abort the program some times when trying to find a string from screen or invoke text() method for the screen:
------------------------------------------------------------------------------
[log] RIGHT CLICK on (1120,835)
Using substitute bounding box at (31,0)->(71,16)
java: unicharset.cpp:76: const UNICHAR_ID UNICHARSET::unichar_to_id(const char*, int) const: Assertion `ids.contains(unichar_repr, length)' failed.
/home/tiddy/bin/jython: line 263: 11795 Aborted (core dumped) "${JAVA_CMD[@]}" $JAVA_OPTS "${java_args[@]}" -Dpython.home="$JYTHON_HOME" -Dpython.executable="$PRG" org.python.util.jython $JYTHON_OPTS "$@"

------------------------------------------------------------------------------

BTW, after the error, I cannot type via keyboard in the Terminal, and also failed to paste text in the Terminal. I have to close the current Terminal to restart.

Revision history for this message
RaiMan (raimund-hocke) wrote :

@ tiddy
This problem is related to the usage of Tesseract, since the error happens in a Tesseract library module:

Tesseract log message: Using substitute bounding box at (31,0)->(71,16)

Tesseract c++ module: unicharset.cpp:76: const UNICHAR_ID UNICHARSET::unichar_to_id(const char*, int) const: Assertion `ids.contains(unichar_repr, length)' failed.

So your problem has nothing to do with this thread, that talks about OpenCV and not Tesseract.

Revision history for this message
tiddy (tiddy-xiong) wrote :

OK. Thanks for the update, RaiMan.

Revision history for this message
j (j-the-k) wrote :

@Zhi
Can you please tell how exactly you made sikuli work on ubuntu 12.04? I'm trying at the moment but I was not successful until now.

Revision history for this message
j (j-the-k) wrote :

Never mind, I did it.
Just install http://packages.ubuntu.com/de/oneiric/libcv2.1 and everything works fine again.

Revision history for this message
truebit (wangxiao8611) wrote :

@j-the-k
after installed the libcv2.1 package, I still got following libary missing using command 'ldd libVisionProxy.so':
libcvaux.so.2.1 => not found
libhighgui.so.2.1 => not found

Revision history for this message
RaiMan (raimund-hocke) wrote :

So what did libcv2.1 install on your system?

Are there any libcv... files somewhere?

what about ibcvaux.so.2.1 and libhighgui.so.2.1? are they in some other directory?

Revision history for this message
Sepero (cowpie2000) wrote :

I was able to get sikuli working on Ubuntu 12.04 by installing these packages.
http://packages.ubuntu.com/en/oneiric/amd64/libcv2.1/download
http://packages.ubuntu.com/en/oneiric/amd64/libcvaux2.1/download
http://packages.ubuntu.com/en/oneiric/amd64/libhighgui2.1/download

Thank you to the sikuli team for everything you do.

Revision history for this message
Eli Spizzichino (scrivi-gmail) wrote :

In ubuntu 12.11 that ships with opencv2.3 I solved the problem of libVisionProxy not finding libml.so by fixing the jni path
I have not installed opencv 2.1 but adding to the sikuli-ide.sh

export LD_LIBRARY_PATH="$DIR/libs:/usr/lib/x86_64-linux-gnu/jni:$LD_LIBRARY_PATH"

of course change the x86_64-linux-gnu part if you are in different arch.

you can find out the correct value by
$ dpkg-architecture |grep DEB_HOST_MULTIARCH

Keep it up RaiMan!
ciao
Eli

Revision history for this message
RaiMan (raimund-hocke) wrote :

@ Eli:
Thanks for feedback and solution.

Changed in sikuli:
assignee: nobody → RaiMan (raimund-hocke)
RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
tags: added: ubuntu
Revision history for this message
Chris Kiick (9e9o1ko8b2f5xpiibgscjzlhug6x-759v2-0zxvj9hhx1hzo5xiyhxz186cr43t) wrote :

The oneiric packages are no longer available on ubuntu site. Is there an alternate? I searched for opencv but there is no longer a 2.1 version available from ubuntu. If I can't find opencv 2.1, should I build opencv or sikuli?

Revision history for this message
RaiMan (raimund-hocke) wrote :

@Chris

yes, if you do not get it running, you have to build from sources. There should be some hints about that here and in the net.

After the new version is ready in May, I will take care in June/July, that these kind of packages come back

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.