27 #ifndef SCRIBO_PRIMITIVE_LINK_WITH_SEVERAL_GRAPHES_HH
28 # define SCRIBO_PRIMITIVE_LINK_WITH_SEVERAL_GRAPHES_HH
34 # include <mln/core/concept/image.hh>
35 # include <mln/labeling/compute.hh>
36 # include <mln/accu/center.hh>
38 # include <mln/math/abs.hh>
40 # include <mln/util/array.hh>
41 # include <mln/util/graph.hh>
43 # include <scribo/core/macros.hh>
44 # include <scribo/core/component_set.hh>
45 # include <scribo/primitive/internal/find_graph_link.hh>
63 unsigned neighb_max_distance);
65 # ifndef MLN_INCLUDE_ONLY
71 unsigned neighb_max_distance)
73 mln_trace(
"scribo::primitive::link::with_several_graphes");
77 for_all_comps(i, comps)
79 unsigned midcol = (comps(i).bbox().pmax().col()
80 - comps(i).bbox().pmin().col()) / 2;
81 int dmax = midcol + neighb_max_distance;
83 mln_site(L) c = comps(i).mass_center();
100 a1.row() = comps(i).
bbox().pmin().row()
101 + (c.row() - comps(i).
bbox().pmin().row()) / 4;
102 internal::find_graph_link(g, comps, i, dmax, a1);
105 internal::find_graph_link(g, comps, i, dmax, c);
109 a2.row() = comps(i).
bbox().pmax().row()
110 - (c.row() - comps(i).
bbox().pmin().row()) / 4;
111 internal::find_graph_link(g, comps, i, dmax, a2);
118 # endif // ! MLN_INCLUDE_ONLY
126 #endif // ! SCRIBO_PRIMITIVE_LINK_WITH_SEVERAL_GRAPHES_HH