Commit ccc4a321 authored by Roland Levillain's avatar Roland Levillain
Browse files

Clean up some tests in tests/morpho/.

	* tests/morpho/rank_filter.cc: Do not include mln/io/pgm/save.hh.
	* tests/morpho/skeleton_constrained.cc: Likewise.
	(mln::show_connectivity_numbers): Move this function into the
	global namespace to avoid the pollution of the `mln' namespace.
	Aesthetic changes.
parent 5758dd72
2010-06-03 Roland Levillain <roland@lrde.epita.fr>
Clean up some tests in tests/morpho/.
* tests/morpho/rank_filter.cc: Do not include mln/io/pgm/save.hh.
* tests/morpho/skeleton_constrained.cc: Likewise.
(mln::show_connectivity_numbers): Move this function into the
global namespace to avoid the pollution of the `mln' namespace.
Aesthetic changes.
2010-06-03 Roland Levillain <roland@lrde.epita.fr>
 
Clean up a bit Milena's Makefiles.
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -28,7 +29,6 @@
#include <mln/core/alias/window2d.hh>
#include <mln/io/pgm/load.hh>
#include <mln/io/pgm/save.hh>
#include <mln/value/int_u8.hh>
#include <mln/data/fill.hh>
......@@ -37,7 +37,6 @@
#include <mln/morpho/rank_filter.hh>
#include <mln/morpho/dilation.hh>
#include <mln/pw/value.hh>
#include <mln/pw/cst.hh>
#include <mln/fun/ops.hh>
......
// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
//
......@@ -33,7 +34,6 @@
#include <mln/morpho/skeleton_constrained.hh>
#include <mln/io/pbm/load.hh>
#include <mln/io/pbm/save.hh>
#include <mln/data/fill.hh>
#include <mln/pw/value.hh>
......@@ -49,49 +49,46 @@
#include "tests/data.hh"
namespace mln
template <typename N>
void
show_connectivity_numbers(const mln::image2d<bool>& ima, const N& nbh)
{
mln::extension::adjust_duplicate(ima, nbh);
template <typename N>
void show_connectivity_numbers(const image2d<bool>& ima,
const N& nbh)
mln::image2d<unsigned> when_true(ima.domain()), when_false(ima.domain());
mln_piter(mln::box2d) p(ima.domain());
for_all(p)
{
extension::adjust_duplicate(ima, nbh);
image2d<unsigned> when_true(ima.domain()), when_false(ima.domain());
mln_piter(box2d) p(ima.domain());
for_all(p)
{
when_true(p) = connectivity_number_2d(ima, nbh.foreground(), p, true);
when_false(p) = connectivity_number_2d(ima, nbh.background(), p, false);
}
when_true(p) = connectivity_number_2d(ima, nbh.foreground(), p, true);
when_false(p) = connectivity_number_2d(ima, nbh.background(), p, false);
}
}
bool skl_ref_[22][18] =
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 } };
int main()
{
......@@ -103,8 +100,10 @@ int main()
image2d<bool> pic;
io::pbm::load(pic, MLN_IMG_DIR "/tiny.pbm");
typedef neighb<win::multiple_size<2u, window<dpoint<grid::square, short int> >,
pw::value_<image2d<bool> > > > nbh_t;
typedef
neighb<win::multiple_size<2u, window<dpoint<grid::square, short int> >,
pw::value_<image2d<bool> > > >
nbh_t;
nbh_t nbh = make::dual_neighb(pic, c4(), c8());
show_connectivity_numbers(pic, nbh);
......
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