27 #ifndef SCRIBO_FILTER_OBJECTS_H_THICK_HH
28 # define SCRIBO_FILTER_OBJECTS_H_THICK_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/core/concept/neighborhood.hh>
37 # include <scribo/core/component_set.hh>
38 # include <scribo/filter/internal/compute.hh>
60 template <
typename I,
typename N,
typename V>
66 unsigned max_thickness);
82 unsigned max_thickness);
86 # ifndef MLN_INCLUDE_ONLY
95 struct h_thick_object_filter
104 h_thick_object_filter(
const component_set<L>& comps,
105 unsigned max_thickness)
106 : comps_(comps), max_thickness_(max_thickness)
114 h_thick_object_filter(
unsigned max_thickness)
115 : max_thickness_(max_thickness)
121 void update_objects(
const component_set<L>& comps)
130 bool operator()(
const mln_value(L)& l)
const
132 if (l == literal::zero)
134 return comps_(l).bbox().width() < max_thickness_;
139 component_set<L> comps_;
142 unsigned max_thickness_;
149 template <
typename I,
typename N,
typename V>
155 unsigned max_thickness)
157 mln_trace(
"scribo::filter::objects_h_thick");
159 const I& input =
exact(input_);
162 mln_precondition(input.is_valid());
163 mln_precondition(nbh.is_valid());
165 internal::h_thick_object_filter<V> functor(max_thickness);
167 output = internal::
compute(input, nbh, label_type, functor);
173 template <typename L>
177 unsigned max_thickness)
179 mln_trace(
"scribo::filter::objects_h_thick");
181 internal::h_thick_object_filter<L> functor(comps, max_thickness);
187 # endif // ! MLN_INCLUDE_ONLY
194 #endif // ! SCRIBO_FILTER_OBJECTS_H_THICK_HH