
* mln/geom/chamfer.hh: Fix a too restrictive test (true == 1 but not > 0). * mln/geom/seeds2tiling_roundness.hh: Fix wrong declaration/use of p_priority site_set. Priority was based on sites and not on priority values. --- milena/ChangeLog | 11 +++++++++++ milena/mln/geom/chamfer.hh | 8 ++++---- milena/mln/geom/seeds2tiling_roundness.hh | 13 +++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 03d1aa9..03a2bdb 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,14 @@ +2009-04-27 Guillaume Lazzara <lazzara@lrde.epita.fr> + + Fix seeds2tiling_roundness test. + + * mln/geom/chamfer.hh: Fix a too restrictive test (true == 1 but not > + 0). + + * mln/geom/seeds2tiling_roundness.hh: Fix wrong declaration/use of + p_priority site_set. Priority was based on sites and not on priority + values. + 2009-04-20 Thierry Geraud <thierry.geraud@lrde.epita.fr> Improve vector and matrix interoperability. diff --git a/milena/mln/geom/chamfer.hh b/milena/mln/geom/chamfer.hh index 4967a66..0358a83 100644 --- a/milena/mln/geom/chamfer.hh +++ b/milena/mln/geom/chamfer.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -78,8 +78,8 @@ namespace mln mln_piter(O) p(output.domain()); for_all(p) { - if (input(p) == true) - output(p) = 0; + if (input(p)) + output(p) = 0u; else output(p) = max; } diff --git a/milena/mln/geom/seeds2tiling_roundness.hh b/milena/mln/geom/seeds2tiling_roundness.hh index 865198b..4b37999 100644 --- a/milena/mln/geom/seeds2tiling_roundness.hh +++ b/milena/mln/geom/seeds2tiling_roundness.hh @@ -88,15 +88,16 @@ namespace mln I& ima = exact(ima_); const N& nbh = exact(nbh_); image2d<unsigned> dist = geom::chamfer(ima, w_win, max); + I out = duplicate(ima_); - p_priority<mln_psite(I), p_queue_fast<unsigned> > q; + p_priority<unsigned, p_queue_fast<mln_psite(I)> > q; // Init. { mln_piter(I) p(ima.domain()); for_all(p) - q.push(p, max - dist(p)); + q.push(max - dist(p), p); } @@ -104,14 +105,14 @@ namespace mln { while (! q.is_empty()) { - mln_psite(I) p = q.highest_priority(); - q.pop(); - if (out(p) != 0) // p has already been processed so ignore + mln_psite(I) p = q.pop_front(); + + if (out(p) != literal::zero) // p has already been processed so ignore continue; mln_niter(N) n(nbh, p); for_all(n) if (ima.has(n)) - if (out(n) != 0) + if (out(n) != literal::zero) out(p) = out(n); } } -- 1.5.6.5
participants (1)
-
Guillaume Lazzara