opencv官网下载Android版Releases - OpenCV
下载好OpenCV-android-sdk并解压好,然后新建一个jni文件夹测试,测试项目目录结构如下:
├── jni
│ ├── Android.mk
│ ├── Application.mk
│ └── test.cpp
Application.mk:
APP_STL := c++_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-21
Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# 设置下载好的OpenCV-android-sdk路径, 可以为相对路径和绝对路径
OPENCV_ANDROID_SDK := D:\install\opencv-4.0.1-android-sdk\OpenCV-android-sdk
# 以静态链接式编译
#OPENCV_LIB_TYPE := STATIC
# 以动态链接式编译
OPENCV_LIB_TYPE := SHARED
# 引入OpenCV的配置文件
ifdef