Static Initialization Problem

386 views
Skip to first unread message

Droidkie

unread,
Sep 26, 2012, 1:21:37 PM9/26/12
to android...@googlegroups.com
i'm trying to run OpenCV Tutorial 1 - Add OpenCV with static initialization using dev_with_OCV_on_Android.html#application-development-with-static-initialization (i don't want a separate OpenCV Manager application installed) but i get an "OpenCV error: Cannot load info library for OpenCV." i did the following things:
  1. added a libs folder with armeabi, armeabi-v7a, and x86 folders inside of it (from <OpenCV-2.4.2-android-sdk>/sdk/native/libs/>
  2. added the static{if (!OpenCVLoader.initDebug())} code just below private Sample1View mView;
  3. removed the if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack)) code
what seems to be the problem?

Andrey Pavlenko

unread,
Sep 27, 2012, 8:50:00 AM9/27/12
to android...@googlegroups.com
The logcat message "OpenCV error: Cannot load info library for OpenCV" doesn't indicate an error, look at the followed log lines to see that "OpenCV libs init was ok!"
Most likely your problem is that after you removed "if (!OpenCVLoader.initAsync..." code block, nobody calls the "mOpenCVCallBack.onManagerConnected()" method that creates View and opens Camera.
Quick fix is to call "mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS);" in "OnCreate()" method...

Droidkie

unread,
Sep 27, 2012, 10:17:57 AM9/27/12
to android...@googlegroups.com
i did what you posted but it still doesn't work. here is the log:
Trying to get library list
OpenCV error: Cannot load info library for OpenCV
Library list: ""
First attempt to load libs
Trying to init OpenCV libs
Trying to load library opencv_java
Trying to load lib /data/data/org.opencv.samples.tutorial1/lib/libopencv_java.so
Shared lib '/data/data/org.opencv.samples.tutorial1/lib/libopencv_java.so' already loaded in same CL
OpenCV libs init was ok!
First attempt to load libs is OK
Reply all
Reply to author
Forward
0 new messages