27 #ifndef SCRIBO_FILTER_COMPONENTS_SMALL_HH
28 # define SCRIBO_FILTER_COMPONENTS_SMALL_HH
35 # include <mln/core/concept/image.hh>
36 # include <mln/core/concept/neighborhood.hh>
37 # include <mln/core/concept/function.hh>
38 # include <mln/core/image/dmorph/image_if.hh>
40 # include <mln/data/transform.hh>
42 # include <mln/util/array.hh>
44 # include <mln/pw/all.hh>
46 # include <scribo/core/component_set.hh>
47 # include <scribo/fun/v2b/objects_small_filter.hh>
48 # include <scribo/primitive/extract/components.hh>
74 template <
typename I,
typename N,
typename V>
98 # ifndef MLN_INCLUDE_ONLY
101 template <
typename I,
typename N,
typename V>
109 mln_trace(
"scribo::filter::components_small");
111 const I& input =
exact(input_);
112 const N& nbh =
exact(nbh_);
114 mln_precondition(input.is_valid());
115 mln_precondition(nbh.is_valid());
119 lbl = primitive::extract::components(input, nbh, nlabels);
121 typedef fun::v2b::components_small_filter<mln_ch_value(I,V)> func_t;
122 func_t fv2b(lbl, min_size);
125 nlabels = fv2b.nlabels_;
131 template <typename L>
137 mln_trace(
"scribo::filter::components_small");
139 mln_precondition(components.is_valid());
141 fun::v2b::components_small_filter<L> f(components, min_size);
143 component_set<L> output = components.duplicate();
150 # endif // ! MLN_INCLUDE_ONLY
156 #endif // ! SCRIBO_FILTER_COMPONENTS_SMALL_HH