Ocean
|
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 HomogenousMatrix4 & | pose () const |
Returns the current pose of this motion model as transformation matrix. More... | |
const HomogenousMatrix4 & | predictedPose () const |
Returns the predicted pose of this motion model as transformation matrix. More... | |
const Pose & | velocity () const |
Returns the current velocity of this motion model. More... | |
const Pose & | predictedVelocity () 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... | |
This class implements a 6DOF pose with internal motion model.
Ocean::Tracking::MotionModel::MotionModel | ( | ) |
Creates a new but invalid motion model.
|
explicit |
Creates a new pose with a given homogeneous matrix.
The given transformation must be scale and shear free.
transformation | Matrix defining the pose |
Ocean::Tracking::MotionModel::MotionModel | ( | const Vector3 & | translation, |
const Quaternion & | orientation | ||
) |
Creates a new pose by a given translation and orientation.
translation | Translation of the pose |
orientation | Orientation of the pose |
Ocean::Tracking::MotionModel::MotionModel | ( | const Vector3 & | translation, |
const Rotation & | orientation | ||
) |
Creates a new pose by a given translation and orientation.
translation | Translation of the pose |
orientation | Orientation of the pose |
|
inlinestatic |
Applies a liner (and spherical linear) interpolation between two camera poses by application of an interpolation factor.
pose0 | The first camera pose that will be returned if an interpolation factor of 0.0 is applied |
pose1 | The second camera pose that will be returned if an interpolation factor of 1.0 is applied |
factor | The interpolation factor with range [0.0, 1.0] |
|
inline |
Returns whether no pose has been registered.
|
inlineexplicit |
Returns whether at least one pose has been registered.
|
inline |
Returns the current pose of this motion model as transformation matrix.
|
inline |
Returns the predicted pose of this motion model as transformation matrix.
|
inline |
Returns the current velocity of this motion model.
|
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).
previousPoses | A concurrent set of valid poses for the previous frames, at least two poses must be provided. |
factor | The interpolation factor that defines the influence of the most recent poses, with range [0.0, 1.0] |
void Ocean::Tracking::MotionModel::reset | ( | ) |
Resets the motion model.
All gathered information will be lost.
void Ocean::Tracking::MotionModel::update | ( | const HomogenousMatrix4 & | pose | ) |
Updates the model with a new precise pose.
pose | New pose to updating the model and creating a new prediction |
|
inline |
Returns the current velocity of this motion model.
|
private |
State determining whether at least one pose has been registered.
|
private |
Current pose.
|
private |
Predicted pose.
|
private |
Predicted velocity.
|
private |
Current velocity.