Image Component Library (ICL)
QuadDetector.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/QuadDetector.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/Configurable.h>
35 #include <ICLUtils/Uncopyable.h>
36 #include <ICLCore/ImgBase.h>
37 #include <ICLCV/RegionDetector.h>
38 #include <vector>
39 
40 #include <ICLMarkers/TiltedQuad.h>
41 
42 namespace icl{
43  namespace markers{
44 
46 
63 
65  class Data;
66 
68  Data *data;
69 
70  public:
71 
72 
74  enum QuadColor{
77  BlackAndWhite
78  };
79 
81 
87  QuadDetector(QuadColor c = BlackOnly, bool dynamic=false,
88  float minQRating = 0.4);
89 
91  ~QuadDetector();
92 
94 
97  const std::vector<TiltedQuad> &detect(const core::ImgBase *image);
98 
100  const core::Img8u &getLastBinaryImage() const;
101 
102 
104  icl::cv::RegionDetector* getRegionDetector();
105 
106 
108  typedef std::vector<utils::Point32f> PVec;
109 
111  typedef std::vector<PVec> PVecVec;
112 
114  const PVecVec &getAllCorners() const;
115 
117  PVecVec &getAllCorners();
118 
120  const PVecVec &getLongestCorners() const;
121 
123  PVecVec &getLongestCorners();
124 
126  const PVecVec &getSecLongestCorners() const;
127 
129  PVecVec &getSecLongestCorners();
130 
132  const PVecVec &getInterCorners() const;
133 
135  PVecVec &getInterCorners();
136 
138  const PVecVec &getPerpCorners() const;
139 
141  PVecVec &getPerpCorners();
142 
144  const PVecVec &getMirrorCorners() const;
145 
147  PVecVec &getMirrorCorners();
148 
150  std::vector<utils::Point32f> computeCorners(const cv::ImageRegion &r) const;
151  };
152 
153 
155  ICLMarkers_API std::ostream &operator<<(std::ostream &s, const QuadDetector::QuadColor &c);
156 
158  ICLMarkers_API std::istream &operator>>(std::istream &s, QuadDetector::QuadColor &c);
159 
160 
161 
162  } // namespace markers
163 }
164 
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
Tool-class for detecting tilted quads in images.
Definition: QuadDetector.h:62
std::vector< PVec > PVecVec
internal typedef for vector of vector of points
Definition: QuadDetector.h:111
ICLMarkers_API std::ostream & operator<<(std::ostream &s, const DecodedBCHCode2D::Rotation &r)
ostream-operator for DecodedBCHCode2D::Rotation
std::vector< utils::Point32f > PVec
internal typedef for vector of points
Definition: QuadDetector.h:108
only quads that are black (default, value 0)
Definition: QuadDetector.h:75
only quads that are white (value 255)
Definition: QuadDetector.h:76
ImageRegion Structure providing region feature information.
Definition: ImageRegion.h:99
Complex utility class for detection of connected image components.
Definition: RegionDetector.h:179
Interface for classes that can be configured from configuration-files and GUI-Components.
Definition: Configurable.h:194
QuadColor
enum, that helps to specify what quads are searched in the threshold-result image
Definition: QuadDetector.h:74
#define ICLMarkers_API
Definition: CompatMacros.h:180
ICLMarkers_API std::istream & operator>>(std::istream &s, QuadDetector::QuadColor &c)
istream operator for QuadDetector::QuadColor instances
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
Data * data
Internal data pointer (hidden)
Definition: QuadDetector.h:65