Share via


DepthMediaFrame.TryCreateCoordinateMapper Method

Definition

Attempts to create a DepthCorrelatedCoordinateMapper for the DepthMediaFrame. This object provides methods for mapping pixel coordinates from a MediaFrameSource camera to the coordinate system of a different MediaFrameSource or to 3D space.

public:
 virtual DepthCorrelatedCoordinateMapper ^ TryCreateCoordinateMapper(CameraIntrinsics ^ cameraIntrinsics, SpatialCoordinateSystem ^ coordinateSystem) = TryCreateCoordinateMapper;
DepthCorrelatedCoordinateMapper TryCreateCoordinateMapper(CameraIntrinsics const& cameraIntrinsics, SpatialCoordinateSystem const& coordinateSystem);
public DepthCorrelatedCoordinateMapper TryCreateCoordinateMapper(CameraIntrinsics cameraIntrinsics, SpatialCoordinateSystem coordinateSystem);
function tryCreateCoordinateMapper(cameraIntrinsics, coordinateSystem)
Public Function TryCreateCoordinateMapper (cameraIntrinsics As CameraIntrinsics, coordinateSystem As SpatialCoordinateSystem) As DepthCorrelatedCoordinateMapper

Parameters

cameraIntrinsics
CameraIntrinsics

An object that describes the distortion model of the MediaFrameSource camera for which coordinates will be mapped using the DepthMediaFrame data.

coordinateSystem
SpatialCoordinateSystem

An object representing the spatial coordinate system of the camera for which coordinates will be mapped using the DepthMediaFrame data.

Returns

A DepthCorrelatedCoordinateMapper if the operation was successful; otherwise, null.

Remarks

The DepthCorrelatedCoordinateMapper returned by this method will use depth data from the DepthMediaFrame to map coordinates from one media frame or MediaFrameSource to the coordinate system of another media frame or MediaFrameSource. The parameters to this method specify the camera intrinsics and coordinate system of the original coordinates to be mapped.

Get static camera intrinsics for a MediaFrameSource by calling TryGetCameraIntrinsics. Get the static coordinate system for a MediaFrameSource by accessing the CoordinateSystem property of the MediaFrameSourceInfo associated with the frame source. Get dynamic camera instrinsics by accessing CameraIntrinsics property of a VideoMediaFrame. Get the dynamic coordinate system from a MediaFrameReference with the CoordinateSystem property.

You specify the camera intrinsics and coordinate system of the target frame or frame source, to which the source points will be mapped, when you call the mapping methods of the DepthCorrelatedCoordinateMapper.

Applies to