NatML
Search…
MLDepthFeature
abstract class NatSuite.ML.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

1
/// <summary>
2
/// Initialize the depth feature with the depth map dimensions.
3
/// </summary>
4
/// <param name="width">Depth map width.</param>
5
/// <param name="height">Depth map height.</param>
6
protected MLDepthFeature (int width, int height);
Copied!
INCOMPLETE.
1
/// <summary>
2
/// Initialize the depth feature with the depth map feature type.
3
/// </summary>
4
/// <param name="type">Depth map feature type.</param>
5
protected MLDepthFeature (MLImageType type);
Copied!

Inspecting the Feature

The depth feature exposes its underlying type, along with convenience properties for inspecting the aforementioned type.

Feature Type

1
/// <summary>
2
/// Feature type.
3
/// </summary>
4
MLFeatureType type { get; }
Copied!
Refer to the Inspecting the Feature section of the MLFeature class for more information.
The type is always an MLImageType.

Depth Map Width

1
/// <summary>
2
/// Depth map width.
3
/// </summary>
4
int width { get; }
Copied!
The depth feature provides this convenience property for accessing the width of the feature type.

Depth Map Height

1
/// <summary>
2
/// Depth map height.
3
/// </summary>
4
int height { get; }
Copied!
The depth feature provides this convenience property for accessing the height of the feature type.

Sampling Pixel Depth

1
/// <summary>
2
/// Sample the depth value at a normalized pixel location.
3
/// </summary>
4
/// <returns>Depth in meters.</returns>
5
public abstract float Sample (float x, float y);
Copied!
INCOMPLETE.
The coordinates [x, y] are specified in normalized coordinates, and as such must be in range [0.0, 1.0].