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  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: openFrameworks是一个开源的跨平台C++开发框架,可帮助开发人员轻松创建屏幕实时、交互式的应用程序,具有良好的可扩展性。而openFrameworks的三维重建模块则是可以基于RGBD传感器不断获取深度图像数据,进而实现逐帧三维重建的功能,从而获取更多的场景信息和三维结构。 通过openFrameworks的三维重建模块,我们可以从一系列二维的图像中,通过计算机算法自动构建出三维场景,实现对物体的直观化呈现和深度分析。openFrameworks三维重建模块具备高度自由化和可定制化的特点,可根据需求对其进行二次开发和优化。而其源代码公开,也为开发者们提供了丰富的学习和交流资源。 openFrameworks三维重建模块对行业中多个领域都有着广泛的应用,例如:建筑、艺术、游戏、虚拟现实等。在建筑领域,开发者可以利用其进行场景重建和室内设计;在艺术领域,它可以用于三维雕塑和手势识别等方面,逐渐扩展出更多的应用场景;在游戏和虚拟现实领域中,三维重建模块可以用于改善游戏场景和角色模型的真实性和质感等等。因此,openFrameworks三维重建模块不仅是一种方便快捷的三维建模方式,它也为行业带来了更多的应用和发展。 ### 回答2: OpenFrameworks是一个开源的C++跨平台编程框架,它的应用覆盖了音频、视频、3D图形、物理、计算机视觉等各种领域。在三维重建方面,OpenFrameworks提供了丰富的三维图形绘制与处理的函数库,可以有效地将二维图像转化为三维图像,使得模型更加真实、具有立体感。 在使用OpenFrameworks进行三维重建时,首先需要得到原始图像数据,可以通过摄像机、激光扫描等设备获取。然后,通过OpenFrameworks提供的三维图形绘制函数,将二维图像转化为三维模型,并进行建模和优化。同时,OpenFrameworks还提供了一些三维可视化工具,可以帮助设计师更加直观地观察和修改模型。 OpenFrameworks在三维重建方面有着广泛的应用。例如,在游戏开发中使用OpenFrameworks可以将游戏场景中的二维元素转化为三维模型,更加真实地呈现游戏效果。在建筑设计中,OpenFrameworks可以通过图像建模技术,将建筑图纸转化为立体模型,帮助设计师更好地审阅和修改设计方案。在科学研究中,通过三维重建技术可以将实验数据进行可视化处理,使得研究人员能够更直观地了解实验结果。 总之,OpenFrameworks 作为一款跨平台的开源C++编程框架,在三维重建方面有着广泛的应用和优势。它使得三维重建更加快捷、简单,有助于设计师和科研人员更好地进行创作和研究。 ### 回答3: openFrameworks是一个开源的跨平台艺术创作工具,它支持C++编程语言和OpenGL图形引擎,可以用于创建实时交互式的多媒体艺术作品,也可以用于科学计算和数据可视化领域。openFrameworks内置了许多丰富的功能库和插件,可以用于处理图像、视频、音频、网络、物理模拟、虚拟现实、增强现实等领域。 三维重建是指通过摄像机或激光扫描等方式获取物体的三维坐标信息,再通过计算机算法将其转换成三维模型形态的过程。在openFrameworks中,可以使用多种开源库和插件来实现三维重建,如OpenCV、PCL、ofx3DModelLoader等,同时也可以结合深度学习、机器视觉等技术来提高重建的精度和效率。 其中,ofx3DModelLoader插件是一个专用于加载和显示三维模型的工具,可以支持多种模型格式,包括.obj、.stl、.3ds、.blend等,同时也支持自定义材质、贴图、光照等效果。使用ofx3DModelLoader可以方便地在openFrameworks中创建、编辑和显示三维模型,为创作出高质量的三维作品提供了有力支持。 总之,openFrameworks是一款功能强大、易于使用的艺术创作工具,可以用于实现多样化的项目,其中包括三维重建,通过openFrameworks的丰富功能库和插件,我们可以将创意变为现实。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值