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. Usesdepth
.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 ofdisparity
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_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
-
config_postprocessing
(colorize=None, colormap=None)¶ Configures postprocessing options.
- Parameters
colorize (Optional[Union[depthai_sdk.visualize.configs.StereoColor, bool]]) – Colorize the disparity map. Can be either a StereoColor enum, string or bool.
colormap (Optional[int]) – Colormap to use for colorizing the disparity map.
- Return type
-
config_wls
(wls_level=None, wls_lambda=None, wls_sigma=None)¶ Configures WLS filter options.
-
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.
-
set_ir
(dot_projector_brightness=None, flood_brightness=None)¶ Sets IR brightness and flood.
-
property