This blog is intended to help users setup Matlab environment to work with Microsoft Kinect sensor which is has RGB-D Camera, 4 Array Microphone, Tilt motors etc. We have tested the procedure with Kinect for Windows type hardware in our lab and use Matlab 2012a version.
Install Microsoft Visual Studio 2010(Express Edition) on to your computer.from this link by choosing all in one ISO option.
After installing Visual Studio open Matlab. First of all mex compiler should be setup in Matlab using the following command.
After setting the compiler options user may need to restart Matlab environment.
Install OpenNI-NITE ver 0.27 from here. User have to choose between 32 and 64 bit versions depending upon the Operating System used. For example for Windows 64-bit OS select OpenNI_NITE_Installer-win64-0.27.zip.
Install openni-win64-188.8.131.52-dev.msi, nite-win64-184.108.40.206-dev.msi, and finally primesense driver for kinect sensor SensorKinect092-Bin-Win64-v220.127.116.11.msi to the default directory. User may also need C++ distributable sensor-win64-18.104.22.168-redist.msi which located in the same directory to be installed.
Now connect the Kinect Sensor to your USB port. Make sure Kinect’s power adapter is pluged in.
Note : User need to remove Kinect for Windows driver which comes with Kinect-SDK if previously installed.
Device entry should look like this.
Download zip-file containing c++ wrapper functions for the Microsoft Kinect, OpenNI 1.* from Mathworks website. Extract it and open Matlab and choose current directory as <your path to>\Kinect_Matlab_version2\OpenNI1.
Tip: Make sure compile_cpp_files.m is in your current folder in Matlab window along with Mex folder.
Next we need to compile the binaries using Mex compiler and OpenNI Library. For this type the following command in the command window
The Mex compiler will start compiling the binaries for you. After successful compilation open “Example.m”
comment the following lines by adding % before it.
and uncomment the line by removing % before it
The code displays the RGB and Depth map images on the screen.
Run the code and enjoy the brilliance of Kinect Sensor!!!!