Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Private Attributes
icl::geom::Posit Class Reference

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

#include <Posit.h>

List of all members.

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

Private Attributes

Data * data
 internal data storage class

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

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

creates new posit instance with optionally given termination criterions

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

creates new posit with given model points

Destructor.

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

Copy constructor (all internal data is simply copied deeply)


Member Function Documentation

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

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

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

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.

returns the current max-iterations termination criterion

returns the current min-delta termination criterion

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

returns the current model points

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

assignment operator (all internal data is simply copied deeply)

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

sets the max-iterations termination criterion

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

sets the min-delta termination criterion

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

sets new model points


Member Data Documentation

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

internal data storage class

internal data storage


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines