https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix extension handling in fastest functors of morpho erosion.
* tests/morpho/erosion.cc: Stress test while setting border
thickness to 0.
Fix copyright layout.
* mln/morpho/erosion.spe.hh
(erosion_arbitrary_2d_fastest_functor): Move extension handling
into...
(erosion_arbitrary_2d_fastest): ...this routine.
(erosion_directional_nd_fastest_functor): Move extension handling
into...
(erosion_directional_nd_fastest): ...this routine.
mln/morpho/erosion.spe.hh | 19 ++++++++++++++++---
tests/morpho/erosion.cc | 15 +++++++++------
2 files changed, 25 insertions(+), 9 deletions(-)
Index: tests/morpho/erosion.cc
--- tests/morpho/erosion.cc (revision 2818)
+++ tests/morpho/erosion.cc (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 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
@@ -25,10 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/*! \file tests/morpho/erosion.cc
- *
- * \brief Test on mln::morpho::erosion.
- */
+/// \file tests/morpho/erosion.cc
+///
+/// Test on mln::morpho::erosion.
#include <mln/core/image/image2d.hh>
#include <mln/win/all.hh>
@@ -43,12 +43,14 @@
#include "tests/data.hh"
+
int main()
{
using namespace mln;
using value::int_u8;
- border::thickness = 20;
+ border::thickness = 0;
+
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
@@ -61,6 +63,7 @@
image2d<int_u8> out;
image2d<int_u8> ref;
+// trace::quiet = false;
// Rectangle
{
Index: mln/morpho/erosion.spe.hh
--- mln/morpho/erosion.spe.hh (revision 2818)
+++ mln/morpho/erosion.spe.hh (working copy)
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008 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
@@ -398,7 +399,9 @@
void init()
{
- extension::adjust_fill(input, win, accu);
+ // extension::adjust_fill is performed in the routine
+ // because it has to be done before the initialization of
+ // the fast iterators (q_*).
initialize(output, input);
accu.init();
p = input.domain().pmin() - dps[0];
@@ -457,6 +460,10 @@
trait::image::kind::binary) is_binary;
typedef mlc_if(is_binary, accu::land, accu::min_h<mln_value(I)>) A;
+ extension::adjust_fill(input,
+ geom::delta(win) + 1,
+ A());
+
typedef erosion_arbitrary_2d_fastest_functor<I, W, A> F;
F f(exact(input), exact(win));
canvas::browsing::snake_generic(f);
@@ -753,7 +760,9 @@
void init()
{
- extension::adjust_fill(input, win, accu);
+ // extension::adjust_fill is performed in the routine
+ // because it has to be done before the initialization of
+ // the fast iterators (q_l and q_r).
initialize(output, input);
}
@@ -795,6 +804,10 @@
trait::image::kind::binary) is_binary;
typedef mlc_if(is_binary, accu::land, accu::min_h<mln_value(I)>) A;
+ extension::adjust_fill(input,
+ geom::delta(win) + 1,
+ A());
+
typedef erosion_directional_nd_fastest_functor<I, W, A> F;
F f(exact(input), exact(win), dir);
canvas::browsing::directional(f);