Image Component Library (ICL)
ObjectEdgeDetectorCPU.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/ObjectEdgeDetectorCPU.h **
10 ** Module : ICLGeom **
11 ** Authors: Andre Ueckermann **
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 
32 //Please use the ObjectEdgeDetector Class.
33 //This is the CPU implementation of the interface.
34 
35 #pragma once
36 
38 
39 namespace icl{
40  namespace geom{
41 
42  struct Vec4 {
43  inline Vec4() {
44  }
45  inline Vec4(float x, float y, float z, float w) :
46  x(x), y(y), z(z), w(w) {
47  }
48  float x, y, z, w;
49  };
50 
51  class ICLGeom_API ObjectEdgeDetectorCPU : public ObjectEdgeDetectorPlugin{
52 
53  struct Data;
54  Data *m_data;
55 
56  public:
57 
59 
61  ObjectEdgeDetectorCPU();
62 
64  virtual ~ObjectEdgeDetectorCPU();
65 
67 
73  const core::Img8u &calculate(const core::Img32f &depthImage, bool filter, bool average, bool gauss);
74 
76 
77  void setDepthImage(const core::Img32f &depthImg);
78 
80 
81  void applyMedianFilter();
82 
84 
85  const core::Img32f &getFilteredDepthImage();
86 
88 
90  void setFilteredDepthImage(const core::Img32f &filteredImg);
91 
93 
95  void applyNormalCalculation();
96 
98 
102  void applyLinearNormalAveraging();
103 
105 
111  void applyGaussianNormalSmoothing();
112 
114 
115  const core::DataSegment<float,4> getNormals();
116 
118 
119  void applyWorldNormalCalculation(const Camera &cam);
120 
122 
123  const core::DataSegment<float,4> getWorldNormals();
124 
126 
127  const core::Img8u &getRGBNormalImage();
128 
130 
132  void setNormals(core::DataSegment<float,4> pNormals);
133 
135 
137  void applyAngleImageCalculation();
138 
140 
141  const core::Img32f &getAngleImage();
142 
144 
146  void setAngleImage(const core::Img32f &angleImg);
147 
149 
150  void applyImageBinarization();
151 
153 
154  const core::Img8u &getBinarizedAngleImage();
155 
157 
159  void setMedianFilterSize(int size);
160 
162 
164  void setNormalCalculationRange(int range);
165 
167 
168  void setNormalAveragingRange(int range);
169 
171 
173  void setAngleNeighborhoodMode(int mode);
174 
176 
178  void setAngleNeighborhoodRange(int range);
179 
181 
184  void setBinarizationThreshold(float threshold);
185 
187 
189  void setUseNormalAveraging(bool use);
190 
192 
194  void setUseGaussSmoothing(bool use);
195 
197 
199  bool isCLReady();
200 
201  void initialize(utils::Size size);
202 
203 
204  private:
205 
206  float scalar(math::FixedColVector<float,4> &a, math::FixedColVector<float,4> &b);
207  float flipAngle(float angle);
208  float scalarAndFlip(math::FixedColVector<float,4> &a, math::FixedColVector<float,4> &b);
209  float maxAngle(float snr, float snl, float snt, float snb,
210  float snbl, float snbr, float sntl, float sntr);
211 
212  };
213  }
214 }
215 
undocument this line if you encounter any issues!
Definition: Any.h:37
FixedColVector< icl32f, 4 > Vec4
another shortcut for 3D vectors
Definition: HomogeneousMath.h:43
#define ICLGeom_API
Definition: CompatMacros.h:179
Img< icl8u > Img8u
typedef for 8bit integer images
Definition: Types.h:42
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
Img< icl32f > Img32f
typedef for 32bit float images
Definition: Types.h:54