I have kinect for PC and the new microsoft kinect SDK (not the beta). I was able to connect to the kinect from Matlab (using net.addassembly(<microsoft.kinect.dll>), and register an event listener (e.g., to DepthFrameReady event using addlistener). My event handler get called indeed (30 times a sec), but, when I copy the image data in the event handler to a matlab int8 array (using, DepthFrame.CopyPixelDataTo(frameBits)), the resulting matlab array, frameBits, is all zeros.
Any help on how to get the data from kinect sensor using microsft sdk would be highly appriciated.
OK, found the solution to my problem.I guess there aren't many poeple out there working with the kinect through Matlab...
Probably this:
since all the TMW pages supporting Kinect seem to no longer exist, even though they're still indexed and appear on the TMW search results.
This is where I went first:
http://www.mathworks.com/academia/hardware-resources/
since it looks like fun when time eventually permits.
Actually I don't have Simulink, so I'm using the Kinect from a "barebone" Matlab.
The solution to my original questions (getting the data from the depthImageFrame object to matlab is the following:
netArray=NET.createArray('System.Int16',frame.PixelDataLength);
frame.CopyPixelDataTo(netArray);
frameBits=int16(netArray);
depthBits=int16(ceil(frameBits/8));%first 3 bits are the skelton index
depthFrame=reshape(depthBits,frame.Width,frame.Height)';
Amir
1 Comment
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/38256#comment_154772
hello , im trying to get data from kinect into matlab, i had no luck yet, could you pls post ur code?