docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PerceptionCamera

    Captures ground truth from the associated Camera.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    PerceptionCamera
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Perception.GroundTruth
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [RequireComponent(typeof(Camera))]
    public class PerceptionCamera : MonoBehaviour

    Fields

    alphaThreshold

    The minimum level of transparency that will be rendered per pixel in the segmentation image.

    Declaration
    [Tooltip("The minimum level of transparency that will be rendered per pixel in segmentation images.")]
    [Range(0, 1)]
    public float alphaThreshold
    Field Value
    Type Description
    float

    captureRgbImages

    Whether camera output should be captured to disk.

    Declaration
    public bool captureRgbImages
    Field Value
    Type Description
    bool

    captureTriggerMode

    The method of triggering captures for this camera.

    Declaration
    public CaptureTriggerMode captureTriggerMode
    Field Value
    Type Description
    CaptureTriggerMode

    description

    A human-readable description of the camera.

    Declaration
    public string description
    Field Value
    Type Description
    string

    firstCaptureFrame

    Frame number at which this camera starts capturing.

    Declaration
    public int firstCaptureFrame
    Field Value
    Type Description
    int

    framesBetweenCaptures

    The number of frames to simulate and render between the camera's scheduled captures. Setting this to 0 makes the camera capture every frame.

    Declaration
    public int framesBetweenCaptures
    Field Value
    Type Description
    int

    id

    The string ID of this camera sensor

    Declaration
    public string id
    Field Value
    Type Description
    string

    manualSensorAffectSimulationTiming

    Have this unscheduled (manual capture) camera affect simulation timings (similar to a scheduled camera) by requesting a specific frame delta time.

    Declaration
    public bool manualSensorAffectSimulationTiming
    Field Value
    Type Description
    bool

    overrideLayerMask

    Whether to override the camera's LayerMask on its labelers.

    Declaration
    public bool overrideLayerMask
    Field Value
    Type Description
    bool

    showVisualizations

    Turns on/off the realtime visualization capability.

    Declaration
    public bool showVisualizations
    Field Value
    Type Description
    bool

    simulationDeltaTime

    The simulation frame time (seconds) for this camera. E.g. 0.0166 translates to 60 frames per second. This will be used as Unity's captureDeltaTime, causing a fixed number of frames to be generated for each second of elapsed simulation time regardless of the capabilities of the underlying hardware.

    Declaration
    public float simulationDeltaTime
    Field Value
    Type Description
    float

    useAccumulation

    Whether to use accumulation before capture (e.g. Path Tracing)

    Declaration
    public bool useAccumulation
    Field Value
    Type Description
    bool

    waitFrames

    Number of frames to wait before starting the scenario

    Declaration
    public static int waitFrames
    Field Value
    Type Description
    int

    Properties

    SensorHandle

    The SensorHandle associated with this camera. Use this to report additional annotations and metrics at runtime.

    Declaration
    public SensorHandle SensorHandle { get; }
    Property Value
    Type Description
    SensorHandle

    attachedCamera

    Caches access to the camera attached to the perception camera.

    Declaration
    public Camera attachedCamera { get; }
    Property Value
    Type Description
    Camera

    cameraSensor

    The CameraSensor used to generate the PerceptionCamera's output.

    Declaration
    public CameraSensor cameraSensor { get; set; }
    Property Value
    Type Description
    CameraSensor

    captureFrameCount

    The number of capture-able frames that have been generated

    Declaration
    public static int captureFrameCount { get; }
    Property Value
    Type Description
    int

    channels

    The currently enabled CameraChannel<T>s for this PerceptionCamera.

    Declaration
    public IReadOnlyList<CameraChannelBase> channels { get; }
    Property Value
    Type Description
    IReadOnlyList<CameraChannelBase>

    labelers

    The CameraLabeler instances which will be run for this PerceptionCamera.

    Declaration
    public IReadOnlyList<CameraLabeler> labelers { get; }
    Property Value
    Type Description
    IReadOnlyList<CameraLabeler>

    layerMask

    The LayerMask used for filtering objects before capturing labeler data. The overrideLayerMask field must be enabled for this LayerMask to be used. The attached Camera's cullingMask is used otherwise.

    Declaration
    public LayerMask layerMask { get; set; }
    Property Value
    Type Description
    LayerMask

    Methods

    AddLabeler(CameraLabeler)

    Add the given CameraLabeler to the PerceptionCamera. It will be set up and executed by this PerceptionCamera each frame it captures data.

    Declaration
    public void AddLabeler(CameraLabeler cameraLabeler)
    Parameters
    Type Name Description
    CameraLabeler cameraLabeler

    The labeler to add to this PerceptionCamera

    EnableChannel<T>()

    Enables a channel of the given type on the sensor.

    Declaration
    public T EnableChannel<T>() where T : CameraChannelBase, new()
    Returns
    Type Description
    T

    Newly created Channel

    Type Parameters
    Name Description
    T

    The type of channel to enable.

    GetChannel<T>()

    Returns the enabled channel of the specified type.

    Declaration
    public T GetChannel<T>() where T : CameraChannelBase
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T

    The type of channel to get.

    Exceptions
    Type Condition
    InvalidOperationException

    Channel's must be enabled before they can be accessed.

    IsChannelEnabled<T>()

    Returns whether a channel of the given type has been enabled on the sensor.

    Declaration
    public bool IsChannelEnabled<T>() where T : CameraChannelBase
    Returns
    Type Description
    bool

    The enabled status of the given channel.

    Type Parameters
    Name Description
    T

    The type of channel to check the enabled status of.

    RemoveLabeler(CameraLabeler)

    Removes the given CameraLabeler from the list of labelers under this PerceptionCamera, if it is in the list. The labeler is cleaned up in the process. Labelers removed from a PerceptionCamera should not be used again.

    Declaration
    public bool RemoveLabeler(CameraLabeler cameraLabeler)
    Parameters
    Type Name Description
    CameraLabeler cameraLabeler
    Returns
    Type Description
    bool

    RemovePersistentSensorData(string)

    Removes a persistent sensor data object.

    Declaration
    public bool RemovePersistentSensorData(string key)
    Parameters
    Type Name Description
    string key

    The key of the object to remove.

    Returns
    Type Description
    bool

    True if a data object was removed. False if it was not set.

    RequestCapture()

    Requests a capture from this PerceptionCamera on the next rendered frame. Can only be used when using Manual capture mode.

    Declaration
    public void RequestCapture()

    SetPersistentSensorData(string, object)

    Add a data object which will be added to the dataset with each capture. Overrides existing sensor data associated with the given key.

    Declaration
    public void SetPersistentSensorData(string key, object data)
    Parameters
    Type Name Description
    string key

    The key to associate with the data.

    object data

    An object containing the data. Will be serialized into json.

    TryGetChannel<T>(out T)

    Returns whether a channel of the given type is enabled, and additionally outputs the found channel.

    Declaration
    public bool TryGetChannel<T>(out T channel) where T : CameraChannelBase
    Parameters
    Type Name Description
    T channel

    The found channel of the given type.

    Returns
    Type Description
    bool

    True if a channel of the given type is enabled, false if otherwise.

    Type Parameters
    Name Description
    T

    The type of channel to get.

    Events

    RenderedObjectInfosCalculated

    Invoked when RenderedObjectInfos are calculated. The first parameter is the Time.frameCount at which the objects were rendered. This may be called many frames after the objects were rendered.

    Declaration
    public event Action<int, NativeArray<RenderedObjectInfo>, SceneHierarchyInformation> RenderedObjectInfosCalculated
    Event Type
    Type Description
    Action<int, NativeArray<RenderedObjectInfo>, SceneHierarchyInformation>
    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)