Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GradientGauss.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 #ifndef __GradientGauss_hh__
27 #define __GradientGauss_hh__
28 
29 #include "FilterNTo2N.hh"
30 #include "Convolution.hh"
31 
32 #include <Base/Math/Vector3.hh>
33 
34  // the debugfasgs are defined in Convolution.hh
35  // #define D_GRADGAUSS_KERNEL 0x00000001
36 
37 namespace BIAS {
38 
39  /** @class GradientGauss
40  @ingroup g_filter
41  @brief gradient calculation with separated gauss masks
42  @author woelk 09/2004 */
43  template <class InputStorageType, class OutputStorageType>
44  class BIASFilter_EXPORT GradientGauss : public FilterNTo2N<InputStorageType, OutputStorageType>
45  {
46  public:
47  GradientGauss();
49  virtual ~GradientGauss();
50 
51  /** returns a 2 channel image containig gx and gy
52  @author woelk 12/2004, untested */
53  virtual int Filter(const Image<InputStorageType>& src,
55 
56  virtual int Filter(const Image<InputStorageType>& src,
59 
60  virtual int Filter(const Image<InputStorageType>& src,
64 
67 
68  ////////////////////////////////////////////////////////////////////////
69 
70  inline void SetGradGaussSigma(const double sigma)
71  { _GradGaussSigma=sigma; }
72 
73  inline double GetGradGaussSigma() const { return _GradGaussSigma; }
74 
75  inline void SetGradGaussRatio(const double ratio)
76  { _GradGaussRatio=ratio; }
77 
78  inline double GetGradGaussRatio() const { return _GradGaussRatio; }
79 
80  inline void PrintKernel() const
81  { _Conv.PrintKernel(); }
82 
83  protected:
84  /// the parameters
85  double _GradGaussSigma, _GradGaussRatio;
86  /// the parameters at the time of the last call
87  double _LastSigma, _LastRatio;
88  /// computation object to execute the convolution
90 
91  /** Fills _HVec with gaussian function and _VVec with derivative of
92  gaussian function with standard deviation Sigma. The size of _HVec
93  and _VVec is calculated by using Ration. The Gaussian function is
94  truncated, when the ration between biggest and smalles entry falls
95  below Ratio.
96  @author woelk 09/2004 */
97  void _CalculateKernels(double Sigma, double Ratio);
98 
99  virtual void GetBordersValid_(int& border_x, int &border_y) const;
100 
101  }; // class
102 
103 
104 } // namsepace
105 
106 #endif // __GradientGauss_hh__
gradient calculation with separated gauss masks
generic convolution class.
Definition: Convolution.hh:66
void PrintKernel() const
void SetGradGaussRatio(const double ratio)
void SetGradGaussSigma(const double sigma)
base class for simple n-&gt;2n filter implementations
Definition: FilterNTo2N.hh:44
virtual FilterNTo2N< InputStorageType, OutputStorageType > * Clone() const
double _GradGaussSigma
the parameters
Convolution< InputStorageType, OutputStorageType > _Conv
computation object to execute the convolution
double _LastSigma
the parameters at the time of the last call
double GetGradGaussSigma() const
double GetGradGaussRatio() const