27 #ifndef SCRIBO_FILTER_OBJECTS_V_THIN_HH
28 # define SCRIBO_FILTER_OBJECTS_V_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>
60 template <
typename I,
typename N,
typename V>
66 unsigned min_thinness);
82 unsigned min_thinness);
85 # ifndef MLN_INCLUDE_ONLY
94 struct objects_v_thin_filter
97 typedef accu::shape::bbox<mln_psite(L)> box_accu_t;
105 objects_v_thin_filter(
const component_set<L>& comps,
106 unsigned min_thinness)
107 : comps_(comps), min_thinness_(min_thinness)
116 objects_v_thin_filter(
unsigned min_thinness)
117 : min_thinness_(min_thinness)
123 void update_objects(
const component_set<L>& comps)
134 bool operator()(
const mln_value(L)& l)
const
136 if (l == literal::zero)
138 return comps_(l).bbox().height() > min_thinness_;
142 component_set<L> comps_;
145 unsigned min_thinness_;
152 template <
typename I,
typename N,
typename V>
158 unsigned min_thinness)
160 mln_trace(
"scribo::filter::objects_v_thin");
163 const I& input =
exact(input_);
164 const N& nbh =
exact(nbh_);
166 mln_precondition(input.is_valid());
167 mln_precondition(nbh.is_valid());
169 internal::objects_v_thin_filter<V> fv2b(min_thinness);
171 output = internal::
compute(input, nbh, label_type, fv2b);
177 template <typename L>
181 unsigned min_thinness)
183 mln_trace(
"scribo::filter::objects_v_thin");
185 internal::objects_v_thin_filter<L>
186 is_not_too_v_thin(comps, min_thinness);
192 # endif // ! MLN_INCLUDE_ONLY
199 #endif // ! SCRIBO_FILTER_OBJECTS_V_THIN_HH