
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena ChangeLog: 2009-02-28 Edwin Carlinet <carlinet@lrde.epita.fr> Create opening and closing morpho subdir and move opening and. * mln/morpho/algebraic_filter.hh: Add precondition and test. * mln/morpho/closing/algebraic.hh: New. * mln/morpho/closing_algebraic.hh: Remove. * mln/morpho/leveling_filter.hh: Add precondition and test. * mln/morpho/opening/algebraic.hh: New. * mln/morpho/opening_algebraic.hh: Remove. * tests/morpho/closing/algebraic.cc: New. * tests/morpho/closing/area.cc: New. * tests/morpho/closing/height.cc: New. * tests/morpho/closing/volume.cc: New. * tests/morpho/closing: New. * tests/morpho/closing_algebraic.cc: Remove. * tests/morpho/closing_area.cc: Remove. * tests/morpho/closing_height.cc: Remove. * tests/morpho/closing_volume.cc: Remove. * tests/morpho/opening/area.cc: New. * tests/morpho/opening/height.cc: New. * tests/morpho/opening/volume.cc: New. * tests/morpho/opening: New. * tests/morpho/opening_area.cc: Remove. * tests/morpho/opening_height.cc: Remove. * tests/morpho/opening_volume.cc: Remove. --- mln/morpho/algebraic_filter.hh | 29 ++++++++++-- mln/morpho/closing/algebraic.hh | 86 ++++++++++++++++++++++++++++++++++++++ mln/morpho/leveling_filter.hh | 24 ++++++++++ mln/morpho/opening/algebraic.hh | 86 ++++++++++++++++++++++++++++++++++++++ tests/morpho/closing/algebraic.cc | 67 +++++++++++++++++++++++++++++ tests/morpho/closing/area.cc | 54 +++++++++++++++++++++++ tests/morpho/closing/height.cc | 52 ++++++++++++++++++++++ tests/morpho/closing/volume.cc | 60 ++++++++++++++++++++++++++ tests/morpho/opening/area.cc | 56 ++++++++++++++++++++++++ tests/morpho/opening/height.cc | 54 +++++++++++++++++++++++ tests/morpho/opening/volume.cc | 54 +++++++++++++++++++++++ 11 files changed, 616 insertions(+), 6 deletions(-) Index: trunk/milena/tests/morpho/closing_volume.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/closing_area.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/closing_height.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/opening_volume.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/opening_area.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/opening_height.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/closing_algebraic.cc (deleted) =================================================================== Index: trunk/milena/tests/morpho/closing/volume.cc =================================================================== --- trunk/milena/tests/morpho/closing/volume.cc (revision 0) +++ trunk/milena/tests/morpho/closing/volume.cc (revision 3437) @@ -0,0 +1,60 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/closing_volume.cc +/// +/// Test on mln::morpho::closing_volume. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/closing_volume.hh> +#include <mln/morpho/attribute/volume.hh> + +#include "tests/data.hh" + + +int main() +{ + using namespace mln; + using value::int_u8; + + typedef image2d<int_u8> I; + I lena; + io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm"); + io::pgm::save(morpho::closing_volume(lena, c4(), 10000), + "ref.pgm"); + + typedef morpho::attribute::volume<I> A; + io::pgm::save(morpho::closing_attribute<A>(lena, c4(), 10000), + "out.pgm"); +} Index: trunk/milena/tests/morpho/closing/area.cc =================================================================== --- trunk/milena/tests/morpho/closing/area.cc (revision 0) +++ trunk/milena/tests/morpho/closing/area.cc (revision 3437) @@ -0,0 +1,54 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/closing_area.cc +/// +/// Test on mln::morpho::closing_area. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/closing_area.hh> + +#include "tests/data.hh" + + + +int main() +{ + using namespace mln; + using value::int_u8; + + image2d<int_u8> lena; + io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm"); + io::pgm::save(morpho::closing_area(lena, c4(), 510), "out.pgm"); +} Index: trunk/milena/tests/morpho/closing/height.cc =================================================================== --- trunk/milena/tests/morpho/closing/height.cc (revision 0) +++ trunk/milena/tests/morpho/closing/height.cc (revision 3437) @@ -0,0 +1,52 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/closing_height.cc +/// +/// Test on mln::morpho::closing_height. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/closing_height.hh> + +#include "tests/data.hh" + +int main() +{ + using namespace mln; + using value::int_u8; + + image2d<int_u8> lena; + io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm"); + io::pgm::save(morpho::closing_height(lena, c4(), 20), "out.pgm"); +} Index: trunk/milena/tests/morpho/closing/algebraic.cc =================================================================== --- trunk/milena/tests/morpho/closing/algebraic.cc (revision 0) +++ trunk/milena/tests/morpho/closing/algebraic.cc (revision 3437) @@ -0,0 +1,67 @@ +// Copyright (C) 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/closing_algebraic.cc +/// +/// Test on mln::morpho::closing_algebraic. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/closing_algebraic.hh> +#include <mln/morpho/attribute/card.hh> +#include <mln/accu/count.hh> + +#include "tests/data.hh" + + + +int main() +{ + using namespace mln; + using value::int_u8; + + trace::quiet = false; + + typedef image2d<int_u8> I; + I lena; + io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm"); + { + accu::count<point2d> a; + io::pgm::save(morpho::closing_algebraic(lena, c4(), a, 10), + "ref.pgm"); + } + { + morpho::attribute::card<I> a; + io::pgm::save(morpho::closing_algebraic(lena, c4(), a, 10), + "out.pgm"); + } +} Property changes on: trunk/milena/tests/morpho/closing/algebraic.cc ___________________________________________________________________ Name: svn:mergeinfo + Index: trunk/milena/tests/morpho/opening/volume.cc =================================================================== --- trunk/milena/tests/morpho/opening/volume.cc (revision 0) +++ trunk/milena/tests/morpho/opening/volume.cc (revision 3437) @@ -0,0 +1,54 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/opening_volume.cc +/// +/// Test on mln::morpho::opening_volume. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/opening_volume.hh> + +#include "tests/data.hh" + +int main() +{ + using namespace mln; + using value::int_u8; + + image2d<int_u8> lena; + io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm"); + image2d<int_u8> out(lena.domain()); + + out = morpho::opening_volume(lena, c4(), 10000); + io::pgm::save(out, "out.pgm"); +} Index: trunk/milena/tests/morpho/opening/area.cc =================================================================== --- trunk/milena/tests/morpho/opening/area.cc (revision 0) +++ trunk/milena/tests/morpho/opening/area.cc (revision 3437) @@ -0,0 +1,56 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/opening_area.cc +/// +/// Test on mln::morpho::opening_area. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/opening_area.hh> + +#include "tests/data.hh" + + + +int main() +{ + using namespace mln; + using value::int_u8; + + image2d<int_u8> lena; + io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm"); + image2d<int_u8> out(lena.domain()); + + out = morpho::opening_area(lena, c4(), 510); + io::pgm::save(out, "out.pgm"); +} Index: trunk/milena/tests/morpho/opening/height.cc =================================================================== --- trunk/milena/tests/morpho/opening/height.cc (revision 0) +++ trunk/milena/tests/morpho/opening/height.cc (revision 3437) @@ -0,0 +1,54 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/// \file tests/morpho/opening_height.cc +/// +/// Test on mln::morpho::opening_height. + +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pgm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/morpho/opening_height.hh> + +#include "tests/data.hh" + +int main() +{ + using namespace mln; + using value::int_u8; + + image2d<int_u8> lena; + io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm"); + image2d<int_u8> out(lena.domain()); + + out = morpho::opening_height(lena, c4(), 20); + io::pgm::save(out, "out.pgm"); +} Index: trunk/milena/mln/morpho/closing_algebraic.hh (deleted) =================================================================== Index: trunk/milena/mln/morpho/opening_algebraic.hh (deleted) =================================================================== Index: trunk/milena/mln/morpho/closing/algebraic.hh =================================================================== --- trunk/milena/mln/morpho/closing/algebraic.hh (revision 0) +++ trunk/milena/mln/morpho/closing/algebraic.hh (revision 3437) @@ -0,0 +1,86 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_MORPHO_CLOSING_ALGEBRAIC_HH +# define MLN_MORPHO_CLOSING_ALGEBRAIC_HH + +/// \file mln/morpho/closing/algebraic.hh +/// +/// Morphological algebraic closing. + +# include <mln/morpho/includes.hh> +# include <mln/morpho/algebraic_filter.hh> + + +namespace mln { + namespace morpho { + namespace closing { + + /// Morphological algebraic closing. + template <typename I, typename N, typename A> + mln_concrete(I) + algebraic(const Image<I>& input, const Neighborhood<N>& nbh, + const Accumulator<A>& accu, const mln_result(A)& lambda); + + + + +# ifndef MLN_INCLUDE_ONLY + + + template <typename I, typename N, typename A> + inline + mln_concrete(I) + algebraic(const Image<I>& input, const Neighborhood<N>& nbh, + const Accumulator<A>& accu, const mln_result(A)& lambda) + { + trace::entering("morpho::closing::algebraic"); + + mln_precondition(exact(input).is_valid()); + mln_precondition(mlc_equal(mln_trait_accumulator_when_pix(A), + trait::accumulator::when_pix::not_ok)::value) + + mln_concrete(I) output; + output = algebraic_filter(input, nbh, accu, lambda, + /* increasing = */ true); + + mln_postcondition(output >= input); + + trace::exiting("morpho::closing::algebraic"); + return output; + } + + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::morpho::closing + } // end of namespace mln::morpho +} // end of namespace mln + + +#endif // ! MLN_MORPHO_CLOSING_ALGEBRAIC_HH Property changes on: trunk/milena/mln/morpho/closing/algebraic.hh ___________________________________________________________________ Name: svn:mergeinfo + Index: trunk/milena/mln/morpho/opening/algebraic.hh =================================================================== --- trunk/milena/mln/morpho/opening/algebraic.hh (revision 0) +++ trunk/milena/mln/morpho/opening/algebraic.hh (revision 3437) @@ -0,0 +1,86 @@ +// 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 +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_MORPHO_OPENING_ALGEBRAIC_HH +# define MLN_MORPHO_OPENING_ALGEBRAIC_HH + +/// \file mln/morpho/opening/algebraic.hh +/// +/// Morphological algebraic opening. + +# include <mln/morpho/includes.hh> +# include <mln/morpho/algebraic_filter.hh> + + +namespace mln { + namespace morpho { + namespace opening { + + /// Morphological algebraic opening. + template <typename I, typename N, typename A> + mln_concrete(I) + algebraic(const Image<I>& input, const Neighborhood<N>& nbh, + const Accumulator<A>& accu, const mln_result(A)& lambda); + + + + +# ifndef MLN_INCLUDE_ONLY + + + template <typename I, typename N, typename A> + inline + mln_concrete(I) + algebraic(const Image<I>& input, const Neighborhood<N>& nbh, + const Accumulator<A>& accu, const mln_result(A)& lambda) + { + trace::entering("morpho::opening::algebraic"); + + mln_precondition(exact(input).is_valid()); + mln_precondition(mlc_equal(mln_trait_accumulator_when_pix(A), + trait::accumulator::when_pix::not_ok)::value) + + mln_concrete(I) output; + output = algebraic_filter(input, nbh, accu, lambda, + /* increasing = */ false); + + mln_postcondition(output <= input); + + trace::exiting("morpho::opening::algebraic"); + return output; + } + + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace mln::morpho::opening + } // end of namespace mln::morpho +} // end of namespace mln + + +#endif // ! MLN_MORPHO_OPENING_ALGEBRAIC_HH Property changes on: trunk/milena/mln/morpho/opening/algebraic.hh ___________________________________________________________________ Name: svn:mergeinfo + Index: trunk/milena/mln/morpho/leveling_filter.hh =================================================================== --- trunk/milena/mln/morpho/leveling_filter.hh (revision 3436) +++ trunk/milena/mln/morpho/leveling_filter.hh (revision 3437) @@ -53,15 +53,37 @@ const Neighborhood<N>& nbh, const Accumulator<A>& a, const typename A::result& lambda, + bool increasing); + + +# ifndef MLN_INCLUDE_ONLY + + template <typename I, typename N, typename A> + mln_concrete(I) + leveling_filter(const Image<I>& input, + const Neighborhood<N>& nbh, + const Accumulator<A>& a, + const typename A::result& lambda, bool increasing) { + trace::entering("morpho::opening::leveling_filter"); + + mln_precondition(exact(input).is_valid()); + mlc_or(mlc_equal(mln_trait_accumulator_when_pix(A), trait::accumulator::when_pix::use_pix), mlc_equal(mln_trait_accumulator_when_pix(A), trait::accumulator::when_pix::use_v))::check(); - return canvas::morpho::internal::attribute_filter_dispatch(input, nbh, a, lambda, increasing); + mln_concrete(I) output; + output = canvas::morpho::internal::attribute_filter_dispatch(input, nbh, a, lambda, increasing); + + trace::exiting("morpho::opening::leveling_filter"); + + return output; } + +# endif // ! MLN_INCLUDE_ONLY } // end of namespace mln::morpho } // end of namespace mln Index: trunk/milena/mln/morpho/algebraic_filter.hh =================================================================== --- trunk/milena/mln/morpho/algebraic_filter.hh (revision 3436) +++ trunk/milena/mln/morpho/algebraic_filter.hh (revision 3437) @@ -28,9 +28,9 @@ #ifndef MLN_MORPHO_ALGEBRAIC_FILTER_HH_ # define MLN_MORPHO_ALGEBRAIC_FILTER_HH_ -/// \file mln/morpho/leveling_filter.hh +/// \file mln/morpho/algebraic_filter.hh /// -/// Leveling filter calls attribute canvas. +/// Alegebraic filter calls attribute canvas. # include <mln/core/concept/image.hh> @@ -53,19 +53,38 @@ const Neighborhood<N>& nbh, const Accumulator<A>& a, const typename A::result& lambda, + bool increasing); + + +# ifndef MLN_INCLUDE_ONLY + + template <typename I, typename N, typename A> + mln_concrete(I) + algebraic_filter(const Image<I>& input, + const Neighborhood<N>& nbh, + const Accumulator<A>& a, + const typename A::result& lambda, bool increasing) { + trace::entering("morpho::opening::algebraic_filter"); + + mln_precondition(exact(input).is_valid()); + mlc_or(mlc_equal(mln_trait_accumulator_when_pix(A), trait::accumulator::when_pix::use_none), mlc_equal(mln_trait_accumulator_when_pix(A), trait::accumulator::when_pix::use_p))::check(); - return canvas::morpho::internal::attribute_filter_dispatch(input, nbh, a, lambda, increasing); + mln_concrete(I) output; + output = canvas::morpho::internal::attribute_filter_dispatch(input, nbh, a, lambda, increasing); + + trace::exiting("morpho::opening::algebraic_filter"); + + return output; } +# endif // ! MLN_INCLUDE_ONLY } // end of namespace mln::morpho } // end of namespace mln - - #endif /* !MLN_MORPHO_ALGEBRAIC_FILTER_HH_ */