OpenFrameworks + kinect + Android项目源码下载


TheSIProp project's members finised to make "OpenFrameworks xkinectx Android" Development Environment and to run it on Android(armadillo & beagleboard).
Demo video



Special Thanks:
We used those OSSs. Thank you for great works!
OpenFrameworks
ofxKinect(Kinect for OpenFrameworks)
ofxAndroid(Android for OpenFrameworks)


SIProp members:
Hirotaka Niisato
masaxmasa





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

更多相关文章

  1. Android 发布项目到私服Nexus仓库
  2. android studio驾校题库计分项目
  3. android studio使用.gitignore建立项目过滤规则
  4. Android Studio新建项目继承AppcompatActivity报错的解决方案
  5. 优秀的android开源项目
  6. Androidstudio开发button按钮的操作以及项目开发大致过程
  7. Android问题集锦之十:Android导入项目时Android jar包丢失的解决
  8. Android视频播放项目总结之 使用第三方Vitamio库,开发万能播放器(

随机推荐

  1. 利用PHP和百度ai实现文本以及图片的审核
  2. 关于php的打包 解包 Phar
  3. PHP制作的掷色子点数抽奖游戏实例(代码)
  4. php中static关键字的理解
  5. PHP的Phar包原来性能这么强
  6. php利用32进制实现对id加密解密
  7. 详解 PHP 中的三大经典模式
  8. 宿主机nginx与docker的PHP搭配使用
  9. PHP浮点精度问题
  10. PHP变量的初始化以及赋值方式介绍