Image Component Library (ICL)
Fiducial.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 : ICLMarkers/src/ICLMarkers/Fiducial.h **
10 ** Module : ICLMarkers **
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 <ICLUtils/Point32f.h>
35 #include <ICLGeom/GeomDefs.h>
36 #include <ICLCV/ImageRegion.h>
37 
38 #include <bitset>
39 
40 namespace icl{
41  namespace markers{
42 
44  struct FiducialImpl;
45  struct FiducialDetectorPlugin;
49 
59 
60  public:
61 
62 
64 
65  enum Feature{
74  FeatureCount
75  };
76 
78 
80  typedef std::bitset<(int)FeatureCount> FeatureSet;
81 
83  static const FeatureSet AllFeatures;
84 
86 
92  struct KeyPoint{
94  inline KeyPoint(){}
95 
97  inline KeyPoint(const utils::Point32f &imagePos, const utils::Point32f &markerPos, int ID):
98  imagePos(imagePos),markerPos(markerPos),ID(ID){}
99 
102  int ID;
103  };
104 
106  inline Fiducial(FiducialImpl *impl=0):impl(impl){}
107 
109  int getID() const;
110 
112  std::string getName() const;
113 
115  bool supports(Feature f) const;
116 
118  const utils::Point32f &getCenter2D() const;
119 
121  const float &getRotation2D() const;
122 
124  const std::vector<utils::Point32f> &getCorners2D() const;
125 
127  const std::vector<KeyPoint> &getKeyPoints2D() const;
128 
130  const cv::ImageRegion getImageRegion() const;
131 
133  const geom::Vec &getCenter3D() const;
134 
136  const geom::Vec &getRotation3D() const;
137 
139  const geom::Mat &getPose3D() const;
140 
142  inline operator bool() const { return impl; }
143 
145  inline bool operator!() const { return isNull(); }
146 
148  inline bool isNull() const { return !impl; }
149 
151  inline bool operator==(const Fiducial &a) const { return impl == a.impl; }
152 
154  inline bool operator!=(const Fiducial &a) const{ return impl != a.impl; }
155 
157  inline FiducialImpl *getImpl() { return impl; }
158 
160  inline const FiducialImpl *getImpl() const { return impl; }
161 
163  FiducialDetectorPlugin *getDetector();
164 
166  const FiducialDetectorPlugin *getDetector() const;
167  };
168 
169 
172  s.set(f); return s;
173  }
174 
177  return s|f;
178  }
179 
182  Fiducial::FeatureSet s; s.reset(); s.set(f1); s.set(f2); return s;
183  }
184  } // namespace markers
185 }
186 
undocument this line if you encounter any issues!
Definition: Any.h:37
3D orientation information
Definition: Fiducial.h:73
Main class for detected image markers/fiducials.
Definition: Fiducial.h:56
associated image region
Definition: Fiducial.h:70
std::bitset<(int) FeatureCount > FeatureSet
FeatureSet class.
Definition: Fiducial.h:80
rotation in the image plain
Definition: Fiducial.h:67
const FiducialImpl * getImpl() const
returns the marker's internal implementation structure (const)
Definition: Fiducial.h:160
FiducialImpl * getImpl()
returns the marker's internal implementation structure
Definition: Fiducial.h:157
KeyPoint()
Default constructor (does nothing)
Definition: Fiducial.h:94
FiducialImpl * impl
hidden implementation (always managed by the parent MarkerDetector)
Definition: Fiducial.h:58
static const FeatureSet AllFeatures
a full feature set
Definition: Fiducial.h:83
3D orientation information
Definition: Fiducial.h:72
bool isNull() const
returns whether is marker has not been initialized
Definition: Fiducial.h:148
list of 2D points with corresponding marker coordinates
Definition: Fiducial.h:69
utils::Point32f imagePos
key point in image space
Definition: Fiducial.h:100
bool operator!() const
returns whether is marker has not been initialized
Definition: Fiducial.h:145
center in image coordinates
Definition: Fiducial.h:66
bool operator!=(const Fiducial &a) const
returns whether the fiducials have not the same impl
Definition: Fiducial.h:154
ImageRegion Structure providing region feature information.
Definition: ImageRegion.h:99
Feature
Currently supported feature types.
Definition: Fiducial.h:65
Fiducial::FeatureSet operator|(Fiducial::FeatureSet s, Fiducial::Feature f)
or operator for convenient creation of Fiducial::FeatureSet instances
Definition: Fiducial.h:171
Single precission 3D Vectors Point class of the ICL.
Definition: Point32f.h:41
3D center information
Definition: Fiducial.h:71
key point structure
Definition: Fiducial.h:92
KeyPoint(const utils::Point32f &imagePos, const utils::Point32f &markerPos, int ID)
Special constructor with given params.
Definition: Fiducial.h:97
Hidden implemetation for fiduical classes.
Definition: FiducialImpl.h:76
utils::Point32f markerPos
key point in marker space
Definition: Fiducial.h:101
list of corners
Definition: Fiducial.h:68
#define ICLMarkers_API
Definition: CompatMacros.h:180
int ID
key point ID
Definition: Fiducial.h:102
bool operator==(const Fiducial &a) const
returns whether the fiducials have the same impl
Definition: Fiducial.h:151
Fiducial(FiducialImpl *impl=0)
private Constructor
Definition: Fiducial.h:106
Generic Interface class for FiducialDetector plugins.
Definition: FiducialDetectorPlugin.h:49