* tests/binarization/sauvola_ms.cc,
* tests/binarization/sauvola_ms.ref.pbm,
* tests/binarization/sauvola_ms_weven_hodd.ref.pbm,
* tests/binarization/sauvola_ms_wodd_heven.ref.pbm,
* tests/binarization/sauvola_ms_wodd_hodd.ref.pbm: Make use of
reference files in test.
---
scribo/ChangeLog | 11 ++++++++
scribo/tests/binarization/sauvola_ms.cc | 27 ++++++++++---------
scribo/tests/binarization/sauvola_ms.ref.pbm | Bin 32884 -> 32884 bytes
.../binarization/sauvola_ms_weven_hodd.ref.pbm | Bin 32820 -> 32820 bytes
.../binarization/sauvola_ms_wodd_heven.ref.pbm | Bin 32884 -> 32884 bytes
.../binarization/sauvola_ms_wodd_hodd.ref.pbm | Bin 32820 -> 32820 bytes
6 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 4f1d5b9..af65bd5 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,16 @@
2013-03-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix sauvola_ms test.
+
+ * tests/binarization/sauvola_ms.cc,
+ * tests/binarization/sauvola_ms.ref.pbm,
+ * tests/binarization/sauvola_ms_weven_hodd.ref.pbm,
+ * tests/binarization/sauvola_ms_wodd_heven.ref.pbm,
+ * tests/binarization/sauvola_ms_wodd_hodd.ref.pbm: Make use of
+ reference files in test.
+
+2013-03-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix compilation issues.
* scribo/binarization/local_threshold.hh,
diff --git a/scribo/tests/binarization/sauvola_ms.cc
b/scribo/tests/binarization/sauvola_ms.cc
index e51c799..ba44798 100644
--- a/scribo/tests/binarization/sauvola_ms.cc
+++ b/scribo/tests/binarization/sauvola_ms.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -44,12 +45,12 @@ int main()
image2d<value::int_u8> input;
io::pgm::load(input, MILENA_IMG_DIR "/lena.pgm");
- image2d<bool> bin = scribo::binarization::sauvola_ms(input, 101, 2);
+ image2d<bool> bin = scribo::binarization::sauvola_ms(input, 21, 2);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR "/binarization/sauvola_ms.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR "/binarization/sauvola_ms.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// even height and odd width
@@ -57,12 +58,12 @@ int main()
image2d<value::int_u8> input;
io::pgm::load(input, SCRIBO_IMG_DIR "/lena_wodd_heven.pgm");
- image2d<bool> bin = scribo::binarization::sauvola_ms(input, 101, 2);
+ image2d<bool> bin = scribo::binarization::sauvola_ms(input, 21, 2);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/sauvola_ms_wodd_heven.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/sauvola_ms_wodd_heven.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// odd height and even width
@@ -70,12 +71,12 @@ int main()
image2d<value::int_u8> input;
io::pgm::load(input, SCRIBO_IMG_DIR "/lena_weven_hodd.pgm");
- image2d<bool> bin = scribo::binarization::sauvola_ms(input, 101, 2);
+ image2d<bool> bin = scribo::binarization::sauvola_ms(input, 21, 2);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/sauvola_ms_weven_hodd.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/sauvola_ms_weven_hodd.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
// odd height and width
@@ -83,11 +84,11 @@ int main()
image2d<value::int_u8> input;
io::pgm::load(input, SCRIBO_IMG_DIR "/lena_wodd_hodd.pgm");
- image2d<bool> bin = scribo::binarization::sauvola_ms(input, 101, 2);
+ image2d<bool> bin = scribo::binarization::sauvola_ms(input, 21, 2);
image2d<bool> ref;
- io::pbm::save(bin, SCRIBO_TESTS_DIR
"binarization/sauvola_ms_wodd_hodd.ref.pbm");
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"binarization/sauvola_ms_wodd_hodd.ref.pbm");
-// mln_assertion(bin == ref);
+ mln_assertion(bin == ref);
}
}
diff --git a/scribo/tests/binarization/sauvola_ms.ref.pbm
b/scribo/tests/binarization/sauvola_ms.ref.pbm
index 8128898..7f0e0c9 100644
Binary files a/scribo/tests/binarization/sauvola_ms.ref.pbm and
b/scribo/tests/binarization/sauvola_ms.ref.pbm differ
diff --git a/scribo/tests/binarization/sauvola_ms_weven_hodd.ref.pbm
b/scribo/tests/binarization/sauvola_ms_weven_hodd.ref.pbm
index b151f59..e3b5883 100644
Binary files a/scribo/tests/binarization/sauvola_ms_weven_hodd.ref.pbm and
b/scribo/tests/binarization/sauvola_ms_weven_hodd.ref.pbm differ
diff --git a/scribo/tests/binarization/sauvola_ms_wodd_heven.ref.pbm
b/scribo/tests/binarization/sauvola_ms_wodd_heven.ref.pbm
index 391cc61..be8098e 100644
Binary files a/scribo/tests/binarization/sauvola_ms_wodd_heven.ref.pbm and
b/scribo/tests/binarization/sauvola_ms_wodd_heven.ref.pbm differ
diff --git a/scribo/tests/binarization/sauvola_ms_wodd_hodd.ref.pbm
b/scribo/tests/binarization/sauvola_ms_wodd_hodd.ref.pbm
index eb59ebd..d8615f3 100644
Binary files a/scribo/tests/binarization/sauvola_ms_wodd_hodd.ref.pbm and
b/scribo/tests/binarization/sauvola_ms_wodd_hodd.ref.pbm differ
--
1.7.2.5