# DynamicCalibrationControl

The DynamicCalibrationControl message is the control interface used to interact with the [Dynamic
Calibration](https://docs.luxonis.com/software-v3/depthai/depthai-components/host_nodes/dynamic_calibration.md) node in DepthAI.

It provides a set of commands and configuration options that allow developers to:

 * Change the performance modes based on their use case
 * Load images when it best suits the user
 * Check calibration quality
 * Start or stop the calibration process,
 * Apply a computed calibration to device and
 * Reset already uploaded images to control resources

Essentially, it's the command protocol for managing the dynamic calibration process.

## Examples of functionality

 * [Calibration integration
   example](https://github.com/luxonis/depthai-core/blob/main/examples/python/DynamicCalibration/calibration_integration.py)
 * [Calibrate dynamic
   example](https://github.com/luxonis/depthai-core/blob/main/examples/python/DynamicCalibration/calibration_dynamic.py)

## Reference

### dai::DynamicCalibrationControl

Kind: class

Control message used to manage Dynamic Calibration on the device.

This class encapsulates all commands that can be sent to the DynamicCalibration node. A command is represented using the Command
variant, which may contain one of the command structures defined in the Commands namespace. Factory methods (e.g., calibrate ,
startCalibration ) allow convenient creation of command objects. The message is serialized and transmitted to the device through
an input queue.

#### dai::DynamicCalibrationControl::Commands

Kind: struct

Namespace containing all command structures that may be used inside Command .

These structs represent individual commands that the Dynamic Calibration node can execute. Each command corresponds to a specific
action or configuration update.

##### dai::DynamicCalibrationControl::Commands::ApplyCalibration

Kind: struct

Command to apply a new calibration to the device.

###### CalibrationHandler calibration

Kind: variable

Calibration data to apply.

###### bool flash

Kind: variable

###### ApplyCalibration()

Kind: function

###### ApplyCalibration(const CalibrationHandler & calibration, bool flash)

Kind: function

###### DEPTHAI_SERIALIZE(ApplyCalibration, calibration, flash)

Kind: function

##### dai::DynamicCalibrationControl::Commands::Calibrate

Kind: struct

Command to perform a full calibration run.

###### bool force

Kind: variable

Force calibration even when unnecessary.

###### Calibrate(bool force)

Kind: function

###### DEPTHAI_SERIALIZE(Calibrate, force)

Kind: function

##### dai::DynamicCalibrationControl::Commands::CalibrationQuality

Kind: struct

Command to perform a calibration quality check.

###### bool force

Kind: variable

Force check even if previous quality is valid.

###### CalibrationQuality(bool force)

Kind: function

###### DEPTHAI_SERIALIZE(CalibrationQuality, force)

Kind: function

##### dai::DynamicCalibrationControl::Commands::ComputeCalibrationMetrics

Kind: struct

Command to compute calibration metrics (e.g., calibrationConfidence and dataConfidence).

Evaluates the provided calibration data and computes relevant quality metrics.

###### dai::CalibrationHandler calibration

Kind: variable

###### ComputeCalibrationMetrics(dai::CalibrationHandler & calibration)

Kind: function

###### DEPTHAI_SERIALIZE(ComputeCalibrationMetrics, calibration)

Kind: function

##### dai::DynamicCalibrationControl::Commands::LoadImage

Kind: struct

Command to load a single image for calibration.

Useful for manual step-by-step calibration sequences.

##### dai::DynamicCalibrationControl::Commands::ResetData

Kind: struct

Command to reset accumulated calibration and quality data.

##### dai::DynamicCalibrationControl::Commands::SetPerformanceMode

Kind: struct

Command to select the calibration performance mode.

###### PerformanceMode performanceMode

Kind: variable

Desired performance mode.

###### SetPerformanceMode()

Kind: function

###### SetPerformanceMode(PerformanceMode performanceMode)

Kind: function

###### DEPTHAI_SERIALIZE(SetPerformanceMode, performanceMode)

Kind: function

##### dai::DynamicCalibrationControl::Commands::StartCalibration

Kind: struct

Command to start dynamic calibration with periodic operations.

parameters: loadImagePeriod: How often image loading should occur (seconds); calibrationPeriod: How often calibration should run
(seconds)

###### float loadImagePeriod

Kind: variable

Seconds between image loads.

###### float calibrationPeriod

Kind: variable

Seconds between calibration cycles.

###### StartCalibration(float loadImagePeriod, float calibrationPeriod)

Kind: function

###### DEPTHAI_SERIALIZE(StartCalibration, loadImagePeriod, calibrationPeriod)

Kind: function

##### dai::DynamicCalibrationControl::Commands::StopCalibration

Kind: struct

Command to stop a running dynamic calibration process.

#### int PerformanceMode

Kind: enum

Performance mode for Dynamic Calibration.

These modes influence how aggressively calibration and quality checks are performed on the device.

##### DEFAULT

Kind: enum_value

Default behavior (balance quality and speed)

##### STATIC_SCENERY

Kind: enum_value

Optimized for scenes with little or no motion.

##### OPTIMIZE_SPEED

Kind: enum_value

Favor faster processing at possible quality trade-off.

##### OPTIMIZE_PERFORMANCE

Kind: enum_value

Favor accuracy even at reduced speed.

##### SKIP_CHECKS

Kind: enum_value

Skip quality checks; force calibration actions.

#### std::variant< std::monostate, Commands::Calibrate , Commands::CalibrationQuality , Commands::StartCalibration ,
Commands::StopCalibration , Commands::LoadImage , Commands::ApplyCalibration , Commands::ResetData , Commands::SetPerformanceMode
, Commands::ComputeCalibrationMetrics > Command

Kind: enum

Variant type representing a single calibration command.

Only one command may be active at any time. If no command is present, the variant contains

#### Command command

Kind: variable

#### DynamicCalibrationControl()

Kind: function

#### DynamicCalibrationControl(Command cmd)

Kind: function

#### ~DynamicCalibrationControl()

Kind: function

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

Kind: function

#### DatatypeEnum getDatatype()

Kind: function

Get the datatype of this specific message.

return: DatatypeEnum

### Need assistance?

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