27 #ifndef SCRIBO_PRIMITIVE_EXTRACT_COMPONENTS_HH
28 # define SCRIBO_PRIMITIVE_EXTRACT_COMPONENTS_HH
35 # include <mln/core/concept/neighborhood.hh>
36 # include <mln/core/site_set/box.hh>
38 # include <mln/accu/shape/bbox.hh>
39 # include <mln/accu/center.hh>
40 # include <mln/accu/pair.hh>
42 # include <mln/labeling/value_and_compute.hh>
43 # include <mln/labeling/compute.hh>
45 # include <mln/util/array.hh>
46 # include <mln/util/couple.hh>
48 # include <mln/extension/fill.hh>
50 # include <scribo/core/component_set.hh>
51 # include <scribo/estim/components_features.hh>
79 template <
typename I,
typename J,
typename N,
typename V>
81 component_set<mln_ch_value(I,V)>
99 template <
typename I,
typename N,
typename V>
101 component_set<mln_ch_value(I,V)>
107 # ifndef MLN_INCLUDE_ONLY
109 template <
typename I,
typename J,
typename N,
typename V>
111 component_set<mln_ch_value(I,V)>
116 mln_trace(
"scribo::components");
118 mlc_equal(mln_value(J),
bool)::check();
120 mln_precondition(
exact(input).is_valid());
121 mln_precondition(
exact(binary_input).is_valid());
122 mln_precondition(
exact(nbh).is_valid());
126 output = extract::
components(binary_input, nbh, ncomponents, type);
128 output = estim::components_features(input, binary_input, output);
134 template <typename I, typename N, typename V>
136 component_set<mln_ch_value(I,V)>
139 component::Type type)
141 mln_trace(
"scribo::components");
143 mlc_equal(mln_value(I),
bool)::check();
145 mln_precondition(
exact(binary_input).is_valid());
146 mln_precondition(
exact(nbh).is_valid());
150 typedef mln::accu::shape::
bbox<mln_site(L)> bbox_accu_t;
151 typedef mln::accu::center<mln_site(L)> center_accu_t;
152 typedef mln::accu::pair<bbox_accu_t, center_accu_t> pair_accu_t;
155 extension::
fill(binary_input, false);
159 mln::util::array<mln_result(pair_accu_t)>,
160 mln::util::array<pair_accu_t> > >
166 output(results.first(), ncomponents, results.second().second(), type);
172 # endif // ! MLN_INCLUDE_ONLY
181 #endif // ! SCRIBO_PRIMITIVE_EXTRACT_COMPONENTS_HH