OpenCV using static libraries for Android application

荒凉一梦 提交于 2020-07-23 06:15:33

问题


I have integrated OpenCV 4.3.0 in my Android Studio 4.0 application. I have to install the OpenCV Manager on my target Android device to make my application work.

I have followed below link to integrate the OpenCV:
https://android.jlelse.eu/a-beginners-guide-to-setting-up-opencv-android-library-on-android-studio-19794e220f3c

As per the above link, I have the static OpenCV libraries in my Android application.

In my code, I just open the camera preview for testing. My application fails to load the static libraries and I have to install OpenCV Manager on my Android device then only my application works perfectly.

Also, my Android project has the libraries included under the jniLinbs folder arm64-v8a, armeabi-v7a, x86, and x86_64. But still, I have to use OpenCV Manager Application for accessing the Camera Preview. I have the below code to initialize.

if (!OpenCVLoader.initDebug()) {
  // This code is getting executed  
  Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization");
  OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_4_0, this, mLoaderCallback);
} else {
  Log.d(TAG, "OpenCV library found inside package. Using it!");
  mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
}

Am I missing anything?

I want to avoid using the OpenCV Manager Application and have all the libraries integrated into one Android application.


回答1:


  • New versions of OpenCV for Android are often unstable
  • Please download opencv-3.4.3-android-sdk.zip here and your problem will be solved: https://sourceforge.net/projects/opencvlibrary/files/opencv-android/3.4.3/
  • Good luck to you!


来源:https://stackoverflow.com/questions/62610483/opencv-using-static-libraries-for-android-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!