ImFusion SDK 4.3
ParametricMotionModel Class Reference

#include <ImFusion/US/MotionTrajectoryModel.h>

A motion model that extends rigid motion with possible waypoint parametrization. More...

+ Inheritance diagram for ParametricMotionModel:

Detailed Description

A motion model that extends rigid motion with possible waypoint parametrization.

This class extends the functionality of SimpleMotionModel in RigidPose mode by combining it with a spline-based MotionModel. The base rigid motion is defined by the first 6 parameters and handled by SimpleMotionModel. The remaining parameters are used to define waypoints.

Note
  • The first 6 parameters define the global rigid transformation.
  • Rigid transformation is distributed symmetrically.
  • The remaining parameters are divided into k blocks of 6 values.
  • Each block defines the pose in position and euler angles for waypoints used by MotionModel.
  • The number of control points (numberOfControlPoints()) does not necessarily match the number of blocks. The motion will be calculated based on these waypoints, and for each control point, the pose matrix will be interpolated.
  • Control points are interpolated across the frame range, excluding the first and last frames.
  • The base rigid transformation (first 6 parameters) is distributed symmetrically across the full motion.
  • Waypoints influence only the internal frames.
Warning
setParameters(std::vector<double>) is not overridden. Parameters are exposed as-is:
  • pars[0..5]: Rigid motion parameters.
  • pars[6..]: k blocks of 6 parameters (position + Euler angles).
See also
SimpleMotionModel
MotionModel

Public Member Functions

 ParametricMotionModel (int size)
 
std::string name () const override
 Returns the name of the current motion model.
 
void configure (const Properties *p) override
 Extends MotionTrajectoryModel::configure(const Properties *)
 
void configuration (Properties *p) const override
 Saves the current model settings into the provided Properties object, including the "numCtrlPoints" property if set.
 
std::vector< mat4 > defineMotion () const override
 Computes a set of m_size matrices describing the intended motion trajectory.
 
mat4 fitMatrices (const std::vector< mat4 > &mat) override
 Sets the parameters based on the given motion sequence.
 
void setNumberOfControlPoints (int p, bool opt=false)
 Function defining the number of control points and optimization flag.
 
int numberOfControlPoints () const
 
bool optimizeControlPoints () const
 
- Public Member Functions inherited from MotionTrajectoryModel
 MotionTrajectoryModel (int size)
 
void setRelativeShiftMatrix (const mat4 &relShiftBefore)
 Sets the relative shift matrix applied before the motion.
 
virtual int numberOfParameters () const
 
virtual std::vector< double > parameters () const
 
virtual void setParameters (const std::vector< double > &pars)
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Protected Attributes

int m_numCtrlPoints = 1
 Control points of underlying MotionModel; Should not exceed the size of a model.
 
bool m_modelOpt = false
 Optimize motion control points.
 
- Protected Attributes inherited from MotionTrajectoryModel
const int m_size
 Size of the model, regularly the number of frames.
 
std::vector< double > m_pars
 Full motion parameter vector - not necessarily the exposed ones.
 
mat4 m_relShift
 Generic helper matrix to incorporate optional shifts. Considered by rigidMotion().
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Additional Inherited Members

- Public Types inherited from MotionTrajectoryModel
typedef std::function< MotionTrajectoryModel *(int)> createModelFunc
 Function signature for creating a motion model with a given size.
 
- Static Public Member Functions inherited from MotionTrajectoryModel
static std::vector< std::pair< std::string, createModelFunc > > & supportedModels ()
 Returns a list of supported motion models.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Member Functions inherited from MotionTrajectoryModel
std::vector< mat4 > rigidMotion (const mat4 &m0, const mat4 &m1, int startFrame=0, int endFrame=-1) const
 Helper method to interpolate a rigid motion between m0 and m1.
 

Constructor & Destructor Documentation

◆ ParametricMotionModel()

ParametricMotionModel ( int size)
explicit
Parameters
sizeThe number of frames in the motion sequence.

Member Function Documentation

◆ name()

std::string name ( ) const
inlineoverridevirtual

Returns the name of the current motion model.

Implements MotionTrajectoryModel.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Extends MotionTrajectoryModel::configure(const Properties *)

Supports additional properties specific to this model:

  • "numCtrlPoints": the number of control points.
See also
MotionTrajectoryModel::configure(const Properties *)

Reimplemented from MotionTrajectoryModel.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Saves the current model settings into the provided Properties object, including the "numCtrlPoints" property if set.

Reimplemented from MotionTrajectoryModel.

◆ defineMotion()

std::vector< mat4 > defineMotion ( ) const
overridevirtual

Computes a set of m_size matrices describing the intended motion trajectory.

Implements MotionTrajectoryModel.

◆ fitMatrices()

mat4 fitMatrices ( const std::vector< mat4 > & mat)
overridevirtual

Sets the parameters based on the given motion sequence.

Warning
If mat.size() > m_size, the behavior is undefined. Ensure the input sequence does not exceed the model size.

Implements MotionTrajectoryModel.

◆ setNumberOfControlPoints()

void setNumberOfControlPoints ( int p,
bool opt = false )

Function defining the number of control points and optimization flag.

  • If opt == false: Control points are distributed uniformly over the normalized time interval (0, 1), excluding the start and end frames.
  • If opt == true: Control points are distributed non-uniformly based on the Manhattan norm of each parameter block.
Parameters
pNumber of control points to use (must be 0 < p < m_size).
optWhether to optimize the distribution of control points based on waypoint motion.

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close