`

OpenFrameworks + kinect + Android

阅读更多

How to make:


1.Setup ofxAndroid's Development Environment
Please refer to the following site:
ofxAndroid setup manual
http://www.openframeworks.cc/setup/android-eclipse
If you can read Japanese & want to setup it on Windows, you should refer to this site.
http://blog.goo.ne.jp/tuninghigh/e/637821f5b76b370876e3092e860ce7db



2.Merge ofxKinect to ofxAndroid
2-1.Download & Setup to Eclipse

Please download soruce code from the following site:
https://github.com/ofTheo/ofxKinect

Next, Copy [ofxKinect directory]/src/ofxKinect/ to [ofxAndroid directory]/addons/ .
Final, Add include path to Eclipse's "(ofxAndroid's)addons" project.
Please run Eclipse and add the folloing place & path:

Place: Properties -> C/C++ General -> Pths and Symbols -> Includes tab(GNU C++)
Path: [ofxAndroid directory]/addons/src/ofxKinect/src/




2-2.Fix compile error
If ofxAndroid doesn't have ofxThread::waitForThread(bool) function.
Please add the following source:
[ofxAndroid directory]/addons/ofxThread/src/ofxThread.h

void waitForThread(bool stop = true);



[ofxAndroid directory]/addons/ofxThread/src/ofxThread.c


void ofxThread::waitForThread(bool stop){
if (threadRunning){
// Reset the thread state
if(stop){
threadRunning = false;
if(verbose)printf("ofxThread: stopping thread\n");
}
if(verbose)printf("ofxThread: waiting for thread to stop\n");
// Wait for the thread to finish
#ifdef TARGET_WIN32
WaitForSingleObject(myThread, INFINITE);
CloseHandle(myThread);
#else
if(pthread_self()==myThread) printf("ofxThread: error, waitForThread should only be called from outside the thread");
pthread_join(myThread, NULL);
#endif
if(verbose)printf("ofxThread: thread stopped\n");
myThread = NULL;
}else{
if(verbose)printf("ofxThread: thread already stopped\n");
}
}





2-3.Do customize source code for Android
Please remove the following code in ofxKinect::threadedFunction() function:

ofSleepMillis(20);


Please add the following code in [ofxKinect directory]/libs/lubusb/io.c file:


#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)





2-4.Create your application project
Please choose sample programs from the following directory:

[ofxAndroid directory]/apps/androidExamples/


And copy it to the following directory:

[NDK directory]/apps/


Final, export this project on Eclipse.



2-5.Build project
You must build JNI at first.
You execute the following commands:

cd [NDK directory]/apps/[your app directory]
[NDK directory]/ndk-build -B


And, you build android application on Eclipse.

*If you don't know how to use ofxKinect framework, please refer to "[ofxKinect directory]/src/testApp.cpp".



3.Change Android's configuration
Please add the following line to init.rc:

mount usbfs none /proc/bus/usb -o devmode=0666





4.Upgrade Android's kernel
libusb MUST neet "USB FS". And Kinect MUST neet "High Speed USB(USB2.0)".
Therefore, you check the following kernel options:
.config

CONFIG_USB_DEVICEFS=y
CONFIG_USB_EHCI_ARC_OTG_ALLOW_HS=y (only armadillo)




Appendix
If your device can not draw normal Z-camera image and RGB-camera image, you MUST need to build optimized kernel & userland.
I used the following optimization option for building kernel, userland & "OpenFrameworks x kinect x Android".
for armadillo

-O3 -march=armv6 -mtune=arm1136jf-s -mfpu=vfp -ffast-math -fno-math-errno -mfloat-abi=softfp -ftree-vectorize -fomit-frame-pointer -funroll-loops -fstrict-aliasing -funswitch-loops


for beagleboard

-O3 -ffast-math -fno-math-errno -march=armv7-a -mtune=cortex-a8 -mfloat-abi=softfp -mfpu=neon -ftree-vectorize -fomit-frame-pointer -funroll-loops -fstrict-aliasing -funswitch-loops






*Download
Full "OpenFrameworks x kinect x Android" Development Environment for Armadillo
Full "OpenFrameworks x kinect x Android" Development Environment for beagleboard
Only source code "OpenFrameworks x kinect x Android

Full "OpenFrameworks x kinect x Android" Development Environment has:

Android NDK crystax version for Linux
Android SDK for Linux
C/C++ Eclipse for Linux
ofxKinect(Kinect for OpenFrameworks)'s source codes
ofxAndroid(Android for OpenFrameworks)'s source codes
"OpenFrameworks x kinect x Android" 's source codes
sample program Eclipse's workspace



OpenFrameworks + kinect + Android项目源码下载
原文链接:http://www.cnkinect.com/thread-2953-1-1.html  

分享到:
评论

相关推荐

    3DCloth:3D布料openframeworks + glm

    3D 布料物理粒子弹簧。 不完整!!! 依赖glm 库

    kinect V2 c++

    基于openFrameworks的kinect V2开发

    Game-of-life:简单生活游戏,使用OpenFrameworks C ++编写

    简单生活游戏,使用OpenFrameworks C ++编写 建议在阅读和/或修改openFrameworks和/或C ++中的初学者代码之前阅读以下内容: : 。 目前该项目尚未获得许可,您可以根据需要进行该项目的操作,如果您共享此仓库,请...

    [openFrameworks] 精通 openFrameworks (英文版)

    Make use of the next generation technologies and techniques in your projects involving OpenCV, Microsoft Kinect, and so on ☆ 出版信息:☆ [作者信息] Denis Perevalov [出版机构] Packt Publishing ...

    openFrameworks.Essentials.

    Create stunning, interactive openFrameworks-based applications with this fast-paced guide About This Book Generate 2D and 3D graphics with openFrameworks Create a video synthesizer project and run it...

    Android-openFrameworks.zip

    Android-openFrameworks.zip,OpenFrasWorkS是一个社区开发的跨平台工具包,用于C 中的创造性编码。,安卓系统是谷歌在2008年设计和制造的。操作系统主要写在爪哇,C和C 的核心组件。它是在linux内核之上构建的,具有...

    Kinect-v2-for-openFrameworks

    使用 openFrameworks 运行的 Kinect v2 ## 如何使用 每个文件夹都是一个应用单元。 of_v0.8.4_vs_release \ apps \ myApps请复制到。 ##环境视窗 8.1 专业版Visual Studio 2013 Ultimate(编译器为 Visual Studio ...

    openFrameworks book

    学习openFrameworks的稀有经典数据。 学习openFrameworks必备。

    ofxCocoa:[已弃用]已为openFrameworks 0072+修复了Memo Atken的ofxCocoa库

    Memo Atken的ofxCocoa库已针对openFrameworks 0072+进行了修复。 这与Memo在其令人惊叹的存储库中的ofxCocoa插件几乎100%相同,只是对OF的最新版本进行了一些较小的修复。 我会尝试在它们出现时添加更多示例,但是...

    KinectV2Sample:在 Windows 上的 openFrameworks 中使用 Kinect for Windows SDK 2.0 的示例

    这是 在 Windows 8.1 上的 openFrameworks v0.8.4 中使用 Kinect for Windows SDK 2.0 基于sdk的官方样本 ColorSample-D2d

    ofruby-ios:openFrameworks 遇到 mruby

    ofruby = openFrameworks + mruby。 openFrameworks 是一个用于创造性编码的开源 C++ 工具包。 mruby 是轻量级的 Ruby。 要开始,请查看 。截屏建造环境我的构建环境。 OSX 10.9.4(小牛队) Xcode 5.1.1 3.06 GHz ...

    openframeworks书籍

    openframeworks书籍

    openframeworks codeblocks_additions

    openframeworks的CB附加包 添加后CB才能编译openframeworks

    openFrameworks源码

    openFrameworks源码,是一个很不错的Android代码,有兴趣的伙伴们抽时间可以看一下把。

    stardust:带来openFrameworks http

    *灰尘= openFrameworks +均衡器 Stardust尝试通过使用将的优点和功能带入群集环境和分布式图形中。 从本质上讲,这意味着只要有足够的资源(感谢Equalizer并由其提供支持),就可以在任何规模的可视化集群中运行由...

    Kinect与OpenCV实现简单的三维重建

    Kinect和OpenCV实现简单的点云三角化,用最小二乘法计算法线,并实时显示获得的模型。建立在OpenFrameworks框架上,编译需要安装OpenFrameworks并放到myApps目录里,还需要Kinect SDK 1.7和OpenCV 2.4.3。

    ofxLaser, 用于控制多个激光投影仪的openFrameworks插件.zip

    ofxLaser, 用于控制多个激光投影仪的openFrameworks插件 ofxLaser用于控制一个或者多个iLDA激光投影仪的openFrameworks插件,它在渲染图形方面特别出色。 目前,它使用Etherdream控制器,但将来增加更多的dac 。安全...

    openFrameworks Essentials 无水印pdf

    openFrameworks Essentials 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或...

    openFrameworks入门书籍Beyond Interaction

    田所淳 所著的openframeworks入门书籍Beyond Interaction,已经开放PDF下载,日文的,不过代码很有参考价值,下载下来跟大家分享。代码对应下载地址:https://github.com/tado/BeyondInteraction。

    Openframeworks显示中文的字体文件

    openframeworks用来显示中文的字体文件-可以用该文件定义中文字体,并在界面上显示!-详情见说明!

Global site tag (gtag.js) - Google Analytics