Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Morphology.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 __Morphology_hh__
27 #define __Morphology_hh__
28 
29 #include "./FilterBase.hh"
30 #include <Base/Image/Image.hh>
31 
32 namespace BIAS {
33  /** @class Morphology
34  @ingroup g_filter
35  @brief base class for Erosion, Dilation, and single Deletion
36 
37  @author grest, Oct. 2004
38  */
39 
40  template <class InputStorageType, class OutputStorageType>
41  class BIASFilter_EXPORT Morphology : public FilterBase<InputStorageType, OutputStorageType>
42  {
43  public:
44  Morphology();
46  virtual ~Morphology();
47 
48  /// fills the XBorderSize respectivly YBorderSize nearest
49  /// Pixels to picture border with Value
50  /// XBorderSize defines the border parallel to the x axis
51  int FillBorderConst(Image<OutputStorageType>& Image,
52  unsigned short int XBorderSize,
53  unsigned short int YBorderSize,
54  OutputStorageType Value);
55 
56  inline void SetKernelSize(int size) { kernelSize_=size; }
57 
58  /** Very fast deletion of pixels with no neighbours.
59  All values, which are not zero, are treated as foreground.
60  The border of one pixel is always deleted (set to zero).
61  default is 8-neighborhood.
62  src and dest must NOT be the same!
63  @author Daniel Grest, Sept. 2002
64  @status tested */
65  //int DeleteSingles(Image<unsigned char>& src,
66  // Image<unsigned char>& dest,
67  // bool Neighbor4=false);
68  protected:
69 
70  /// pointer into param object, determines influence region size
72 
73  }; // class
74 
75 
76 } // namespace
77 
78 
79 #endif // __Morphology_hh__
int kernelSize_
Very fast deletion of pixels with no neighbours.
Definition: Morphology.hh:71
virtual parent class for API definition of all (future) filters
Definition: FilterBase.hh:77
base class for Erosion, Dilation, and single Deletion
Definition: Morphology.hh:41
void SetKernelSize(int size)
Definition: Morphology.hh:56