Commit 02c779ad authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Small fixes related to morpho.

	* mln/morpho/closing/area.hh: update copyright.

	* mln/morpho/closing/leveling.hh: fix guard and revamp.

	* mln/morpho/rank_filter.hh: update forward declaration.

	* tests/morpho/Makefile.am: run tests in morpho/closing and
	morpho/opening.

	* tests/morpho/closing/area.cc,
	* tests/morpho/closing/height.cc,
	* tests/morpho/closing/sum.cc,
	* tests/morpho/closing/volume.cc,
	* tests/morpho/opening/area.cc,
	* tests/morpho/opening/height.cc,
	* tests/morpho/opening/sum.cc,
	* tests/morpho/opening/volume.cc: use tiny.ppm instead of lena.ppm, it
	is faster.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3469 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent a1ca9a44
2009-03-03 Guillaume Lazzara <lazzara@lrde.epita.fr>
Small fixes related to morpho.
* mln/morpho/closing/area.hh: update copyright.
* mln/morpho/closing/leveling.hh: fix guard and revamp.
* mln/morpho/rank_filter.hh: update forward declaration.
* tests/morpho/Makefile.am: run tests in morpho/closing and
morpho/opening.
* tests/morpho/closing/area.cc,
* tests/morpho/closing/height.cc,
* tests/morpho/closing/sum.cc,
* tests/morpho/closing/volume.cc,
* tests/morpho/opening/area.cc,
* tests/morpho/opening/height.cc,
* tests/morpho/opening/sum.cc,
* tests/morpho/opening/volume.cc: use tiny.ppm instead of lena.ppm, it
is faster.
2009-03-03 Guillaume Lazzara <lazzara@lrde.epita.fr>
 
Add a specialization of level::convert.
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Olena Library. This library is free
......
......@@ -26,7 +26,7 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_MORPHO_OPENING_LEVELING_HH
#ifndef MLN_MORPHO_CLOSING_LEVELING_HH
# define MLN_MORPHO_CLOSING_LEVELING_HH
/// \file mln/morpho/closing/leveling.hh
......@@ -37,15 +37,20 @@
# include <mln/morpho/leveling_filter.hh>
namespace mln {
namespace morpho {
namespace closing {
namespace mln
{
/// 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);
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);
......@@ -53,33 +58,35 @@ namespace mln {
# 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");
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_not_equal(mln_trait_accumulator_when_pix(A),
trait::accumulator::when_pix::not_ok)::value);
mln_precondition(exact(input).is_valid());
mln_precondition(mlc_not_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_concrete(I) output;
output = leveling_filter(input, nbh, accu, lambda,
/* increasing = */ true);
mln_postcondition(output >= input);
mln_postcondition(output >= input);
trace::exiting("morpho::closing::leveling");
return output;
}
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
......
// 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
......@@ -44,7 +45,7 @@ namespace mln
/// Morphological rank_filter.
template <typename I, typename W>
mln_concrete(I)
rank_filter(const Image<I>& input, const Window<W>& win);
rank_filter(const Image<I>& input, const Window<W>& win, unsigned k);
# ifndef MLN_INCLUDE_ONLY
......
......@@ -4,7 +4,9 @@ include $(top_srcdir)/milena/tests/tests.mk
SUBDIRS = \
attribute \
closing \
elementary \
opening \
tree \
watershed
......
......@@ -49,6 +49,6 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
io::pgm::save(morpho::closing::area(lena, c4(), 510), "out.pgm");
}
......@@ -48,6 +48,6 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
io::pgm::save(morpho::closing::height(lena, c4(), 20), "out.pgm");
}
......@@ -51,7 +51,7 @@ int main()
typedef image2d<int_u8> I;
I lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
typedef morpho::attribute::sum<I> A;
io::pgm::save(morpho::closing::leveling(lena, c4(), A(), 10000),
......
......@@ -50,7 +50,7 @@ int main()
typedef image2d<int_u8> I;
I lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
io::pgm::save(morpho::closing::volume(lena, c4(), 10000),
"ref.pgm");
......
......@@ -48,7 +48,7 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out(lena.domain());
out = morpho::opening::area(lena, c4(), 510);
......
......@@ -48,7 +48,7 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out(lena.domain());
out = morpho::opening::height(lena, c4(), 20);
......
......@@ -52,7 +52,7 @@ int main()
I lena;
typedef morpho::attribute::sum<I> A;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
io::pgm::save(morpho::opening::leveling(lena, c4(), A(), 10000),
"out.pgm");
}
......@@ -48,7 +48,7 @@ int main()
using value::int_u8;
image2d<int_u8> lena;
io::pgm::load(lena, MLN_IMG_DIR "/lena.pgm");
io::pgm::load(lena, MLN_IMG_DIR "/tiny.pgm");
image2d<int_u8> out(lena.domain());
out = morpho::opening::volume(lena, c4(), 10000);
......
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