openCv 导入 android studio
来源:互联网 发布:arp软件是个什么软件 编辑:程序博客网 时间:2024/06/08 06:39
这是我从国外网站上看到的配置教程,it works for me!
Follow the below steps to add Open CV in your project as library.
Create a
libraries
folder underneath your project main directory. For example, if your project isOpenCVExamples
, you would create aOpenCVExamples/libraries
folder.Go to the location where you have SDK "\OpenCV-2.4.8-android-sdk\sdk" here you will find the
java
folder, rename it toopencv
.Now copy the complete opencv directory from the SDK into the libraries folder you just created.
Now create a
build.gradle
file in theopencv
directory with the following contentsapply plugin: 'android-library'buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' }}android { compileSdkVersion 19 buildToolsVersion "19.0.1" defaultConfig { minSdkVersion 8 targetSdkVersion 19 versionCode 2480 versionName "2.4.8" } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] res.srcDirs = ['res'] aidl.srcDirs = ['src'] } }}
Edit your settings.gradle file in your application’s main directory and add this line:
include ':libraries:opencv'
Sync your project with Gradle and it should looks like this
Right click on your project then click on the
Open Module Settings
then Choose Modules from the left-hand list, click on your application’s module, click on the Dependencies tab, and click on the + button to add a new module dependency.Choose
Module dependency
. It will open a dialog with a list of modules to choose from; select “:libraries:opencv”.Create a
jniLibs
folder in the/app/src/main/
location and copy the all the folder with *.so files (armeabi, armeabi-v7a, mips, x86) in thejniLibs
from the OpenCV SDK.Click OK. Now everything done, go and enjoy with OpenCV.
顺便附上视频教程
原文地址
http://stackoverflow.com/questions/17767557/how-to-use-opencv-in-android-studio-using-gradle-build-tool?lq=1
- opencv导入android studio
- openCv 导入 android studio
- Android Studio 导入 opencv
- Android Studio导入OpenCV Android SDK
- Android Studio下导入openCV到项目中
- opencv sample导入到Android studio(tutorial部分)
- Android studio导入OpenCV-android-sdk出现Error:(22, 0) Gradle DSL method not found: 'android()'
- android studio搭建 OpenCv
- android studio配置OpenCV
- Android studio配置opencv
- Android Studio使用OpenCV
- OpenCV Android Studio配置
- Android Studio+OpenCV+jni
- Android Studio 集成OpenCV
- Android Studio OpenCV 记录
- Android Studio 导入项目
- Android Studio导入项目
- Android Studio导入项目
- android手势滑动关闭当前activity
- 趣文:C++程序员离职前丧心病狂的报复
- 浏览器访问web服务器的流程
- 第五章—面向对象(上)
- 八大排序算法之快速排序法
- openCv 导入 android studio
- OpenCV基础
- 设置只读后禁止后撤键
- MyEclipse 优化技巧
- Python面向对象编程基础学习笔记
- 【POJ】2506 - Tiling(递推,高精度)
- 如何将MyEclipse开发的项目导入到Eclipse中运行
- Swift中根据字符串创建对象
- C语言宏定义技巧(常用宏定义)