Template Class PointObservation

Class Documentation

template<typename TransformationType>
class PointObservation

This class defines a point observation made by a keyframe. It holds the 3D point in camera reference frame, the 2D keypoint, descriptor, inlier flag, and optional factors.

Public Types

using vector = vector_t<PointObservation>

Typedef to a vector_t of type PointObservation.

using shared_ptr = std::shared_ptr<PointObservation>

Typedef to a std::shared_ptr of type PointObservation.

using unique_ptr = std::unique_ptr<PointObservation>

Typedef to a std::unique_ptr of type PointObservation.

using ProjectionFactorTyped = ProjectionFactor<TransformationType>

Typedef for the Typed projection factor.

using PointDistanceFactorTyped = PointDistanceFactor<TransformationType>

Typedef to the typed point distance factor.

Public Functions

inline PointObservation(const point2d_t &keypoint_, const point3d_t &point_, const descriptor_t &descriptor_, const pose_t &cameraPose_, const bool inlier_ = true, const ProjectionFactorTyped::shared_ptr &projectionFactor_ = nullptr, const PointDistanceFactorTyped::shared_ptr &distanceFactor_ = nullptr)

Construct a new PointObservation object.

Parameters:
  • keypoint_ – 2D observation of the keypoint in the image.

  • point_ – 3D position of the point in the image reference frame.

  • descriptor_ – Descriptor for the keypoint in the image.

  • cameraPose_ – Camera pose of the observation in world coordinates.

  • inlier_ – Flag to indicate if the point is an inlier.

  • projectionFactor_ – Pointer to a projection factor.

  • distanceFactor_ – Pointer to a distance factor.

inline PointObservation(const PointObservation::shared_ptr &other_)

Construct a PointObservation object.

Parameters:

other_ – Shared pointer to a PointObservation object.

inline PointObservation(const PointObservation &other_)

Construct a PointObservation object.

Parameters:

other_PointObservation object.

inline PointObservation()

Construct a default PointObservation object.

inline ~PointObservation()

Destroy a PointObservation object.

inline PointObservation &operator=(const PointObservation &other_)

Assignment operator for PointObservation.

Parameters:

other_PointObservation object.

Returns:

Reference to the updated observation.

inline output_t<point3d_t> get_point() const

Gets the 3D point observation (image reference frame).

Returns:

3D point observation (image reference frame).

inline output_t<point2d_t> get_keypoint() const

Gets the 2D observation of the keypoint in the image.

Returns:

2D observation of the keypoint in the image.

inline output_t<descriptor_t> get_descriptor() const

Gets the descriptor for the point.

Returns:

Descriptor for the point.

inline output_t<pose_t> get_camera_pose() const

Gets the camera pose of the observation in world coordinates.

Returns:

Camera pose of the observation in world coordinates.

inline output_t<typename ProjectionFactorTyped::shared_ptr> get_projection_factor() const

Gets the projection factor for the observation.

Returns:

Projection factor for the observation.

inline output_t<typename PointDistanceFactorTyped::shared_ptr> get_distance_factor() const

Gets the distance factor for the observation.

Returns:

Distance factor for the observation.

inline void update_projection_factor_keys(const point_id_t pointId_, const keyframe_id_t keyframeId_)

Updates the keys of the projection factor.

Parameters:
  • pointId_ – Point Id of the factor.

  • keyframeId_ – Keyframe Id of the factor.

inline void update_distance_factor_keys(const point_id_t pointId_, const keyframe_id_t keyframeId_)

Updates the keys of the distance factor.

Parameters:
  • pointId_ – Point Id of the factor.

  • keyframeId_ – Keyframe Id of the factor.

inline bool is_inlier() const

Check if the edge is an inlier.

Returns:

True if the edge is an inlier, false otherwise.

inline void set_inlier(bool inlier_)

Sets the inlier status of the point observation.

Parameters:

inlier_ – True to set the point as inlier, false otherwise.

Public Static Functions

static inline PointObservation::shared_ptr make_shared(const point2d_t &keypoint_, const point3d_t &point_, const descriptor_t &descriptor_, const pose_t &cameraPose_, const bool inlier_ = true, const ProjectionFactorTyped::shared_ptr &projectionFactor_ = nullptr, const PointDistanceFactorTyped::shared_ptr &distanceFactor_ = nullptr)

Allocates a new PointObservation object.

Parameters:
  • keypoint_ – 2D observation of the keypoint in the image.

  • point_ – 3D position of the point in the image reference frame.

  • descriptor_ – Descriptor for the keypoint in the image.

  • cameraPose_ – Camera pose of the observation in world coordinates.

  • inlier_ – Flag to indicate if the point is an inlier.

  • projectionFactor_ – Pointer to a projection factor.

  • distanceFactor_ – Pointer to a distance factor.

Returns:

Shared pointer owning the new PointObservation object.

static inline PointObservation::shared_ptr make_shared(const PointObservation &observation_, const ProjectionFactorTyped::shared_ptr &projectionFactor_ = nullptr, const PointDistanceFactorTyped::shared_ptr &distanceFactor_ = nullptr)

Allocates a new PointObservation object.

Parameters:
  • observation_PointObservation object.

  • projectionFactor_ – Pointer to a projection factor.

  • distanceFactor_ – Pointer to a distance factor.

Returns:

Shared pointer owning the new PointObservation object.

static inline PointObservation::shared_ptr make_shared(const PointObservation &observation_)

Allocates a new PointObservation object.

Parameters:

observation_PointObservation object.

Returns:

Shared pointer owning the copied PointObservation object.

Private Members

point2d_t _keypoint

2D observation of the keypoint in the image.

point3d_t _point

3D position of the point in the image reference frame.

descriptor_t _descriptor

Descriptor for the keypoint in the image.

pose_t _cameraPose

Camera pose of the observation in world coordinates.

bool _inlier

Flag to indicate if the point is an inlier.

ProjectionFactorTyped::shared_ptr _projectionFactor

Pointer to a projection factor.

PointDistanceFactorTyped::shared_ptr _distanceFactor

Pointer to a distance factor.

mutable mutex_t _mutex

Mutex to protect access to the edge data.