Class DynamicCalibrationControl

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class DynamicCalibrationControl : public dai::Buffer

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.

Public Types

enum class PerformanceMode : int

Performance mode for Dynamic Calibration.

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

Values:

enumerator DEFAULT

Default behavior (balance quality and speed)

enumerator STATIC_SCENERY

Optimized for scenes with little or no motion.

enumerator OPTIMIZE_SPEED

Favor faster processing at possible quality trade-off.

enumerator OPTIMIZE_PERFORMANCE

Favor accuracy even at reduced speed.

enumerator SKIP_CHECKS

Skip quality checks; force calibration actions.

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

Variant type representing a single calibration command.

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

Public Functions

inline DynamicCalibrationControl()
inline explicit DynamicCalibrationControl(Command cmd)
~DynamicCalibrationControl() override
inline virtual void serialize(std::vector<std::uint8_t> &metadata, DatatypeEnum &datatype) const override
inline virtual DatatypeEnum getDatatype() const override

Get the datatype of this specific message.

Returns:

DatatypeEnum

Public Members

Command command = {}

Public Static Functions

static inline std::shared_ptr<DynamicCalibrationControl> calibrate(bool force = false)

Create a command that triggers a full calibration run.

Parameters:

force – If true, force calibration even if the quality check passes.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> calibrationQuality(bool force = false)

Create a command to request a calibration quality check.

Parameters:

force – If true, force execution even if conditions are not ideal.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> computeCalibrationMetrics(dai::CalibrationHandler &calibration)

Create a command to compute metrics for a given calibration.

This command instructs the device to evaluate the supplied calibration data and compute metrics such as calibrationConfidence and dataConfidence.

Parameters:

calibration – Calibration data to evaluate.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> startCalibration(float loadImagePeriod = 0.5f, float calibrationPeriod = 5.0f)

Start periodic dynamic calibration.

Parameters:
  • loadImagePeriod – How often images should be loaded, in seconds.

  • calibrationPeriod – How often a new calibration should be executed, in seconds.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> stopCalibration()

Stop a running dynamic calibration session.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> loadImage()

Request manual image loading for calibration.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> applyCalibration(const CalibrationHandler &calibration, bool flash = false)

Apply a new calibration to the system.

Parameters:

calibration – Calibration data to apply.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> resetData()

Reset internal calibration-related data.

Returns:

Shared pointer to a DynamicCalibrationControl command.

static inline std::shared_ptr<DynamicCalibrationControl> setPerformanceMode(PerformanceMode mode = PerformanceMode::DEFAULT)

Set the performance mode for dynamic calibration.

Parameters:

mode – Performance mode to use. Defaults to PerformanceMode::DEFAULT.

Returns:

Shared pointer to a DynamicCalibrationControl command.

struct Commands

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.

struct ApplyCalibration

Command to apply a new calibration to the device.

Public Functions

ApplyCalibration() = default
inline explicit ApplyCalibration(const CalibrationHandler &calibration, bool flash = false)
DEPTHAI_SERIALIZE(ApplyCalibration, calibration, flash)

Public Members

CalibrationHandler calibration

Calibration data to apply.

bool flash
struct Calibrate

Command to perform a full calibration run.

Public Functions

inline explicit Calibrate(bool force = false)
DEPTHAI_SERIALIZE(Calibrate, force)

Public Members

bool force = false

Force calibration even when unnecessary.

struct CalibrationQuality

Command to perform a calibration quality check.

Public Functions

inline explicit CalibrationQuality(bool force = false)
DEPTHAI_SERIALIZE(CalibrationQuality, force)

Public Members

bool force = false

Force check even if previous quality is valid.

struct ComputeCalibrationMetrics

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

  • Evaluates the provided calibration data and computes relevant quality metrics.

Public Functions

inline explicit ComputeCalibrationMetrics(dai::CalibrationHandler &calibration)
DEPTHAI_SERIALIZE(ComputeCalibrationMetrics, calibration)

Public Members

dai::CalibrationHandler calibration
struct LoadImage

Command to load a single image for calibration.

Useful for manual step-by-step calibration sequences.

struct ResetData

Command to reset accumulated calibration and quality data.

struct SetPerformanceMode

Command to select the calibration performance mode.

Public Functions

inline SetPerformanceMode()
inline explicit SetPerformanceMode(PerformanceMode performanceMode)
DEPTHAI_SERIALIZE(SetPerformanceMode, performanceMode)

Public Members

PerformanceMode performanceMode

Desired performance mode.

struct StartCalibration

Command to start dynamic calibration with periodic operations.

Param loadImagePeriod:

How often image loading should occur (seconds)

Param calibrationPeriod:

How often calibration should run (seconds)

Public Functions

inline explicit StartCalibration(float loadImagePeriod = 0.5f, float calibrationPeriod = 5.0f)
DEPTHAI_SERIALIZE(StartCalibration, loadImagePeriod, calibrationPeriod)

Public Members

float loadImagePeriod = 0.5f

Seconds between image loads.

float calibrationPeriod = 5.0f

Seconds between calibration cycles.

struct StopCalibration

Command to stop a running dynamic calibration process.