android studio 上配置opencv4Android
2015-02-04 15:56
197 查看
The below steps for using Android OpenCV sdk in Android Studio. Thanks to TGMCains answer which is simplified below.
Download latest OpenCV sdk for Android from OpenCV.org and
decompress the zip file.
Import OpenCV to Android Studio, From File -> Import Module, choose sdk/java folder
in the unzipped opencv archive.
Update build.gradle under imported OpenCV module to update 4 fields to match your project build.gradle a) compileSdkVersion
b) buildToolsVersion c) minSdkVersion and 4) targetSdkVersion.
Add module dependency by Application -> Module Settings, and select
the Dependencies tab. Click + icon at bottom, choose Module Dependency and select the
imported OpenCV module.
Copy libs folder under sdk/native to
Android Studio under app/src/main.
In Android Studio, rename the copied libs directory to jniLibs and
we are done.
Step (6) is since Android studio expects native libs in
of older
For those new to Android OpenCV, don't miss below steps
include
For step(5), if you ignore any platform libs like x86, make sure your device/emulator is not on that platform.
OpenCV written is in C/C++. Java wrappers are
Android
OpenCV SDK - OpenCV.org maintained Android Java wrapper. I suggest this one.
OpenCV
Java - OpenCV.org maintained auto generated desktop Java wrapper.
JavaCV -
Popular Java wrapper maintained by independent developer(s). Not Android specific. This library might get out of sync with OpenCV newer versions.
Download latest OpenCV sdk for Android from OpenCV.org and
decompress the zip file.
Import OpenCV to Android Studio, From File -> Import Module, choose sdk/java folder
in the unzipped opencv archive.
Update build.gradle under imported OpenCV module to update 4 fields to match your project build.gradle a) compileSdkVersion
b) buildToolsVersion c) minSdkVersion and 4) targetSdkVersion.
Add module dependency by Application -> Module Settings, and select
the Dependencies tab. Click + icon at bottom, choose Module Dependency and select the
imported OpenCV module.
Copy libs folder under sdk/native to
Android Studio under app/src/main.
In Android Studio, rename the copied libs directory to jniLibs and
we are done.
Step (6) is since Android studio expects native libs in
app/src/main/jniLibsinstead
of older
libsfolder.
For those new to Android OpenCV, don't miss below steps
include
static{ System.loadLibrary("opencv_java"); }
For step(5), if you ignore any platform libs like x86, make sure your device/emulator is not on that platform.
OpenCV written is in C/C++. Java wrappers are
Android
OpenCV SDK - OpenCV.org maintained Android Java wrapper. I suggest this one.
OpenCV
Java - OpenCV.org maintained auto generated desktop Java wrapper.
JavaCV -
Popular Java wrapper maintained by independent developer(s). Not Android specific. This library might get out of sync with OpenCV newer versions.
相关文章推荐
- Android Studio 2.2 让你5分钟配置好 OpenCV for Android(java层和native层都可以使用)
- android开发 android studio配置opencv for android sdk,使用opencv的java函数
- OpenCV On Android开发 - Android Studio上环境配置
- Opencv4android的Android Studio环境配置及项目实例下载
- 【Android】Android Studio使用OpenCV的配置方法
- Android Studio配置并运行OpenCV4Android的face-detection
- Android studio2.2配置opencv for android(CMake方式)
- Android开发——Android Studio中配置及使用OpenCV示例
- Android开发——Android Studio中配置及使用OpenCV示例
- Android 配置 OpenCV2.3.1
- Android Studio配置AndroidAnnotations
- [Android] 环境配置之正式版Android Studio 1.0
- Android开发OpenCV2.4.10环境配置(免Cygwin)-前篇
- Android-Universal-Image-Loader 图片异步加载类库的使用(超详细配置)提供Android studio 的DEMO
- 在Intel Android设备中安装和配置基于OpenCV的项目开发
- android studio 配置 AndroidAnnotation
- 零Android基础配置 win7_32+opencv2.4.6+eclipse+ndk等
- OpenCV4Android 环境配置(最新详细教程)
- eclipse下android开发opencv配置图文教程
- NDK sample + Android OpenCV 配置实例