SDK Calibration Factories

std::unique_ptr<EBPatternDetector> Metavision::calib::create_eb_pattern_detector(const Pattern &pattern, const Parameters &params)

Factory function to create an event-based pattern detector.

Parameters
  • pattern – The pattern to detect

  • params – The parameters to use to create the detector

Throws

std::invalid_argument – in case of an invalid parameter

Returns

A unique pointer to the created pattern detector

std::unique_ptr<IntrinsicsEstimator> Metavision::calib::create_intrinsics_estimator(const Parameters &params)

Factory function to create an intrinsics estimator.

Parameters

params – The parameters to use to create the estimator

Throws

std::invalid_argument – in case of an invalid parameter

Returns

A unique pointer to the created intrinsics estimator

std::unique_ptr<PatternRenderer> Metavision::calib::create_pattern_renderer(const Pattern &pattern)

Factory function to create a pattern renderer.

Parameters

pattern – The pattern to render

Returns

A unique pointer to the created pattern renderer

template<typename T>
T Metavision::calib::get(const Parameters &params, const std::string &key)

Retrieves the value of a parameter from a parameter list.

Template Parameters

T – The expected type of the parameter to retrieve

Parameters
  • params – The parameter list

  • key – The key of the parameter to retrieve

Throws

std::bad_any_cast – if the parameter is not of the expected type or std::out_of_range if the parameter is not found in the list

Returns

The value of the parameter

template<typename T>
std::optional<T> Metavision::calib::get_if_exist(const Parameters &params, const std::string &key)

Retrieves the value of a parameter from a parameter list if it exists.

Template Parameters

T – The expected type of the parameter to retrieve

Parameters
  • params – The parameter list

  • key – The key of the parameter to retrieve

Returns

The value of the parameter if it exists, otherwise an empty optional

template<typename T>
void Metavision::calib::set(T &p, const Parameters &params, const std::string &key)

Copies (and converts if necessary) the value of a parameter from a parameter list to a variable.

Template Parameters

T – The type of the variable to set

Parameters
  • p – The variable to set

  • params – The parameter list

  • key – The key of the parameter to set

template<typename T>
void Metavision::calib::set_if_exist(T &p, const Parameters &params, const std::string &key)

Copies (and converts if necessary) the value of a parameter from a parameter list to a variable if it exists.

Template Parameters

T – The type of the variable to set

Parameters
  • p – The variable to set

  • params – The parameter list

  • key – The key of the parameter to set