Image Component Library (ICL)
LensUndistortionCalibrator.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/LensUndistortionCalibrator.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 #pragma once
31 
32 #include <ICLUtils/Point32f.h>
33 #include <ICLUtils/Uncopyable.h>
34 #include <ICLUtils/Size.h>
35 #include <ICLUtils/Size32f.h>
36 
38 
39 #include <vector>
40 
41 namespace icl{
42 
43  namespace cv{
44 
46 
54  struct Data;
55  Data *m_data;
56 
57  public:
58 
60  struct ICLCV_API GridDefinition : public std::vector<utils::Point32f>{
61 
64 
66  GridDefinition(const utils::Size &dims, const utils::Size32f &size);
67 
69  GridDefinition(const utils::Size &markerGridDims,
70  const utils::Size32f &markerSize,
71  const utils::Size32f &markerSpacing);
72 
74  GridDefinition(const utils::Size &markerGridDims, float markerDim, float markerSpacing);
75 
77  const utils::Size32f &getGridBoundarySize() const { return m_gridBoundarySize; }
78 
79  private:
82  };
83 
85  struct Info{
90  };
91 
92 
95 
97  LensUndistortionCalibrator(const utils::Size &imagesSize, const GridDefinition &gridDef);
98 
101 
103  void init(const utils::Size &imagesSize, const GridDefinition &gridDef);
104 
106  void init(const utils::Size &imageSize);
107 
109  bool isNull() const;
110 
112  void addPoints(const std::vector<utils::Point32f> &imagePoints);
113 
115  void addPoints(const std::vector<utils::Point32f> &imagePoints, const std::vector<utils::Point32f> &gridDef);
116 
118  void clear();
119 
121 
122  void undoLast();
123 
125  Info getInfo();
126 
128  io::ImageUndistortion computeUndistortion();
129 
130  };
131  }
132 
133 }
const GridDefinition & gridDef
current grid definition
Definition: LensUndistortionCalibrator.h:89
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
int numPointsAdded
total number of points added
Definition: LensUndistortionCalibrator.h:87
Internally used info structure (also returned by LensUndistortionCalibrator::getInfo)
Definition: LensUndistortionCalibrator.h:85
Utility data class describing the grid structure that is used.
Definition: LensUndistortionCalibrator.h:60
Utility class for estimation of compensation parameters of lens-distortion.
Definition: LensUndistortionCalibrator.h:53
utils::Size32f m_gridBoundarySize
outer physical size of the used grid
Definition: LensUndistortionCalibrator.h:81
#define ICLCV_API
Definition: CompatMacros.h:177
int numPointSetsAdded
number of sub-sets added
Definition: LensUndistortionCalibrator.h:88
Size class of the ICL.
Definition: Size.h:61
GridDefinition()
creates an empty grid definition
Definition: LensUndistortionCalibrator.h:63
Data * m_data
internal data
Definition: LensUndistortionCalibrator.h:54
const utils::Size32f & getGridBoundarySize() const
returns the outer physical size of the used grid
Definition: LensUndistortionCalibrator.h:77
Size32f class of the ICL (float valued)
Definition: Size32f.h:40
Definition: ImageUndistortion.h:39
utils::Size imageSize
current camera image size
Definition: LensUndistortionCalibrator.h:86