Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Mean.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 __Mean_hh__
27 #define __Mean_hh__
28 
29 #include "Convolution.hh"
30 
31 #include <Base/Common/BIASpragmaStart.hh>
32 
33 namespace BIAS
34 {
35  /** @class Mean
36  @ingroup g_filter
37  @brief average mean filter
38 
39  @author woelk 09/2004 */
40  template <class InputStorageType, class OutputStorageType>
41  class BIASFilter_EXPORT Mean : public Convolution<InputStorageType, OutputStorageType>
42  {
43  public:
44  Mean();
46  ~Mean();
47 
48  /** @brief averages over a region with constant weights
49  @author woelk 09/2004 */
50  virtual int Filter(const Image<InputStorageType>& src,
52 
53  /** @brief only calls filter, for consistency of params */
54  virtual int FilterInt(const Image<InputStorageType>& src,
56 
57  /** @brief only calls filter, for consistency of params */
58  virtual int FilterFloat(const Image<InputStorageType>& src,
60 
62  { return new Mean<InputStorageType, OutputStorageType>(*this); }
63 
64  /** deprecated
65  @author woelk 09/2004 */
66  int FilterMean(const Image<InputStorageType>& src,
68 
69  /** dst width = src width - 1, dst height = src height - 1
70  @todo support for ROI is still missing.
71  @author woelk 01/2003 */
72  int FilterMean2x2(const Image<InputStorageType>& src,
74 
75  /** dst must be initialized:
76  dst width = src width - 1, dst height = src height - 1
77  Does support ROI. No specialization for integer data types.
78  @author woelk 09/2004 */
79  int FilterMean2x2Grey(const Image<InputStorageType>& src,
81 
82  /////////////////////////////////////////////////////////////////////////
83 
84  inline void SetSize(const int size) { _MeanSize=size; }
85  inline int GetSize() const { return _MeanSize; }
86 
87  protected:
88  int _MeanSize;
89 
90  /** sets the vector members of Convolution
91  @author woelk 09/2004 */
92  void _SetKernel();
93 
95 
96  virtual void GetBordersValid_(int &border_x, int &border_y) const;
97 
98  }; // class
99 
100 
101 
102 
103 } // namespace
104 
105 #include <Base/Common/BIASpragmaEnd.hh>
106 
107 #endif // __Mean_hh__
int _MeanSize
Definition: Mean.hh:88
generic convolution class.
Definition: Convolution.hh:66
void SetSize(const int size)
Definition: Mean.hh:84
base class for simple n-&gt;n filter implementations
Definition: FilterNToN.hh:43
int GetSize() const
Definition: Mean.hh:85
virtual FilterNToN< InputStorageType, OutputStorageType > * Clone() const
Definition: Mean.hh:61
average mean filter
Definition: Mean.hh:41