ImFusion SDK 4.3
PoseGraphOptimization Class Reference

#include <ImFusion/Vision/PoseGraphOptimization.h>

Pose graph optimization The first pose is the reference pose and will stay fixed, all other poses are free to change. More...

+ Inheritance diagram for PoseGraphOptimization:

Detailed Description

Pose graph optimization The first pose is the reference pose and will stay fixed, all other poses are free to change.

Classes

struct  Constraint
 Constraints between nodes, i.e. relative poses between them. More...
 

Public Member Functions

bool addPose (const int &id, const mat4 &T, bool fixed=false)
 Add node with given pose. Returns false when node already existed. In this case the pose is not updated.
 
std::map< int, mat4 > poses () const
 Return map of all poses (nodes) with their ids.
 
bool addConstraint (const Constraint &constraint)
 Add constraint between nodes. Nodes must exist. Returns false when constraint was not added.
 
bool addConstraint (const int &from, const int &to, const mat4 &T, const mat6 &information)
 Add constraint between nodes. Nodes must exist. Returns false when constraint was not added.
 
std::vector< Constraintconstraints () const
 Get the set of constraints.
 
void setMaximumIterations (int maxIter)
 Set maximum number of iterations to run the optimizer for.
 
int maximumIterations () const
 Get the maximum number of iteration to run the optimizer for.
 
void setGainThreshold (double gainThreshold)
 Set error improvement across iterations below which to abort the optimization.
 
double gainThreshold () const
 Get error improvement across iterations below which to abort the optimization.
 
bool isComplete ()
 Tests whether the pose graph is complete, i.e. there is only one connected component.
 
int numConnectedComponents ()
 Gives the number of independed components of the added graph by applying Disjoint Set Union to search for the number of connected components.
 
std::vector< int > connectedComponents ()
 Gives an index for each pose/node indicating to which component the pose/node belongs (Disjoint Set Union)
 
virtual bool compute ()
 Run pose graph optimization.
 

Protected Member Functions

int traceParents (int *parent, int x) const
 Traces back to the parent of a node in a graph; used by numConnectedComponents.
 
std::vector< int > computeAllParents () const
 

Protected Attributes

int m_maxIter = 400
 Number of iteration to run the optimizer for.
 
double m_gainThreshold = 1e-2
 Multiplicative error improvement to abort optimization.
 
std::vector< mat4 > m_poses
 Pose defined as transformation matrix relative to the global-frame.
 
std::vector< bool > m_fixed
 Specifies whether pose should be optimized.
 
std::unordered_map< int, int > m_origToConsecutivePoseIds
 Maps original id of a pose to its consecutive place in the computation sets (which we enforce to be consecutive from 0 to N)
 
std::vector< Constraintm_constraints
 Relative poses.
 

Member Function Documentation

◆ compute()

virtual bool compute ( )
inlinevirtual

Run pose graph optimization.

Reimplemented in LeastSquaresPoseGraphSolution, and MotionAveragingPoseGraphSolution.


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