ImFusion SDK 4.3
MotionModel Class Reference

#include <ImFusion/Base/MotionModel.h>

Motion model of smooth (modeled by splines) homogenous transformations over time. More...

+ Inheritance diagram for MotionModel:

Detailed Description

Motion model of smooth (modeled by splines) homogenous transformations over time.

The output of the model is a vector of matrices. Control point values, (and optionally locations) are set via applyParameters()

Public Member Functions

 MotionModel (int numMatrices)
 Creates the motion model with the desired number of output matrices.
 
void setControlPoints (const std::vector< double > &points)
 Specify custom control point locations, normalized between zero and one.
 
void setPoseParameterSelection (const std::vector< bool > &sel)
 Set which affine pose parameters to use (the rigid ones by default)
 
void fit (const std::vector< mat4 > &matrices, bool optimize=false)
 Fits the motion model from a vector of transformation matrices.
 
void optimize (Optimizer *opt)
 Prepares the given optimizer and runs it for motion model refinement The optimizer has to have a cost function assigned which is calling the applyParameters method of this class.
 
void applyParameters (int n, const double *pars)
 Applies provided parameters on the motion model.
 
const std::vector< double > & parameters () const
 Access to the parameter vector for all control points.
 
const std::vector< mat4 > & matrices () const
 Access the transformation matrices.
 
const std::vector< double > & points () const
 Access the control point locations.
 
int numberOfControlPointsToOptimize () const
 Return the number of control points that are actually optimized ( depends on whether first and last control points are optimized)
 
int numberOfControlPointLocationsToOptimize () const
 Return the number of control point locations to be optimized, may be zero.
 
int numberOfParameters () const
 Return the number of parameters needed for optimization.
 
int numberOfControlPoints () const
 Legacy getter/setter Methods.
 
void setNumberOfControlPoints (int n)
 
void setUseBorderPoints (bool first, bool last)
 Legacy getter/setter methods for p_useFirstControlPoint and p_useLastControlPoint.
 
void setOptimizePosition (bool flag)
 Legacy setter method for p_optimizeCPPositions.
 
void setLinkLastPoint (bool flag)
 Legacy setter method for linkLastCpWithPrevious.
 
void setBlockMode (bool flag)
 Legacy setter for p_blockMode.
 
- Public Member Functions inherited from Configurable
virtual void configure (const Properties *p)
 Configure this object instance by de-serializing the given Properties.
 
virtual void configuration (Properties *p) const
 Serialize the current object configuration into the given Properties object.
 
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
 

Public Attributes

Parameter< int > p_numControlPoints = {"numControlPoints", 3, this}
 Number of control points.
 
Parameter< bool > p_useFirstControlPoint = {"useFirstControlPoint", true, this}
 Whether to use the first control point.
 
Parameter< bool > p_useLastControlPoint = {"useLastControlPoint", true, this}
 Whether to use the last control point.
 
Parameter< bool > p_optimizeCPPositions = {"optimizeCPPositions", false, this}
 Whether to optimize control point positions.
 
Parameter< bool > p_linkLastCPWithPrevious = {"linkLastCPWithPrevious", false, this}
 
Parameter< bool > p_blockMode = {"blockMode", false, this}
 If enabled, blocks of constant transformations are defined between the control points.
 
- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 

Protected Member Functions

void applyParametersSpline (int n, const double *pars)
 

Additional Inherited Members

- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ optimize()

void optimize ( Optimizer * opt)

Prepares the given optimizer and runs it for motion model refinement The optimizer has to have a cost function assigned which is calling the applyParameters method of this class.

If the optimizer dimension does not match, it is expected to contain just a single set of pose parameters and is expanded.

◆ setOptimizePosition()

void setOptimizePosition ( bool flag)
inline

Legacy setter method for p_optimizeCPPositions.

Link last control point with previous. If true and the last border point is disabled, it moves with the previous one


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