Image Component Library (ICL)
Posit.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/Posit.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLGeom/GeomDefs.h>
35 #include <ICLUtils/Exception.h>
36 #include <ICLUtils/Point32f.h>
37 
38 namespace icl{
39  namespace geom{
40 
42  class Camera;
45 
65  struct Data;
66  Data *data;
67 
68  public:
70  Posit(int maxIterations=100, float minDelta=0.001);
71 
73  Posit(const std::vector<Vec> &modelPoints, int maxIterations=100, float minDelta=0.001);
74 
76  ~Posit();
77 
79  Posit(const Posit &other);
80 
82  Posit &operator=(const Posit &other);
83 
85  void setModel(const std::vector<Vec> &modelPoints);
86 
88  void setMaxIterations(int maxIterations);
89 
91  void setMinDelta(float minDelta);
92 
94  int getMaxIterations() const;
95 
97  float getMinDelta() const;
98 
100  const std::vector<Vec> &getModel() const;
101 
103  struct ICLGeom_API Result : public Mat{
104  friend struct Posit::Data;
105  private:
107  inline Result():Mat(0.0){}
109  inline Result(float r00, float r10, float r20, float tx,
110  float r01, float r11, float r21, float ty,
111  float r02, float r12, float r22, float tz):
112  Mat(r00,r10,r20,tx,r01,r11,r21,ty,r02,r12,r22,tz,0,0,0,1){}
113 
114  public:
116  math::FixedColVector<float,3> getAngles() const;
117 
119  math::FixedColVector<float,3> getTranslation() const;
120  };
121 
123  const Result &findPose(const std::vector<utils::Point32f> &imagePoints, const Camera &cam) ;
124 
126 
144  const Result &findPose(const std::vector<utils::Point32f> &imagePoints,
145  const utils::Point &principlePointOffset,
146  float focalLengthX, float focalLengthY) ;
147  };
148 
149  } // namespace geom
150 }
151 
Result(float r00, float r10, float r20, float tx, float r01, float r11, float r21, float ty, float r02, float r12, float r22, float tz)
private Konstructor
Definition: Posit.h:109
undocument this line if you encounter any issues!
Definition: Any.h:37
result type (basically a 4x4 homogeneous transformation matrix)
Definition: Posit.h:103
#define ICLGeom_API
Definition: CompatMacros.h:179
Data * data
internal data storage class
Definition: Posit.h:65
Camera class.
Definition: Camera.h:132
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
Result()
private Konstructor
Definition: Posit.h:107
Implementation of the posit algorithm for 6D pose detection from a single camera.
Definition: Posit.h:64