Image Component Library (ICL)
BilateralFilterOp.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/BilateralOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Tobias Roehlig **
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 <ICLFilter/UnaryOp.h>
34 #include <ICLUtils/Uncopyable.h>
35 #include <ICLCore/Img.h>
36 
37 namespace icl {
38 
39 namespace filter {
40 
49 
50 public:
51 
52  enum Mode {BEST, GPU, CPU};
53  enum Method {GAUSS, KUWAHARA};
57  BilateralFilterOp(Mode mode = BEST, Method method = GAUSS);
64  BilateralFilterOp(int radius, float sigma_s, float sigma_r, bool _use_lab = true, Mode mode = BEST, Method method = GAUSS);
66  virtual ~BilateralFilterOp();
67 
68  // We make use of the apply functions:
69  using UnaryOp::apply;
70 
80  void apply(const core::ImgBase *in, core::ImgBase **out) throw();
81 
83  void setRadius(int radius) { this->radius = radius; }
85  void setSigmaS(float sigmaS) { this->sigma_s = sigmaS; }
87  void setSigmaR(float sigmaR) { this->sigma_r = sigmaR; }
89  void setUseLAB(bool _use_lab) { this->use_lab = _use_lab; }
90 
91  int getRadius() { return this->radius; }
92  float getSigmaS() { return this->sigma_s; }
93  float getSigmaR() { return this->sigma_r; }
94 
95  core::Img32f const &getSumImg();
96 
97 protected:
98 
99  bool use_lab;
101  int radius;
103  float sigma_s;
105  float sigma_r;
108 
109 private:
110 
111  struct Impl;
112  struct GPUImpl;
113  struct CPUImpl;
114  Impl *impl;
115 
119  void init(Mode mode, Method method);
120 
121 };
122 
123 } // namespace filter
124 } // namespace icl
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
Method _method
Bilateral filter method used.
Definition: BilateralFilterOp.h:107
Mode
Definition: BilateralFilterOp.h:52
Method
Definition: BilateralFilterOp.h:53
void setSigmaR(float sigmaR)
Sets the sigma_r component.
Definition: BilateralFilterOp.h:87
void setRadius(int radius)
Sets the kernel radius.
Definition: BilateralFilterOp.h:83
Abstract Base class for Unary Operators.
Definition: UnaryOp.h:51
float getSigmaR()
Definition: BilateralFilterOp.h:93
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)
float getSigmaS()
Definition: BilateralFilterOp.h:92
bool use_lab
Definition: BilateralFilterOp.h:99
void setUseLAB(bool _use_lab)
Sets whether to use lab-color space or rgb.
Definition: BilateralFilterOp.h:89
int radius
Kernel radius.
Definition: BilateralFilterOp.h:101
float sigma_r
“Minimum” amplitude of an edge
Definition: BilateralFilterOp.h:105
#define ICLFilter_API
Definition: CompatMacros.h:175
Impl * impl
internal data type derived from Impl
Definition: BilateralFilterOp.h:113
void setSigmaS(float sigmaS)
Sets the sigma_s component.
Definition: BilateralFilterOp.h:85
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
BilateralFilterICL class Gaussian bilateral filtering Implements the gaussian bilateral filtering lik...
Definition: BilateralFilterOp.h:48
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
float sigma_s
Spatial extent of the kernel, size of the considered neighborhood.
Definition: BilateralFilterOp.h:103
int getRadius()
Definition: BilateralFilterOp.h:91