docs.unity3d.com
    Show / Hide Table of Contents

    Class ParallelStereo

    The role of this class is to extract a PointCloud data from 2 incoming RenderTexture taken from parallel camera.

    Inheritance
    Object
    NodeRuntime
    Transcoder
    ParallelStereo
    ParallelStereoNode
    Inherited Members
    Transcoder.inTranscode
    Transcoder.outTranscode
    Transcoder._computeShader
    Transcoder._computeKernelIdx
    Transcoder.EnableInterfaceOnChangeEvent()
    Transcoder.DisableInterfaceOnChangeEvent()
    Transcoder.InitializeComputeShader(String, String)
    NodeRuntime._parent
    NodeRuntime._portList
    NodeRuntime._queryPath
    NodeRuntime._tickCPUTimeNs
    NodeRuntime.Initialize(SystemGraphComponent)
    NodeRuntime.InternalInitialize()
    NodeRuntime.Start()
    NodeRuntime.OnTick(Double, Double, Scheduler.ClockState, Scheduler.Signal)
    NodeRuntime.Update()
    NodeRuntime.FixedUpdate()
    NodeRuntime.OnPortAdded(String, Type, String, PortDirection, FieldExtra, IPortType)
    NodeRuntime.OnPortRemoved(String)
    NodeRuntime.InitializeDynamicPorts(SystemGraphComponent)
    NodeRuntime.QueryPath
    NodeRuntime.TickCPUTimeNs
    NodeRuntime.PortDataList
    Namespace: Mechatronics.SensorSDK
    Syntax
    public class ParallelStereo : Transcoder

    Fields

    _baseline

    Distance between the two views in meter. A non-positive baseline is invalid.

    Declaration
    protected float _baseline
    Field Value
    Type Description
    Single

    _computeClearDisparitiesKernelIdx

    Kernel index, in the compute shader, to clear the disparities buffer.

    Declaration
    protected int _computeClearDisparitiesKernelIdx
    Field Value
    Type Description
    Int32

    _computePointCloudKernelIdx

    Kernel index, in the compute shader, to generate the point cloud.

    Declaration
    protected int _computePointCloudKernelIdx
    Field Value
    Type Description
    Int32

    _disparitiesScores

    Internal reference to the disparities buffer.

    Declaration
    protected RenderTexture _disparitiesScores
    Field Value
    Type Description
    RenderTexture

    _pointCloud

    Internal reference to the output point cloud.

    Declaration
    protected PointCloud _pointCloud
    Field Value
    Type Description
    PointCloud

    boundLeftTransform

    Transform of the object used to generate the left samples.

    Declaration
    [Binding("LeftTransform")]
    [SerializeField]
    protected Binding<Transform> boundLeftTransform
    Field Value
    Type Description
    Binding<Transform>

    boundRightTransform

    Transform of the object used to generate the right samples.

    Declaration
    [Binding("RightTransform")]
    [SerializeField]
    protected Binding<Transform> boundRightTransform
    Field Value
    Type Description
    Binding<Transform>

    disparityMax

    Declaration
    [Tooltip("Max pixel distance to look for a similar pattern.")]
    [Field("DisparityMax", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<uint> disparityMax
    Field Value
    Type Description
    PortType<UInt32>

    disparityMin

    Declaration
    [Tooltip("Min pixel distance to look for a similar pattern.")]
    [Field("DisparityMin", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<uint> disparityMin
    Field Value
    Type Description
    PortType<UInt32>

    focalLength

    Declaration
    [Tooltip("Distance between lens and the sensor.")]
    [Field("FocalLength", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> focalLength
    Field Value
    Type Description
    PortType<Single>

    leftViewSamples

    Declaration
    [Tooltip("RenderTexture corresponding to the left view of the camera.")]
    [Field("LeftViewSamples", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<RenderTexture> leftViewSamples
    Field Value
    Type Description
    PortType<RenderTexture>

    patchSize

    Declaration
    [Tooltip("This is the kernel size use to make the pattern matching in pixel.")]
    [Field("PatchSize", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<uint> patchSize
    Field Value
    Type Description
    PortType<UInt32>

    pointCloud

    Declaration
    [Field("PointCloud", PortDirection.Right, FieldExtra.Write)]
    [SerializeField]
    protected PortType<PointCloud> pointCloud
    Field Value
    Type Description
    PortType<PointCloud>

    rightViewSamples

    Declaration
    [Tooltip("RenderTexture corresponding to the right view of the camera.")]
    [Field("RightViewSamples", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<RenderTexture> rightViewSamples
    Field Value
    Type Description
    PortType<RenderTexture>

    sensorHeight

    Declaration
    [Tooltip("Distance between lens and the sensor.")]
    [Field("SensorHeight", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> sensorHeight
    Field Value
    Type Description
    PortType<Single>

    sensorWidth

    Declaration
    [Tooltip("Distance between lens and the sensor.")]
    [Field("SensorWidth", PortDirection.Left, FieldExtra.Read)]
    [SerializeField]
    protected PortType<float> sensorWidth
    Field Value
    Type Description
    PortType<Single>

    Methods

    ComputeBaseline()

    Computes the distance between the two cameras.

    Declaration
    protected void ComputeBaseline()
    Remarks

    Enforces that there is only a translation along the X axis between the cameras.

    Disable()

    Unregister change event on ports and release graphic resources.

    Declaration
    public override void Disable()
    Overrides
    NodeRuntime.Disable()

    Enable(Scheduler.ClockState)

    Setup the change event on ports and call the compute shader initialization.

    Declaration
    public override void Enable(Scheduler.ClockState clockState)
    Parameters
    Type Name Description
    Scheduler.ClockState clockState

    The parameters of the waveform associated to this node

    Overrides
    NodeRuntime.Enable(Scheduler.ClockState)

    InitializeComputeShader()

    Initialize the compute buffer and all kernel used for the parallel stereo camera (ComputeDisparitiesScores, ComputePointCloud, ClearDisparities).

    Declaration
    protected virtual void InitializeComputeShader()

    PrepareDisparityBuffer(Int32, Int32)

    Create or resize the disparities buffer.

    Declaration
    protected virtual void PrepareDisparityBuffer(int frameWidth, int frameHeight)
    Parameters
    Type Name Description
    Int32 frameWidth

    Texture buffer width.

    Int32 frameHeight

    Texture buffer height.

    Release()

    Release graphic resources

    Declaration
    protected override void Release()
    Overrides
    Transcoder.Release()

    Transcode(CustomPassContext)

    Execute the transcoding process.

    Declaration
    protected override void Transcode(CustomPassContext ctx)
    Parameters
    Type Name Description
    CustomPassContext ctx

    A graphic context with a command buffer.

    Overrides
    Transcoder.Transcode(CustomPassContext)
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023