iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Morphology.H
Go to the documentation of this file.
1 /*! @file
2  @author Pezhman Firoozfam
3  @copyright GNU Public License (GPL v3)
4  @section License
5  @verbatim
6  // ////////////////////////////////////////////////////////////////////////
7  // The iLab Neuromorphic Robotics Toolkit (NRT) //
8  // Copyright 2010-2012 by the University of Southern California (USC) //
9  // and the iLab at USC. //
10  // //
11  // iLab - University of Southern California //
12  // Hedco Neurociences Building, Room HNB-10 //
13  // Los Angeles, Ca 90089-2520 - USA //
14  // //
15  // See http://ilab.usc.edu for information about this project. //
16  // ////////////////////////////////////////////////////////////////////////
17  // This file is part of The iLab Neuromorphic Robotics Toolkit. //
18  // //
19  // The iLab Neuromorphic Robotics Toolkit is free software: you can //
20  // redistribute it and/or modify it under the terms of the GNU General //
21  // Public License as published by the Free Software Foundation, either //
22  // version 3 of the License, or (at your option) any later version. //
23  // //
24  // The iLab Neuromorphic Robotics Toolkit is distributed in the hope //
25  // that it will be useful, but WITHOUT ANY WARRANTY; without even the //
26  // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR //
27  // PURPOSE. See the GNU General Public License for more details. //
28  // //
29  // You should have received a copy of the GNU General Public License //
30  // along with The iLab Neuromorphic Robotics Toolkit. If not, see //
31  // <http://www.gnu.org/licenses/>. //
32  // ////////////////////////////////////////////////////////////////////////
33  @endverbatim */
34 
35 
36 #ifndef INCLUDE_NRT_IMAGEPROC_FILTERING_MORPHOLOGY_H
37 #define INCLUDE_NRT_IMAGEPROC_FILTERING_MORPHOLOGY_H
38 
39 #include <nrt/Core/Image/Image.H>
42 
43 namespace nrt
44 {
45  /*! \defgroup morphology Morphology Operations
46  These methods perform morphological filtering on binary Images by applying a 'structuring element' to them. These
47  operations are useful to clean up boundaries (erode), fill in holes (dilate), etc.
48 
49  \ingroup imagefiltering
50  \see imagefiltering */
51 
52  /*! @{ */ // **********************************************************************
53 
54  //! Dilate the img with a custom structuring element
55  /*! @param img The (binary) source image
56  @param se The structuring element to use. Most users will want to generate one using the morphologyKernel method.
57  @param origin The origin of the structuring element. The default is the center of the structuring element. */
58  template <class PixType>
59  Image<PixType> dilate(Image<PixType> const& img, Image<PixType> const& se, Point2D<int> origin = Point2D<int>(-1,-1));
60 
61  //! Dilate the img with a square structuring element
62  /*! @param img The (binary) source image
63  @param seSize The x/y size of the square morphology structuring element.
64  @param origin The origin of the structuring element. The default is the center of the structuring element. */
65  template <class PixType>
66  Image<PixType> dilate(Image<PixType> const& img, int seSize = 3, Point2D<int> origin = Point2D<int>(-1,-1));
67 
68  //! Erode the img with a custom structuring element
69  /*! @param img The (binary) source image
70  @param se The structuring element to use. Most users will want to generate one using the morphologyKernel method.
71  @param origin The origin of the structuring element. The default is the center of the structuring element. */
72  template <class PixType>
73  Image<PixType> erode(Image<PixType> const& img, Image<PixType> const& se, Point2D<int> origin = Point2D<int>(-1,-1));
74 
75  //! Erode the img with a square structuring element
76  /*! @param img The (binary) source image
77  @param seSize The x/y size of the square morphology structuring element.
78  @param origin The origin of the structuring element. The default is the center of the structuring element. */
79  template <class PixType>
80  Image<PixType> erode(Image<PixType> const& img, int seSize = 3, Point2D<int> origin = Point2D<int>(-1,-1));
81 
82  //! Open (erode and then dilate) img with a custom structuring element
83  /*! @param img The (binary) source image
84  @param se The structuring element to use. Most users will want to generate one using the morphologyKernel method.
85  @param origin The origin of the structuring element. The default is the center of the structuring element. */
86  template <class PixType>
87  Image<PixType> open(Image<PixType> const& img, Image<PixType> const& se, Point2D<int> origin = Point2D<int>(-1,-1));
88 
89  //! Open (erode and then dilate) img with a square structuring element
90  /*! @param img The (binary) source image
91  @param seSize The x/y size of the square morphology structuring element.
92  @param origin The origin of the structuring element. The default is the center of the structuring element. */
93  template <class PixType>
94  Image<PixType> open(Image<PixType> const& img, int seSize = 3, Point2D<int> origin = Point2D<int>(-1,-1));
95 
96  //! Close (dilate and then erode) img with struct element se with a given origin
97  /*! @param img The (binary) source image
98  @param se The structuring element to use. Most users will want to generate one using the morphologyKernel method.
99  @param origin The origin of the structuring element. The default is the center of the structuring element. */
100  template <class PixType>
101  Image<PixType> close(Image<PixType> const& img, Image<PixType> const& se, Point2D<int> origin = Point2D<int>(-1,-1));
102 
103  //! Close (dilate and then erode) img with a square structuring element
104  /*! @param img The (binary) source image
105  @param seSize The x/y size of the square morphology structuring element.
106  @param origin The origin of the structuring element. The default is the center of the structuring element. */
107  template <class PixType>
108  Image<PixType> close(Image<PixType> const& img, int seSize = 3, Point2D<int> origin = Point2D<int>(-1,-1));
109 
110  /*! @} */ // **********************************************************************
111 
112 } // namespace nrt
113 
114 //! Include implementation details
116 
117 #endif // INCLUDE_NRT_IMAGEPROC_FILTERING_MORPHOLOGY_H