docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class OcclusionLabeler

    This labeler reports a set of visibility metrics for each object that is visible within the frame. Each set contains 3 metrics:

    1. Percent Visible: The portion of an object that visible
    2. Percent In Frame: The portion of an object that is not occluded by the camera frame
    3. Visibility In Frame: The unoccluded portion of the part of an object that is in frame
    Inheritance
    object
    CameraLabeler
    OcclusionLabeler
    Inherited Members
    CameraLabeler.enabled
    CameraLabeler.hudPanel
    CameraLabeler.overlayPanel
    CameraLabeler.visualizationEnabled
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Perception.GroundTruth.Labelers
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [Serializable]
    [MovedFrom("UnityEngine.Perception.GroundTruth")]
    public sealed class OcclusionLabeler : CameraLabeler
    Remarks

    The occlusion labeler operates in the following stages to generate a set of occlusion metrics for each visible object in the scene:

    1. Render each object one at a time to capture their in-frame unoccluded pixel count
    2. Render each object one at a time in a cube map while masking out the camera's field-of-view to obtain each object's out-of-frame pixel count
    3. Compare these two pixel count values against each object's instance segmentation pixel count to obtain the 3 occlusion metrics

    Constructors

    OcclusionLabeler()

    Creates a new OcclusionLabeler. Be sure to assign idLabelConfig before adding to a PerceptionCamera.

    Declaration
    public OcclusionLabeler()

    OcclusionLabeler(IdLabelConfig)

    Creates a new OcclusionLabeler with an IdLabelConfig.

    Declaration
    public OcclusionLabeler(IdLabelConfig idLabelConfig)
    Parameters
    Type Name Description
    IdLabelConfig idLabelConfig

    The IdLabelConfig which associates objects with labels.

    Fields

    idLabelConfig

    The IdLabelConfig which associates objects with labels.

    Declaration
    public IdLabelConfig idLabelConfig
    Field Value
    Type Description
    IdLabelConfig

    metricId

    The string ID associated with this labeler.

    Declaration
    public string metricId
    Field Value
    Type Description
    string

    outOfFrameResolution

    The OcclusionLabeler's cubemap capture resolution. Higher resolutions are more expensive to capture and increase the accuracy of calculated visibility metrics.

    Declaration
    [Tooltip("Adjust this parameter to control the cubemap resolution this labeler will use when rendering objects outside of the camera's field of view. Higher resolutions will increase accuracy at the expense of increased computational costs and slower capture frame rates.")]
    [Range(32, 4096)]
    public int outOfFrameResolution
    Field Value
    Type Description
    int

    Properties

    description

    A human-readable description of the labeler

    Declaration
    public override string description { get; }
    Property Value
    Type Description
    string
    Overrides
    CameraLabeler.description

    labelerId

    The GUID id to associate with the data produced by this labeler.

    Declaration
    public override string labelerId { get; }
    Property Value
    Type Description
    string
    Overrides
    CameraLabeler.labelerId

    supportsVisualization

    Labelers should set this in their setup to define if they support realtime visualization of their data.

    Declaration
    protected override bool supportsVisualization { get; }
    Property Value
    Type Description
    bool
    Overrides
    CameraLabeler.supportsVisualization

    Methods

    Cleanup()

    Called when the Labeler is about to be destroyed or removed from the PerceptionCamera. Use this to clean up to state.

    Declaration
    protected override void Cleanup()
    Overrides
    CameraLabeler.Cleanup()

    OnBeginRendering(ScriptableRenderContext)

    Called just before the camera renders each frame the the labeler is enabled and ShouldCaptureThisFrame is true.

    Declaration
    protected override void OnBeginRendering(ScriptableRenderContext scriptableRenderContext)
    Parameters
    Type Name Description
    ScriptableRenderContext scriptableRenderContext

    The current context from the Scriptable Render Pipeline.

    Overrides
    CameraLabeler.OnBeginRendering(ScriptableRenderContext)

    OnEndRendering(ScriptableRenderContext)

    Called just after the camera renders each frame the the labeler is enabled and ShouldCaptureThisFrame is true.

    Declaration
    protected override void OnEndRendering(ScriptableRenderContext ctx)
    Parameters
    Type Name Description
    ScriptableRenderContext ctx

    The current context from the Scriptable Render Pipeline.

    Overrides
    CameraLabeler.OnEndRendering(ScriptableRenderContext)

    Setup()

    Called just before the first call to OnUpdate() or OnBeginRendering(ScriptableRenderContext). Implement this to initialize state.

    Declaration
    protected override void Setup()
    Overrides
    CameraLabeler.Setup()

    Events

    occlusionMetricsComputed

    An event that is called each frame for which occlusion metrics are calculated.

    Declaration
    public event Action<int, NativeArray<OcclusionMetricEntry>> occlusionMetricsComputed
    Event Type
    Type Description
    Action<int, NativeArray<OcclusionMetricEntry>>
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)