Class ParallelStereo
The role of this class is to extract a PointCloud data from 2 incoming RenderTexture taken from parallel camera.
Inherited Members
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
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
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
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. |