27 #ifndef SCRIBO_FILTER_OBJECTS_H_THIN_HH
28 # define SCRIBO_FILTER_OBJECTS_H_THIN_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>
59 template <
typename I,
typename N,
typename V>
65 unsigned min_thinness);
80 unsigned min_thinness);
83 # ifndef MLN_INCLUDE_ONLY
92 struct objects_h_thin_filter
95 typedef accu::shape::bbox<mln_psite(L)> box_accu_t;
103 objects_h_thin_filter(
const component_set<L>& comps,
104 unsigned min_thinness)
105 : comps_(comps), min_thinness_(min_thinness)
114 objects_h_thin_filter(
unsigned min_thinness)
115 : min_thinness_(min_thinness)
121 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().width() > min_thinness_;
140 component_set<L> comps_;
143 unsigned min_thinness_;
150 template <
typename I,
typename N,
typename V>
156 unsigned min_thinness)
158 mln_trace(
"scribo::filter::objects_h_thin");
160 const I& input =
exact(input_);
163 mln_precondition(input.is_valid());
164 mln_precondition(nbh.is_valid());
166 internal::objects_h_thin_filter<V> functor(min_thinness);
168 output = internal::
compute(input, nbh, label_type, functor);
175 template <typename L>
179 unsigned min_thinness)
181 mln_trace(
"scribo::filter::objects_h_thin");
183 internal::objects_h_thin_filter<L>
184 is_not_too_h_thin(comps, min_thinness);
191 # endif // ! MLN_INCLUDE_ONLY
198 #endif // ! SCRIBO_FILTER_OBJECTS_H_THIN_HH