NatML
Search…
MLARDepthFeature
class NatSuite.MLX.Features.MLARDepthFeature : MLFeature
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.

Reading Depth Values

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!
The depth image can be sampled for depth values at given pixel coordinates.
The coordinates [x, y] are specified in normalized coordinates, and as such must be in range [0.0, 1.0].
Last modified 2mo ago