Struct DistortionModel

Nested Relationships

Nested Types

Struct Documentation

struct DistortionModel

A Wrapper for all distortion models enabling value semantics.

Public Functions

template<typename ModelT>
DistortionModel(const ModelT &model)

A constructor creating the wrapper.

Template Parameters:

ModelT – The type of the Model to wrap. Model must inherit from DistortionModelInterface!

Parameters:

model – The model object to wrap.

template<typename ModelT>
DistortionModel(std::remove_reference_t<ModelT> &&model)

Move constructor creating the wrapper.

Template Parameters:

ModelT – Type of the model to wrap

Parameters:

model – The model to move from

DistortionModel()

Default constructor, initializes to UnknownDistortion.

DistortionModel(const DistortionModel &other)

Copy constructor.

Parameters:

other – The DistortionModel to copy

DistortionModel(DistortionModel &&other)

Move constructor.

Parameters:

other – The DistortionModel to move from

inline Vector2d distortPoint(const Vector2d &p) const

Distorts a point using the internal distortion model.

Parameters:

p – The point to distort in normalized image coordinates (x and y in [-1, 1])

Returns:

The distorted point in normalized image coordinates

inline const std::vector<double> &coefficients() const

Access to the internal distortion coefficients used for serialization.

Returns:

A const reference to the internal distortion coefficients vector

inline std::string name() const

Access to the name of the distortion model used for serialization.

Returns:

A std::string containing the model name

DistortionModel &operator=(const DistortionModel &other)

Copy assignment operator.

Parameters:

other – The DistortionModel to copy

Returns:

A reference to this

DistortionModel &operator=(DistortionModel &&other)

Move assignment operator.

Parameters:

other – The DistortionModel to move from

Returns:

A reference to this

Public Static Functions

static DistortionModel fromName(const std::string &name, const std::vector<double> &coefficients)

Creates the distortion model indicated by name.

Parameters:
  • name – The name of the distortion model to create

  • coefficients – The distortion coefficients of the model