Homebrew formula for installing OpenNI and NITE and Sensor/SensorKinect.
Ruby Shell
Pull request Compare This branch is 1 commit ahead, 47 commits behind totakke:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



openni-formula is a project for installing OpenNI, NITE, and Sensor module with Homebrew.

You can install these packages in Homebrew installing directory (default: /usr/local) by simple commands. Uninstalling is also easy. This project does not provide only Sensor module (sensor.rb) for Xtion and Xtion PRO LIVE but also SensorKinect module (sensor-kinect.rb) for Microsoft Kinect sensor. You can choose a proper module for your device.


  • OpenNI
    • stable-
    • (--devel) unstable-
  • Sensor
    • stable-
    • (--devel) unstable-
  • SensorKinect
    • stable-
    • (--devel) unstable-
  • NITE
    • stable-
    • (--devel) unstable-



First, download related formulas.

$ cd /usr/local/Library/Formula
$ curl --insecure -O "https://raw.github.com/totakke/openni-formula/master/openni.rb"
$ curl --insecure -O "https://raw.github.com/totakke/openni-formula/master/sensor.rb"
$ curl --insecure -O "https://raw.github.com/totakke/openni-formula/master/nite.rb"

If you want to use Microsoft Kinect sensor (not Xtion), download sensor-kinect.rb instead of sensor.rb.

$ curl --insecure -O "https://raw.github.com/totakke/openni-formula/master/sensor-kinect.rb"


Install OpenNI, Sensor/SensorKinect, and NITE with Homebrew. If you want to install unstable release, add option "--devel". After each Homebrew installations, you have to register modules and license, and create XnSensorServer directory manually.

First of all, install libusb with option "--universal".

$ brew install libusb --universal

Install OpenNI.

$ brew install openni

$ sudo mkdir -p /var/lib/ni
$ sudo niReg /usr/local/lib/libnimMockNodes.dylib
$ sudo niReg /usr/local/lib/libnimCodecs.dylib
$ sudo niReg /usr/local/lib/libnimRecorder.dylib

Install Sensor.

$ brew install sensor

$ sudo niReg /usr/local/lib/libXnDeviceSensorV2.dylib /usr/local/etc/primesense
$ sudo niReg /usr/local/lib/libXnDeviceFile.dylib /usr/local/etc/primesense

$ sudo mkdir -p /var/log/primesense/XnSensorServer
$ sudo chmod a+w /var/log/primesense/XnSensorServer 

(Or install SensorKinect instead if you want to use Microsoft Kinect sensor.)

$ brew install sensor-kinect

$ sudo niReg /usr/local/lib/libXnDeviceSensorV2KM.dylib /usr/local/etc/primesense
$ sudo niReg /usr/local/lib/libXnDeviceFile.dylib /usr/local/etc/primesense

$ sudo mkdir -p /var/log/primesense/XnSensorServer
$ sudo chmod a+w /var/log/primesense/XnSensorServer  

Install NITE.

$ brew install nite

$ sudo niReg /usr/local/lib/libXnVFeatures_1_5_2.dylib /usr/local/etc/primesense/Features_1_5_2
$ sudo niReg /usr/local/lib/libXnVHandGenerator_1_5_2.dylib /usr/local/etc/primesense/Hands_1_5_2

$ sudo niLicense PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=

Run sample for test

Connect a device to the PC and run a sample program.

$ cd /usr/local/Cellar/openni/stable-
$ ./Sample-NiSimpleViewer 


Uninstall OpenNI, Sensor (or SensorKinect), and NITE with Homebrew.

$ brew uninstall nite
$ brew uninstall sensor (or $ brew uninstall sensor-kinect)
$ brew uninstall openni

If you want to clean entirely,

$ sudo rm -rf /var/lib/ni /var/log/primesense/XnSensorServer /usr/local/etc/primesense


Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.