Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Dilation.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 #ifndef _BIAS_MOPRH_DILATION_HH_
25 #define _BIAS_MOPRH_DILATION_HH_
26 #include "./Morphology.hh"
27 
28 namespace BIAS {
29 
30 /** @class Dilation
31  @ingroup g_filter
32  @brief Dilation operator for binary images (black and white)
33 
34  Dilation sets all pixel to 255, which have a neighboring pixel !=0
35  It is also possible to dilate the image with a real grey-value image with
36  Dilate3Fast().
37  Fastest ist TBH_valid and kernelsize=3
38  or call Dilate3Fast() directly.
39  @author grest, Oct. 2004
40  */
41 
42 template <class InputStorageType, class OutputStorageType>
43 class BIASFilter_EXPORT Dilation : public Morphology<InputStorageType, OutputStorageType>
44 {
45  public:
46  Dilation() {}
48  virtual ~Dilation() {}
49 
50  /** Does the dilation. ROI ignored, but set if TBH_valid
51  */
52  virtual int Filter(const Image<InputStorageType>& src,
54 
55  /** dilate with square kernel filled with 255
56  @author Felix Woelk (22/04/2002)
57  @status alpha */
58  int Dilate(const Image<InputStorageType>& Source,
59  Image<OutputStorageType>& Destination,
60  int KernelSize = 3);
61 
62  /** Very fast dilate with 3x3 mask, all values, which are not
63  not zero, are treated as foreground.
64  The src img is dilated with pixels from orig.
65  Therefore src and orig MUST NOT be the same,
66  set orig to a 255 image if u have no original grey image.
67  The border of one pixel is always deleted (set to zero).
68  default is 8-neighborhood.
69  src and dest must NOT be the same!
70  @author Daniel Grest, Sept. 2002
71  @status tested */
72  int Dilate3Fast(const Image<InputStorageType>& src,
73  const Image<InputStorageType>& orig,
75  bool Neighbor4=false);
76 
77  /** Very fast dilate with 3x3 mask, all values, which are not
78  not zero, are treated as foreground.
79  src and dest must NOT be the same!
80  @author woelk, grest 04/2006 */
81  int Dilate3Fast(const Image<InputStorageType>& src,
83  bool Neighbor4 = false);
84 
85  /** @brief If DilateLower=true then the lower value (except 0) overwrites
86  * the higher otherwise the standard algorithm (higher value
87  * overrides lower) is done.
88  * @ author streckel 10/06 */
89  void SetDilateLower(bool dl) {
90  DilateLower_ = dl; }
91 
92  protected:
93  virtual void GetBordersValid_(int& border_x, int& border_y) const;
94 
100 
102 };
103 
104 } // namespace
105 #endif
106 
void SetDilateLower(bool dl)
If DilateLower=true then the lower value (except 0) overwrites the higher otherwise the standard algo...
Definition: Dilation.hh:89
Dilation operator for binary images (black and white)
Definition: Dilation.hh:43
bool DilateLower_
Definition: Dilation.hh:101
virtual ~Dilation()
Definition: Dilation.hh:48
base class for Erosion, Dilation, and single Deletion
Definition: Morphology.hh:41