none
How to save matlab matrix in Kinect Bridge with Matlab Basics D2D RRS feed

  • Question

  • Hi,

    I'm trying to save the matlab color and depth matrix created in Kinect Bridge for Matlab. 

    This code doesn't work:

    hr = m_matlabHelper.MatlabPutVariable("rgbIm", m_pColorMat);
    if (FAILED(hr))
    {
    return hr;
    }
    const char* imwriteExpr = "imwrite(rgbIm, 'C:\KinectBridgeWithMATLABBasics-D2D\data\colorIm.png', 'png');";
    hr = m_matlabHelper.MatlabEvalExpr(imwriteExpr);
    if (FAILED(hr))
    {
    return hr;
    }

    Any ideas? 

    Thanks in advance!

    Thursday, February 20, 2014 6:37 PM

All replies

  • For assistance with Matlab api's, you need to engage the support team from MathWorks. The bridge just provides a way of exposing the Kinect data, how you interact with the Matlab api's would be something to discuss with their team for assistance.

    Were you able to get the sample to run without any modifications?


    Carmine Sirignano - MSFT

    Friday, February 21, 2014 8:30 PM
  • Yes, the sample did run without modifications. For some reason its not saving the matrix. Should I lock the color and depth stream of data when I save the matrix? 
    Saturday, February 22, 2014 6:59 AM
  • Depends on the time it takes to process the data. If you are taking longer than ~30ms to process the frame, you are going to get undefined results. The runtime expects the frame to be released with the length of time for one frame. If you need the data longer, you need to copy it and use the copy in your processing.

    Carmine Sirignano - MSFT

    Monday, February 24, 2014 8:32 PM