Image Component Library (ICL)
LocalThresholdOp.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 : ICLFilter/src/ICLFilter/LocalThresholdOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Christof Elbrechter, Andre Justus **
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/Uncopyable.h>
35 #include <ICLUtils/Size.h>
36 #include <ICLFilter/UnaryOp.h>
37 #include <vector>
38 
39 namespace icl{
40  namespace filter{
41 
43  class IntegralImgOp;
44  class UnaryCompareOp;
45  class BinaryCompareOp;
48 
166  public:
167 
169  enum algorithm{
173  global
174  };
175 
177 
183  LocalThresholdOp(unsigned int maskSize=10, float globalThreshold=0, float gammaSlope=0);
184 
185 
187  LocalThresholdOp(algorithm a, int maskSize=10, float globalThreshold=0, float gammaSlope=0);
188 
189 
191  ~LocalThresholdOp();
192 
194 
197  virtual void apply(const core::ImgBase *src, core::ImgBase **dst);
198 
200  using UnaryOp::apply;
201 
203  void setMaskSize(unsigned int maskSize);
204 
206  void setGlobalThreshold(float globalThreshold);
207 
209  void setGammaSlope(float gammaSlope);
210 
212  void setup(unsigned int maskSize, float globalThreshold, algorithm a=regionMean, float gammaSlope=0);
213 
215  unsigned int getMaskSize() const;
216 
218  float getGlobalThreshold() const;
219 
221  float getGammaSlope() const;
222 
224  algorithm getAlgorithm() const ;
225 
227  void setAlgorithm(algorithm a);
228 
229  private:
230 
232  template<algorithm a>
233  void apply_a(const core::ImgBase *src, core::ImgBase **dst);
234 
236  // property unsigned int m_maskSize;
237 
239  // property float m_globalThreshold;
240 
242  // property float m_gammaSlope;
243 
246 
249 
252 
255 
258 
261 
264 
265  };
266 
267  } // namespace filter
268 }
algorithm
Internally used algorithm.
Definition: LocalThresholdOp.h:169
tiled threshold with nearest neighbour interpolation
Definition: LocalThresholdOp.h:171
core::ImgBase * m_roiBufDst
output ROI buffer image for ROI support
Definition: LocalThresholdOp.h:248
Class for comparing two images pixel-wise.
Definition: BinaryCompareOp.h:45
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
regionMean threshold calculation
Definition: LocalThresholdOp.h:170
core::ImgBase * m_roiBufSrc
mask size
Definition: LocalThresholdOp.h:245
tiled threshold with linear interpolation
Definition: LocalThresholdOp.h:172
core::ImgBase * m_tiledBuf2
second buffer for tiledXXX algorithsm
Definition: LocalThresholdOp.h:263
Abstract Base class for Unary Operators.
Definition: UnaryOp.h:51
LocalThreshold Filter class.
Definition: LocalThresholdOp.h:165
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)
BinaryCompareOp * m_cmp
BinaryCompareOp for tiledXXX algorithms.
Definition: LocalThresholdOp.h:257
#define ICLFilter_API
Definition: CompatMacros.h:175
core::ImgBase * m_tiledBuf1
first buffer for tiledXXX algorithsm
Definition: LocalThresholdOp.h:260
IntegralImgOp * m_iiOp
IntegralImgOp for RegionMean algorithm.
Definition: LocalThresholdOp.h:251
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
class for creating integral images
Definition: IntegralImgOp.h:98