Image Component Library (ICL)
Classes | Public Member Functions | Private Attributes | List of all members
icl::geom::Posit Class Reference

Implementation of the posit algorithm for 6D pose detection from a single camera. More...

#include <Posit.h>

Classes

struct  Result
 result type (basically a 4x4 homogeneous transformation matrix) More...
 

Public Member Functions

 Posit (int maxIterations=100, float minDelta=0.001)
 creates new posit instance with optionally given termination criterions More...
 
 Posit (const std::vector< Vec > &modelPoints, int maxIterations=100, float minDelta=0.001)
 creates new posit with given model points More...
 
 ~Posit ()
 Destructor. More...
 
 Posit (const Posit &other)
 Copy constructor (all internal data is simply copied deeply) More...
 
Positoperator= (const Posit &other)
 assignment operator (all internal data is simply copied deeply) More...
 
void setModel (const std::vector< Vec > &modelPoints)
 sets new model points More...
 
void setMaxIterations (int maxIterations)
 sets the max-iterations termination criterion More...
 
void setMinDelta (float minDelta)
 sets the min-delta termination criterion More...
 
int getMaxIterations () const
 returns the current max-iterations termination criterion More...
 
float getMinDelta () const
 returns the current min-delta termination criterion More...
 
const std::vector< Vec > & getModel () const
 returns the current model points More...
 
const ResultfindPose (const std::vector< utils::Point32f > &imagePoints, const Camera &cam)
 main function to obtain an objects pose from given image points and camera More...
 
const ResultfindPose (const std::vector< utils::Point32f > &imagePoints, const utils::Point &principlePointOffset, float focalLengthX, float focalLengthY)
 utility wrapper if no whole camera is available More...
 

Private Attributes

Data * data
 internal data storage class More...
 

Detailed Description

Implementation of the posit algorithm for 6D pose detection from a single camera.

General Information

The POSIT algorithm allows for 6D object pose detection using a single camera. POSIT needs an indexed set of model-points (in the model coordinate frame). In the detection step, also a set of corresponding image coordinates are needed. POSIT runs iteratively to find an optimal object pose.

We implement the 'modern' POSIT algorithm, which internally uses another norm as the 'classic' POSIT algorithm, both can easily be found in literature.

Restrictions

Please note, that POSIT needs non-coplanar model points. If the model points are complanar (or even almost coplanar), pose estimation results are undefined. TODO find heuristik for this or add another algorithm ...

The Segmentation Algorithm

The algorithm is well described in the paper "Model-based object pose in 25 lines of code" written by Dementhon and Davis in 1995

Constructor & Destructor Documentation

◆ Posit() [1/3]

icl::geom::Posit::Posit ( int  maxIterations = 100,
float  minDelta = 0.001 
)

creates new posit instance with optionally given termination criterions

◆ Posit() [2/3]

icl::geom::Posit::Posit ( const std::vector< Vec > &  modelPoints,
int  maxIterations = 100,
float  minDelta = 0.001 
)

creates new posit with given model points

◆ ~Posit()

icl::geom::Posit::~Posit ( )

Destructor.

◆ Posit() [3/3]

icl::geom::Posit::Posit ( const Posit other)

Copy constructor (all internal data is simply copied deeply)

Member Function Documentation

◆ findPose() [1/2]

const Result& icl::geom::Posit::findPose ( const std::vector< utils::Point32f > &  imagePoints,
const Camera cam 
)

main function to obtain an objects pose from given image points and camera

◆ findPose() [2/2]

const Result& icl::geom::Posit::findPose ( const std::vector< utils::Point32f > &  imagePoints,
const utils::Point principlePointOffset,
float  focalLengthX,
float  focalLengthY 
)

utility wrapper if no whole camera is available

Please note, that the focal lenghts have to be combined with a cameras x- and y-sampling-resolution in order to get valid focal length values. In other words given focal length have to be relative to an x- and y-sampling-resolution of 1.0. Therefore, the given focal length might sometimes be in range [500,...] event though the used camera has a default focal lenght of e.g. [10-55] mm.

For ICL's icl::Camera type, the focal length values are computed as follows:

utils::Point32f principlePointOffset = cam.getPrincipalPointOffset();
float focalLengthX = cam.getFocalLength()*cam.getSamplingResolutionX();
float focalLEngthY = cam.getFocalLength()*cam.getSamplingResolutionY();

However, if you already have an instance of icl::Camera in your code, you can simply use Posit::findPose(const std::vector<utils::Point32f> &, const icl::Camera&), which automatically extracts the correct focal length and principal point offset values from the given icl::Camera instance.

◆ getMaxIterations()

int icl::geom::Posit::getMaxIterations ( ) const

returns the current max-iterations termination criterion

◆ getMinDelta()

float icl::geom::Posit::getMinDelta ( ) const

returns the current min-delta termination criterion

◆ getModel()

const std::vector<Vec>& icl::geom::Posit::getModel ( ) const

returns the current model points

◆ operator=()

Posit& icl::geom::Posit::operator= ( const Posit other)

assignment operator (all internal data is simply copied deeply)

◆ setMaxIterations()

void icl::geom::Posit::setMaxIterations ( int  maxIterations)

sets the max-iterations termination criterion

◆ setMinDelta()

void icl::geom::Posit::setMinDelta ( float  minDelta)

sets the min-delta termination criterion

◆ setModel()

void icl::geom::Posit::setModel ( const std::vector< Vec > &  modelPoints)

sets new model points

Member Data Documentation

◆ data

Data* icl::geom::Posit::data
private

internal data storage class

internal data storage


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