Share via


CoordinateMapper.MapColorFrameToSkeletonFrame Method

Kinect for Windows 1.6, 1.7, 1.8

Maps a frame from color space to skeleton space.

Syntax

public void MapColorFrameToSkeletonFrame (
         ColorImageFormat colorImageFormat,
         DepthImageFormat depthImageFormat,
         DepthImagePixel[] depthPixels,
         SkeletonPoint[] skeletonPoints
)

Parameters

  • colorImageFormat
    Type: ColorImageFormat
    The color space format.
  • depthImageFormat
    Type: DepthImageFormat
    The depth space format.
  • depthPixels
    Type: DepthImagePixel
    The depth frame pixel data, as retrieved from CopyDepthImagePixelDataTo. Must be equal in length to Width*Height of the depth format specified by depthImageFormat.
  • skeletonPoints
    Type: SkeletonPoint
    The SkeletonPoint array to receive the data. Must be equal in length to Width*Height of the color format specified by colorImageFormat.

Remarks

Each element will be the result of mapping the corresponding color pixel into the specified depth frame and then into skeleton space. Will be equal in length to the number of color pixels. Any color pixel without a corresponding depth pixel will result in a sentinel value. The resulting skeleton points can be tested by calling IsKnownPoint.

Because depth image data and color image data come from separate sensors, pixels in the two images may not always line up exactly. The two sensors may have different fields of view, or may not be aimed precisely in the same direction. This means that a point near the edge of the depth image may correspond to a pixel just beyond the edge of the color image, or vice versa.

This function accepts coordinates outside the bounds of the depth image. It may return pixels outside the color image. This means that you can use data from the two images in combination, even when the two images do not line up completely. You must verify that the coordinates that are returned lie within the color image before using the coordinates to reference pixels in that color image.

The depth image coordinates you specify are not required to be within the bounds of the depth frame image, but they should not be too far outside the depth frame image bounds. If the coordinates are far outside the depth frame image, they are unlikely to map to coordinates inside the bounds of the color image. This function will then return color image coordinates that are unlikely to be useful.

Requirements

Namespace: Microsoft.Kinect

Assembly: Microsoft.Kinect (in microsoft.kinect.dll)

See Also

Reference

CoordinateMapper Class
CoordinateMapper Members
Microsoft.Kinect Namespace