abstract class NatML.Features.MLDepthFeature : MLFeature
This feature is used to provide depth data to predictors that require such data. Implementers can derive from this class and provide custom logic for sampling depth given a pixel location.
Creating the Feature
///<summary>/// Initialize the depth feature with the depth map dimensions.///</summary>///<paramname="width">Depth map width.</param>///<paramname="height">Depth map height.</param>protectedMLDepthFeature(intwidth,intheight);
The depth feature is constructed by specifying the feature size. The data type is assumed to be float32. If the data type is different, the full feature type can be specified instead:
///<summary>/// Initialize the depth feature with the depth map feature type.///</summary>///<paramname="type">Depth map feature type.</param>protectedMLDepthFeature(MLImageTypetype);
Inspecting the Feature
The depth feature exposes its underlying type, along with convenience properties for inspecting the aforementioned type.
/// <summary>
/// Sample the depth feature at a given point.
/// </summary>
/// <param name="point">Point to sample in normalized coordinates.</param>
/// <returns>Depth in meters.</returns>
abstract float Sample (Vector2 point);
/// <summary>
/// Project a 2D point into 3D world space using depth.
/// </summary>
/// <param name="point">Point to transform in normalized camera coordinates.</param>
/// <returns>Projected point in 3D world space.</param>
abstract Vector3 Unproject (Vector2 point);