# NeuralDepthConfig

此消息用于配置[NeuralDepth](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/neural_depth.md)节点。
通过此消息，您可以设置后处理选项，例如置信度阈值、边缘阈值、时间滤波以及使用的深度单位。

## 配置选项

### 后处理

 * confidenceThreshold：视差计算的置信度阈值。置信度高于此值的像素视为有效。有效范围为[0, 255]，默认值为125。
 * edgeThreshold：视差计算的边缘阈值。边缘幅度低于此值的像素视为无效。有效范围为[0, 255]，默认值为10。
 * temporalFilter：时间滤波（可选持久性），可减少随时间变化的噪声。

### 算法控制

 * depthUnit：深度数据的测量单位（例如，MILLIMETER、CENTIMETER、METER）。
 * customDepthUnitMultiplier：相对于1米的自定义深度单位倍数。倍数为1000表示深度单位为毫米。

## 参考

### dai::NeuralDepthConfig

Kind: class

NeuralDepthConfig message.

#### dai::NeuralDepthConfig::AlgorithmControl

Kind: struct

##### dai::DepthUnit DepthUnit

Kind: enum

##### DepthUnit depthUnit

Kind: variable

Measurement unit for depth data. Depth data is integer value, multiple of depth unit.

##### float customDepthUnitMultiplier

Kind: variable

Custom depth unit multiplier, if custom depth unit is enabled, relative to 1 meter. A multiplier of 1000 effectively means depth
unit in millimeter.

##### DEPTHAI_SERIALIZE(AlgorithmControl, depthUnit, customDepthUnitMultiplier)

Kind: function

#### dai::NeuralDepthConfig::PostProcessing

Kind: struct

##### filters::params::ThresholdFilter ThresholdFilter

Kind: enum

##### filters::params::TemporalFilter TemporalFilter

Kind: enum

##### uint8_t confidenceThreshold

Kind: variable

Confidence threshold for disparity calculation, Confidences above this value will be considered valid. Valid range is [0,255].

##### uint8_t edgeThreshold

Kind: variable

Edge threshold for disparity calculation, Pixels with edge magnitude below this value will be considered invalid. Valid range is
[0,255].

##### ThresholdFilter thresholdFilter

Kind: variable

Threshold filtering. Filters out distances outside of a given interval.

##### TemporalFilter temporalFilter

Kind: variable

Temporal filtering with optional persistence.

##### DEPTHAI_SERIALIZE(PostProcessing, confidenceThreshold, edgeThreshold, thresholdFilter, temporalFilter)

Kind: function

#### AlgorithmControl algorithmControl

Kind: variable

Controls the flow of stereo algorithm - left-right check, subpixel etc.

#### PostProcessing postProcessing

Kind: variable

Controls the postprocessing of disparity and/or depth map.

#### NeuralDepthConfig()

Kind: function

Construct NeuralDepthConfig message.

#### ~NeuralDepthConfig()

Kind: function

#### NeuralDepthConfig & setConfidenceThreshold(uint8_t confThr)

Kind: function

Confidence threshold for disparity calculation parameters: confThr: Confidence threshold value 0..255

#### uint8_t getConfidenceThreshold()

Kind: function

Get confidence threshold for disparity calculation

#### NeuralDepthConfig & setEdgeThreshold(uint8_t edgeThr)

Kind: function

Set edge threshold for disparity calculation parameters: edgeThr: Edge threshold value 0..255

#### uint8_t getEdgeThreshold()

Kind: function

Get edge threshold for disparity calculation

#### NeuralDepthConfig & setDepthUnit(AlgorithmControl::DepthUnit depthUnit)

Kind: function

Set depth unit of depth map.

#### AlgorithmControl::DepthUnit getDepthUnit()

Kind: function

Get depth unit of depth map.

#### NeuralDepthConfig & setCustomDepthUnitMultiplier(float multiplier)

Kind: function

Set custom depth unit multiplier relative to 1 meter.

#### float getCustomDepthUnitMultiplier()

Kind: function

Get custom depth unit multiplier relative to 1 meter.

#### void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)

Kind: function

#### DEPTHAI_SERIALIZE(NeuralDepthConfig, algorithmControl, postProcessing)

Kind: function

### 需要帮助？

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