26 #ifndef MLN_GEOM_SEEDS2TILING_ROUNDNESS_HH
27 # define MLN_GEOM_SEEDS2TILING_ROUNDNESS_HH
35 # include <mln/core/concept/image.hh>
36 # include <mln/core/concept/neighborhood.hh>
37 # include <mln/core/alias/w_window2d_int.hh>
38 # include <mln/core/site_set/p_priority.hh>
39 # include <mln/core/site_set/p_queue_fast.hh>
40 # include <mln/core/routine/duplicate.hh>
41 # include <mln/accu/stat/mean.hh>
42 # include <mln/estim/min_max.hh>
43 # include <mln/algebra/vec.hh>
44 # include <mln/geom/chamfer.hh>
65 template <
typename I,
typename N>
67 seeds2tiling_roundness (Image<I>& ima_,
const w_window2d_int& w_win,
68 unsigned max,
const Neighborhood<N>& nbh_);
72 # ifndef MLN_INCLUDE_ONLY
77 template <
typename I,
typename N>
80 seeds2tiling_roundness(Image<I>& ima_,
const w_window2d_int& w_win,
81 unsigned max,
const Neighborhood<N>& nbh_)
83 trace::entering(
"geom::impl::seed2tiling_roundness");
86 const N& nbh = exact(nbh_);
90 p_priority<unsigned, p_queue_fast<mln_psite(I)> > q;
94 mln_piter(I) p(ima.domain());
97 q.push(max - dist(p), p);
103 while (! q.is_empty())
105 mln_psite(I) p = q.pop_front();
107 if (out(p) != literal::zero)
109 mln_niter(N) n(nbh, p);
111 for_all(n) if (ima.has(n))
112 if (out(n) != literal::zero)
117 trace::exiting("geom::impl::seed2tiling_roundness");
125 template <typename I, typename N>
128 seeds2tiling_roundness(Image<I>& ima_, const w_window2d_int& w_win,
129 unsigned max, const Neighborhood<N>& nbh)
131 trace::entering(
"geom::seed2tiling_roundness");
133 mln_precondition(exact(ima_).is_valid());
134 I output = impl::seeds2tiling_roundness(ima_, w_win, max, nbh);
136 trace::exiting(
"geom::seed2tiling_roundness");
142 # endif // ! MLN_INCLUDE_ONLY
149 #endif // ! MLN_GEOM_SEEDS2TILING_ROUNDNESS_HH