$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
clean.hh
1 // Copyright (C) 2009, 2010, 2011 EPITA Research and Development
2 // Laboratory (LRDE)
3 //
4 // This file is part of Olena.
5 //
6 // Olena is free software: you can redistribute it and/or modify it under
7 // the terms of the GNU General Public License as published by the Free
8 // Software Foundation, version 2 of the License.
9 //
10 // Olena is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with Olena. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // As a special exception, you may use this file as part of a free
19 // software project without restriction. Specifically, if other files
20 // instantiate templates or use macros or inline functions from this
21 // file, or you compile this file and link it with other files to produce
22 // an executable, this file does not by itself cause the resulting
23 // executable to be covered by the GNU General Public License. This
24 // exception does not however invalidate any other reasons why the
25 // executable file might be covered by the GNU General Public License.
26 
27 #ifndef SCRIBO_TEXT_CLEAN_HH
28 # define SCRIBO_TEXT_CLEAN_HH
29 
33 
34 # include <mln/core/concept/image.hh>
35 # include <mln/core/concept/weighted_window.hh>
36 # include <mln/core/routine/extend.hh>
37 
38 # include <mln/morpho/skeleton_constrained.hh>
39 # include <mln/morpho/dilation.hh>
40 
41 # include <mln/topo/skeleton/is_simple_point.hh>
42 # include <mln/topo/skeleton/crest.hh>
43 
44 # include <mln/logical/not.hh>
45 
46 //# include <mln/world/binary_2d/enlarge.hh>
47 
48 # include <mln/debug/filename.hh>
49 # include <mln/io/pbm/save.hh>
50 
51 #include <mln/labeling/wrap.hh>
52 #include <mln/win/octagon2d.hh>
53 
54 #include <mln/arith/revert.hh>
55 
56 #include <mln/transform/distance_front.hh>
57 
58 
59 #include <mln/linear/gaussian.hh>
60 #include <mln/value/int_u8.hh>
61 
62 #include <mln/data/convert.hh>
63 #include <mln/value/rgb8.hh>
64 #include <mln/io/pgm/all.hh>
65 
66 #include <scribo/core/line_info.hh>
67 #include <scribo/upsampling/bs2x.hh>
68 #include <scribo/upsampling/eagle.hh>
69 #include <scribo/subsampling/bilinear.hh>
70 
71 #include <scribo/text/clean_inplace.hh>
72 
73 namespace scribo
74 {
75 
76  namespace text
77  {
78 
79  using namespace mln;
80 
81 
90  //
91  template <typename L, typename I>
92  mln_concrete(I)
93  clean(const line_info<L>& line, const Image<I>& input_);
94 
95 
96 # ifndef MLN_INCLUDE_ONLY
97 
98  template <typename L, typename I>
99  mln_concrete(I)
100  clean(const line_info<L>& line, const Image<I>& input_)
101  {
102  mln_trace("scribo::text::clean");
103 
104  const I& input = exact(input_);
105  mlc_bool(mln_site_(I)::dim == 2)::check();
106  mlc_equal(mln_value(I),bool)::check();
107  mln_precondition(input.is_valid());
108  mln_precondition(line.is_valid());
109 
110  mln_concrete(I) output = duplicate(input);
111 
112  clean_inplace(line, output);
113 
114  return output;
115  }
116 
117 # endif // ! MLN_INCLUDE_ONLY
118 
119  } // end of namespace scribo::text
120 
121 } // end of namespace scribo
122 
123 #endif // ! SCRIBO_TEXT_CLEAN_HH