openni2+mac

Using OpenNI 2.2 Beta on OS X

Posted on 10 August 2013

Here’s how I go the samples working. First install OpenNI itself:

  1. Download OpenNI 2.2 Beta for OS X.

  2. Run sudo ./install.sh. You will not see any output. This is normal.

Next you’ll need a driver for the Kinect:

  1. Clone the OpenNI2-FreenectDriver repo.

  2. Run ./waf configure build. You should now have a build directory withlibFreenectDriver.dylib in it.

  3. Copy that file into Redist/OpenNI2/Drivers/. If you want to try the samples then also copy the file into Samples/Bin/OpenNI2/Drivers.

To run an example:

  1. cd Samples/Bin

  2. ./ClosestPointViewer

To use the OpenNI in an XCode project, for example in combination with openFrameworks:

  1. Create a new project. (Use the project generator if you are working with oF.)

  2. Click the name of the project in the left sidebar and make sure ‘Project’ is selected in the main panel.

  3. Look for the setting ‘Header Search Paths’ and click to edit. Click the plus sign and add the path to ‘Include’ directory from OpenNI. For example, I installed OpenNI in/Applications/OpenNI-MacOSX-x64-2.2, so my path is /Applications/OpenNI-MacOSX-x64-2.2/Include.

  4. Next, copy libOpenNI2.dylib from the OpenNI Redist folder to the folder that will contain your binary (the compiled version of your project). If you are working with oF then this is the bin folder inside your project.

  5. Finally, add #include "OpenNI.h" add the start of your code. (In oF: this would be in testApp.h.


转载于:https://my.oschina.net/gujianhan/blog/204325

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值