Class Average

Inheritance Relationships

Base Type

Class Documentation

class Average : public slam_mer::utils::DescriptorModel

The Average descriptor model computes the arithmetic average of the added descriptors and returns it as the current descriptor.

Public Types

typedef std::shared_ptr<Average> shared_ptr

Typedef for shared pointer of type Average.

Public Functions

Average() = default

Average descriptor model constructor.

~Average() override = default

Average descriptor model destructor.

inline virtual output_t<descriptor_t> predict(const pose_t &pose_ = pose_t(), const point3d_t &point_ = point3d_t()) override

Predicts the descriptor for a given pose and point.

Parameters:
  • pose_ – The pose for which to predict the descriptor (not used in this model).

  • point_ – The point for which to predict the descriptor (not used in this model).

Returns:

The arithmetic average descriptor of the added descriptors.

virtual void fit(const descriptor_t &descriptor_, const pose_t &pose_ = pose_t(), const point3d_t &point_ = point3d_t()) override

Adds a new descriptor to the model.

Parameters:
  • descriptor_ – The new descriptor to add to the model.

  • pose_ – The pose of the keyframe that observed the descriptor (not used in this model).

  • point_ – The 3d point observation associated with the new descriptor (not used in this model).

Public Static Functions

static inline shared_ptr make_shared()

Creates a shared Average instance.

Returns:

Shared pointer to a new Average object.

Private Members

std::vector<float> _sumDescriptor

Sum of the added descriptors. This is used to compute the average descriptor efficiently without having to store all the descriptors in memory.