none
MapDepthFrameToColorFrame not in c++ RRS feed

Answers

  • It's there, it's named INuiSensor::NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution.

    Note that pColorCoordinates is an array of alternating x, y coordinate values for each pixel, so cColorCoordinates should always be 2 * cDepthValues.

    John
    K4W Dev

     

    • Marked as answer by marduk2 Wednesday, February 8, 2012 9:37 AM
    Monday, February 6, 2012 7:54 PM
  • We added this API after the cutoff for documentation update, so unfortunately it missed the .chm.  You'll find it on INuiSensor for C++/COM use:
            HRESULT NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution(
                [in] NUI_IMAGE_RESOLUTION eColorResolution,
                [in] NUI_IMAGE_RESOLUTION eDepthResolution,
                [in] DWORD cDepthValues,
                [in, size_is(cDepthValues)] USHORT* pDepthValues,
                [in] DWORD cColorCoordinates,
                [in, out, size_is(cColorCoordinates)] LONG* pColorCoordinates
            );
    
    Does this work for you?

    -Adam Smith [MS]
    • Marked as answer by marduk2 Wednesday, February 8, 2012 9:36 AM
    Monday, February 6, 2012 8:00 PM

All replies

  • It's there, it's named INuiSensor::NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution.

    Note that pColorCoordinates is an array of alternating x, y coordinate values for each pixel, so cColorCoordinates should always be 2 * cDepthValues.

    John
    K4W Dev

     

    • Marked as answer by marduk2 Wednesday, February 8, 2012 9:37 AM
    Monday, February 6, 2012 7:54 PM
  • We added this API after the cutoff for documentation update, so unfortunately it missed the .chm.  You'll find it on INuiSensor for C++/COM use:
            HRESULT NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution(
                [in] NUI_IMAGE_RESOLUTION eColorResolution,
                [in] NUI_IMAGE_RESOLUTION eDepthResolution,
                [in] DWORD cDepthValues,
                [in, size_is(cDepthValues)] USHORT* pDepthValues,
                [in] DWORD cColorCoordinates,
                [in, out, size_is(cColorCoordinates)] LONG* pColorCoordinates
            );
    
    Does this work for you?

    -Adam Smith [MS]
    • Marked as answer by marduk2 Wednesday, February 8, 2012 9:36 AM
    Monday, February 6, 2012 8:00 PM
  • Thanks for the information! I have a few additional questions

    1) Is it enough to do this mapping once (and apply that same map to the following depth and color frames) or does the depth to color pixel mapping change from frame to frame?

    2) Can the values in pDepthValue a packed depth pixel (depth and player index) or does it need to be a pure depth value?

    -Florian

    Tuesday, February 7, 2012 9:26 PM
  • 1) Is it enough to do this mapping once (and apply that same map to the following depth and color frames) or does the depth to color pixel mapping change from frame to frame?

    Per frame, because the depth of each pixel affects the mapping (the divergence is proportional to the distance from the sensor)

    2) Can the values in pDepthValue a packed depth pixel (depth and player index) or does it need to be a pure depth value?

    In fact it must be the packed value.  The intention is to allow you pass the "raw" depth buffer directly.


    -Adam Smith [MS]

    Wednesday, February 8, 2012 5:17 AM
  • hello,could you please give me some simple samples using this function?
    Saturday, August 11, 2012 6:44 AM
  • Yes, NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution is kind of doing the trick, but be aware of this misalignment issue :

    http://social.msdn.microsoft.com/Forums/da/kinectsdknuiapi/thread/cae09150-8f53-4d89-b84c-c21fe408d2ca

    Tell me if you run into a similar problem, maybe it will motivate one of the Microsoft guys (hello!) to give us more detail about this.

    Frank

    Wednesday, August 15, 2012 1:02 PM
  • I have aligned the depth image to RGB image now using NuiImageGetColorPixelCoordinateFrameFromDepthPixelFrameAtResolution, but I can not align skeleton joints to the image.

    Before I use this method to align the depth image and RGB image,the skeleton joints are aligned to the depth image,but after using the method,the joints are not yet aligned to the depth image.

    So how should I do to solve this problem
    • Edited by yaoshunyu Thursday, August 16, 2012 3:08 AM
    Thursday, August 16, 2012 1:49 AM