* tests/Makefile.am: Add more files in EXTRA_DIST.
* tests/binarization/niblack.cc,
* tests/binarization/wolf.cc: Load reference file instead of saving it.
---
scribo/ChangeLog | 9 +++++++++
scribo/tests/Makefile.am | 4 ++++
scribo/tests/binarization/niblack.cc | 16 ++++++++--------
scribo/tests/binarization/wolf.cc | 16 ++++++++--------
4 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index ebf34aa..ea6bc10 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,12 @@
+2013-04-04 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix binarization tests.
+
+ * tests/Makefile.am: Add more files in EXTRA_DIST.
+ * tests/binarization/niblack.cc,
+ * tests/binarization/wolf.cc: Load reference file instead of
+ saving it.
+
2013-04-02 Guillaume Lazzara <z(a)lrde.epita.fr>
Fix component_set comparison.
diff --git a/scribo/tests/Makefile.am b/scribo/tests/Makefile.am
index 4d6ce66..8c05d3e 100644
--- a/scribo/tests/Makefile.am
+++ b/scribo/tests/Makefile.am
@@ -23,6 +23,9 @@ EXTRA_DIST = \
img/alignment_3.pbm \
img/alignment_4.pbm \
img/comp_on_borders.pbm \
+ lena_weven_hodd.pgm \
+ lena_wodd_heven.pgm \
+ lena_wodd_hodd.pgm \
img/lines_discontinued.pbm \
img/multi_scale.png \
img/phillip.pbm \
@@ -39,6 +42,7 @@ EXTRA_DIST = \
img/the_valleys.pbm \
img/wildly.pbm
+
SUBDIRS = \
binarization \
convert \
diff --git a/scribo/tests/binarization/niblack.cc b/scribo/tests/binarization/niblack.cc
index 673a93e..7f6891f 100644
--- a/scribo/tests/binarization/niblack.cc
+++ b/scribo/tests/binarization/niblack.cc
@@ -47,9 +47,9 @@ int main()
image2d<bool> bin = scribo::binarization::niblack(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR "binarization/niblack.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR "binarization/niblack.ref.pbm");
- //mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// even height and odd width
@@ -60,9 +60,9 @@ int main()
image2d<bool> bin = scribo::binarization::niblack(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/niblack_wodd_heven.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/niblack_wodd_heven.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// odd height and even width
@@ -73,9 +73,9 @@ int main()
image2d<bool> bin = scribo::binarization::niblack(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/niblack_weven_hodd.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/niblack_weven_hodd.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// odd height and width
@@ -86,8 +86,8 @@ int main()
image2d<bool> bin = scribo::binarization::niblack(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/niblack_wodd_hodd.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/niblack_wodd_hodd.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
}
diff --git a/scribo/tests/binarization/wolf.cc b/scribo/tests/binarization/wolf.cc
index 0c4b4e3..27d7cd2 100644
--- a/scribo/tests/binarization/wolf.cc
+++ b/scribo/tests/binarization/wolf.cc
@@ -47,9 +47,9 @@ int main()
image2d<bool> bin = scribo::binarization::wolf(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR "binarization/wolf.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR "binarization/wolf.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// even height and odd width
@@ -60,9 +60,9 @@ int main()
image2d<bool> bin = scribo::binarization::wolf(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/wolf_wodd_heven.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/wolf_wodd_heven.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// odd height and even width
@@ -73,9 +73,9 @@ int main()
image2d<bool> bin = scribo::binarization::wolf(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/wolf_weven_hodd.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/wolf_weven_hodd.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// odd height and width
@@ -86,8 +86,8 @@ int main()
image2d<bool> bin = scribo::binarization::wolf(input, 101);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/wolf_wodd_hodd.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/wolf_wodd_hodd.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
}
--
1.7.2.5