Image Component Library (ICL)
CoplanarPointPoseEstimator.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/CoplanarPointPoseEstimator.h **
10 ** Module : ICLGeom **
11 ** Authors: Christof Elbrechter, Sergius Gaulik **
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 <ICLMath/FixedMatrix.h>
35 #include <ICLUtils/Point32f.h>
36 #include <ICLUtils/Configurable.h>
37 
38 namespace icl{
39  namespace geom{
40 
42  class Camera;
46 
99 
101  struct Data;
102 
104  Data *data;
105 
107  void propertyChangedCallback(const Property &p);
108 
109 #if !(defined ICL_MSC_VER && ICL_MSC_VER < 1800)
110  void robustPoseCorrection(int n, const utils::Point32f *modelPoints,
112  const utils::Point32f *normalizedImagePoints);
113 #endif
114 
115  public:
116 
120  worldFrame
121  };
122 
124 
132  };
133 
135  struct RANSACSpec{
136  bool useRANSAC;
140 
142 
145 
147 
148  RANSACSpec(bool useRANSAC = false, int numPointsForModel = 4, int numRandomCycles=20,
149  float maxPointProjectionDistance = 10.0f,
150  PoseEstimationAlgorithm poseEstimationDuringSampling = HomographyBasedOnly):
151  useRANSAC(useRANSAC), numPointsForModel(numPointsForModel),numRandomCycles(numRandomCycles),
152  maxPointProjectionDistance(maxPointProjectionDistance),
153  poseEstimationDuringSampling(poseEstimationDuringSampling){}
154  };
155 
157 
164  CoplanarPointPoseEstimator(ReferenceFrame returnedPosesReferenceFrame=worldFrame,
165  PoseEstimationAlgorithm a = SimplexSampling,
166  const RANSACSpec &spec = RANSACSpec());
167 
170 
173 
176 
178  ReferenceFrame getReferenceFrame() const;
179 
181  void setReferenceFrame(ReferenceFrame f);
182 
184 
190  math::FixedMatrix<float,4,4> getPose(int n, const utils::Point32f *modelPoints,
191  const utils::Point32f *imagePoints, const Camera &cam);
192 
193  private:
195  math::FixedMatrix<float,4,4> getPoseInternal(PoseEstimationAlgorithm a, int n,
196  const utils::Point32f *modelPoints,
197  const utils::Point32f *imagePoints,
198  const utils::Point32f *normalizedImagePoints,
199  const Camera &cam);
200  };
201  } // namespace geom
202 }
203 
uses custom properties to define sampling parameters for brute force sampling
Definition: CoplanarPointPoseEstimator.h:131
Powerful and highly flexible matrix class implementation.
Definition: FixedMatrix.h:172
PoseEstimationAlgorithm
Algorithm, that is used for pose-estimation.
Definition: CoplanarPointPoseEstimator.h:125
undocument this line if you encounter any issues!
Definition: Any.h:37
poses are returned w.r.t. the camera frame
Definition: CoplanarPointPoseEstimator.h:119
uses the above described algorithm (Algorithms) only
Definition: CoplanarPointPoseEstimator.h:126
performs simplex sampling for optimization (very fast and very accurate!
Definition: CoplanarPointPoseEstimator.h:127
float maxPointProjectionDistance
maximun distance of model points to be in the consensus set
Definition: CoplanarPointPoseEstimator.h:139
#define ICLGeom_API
Definition: CompatMacros.h:179
ReferenceFrame
Reference frame enumeration.
Definition: CoplanarPointPoseEstimator.h:118
bool useRANSAC
enables/disables RANSAC (if disabled, the other parameters are obsolete)
Definition: CoplanarPointPoseEstimator.h:136
int numRandomCycles
number of RANSAC cycles performed
Definition: CoplanarPointPoseEstimator.h:138
Camera class.
Definition: Camera.h:132
PoseEstimationAlgorithm poseEstimationDuringSampling
poseestimation algorithm that is used during the RANSAC sampling
Definition: CoplanarPointPoseEstimator.h:144
RANSACSpec(bool useRANSAC=false, int numPointsForModel=4, int numRandomCycles=20, float maxPointProjectionDistance=10.0f, PoseEstimationAlgorithm poseEstimationDuringSampling=HomographyBasedOnly)
Constructor with given parameters and defaults.
Definition: CoplanarPointPoseEstimator.h:148
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
use some predefined sampling parameters for brute force coase sampling (fast)
Definition: CoplanarPointPoseEstimator.h:128
use some predefined sampling parameters for brute force fine sampling (slow)
Definition: CoplanarPointPoseEstimator.h:130
Interface for classes that can be configured from configuration-files and GUI-Components.
Definition: Configurable.h:194
Data * data
Internally used data pointer.
Definition: CoplanarPointPoseEstimator.h:101
Utility class that allows for 6D pose estimation from a set of at least 4 coplanar points.
Definition: CoplanarPointPoseEstimator.h:98
use some predefined sampling parameters for brute force medium sampling (average speed)
Definition: CoplanarPointPoseEstimator.h:129
Represents a single property.
Definition: Configurable.h:200
Parameter struct that is used to specify optional RANSAC parameters for the internal pose estimation.
Definition: CoplanarPointPoseEstimator.h:135
int numPointsForModel
number of points used for finding initial models
Definition: CoplanarPointPoseEstimator.h:137