Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Static Initialization on OpenCV Android [duplicate]

Tags:

i'm trying to run OpenCV Tutorial 1 - Add OpenCV with static initialization using this
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 below code

if (!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))

what seems to be the problem?

like image 551
Droidkie Avatar asked Sep 27 '12 06:09

Droidkie


1 Answers

You should add the code:

mOpenCVCallBack.onManagerConnected(LoaderCallbackInterface.SUCCESS); 

after:

if(!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))  

If you remove:

if(!OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_2, this, mOpenCVCallBack))   

code block then nobody calls.

Hope it can help you.

like image 180
Qichao Chen Avatar answered Sep 19 '22 18:09

Qichao Chen