Opencv integration in Android studio for app development

*爱你&永不变心* 提交于 2021-01-28 22:33:58

问题


How to integrate opencv in Android Studio? I am facing problem in importing and installing opencv library in android studio


回答1:


Install openCV in Android Studio Simple Steps:-(Indirect Method)

  1. Download/Install(Extract) OpenCV for Android (you might already have it)
    Download :-here Documentation :- here
    Version 2.4.11 is recommended.
  2. Open you Android Project on Android Studio. Import Module (Files >> New >> Import Module) Browse the path to the samples Folder inside OpenCV for Android Folder and Select any one of the Samples
    eg :-OpenCV-2.4.11-android-sdk\OpenCV-android-sdk\samples\15-puzzle
    While importing keep everything checked.
    This will automatically add OpenCV Libraries Module to your project.
    Now you can delete the 15-puzzle module (this is optional).
  3. In the gradle file of your app add dependency :- compile project(':openCVLibrary2411')
    dependencies { compile project(':openCVLibrary2411') }
  4. Now you can Import openCV classes in your project
    eg:-

import org.opencv.android.BaseLoaderCallback;
import org.opencv.android.LoaderCallbackInterface;
import org.opencv.android.OpenCVLoader;



来源:https://stackoverflow.com/questions/31144098/opencv-integration-in-android-studio-for-app-development

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