27 #ifndef SCRIBO_FILTER_OBJECTS_V_THICK_HH
28 # define SCRIBO_FILTER_OBJECTS_V_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>
61 template <
typename I,
typename N,
typename V>
67 unsigned max_thickness);
84 unsigned max_thickness);
88 # ifndef MLN_INCLUDE_ONLY
97 struct v_thick_object_filter
106 v_thick_object_filter(
const component_set<L>& comps,
107 unsigned max_thickness)
108 : comps_(comps), max_thickness_(max_thickness)
116 v_thick_object_filter(
unsigned max_thickness)
117 : max_thickness_(max_thickness)
123 void update_objects(
const component_set<L>& comps)
132 bool operator()(
const mln_value(L)& l)
const
134 if (l == literal::zero)
136 return comps_(l).bbox().height() < max_thickness_;
141 component_set<L> comps_;
144 unsigned max_thickness_;
151 template <
typename I,
typename N,
typename V>
157 unsigned max_thickness)
159 mln_trace(
"scribo::filter::objects_v_thick");
161 const I& input =
exact(input_);
164 mln_precondition(input.is_valid());
165 mln_precondition(nbh.is_valid());
167 internal::v_thick_object_filter<V> functor(max_thickness);
169 output = internal::
compute(input, nbh, label_type, functor);
175 template <typename L>
179 unsigned max_thickness)
181 mln_trace(
"scribo::filter::objects_v_thick");
183 internal::v_thick_object_filter<L> functor(comps, max_thickness);
189 # endif // ! MLN_INCLUDE_ONLY
196 #endif // ! SCRIBO_FILTER_OBJECTS_V_THICK_HH