# 深度后处理

本示例展示了如何在设备本身上运行深度后处理滤波器，以减少噪点、平滑深度图并整体提升深度图质量。后处理可以添加到
[StereoDepth](https://docs.luxonis.com/software/depthai-components/nodes/stereo_depth.md) 节点中。

## Demo

## 深度滤波器

### 中值滤波

这是一种非保边中值滤波器，可用于减少噪声并平滑深度图。中值滤波器由硬件实现，因此是最快的滤波器。

### 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

### 散斑滤波

散斑滤波器用于减少散斑噪声。散斑噪声是指相邻视差/深度像素之间存在巨大差异的区域，散斑滤波器尝试滤除这类区域。

### 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

### 时域滤波

时域滤波器旨在通过基于先前帧操作每个像素值来提升深度数据的持久性。该滤波器对数据执行单次遍历，在调整深度值的同时更新跟踪历史。当像素数据缺失或无效时，滤波器使用用户定义的持久性模式来决定是否用存储的数据来修正缺失值。需要注意的是，由于依赖历史数据，该滤波器可能会引入明显的模糊/拖影伪影，因此最适合静态场景。

### 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

### 空间滤波

空间保边滤波器会用有效的邻近深度像素填充无效的深度像素。它执行一系列一维水平和垂直遍历（迭代），以增强重建数据的平滑度。该滤波器基于[这篇研究论文](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

### 阈值滤波

阈值滤波器会滤除所有超出配置的最小/最大阈值范围的视差/深度像素。

```python
class ThresholdFilter:
'''
    空间保边滤波器会用有效的邻近深度像素填充无效的深度像素。
    它执行一系列一维水平和垂直遍历（迭代），以增强重建数据的平滑度。
    该滤波器基于[这篇研究论文](https://www.inf.ufrgs.br/~eslgastal/DomainTransform/)。
'''
```

### 相似示例：

 * [深度预览](https://docs.luxonis.com/software/depthai/examples/depth_preview.md)
 * [主机立体深度](https://docs.luxonis.com/software/depthai/examples/stereo_depth_from_host.md)

## 设置

请运行[安装脚本](https://github.com/luxonis/depthai-python/blob/main/examples/install_requirements.py)以下载所有必需的依赖项。请注意，此脚本必须在 git
上下文中运行，因此您需要先下载 [depthai-python](https://github.com/luxonis/depthai-python) 仓库，然后运行该脚本。

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

更多信息，请参考[安装指南](https://docs.luxonis.com/software/depthai/manual-install.md)。

## 源代码

#### 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;
}
```

## 流水线

### 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"}}]]}}
```

### 需要帮助？

请前往 [OAKChina 官网](https://www.oakchina.cn/) 获取技术支持或解答您的任何疑问。
