NatML
Search…
MLARImageFeature
class NatSuite.MLX.Features.MLARImageFeature : MLFeature, IMLFeature
This feature contains a pixel buffer from an ARFoundation XRCpuImage. It is specifically optimized for realtime augmented reality applications, and exposes the same properties as the MLImageFeature class.
This class is part of the NatMLX extension library.

Creating the Feature

1
/// <summary>
2
/// Create an augmented reality image feature.
3
/// </summary>
4
/// <param name="image">Augmented reality image.</param>
5
/// <param name="world">Whether AR image is from world-facing camera.</param>
6
MLARImageFeature (XRCpuImage image, bool world = true);
Copied!
The AR image feature is created from an ARFoundation XRCpuImage. The world argument specifies whether the image is from the world camera or the user-facing camera:
1
// Get the ARCameraManager
2
ARCameraManager cameraManager = ...;
3
// Get the latest camera image
4
XRCpuImage image;
5
cameraManager.TryAcquireLatestCpuImage(out image);
6
// Create the image feature
7
var imageFeature = new MLARImageFeature(image);
Copied!

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.

Handling Normalization

1
/// <summary>
2
/// Normalization mean.
3
/// </summary>
4
Vector3 mean { get; set; }
5
6
/// <summary>
7
/// Normalization standard deviation.
8
/// </summary>
9
Vector3 std { get; set; }
Copied!
Refer to the Handling Normalization section of the MLImageFeature class for more information.

Handling Aspect Mode

1
/// <summary>
2
/// Aspect mode.
3
/// </summary>
4
MLImageFeature.AspectMode aspectMode { get; set; }
Copied!
Refer to the Handling Aspect Mode section of the MLImageFeature class for more information.
Last modified 2mo ago