# NeuralDepthConfig

This message is used to configure the
[NeuralDepth](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/neural_depth.md) node. With this message you
can set post-processing options like confidence threshold, edge threshold, temporal filtering, and used depth units.

## Configuration Options

### Post-Processing

 * confidenceThreshold: Confidence threshold for disparity calculation. Pixels with confidence above this value are considered
   valid. Valid range is [0, 255], default is 125.
 * edgeThreshold: Edge threshold for disparity calculation. Pixels with edge magnitude below this value are considered invalid.
   Valid range is [0, 255], default is 10.
 * temporalFilter: Temporal filtering with optional persistence to reduce noise over time.

### Algorithm Control

 * depthUnit: Measurement unit for depth data (e.g., MILLIMETER, CENTIMETER, METER).
 * customDepthUnitMultiplier: Custom depth unit multiplier relative to 1 meter. A multiplier of 1000 means depth unit in
   millimeters.

## Reference

### 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::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].

##### TemporalFilter temporalFilter

Kind: variable

Temporal filtering with optional persistence.

##### DEPTHAI_SERIALIZE(PostProcessing, confidenceThreshold, edgeThreshold, 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

### Need assistance?

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