Skip to main content
API Reference NianticSpatial.NSDK.AR.SceneSegmentation

ARSceneSegmentationManager

↳ extends UnityEngine.XR.ARFoundation.SubsystemLifecycleManager

Declaration

public class ARSceneSegmentationManager : SubsystemLifecycleManager<XRSceneSegmentationSubsystem, XRSceneSegmentationSubsystemDescriptor, Provider>

Summary

The ARSceneSegmentationManager controls the XRSceneSegmentationSubsystem and updates the scene segmentation textures on each Update loop. Textures and XRCpuImages are available for confidence maps of individual semantic segmentation channels and a bit array indicating which semantic channels have surpassed the chosen confidence threshold per pixel. For cases where a semantic segmentation texture is overlaid on the screen, utilities are provided to read semantic properties at a given point on the screen.


Properties

NameTypeSummary
readonly ChannelIndicesIReadOnlyDictionary<SceneSegmentationChannel, int>
The indices of the semantic channels that the current model is able to detect.
readonly ChannelsIReadOnlyList<SceneSegmentationChannel>
The semantic channels that the current model is able to detect.
IsMetadataAvailablebool
True if the underlying subsystem has finished initialization.
TargetFrameRateuint
Frame rate that semantic segmentation inference will aim to run at.

Methods

NameTypeSummary
DoesChannelExistAtbool
Check if a semantic class is detected at the specified location in screen space, based on the confidence
threshold set for this channel. (See TrySetChannelConfidenceThresholds)
GetChannelFromNameNullable<SceneSegmentationChannel>
Converts a channel name string to its corresponding SceneSegmentationChannel enum value.
GetChannelIndexint
Get the channel index of a specified semantic class. This corresponds to a bit position in the packed
scene segmentation buffer, with index 0 being the most-significant bit.
GetChannelIndicesAtList<int>
Returns an array of channel indices that are present at the specified pixel onscreen.
static GetChannelNameFromEnumstring
Converts a SceneSegmentationChannel enum value to its string representation for display purposes.
GetChannelNamesAtList<string>
Returns an array of channel names that are present for the specified pixel onscreen (for display purposes).
GetChannelsAtList<SceneSegmentationChannel>
Returns an array of channels that are present for the specified pixel onscreen.
GetPackedSceneSegmentationChannelsTextureTexture2D
Retrieves the texture of semantic data where each pixel can be interpreted as a uint with bits
corresponding to different classifications.
GetSceneSegmentationuint
Returns the scene segmentation at the specified pixel on screen.
GetSceneSegmentationChannelTextureTexture2D
Returns semantic segmentation texture for the specified semantic channel.
GetSuppressionMaskTextureTexture2D
Retrieves the suppression mask texture, where each pixel contains a uint which can be used to interpolate
between the predicted depth and the far field depth of the scene. This is useful for enabling smooth occlusion suppression.
TryAcquirePackedSceneSegmentationChannelsCpuImagebool
Tries to acquire the latest packed semantic channels XRCpuImage. Each element of the XRCpuImage is a bit field
indicating which semantic channels have surpassed their respective detection confidence thresholds for that
pixel. (See GetChannelIndex)
TryAcquireSceneSegmentationChannelCpuImagebool
Attempt to acquire the latest semantic segmentation XRCpuImage for the specified semantic class. This
provides direct access to the raw pixel data.
TryAcquireSuppressionMaskCpuImagebool
Tries to acquire the latest suppression mask XRCpuImage. Each element of the XRCpuImage is a uint32 value
which can be used to interpolate between instantaneous depth and far field depth.
TryResetChannelConfidenceThresholdsbool
Resets the confidence thresholds for all semantic channels to the default values from the current model.
TrySetChannelConfidenceThresholdsbool
Sets the confidence threshold for including the specified semantic channel in the packed semantic
channel buffer.
Updatevoid
Callback as the manager is being updated.

Events

NameTypeSummary
FrameReceivedAction<ARSceneSegmentationFrameEventArgs>
-
MetadataInitializedAction<ARSceneSegmentationModelEventArgs>
An event which fires when the underlying subsystem has finished initializing.