CoordinateMapper.MapDepthFrameToColorFrame Method
Kinect for Windows 1.6, 1.7, 1.8
Maps a frame from depth space to color space.
Syntax
public void MapDepthFrameToColorFrame (
DepthImageFormat depthImageFormat,
DepthImagePixel[] depthPixels,
ColorImageFormat colorImageFormat,
ColorImagePoint[] colorPoints
)
Parameters
- depthImageFormat
Type: DepthImageFormat
The depth space format. - depthPixels
Type: DepthImagePixel
The depth frame pixel data from CopyDepthImagePixelDataTo. Must be equal in length to Width*Height of the depth format specified by depthImageFormat. - colorImageFormat
Type: ColorImageFormat
The color space format. - colorPoints
Type: ColorImagePoint
The ColorImagePoint array to receive the data. Must be equal in length to Width*Height of the depth format specified by depthImageFormat.
Remarks
Maps the entire depth frame to color space. Each element will be the result of mapping the corresponding DepthImagePixel into color space. Will be equal in length to the number of DepthImagePixels. Any DepthImagePixel without a corresponding color pixel will result in a sentinel value. The resulting ColorImagePoints 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