StereoComponent

StereoComponent abstracts StereoDepth node, its configuration, filtering (eg. WLS filter), and disparity/depth viewing.

Usage

from depthai_sdk import OakCamera

with OakCamera() as oak:
    # Create stereo component, initialize left/right MonoCamera nodes for 800P and 60FPS
    stereo = oak.create_stereo('800p', fps=60)

    # Visualize normalized and colorized disparity stream
    oak.visualize(stereo.out.depth)
    # Start the pipeline, continuously poll
    oak.start(blocking=True)

Component outputs

  • main - Default output. Uses depth.

  • disparity - Streams StereoDepth’s disparity frames to the host. When visualized, these get normalized and colorized. Produces DepthPacket.

  • depth - Streams StereoDepth’s depth frames to the host. When visualized, depth gets converted to disparity (for nicer visualization), normalized and colorized. Produces DepthPacket.

  • rectified_left - Streams StereoDepth’s rectified left frames to the host.

  • rectified_right - Streams StereoDepth’s rectified right frames to the host.

  • encoded - Provides an encoded version of disparity stream.

Reference

class depthai_sdk.components.StereoComponent(device, pipeline, left, right, replay=None, args=None, encode=None)
property depth
property disparity
on_pipeline_started(device)

This function gets called after the pipeline has been started. It is called from the main thread. It can be used to eg. initialize XlinkIn queues.

Parameters

device (depthai.Device) –

config_undistortion(M2_offset=0)
Parameters

M2_offset (int) –

config_stereo(confidence=None, align=None, median=None, extended=None, subpixel=None, lr_check=None, sigma=None, lr_check_threshold=None, subpixel_bits=None)

Configures StereoDepth modes and options.

Parameters
  • confidence (Optional[int]) –

  • align (Optional[depthai_sdk.components.camera_component.CameraComponent]) –

  • median (Union[None, int, depthai.MedianFilter]) –

  • extended (Optional[bool]) –

  • subpixel (Optional[bool]) –

  • lr_check (Optional[bool]) –

  • sigma (Optional[int]) –

  • lr_check_threshold (Optional[int]) –

  • subpixel_bits (Optional[int]) –

Return type

None

config_postprocessing(colorize=None, colormap=None)

Configures postprocessing options.

Parameters
Return type

None

config_wls(wls_level=None, wls_lambda=None, wls_sigma=None)

Configures WLS filter options.

Parameters
  • wls_level (Optional[Union[depthai_sdk.components.stereo_component.WLSLevel, str]]) – WLS filter level. Can be either a WLSLevel enum or string.

  • wls_lambda (Optional[float]) – WLS filter lambda.

  • wls_sigma (Optional[float]) – WLS filter sigma.

Return type

None

set_colormap(colormap)

Sets the colormap to use for colorizing the disparity map. Used for on-device postprocessing. Works only with encoded output. Note: This setting can affect the performance.

Parameters

colormap (depthai.Colormap) – Colormap to use for colorizing the disparity map.

set_auto_ir(auto_mode, continuous_mode=False)

Enables/disables auto IR dot projector and flood brightness. Selects the best IR brightness level automatically. Can be set to continious mode, which will continuously adjust the IR brightness. Otherwise, it will adjust the brightness only once when the device is started.

Parameters
  • auto_mode (bool) – Enable/disable auto IR.

  • continuous_mode (bool) – Enable/disable continious mode.

Return type

None

set_ir(dot_projector_brightness=None, flood_brightness=None)

Sets IR brightness and flood.

Parameters
  • dot_projector_brightness (Optional[int]) –

  • flood_brightness (Optional[int]) –

get_fourcc()
Return type

Optional[str]

class Out(stereo_component)
class DepthOut(component)
class DisparityOut(component)
class RectifiedLeftOut(component)
class RectifiedRightOut(component)
class EncodedOut(component)