本文主要是介绍android-opencv-jni,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
//------------------start opencv--------------------@Override public void onResume(){ super.onResume(); //通过OpenCV引擎服务加载并初始化OpenCV类库,所谓OpenCV引擎服务即是 //OpenCV_2.4.3.2_Manager_2.4_*.apk程序包,存在于OpenCV安装包的apk目录中 OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback); } //OpenCV类库加载并初始化成功后的回调函数,在此我们不进行任何操作 private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this){ @Override public void onManagerConnected(int status){ switch (status){ case LoaderCallbackInterface.SUCCESS:{ System.loadLibrary("image_proc"); } break; default:{ super.onManagerConnected(status); } break; } } } ; //------------------end opencv--------------------
android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include ../OpenCV-SDK/native/jni/OpenCV.mk LOCAL_SRC_FILES := ImageProc.cpp
LOCAL_SRC_FILES += Hull.cpp
LOCAL_SRC_FILES += Minrectange.cpp LOCAL_MODULE := image_proc include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_STL := gnustl_static
APP_CPPFLAGS := -frtti -fexceptions
APP_ABI := armeabi-v7a
APP_PLATFORM := android-8
这篇关于android-opencv-jni的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!