* 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.
---
milena/ChangeLog | 23 +++++++++++++
milena/mln/morpho/closing/area.hh | 2 +-
milena/mln/morpho/closing/leveling.hh | 59 ++++++++++++++++++--------------
milena/mln/morpho/rank_filter.hh | 5 ++-
milena/tests/morpho/Makefile.am | 2 +
milena/tests/morpho/closing/area.cc | 2 +-
milena/tests/morpho/closing/height.cc | 2 +-
milena/tests/morpho/closing/sum.cc | 2 +-
milena/tests/morpho/closing/volume.cc | 2 +-
milena/tests/morpho/opening/area.cc | 2 +-
milena/tests/morpho/opening/height.cc | 2 +-
milena/tests/morpho/opening/sum.cc | 2 +-
milena/tests/morpho/opening/volume.cc | 2 +-
13 files changed, 70 insertions(+), 37 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index d961175..6e55f81 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,28 @@
2009-03-03 Guillaume Lazzara <lazzara(a)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(a)lrde.epita.fr>
+
Add a specialization of level::convert.
* mln/level/convert.hh: Add a specialization while the conversion
diff --git a/milena/mln/morpho/closing/area.hh b/milena/mln/morpho/closing/area.hh
index a351262..f805c31 100644
--- a/milena/mln/morpho/closing/area.hh
+++ b/milena/mln/morpho/closing/area.hh
@@ -1,4 +1,4 @@
-// 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
diff --git a/milena/mln/morpho/closing/leveling.hh
b/milena/mln/morpho/closing/leveling.hh
index 32a34c8..7825166 100644
--- a/milena/mln/morpho/closing/leveling.hh
+++ b/milena/mln/morpho/closing/leveling.hh
@@ -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
diff --git a/milena/mln/morpho/rank_filter.hh b/milena/mln/morpho/rank_filter.hh
index fe99eb9..4b36695 100644
--- a/milena/mln/morpho/rank_filter.hh
+++ b/milena/mln/morpho/rank_filter.hh
@@ -1,4 +1,5 @@
-// 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
diff --git a/milena/tests/morpho/Makefile.am b/milena/tests/morpho/Makefile.am
index 4775e6f..909488f 100644
--- a/milena/tests/morpho/Makefile.am
+++ b/milena/tests/morpho/Makefile.am
@@ -4,7 +4,9 @@ include $(top_srcdir)/milena/tests/tests.mk
SUBDIRS = \
attribute \
+ closing \
elementary \
+ opening \
tree \
watershed
diff --git a/milena/tests/morpho/closing/area.cc b/milena/tests/morpho/closing/area.cc
index 711f178..c26f49f 100644
--- a/milena/tests/morpho/closing/area.cc
+++ b/milena/tests/morpho/closing/area.cc
@@ -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");
}
diff --git a/milena/tests/morpho/closing/height.cc
b/milena/tests/morpho/closing/height.cc
index 6a9561e..575a080 100644
--- a/milena/tests/morpho/closing/height.cc
+++ b/milena/tests/morpho/closing/height.cc
@@ -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");
}
diff --git a/milena/tests/morpho/closing/sum.cc b/milena/tests/morpho/closing/sum.cc
index c933da9..269b36d 100644
--- a/milena/tests/morpho/closing/sum.cc
+++ b/milena/tests/morpho/closing/sum.cc
@@ -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),
diff --git a/milena/tests/morpho/closing/volume.cc
b/milena/tests/morpho/closing/volume.cc
index fccfa8e..d26bb6f 100644
--- a/milena/tests/morpho/closing/volume.cc
+++ b/milena/tests/morpho/closing/volume.cc
@@ -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");
diff --git a/milena/tests/morpho/opening/area.cc b/milena/tests/morpho/opening/area.cc
index bfa0df7..cd9eacf 100644
--- a/milena/tests/morpho/opening/area.cc
+++ b/milena/tests/morpho/opening/area.cc
@@ -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);
diff --git a/milena/tests/morpho/opening/height.cc
b/milena/tests/morpho/opening/height.cc
index cebfd2e..eb46824 100644
--- a/milena/tests/morpho/opening/height.cc
+++ b/milena/tests/morpho/opening/height.cc
@@ -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);
diff --git a/milena/tests/morpho/opening/sum.cc b/milena/tests/morpho/opening/sum.cc
index 0be3b8e..6eaaafc 100644
--- a/milena/tests/morpho/opening/sum.cc
+++ b/milena/tests/morpho/opening/sum.cc
@@ -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");
}
diff --git a/milena/tests/morpho/opening/volume.cc
b/milena/tests/morpho/opening/volume.cc
index 0fb7f64..c72b88c 100644
--- a/milena/tests/morpho/opening/volume.cc
+++ b/milena/tests/morpho/opening/volume.cc
@@ -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);
--
1.5.6.5