Commit 6ff05af3 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Fix missing tests in morpho.

	* tests/morpho/top_hat.cc: New.
	* tests/morpho/Makefile.am: Update.
	* tests/morpho/closing/area.cc,
	* tests/morpho/closing/height.cc (Copyright): Fix.
	* tests/morpho/closing/structural.cc: New.
	* tests/morpho/closing/Makefile.am: Update.
	* tests/morpho/opening/volume.cc,
	* tests/morpho/opening/area.cc,
	* tests/morpho/opening/height.cc (Copyright): Fix.
	* tests/morpho/opening/structural.cc: New.
	* tests/morpho/opening/Makefile.am: Update.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3464 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 3a122368
2009-03-03 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Fix missing tests in morpho.
* tests/morpho/top_hat.cc: New.
* tests/morpho/Makefile.am: Update.
* tests/morpho/closing/area.cc,
* tests/morpho/closing/height.cc (Copyright): Fix.
* tests/morpho/closing/structural.cc: New.
* tests/morpho/closing/Makefile.am: Update.
* tests/morpho/opening/volume.cc,
* tests/morpho/opening/area.cc,
* tests/morpho/opening/height.cc (Copyright): Fix.
* tests/morpho/opening/structural.cc: New.
* tests/morpho/opening/Makefile.am: Update.
2009-03-03 Thierry Geraud <thierry.geraud@lrde.epita.fr>
 
Disambiguate morphological structural opening and closing.
......@@ -30,7 +30,9 @@ check_PROGRAMS = \
meyer_wst_long \
rank_filter \
skeleton_constrained \
thinning
thinning \
top_hat
# -------------- #
# Normal tests. #
......@@ -38,7 +40,6 @@ check_PROGRAMS = \
# FIXME: Have erosion and dilation perform symmetric tests.
erosion_SOURCES = erosion.cc
contrast_SOURCES = contrast.cc
general_SOURCES = general.cc
gradient_SOURCES = gradient.cc
......@@ -48,21 +49,18 @@ thinning_SOURCES = thinning.cc
graph_image_morpho_SOURCES = graph_image_morpho.cc
graph_image_wst_SOURCES = graph_image_wst.cc
line_graph_image_morpho_SOURCES = line_graph_image_morpho.cc
line_graph_image_wst_SOURCES = line_graph_image_wst.cc
complex_image_morpho_SOURCES = complex_image_morpho.cc
complex_image_wst_SOURCES = complex_image_wst.cc
meyer_wst_SOURCES = meyer_wst.cc
rank_filter_SOURCES = rank_filter.cc
skeleton_constrained_SOURCES = skeleton_constrained.cc
top_hat_SOURCES = top_hat.cc
combined_SOURCES = combined.cc
# --------------- #
# Complex tests. #
# --------------- #
......
......@@ -8,6 +8,7 @@ check_PROGRAMS = \
height \
area \
volume \
structural \
sum
leveling_SOURCES = leveling.cc
......@@ -15,6 +16,7 @@ algebraic_SOURCES = algebraic.cc
height_SOURCES = height.cc
area_SOURCES = area.cc
volume_SOURCES = volume.cc
structural_SOURCES = structural.cc
sum_SOURCES = sum.cc
TESTS = $(check_PROGRAMS)
// 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
......
// 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
......@@ -41,6 +41,7 @@
#include "tests/data.hh"
int main()
{
using namespace mln;
......
// 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/structural.cc
///
/// Test on mln::morpho::closing::structural.
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/alias/window2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/morpho/closing/structural.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena, out;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
bool w[] = { 0, 1, 1,
0, 0, 1,
0, 0, 1 };
out = morpho::closing::structural(lena,
convert::to<window2d>(w));
io::pgm::save(out, "out.pgm");
}
......@@ -8,6 +8,7 @@ check_PROGRAMS = \
height \
area \
volume \
structural \
sum
leveling_SOURCES = leveling.cc
......@@ -15,6 +16,7 @@ algebraic_SOURCES = algebraic.cc
height_SOURCES = height.cc
area_SOURCES = area.cc
volume_SOURCES = volume.cc
structural_SOURCES = structural.cc
sum_SOURCES = sum.cc
TESTS = $(check_PROGRAMS)
// 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
......@@ -41,7 +42,6 @@
#include "tests/data.hh"
int main()
{
using namespace mln;
......
// 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
......@@ -40,6 +41,7 @@
#include "tests/data.hh"
int main()
{
using namespace mln;
......
// 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/structural.cc
///
/// Test on mln::morpho::opening::structural.
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/core/alias/window2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/morpho/opening/structural.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
using value::int_u8;
image2d<int_u8> lena, out;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
bool w[] = { 0, 1, 1,
0, 0, 1,
0, 0, 1 };
out = morpho::opening::structural(lena,
convert::to<window2d>(w));
io::pgm::save(out, "out.pgm");
}
// 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
......@@ -40,6 +41,7 @@
#include "tests/data.hh"
int main()
{
using namespace mln;
......
// Copyright (C) 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/elementary/top_hat.cc
///
/// Test on mln::morpho::top_hat.
#include <mln/core/image/image2d.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/debug/iota.hh>
#include <mln/debug/println.hh>
#include <mln/morpho/top_hat.hh>
int main()
{
using namespace mln;
using value::int_u8;
// trace::quiet = false;
image2d<int_u8> ima(3, 3, 0);
debug::iota(ima);
debug::println(ima);
debug::println( morpho::top_hat_white(ima, c4().win()) );
debug::println( morpho::top_hat_black(ima, c4().win()) );
debug::println( morpho::top_hat_self_complementary(ima, c4().win()) );
image2d<bool> msk(3, 3, 0);
data::fill(msk, pw::value(ima) >= pw::cst(5u));
debug::println(msk);
debug::println( morpho::top_hat_white(msk, c4().win()) );
debug::println( morpho::top_hat_black(msk, c4().win()) );
debug::println( morpho::top_hat_self_complementary(msk, c4().win()) );
}
Supports Markdown
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