【FastCV】FastCV实例1
来源:互联网 发布:类似于皮影客的软件 编辑:程序博客网 时间:2024/05/29 14:57
在上一篇《FastCV环境搭建》中已经描述了如何搭建FastCV及其导入FastCV SDK自带的demo,这篇文章将讲述如何自己创建一个FastCV项目。
1、创建一个新的安卓工程 fastCVTest。
2、在工程目录下新建jni文件夹,把fastcv.h及libfastcv.a拷贝到jni文件夹下,并且在文件夹下创建android.mk application.mk image.cpp 文件,编辑以下内容:
application.mk
APP_ABI := armeabi-v7aAPP_STL := gnustl_staticAPP_CPPFLAGS := -frtti -fexceptions
android.mk
# 在编译源文件前先编译出libfastcv.so 库include $(CLEAR_VARS)LOCAL_MODULE := fastcvLOCAL_SRC_FILES := libfastcv.ainclude $(PREBUILT_STATIC_LIBRARY)#编译libfastCVTest.soLOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := fastCVTestLOCAL_CPPFLAGS := -frtti -fexceptionsLOCAL_LDLIBS += -llog -lz#引用libfastcv.soLOCAL_STATIC_LIBRARIES := fastcvLOCAL_SRC_FILES := image.cppinclude $(BUILD_SHARED_LIBRARY)
image.cpp
#include "fastcv.h"#include "jni.h"#include <android/log.h>#ifndef LOG_TAG#define LOG_TAG "FASTCV"#endif#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)#ifdef __cplusplusextern "C" {#endif /* __cplusplus */void Java_com_example_fastcvtest_MainActivity_test(JNIEnv* env,jobject thiz){ char sVersion[32]; fcvGetVersion(sVersion, 32); LOGD("FastCV version %s", sVersion);}#ifdef __cplusplus}#endif
在MainActivity.java中添加:
static{ System.loadLibrary("fastCVTest");}native void test();@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); test();}
3、设置自动编译,具体参照上一篇文章中的操作。
4、运行即可看到相关的log。
该工程项目源码:
0 0
- 【FastCV】FastCV实例1
- FastCV
- FastCV实例cornerApp讲解
- Android下fastcv搭建
- 移动图像开源库-fastcv
- FastCV SDK详解
- 安装FastCV SDK
- FastCV Computer Vision SDK
- FastCV Computer Vision SDK
- fastcv 1 —— 环境配置和编译运行
- FastCV Public API最新版本1.7.1概述
- fastcv环境搭建+samples编译
- FastCV主要接口分析之一
- Android下的类OpenCV库---【FastCV】
- Linux下安装FastCV 运行samples
- Android下的类OpenCV库---【FastCV】
- fastcv 2 —— fastcorner例子浅析
- FastCV主要接口分析之二
- Struts2中常用的.properties文件、xml文件的命名方式、存放位置以及详解。
- Python 标准库 —— urllib/urllib2
- Pku2831 Can We Build This One?(次小生成树)
- char* p与char p[]
- AndroidStudio使用第三方aar包步骤
- 【FastCV】FastCV实例1
- 高仿qq健康
- Jenkins:解决Console Output中文乱码问题
- 链表操作
- 列表适配器
- 第6章 供给、需求与政府政策
- hdoj-2028-Lowest Common Multiple Plus
- Java开发环境
- 服务器错误500解决