URL:
https://svn.lrde.epita.fr/svn/oln/trunk
ChangeLog:
2009-02-28 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Correct bugs in tests.
* milena/mln/morpho/closing/algebraic.hh,
* milena/mln/morpho/closing/leveling.hh: Correct some bugs.
* milena/tests/morpho/closing/Makefile.am,
* milena/tests/morpho/closing/algebraic.cc,
* milena/tests/morpho/closing/leveling.cc,
* milena/tests/morpho/opening/Makefile.am,
* milena/tests/morpho/opening/algebraic.cc,
* milena/tests/morpho/opening/leveling.cc:
Correct some bugs and comment reference code using generic accumulators.
---
mln/morpho/closing/algebraic.hh | 2 +-
mln/morpho/closing/leveling.hh | 4 ++--
tests/morpho/closing/Makefile.am | 2 +-
tests/morpho/closing/algebraic.cc | 13 +++++++------
tests/morpho/closing/leveling.cc | 13 +++++++------
tests/morpho/opening/Makefile.am | 2 +-
tests/morpho/opening/algebraic.cc | 13 +++++++------
tests/morpho/opening/leveling.cc | 13 +++++++------
8 files changed, 33 insertions(+), 29 deletions(-)
Index: trunk/milena/tests/morpho/closing/Makefile.am
===================================================================
--- trunk/milena/tests/morpho/closing/Makefile.am (revision 3440)
+++ trunk/milena/tests/morpho/closing/Makefile.am (revision 3441)
@@ -2,7 +2,7 @@
include $(top_srcdir)/milena/tests/tests.mk
-check_PROGRAMS =
+check_PROGRAMS = \
leveling \
algebraic \
height \
Index: trunk/milena/tests/morpho/closing/leveling.cc
===================================================================
--- trunk/milena/tests/morpho/closing/leveling.cc (revision 3440)
+++ trunk/milena/tests/morpho/closing/leveling.cc (revision 3441)
@@ -38,7 +38,6 @@
#include <mln/morpho/closing/leveling.hh>
#include <mln/morpho/attribute/volume.hh>
-#include <mln/accu/count.hh>
#include "tests/data.hh"
@@ -54,11 +53,13 @@
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");
- }
+
+// FIXME: Can't be called with new implementation. (When_pix = not_ok).
+// {
+// accu::volume<I> 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),
Index: trunk/milena/tests/morpho/closing/algebraic.cc
===================================================================
--- trunk/milena/tests/morpho/closing/algebraic.cc (revision 3440)
+++ trunk/milena/tests/morpho/closing/algebraic.cc (revision 3441)
@@ -38,7 +38,6 @@
#include <mln/morpho/closing/algebraic.hh>
#include <mln/morpho/attribute/card.hh>
-#include <mln/accu/count.hh>
#include "tests/data.hh"
@@ -54,11 +53,13 @@
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::algebraic(lena, c4(), a, 10),
- "ref.pgm");
- }
+
+// FIXME: Can't be called with new implementation. (When_pix = not_ok).
+// {
+// accu::count<point2d> a;
+// 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),
Index: trunk/milena/tests/morpho/opening/Makefile.am
===================================================================
--- trunk/milena/tests/morpho/opening/Makefile.am (revision 3440)
+++ trunk/milena/tests/morpho/opening/Makefile.am (revision 3441)
@@ -2,7 +2,7 @@
include $(top_srcdir)/milena/tests/tests.mk
-check_PROGRAMS =
+check_PROGRAMS = \
leveling \
algebraic \
height \
Index: trunk/milena/tests/morpho/opening/leveling.cc
===================================================================
--- trunk/milena/tests/morpho/opening/leveling.cc (revision 3440)
+++ trunk/milena/tests/morpho/opening/leveling.cc (revision 3441)
@@ -38,7 +38,6 @@
#include <mln/morpho/opening/leveling.hh>
#include <mln/morpho/attribute/volume.hh>
-#include <mln/accu/count.hh>
#include "tests/data.hh"
@@ -54,11 +53,13 @@
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");
- }
+
+// FIXME: Can't be called with new implementation. (When_pix = not_ok).
+// {
+// accu::volume<I> 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),
Index: trunk/milena/tests/morpho/opening/algebraic.cc
===================================================================
--- trunk/milena/tests/morpho/opening/algebraic.cc (revision 3440)
+++ trunk/milena/tests/morpho/opening/algebraic.cc (revision 3441)
@@ -38,7 +38,6 @@
#include <mln/morpho/opening/algebraic.hh>
#include <mln/morpho/attribute/card.hh>
-#include <mln/accu/count.hh>
#include "tests/data.hh"
@@ -54,11 +53,13 @@
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");
- }
+
+// FIXME: Can't be called with new implementation. (When_pix = not_ok).
+// {
+// 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),
Index: trunk/milena/mln/morpho/closing/leveling.hh
===================================================================
--- trunk/milena/mln/morpho/closing/leveling.hh (revision 3440)
+++ trunk/milena/mln/morpho/closing/leveling.hh (revision 3441)
@@ -62,8 +62,8 @@
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_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,
Index: trunk/milena/mln/morpho/closing/algebraic.hh
===================================================================
--- trunk/milena/mln/morpho/closing/algebraic.hh (revision 3440)
+++ trunk/milena/mln/morpho/closing/algebraic.hh (revision 3441)
@@ -63,7 +63,7 @@
mln_precondition(exact(input).is_valid());
mln_precondition(mlc_equal(mln_trait_accumulator_when_pix(A),
- trait::accumulator::when_pix::not_ok)::value)
+ trait::accumulator::when_pix::not_ok)::value);
mln_concrete(I) output;
output = algebraic_filter(input, nbh, accu, lambda,