Class CameraSensor
Derive this class to define a new sensor that generates RGB data and it's associated channel information (e.g. depth, normals, segmentation, etc.).
Inherited Members
Namespace: UnityEngine.Perception.GroundTruth.Sensors
Assembly: Unity.Perception.Runtime.dll
Syntax
[Serializable]
[MovedFrom("UnityEngine.Perception.GroundTruth")]
public abstract class CameraSensor
Properties
intrinsics
The intrinsic properties of the RGB sensor such as the field of view and projection type.
Declaration
public abstract CameraSensorIntrinsics intrinsics { get; }
Property Value
| Type | Description |
|---|---|
| CameraSensorIntrinsics |
perceptionCamera
The PerceptionCamera component capturing the output of this sensor.
Declaration
protected PerceptionCamera perceptionCamera { get; }
Property Value
| Type | Description |
|---|---|
| PerceptionCamera |
pixelHeight
The pixel height of the sensor output.
Declaration
public abstract int pixelHeight { get; }
Property Value
| Type | Description |
|---|---|
| int |
pixelWidth
The pixel width of the sensor output.
Declaration
public abstract int pixelWidth { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
Cleanup()
Cleanup is called when the PerceptionCamera capturing data from this sensor is destroyed.
Declaration
protected virtual void Cleanup()
OnBeginFrameRendering(ScriptableRenderContext)
OnBeginFrameRendering is called just before rendering has begun for the current frame.
Declaration
protected virtual void OnBeginFrameRendering(ScriptableRenderContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptableRenderContext | ctx | The scriptable render context for the current frame. |
OnDisable()
OnDisable is called when the PerceptionCamera capturing data from this sensor is disabled.
Declaration
protected virtual void OnDisable()
OnEnable()
OnEnable is called when the PerceptionCamera capturing data from this sensor is enabled.
Declaration
protected virtual void OnEnable()
OnEndFrameRendering(ScriptableRenderContext)
OnEndFrameRendering is called just after rendering has ended for the current frame.
Declaration
protected virtual void OnEndFrameRendering(ScriptableRenderContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| ScriptableRenderContext | ctx | The scriptable render context for the current frame. |
Setup()
Setup is called when the PerceptionCamera capturing data from this sensor is initialized (on Awake).
Declaration
protected virtual void Setup()
SetupChannel<T>(T)
Configures newly enabled channels and returns the output texture of the enabled channel.
Declaration
protected abstract RenderTexture SetupChannel<T>(T channel) where T : CameraChannelBase, new()
Parameters
| Type | Name | Description |
|---|---|---|
| T | channel | The channel instance being enabled through this sensor. |
Returns
| Type | Description |
|---|---|
| RenderTexture | The output texture of the enabled channel. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of channel to configure. |