How to map the skeleton coordinate to screen coordinates RRS feed

  • Question

  • Hi,

        I need to convert skeleton points to dynamic screen resolution. I had created the depth event with the resolution of 640*480 and the color event with the resolution of 1280*960. 

         I converted the skeleton points to depth image using the API call,

             NuiTransformSkeletonToDepthImage(skeletonPoint, &x, &y);

         Then I converted that into screen cooordinates using following steps:

            GetClientRect( GetDlgItem( m_hWnd,  DLG_5_Kinect_VideoViewer), &rct);
    int width = rct.right;
    int height = rct.bottom;

             float screenPointX = static_cast<float>((x * width)/ 320);
             float screenPointY = static_cast<float>((y * height)/240);

         I need to draw a line between head point and the neck point on the video. When I stand at the axis of the Kinect is all fine for me. But if I moved towards left/right/away from the kinect, the positioning of the line would not be proper.

         How do I map the skeleton points to the screen coordinates exactly???

    Thankx in advance :)

    Monday, July 29, 2013 4:56 AM


All replies