NatML
Search…
MLARDepthFeature
class NatSuite.MLX.Features.MLARDepthFeature : MLDepthFeature
This feature contains a depth buffer from an ARFoundation XRCpuImage. It is useful for predictors that need access to real-world depth data in order to make predictions.
This class is part of the NatMLX extension library.
This feature cannot be used for predictions by itself. It is only used to provide extra information to a predictor.

Creating the Feature

1
/// <summary>
2
/// Create an AR depth image feature.
3
/// </summary>
4
/// <param name="image">Augmented reality depth image.</param>
5
MLARDepthFeature (XRCpuImage image);
Copied!
The AR depth feature is created from an ARFoundation XRCpuImage.

Inspecting the Feature

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.

Sampling Pixel Depth

1
/// <summary>
2
/// Sample the depth value at a normalized pixel location.
3
/// The x-y coordinates are in range [0, 1].
4
/// </summary>
5
/// <returns>Depth in meters.</returns>
6
float Sample (float x, float y);
Copied!
Refer to the Sampling Pixel Depth section of the MLDepthFeature class for more information.