 <p>I have done the same for my application. So here a brief overview what i have done:</p> <p><strong>Save the data (C#/Kinect SDK):</strong></p> <p>How to save a depth Image:</p> <pre><code> MultiSourceFrame mSF = (MultiSourceFrame)reference; var frame = mSF.DepthFrameReference.AcquireFrame(); if (frame != null ) { using (KinectBuffer depthBuffer = frame.LockImageBuffer()) { Marshal.Copy(depthBuffer.UnderlyingBuffer, targetBuffer,0, DEPTH_IMAGESIZE); } frame.Dispose(); } </code></pre> <p>write buffer to file:</p> <pre><code>File.WriteAllBytes(filePath + fileName, targetBuffer.Buffer); </code></pre> <p>For fast saving think about a ringbuffer.</p> <p><strong>ReadIn the data (Matlab)</strong></p> <p>how to get z_data:</p> <pre><code>fid = fopen(fileNameImage,'r'); img= fread(fid[IMAGE_WIDTH*IMAGE_HEIGHT,1],'uint16'); fclose(fid); img= reshape(img,IMAGE_WIDTH,MAGE_HEIGHT); </code></pre> <p>how to get XYZ-Data:</p> <p>For that think about the pinhole-model-formula to convert uv-coordinates to xyz (<a href="https://visualservoing.files.wordpress.com/2012/04/pinhole-model-formula.jpg" rel="nofollow">formula</a>).</p> <p>To get the cameramatrix K you need to calibrate your camera (<a href="http://de.mathworks.com/help/vision/ug/single-camera-calibrator-app.html" rel="nofollow">matlab calibration app</a>) or get the cameraparameters from Kinect-SDK (<code>var cI= kinectSensor.CoordinateMapper.GetDepthCameraIntrinsics();</code>).</p> <p><strong><code>coordinateMapper</code> with the SDK</strong>:</p> <p>The way to get XYZ from Kinect SDK directly is quite easier. For that this <a href="https://msdn.microsoft.com/de-de/library/dn785530.aspx" rel="nofollow">link</a> could help you. Just get the buffer by kinect sdk and convert the rawData with the <code>coordinateMapper</code> to xyz. Afterwards save it to csv or txt, so it is easy for reading in matlab.</p>