Commit cc313a41 authored by Edwin Carlinet's avatar Edwin Carlinet
Browse files

Add leveling/algebraic morpho tests.

	* configure.ac: Add opening/closing subdirs to generate Makefile.
	* milena/mln/morpho/closing/leveling.hh: Missing file from
	last commit.
	* milena/mln/morpho/opening/leveling.hh: Missing file from
	last commit.
	* milena/tests/morpho/closing/Makefile.am: New.
	* milena/tests/morpho/closing/algebraic.cc: Test file for
	algebraic closing filter.
	* milena/tests/morpho/closing/leveling.cc:  Test file for
	leveling closing filter.
	* milena/tests/morpho/opening/Makefile.am: New.
	* milena/tests/morpho/opening/algebraic.cc:  Test file for
	algebraic opening filter.
	* milena/tests/morpho/opening/leveling.cc:  Test file for
	leveling opening filter.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3440 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 95092f63
2009-02-28 Edwin Carlinet <carlinet@lrde.epita.fr>
Add leveling/algebraic morpho tests.
* configure.ac: Add opening/closing subdirs to generate Makefile.
* milena/mln/morpho/closing/leveling.hh: Missing file from
last commit.
* milena/mln/morpho/opening/leveling.hh: Missing file from
last commit.
* milena/tests/morpho/closing/Makefile.am: New.
* milena/tests/morpho/closing/algebraic.cc: Test file for
algebraic closing filter.
* milena/tests/morpho/closing/leveling.cc: Test file for
leveling closing filter.
* milena/tests/morpho/opening/Makefile.am: New.
* milena/tests/morpho/opening/algebraic.cc: Test file for
algebraic opening filter.
* milena/tests/morpho/opening/leveling.cc: Test file for
leveling opening filter.
2009-02-20 Guillaume Lazzara <z@lrde.epita.fr>
* configure.ac: configure tests/fun/l2l.
......
......@@ -244,6 +244,8 @@ AC_CONFIG_FILES([
milena/tests/morpho/elementary/Makefile
milena/tests/morpho/tree/Makefile
milena/tests/morpho/watershed/Makefile
milena/tests/morpho/closing/Makefile
milena/tests/morpho/opening/Makefile
milena/tests/norm/Makefile
milena/tests/opt/Makefile
milena/tests/pw/Makefile
......
// 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_LEVELING_HH
# define MLN_MORPHO_CLOSING_LEVELING_HH
/// \file mln/morpho/closing/leveling.hh
///
/// Morphological leveling closing.
# include <mln/morpho/includes.hh>
# include <mln/morpho/leveling_filter.hh>
namespace mln {
namespace morpho {
namespace closing {
/// Morphological leveling closing.
template <typename I, typename N, typename A>
mln_concrete(I)
leveling(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)
leveling(const Image<I>& input, const Neighborhood<N>& nbh,
const Accumulator<A>& accu, const mln_result(A)& lambda)
{
trace::entering("morpho::closing::leveling");
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 = leveling_filter(input, nbh, accu, lambda,
/* increasing = */ true);
mln_postcondition(output >= input);
trace::exiting("morpho::closing::leveling");
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_LEVELING_HH
// 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_LEVELING_HH
# define MLN_MORPHO_OPENING_LEVELING_HH
/// \file mln/morpho/opening/leveling.hh
///
/// Morphological leveling opening.
# include <mln/morpho/includes.hh>
# include <mln/morpho/leveling_filter.hh>
namespace mln {
namespace morpho {
namespace opening {
/// Morphological leveling opening.
template <typename I, typename N, typename A>
mln_concrete(I)
leveling(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)
leveling(const Image<I>& input, const Neighborhood<N>& nbh,
const Accumulator<A>& accu, const mln_result(A)& lambda)
{
trace::entering("morpho::opening::leveling");
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 = leveling_filter(input, nbh, accu, lambda,
/* increasing = */ false);
mln_postcondition(output <= input);
trace::exiting("morpho::opening::leveling");
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_LEVELING_HH
## Process this file through Automake to create Makefile.in -*- Makefile -*-
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS =
leveling \
algebraic \
height \
card \
volume \
sum
leveling_SOURCES = leveling.cc
algebraic_SOURCES = algebraic.cc
height_SOURCES = height.cc
card_SOURCES = card.cc
volume_SOURCES = volume.cc
sum_SOURCES = sum.cc
TESTS = $(check_PROGRAMS)
\ No newline at end of file
......@@ -25,9 +25,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
/// \file tests/morpho/closing_algebraic.cc
/// \file tests/morpho/closing/algebraic.cc
///
/// Test on mln::morpho::closing_algebraic.
/// Test on mln::morpho::closing::algebraic.
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
......@@ -36,7 +36,7 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/morpho/closing_algebraic.hh>
#include <mln/morpho/closing/algebraic.hh>
#include <mln/morpho/attribute/card.hh>
#include <mln/accu/count.hh>
......@@ -56,12 +56,12 @@ int main()
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
{
accu::count<point2d> a;
io::pgm::save(morpho::closing_algebraic(lena, c4(), a, 10),
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),
io::pgm::save(morpho::closing::algebraic(lena, c4(), a, 10),
"out.pgm");
}
}
// 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/leveling.cc
///
/// Test on mln::morpho::closing::leveling.
#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/leveling.hh>
#include <mln/morpho/attribute/volume.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::leveling(lena, c4(), a, 10),
"ref.pgm");
}
{
morpho::attribute::volume<I> a;
io::pgm::save(morpho::closing::leveling(lena, c4(), a, 10),
"out.pgm");
}
}
## Process this file through Automake to create Makefile.in -*- Makefile -*-
include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS =
leveling \
algebraic \
height \
card \
volume \
sum
leveling_SOURCES = leveling.cc
algebraic_SOURCES = algebraic.cc
height_SOURCES = height.cc
card_SOURCES = card.cc
volume_SOURCES = volume.cc
sum_SOURCES = sum.cc
TESTS = $(check_PROGRAMS)
\ No newline at end of file
// 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/opening/algebraic.cc
///
/// Test on mln::morpho::opening::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/opening/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::opening::algebraic(lena, c4(), a, 10),
"ref.pgm");
}
{
morpho::attribute::card<I> a;
io::pgm::save(morpho::opening::algebraic(lena, c4(), a, 10),
"out.pgm");
}
}
// 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/opening/leveling.cc
///
/// Test on mln::morpho::opening::leveling.
#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/leveling.hh>
#include <mln/morpho/attribute/volume.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::opening::leveling(lena, c4(), a, 10),
"ref.pgm");
}
{
morpho::attribute::volume<I> a;
io::pgm::save(morpho::opening::leveling(lena, c4(), a, 10),
"out.pgm");
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment