27 #ifndef SCRIBO_ESTIM_OBJECT_GROUPS_MEAN_WIDTH_HH
28 # define SCRIBO_ESTIM_OBJECT_GROUPS_MEAN_WIDTH_HH
36 # include <mln/util/array.hh>
37 # include <scribo/core/object_groups.hh>
38 # include <scribo/core/macros.hh>
62 # ifndef MLN_INCLUDE_ONLY
69 mln_trace(
"scribo::estim::object_groups_mean_width");
71 mln_precondition(groups.is_valid());
73 const component_set<L>&
components = groups.components();
76 for_all_groups(g, groups)
77 for_all_elements(e, groups(g).component_ids())
78 output(g) += components(groups(g).component_ids()(e)).
bbox().width();
81 for_all_groups(g, groups)
82 if (groups(g).is_valid())
83 output(g) /= groups(g).card();
91 # endif // ! MLN_INCLUDE_ONLY
98 #endif // ! SCRIBO_ESTIM_OBJECT_GROUPS_MEAN_WIDTH_HH