26 #ifndef SCRIBO_FILTER_OBJECTS_IN_BORDERS_HH
27 # define SCRIBO_FILTER_OBJECTS_IN_BORDERS_HH
35 # include <mln/core/concept/image.hh>
36 # include <mln/geom/all.hh>
37 # include <scribo/core/component_set.hh>
38 # include <scribo/util/box_is_included.hh>
83 # ifndef MLN_INCLUDE_ONLY
89 mln_trace(
"scribo::filter::objects_in_borders");
91 mln_precondition(components.is_valid());
93 const L& ima = components.labeled_image();
96 hborder_size = hratio *
std::min(ima.domain().width(), ima.domain().height()),
97 vborder_size = vratio *
std::min(ima.domain().width(), ima.domain().height());
111 ptl = ima.domain().pmin(),
114 pbr = ima.domain().pmax(),
124 for_all_comps(c, components)
125 if (components(c).is_valid())
126 if (util::box_is_included(components(c).
bbox(), bt)
127 || util::box_is_included(components(c).bbox(), br)
128 || util::box_is_included(components(c).bbox(), bb)
129 || util::box_is_included(components(c).bbox(), bl))
136 # endif // ! MLN_INCLUDE_ONLY
142 #endif // ! SCRIBO_FILTER_OBJECTS_IN_BORDERS_HH