* tests/img/lena.tiff: New.
Generated from Milena's lena.pgm using ImageMagick's convert.
* tests/Makefile.am (EXTRA_DIST): Add img/lena.tiff.
* tests/binarization/sauvola_ms_tiff.cc: New test.
* tests/binarization/sauvola_ms_tiff.ref.pbm: New reference output
image.
* tests/binarization/Makefile.am (check_PROGRAMS) [HAVE_TIFF]:
Add sauvola_ms_tiff.
(sauvola_ms_tiff_CPPFLAGS, sauvola_ms_tiff_LDFLAGS) [HAVE_TIFF]:
New.
(EXTRA_DIST): Add sauvola_ms_tiff.ref.pbm.
---
scribo/ChangeLog | 16 +++++++++++++
scribo/tests/Makefile.am | 1 +
scribo/tests/binarization/Makefile.am | 6 +++++
.../binarization/{otsu.cc => sauvola_ms_tiff.cc} | 24 ++++++++++----------
...{sauvola_ms.ref.pbm => sauvola_ms_tiff.ref.pbm} | Bin 32884 -> 32885 bytes
scribo/tests/img/lena.tiff | Bin 0 -> 262674 bytes
6 files changed, 35 insertions(+), 12 deletions(-)
copy scribo/tests/binarization/{otsu.cc => sauvola_ms_tiff.cc} (75%)
copy scribo/tests/binarization/{sauvola_ms.ref.pbm => sauvola_ms_tiff.ref.pbm} (99%)
create mode 100644 scribo/tests/img/lena.tiff
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 4f33ead..0a54632 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,19 @@
+2013-09-05 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Exercise the multi-scale Sauvola binarization with a TIFF image.
+
+ * tests/img/lena.tiff: New.
+ Generated from Milena's lena.pgm using ImageMagick's convert.
+ * tests/Makefile.am (EXTRA_DIST): Add img/lena.tiff.
+ * tests/binarization/sauvola_ms_tiff.cc: New test.
+ * tests/binarization/sauvola_ms_tiff.ref.pbm: New reference output
+ image.
+ * tests/binarization/Makefile.am (check_PROGRAMS) [HAVE_TIFF]:
+ Add sauvola_ms_tiff.
+ (sauvola_ms_tiff_CPPFLAGS, sauvola_ms_tiff_LDFLAGS) [HAVE_TIFF]:
+ New.
+ (EXTRA_DIST): Add sauvola_ms_tiff.ref.pbm.
+
2013-09-11 Roland Levillain <roland(a)lrde.epita.fr>
Scribo: Fix the use of QT_LIBS.
diff --git a/scribo/tests/Makefile.am b/scribo/tests/Makefile.am
index 819046b..ca6f297 100644
--- a/scribo/tests/Makefile.am
+++ b/scribo/tests/Makefile.am
@@ -23,6 +23,7 @@ EXTRA_DIST = \
img/alignment_3.pbm \
img/alignment_4.pbm \
img/comp_on_borders.pbm \
+ img/lena.tiff \
img/lena_weven_hodd.pgm \
img/lena_wodd_heven.pgm \
img/lena_wodd_hodd.pgm \
diff --git a/scribo/tests/binarization/Makefile.am
b/scribo/tests/binarization/Makefile.am
index 7458b1c..79b3e76 100644
--- a/scribo/tests/binarization/Makefile.am
+++ b/scribo/tests/binarization/Makefile.am
@@ -31,6 +31,7 @@ EXTRA_DIST = \
niblack_fast_weven_hodd.ref.pbm \
niblack_fast_wodd_hodd.ref.pbm \
sauvola_ms.ref.pbm \
+ sauvola_ms_tiff.ref.pbm \
sauvola_ms_wodd_heven.ref.pbm \
sauvola_ms_weven_hodd.ref.pbm \
sauvola_ms_wodd_hodd.ref.pbm \
@@ -60,6 +61,11 @@ check_PROGRAMS = \
wolf \
wolf_fast
+if HAVE_TIFF
+check_PROGRAMS += sauvola_ms_tiff
+sauvola_ms_tiff_CPPFLAGS = $(AM_CPPFLAGS) $(TIFF_CPPFLAGS)
+sauvola_ms_tiff_LDFLAGS = $(LDFLAGS) $(TIFF_LDFLAGS)
+endif HAVE_TIFF
TESTS = $(check_PROGRAMS)
diff --git a/scribo/tests/binarization/otsu.cc
b/scribo/tests/binarization/sauvola_ms_tiff.cc
similarity index 75%
copy from scribo/tests/binarization/otsu.cc
copy to scribo/tests/binarization/sauvola_ms_tiff.cc
index fd4c7f2..c9a26b6 100644
--- a/scribo/tests/binarization/otsu.cc
+++ b/scribo/tests/binarization/sauvola_ms_tiff.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2013 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,29 +24,29 @@
// executable file might be covered by the GNU General Public License.
/// \file
+/// \brief Exercise the multi-scale Sauvola binarization with a TIFF image.
#include <mln/core/image/image2d.hh>
-#include <mln/data/compare.hh>
#include <mln/value/int_u8.hh>
-#include <mln/io/pgm/load.hh>
+
#include <mln/io/pbm/load.hh>
-#include <mln/io/pbm/save.hh>
+#include <mln/io/tiff/load.hh>
+
+#include <mln/data/compare.hh>
-#include <scribo/binarization/otsu.hh>
+#include <scribo/binarization/sauvola_ms.hh>
#include "tests/data.hh"
int main()
{
using namespace mln;
+ using mln::value::int_u8;
- image2d<value::int_u8> input;
- io::pgm::load(input, MILENA_IMG_DIR "/lena.pgm");
-
- image2d<bool> bin = scribo::binarization::otsu(input);
-
+ image2d<int_u8> input;
+ io::tiff::load(input, SCRIBO_IMG_DIR "/lena.tiff");
+ image2d<bool> bin = scribo::binarization::sauvola_ms(input, 21, 2);
image2d<bool> ref;
- io::pbm::load(ref, SCRIBO_TESTS_DIR "binarization/otsu.ref.pbm");
-
+ io::pbm::load(ref, SCRIBO_TESTS_DIR
"/binarization/sauvola_ms_tiff.ref.pbm");
mln_assertion(bin == ref);
}
diff --git a/scribo/tests/binarization/sauvola_ms.ref.pbm
b/scribo/tests/binarization/sauvola_ms_tiff.ref.pbm
similarity index 99%
copy from scribo/tests/binarization/sauvola_ms.ref.pbm
copy to scribo/tests/binarization/sauvola_ms_tiff.ref.pbm
index 7f0e0c9..c9845fe 100644
Binary files a/scribo/tests/binarization/sauvola_ms.ref.pbm and
b/scribo/tests/binarization/sauvola_ms_tiff.ref.pbm differ
diff --git a/scribo/tests/img/lena.tiff b/scribo/tests/img/lena.tiff
new file mode 100644
index 0000000..7661a3a
Binary files /dev/null and b/scribo/tests/img/lena.tiff differ
--
1.7.10.4