Code covered by the BSD License  

Highlights from
Matlab Wrapper for OpenNI 2.2

5.0

5.0 | 3 ratings Rate this file 36 Downloads (last 30 days) File Size: 4.94 KB File ID: #42127

Matlab Wrapper for OpenNI 2.2

by

 

07 Jun 2013 (Updated )

A very simple wrapper that provides an interface to RGBD cameras through OpenNI v2.2

| Watch this File

File Information
Description

This submission was motivated by the Kinect Matlab submission that provided an interface to OpenNI version 1.5. There was a significant reworking of the interface in OpenNI v2.2 that necessitated a bit of a rethink. The current interface is a single mex routine that acts as a 'switchyard'. You indicate which operation you want to perform on the device via the first argument which should be an integer.

Installation:

You need to install OpenNI 2.2 first before you build this mex function.

I have provided short compilation script which shows how to build the mex application. You should edit the filename variables in this script to match your system configuration.

IMPORTANT:
In order to run this mex file you need to copy the contents of the OpenNI/Redist directory to your current working directory. There may be a way to avoid this by messing with your DYLD_LIBRARY_PATH but I haven't tested this.

Usage:

Once you have this built you can type mxNI to see the operations that you can perform.

Known Issues:

This code assumes that you only have one OpenNI device attached

It has only been tested on MacOSX version 10.8.3.

When you run the compilation on this system their is an annoying warning regarding a dangling pragma.

This code is functional but more bells and whistles could be added. Fortunately the structure of the code is quite simple so please feel free to make it better.

Happy Hacking!!

Acknowledgements

Kinect Matlab inspired this file.

MATLAB release MATLAB 8.0 (R2012b)
Other requirements OpenNI Version 2.2
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
25 Aug 2014 Carolyn Parcheta

nevermind, i got it figured out! :)

21 Aug 2014 Carolyn Parcheta

Hi, i am getting an error when mxNI calls openni.h that there is a null character on 1:5 (line 1, column 5?).
The line itself is just "/*******************" and is the first part of the commented header information.

The error also says the word "book" after the location 1:5... but "book" does not appear in the code anywhere, let alone on line 5.

Does anyone know what is going on and how to get past the "warning null character" error that repeats several times before crashing the code?

Many thanks in advance

31 Mar 2014 Rakshit Kothari

Hi, I'll start with a few things to help a user.

1. Add the location of the redist folder in 'C:\Program Files\OpenNI2\Redist' to the path variable & MATlab path via advanced setting-->system variables

2. As Ivan mentioned, change

OPENNI2_INCLUDE = 'C:\Program Files\OpenNI2\Include';

OPENNI2_REDIST = 'C:\Program Files\OpenNI2\Lib';

Congratulatory part:
Code is simple, effective and a great platform for simple hacks!

26 Nov 2013 jetsun

It can works on Windows.

21 Sep 2013 Ivan

Thanks for this. Compiled fine under Windows with Matlab2010a, MSVC 10 Express, OpenNI2.2 and Windows SDK 7.1. Had to rewrite the paths:
OPENNI2_INCLUDE = 'C:\Program Files\OpenNI2\Include';
OPENNI2_REDIST = 'C:\Program Files\OpenNI2\Lib';

Updates
14 Jun 2013

Deleted an extraneous word from the Summary field

Contact us