Tim's Blog

始于技术 不止于技术

  menu
11 文章
3 评论
2175 浏览
2 当前访客
ღゝ◡╹)ノ❤️

Android快速集成OpenCV 有更新!

首先需要先下载一个OpenCV的Android开发SDK:
image.png
image.png
新建一个空项目,然后Android Studio菜单–>File–>New–>Import Module

1、选择刚刚的sdk文件夹下的java文件夹;
2、Module name: Android studio会自动填充这项为openCVLibrary340 ,不用管它;
3、点击下一步,会出现三个复选框,都选上,点击Finish。

如果在集成过程中出现

ERROR: Failed to install the following Android SDK packages as some licences have not been accepted.
   build-tools;28.0.3 Android SDK Build-Tools 28.0.3
   platforms;android-14 Android SDK Platform 14
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: D:\develop\AndroidSDK
Install missing SDK package(s)

直接点击Install missing SDK package(s)下载即可

image.png

接着,需要把Module的几个编译参数改成和工程一致即可:
image.png

此时需要在app/src/main下新建文件夹jniLibs,把下载的OpenCV-android-sdk的sdk/native/libs下的所有文件拷贝到jniLibs下


标题:Android快速集成OpenCV
作者:zouchanglin
地址:http://zouchanglin.cn/articles/2019/07/31/1564536436632.html

评论