Ocean
Ocean::Tracking::MotionModel Class Reference

This class implements a 6DOF pose with internal motion model. More...

Public Member Functions

 MotionModel ()
 Creates a new but invalid motion model. More...
 
 MotionModel (const HomogenousMatrix4 &transformation)
 Creates a new pose with a given homogeneous matrix. More...
 
 MotionModel (const Vector3 &translation, const Quaternion &orientation)
 Creates a new pose by a given translation and orientation. More...
 
 MotionModel (const Vector3 &translation, const Rotation &orientation)
 Creates a new pose by a given translation and orientation. More...
 
void update (const HomogenousMatrix4 &pose)
 Updates the model with a new precise pose. More...
 
const HomogenousMatrix4pose () const
 Returns the current pose of this motion model as transformation matrix. More...
 
const HomogenousMatrix4predictedPose () const
 Returns the predicted pose of this motion model as transformation matrix. More...
 
const Posevelocity () const
 Returns the current velocity of this motion model. More...
 
const PosepredictedVelocity () const
 Returns the current velocity of this motion model. More...
 
void reset ()
 Resets the motion model. More...
 
bool isNull () const
 Returns whether no pose has been registered. More...
 
 operator bool () const
 Returns whether at least one pose has been registered. More...
 

Static Public Member Functions

static HomogenousMatrix4 interpolate (const HomogenousMatrix4 &pose0, const HomogenousMatrix4 &pose1, const Scalar factor)
 Applies a liner (and spherical linear) interpolation between two camera poses by application of an interpolation factor. More...
 
static HomogenousMatrix4 predictPose (const HomogenousMatrices4 &previousPoses, const Scalar factor=Scalar(0.4))
 Predicts (extrapolates) the camera pose for a current camera frame, if poses for the previous frames are known. More...
 

Private Attributes

HomogenousMatrix4 modelPose
 Current pose. More...
 
HomogenousMatrix4 modelPredictedPose
 Predicted pose. More...
 
Pose modelVelocity
 Current velocity. More...
 
Pose modelPredictedVelocity
 Predicted velocity. More...
 
bool modelHasPose
 State determining whether at least one pose has been registered. More...
 

Detailed Description

This class implements a 6DOF pose with internal motion model.

Constructor & Destructor Documentation

◆ MotionModel() [1/4]

Ocean::Tracking::MotionModel::MotionModel ( )

Creates a new but invalid motion model.

◆ MotionModel() [2/4]

Ocean::Tracking::MotionModel::MotionModel ( const HomogenousMatrix4 transformation)
explicit

Creates a new pose with a given homogeneous matrix.

The given transformation must be scale and shear free.

Parameters
transformationMatrix defining the pose

◆ MotionModel() [3/4]

Ocean::Tracking::MotionModel::MotionModel ( const Vector3 translation,
const Quaternion orientation 
)

Creates a new pose by a given translation and orientation.

Parameters
translationTranslation of the pose
orientationOrientation of the pose

◆ MotionModel() [4/4]

Ocean::Tracking::MotionModel::MotionModel ( const Vector3 translation,
const Rotation orientation 
)

Creates a new pose by a given translation and orientation.

Parameters
translationTranslation of the pose
orientationOrientation of the pose

Member Function Documentation

◆ interpolate()

HomogenousMatrix4 Ocean::Tracking::MotionModel::interpolate ( const HomogenousMatrix4 pose0,
const HomogenousMatrix4 pose1,
const Scalar  factor 
)
inlinestatic

Applies a liner (and spherical linear) interpolation between two camera poses by application of an interpolation factor.

Parameters
pose0The first camera pose that will be returned if an interpolation factor of 0.0 is applied
pose1The second camera pose that will be returned if an interpolation factor of 1.0 is applied
factorThe interpolation factor with range [0.0, 1.0]
Returns
The resulting interpolated camera pose

◆ isNull()

bool Ocean::Tracking::MotionModel::isNull ( ) const
inline

Returns whether no pose has been registered.

Returns
True, if so

◆ operator bool()

Ocean::Tracking::MotionModel::operator bool ( ) const
inlineexplicit

Returns whether at least one pose has been registered.

Returns
True, if so

◆ pose()

const HomogenousMatrix4 & Ocean::Tracking::MotionModel::pose ( ) const
inline

Returns the current pose of this motion model as transformation matrix.

Returns
Current pose

◆ predictedPose()

const HomogenousMatrix4 & Ocean::Tracking::MotionModel::predictedPose ( ) const
inline

Returns the predicted pose of this motion model as transformation matrix.

Returns
Predicted pose

◆ predictedVelocity()

const Pose & Ocean::Tracking::MotionModel::predictedVelocity ( ) const
inline

Returns the current velocity of this motion model.

Returns
Current velocity

◆ predictPose()

static HomogenousMatrix4 Ocean::Tracking::MotionModel::predictPose ( const HomogenousMatrices4 previousPoses,
const Scalar  factor = Scalar(0.4) 
)
static

Predicts (extrapolates) the camera pose for a current camera frame, if poses for the previous frames are known.

This function predicts a pose for each two pairs of concurrent poses of the given set of previous poses.
The prediction of the most recent pose pairs is interpolated with the precision of the next pose pairs and so on.
Thus, the influence of the previous poses can be adjusted with the interpolation factor.
A given factor of of 0.4 means that the youngest poses have an influence of 60% while each older pose has an influence of 40% (recursively).

Parameters
previousPosesA concurrent set of valid poses for the previous frames, at least two poses must be provided.
factorThe interpolation factor that defines the influence of the most recent poses, with range [0.0, 1.0]

◆ reset()

void Ocean::Tracking::MotionModel::reset ( )

Resets the motion model.

All gathered information will be lost.

◆ update()

void Ocean::Tracking::MotionModel::update ( const HomogenousMatrix4 pose)

Updates the model with a new precise pose.

Parameters
poseNew pose to updating the model and creating a new prediction

◆ velocity()

const Pose & Ocean::Tracking::MotionModel::velocity ( ) const
inline

Returns the current velocity of this motion model.

Returns
Current velocity

Field Documentation

◆ modelHasPose

bool Ocean::Tracking::MotionModel::modelHasPose
private

State determining whether at least one pose has been registered.

◆ modelPose

HomogenousMatrix4 Ocean::Tracking::MotionModel::modelPose
private

Current pose.

◆ modelPredictedPose

HomogenousMatrix4 Ocean::Tracking::MotionModel::modelPredictedPose
private

Predicted pose.

◆ modelPredictedVelocity

Pose Ocean::Tracking::MotionModel::modelPredictedVelocity
private

Predicted velocity.

◆ modelVelocity

Pose Ocean::Tracking::MotionModel::modelVelocity
private

Current velocity.


The documentation for this class was generated from the following file: