# Depth Post-Processing

This example shows how you can run depth post-processing filters on the device itself to reduce noise, smooth the depth map and
overall improve the depth map quality. Post-processing can be added to
[StereoDepth](https://docs.luxonis.com/software/depthai-components/nodes/stereo_depth.md) node.

## Demo

## Depth filters

### Median

This is a non-edge preserving [Median filter](https://en.wikipedia.org/wiki/Median_filter), which can be used to reduce noise and
smoothen the depth map. Median filter is implemented in hardware, so it's the fastest filter.

### depthai.StereoDepthConfig.MedianFilter

Kind: Class

Median filter config

Members:

MEDIAN_OFF

KERNEL_3x3

KERNEL_5x5

KERNEL_7x7

#### KERNEL_3x3: typing.ClassVar[MedianFilter]

Kind: Class Variable

#### KERNEL_5x5: typing.ClassVar[MedianFilter]

Kind: Class Variable

#### KERNEL_7x7: typing.ClassVar[MedianFilter]

Kind: Class Variable

#### MEDIAN_OFF: typing.ClassVar[MedianFilter]

Kind: Class Variable

#### __members__: typing.ClassVar[dict[str, MedianFilter]]

Kind: Class Variable

#### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

#### __getstate__(self) -> int: int

Kind: Method

#### __hash__(self) -> int: int

Kind: Method

#### __index__(self) -> int: int

Kind: Method

#### __init__(self, value: typing.SupportsInt)

Kind: Method

#### __int__(self) -> int: int

Kind: Method

#### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

#### __repr__(self) -> str: str

Kind: Method

#### __setstate__(self, state: typing.SupportsInt)

Kind: Method

#### __str__(self) -> str: str

Kind: Method

#### name

Kind: Property

#### value

Kind: Property

### Speckle

Speckle Filter is used to reduce the speckle noise. Speckle noise is a region with huge variance between neighboring
disparity/depth pixels, and speckle filter tries to filter this region.

### depthai.StereoDepthConfig.PostProcessing.SpeckleFilter

Kind: Class

Speckle filtering. Removes speckle noise.

#### __init__(self: RawStereoDepthConfig.PostProcessing.SpeckleFilter)

Kind: Method

#### differenceThreshold

Kind: Property

Maximum difference between neighbor disparity pixels to put them into the same
blob. Units in disparity integer levels.

#### differenceThreshold.setter(self, arg0: typing.SupportsInt)

Kind: Method

#### enable

Kind: Property

Whether to enable or disable the filter.

#### enable.setter(self, arg0: bool)

Kind: Method

#### speckleRange

Kind: Property

Speckle search range.

#### speckleRange.setter(self, arg0: typing.SupportsInt)

Kind: Method

### Temporal

Temporal Filter is intended to improve the depth data persistency by manipulating per-pixel values based on previous frames. The
filter performs a single pass on the data, adjusting the depth values while also updating the tracking history. In cases where the
pixel data is missing or invalid, the filter uses a user-defined persistency mode to decide whether the missing value should be
rectified with stored data. Note that due to its reliance on historic data, the filter may introduce visible blurring/smearing
artifacts, and therefore is best-suited for static scenes.

### depthai.StereoDepthConfig.PostProcessing.TemporalFilter

Kind: Class

Temporal filtering with optional persistence.

#### depthai.StereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode

Kind: Class

Persistency algorithm type.

Members:

PERSISTENCY_OFF :

VALID_8_OUT_OF_8 :

VALID_2_IN_LAST_3 :

VALID_2_IN_LAST_4 :

VALID_2_OUT_OF_8 :

VALID_1_IN_LAST_2 :

VALID_1_IN_LAST_5 :

VALID_1_IN_LAST_8 :

PERSISTENCY_INDEFINITELY :

##### PERSISTENCY_INDEFINITELY: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### PERSISTENCY_OFF: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_1_IN_LAST_2: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_1_IN_LAST_5: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_1_IN_LAST_8: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_2_IN_LAST_3: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_2_IN_LAST_4: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_2_OUT_OF_8: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### VALID_8_OUT_OF_8: typing.ClassVar[RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]

Kind: Class Variable

##### __members__: typing.ClassVar[dict[str, RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode]]

Kind: Class Variable

##### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

##### __getstate__(self) -> int: int

Kind: Method

##### __hash__(self) -> int: int

Kind: Method

##### __index__(self: RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode) -> int: int

Kind: Method

##### __init__(self: RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode, value: typing.SupportsInt)

Kind: Method

##### __int__(self: RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode) -> int: int

Kind: Method

##### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

##### __repr__(self) -> str: str

Kind: Method

##### __setstate__(self: RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode, state: typing.SupportsInt)

Kind: Method

##### __str__(self) -> str: str

Kind: Method

##### name

Kind: Property

##### value

Kind: Property

#### __init__(self: RawStereoDepthConfig.PostProcessing.TemporalFilter)

Kind: Method

#### alpha

Kind: Property

The Alpha factor in an exponential moving average with Alpha=1 - no filter.
Alpha = 0 - infinite filter. Determines the extent of the temporal history that
should be averaged.

#### alpha.setter(self, arg0: typing.SupportsFloat)

Kind: Method

#### delta

Kind: Property

Step-size boundary. Establishes the threshold used to preserve surfaces (edges).
If the disparity value between neighboring pixels exceed the disparity threshold
set by this delta parameter, then filtering will be temporarily disabled.
Default value 0 means auto: 3 disparity integer levels. In case of subpixel mode
it's 3*number of subpixel levels.

#### delta.setter(self, arg0: typing.SupportsInt)

Kind: Method

#### enable

Kind: Property

Whether to enable or disable the filter.

#### enable.setter(self, arg0: bool)

Kind: Method

#### persistencyMode

Kind: Property

Persistency mode. If the current disparity/depth value is invalid, it will be
replaced by an older value, based on persistency mode.

#### persistencyMode.setter(self, arg0: RawStereoDepthConfig.PostProcessing.TemporalFilter.PersistencyMode)

Kind: Method

### Spatial

Spatial Edge-Preserving Filter will fill invalid depth pixels with valid neighboring depth pixels. It performs a series of 1D
horizontal and vertical passes or iterations, to enhance the smoothness of the reconstructed data. It is based on [this research
paper](https://www.inf.ufrgs.br/~eslgastal/DomainTransform/).

### depthai.StereoDepthConfig.PostProcessing.SpatialFilter

Kind: Class

1D edge-preserving spatial filter using high-order domain transform.

#### __init__(self: RawStereoDepthConfig.PostProcessing.SpatialFilter)

Kind: Method

#### alpha

Kind: Property

The Alpha factor in an exponential moving average with Alpha=1 - no filter.
Alpha = 0 - infinite filter. Determines the amount of smoothing.

#### alpha.setter(self, arg0: typing.SupportsFloat)

Kind: Method

#### delta

Kind: Property

Step-size boundary. Establishes the threshold used to preserve "edges". If the
disparity value between neighboring pixels exceed the disparity threshold set by
this delta parameter, then filtering will be temporarily disabled. Default value
0 means auto: 3 disparity integer levels. In case of subpixel mode it's 3*number
of subpixel levels.

#### delta.setter(self, arg0: typing.SupportsInt)

Kind: Method

#### enable

Kind: Property

Whether to enable or disable the filter.

#### enable.setter(self, arg0: bool)

Kind: Method

#### holeFillingRadius

Kind: Property

An in-place heuristic symmetric hole-filling mode applied horizontally during
the filter passes. Intended to rectify minor artefacts with minimal performance
impact. Search radius for hole filling.

#### holeFillingRadius.setter(self, arg0: typing.SupportsInt)

Kind: Method

#### numIterations

Kind: Property

Number of iterations over the image in both horizontal and vertical direction.

#### numIterations.setter(self, arg0: typing.SupportsInt)

Kind: Method

### Threshold

Threshold Filter filters out all disparity/depth pixels outside the configured min/max threshold values.

```python
class ThresholdFilter:
'''
    Spatial Edge-Preserving Filter will fill invalid depth pixels with valid neighboring depth pixels.
    It performs a series of 1D horizontal and vertical passes or iterations, to enhance the smoothness of the reconstructed data. It is based on [this research paper](https://www.inf.ufrgs.br/~eslgastal/DomainTransform/).
'''
```

### Similar samples:

 * [Depth Preview](https://docs.luxonis.com/software/depthai/examples/depth_preview.md)
 * [Stereo Depth from host](https://docs.luxonis.com/software/depthai/examples/stereo_depth_from_host.md)

## Setup

Please run the [install script](https://github.com/luxonis/depthai-python/blob/main/examples/install_requirements.py) to download
all required dependencies. Please note that this script must be ran from git context, so you have to download the
[depthai-python](https://github.com/luxonis/depthai-python) repository first and then run the script

```bash
git clone https://github.com/luxonis/depthai-python.git
cd depthai-python/examples
python3 install_requirements.py
```

For additional information, please follow the [installation guide](https://docs.luxonis.com/software/depthai/manual-install.md).

## Source code

#### Python

```python
#!/usr/bin/env python3

import cv2
import depthai as dai
import numpy as np

# Closer-in minimum depth, disparity range is doubled (from 95 to 190):
extended_disparity = False
# Better accuracy for longer distance, fractional disparity 32-levels:
subpixel = False
# Better handling for occlusions:
lr_check = True

# Create pipeline
pipeline = dai.Pipeline()

# Define sources and outputs
monoLeft = pipeline.create(dai.node.MonoCamera)
monoRight = pipeline.create(dai.node.MonoCamera)
depth = pipeline.create(dai.node.StereoDepth)
xout = pipeline.create(dai.node.XLinkOut)

xout.setStreamName("disparity")

# Properties
monoLeft.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoLeft.setCamera("left")
monoRight.setResolution(dai.MonoCameraProperties.SensorResolution.THE_400_P)
monoRight.setCamera("right")

# Create a node that will produce the depth map (using disparity output as it's easier to visualize depth this way)
depth.setDefaultProfilePreset(dai.node.StereoDepth.PresetMode.HIGH_DENSITY)
# Options: MEDIAN_OFF, KERNEL_3x3, KERNEL_5x5, KERNEL_7x7 (default)
depth.initialConfig.setMedianFilter(dai.MedianFilter.KERNEL_7x7)
depth.setLeftRightCheck(lr_check)
depth.setExtendedDisparity(extended_disparity)
depth.setSubpixel(subpixel)

config = depth.initialConfig.get()
config.postProcessing.speckleFilter.enable = False
config.postProcessing.speckleFilter.speckleRange = 50
config.postProcessing.temporalFilter.enable = True
config.postProcessing.spatialFilter.enable = True
config.postProcessing.spatialFilter.holeFillingRadius = 2
config.postProcessing.spatialFilter.numIterations = 1
config.postProcessing.thresholdFilter.minRange = 400
config.postProcessing.thresholdFilter.maxRange = 15000
config.postProcessing.decimationFilter.decimationFactor = 1
depth.initialConfig.set(config)

# Linking
monoLeft.out.link(depth.left)
monoRight.out.link(depth.right)
depth.disparity.link(xout.input)

# Connect to device and start pipeline
with dai.Device(pipeline) as device:

    # Output queue will be used to get the disparity frames from the outputs defined above
    q = device.getOutputQueue(name="disparity", maxSize=4, blocking=False)

    while True:
        inDisparity = q.get()  # blocking call, will wait until a new data has arrived
        frame = inDisparity.getFrame()
        # Normalization for better visualization
        frame = (frame * (255 / depth.initialConfig.getMaxDisparity())).astype(np.uint8)

        cv2.imshow("disparity", frame)

        # Available color maps: https://docs.opencv.org/3.4/d3/d50/group__imgproc__colormap.html
        frame = cv2.applyColorMap(frame, cv2.COLORMAP_JET)
        cv2.imshow("disparity_color", frame)

        if cv2.waitKey(1) == ord('q'):
            break
```

#### C++

```cpp
#include <iostream>

// Inludes common necessary includes for development using depthai library
#include "depthai/depthai.hpp"

// Closer-in minimum depth, disparity range is doubled (from 95 to 190):
static std::atomic<bool> extended_disparity{false};
// Better accuracy for longer distance, fractional disparity 32-levels:
static std::atomic<bool> subpixel{false};
// Better handling for occlusions:
static std::atomic<bool> lr_check{true};

int main() {
    // Create pipeline
    dai::Pipeline pipeline;

    // Define sources and outputs
    auto monoLeft = pipeline.create<dai::node::MonoCamera>();
    auto monoRight = pipeline.create<dai::node::MonoCamera>();
    auto depth = pipeline.create<dai::node::StereoDepth>();
    auto xout = pipeline.create<dai::node::XLinkOut>();

    xout->setStreamName("disparity");

    // Properties
    monoLeft->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
    monoLeft->setCamera("left");
    monoRight->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
    monoRight->setCamera("right");

    // Create a node that will produce the depth map (using disparity output as it's easier to visualize depth this way)
    depth->setDefaultProfilePreset(dai::node::StereoDepth::PresetMode::HIGH_DENSITY);
    // Options: MEDIAN_OFF, KERNEL_3x3, KERNEL_5x5, KERNEL_7x7 (default)
    depth->initialConfig.setMedianFilter(dai::MedianFilter::KERNEL_7x7);
    depth->setLeftRightCheck(lr_check);
    depth->setExtendedDisparity(extended_disparity);
    depth->setSubpixel(subpixel);
    auto config = depth->initialConfig.get();
    config.postProcessing.speckleFilter.enable = false;
    config.postProcessing.speckleFilter.speckleRange = 50;
    config.postProcessing.temporalFilter.enable = true;
    config.postProcessing.spatialFilter.enable = true;
    config.postProcessing.spatialFilter.holeFillingRadius = 2;
    config.postProcessing.spatialFilter.numIterations = 1;
    config.postProcessing.thresholdFilter.minRange = 400;
    config.postProcessing.thresholdFilter.maxRange = 15000;
    config.postProcessing.decimationFilter.decimationFactor = 1;
    depth->initialConfig.set(config);

    // Linking
    monoLeft->out.link(depth->left);
    monoRight->out.link(depth->right);
    depth->disparity.link(xout->input);

    // Connect to device and start pipeline
    dai::Device device(pipeline);

    // Output queue will be used to get the disparity frames from the outputs defined above
    auto q = device.getOutputQueue("disparity", 4, false);

    while(true) {
        auto inDepth = q->get<dai::ImgFrame>();
        auto frame = inDepth->getFrame();
        // Normalization for better visualization
        frame.convertTo(frame, CV_8UC1, 255 / depth->initialConfig.getMaxDisparity());

        cv::imshow("disparity", frame);

        // Available color maps: https://docs.opencv.org/3.4/d3/d50/group__imgproc__colormap.html
        cv::applyColorMap(frame, frame, cv::COLORMAP_JET);
        cv::imshow("disparity_color", frame);

        int key = cv::waitKey(1);
        if(key == 'q' || key == 'Q') {
            return 0;
        }
    }
    return 0;
}
```

## Pipeline

### examples/depth_post_processing.pipeline.json

```json
{"pipeline":{"connections":[{"node1Id":0,"node1Output":"out","node1OutputGroup":"","node2Id":2,"node2Input":"left","node2InputGroup":""},{"node1Id":1,"node1Output":"out","node1OutputGroup":"","node2Id":2,"node2Input":"right","node2InputGroup":""},{"node1Id":2,"node1Output":"disparity","node1OutputGroup":"","node2Id":3,"node2Input":"in","node2InputGroup":""}],"globalProperties":{"calibData":null,"cameraTuningBlobSize":null,"cameraTuningBlobUri":"","leonCssFrequencyHz":700000000,"leonMssFrequencyHz":700000000,"pipelineName":null,"pipelineVersion":null,"sippBufferSize":18432,"sippDmaBufferSize":16384,"xlinkChunkSize":-1},"nodes":[[0,{"id":0,"ioInfo":[[["","inputControl"],{"blocking":true,"group":"","id":1,"name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}],[["","out"],{"blocking":false,"group":"","id":2,"name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","id":3,"name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","frameEvent"],{"blocking":false,"group":"","id":4,"name":"frameEvent","queueSize":8,"type":0,"waitForMessage":false}]],"name":"MonoCamera","properties":{"boardSocket":-1,"cameraName":"left","fps":30,"imageOrientation":-1,"initialControl":{"aeLockMode":false,"aeMaxExposureTimeUs":0,"aeRegion":{"height":0,"priority":0,"width":0,"x":0,"y":0},"afRegion":{"height":0,"priority":0,"width":0,"x":0,"y":0},"antiBandingMode":0,"autoFocusMode":3,"awbLockMode":false,"awbMode":0,"brightness":0,"captureIntent":0,"chromaDenoise":0,"cmdMask":0,"contrast":0,"controlMode":0,"effectMode":0,"expCompensation":0,"expManual":{"exposureTimeUs":0,"frameDurationUs":0,"sensitivityIso":0},"frameSyncMode":0,"lensPosAutoInfinity":0,"lensPosAutoMacro":0,"lensPosition":0,"lensPositionRaw":0,"lowPowerNumFramesBurst":0,"lowPowerNumFramesDiscard":0,"lumaDenoise":0,"saturation":0,"sceneMode":0,"sharpness":0,"strobeConfig":{"activeLevel":0,"enable":0,"gpioNumber":0},"strobeTimings":{"durationUs":0,"exposureBeginOffsetUs":0,"exposureEndOffsetUs":0},"wbColorTemp":0},"isp3aFps":0,"numFramesPool":3,"numFramesPoolRaw":3,"rawPacked":null,"resolution":2}}],[1,{"id":1,"ioInfo":[[["","inputControl"],{"blocking":true,"group":"","id":5,"name":"inputControl","queueSize":8,"type":3,"waitForMessage":false}],[["","out"],{"blocking":false,"group":"","id":6,"name":"out","queueSize":8,"type":0,"waitForMessage":false}],[["","raw"],{"blocking":false,"group":"","id":7,"name":"raw","queueSize":8,"type":0,"waitForMessage":false}],[["","frameEvent"],{"blocking":false,"group":"","id":8,"name":"frameEvent","queueSize":8,"type":0,"waitForMessage":false}]],"name":"MonoCamera","properties":{"boardSocket":-1,"cameraName":"right","fps":30,"imageOrientation":-1,"initialControl":{"aeLockMode":false,"aeMaxExposureTimeUs":0,"aeRegion":{"height":0,"priority":0,"width":0,"x":0,"y":0},"afRegion":{"height":0,"priority":0,"width":0,"x":0,"y":0},"antiBandingMode":0,"autoFocusMode":3,"awbLockMode":false,"awbMode":0,"brightness":0,"captureIntent":0,"chromaDenoise":0,"cmdMask":0,"contrast":0,"controlMode":0,"effectMode":0,"expCompensation":0,"expManual":{"exposureTimeUs":0,"frameDurationUs":0,"sensitivityIso":0},"frameSyncMode":0,"lensPosAutoInfinity":0,"lensPosAutoMacro":0,"lensPosition":0,"lensPositionRaw":0,"lowPowerNumFramesBurst":0,"lowPowerNumFramesDiscard":0,"lumaDenoise":0,"saturation":0,"sceneMode":0,"sharpness":0,"strobeConfig":{"activeLevel":0,"enable":0,"gpioNumber":0},"strobeTimings":{"durationUs":0,"exposureBeginOffsetUs":0,"exposureEndOffsetUs":0},"wbColorTemp":0},"isp3aFps":0,"numFramesPool":3,"numFramesPoolRaw":3,"rawPacked":null,"resolution":2}}],[2,{"id":2,"ioInfo":[[["","inputConfig"],{"blocking":false,"group":"","id":9,"name":"inputConfig","queueSize":4,"type":3,"waitForMessage":false}],[["","left"],{"blocking":false,"group":"","id":10,"name":"left","queueSize":8,"type":3,"waitForMessage":true}],[["","debugExtDispLrCheckIt1"],{"blocking":false,"group":"","id":22,"name":"debugExtDispLrCheckIt1","queueSize":8,"type":0,"waitForMessage":false}],[["","right"],{"blocking":false,"group":"","id":11,"name":"right","queueSize":8,"type":3,"waitForMessage":true}],[["","syncedLeft"],{"blocking":false,"group":"","id":12,"name":"syncedLeft","queueSize":8,"type":0,"waitForMessage":false}],[["","depth"],{"blocking":false,"group":"","id":13,"name":"depth","queueSize":8,"type":0,"waitForMessage":false}],[["","disparity"],{"blocking":false,"group":"","id":14,"name":"disparity","queueSize":8,"type":0,"waitForMessage":false}],[["","syncedRight"],{"blocking":false,"group":"","id":15,"name":"syncedRight","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispCostDump"],{"blocking":false,"group":"","id":20,"name":"debugDispCostDump","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispLrCheckIt2"],{"blocking":false,"group":"","id":21,"name":"debugDispLrCheckIt2","queueSize":8,"type":0,"waitForMessage":false}],[["","rectifiedLeft"],{"blocking":false,"group":"","id":16,"name":"rectifiedLeft","queueSize":8,"type":0,"waitForMessage":false}],[["","debugExtDispLrCheckIt2"],{"blocking":false,"group":"","id":23,"name":"debugExtDispLrCheckIt2","queueSize":8,"type":0,"waitForMessage":false}],[["","rectifiedRight"],{"blocking":false,"group":"","id":17,"name":"rectifiedRight","queueSize":8,"type":0,"waitForMessage":false}],[["","confidenceMap"],{"blocking":false,"group":"","id":24,"name":"confidenceMap","queueSize":8,"type":0,"waitForMessage":false}],[["","outConfig"],{"blocking":false,"group":"","id":18,"name":"outConfig","queueSize":8,"type":0,"waitForMessage":false}],[["","debugDispLrCheckIt1"],{"blocking":false,"group":"","id":19,"name":"debugDispLrCheckIt1","queueSize":8,"type":0,"waitForMessage":false}]],"name":"StereoDepth","properties":{"alphaScaling":null,"baseline":null,"depthAlignCamera":-1,"depthAlignmentUseSpecTranslation":null,"disparityToDepthUseSpecTranslation":null,"enableRectification":true,"enableRuntimeStereoModeSwitch":false,"focalLength":null,"focalLengthFromCalibration":true,"height":null,"initialConfig":{"algorithmControl":{"centerAlignmentShiftFactor":null,"customDepthUnitMultiplier":1000,"depthAlign":0,"depthUnit":2,"disparityShift":0,"enableExtended":false,"enableLeftRightCheck":true,"enableSubpixel":false,"leftRightCheckThreshold":10,"numInvalidateEdgePixels":0,"subpixelFractionalBits":3},"censusTransform":{"enableMeanMode":true,"kernelMask":0,"kernelSize":-1,"threshold":0},"costAggregation":{"divisionFactor":1,"horizontalPenaltyCostP1":250,"horizontalPenaltyCostP2":500,"verticalPenaltyCostP1":250,"verticalPenaltyCostP2":500},"costMatching":{"confidenceThreshold":245,"disparityWidth":1,"enableCompanding":false,"invalidDisparityValue":0,"linearEquationParameters":{"alpha":0,"beta":2,"threshold":127}},"postProcessing":{"bilateralSigmaValue":0,"brightnessFilter":{"maxBrightness":256,"minBrightness":0},"decimationFilter":{"decimationFactor":1,"decimationMode":0},"median":7,"spatialFilter":{"alpha":0.5,"delta":0,"enable":true,"holeFillingRadius":2,"numIterations":1},"speckleFilter":{"enable":false,"speckleRange":50},"temporalFilter":{"alpha":0.4000000059604645,"delta":0,"enable":true,"persistencyMode":3},"thresholdFilter":{"maxRange":15000,"minRange":400}}},"mesh":{"meshLeftUri":"","meshRightUri":"","meshSize":null,"stepHeight":16,"stepWidth":16},"numFramesPool":3,"numPostProcessingMemorySlices":-1,"numPostProcessingShaves":-1,"outHeight":null,"outKeepAspectRatio":true,"outWidth":null,"rectificationUseSpecTranslation":null,"rectifyEdgeFillColor":0,"useHomographyRectification":null,"width":null}}],[3,{"id":3,"ioInfo":[[["","in"],{"blocking":true,"group":"","id":25,"name":"in","queueSize":8,"type":3,"waitForMessage":true}]],"name":"XLinkOut","properties":{"maxFpsLimit":-1,"metadataOnly":false,"streamName":"disparity"}}]]}}
```

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
