Fail to map depth space point to color space RRS feed

  • Question

  • I want to map a depth space point to color space. For initial testing, I first captured a depth frame and saved it as a png image. Then I loaded the image in Matlab, picked a pixel (column=100, row=200) and obtained its depth value which is 973. Next, I used following code to map the point to color space.

    DepthSpacePoint dp;
    dp.X = 100;
    dp.Y = 200;
    UINT16 depth = 973;
    ColorSpacePoint cp;

    The function"MapDepthPointToColorSpace" cannot run successfully. An "Access violation" error happened when call the function.  Does anyone can tell me how to use the function correctly ? Thanks a lot !



    Friday, April 10, 2015 1:16 PM

All replies

  • first, depth is not a color image so you cannot save it as a PNG since that will add some level of compression to the data and therefore corrupt it.

    second, how are you integrating Matlab to use the Kinect SDK? Kinect natively does not support Matlab so you will have to create a wrapper or provide some intro with the library. 

    If you are using a regular .Net based application C#/WPF you can have a look at the Coordinate Mapping basics sample as an example of how to call the api's. Aside from an Access Violation error, you must not assume that every point in the depth frame will map to a color pixel. 

    Carmine Sirignano - MSFT

    Wednesday, April 15, 2015 5:58 PM