Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
* tests/literal/Makefile.am: Update targets.
* tests/literal/colors.cc,
* tests/literal/identity.cc,
* tests/literal/max.cc,
* tests/literal/min.cc,
* tests/literal/origin.cc: New.
* tests/literal/medium_gray.cc: Make a real test.
---
milena/ChangeLog | 14 +++++
milena/tests/literal/Makefile.am | 12 ++++-
.../tests/literal/colors.cc | 62 +++++++++++---------
.../tests/literal/identity.cc | 31 +++++-----
.../color_type.hh => milena/tests/literal/max.cc | 27 ++++-----
milena/tests/literal/medium_gray.cc | 25 +++-----
.../color_type.hh => milena/tests/literal/min.cc | 27 ++++-----
.../{core/site_set/box.cc => literal/origin.cc} | 18 +++---
8 files changed, 118 insertions(+), 98 deletions(-)
copy scribo/tests/filter/object_links_left_aligned.cc => milena/tests/literal/colors.cc (55%)
copy scribo/scribo/core/def/color_type.hh => milena/tests/literal/identity.cc (79%)
copy scribo/scribo/core/def/color_type.hh => milena/tests/literal/max.cc (79%)
copy scribo/scribo/core/def/color_type.hh => milena/tests/literal/min.cc (79%)
copy milena/tests/{core/site_set/box.cc => literal/origin.cc} (81%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index bbbc6ea..fdf84db 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,19 @@
2011-11-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Improve tests for literal classes.
+
+ * tests/literal/Makefile.am: Update targets.
+
+ * tests/literal/colors.cc,
+ * tests/literal/identity.cc,
+ * tests/literal/max.cc,
+ * tests/literal/min.cc,
+ * tests/literal/origin.cc: New.
+
+ * tests/literal/medium_gray.cc: Make a real test.
+
+2011-11-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix compilation with multiple files.
* mln/canvas/browsing/backdiagonal2d.hh,
diff --git a/milena/tests/literal/Makefile.am b/milena/tests/literal/Makefile.am
index ef86851..81e3a16 100644
--- a/milena/tests/literal/Makefile.am
+++ b/milena/tests/literal/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+# Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
# Laboratory (LRDE).
#
# This file is part of Olena.
@@ -19,14 +19,24 @@ include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
black \
+ colors \
+ identity \
+ max \
medium_gray \
+ min \
one \
+ origin \
white \
zero
black_SOURCES = black.cc
+colors_SOURCES = colors.cc
+identity_SOURCES = identity.cc
+max_SOURCES = max.cc
medium_gray_SOURCES = medium_gray.cc
+min_SOURCES = min.cc
one_SOURCES = one.cc
+origin_SOURCES = origin.cc
white_SOURCES = white.cc
zero_SOURCES = zero.cc
diff --git a/scribo/tests/filter/object_links_left_aligned.cc b/milena/tests/literal/colors.cc
similarity index 55%
copy from scribo/tests/filter/object_links_left_aligned.cc
copy to milena/tests/literal/colors.cc
index ce630f5..2635dc8 100644
--- a/scribo/tests/filter/object_links_left_aligned.cc
+++ b/milena/tests/literal/colors.cc
@@ -25,45 +25,53 @@
/// \file
-#include <iostream>
+#include <mln/value/rgb8.hh>
+#include <mln/literal/colors.hh>
-#include <mln/core/image/image2d.hh>
-#include <mln/core/alias/neighb2d.hh>
-#include <mln/io/pbm/load.hh>
-#include <scribo/core/def/lbl_type.hh>
-#include <scribo/primitive/extract/components.hh>
-#include <scribo/primitive/link/with_single_left_link.hh>
-#include <scribo/filter/object_links_left_aligned.hh>
-
-#include "tests/data.hh"
int main()
{
- using namespace scribo;
using namespace mln;
- std::string img = SCRIBO_IMG_DIR "/phillip.pbm";
+ value::rgb8 v = literal::red;
+ mln_assertion(v == value::rgb8(255, 0, 0));
+
+ v = literal::green;
+ mln_assertion(v == value::rgb8(0, 255, 0));
+
+ v = literal::blue;
+ mln_assertion(v == value::rgb8(0, 0, 255));
+
+ v = literal::brown;
+ mln_assertion(v == value::rgb8(191, 127, 64));
+
+ v = literal::lime;
+ mln_assertion(v == value::rgb8(191, 255, 0));
+
+ v = literal::orange;
+ mln_assertion(v == value::rgb8(255, 127, 0));
- const unsigned ref[] = { 0, 2, 6, 8, 3, 4, 6, 9, 2, 4 };
- const unsigned filtered_ref[] = { 0, 2, 2, 8, 4, 4, 6, 9, 2, 4 };
+ v = literal::pink;
+ mln_assertion(v == value::rgb8(255, 191, 191));
- image2d<bool> input;
- io::pbm::load(input, img.c_str());
+ v = literal::purple;
+ mln_assertion(v == value::rgb8(191, 0, 64));
- typedef scribo::def::lbl_type V;
- typedef image2d<V> L;
+ v = literal::teal;
+ mln_assertion(v == value::rgb8(0, 127, 127));
- V nbboxes;
- component_set<L>
- text = primitive::extract::components(input, c8(), nbboxes);
+ v = literal::violet;
+ mln_assertion(v == value::rgb8(127, 0, 127));
- object_links<L> links = primitive::link::with_single_left_link(text, 30);
+ v = literal::cyan;
+ mln_assertion(v == value::rgb8(0, 255, 255));
- for_all_links(l, links)
- mln_assertion(links(l) == ref[l]);
+ v = literal::magenta;
+ mln_assertion(v == value::rgb8(255, 0, 255));
- links = scribo::filter::object_links_left_aligned(links, 80.f);
+ v = literal::yellow;
+ mln_assertion(v == value::rgb8(255, 255, 0));
- for_all_links(l, links)
- mln_assertion(links(l) == filtered_ref[l]);
+ v = literal::olive;
+ mln_assertion(v == value::rgb8(127, 127, 0));
}
diff --git a/scribo/scribo/core/def/color_type.hh b/milena/tests/literal/identity.cc
similarity index 79%
copy from scribo/scribo/core/def/color_type.hh
copy to milena/tests/literal/identity.cc
index 7acd334..e8cbc3d 100644
--- a/scribo/scribo/core/def/color_type.hh
+++ b/milena/tests/literal/identity.cc
@@ -23,26 +23,25 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_CORE_COLOR_TYPE_HH
-# define SCRIBO_CORE_COLOR_TYPE_HH
-
/// \file
-///
-/// Global type definition for labels.
-
-# include <mln/value/rgb8.hh>
+#include <mln/core/contract.hh>
+#include <mln/literal/identity.hh>
+#include <mln/algebra/mat.hh>
+#include <mln/make/mat.hh>
-namespace scribo
-{
- namespace def
- {
- typedef mln::value::rgb8 color_type;
-
- } // end of namespace scribo::def
+int main()
+{
+ using namespace mln;
-} // end of namespace scribo
+ int val[4] = {
+ 1, 0 ,
+ 0, 1
+ };
-#endif // ! SCRIBO_CORE_DEF_HH
+ algebra::mat<2,2, int> m = literal::identity;
+ algebra::mat<2,2, int> ref = make::mat<2,2>(val);
+ mln_assertion(m == ref);
+}
diff --git a/scribo/scribo/core/def/color_type.hh b/milena/tests/literal/max.cc
similarity index 79%
copy from scribo/scribo/core/def/color_type.hh
copy to milena/tests/literal/max.cc
index 7acd334..5bbf170 100644
--- a/scribo/scribo/core/def/color_type.hh
+++ b/milena/tests/literal/max.cc
@@ -23,26 +23,23 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_CORE_COLOR_TYPE_HH
-# define SCRIBO_CORE_COLOR_TYPE_HH
-
/// \file
-///
-/// Global type definition for labels.
-
-# include <mln/value/rgb8.hh>
+#include <mln/literal/max.hh>
+#include <mln/value/int_u8.hh>
-namespace scribo
-{
- namespace def
- {
- typedef mln::value::rgb8 color_type;
+int main()
+{
+ using namespace mln;
- } // end of namespace scribo::def
+ unsigned char c = literal::max;
+ mln_assertion(c == mln_max(unsigned char));
-} // end of namespace scribo
+ double d = literal::max;
+ mln_assertion(d == mln_max(double));
-#endif // ! SCRIBO_CORE_DEF_HH
+ value::int_u8 v = literal::max;
+ mln_assertion(v == mln_max(value::int_u8));
+}
diff --git a/milena/tests/literal/medium_gray.cc b/milena/tests/literal/medium_gray.cc
index 75995fb..278c46c 100644
--- a/milena/tests/literal/medium_gray.cc
+++ b/milena/tests/literal/medium_gray.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,6 +24,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/literal/grays.hh>
#include <mln/value/graylevel.hh>
#include <mln/value/gl8.hh>
@@ -33,20 +36,12 @@ int main()
{
using namespace mln;
- using literal::medium_gray;
- using value::gl8;
- using value::gl16;
-
- gl8 a;
- gl16 b;
-
- a = medium_gray;
-
- std::cout << int(a.value()) << std::endl;
+ value::gl8 a = literal::medium_gray;
+ mln_assertion(a == value::gl8(128));
- b = a;
- std::cout << int(b.value()) << std::endl;
+ value::gl16 b = a;
+ mln_assertion(b == value::gl16(32768));
- b = medium_gray;
- std::cout << int(b.value()) << std::endl;
+ b = literal::medium_gray;
+ mln_assertion(b == value::gl16(32768));
}
diff --git a/scribo/scribo/core/def/color_type.hh b/milena/tests/literal/min.cc
similarity index 79%
copy from scribo/scribo/core/def/color_type.hh
copy to milena/tests/literal/min.cc
index 7acd334..254f5f9 100644
--- a/scribo/scribo/core/def/color_type.hh
+++ b/milena/tests/literal/min.cc
@@ -23,26 +23,23 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_CORE_COLOR_TYPE_HH
-# define SCRIBO_CORE_COLOR_TYPE_HH
-
/// \file
-///
-/// Global type definition for labels.
-
-# include <mln/value/rgb8.hh>
+#include <mln/literal/min.hh>
+#include <mln/value/int_u8.hh>
-namespace scribo
-{
- namespace def
- {
- typedef mln::value::rgb8 color_type;
+int main()
+{
+ using namespace mln;
- } // end of namespace scribo::def
+ unsigned char c = literal::min;
+ mln_assertion(c == mln_min(unsigned char));
-} // end of namespace scribo
+ double d = literal::min;
+ mln_assertion(d == mln_min(double));
-#endif // ! SCRIBO_CORE_DEF_HH
+ value::int_u8 v = literal::min;
+ mln_assertion(v == mln_min(value::int_u8));
+}
diff --git a/milena/tests/core/site_set/box.cc b/milena/tests/literal/origin.cc
similarity index 81%
copy from milena/tests/core/site_set/box.cc
copy to milena/tests/literal/origin.cc
index ad5c119..312948d 100644
--- a/milena/tests/core/site_set/box.cc
+++ b/milena/tests/literal/origin.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,20 +23,20 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#include <mln/core/site_set/box.hh>
-#include <mln/core/alias/box2d.hh>
+/// \file
+
#include <mln/core/alias/point2d.hh>
+#include <mln/core/alias/point3d.hh>
+#include <mln/literal/origin.hh>
int main()
{
using namespace mln;
- box2d
- b1(point2d(0,0), point2d(3, 4)),
- b2(point2d(-1,-1), point2d(4, 5));
-
- b1.merge(b2);
+ point2d p2 = literal::origin;
+ mln_assertion(p2 == point2d(0, 0));
- mln_assertion(b1 == b2);
+ point3d p3 = literal::origin;
+ mln_assertion(p3 == point3d(0, 0, 0));
}
--
1.7.2.5
1
0
23 Nov '11
* mln/canvas/browsing/backdiagonal2d.hh,
* mln/canvas/browsing/breadth_first_search.hh,
* mln/canvas/browsing/depth_first_search.hh,
* mln/canvas/browsing/diagonal2d.hh,
* mln/canvas/browsing/dir_struct_elt_incr_update.hh,
* mln/canvas/browsing/directional.hh,
* mln/canvas/browsing/fwd.hh,
* mln/canvas/browsing/hyper_directional.hh,
* mln/canvas/browsing/snake_fwd.hh,
* mln/canvas/browsing/snake_generic.hh,
* mln/canvas/browsing/snake_vert.hh,
* mln/fun/v2v/hsi_to_rgb.hh,
* mln/fun/v2v/rgb_to_hsi.hh,
* mln/fun/v2v/rgb_to_hsl.hh,
* mln/literal/black.hh,
* mln/literal/colors.hh,
* mln/literal/grays.hh,
* mln/literal/max.hh,
* mln/literal/min.hh,
* mln/literal/white.hh: Add missing inline keyword and
MLN_WO_GLOBAL_VARS guards.
---
milena/ChangeLog | 26 ++++++++++++++++++++
milena/mln/canvas/browsing/backdiagonal2d.hh | 1 +
milena/mln/canvas/browsing/breadth_first_search.hh | 9 +++++-
milena/mln/canvas/browsing/depth_first_search.hh | 1 +
milena/mln/canvas/browsing/diagonal2d.hh | 1 +
.../canvas/browsing/dir_struct_elt_incr_update.hh | 5 ++++
milena/mln/canvas/browsing/directional.hh | 1 +
milena/mln/canvas/browsing/fwd.hh | 6 ++++
milena/mln/canvas/browsing/hyper_directional.hh | 6 ++++
milena/mln/canvas/browsing/snake_fwd.hh | 1 +
milena/mln/canvas/browsing/snake_generic.hh | 1 +
milena/mln/canvas/browsing/snake_vert.hh | 3 ++
milena/mln/fun/v2v/hsi_to_rgb.hh | 6 ++++-
milena/mln/fun/v2v/rgb_to_hsi.hh | 6 ++++-
milena/mln/fun/v2v/rgb_to_hsl.hh | 7 ++++-
milena/mln/literal/black.hh | 1 +
milena/mln/literal/colors.hh | 14 ++++++++++
milena/mln/literal/grays.hh | 4 +++
milena/mln/literal/max.hh | 6 ++++-
milena/mln/literal/min.hh | 5 +++-
milena/mln/literal/white.hh | 1 +
21 files changed, 103 insertions(+), 8 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8817868..bbbc6ea 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,29 @@
+2011-11-23 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix compilation with multiple files.
+
+ * mln/canvas/browsing/backdiagonal2d.hh,
+ * mln/canvas/browsing/breadth_first_search.hh,
+ * mln/canvas/browsing/depth_first_search.hh,
+ * mln/canvas/browsing/diagonal2d.hh,
+ * mln/canvas/browsing/dir_struct_elt_incr_update.hh,
+ * mln/canvas/browsing/directional.hh,
+ * mln/canvas/browsing/fwd.hh,
+ * mln/canvas/browsing/hyper_directional.hh,
+ * mln/canvas/browsing/snake_fwd.hh,
+ * mln/canvas/browsing/snake_generic.hh,
+ * mln/canvas/browsing/snake_vert.hh,
+ * mln/fun/v2v/hsi_to_rgb.hh,
+ * mln/fun/v2v/rgb_to_hsi.hh,
+ * mln/fun/v2v/rgb_to_hsl.hh,
+ * mln/literal/black.hh,
+ * mln/literal/colors.hh,
+ * mln/literal/grays.hh,
+ * mln/literal/max.hh,
+ * mln/literal/min.hh,
+ * mln/literal/white.hh: Add missing inline keyword and
+ MLN_WO_GLOBAL_VARS guards.
+
2011-11-22 Guillaume Lazzara <z(a)lrde.epita.fr>
Add two variants of the threshold function.
diff --git a/milena/mln/canvas/browsing/backdiagonal2d.hh b/milena/mln/canvas/browsing/backdiagonal2d.hh
index 0ec455e..adfdecb 100644
--- a/milena/mln/canvas/browsing/backdiagonal2d.hh
+++ b/milena/mln/canvas/browsing/backdiagonal2d.hh
@@ -102,6 +102,7 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS
+ inline
backdiagonal2d_t::backdiagonal2d_t()
{
}
diff --git a/milena/mln/canvas/browsing/breadth_first_search.hh b/milena/mln/canvas/browsing/breadth_first_search.hh
index a637114..a7a8bce 100644
--- a/milena/mln/canvas/browsing/breadth_first_search.hh
+++ b/milena/mln/canvas/browsing/breadth_first_search.hh
@@ -91,12 +91,17 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
- const breadth_first_search_t breadth_first_search;
-
+ inline
breadth_first_search_t::breadth_first_search_t()
{
}
+# ifndef MLN_WO_GLOBAL_VARS
+
+ const breadth_first_search_t breadth_first_search;
+
+# endif // ! MLN_WO_GLOBAL_VARS
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::canvas::browsing
diff --git a/milena/mln/canvas/browsing/depth_first_search.hh b/milena/mln/canvas/browsing/depth_first_search.hh
index ecb2c08..5aacdea 100644
--- a/milena/mln/canvas/browsing/depth_first_search.hh
+++ b/milena/mln/canvas/browsing/depth_first_search.hh
@@ -97,6 +97,7 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS
+ inline
depth_first_search_t::depth_first_search_t()
{
}
diff --git a/milena/mln/canvas/browsing/diagonal2d.hh b/milena/mln/canvas/browsing/diagonal2d.hh
index 8324795..313058a 100644
--- a/milena/mln/canvas/browsing/diagonal2d.hh
+++ b/milena/mln/canvas/browsing/diagonal2d.hh
@@ -99,6 +99,7 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS
+ inline
diagonal2d_t::diagonal2d_t()
{
}
diff --git a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
index 0037229..6e6f3a1 100644
--- a/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
+++ b/milena/mln/canvas/browsing/dir_struct_elt_incr_update.hh
@@ -98,8 +98,13 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
const dir_struct_elt_incr_update_t dir_struct_elt_incr_update;
+# endif // ! MLN_WO_GLOBAL_VARS
+
+ inline
dir_struct_elt_incr_update_t::dir_struct_elt_incr_update_t()
{
}
diff --git a/milena/mln/canvas/browsing/directional.hh b/milena/mln/canvas/browsing/directional.hh
index 8931cad..03b9956 100644
--- a/milena/mln/canvas/browsing/directional.hh
+++ b/milena/mln/canvas/browsing/directional.hh
@@ -107,6 +107,7 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS
+ inline
directional_t::directional_t()
{
}
diff --git a/milena/mln/canvas/browsing/fwd.hh b/milena/mln/canvas/browsing/fwd.hh
index 86c9bf8..63204bf 100644
--- a/milena/mln/canvas/browsing/fwd.hh
+++ b/milena/mln/canvas/browsing/fwd.hh
@@ -84,8 +84,14 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
const fwd_t fwd;
+# endif // ! MLN_WO_GLOBAL_VARS
+
+
+ inline
fwd_t::fwd_t()
{
}
diff --git a/milena/mln/canvas/browsing/hyper_directional.hh b/milena/mln/canvas/browsing/hyper_directional.hh
index 65bb794..84e8e9c 100644
--- a/milena/mln/canvas/browsing/hyper_directional.hh
+++ b/milena/mln/canvas/browsing/hyper_directional.hh
@@ -86,8 +86,14 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
const hyper_directional_t hyper_directional;
+# endif // ! MLN_WO_GLOBAL_VARS
+
+
+ inline
hyper_directional_t::hyper_directional_t()
{
}
diff --git a/milena/mln/canvas/browsing/snake_fwd.hh b/milena/mln/canvas/browsing/snake_fwd.hh
index 06b72df..855723e 100644
--- a/milena/mln/canvas/browsing/snake_fwd.hh
+++ b/milena/mln/canvas/browsing/snake_fwd.hh
@@ -101,6 +101,7 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS
+ inline
snake_fwd_t::snake_fwd_t()
{
}
diff --git a/milena/mln/canvas/browsing/snake_generic.hh b/milena/mln/canvas/browsing/snake_generic.hh
index af9f799..b0ba22e 100644
--- a/milena/mln/canvas/browsing/snake_generic.hh
+++ b/milena/mln/canvas/browsing/snake_generic.hh
@@ -95,6 +95,7 @@ namespace mln
# endif // ! MLN_WO_GLOBAL_VARS
+ inline
snake_generic_t::snake_generic_t()
{
}
diff --git a/milena/mln/canvas/browsing/snake_vert.hh b/milena/mln/canvas/browsing/snake_vert.hh
index 416786c..dedb95e 100644
--- a/milena/mln/canvas/browsing/snake_vert.hh
+++ b/milena/mln/canvas/browsing/snake_vert.hh
@@ -91,8 +91,11 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
const snake_vert_t snake_vert = snake_vert_t();
+# endif // ! MLN_WO_GLOBAL_VARS
template <typename F>
inline
void
diff --git a/milena/mln/fun/v2v/hsi_to_rgb.hh b/milena/mln/fun/v2v/hsi_to_rgb.hh
index 947e7c4..706539d 100644
--- a/milena/mln/fun/v2v/hsi_to_rgb.hh
+++ b/milena/mln/fun/v2v/hsi_to_rgb.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -69,11 +70,14 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
/// Global variable.
/// \{
f_hsi_to_rgb_3x8_t f_hsi_to_rgb_3x8;
/// \}
+# endif // ! MLN_WO_GLOBAL_VARS
template <typename T_rgb>
template <typename T_hsi>
inline
diff --git a/milena/mln/fun/v2v/rgb_to_hsi.hh b/milena/mln/fun/v2v/rgb_to_hsi.hh
index e80cd00..a0cf9b9 100644
--- a/milena/mln/fun/v2v/rgb_to_hsi.hh
+++ b/milena/mln/fun/v2v/rgb_to_hsi.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -61,11 +62,14 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
/// Global variables.
/// \{
f_rgb_to_hsi_f_t f_rgb_to_hsi_f;
/// \}
+# endif // ! MLN_WO_GLOBAL_VARS
template <typename T_hsi>
template <typename T_rgb>
diff --git a/milena/mln/fun/v2v/rgb_to_hsl.hh b/milena/mln/fun/v2v/rgb_to_hsl.hh
index a3da15d..e7486ca 100644
--- a/milena/mln/fun/v2v/rgb_to_hsl.hh
+++ b/milena/mln/fun/v2v/rgb_to_hsl.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -70,11 +70,14 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
+
/// Global variables.
/// \{
f_rgb_to_hsl_f_t f_rgb_to_hsl_f;
/// \}
+# endif // ! MLN_WO_GLOBAL_VARS
template <typename T_hsl>
template <typename T_rgb>
diff --git a/milena/mln/literal/black.hh b/milena/mln/literal/black.hh
index 6ffbe33..3b0bd2f 100644
--- a/milena/mln/literal/black.hh
+++ b/milena/mln/literal/black.hh
@@ -65,6 +65,7 @@ namespace mln
# endif
+ inline
black_t::black_t()
{
}
diff --git a/milena/mln/literal/colors.hh b/milena/mln/literal/colors.hh
index 52c05d0..e70d843 100644
--- a/milena/mln/literal/colors.hh
+++ b/milena/mln/literal/colors.hh
@@ -195,58 +195,72 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+ inline
red_t::red_t()
{
}
+ inline
green_t::green_t()
{
}
+ inline
blue_t::blue_t()
{
}
+ inline
brown_t::brown_t()
{
}
+ inline
lime_t::lime_t()
{
}
+ inline
orange_t::orange_t()
{
}
+ inline
pink_t::pink_t()
{
}
+ inline
purple_t::purple_t()
{
}
+ inline
teal_t::teal_t()
{
}
+ inline
violet_t::violet_t()
{
}
+ inline
cyan_t::cyan_t()
{
}
+ inline
magenta_t::magenta_t()
{
}
+ inline
yellow_t::yellow_t()
{
}
+ inline
olive_t::olive_t()
{
}
diff --git a/milena/mln/literal/grays.hh b/milena/mln/literal/grays.hh
index 79aef78..0a8687b 100644
--- a/milena/mln/literal/grays.hh
+++ b/milena/mln/literal/grays.hh
@@ -63,12 +63,16 @@ namespace mln
# ifndef MLN_INCLUDE_ONLY
+# ifndef MLN_WO_GLOBAL_VARS
const light_gray_t& light_gray = light_gray_t();
const medium_gray_t& medium_gray = medium_gray_t();
const dark_gray_t& dark_gray = dark_gray_t();
+# endif // ! MLN_WO_GLOBAL_VARS
+
+
# endif // !MLN_INCLUDE_ONLY
} // end of namespace mln::literal
diff --git a/milena/mln/literal/max.hh b/milena/mln/literal/max.hh
index f590f8f..7e1faf5 100644
--- a/milena/mln/literal/max.hh
+++ b/milena/mln/literal/max.hh
@@ -63,7 +63,11 @@ namespace mln
}
- const max_t& max = max_t();
+# ifndef MLN_WO_GLOBAL_VARS
+
+ const max_t max;
+
+# endif // ! MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/literal/min.hh b/milena/mln/literal/min.hh
index 5d37857..e53d29c 100644
--- a/milena/mln/literal/min.hh
+++ b/milena/mln/literal/min.hh
@@ -62,8 +62,11 @@ namespace mln
return mln_min(T);
}
+# ifndef MLN_WO_GLOBAL_VARS
- const min_t& min = min_t();
+ const min_t min;
+
+# endif // ! MLN_WO_GLOBAL_VARS
# endif // ! MLN_INCLUDE_ONLY
diff --git a/milena/mln/literal/white.hh b/milena/mln/literal/white.hh
index 620a73a..7f7a80b 100644
--- a/milena/mln/literal/white.hh
+++ b/milena/mln/literal/white.hh
@@ -65,6 +65,7 @@ namespace mln
# endif
+ inline
white_t::white_t()
{
}
--
1.7.2.5
1
0
* mln/border/duplicate.hh,
* mln/border/mirror.hh,
* mln/canvas/browsing/internal/graph_first_search.hh,
* mln/convert/impl/from_float_to_value.hh,
* mln/convert/to_qimage.hh,
* mln/core/image/complex_window_piter.hh,
* mln/extension/fill.hh,
* mln/fun/spe/binary.hh,
* mln/fun/spe/unary.hh,
* mln/fun/x2x/rotation.hh,
* mln/io/fld/max_components.hh,
* mln/labeling/flat_zones.hh,
* mln/labeling/value.hh,
* mln/morpho/reconstruction/by_dilation/union_find.hh,
* mln/opt/element.hh,
* mln/registration/get_rot.hh,
* mln/subsampling/antialiased.hh,
* mln/subsampling/gaussian_subsampling.hh,
* mln/topo/skeleton/is_simple_point.hh,
* mln/transform/influence_zone_geodesic.hh,
* mln/util/object_id.hh,
* mln/value/lut_vec.hh,
* mln/world/binary_2d/enlarge.hh: Avoid unused variable warnings.
* mln/accu/internal/couple.hh,
* mln/convert/from_to.hxx,
* mln/core/faces_psite.hh,
* mln/core/image/ch_piter.hh,
* mln/core/image/dmorph/extended.hh,
* mln/core/image/dmorph/extension_fun.hh,
* mln/core/image/dmorph/extension_ima.hh,
* mln/core/image/dmorph/extension_val.hh,
* mln/core/image/dmorph/hexa.hh,
* mln/core/image/dmorph/sub_image_if.hh,
* mln/core/image/dmorph/transformed_image.hh,
* mln/core/image/flat_image.hh,
* mln/core/image/graph_elt_mixed_window.hh,
* mln/core/image/graph_elt_window.hh,
* mln/core/image/graph_elt_window_if.hh,
* mln/core/image/graph_window_piter.hh,
* mln/core/image/image2d.hh,
* mln/core/image/imorph/labeled_image.hh,
* mln/core/image/imorph/plain.hh,
* mln/core/image/imorph/safe.hh,
* mln/core/image/vmorph/cast_image.hh,
* mln/core/image/vmorph/fun_image.hh,
* mln/core/image/vmorph/thru_image.hh,
* mln/core/image/vmorph/thrubin_image.hh,
* mln/core/image/vmorph/violent_cast_image.hh,
* mln/core/internal/is_masked_impl_selector.hh,
* mln/core/internal/pixel_impl.hh,
* mln/core/routine/init.hxx,
* mln/core/site_set/attic/p_faces_piter.hh,
* mln/core/site_set/p_faces.hh,
* mln/core/site_set/p_if.hh,
* mln/core/site_set/p_transformed.hh,
* mln/debug/println.spe.hh,
* mln/io/pbm/save.hh,
* mln/io/pgm/save.hh,
* mln/morpho/attribute/height.hh,
* mln/morpho/attribute/sharpness.hh,
* mln/morpho/attribute/volume.hh,
* mln/morpho/tree/data.hh,
* mln/topo/center_only_iter.hh,
* mln/topo/face.hh,
* mln/topo/face_data.hh,
* mln/trait/image_from_grid.hh,
* mln/trait/images.hh,
* mln/value/float01.hh,
* mln/value/float01_f.hh,
* mln/value/graylevel.hh,
* mln/value/graylevel_f.hh,
* mln/value/internal/gray_.hh,
* mln/value/internal/gray_f.hh: Make forward declarations
consistent with declarations.
* mln/core/concept/box.hh,
* mln/core/dpoints_pixter.hh,
* mln/core/image/graph_window_if_piter.hh: Add explicit 'this'.
* mln/data/fill.hh: Make sure declarations are made before use.
* mln/geom/chamfer.hh,
* mln/morpho/tree/compute_attribute_image.hh: Do not set default
argument values in declaration.
* mln/accu/line.hh: Use def::coord.
* mln/algebra/vec.hh,
* mln/convert/from_to.hxx,
* mln/core/image/dmorph/sub_image.hh,
* mln/core/internal/site_set_iterator_base.hh,
* mln/core/site_set/box.hh,
* mln/core/site_set/p_array.hh,
* mln/core/site_set/p_edges.hh,
* mln/core/site_set/p_vertices.hh: Make forward declaration
consistent with declaration.
* mln/value/builtin/carrays.hh: Explicitly convert to char *.
* mln/convert/impl/from_double_to_value.hh,
* mln/convert/impl/from_int_to_value.hh,
* mln/core/point.hh,
* mln/opt/element.hh: Avoid unused variable warning.
* mln/convert/impl/from_image_to_site_set.hh: Remove useless local variable.
---
milena/ChangeLog | 111 ++++++++++++++++++++
milena/mln/accu/internal/couple.hh | 7 +-
milena/mln/accu/line.hh | 17 ++--
milena/mln/algebra/vec.hh | 5 +-
milena/mln/border/duplicate.hh | 4 +-
milena/mln/border/mirror.hh | 3 +-
milena/mln/convert/from_to.hxx | 4 +-
milena/mln/convert/impl/from_double_to_value.hh | 9 +-
milena/mln/convert/impl/from_float_to_value.hh | 8 +-
milena/mln/convert/impl/from_image_to_site_set.hh | 4 +-
milena/mln/convert/impl/from_int_to_value.hh | 6 +-
milena/mln/convert/to_qimage.hh | 2 +
milena/mln/core/concept/box.hh | 3 +-
milena/mln/core/dpoints_pixter.hh | 25 +++--
milena/mln/core/faces_psite.hh | 5 +-
milena/mln/core/image/ch_piter.hh | 5 +-
milena/mln/core/image/complex_window_piter.hh | 5 +-
milena/mln/core/image/dmorph/extended.hh | 5 +-
milena/mln/core/image/dmorph/extension_fun.hh | 5 +-
milena/mln/core/image/dmorph/extension_ima.hh | 6 +-
milena/mln/core/image/dmorph/extension_val.hh | 5 +-
milena/mln/core/image/dmorph/hexa.hh | 5 +-
milena/mln/core/image/dmorph/sub_image.hh | 6 +-
milena/mln/core/image/dmorph/sub_image_if.hh | 7 +-
milena/mln/core/image/dmorph/transformed_image.hh | 7 +-
milena/mln/core/image/flat_image.hh | 5 +-
milena/mln/core/image/graph_elt_mixed_window.hh | 7 +-
milena/mln/core/image/graph_elt_window.hh | 4 +-
milena/mln/core/image/graph_elt_window_if.hh | 7 +-
milena/mln/core/image/graph_window_if_piter.hh | 4 +-
milena/mln/core/image/graph_window_piter.hh | 6 +-
milena/mln/core/image/image2d.hh | 2 +-
milena/mln/core/image/imorph/labeled_image.hh | 5 +-
milena/mln/core/image/imorph/plain.hh | 5 +-
milena/mln/core/image/imorph/safe.hh | 5 +-
milena/mln/core/image/vmorph/cast_image.hh | 5 +-
milena/mln/core/image/vmorph/fun_image.hh | 4 +-
milena/mln/core/image/vmorph/thru_image.hh | 8 +-
milena/mln/core/image/vmorph/thrubin_image.hh | 4 +-
milena/mln/core/image/vmorph/violent_cast_image.hh | 5 +-
.../mln/core/internal/is_masked_impl_selector.hh | 7 +-
milena/mln/core/internal/pixel_impl.hh | 2 +-
milena/mln/core/internal/site_set_iterator_base.hh | 6 +-
milena/mln/core/point.hh | 3 +-
milena/mln/core/routine/init.hxx | 7 +-
milena/mln/core/site_set/attic/p_faces_piter.hh | 4 +-
milena/mln/core/site_set/p_array.hh | 4 +-
milena/mln/core/site_set/p_edges.hh | 5 +-
milena/mln/core/site_set/p_faces.hh | 5 +-
milena/mln/core/site_set/p_if.hh | 6 +-
milena/mln/core/site_set/p_transformed.hh | 5 +-
milena/mln/core/site_set/p_vertices.hh | 4 +-
milena/mln/data/fill.hh | 4 +-
milena/mln/debug/println.spe.hh | 5 +-
milena/mln/extension/fill.hh | 2 +
milena/mln/fun/spe/binary.hh | 1 +
milena/mln/fun/spe/unary.hh | 4 +-
milena/mln/fun/x2x/rotation.hh | 7 +-
milena/mln/geom/chamfer.hh | 5 +-
milena/mln/io/fld/max_components.hh | 3 +-
milena/mln/io/pbm/save.hh | 7 +-
milena/mln/io/pgm/save.hh | 7 +-
milena/mln/labeling/flat_zones.hh | 10 +-
milena/mln/labeling/value.hh | 4 +-
milena/mln/morpho/attribute/height.hh | 5 +-
milena/mln/morpho/attribute/sharpness.hh | 5 +-
milena/mln/morpho/attribute/volume.hh | 5 +-
.../reconstruction/by_dilation/union_find.hh | 18 ++--
milena/mln/morpho/tree/compute_attribute_image.hh | 9 +-
milena/mln/morpho/tree/data.hh | 4 +-
milena/mln/opt/element.hh | 9 +-
milena/mln/registration/get_rot.hh | 9 ++-
milena/mln/subsampling/antialiased.hh | 10 ++
milena/mln/subsampling/gaussian_subsampling.hh | 5 +-
milena/mln/topo/center_only_iter.hh | 7 +-
milena/mln/topo/face.hh | 4 +-
milena/mln/topo/face_data.hh | 4 +-
milena/mln/topo/skeleton/is_simple_point.hh | 1 -
milena/mln/trait/image_from_grid.hh | 5 +-
milena/mln/trait/images.hh | 11 +-
milena/mln/transform/influence_zone_geodesic.hh | 7 +-
milena/mln/util/object_id.hh | 4 +-
milena/mln/value/float01.hh | 5 +-
milena/mln/value/float01_f.hh | 5 +-
milena/mln/value/graylevel.hh | 2 +-
milena/mln/value/graylevel_f.hh | 5 +-
milena/mln/value/internal/gray_.hh | 17 +++-
milena/mln/value/internal/gray_f.hh | 14 ++-
milena/mln/value/lut_vec.hh | 5 +-
milena/mln/world/binary_2d/enlarge.hh | 6 +-
90 files changed, 436 insertions(+), 207 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 544cc30..7e5855b 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -19,6 +19,117 @@
* mln/io/dicom/load.hh: Fix invalid data while loading large
image.
+2011-04-28 Guillaume Lazzara <lazzara(a)fidji.lrde.epita.fr>
+
+ Fix warnings with Clang/g++ 4.6.x
+
+ * mln/border/duplicate.hh,
+ * mln/border/mirror.hh,
+ * mln/canvas/browsing/internal/graph_first_search.hh,
+ * mln/convert/impl/from_float_to_value.hh,
+ * mln/convert/to_qimage.hh,
+ * mln/core/image/complex_window_piter.hh,
+ * mln/extension/fill.hh,
+ * mln/fun/spe/binary.hh,
+ * mln/fun/spe/unary.hh,
+ * mln/fun/x2x/rotation.hh,
+ * mln/io/fld/max_components.hh,
+ * mln/labeling/flat_zones.hh,
+ * mln/labeling/value.hh,
+ * mln/morpho/reconstruction/by_dilation/union_find.hh,
+ * mln/opt/element.hh,
+ * mln/registration/get_rot.hh,
+ * mln/subsampling/antialiased.hh,
+ * mln/subsampling/gaussian_subsampling.hh,
+ * mln/topo/skeleton/is_simple_point.hh,
+ * mln/transform/influence_zone_geodesic.hh,
+ * mln/util/object_id.hh,
+ * mln/value/lut_vec.hh,
+ * mln/world/binary_2d/enlarge.hh: Avoid unused variable warnings.
+
+ * mln/accu/internal/couple.hh,
+ * mln/convert/from_to.hxx,
+ * mln/core/faces_psite.hh,
+ * mln/core/image/ch_piter.hh,
+ * mln/core/image/dmorph/extended.hh,
+ * mln/core/image/dmorph/extension_fun.hh,
+ * mln/core/image/dmorph/extension_ima.hh,
+ * mln/core/image/dmorph/extension_val.hh,
+ * mln/core/image/dmorph/hexa.hh,
+ * mln/core/image/dmorph/sub_image_if.hh,
+ * mln/core/image/dmorph/transformed_image.hh,
+ * mln/core/image/flat_image.hh,
+ * mln/core/image/graph_elt_mixed_window.hh,
+ * mln/core/image/graph_elt_window.hh,
+ * mln/core/image/graph_elt_window_if.hh,
+ * mln/core/image/graph_window_piter.hh,
+ * mln/core/image/image2d.hh,
+ * mln/core/image/imorph/labeled_image.hh,
+ * mln/core/image/imorph/plain.hh,
+ * mln/core/image/imorph/safe.hh,
+ * mln/core/image/vmorph/cast_image.hh,
+ * mln/core/image/vmorph/fun_image.hh,
+ * mln/core/image/vmorph/thru_image.hh,
+ * mln/core/image/vmorph/thrubin_image.hh,
+ * mln/core/image/vmorph/violent_cast_image.hh,
+ * mln/core/internal/is_masked_impl_selector.hh,
+ * mln/core/internal/pixel_impl.hh,
+ * mln/core/routine/init.hxx,
+ * mln/core/site_set/attic/p_faces_piter.hh,
+ * mln/core/site_set/p_faces.hh,
+ * mln/core/site_set/p_if.hh,
+ * mln/core/site_set/p_transformed.hh,
+ * mln/debug/println.spe.hh,
+ * mln/io/pbm/save.hh,
+ * mln/io/pgm/save.hh,
+ * mln/morpho/attribute/height.hh,
+ * mln/morpho/attribute/sharpness.hh,
+ * mln/morpho/attribute/volume.hh,
+ * mln/morpho/tree/data.hh,
+ * mln/topo/center_only_iter.hh,
+ * mln/topo/face.hh,
+ * mln/topo/face_data.hh,
+ * mln/trait/image_from_grid.hh,
+ * mln/trait/images.hh,
+ * mln/value/float01.hh,
+ * mln/value/float01_f.hh,
+ * mln/value/graylevel.hh,
+ * mln/value/graylevel_f.hh,
+ * mln/value/internal/gray_.hh,
+ * mln/value/internal/gray_f.hh: Make forward declarations
+ consistent with declarations.
+
+ * mln/core/concept/box.hh,
+ * mln/core/dpoints_pixter.hh,
+ * mln/core/image/graph_window_if_piter.hh: Add explicit 'this'.
+
+ * mln/data/fill.hh: Make sure declarations are made before use.
+
+ * mln/geom/chamfer.hh,
+ * mln/morpho/tree/compute_attribute_image.hh: Do not set default
+ argument values in declaration.
+
+ * mln/accu/line.hh: Use def::coord.
+
+ * mln/algebra/vec.hh,
+ * mln/convert/from_to.hxx,
+ * mln/core/image/dmorph/sub_image.hh,
+ * mln/core/internal/site_set_iterator_base.hh,
+ * mln/core/site_set/box.hh,
+ * mln/core/site_set/p_array.hh,
+ * mln/core/site_set/p_edges.hh,
+ * mln/core/site_set/p_vertices.hh: Make forward declaration
+ consistent with declaration.
+
+ * mln/value/builtin/carrays.hh: Explicitly convert to char *.
+
+ * mln/convert/impl/from_double_to_value.hh,
+ * mln/convert/impl/from_int_to_value.hh,
+ * mln/core/point.hh,
+ * mln/opt/element.hh: Avoid unused variable warning.
+
+ * mln/convert/impl/from_image_to_site_set.hh: Remove useless local variable.
+
2010-12-10 Roland Levillain <roland(a)lrde.epita.fr>
Ensure non implemented reconstructions on sets abort at run time.
diff --git a/milena/mln/accu/internal/couple.hh b/milena/mln/accu/internal/couple.hh
index 43550fd..55c6cc4 100644
--- a/milena/mln/accu/internal/couple.hh
+++ b/milena/mln/accu/internal/couple.hh
@@ -53,10 +53,11 @@ namespace mln
///
/// \todo Check that, when T is not provided, A1 and A2 have the same value.
template <typename A1, typename A2, typename R, typename E>
- struct couple
- : base<R,E>,
- mlc_equal(mln_argument(A1), mln_argument(A2))::check_t
+ class couple
+ : public base<R,E>,
+ public mlc_equal(mln_argument(A1), mln_argument(A2))::check_t
{
+ public:
typedef mln_argument(A1) argument;
/// Manipulators.
diff --git a/milena/mln/accu/line.hh b/milena/mln/accu/line.hh
index c6022ef..75be6b3 100644
--- a/milena/mln/accu/line.hh
+++ b/milena/mln/accu/line.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -63,8 +64,8 @@ namespace mln
typename I, typename O>
void
line(const Image<I>& input,
- const mln_site(I)& p_start, unsigned len,
- unsigned half_length,
+ const mln_site(I)& p_start, def::coord len,
+ def::coord half_length,
Image<O>& output);
@@ -98,7 +99,7 @@ namespace mln
mln_precondition(input.is_valid());
mln_precondition(output.is_valid());
}
-
+
} // end of namespace mln::accu::internal
@@ -107,7 +108,7 @@ namespace mln
namespace generic
{
-
+
template <typename Meta_Accu, unsigned Dir,
typename I, typename O>
void
@@ -212,8 +213,8 @@ namespace mln
typename I, typename O>
void
line_fastest(const Image<I>& input_,
- const mln_site(I)& p_start, unsigned len,
- unsigned half_length,
+ const mln_site(I)& p_start, def::coord len,
+ def::coord half_length,
Image<O>& output_)
{
typedef mln_site(I) P;
@@ -371,7 +372,7 @@ namespace mln
half_length,
output);
}
-
+
} // end of namespace mln::accu::internal
diff --git a/milena/mln/algebra/vec.hh b/milena/mln/algebra/vec.hh
index 22ebc02..dc526ec 100644
--- a/milena/mln/algebra/vec.hh
+++ b/milena/mln/algebra/vec.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -55,7 +56,7 @@ namespace mln
// Forward declarations.
namespace algebra {
template <unsigned n, typename T> class vec;
- template <unsigned d, typename C> class h_vec;
+ template <unsigned d, typename C> struct h_vec;
template <unsigned n, unsigned m, typename T> class mat;
}
diff --git a/milena/mln/border/duplicate.hh b/milena/mln/border/duplicate.hh
index 4d836cc..059dc77 100644
--- a/milena/mln/border/duplicate.hh
+++ b/milena/mln/border/duplicate.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -227,6 +228,7 @@ namespace mln
void duplicate_dispatch_on(trait::image::speed::any,
const Image<I>& ima)
{
+ (void) ima;
// No-op.
}
diff --git a/milena/mln/border/mirror.hh b/milena/mln/border/mirror.hh
index 793ef21..adeb057 100644
--- a/milena/mln/border/mirror.hh
+++ b/milena/mln/border/mirror.hh
@@ -199,7 +199,8 @@ namespace mln
{
trace::warning("border::mirror for 3D image is not implemented,"
" so image borders have not been mirrored!");
- mln::internal::fixme();
+ (void) ima;
+ // FIXME write it!
}
diff --git a/milena/mln/convert/from_to.hxx b/milena/mln/convert/from_to.hxx
index 7891e9a..e99c3f6 100644
--- a/milena/mln/convert/from_to.hxx
+++ b/milena/mln/convert/from_to.hxx
@@ -63,13 +63,13 @@ namespace mln
template <typename D> class neighb;
template <typename D> class window;
- template <typename D, typename W> class w_window;
+ template <typename D, typename W> struct w_window;
template <typename T> struct image1d;
namespace algebra {
template <unsigned n, typename T> class vec;
- template <unsigned d, typename C> class h_vec;
+ template <unsigned d, typename C> struct h_vec;
}
namespace fun {
diff --git a/milena/mln/convert/impl/from_double_to_value.hh b/milena/mln/convert/impl/from_double_to_value.hh
index 757fb55..fd2b32a 100644
--- a/milena/mln/convert/impl/from_double_to_value.hh
+++ b/milena/mln/convert/impl/from_double_to_value.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -86,9 +87,11 @@ namespace mln
template <typename V>
inline
void
- from_double_to_value(const double& /* from */,
- Value<V>& /* to */)
+ from_double_to_value(const double& from,
+ Value<V>& to)
{
+ (void) from;
+ (void) to;
mlc_abort(V)::check();
}
diff --git a/milena/mln/convert/impl/from_float_to_value.hh b/milena/mln/convert/impl/from_float_to_value.hh
index b50173b..aa880d8 100644
--- a/milena/mln/convert/impl/from_float_to_value.hh
+++ b/milena/mln/convert/impl/from_float_to_value.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -87,9 +87,11 @@ namespace mln
template <typename V>
inline
void
- from_float_to_value(const float& /* from */,
- Value<V>& /* to */)
+ from_float_to_value(const float& from,
+ Value<V>& to)
{
+ (void) from;
+ (void) to;
mlc_abort(V)::check();
}
diff --git a/milena/mln/convert/impl/from_image_to_site_set.hh b/milena/mln/convert/impl/from_image_to_site_set.hh
index 2bdbcff..65873b6 100644
--- a/milena/mln/convert/impl/from_image_to_site_set.hh
+++ b/milena/mln/convert/impl/from_image_to_site_set.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -107,7 +108,6 @@ namespace mln
const std::pair< mln_value(I), p_run<P> >&)
{
s.clear();
- mln_value(I) O = literal::zero;
mln_fwd_piter(I) p(input.domain());
p.start();
for (;;)
diff --git a/milena/mln/convert/impl/from_int_to_value.hh b/milena/mln/convert/impl/from_int_to_value.hh
index b17040b..c22dfb1 100644
--- a/milena/mln/convert/impl/from_int_to_value.hh
+++ b/milena/mln/convert/impl/from_int_to_value.hh
@@ -74,9 +74,11 @@ namespace mln
template <typename V>
inline
void
- from_int_to_value(const int& /* from */,
- Value<V>& /* to */)
+ from_int_to_value(const int& from,
+ Value<V>& to)
{
+ (void) from;
+ (void) to;
mlc_abort(V)::check();
}
diff --git a/milena/mln/convert/to_qimage.hh b/milena/mln/convert/to_qimage.hh
index cd00cdc..a7c8512 100755
--- a/milena/mln/convert/to_qimage.hh
+++ b/milena/mln/convert/to_qimage.hh
@@ -254,6 +254,8 @@ namespace mln
inline
QImage to_qimage_dispatch(const Image<I>& ima, V&)
{
+ (void) ima;
+
// Not supported yet!
mlc_abort(I)::check();
return QImage();
diff --git a/milena/mln/core/concept/box.hh b/milena/mln/core/concept/box.hh
index 15696b4..db6e8f2 100644
--- a/milena/mln/core/concept/box.hh
+++ b/milena/mln/core/concept/box.hh
@@ -132,7 +132,8 @@ namespace mln
{
return
exact(this)->is_valid()
- ? 1 + exact(this)->pmax()[i] - exact(this)->pmin()[i]
+ ? static_cast<unsigned>(1 + exact(this)->pmax()[i]
+ - exact(this)->pmin()[i])
: 0u;
}
diff --git a/milena/mln/core/dpoints_pixter.hh b/milena/mln/core/dpoints_pixter.hh
index 8020fcc..eb19c2b 100644
--- a/milena/mln/core/dpoints_pixter.hh
+++ b/milena/mln/core/dpoints_pixter.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -27,7 +28,7 @@
# define MLN_CORE_DPOINTS_PIXTER_HH
/// \file
-///
+///
/// \brief Definition of forward and backward mln::dpoint-based
/// iterators for pixels iterations.
///
@@ -51,7 +52,7 @@ namespace mln
/// \brief A generic forward iterator on the pixels of a
/// dpoint-based window or neighborhood.
- ///
+ ///
/// Parameter \c I is the image type.
template <typename I>
class dpoints_fwd_pixter
@@ -62,7 +63,7 @@ namespace mln
public:
/// \brief Constructor (using an image).
- ///
+ ///
/// \param[in] image The image to iterate over.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -74,7 +75,7 @@ namespace mln
const Pref& p_ref);
/// \brief Constructor (using a generalized pixel).
- ///
+ ///
/// \param[in] pxl_ref Center (generalized) pixel to iterate around.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -134,7 +135,7 @@ namespace mln
/// \brief A generic backward iterator on the pixels of a
/// dpoint-based window or neighborhood.
- ///
+ ///
/// Parameter \c I is the image type.
template <typename I>
class dpoints_bkd_pixter
@@ -145,7 +146,7 @@ namespace mln
public:
/// \brief Constructor (using an image).
- ///
+ ///
/// \param[in] image The image to iterate over.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -157,7 +158,7 @@ namespace mln
const Pref& p_ref);
/// \brief Constructor (using a generalized pixel).
- ///
+ ///
/// \param[in] pxl_ref Center (generalized) pixel to iterate around.
/// \param[in] dps An object (neighborhood or window) that can
/// provide a set of delta-points.
@@ -257,7 +258,7 @@ namespace mln
{
mln_invariant(value_ref_ != 0 || p_ref_ != 0);
if (p_ref_)
- return image_(*p_ref_);
+ return this->image_(*p_ref_);
else
return **value_ref_;
}
@@ -286,7 +287,7 @@ namespace mln
if (is_valid())
{
if (p_ref_)
- this->value_ptr_ = & image_(*p_ref_) + *i_;
+ this->value_ptr_ = & this->image_(*p_ref_) + *i_;
else
this->value_ptr_ = * value_ref_ + *i_;
}
@@ -368,7 +369,7 @@ namespace mln
{
mln_invariant(value_ref_ != 0 || p_ref_ != 0);
if (p_ref_)
- return image_(*p_ref_);
+ return this->image_(*p_ref_);
else
return **value_ref_;
}
@@ -397,7 +398,7 @@ namespace mln
if (is_valid())
{
if (p_ref_)
- this->value_ptr_ = & image_(*p_ref_) + *i_;
+ this->value_ptr_ = & this->image_(*p_ref_) + *i_;
else
this->value_ptr_ = * value_ref_ + *i_;
}
diff --git a/milena/mln/core/faces_psite.hh b/milena/mln/core/faces_psite.hh
index d8d7573..9f72533 100644
--- a/milena/mln/core/faces_psite.hh
+++ b/milena/mln/core/faces_psite.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@
namespace mln
{
// Forward declaration.
- template <unsigned N, unsigned D, typename P> class p_faces;
+ template <unsigned N, unsigned D, typename P> struct p_faces;
/// \brief Point site associated to a mln::p_faces.
diff --git a/milena/mln/core/image/ch_piter.hh b/milena/mln/core/image/ch_piter.hh
index cacb5c7..b7c53f8 100644
--- a/milena/mln/core/image/ch_piter.hh
+++ b/milena/mln/core/image/ch_piter.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +41,7 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename Fwd> struct ch_piter_image;
+ template <typename I, typename Fwd> class ch_piter_image;
namespace internal
diff --git a/milena/mln/core/image/complex_window_piter.hh b/milena/mln/core/image/complex_window_piter.hh
index 5f1daa5..ab6326c 100644
--- a/milena/mln/core/image/complex_window_piter.hh
+++ b/milena/mln/core/image/complex_window_piter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -364,9 +364,10 @@ namespace mln
template <typename Pref>
inline
void
- complex_window_bkd_piter<I, G, W>::center_at_(const Pref& /* c */)
+ complex_window_bkd_piter<I, G, W>::center_at_(const Pref& c)
{
// FIXME: Argument C is not used here... Is this normal?
+ (void) c;
iter_.center_at(this->center().face());
}
diff --git a/milena/mln/core/image/dmorph/extended.hh b/milena/mln/core/image/dmorph/extended.hh
index 588f95a..791ab1d 100644
--- a/milena/mln/core/image/dmorph/extended.hh
+++ b/milena/mln/core/image/dmorph/extended.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -43,7 +44,7 @@ namespace mln
// Forward declaration.
- template <typename I> class extended;
+ template <typename I> struct extended;
namespace internal
diff --git a/milena/mln/core/image/dmorph/extension_fun.hh b/milena/mln/core/image/dmorph/extension_fun.hh
index a8731c2..887fe02 100644
--- a/milena/mln/core/image/dmorph/extension_fun.hh
+++ b/milena/mln/core/image/dmorph/extension_fun.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename F> struct extension_fun;
+ template <typename I, typename F> class extension_fun;
namespace internal
diff --git a/milena/mln/core/image/dmorph/extension_ima.hh b/milena/mln/core/image/dmorph/extension_ima.hh
index a0bc9ca..63ea0ed 100644
--- a/milena/mln/core/image/dmorph/extension_ima.hh
+++ b/milena/mln/core/image/dmorph/extension_ima.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +40,7 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename J> struct extension_ima;
+ template <typename I, typename J> class extension_ima;
namespace internal
diff --git a/milena/mln/core/image/dmorph/extension_val.hh b/milena/mln/core/image/dmorph/extension_val.hh
index c104eba..c0ccbe0 100644
--- a/milena/mln/core/image/dmorph/extension_val.hh
+++ b/milena/mln/core/image/dmorph/extension_val.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> struct extension_val;
+ template <typename I> class extension_val;
namespace internal
diff --git a/milena/mln/core/image/dmorph/hexa.hh b/milena/mln/core/image/dmorph/hexa.hh
index bfa3739..314cba1 100644
--- a/milena/mln/core/image/dmorph/hexa.hh
+++ b/milena/mln/core/image/dmorph/hexa.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> class hexa;
+ template <typename I> struct hexa;
namespace internal
diff --git a/milena/mln/core/image/dmorph/sub_image.hh b/milena/mln/core/image/dmorph/sub_image.hh
index 7aef40c..088142d 100644
--- a/milena/mln/core/image/dmorph/sub_image.hh
+++ b/milena/mln/core/image/dmorph/sub_image.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +44,7 @@ namespace mln
// Forward declaration.
- template <typename I, typename S> class sub_image;
+ template <typename I, typename S> struct sub_image;
namespace internal
diff --git a/milena/mln/core/image/dmorph/sub_image_if.hh b/milena/mln/core/image/dmorph/sub_image_if.hh
index 547366a..2cc9661 100644
--- a/milena/mln/core/image/dmorph/sub_image_if.hh
+++ b/milena/mln/core/image/dmorph/sub_image_if.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -46,7 +47,7 @@ namespace mln
// Forward declaration.
- template <typename I, typename S> class sub_image_if;
+ template <typename I, typename S> struct sub_image_if;
namespace internal
@@ -168,7 +169,7 @@ namespace mln
{
typedef fun::p2b::has<I> F;
F f(ima);
- s_ = p_if<S,F>(s, f);
+ s_ = p_if<S,F>(s, f);
}
} // end of namespace mln::internal
diff --git a/milena/mln/core/image/dmorph/transformed_image.hh b/milena/mln/core/image/dmorph/transformed_image.hh
index 5feb3b8..0fb4509 100644
--- a/milena/mln/core/image/dmorph/transformed_image.hh
+++ b/milena/mln/core/image/dmorph/transformed_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
// Forward declaration.
- template <typename I, typename F> class transformed_image;
+ template <typename I, typename F> struct transformed_image;
namespace internal
@@ -221,7 +222,7 @@ namespace mln
mln_precondition(this->delegatee_()->has(this->data_->f_(p)));
return this->delegatee_()->operator()(this->data_->f_(p));
}
-
+
template <typename I, typename F>
inline
mln_morpher_lvalue(I)
diff --git a/milena/mln/core/image/flat_image.hh b/milena/mln/core/image/flat_image.hh
index 10d6211..6647766 100644
--- a/milena/mln/core/image/flat_image.hh
+++ b/milena/mln/core/image/flat_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,7 @@ namespace mln
// Forward declaration.
- template <typename T, typename S> class flat_image;
+ template <typename T, typename S> struct flat_image;
namespace internal
diff --git a/milena/mln/core/image/graph_elt_mixed_window.hh b/milena/mln/core/image/graph_elt_mixed_window.hh
index 6ece878..046843a 100644
--- a/milena/mln/core/image/graph_elt_mixed_window.hh
+++ b/milena/mln/core/image/graph_elt_mixed_window.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -42,8 +43,8 @@ namespace mln
/// Forward declaration
template <typename G, typename S, typename S2> class graph_elt_mixed_window;
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
namespace util
{
template <typename G> class edge;
diff --git a/milena/mln/core/image/graph_elt_window.hh b/milena/mln/core/image/graph_elt_window.hh
index b39c44e..86cb147 100644
--- a/milena/mln/core/image/graph_elt_window.hh
+++ b/milena/mln/core/image/graph_elt_window.hh
@@ -42,8 +42,8 @@ namespace mln
/// Forward declaration
template <typename G, typename S> class graph_elt_window;
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
namespace util
{
template <typename G> class edge;
diff --git a/milena/mln/core/image/graph_elt_window_if.hh b/milena/mln/core/image/graph_elt_window_if.hh
index 131e4d2..920e524 100644
--- a/milena/mln/core/image/graph_elt_window_if.hh
+++ b/milena/mln/core/image/graph_elt_window_if.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -44,8 +45,8 @@ namespace mln
/// Forward declaration
template <typename G, typename S, typename I> class graph_elt_window_if;
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
namespace internal
diff --git a/milena/mln/core/image/graph_window_if_piter.hh b/milena/mln/core/image/graph_window_if_piter.hh
index d872853..068fbdb 100644
--- a/milena/mln/core/image/graph_window_if_piter.hh
+++ b/milena/mln/core/image/graph_window_if_piter.hh
@@ -167,7 +167,7 @@ namespace mln
graph_window_if_piter<S,W,I>::do_start_()
{
iter_.start();
- while (iter_.is_valid() && is_masked(this->c_->element(), iter_))
+ while (iter_.is_valid() && this->is_masked(this->c_->element(), iter_))
iter_.next();
}
@@ -177,7 +177,7 @@ namespace mln
graph_window_if_piter<S,W,I>::do_next_()
{
iter_.next();
- while (iter_.is_valid() && is_masked(this->c_->element(), iter_))
+ while (iter_.is_valid() && this->is_masked(this->c_->element(), iter_))
iter_.next();
}
diff --git a/milena/mln/core/image/graph_window_piter.hh b/milena/mln/core/image/graph_window_piter.hh
index 1891925..f6e8d08 100644
--- a/milena/mln/core/image/graph_window_piter.hh
+++ b/milena/mln/core/image/graph_window_piter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -209,8 +209,8 @@ namespace mln
using super_impl_::do_start_;
- friend class internal::impl_selector<typename W::center_t, mln_psite(W),
- graph_window_piter<S,W,I> > ;
+ friend struct internal::impl_selector<typename W::center_t, mln_psite(W),
+ graph_window_piter<S,W,I> > ;
private:
I iter_;
diff --git a/milena/mln/core/image/image2d.hh b/milena/mln/core/image/image2d.hh
index cdb460a..bc49561 100644
--- a/milena/mln/core/image/image2d.hh
+++ b/milena/mln/core/image/image2d.hh
@@ -59,7 +59,7 @@ namespace mln
{
// Forward declaration.
- template <typename T> struct image2d;
+ template <typename T> class image2d;
namespace internal
diff --git a/milena/mln/core/image/imorph/labeled_image.hh b/milena/mln/core/image/imorph/labeled_image.hh
index c0fcde2..c99f386 100644
--- a/milena/mln/core/image/imorph/labeled_image.hh
+++ b/milena/mln/core/image/imorph/labeled_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -50,7 +51,7 @@ namespace mln
{
// Forward declarations.
- template <typename I> struct labeled_image;
+ template <typename I> class labeled_image;
namespace accu
{
template <typename T> struct nil;
diff --git a/milena/mln/core/image/imorph/plain.hh b/milena/mln/core/image/imorph/plain.hh
index e09bfa5..66c9ebd 100644
--- a/milena/mln/core/image/imorph/plain.hh
+++ b/milena/mln/core/image/imorph/plain.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +41,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> struct plain;
+ template <typename I> class plain;
namespace internal
diff --git a/milena/mln/core/image/imorph/safe.hh b/milena/mln/core/image/imorph/safe.hh
index c053645..c516ef4 100644
--- a/milena/mln/core/image/imorph/safe.hh
+++ b/milena/mln/core/image/imorph/safe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +42,7 @@ namespace mln
{
// Forward declaration.
- template <typename I> struct safe_image;
+ template <typename I> class safe_image;
namespace internal
diff --git a/milena/mln/core/image/vmorph/cast_image.hh b/milena/mln/core/image/vmorph/cast_image.hh
index bed4fbf..0226ad0 100644
--- a/milena/mln/core/image/vmorph/cast_image.hh
+++ b/milena/mln/core/image/vmorph/cast_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
{
// Fwd decl.
- template <typename T, typename I> class cast_image_;
+ template <typename T, typename I> struct cast_image_;
namespace internal
diff --git a/milena/mln/core/image/vmorph/fun_image.hh b/milena/mln/core/image/vmorph/fun_image.hh
index 30ac44e..24d7e37 100644
--- a/milena/mln/core/image/vmorph/fun_image.hh
+++ b/milena/mln/core/image/vmorph/fun_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -46,7 +46,7 @@ namespace mln
{
// Forward declaration.
- template <typename F, typename I> class fun_image;
+ template <typename F, typename I> struct fun_image;
namespace internal
{
diff --git a/milena/mln/core/image/vmorph/thru_image.hh b/milena/mln/core/image/vmorph/thru_image.hh
index 2691d38..e829b27 100644
--- a/milena/mln/core/image/vmorph/thru_image.hh
+++ b/milena/mln/core/image/vmorph/thru_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -43,12 +43,12 @@ namespace mln
{
// Forward declaration.
- template <typename I, typename F> struct thru_image;
+ template <typename I, typename F> class thru_image;
namespace internal
{
- template <typename I, typename F> struct thru_image_write;
- template <typename I, typename F> struct thru_image_read;
+ template <typename I, typename F> class thru_image_write;
+ template <typename I, typename F> class thru_image_read;
/// Find correct implementation
template <typename I, typename F>
diff --git a/milena/mln/core/image/vmorph/thrubin_image.hh b/milena/mln/core/image/vmorph/thrubin_image.hh
index 9d5a2f3..0195d1a 100644
--- a/milena/mln/core/image/vmorph/thrubin_image.hh
+++ b/milena/mln/core/image/vmorph/thrubin_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -42,7 +42,7 @@ namespace mln
{
// Forward declaration.
- template <typename I1, typename I2, typename F> struct thrubin_image;
+ template <typename I1, typename I2, typename F> class thrubin_image;
namespace internal
{
diff --git a/milena/mln/core/image/vmorph/violent_cast_image.hh b/milena/mln/core/image/vmorph/violent_cast_image.hh
index 8ff9a1e..0ce4669 100644
--- a/milena/mln/core/image/vmorph/violent_cast_image.hh
+++ b/milena/mln/core/image/vmorph/violent_cast_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -40,7 +41,7 @@ namespace mln
{
// Fwd decl.
- template <typename T, typename I> class violent_cast_image;
+ template <typename T, typename I> struct violent_cast_image;
namespace internal
{
diff --git a/milena/mln/core/internal/is_masked_impl_selector.hh b/milena/mln/core/internal/is_masked_impl_selector.hh
index 56e4ed3..41d941b 100644
--- a/milena/mln/core/internal/is_masked_impl_selector.hh
+++ b/milena/mln/core/internal/is_masked_impl_selector.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -37,8 +38,8 @@ namespace mln
{
// Forward declarations.
- template <typename G, typename F> struct p_edges;
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_edges;
+ template <typename G, typename F> class p_vertices;
diff --git a/milena/mln/core/internal/pixel_impl.hh b/milena/mln/core/internal/pixel_impl.hh
index 4e30f4c..d0549b1 100644
--- a/milena/mln/core/internal/pixel_impl.hh
+++ b/milena/mln/core/internal/pixel_impl.hh
@@ -47,7 +47,7 @@ namespace mln
{
// We indeed have to handle the couple of cases when I is fastest
- // or is not. Justification: mln::pixel derives from pixel_impl_
+ // or is not. Justification: mln::pixel derives from pixel_impl_
// and is a general purpose pixel class; it can be used on any
// image whatever it is a fastest one or not.
diff --git a/milena/mln/core/internal/site_set_iterator_base.hh b/milena/mln/core/internal/site_set_iterator_base.hh
index 66c94d5..71c3fe3 100644
--- a/milena/mln/core/internal/site_set_iterator_base.hh
+++ b/milena/mln/core/internal/site_set_iterator_base.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -114,8 +115,9 @@ namespace mln
template <typename S, typename E>
inline
void
- site_set_iterator_base<S, E>::change_target_(const S& /* s */)
+ site_set_iterator_base<S, E>::change_target_(const S& s)
{
+ (void) s;
// Empty by default.
}
diff --git a/milena/mln/core/point.hh b/milena/mln/core/point.hh
index a912fac..d415cf8 100644
--- a/milena/mln/core/point.hh
+++ b/milena/mln/core/point.hh
@@ -677,8 +677,9 @@ namespace mln
template <typename C>
inline
const util::yes&
- cut_(const point<grid::tick,C>& /* p */)
+ cut_(const point<grid::tick,C>& p)
{
+ (void) p;
util::yes* the_;
return *the_;
}
diff --git a/milena/mln/core/routine/init.hxx b/milena/mln/core/routine/init.hxx
index 3a47684..5cc6d12 100644
--- a/milena/mln/core/routine/init.hxx
+++ b/milena/mln/core/routine/init.hxx
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -36,9 +37,9 @@ namespace mln
// Forward declarations.
namespace fun { namespace i2v { template <typename T> class array; } }
- namespace pw { namespace internal { template <typename F, typename S, typename E> class image_base; } }
+ namespace pw { namespace internal { template <typename F, typename S, typename E> struct image_base; } }
namespace pw { template <typename F, typename S> class image; }
- template <typename I, typename F> class image_if;
+ template <typename I, typename F> struct image_if;
diff --git a/milena/mln/core/site_set/attic/p_faces_piter.hh b/milena/mln/core/site_set/attic/p_faces_piter.hh
index da4b24a..148872c 100644
--- a/milena/mln/core/site_set/attic/p_faces_piter.hh
+++ b/milena/mln/core/site_set/attic/p_faces_piter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -41,7 +41,7 @@ namespace mln
{
// Forward declarations.
- template <unsigned N, unsigned D, typename P> class p_faces;
+ template <unsigned N, unsigned D, typename P> struct p_faces;
template <unsigned N, unsigned D> class faces_fwd_iter_;
template <unsigned N, unsigned D> class faces_bkd_iter_;
diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh
index 6a7a236..0ca810e 100644
--- a/milena/mln/core/site_set/p_array.hh
+++ b/milena/mln/core/site_set/p_array.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh
index 4c58696..b4f1d27 100644
--- a/milena/mln/core/site_set/p_edges.hh
+++ b/milena/mln/core/site_set/p_edges.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -45,7 +46,7 @@ namespace mln
{
// Forward declaration.
- template <typename G, typename F> struct p_edges;
+ template <typename G, typename F> class p_edges;
namespace trait
diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh
index a308a61..09fa2fc 100644
--- a/milena/mln/core/site_set/p_faces.hh
+++ b/milena/mln/core/site_set/p_faces.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -49,7 +50,7 @@ namespace mln
{
// Forward declarations.
- template <unsigned N, unsigned D, typename P> class p_faces;
+ template <unsigned N, unsigned D, typename P> struct p_faces;
template <unsigned N, unsigned D, typename P> class p_faces_fwd_piter_;
template <unsigned N, unsigned D, typename P> class p_faces_bkd_piter_;
diff --git a/milena/mln/core/site_set/p_if.hh b/milena/mln/core/site_set/p_if.hh
index 4381e86..06ae5c6 100644
--- a/milena/mln/core/site_set/p_if.hh
+++ b/milena/mln/core/site_set/p_if.hh
@@ -41,7 +41,7 @@ namespace mln
{
// Forward declarations.
- template <typename S, typename F> struct p_if;
+ template <typename S, typename F> class p_if;
template <typename Pi, typename S, typename F> struct p_if_piter_;
@@ -114,7 +114,7 @@ namespace mln
bool is_valid() const;
- /// Test if \p p belongs to the subset.
+ /// Test if \p p belongs to the subset.
bool has(const psite& p) const;
/// Give the primary overset.
@@ -184,7 +184,7 @@ namespace mln
{
return f_(p);
}
-
+
template <typename S, typename F>
inline
p_if<S,F>::p_if(const S& s, const F& f)
diff --git a/milena/mln/core/site_set/p_transformed.hh b/milena/mln/core/site_set/p_transformed.hh
index ff0638d..2b597a5 100644
--- a/milena/mln/core/site_set/p_transformed.hh
+++ b/milena/mln/core/site_set/p_transformed.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -39,7 +40,7 @@ namespace mln
{
// Forward declarations.
- template <typename S, typename F> struct p_transformed;
+ template <typename S, typename F> class p_transformed;
template <typename Pi, typename S, typename F> struct p_transformed_piter;
diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh
index c8497c0..6efa1a9 100644
--- a/milena/mln/core/site_set/p_vertices.hh
+++ b/milena/mln/core/site_set/p_vertices.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of Olena.
@@ -44,7 +44,7 @@ namespace mln
{
// Forward declaration.
- template <typename G, typename F> struct p_vertices;
+ template <typename G, typename F> class p_vertices;
namespace trait
diff --git a/milena/mln/data/fill.hh b/milena/mln/data/fill.hh
index 61e7055..b223a36 100644
--- a/milena/mln/data/fill.hh
+++ b/milena/mln/data/fill.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
diff --git a/milena/mln/debug/println.spe.hh b/milena/mln/debug/println.spe.hh
index 257ddf4..856c635 100644
--- a/milena/mln/debug/println.spe.hh
+++ b/milena/mln/debug/println.spe.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -53,7 +54,7 @@
namespace mln
{
// Forward declaration.
- template <typename I> class hexa;
+ template <typename I> struct hexa;
namespace debug
{
diff --git a/milena/mln/extension/fill.hh b/milena/mln/extension/fill.hh
index caed937..4375a24 100644
--- a/milena/mln/extension/fill.hh
+++ b/milena/mln/extension/fill.hh
@@ -104,6 +104,8 @@ namespace mln
mln::trait::image::ext_domain::any,
I& ima, const mln_value(I)& val)
{
+ (void) ima;
+ (void) val;
// Oops...
}
diff --git a/milena/mln/fun/spe/binary.hh b/milena/mln/fun/spe/binary.hh
index eaeaa73..cde465d 100644
--- a/milena/mln/fun/spe/binary.hh
+++ b/milena/mln/fun/spe/binary.hh
@@ -71,6 +71,7 @@ namespace mln
template <typename U>
void init(const U& value)
{
+ (void) value;
}
};
diff --git a/milena/mln/fun/spe/unary.hh b/milena/mln/fun/spe/unary.hh
index 0c5a949..47d7f41 100644
--- a/milena/mln/fun/spe/unary.hh
+++ b/milena/mln/fun/spe/unary.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -175,6 +176,7 @@ namespace mln
template <typename U>
void init(const U& value)
{
+ (void) value;
};
};
diff --git a/milena/mln/fun/x2x/rotation.hh b/milena/mln/fun/x2x/rotation.hh
index 3cd54f1..ed48ebf 100644
--- a/milena/mln/fun/x2x/rotation.hh
+++ b/milena/mln/fun/x2x/rotation.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -66,6 +66,9 @@ namespace mln
algebra::h_mat<n, C>
get_rot_h_mat(const C alpha_, const algebra::vec<n,C>& axis_)
{
+ (void) alpha_;
+ (void) axis_;
+
std::cerr
<< __FILE__ << ":" << __LINE__ << ": error:"
<< " generic mln::fun::x2x::internal::get_rot_h_mat<n, C>"
diff --git a/milena/mln/geom/chamfer.hh b/milena/mln/geom/chamfer.hh
index 9603605..8fb6cc8 100644
--- a/milena/mln/geom/chamfer.hh
+++ b/milena/mln/geom/chamfer.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -111,7 +112,7 @@ namespace mln
template <typename I, typename W>
mln_ch_value(I, unsigned)
chamfer(const Image<I>& input_, const W& w_win_,
- unsigned max = mln_max(unsigned))
+ unsigned max)
{
trace::entering("mln::geom::chamfer");
// FIXME: check that input_ is binary.
diff --git a/milena/mln/io/fld/max_components.hh b/milena/mln/io/fld/max_components.hh
index d57310a..ceb4d27 100644
--- a/milena/mln/io/fld/max_components.hh
+++ b/milena/mln/io/fld/max_components.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -74,6 +74,7 @@ namespace mln
inline
unsigned max_component(const algebra::vec<n, V>& v)
{
+ (void) v;
return unsigned(mln_max(V));
}
diff --git a/milena/mln/io/pbm/save.hh b/milena/mln/io/pbm/save.hh
index 689b492..a9b7604 100644
--- a/milena/mln/io/pbm/save.hh
+++ b/milena/mln/io/pbm/save.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -46,8 +47,8 @@ namespace mln
// Fwd decl.
namespace value {
- template <unsigned> class int_u;
- template <unsigned> class int_u_sat;
+ template <unsigned> struct int_u;
+ template <unsigned> struct int_u_sat;
}
diff --git a/milena/mln/io/pgm/save.hh b/milena/mln/io/pgm/save.hh
index 6438b30..c5ba0af 100644
--- a/milena/mln/io/pgm/save.hh
+++ b/milena/mln/io/pgm/save.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2011 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -50,8 +51,8 @@ namespace mln
// Fwd decl.
namespace value {
- template <unsigned> class int_u;
- template <unsigned> class int_u_sat;
+ template <unsigned> struct int_u;
+ template <unsigned> struct int_u_sat;
}
diff --git a/milena/mln/labeling/flat_zones.hh b/milena/mln/labeling/flat_zones.hh
index 431bd86..6c406d5 100644
--- a/milena/mln/labeling/flat_zones.hh
+++ b/milena/mln/labeling/flat_zones.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -82,9 +82,9 @@ namespace mln
void do_no_union(const P&, const P&) {}
void init_attr(const P&) {}
void merge_attr(const P&, const P&) {}
- void set_new_label(const P& p, const L& l){}
- void set_label(const P& p, const L& l) {}
- void finalize() {}
+ void set_new_label(const P&, const L&){}
+ void set_label(const P&, const L&) {}
+ void finalize() {}
// Fastest implementation.
diff --git a/milena/mln/labeling/value.hh b/milena/mln/labeling/value.hh
index 7e1608c..fdd47ef 100644
--- a/milena/mln/labeling/value.hh
+++ b/milena/mln/labeling/value.hh
@@ -111,8 +111,8 @@ namespace mln
void do_no_union(const P&, const P&) {}
void init_attr(const P&) {}
void merge_attr(const P&, const P&) {}
- void set_new_label(const P& p, const L& l){}
- void set_label(const P& p, const L& l) {}
+ void set_new_label(const P&, const L&) {}
+ void set_label(const P&, const L&) {}
void finalize() {}
// Fastest implementation
diff --git a/milena/mln/morpho/attribute/height.hh b/milena/mln/morpho/attribute/height.hh
index 4e8f234..3d47ac0 100644
--- a/milena/mln/morpho/attribute/height.hh
+++ b/milena/mln/morpho/attribute/height.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@ namespace mln
// Forward declaration.
namespace morpho {
namespace attribute {
- template <typename I> class height;
+ template <typename I> struct height;
}
}
diff --git a/milena/mln/morpho/attribute/sharpness.hh b/milena/mln/morpho/attribute/sharpness.hh
index 9548b4d..866b1ab 100644
--- a/milena/mln/morpho/attribute/sharpness.hh
+++ b/milena/mln/morpho/attribute/sharpness.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@ namespace mln
namespace morpho {
namespace attribute {
template <typename I>
- class sharpness;
+ struct sharpness;
}
}
diff --git a/milena/mln/morpho/attribute/volume.hh b/milena/mln/morpho/attribute/volume.hh
index 94dc977..2ac66c6 100644
--- a/milena/mln/morpho/attribute/volume.hh
+++ b/milena/mln/morpho/attribute/volume.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -42,7 +43,7 @@ namespace mln
// Forward declaration.
namespace morpho {
namespace attribute {
- template <typename I> class volume;
+ template <typename I> struct volume;
}
}
diff --git a/milena/mln/morpho/reconstruction/by_dilation/union_find.hh b/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
index 59f15e4..35ec2ae 100644
--- a/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
+++ b/milena/mln/morpho/reconstruction/by_dilation/union_find.hh
@@ -92,7 +92,7 @@ namespace mln
}
-
+
template <typename Par>
inline
mln_site(Par) find_root(Par& parent, mln_site(Par) x)
@@ -111,10 +111,10 @@ namespace mln
namespace impl
{
-
+
namespace generic
{
-
+
template <typename I, typename J, typename N>
inline
mln_concrete(I)
@@ -128,8 +128,8 @@ namespace mln
const N& nbh = exact(nbh_);
internal::union_find_tests(f, g, nbh);
-
-
+
+
typedef mln_site(I) P;
typedef mln_value(I) V;
@@ -184,7 +184,7 @@ namespace mln
deja_vu(p) = true;
}
}
-
+
// Second pass.
{
for (int i = s.nsites() - 1; i >= 0; --i)
@@ -207,7 +207,7 @@ namespace mln
return output;
}
-
+
} // end of namespace mln::morpho::reconstruction::by_dilation::impl::generic
} // end of namespace mln::morpho::reconstruction::by_dilation::impl
@@ -225,6 +225,10 @@ namespace mln
const Image<I>& f, const Image<J>& g,
const Neighborhood<N>& nbh)
{
+ (void) f;
+ (void) g;
+ (void) nbh;
+
// FIXME: Not yet implemented.
std::cerr
<< __FILE__ << ":" << __LINE__ << ": error:\n"
diff --git a/milena/mln/morpho/tree/compute_attribute_image.hh b/milena/mln/morpho/tree/compute_attribute_image.hh
index 9126bf1..e028084 100644
--- a/milena/mln/morpho/tree/compute_attribute_image.hh
+++ b/milena/mln/morpho/tree/compute_attribute_image.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -92,7 +93,7 @@ namespace mln
** \param[in] values Value image.
** \param[out] accu_image Optional argument used to store image.
**
- ** \return
+ ** \return
*/
template <typename A, typename T, typename V>
mln_ch_value(typename T::function, mln_result(A))
@@ -215,7 +216,7 @@ namespace mln
mln_ch_value(typename T::function, mln_result(A))
compute_attribute_image(const Accumulator<A>& a_,
const T& t,
- mln_ch_value(typename T::function, A)* accu_image = 0)
+ mln_ch_value(typename T::function, A)* accu_image)
{
trace::entering("morpho::tree::compute_attribute_image");
@@ -233,7 +234,7 @@ namespace mln
compute_attribute_image_from(const Accumulator<A>& a_,
const T& t,
const Image<V>& values,
- mln_ch_value(typename T::function, A)* accu_image = 0)
+ mln_ch_value(typename T::function, A)* accu_image)
{
trace::entering("morpho::tree::compute_attribute_image_from");
diff --git a/milena/mln/morpho/tree/data.hh b/milena/mln/morpho/tree/data.hh
index 1a0c404..3083759 100644
--- a/milena/mln/morpho/tree/data.hh
+++ b/milena/mln/morpho/tree/data.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -93,7 +93,7 @@ namespace mln
template <typename T> struct dn_leaf_piter;
/// Depth1st tree traversal iterator.
- template <typename T> struct depth1st_piter;
+ template <typename T> class depth1st_piter;
template <typename I, typename S>
diff --git a/milena/mln/opt/element.hh b/milena/mln/opt/element.hh
index 0aabf6b..dc1a415 100644
--- a/milena/mln/opt/element.hh
+++ b/milena/mln/opt/element.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -60,8 +61,9 @@ namespace mln
template <typename I>
inline
mln_rvalue(I) element_impl(trait::image::category::domain_morpher,
- const Image<I>& ima, unsigned /* index */)
+ const Image<I>& ima, unsigned index)
{
+ (void) index;
return element(*exact(ima).delegatee_());
}
@@ -82,8 +84,9 @@ namespace mln
template <typename I>
inline
mln_lvalue(I) element_impl(trait::image::category::domain_morpher,
- Image<I>& ima, unsigned /* index */)
+ Image<I>& ima, unsigned index)
{
+ (void) index;
return element(*exact(ima).delegatee_());
}
diff --git a/milena/mln/registration/get_rot.hh b/milena/mln/registration/get_rot.hh
index e1babf1..28667cb 100644
--- a/milena/mln/registration/get_rot.hh
+++ b/milena/mln/registration/get_rot.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -61,6 +62,12 @@ namespace mln
{
assert(0 && "TODO");
+ (void) c;
+ (void) mu_c;
+ (void) ck;
+ (void) map;
+ (void) mu_xk;
+
//////SLOW VERSION
//// V1
diff --git a/milena/mln/subsampling/antialiased.hh b/milena/mln/subsampling/antialiased.hh
index cb6bbca..66bdd33 100644
--- a/milena/mln/subsampling/antialiased.hh
+++ b/milena/mln/subsampling/antialiased.hh
@@ -118,6 +118,11 @@ namespace mln
const mln_domain(I)& output_domain,
unsigned border_thickness)
{
+ (void) input_;
+ (void) factor;
+ (void) output_domain;
+ (void) border_thickness;
+
// To be written...
mlc_abort(I)::check();
@@ -314,6 +319,11 @@ namespace mln
const mln_domain(I)& output_domain,
unsigned border_thickness)
{
+ (void) input;
+ (void) factor;
+ (void) output_domain;
+ (void) border_thickness;
+
// Not implemented yet.
mlc_abort(I)::check();
}
diff --git a/milena/mln/subsampling/gaussian_subsampling.hh b/milena/mln/subsampling/gaussian_subsampling.hh
index 4e8f24e..8855b9c 100644
--- a/milena/mln/subsampling/gaussian_subsampling.hh
+++ b/milena/mln/subsampling/gaussian_subsampling.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -66,6 +67,8 @@ namespace mln
trace::entering("subsampling::gaussian_subsampling");
mln_precondition(exact(input).is_valid());
+ (void) sigma;
+
mln_concrete(I) temp(exact(input).domain());
mln_concrete(I) output(geom::nrows(input) / gap,
geom::ncols(input) / gap); //FIXME : image2d only
diff --git a/milena/mln/topo/center_only_iter.hh b/milena/mln/topo/center_only_iter.hh
index ff072aa..9d52099 100644
--- a/milena/mln/topo/center_only_iter.hh
+++ b/milena/mln/topo/center_only_iter.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -44,7 +45,7 @@ namespace mln
{
// Forward declaration.
- template <unsigned D> class face;
+ template <unsigned D> struct face;
/*----------------------------.
@@ -63,7 +64,7 @@ namespace mln
as well, since it always contains a single element, the
center/reference face (and the traversal order is
meaningless).
-
+
This iterator is essentially used to implement other iterators.
\see mln::topo::centered_iter_adapter
\see mln::complex_lower_window
diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh
index da95019..c9b58b0 100644
--- a/milena/mln/topo/face.hh
+++ b/milena/mln/topo/face.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -49,7 +49,7 @@ namespace mln
template <unsigned D> class complex;
template <unsigned N, unsigned D> class n_face;
template <unsigned N, unsigned D> class face_data;
- template <unsigned N> class algebraic_face;
+ template <unsigned N> struct algebraic_face;
/*-------.
diff --git a/milena/mln/topo/face_data.hh b/milena/mln/topo/face_data.hh
index de8028b..1622e51 100644
--- a/milena/mln/topo/face_data.hh
+++ b/milena/mln/topo/face_data.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2008, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -51,7 +51,7 @@ namespace mln
{
template <unsigned N, unsigned D> struct lower_dim_faces_set_mixin;
template <unsigned N, unsigned D> struct higher_dim_faces_set_mixin;
-
+
template <unsigned N, unsigned D>
struct lower_dim_adj_faces_if_dim_matches_;
template <unsigned N, unsigned D>
diff --git a/milena/mln/topo/skeleton/is_simple_point.hh b/milena/mln/topo/skeleton/is_simple_point.hh
index 9fa665c..d852c35 100644
--- a/milena/mln/topo/skeleton/is_simple_point.hh
+++ b/milena/mln/topo/skeleton/is_simple_point.hh
@@ -209,7 +209,6 @@ namespace mln
return internal::nb_connexity_c8[res];
default:
mln_assertion(0);
-
}
return 0;
}
diff --git a/milena/mln/trait/image_from_grid.hh b/milena/mln/trait/image_from_grid.hh
index eae5e4e..38fc538 100644
--- a/milena/mln/trait/image_from_grid.hh
+++ b/milena/mln/trait/image_from_grid.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -47,7 +48,7 @@ namespace mln
// Fwd decls.
template <typename T> struct image1d;
- template <typename T> struct image2d;
+ template <typename T> class image2d;
template <typename T> struct image3d;
diff --git a/milena/mln/trait/images.hh b/milena/mln/trait/images.hh
index 409d773..d8e80b0 100644
--- a/milena/mln/trait/images.hh
+++ b/milena/mln/trait/images.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2007, 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -110,16 +111,16 @@ namespace mln
// Primitive types.
template <typename T> struct image1d;
- template <typename T> struct image2d;
+ template <typename T> class image2d;
template <typename T> struct image3d;
namespace pw { template <typename F, typename S> class image; }
// Morphers.
template <typename I, typename F> struct image_if_base;
- template <typename I, typename D> class decorated_image;
- template <typename I, typename S> class sub_image;
+ template <typename I, typename D> struct decorated_image;
+ template <typename I, typename S> struct sub_image;
template <typename I> class safe_image;
- template <typename T, typename I> class cast_image_;
+ template <typename T, typename I> struct cast_image_;
namespace value { template <unsigned n, typename I> struct stack_image; }
diff --git a/milena/mln/transform/influence_zone_geodesic.hh b/milena/mln/transform/influence_zone_geodesic.hh
index b9a763f..64d7702 100644
--- a/milena/mln/transform/influence_zone_geodesic.hh
+++ b/milena/mln/transform/influence_zone_geodesic.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2008, 2009, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -87,6 +87,9 @@ namespace mln
influence_zone_geodesic(const Image<I>& input,
const Neighborhood<N>& nbh)
{
+ (void) input;
+ (void) nbh;
+
// FIXME: To be written...
mlc_abort(I)::check();
}
diff --git a/milena/mln/util/object_id.hh b/milena/mln/util/object_id.hh
index 794abc4..525ff15 100644
--- a/milena/mln/util/object_id.hh
+++ b/milena/mln/util/object_id.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -136,6 +137,7 @@ namespace mln
inline
object_id<Tag,V>::object_id(const object_id<Tag2,V2>& id)
{
+ (void) id;
typedef object_id<Tag2,V2> id_t;
mlc_abort(id_t)::check();
}
diff --git a/milena/mln/value/float01.hh b/milena/mln/value/float01.hh
index 23f83df..898853f 100644
--- a/milena/mln/value/float01.hh
+++ b/milena/mln/value/float01.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -47,7 +48,7 @@ namespace mln
{
// Fwd decl.
- template <unsigned n> class float01_;
+ template <unsigned n> struct float01_;
class float01;
diff --git a/milena/mln/value/float01_f.hh b/milena/mln/value/float01_f.hh
index 2769200..3edb4ae 100644
--- a/milena/mln/value/float01_f.hh
+++ b/milena/mln/value/float01_f.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -43,7 +44,7 @@ namespace mln
// Fwd decls.
namespace value {
- struct float01;
+ class float01;
struct float01_f;
}
diff --git a/milena/mln/value/graylevel.hh b/milena/mln/value/graylevel.hh
index cca7e08..fc68391 100644
--- a/milena/mln/value/graylevel.hh
+++ b/milena/mln/value/graylevel.hh
@@ -63,7 +63,7 @@ namespace mln
namespace internal
{
template <unsigned n> class gray_;
- class gray_f;
+ struct gray_f;
template <unsigned n_src, unsigned n_dest>
long convert(int val);
}
diff --git a/milena/mln/value/graylevel_f.hh b/milena/mln/value/graylevel_f.hh
index e70927a..4194b25 100644
--- a/milena/mln/value/graylevel_f.hh
+++ b/milena/mln/value/graylevel_f.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -57,7 +58,7 @@ namespace mln
namespace value
{
/// \{ Forward declarations.
- namespace internal {class gray_f; }
+ namespace internal { struct gray_f; }
struct graylevel_f;
template <unsigned n> struct graylevel;
struct float01_f;
diff --git a/milena/mln/value/internal/gray_.hh b/milena/mln/value/internal/gray_.hh
index e672c37..c845c21 100644
--- a/milena/mln/value/internal/gray_.hh
+++ b/milena/mln/value/internal/gray_.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -57,8 +58,8 @@ namespace mln
/// \{ Forward declarations.
template <unsigned n>
struct graylevel;
- template <unsigned N> class graylevel;
- class graylevel_f;
+ template <unsigned N> struct graylevel;
+ struct graylevel_f;
namespace internal
{
template <unsigned n> class gray_;
@@ -488,6 +489,8 @@ namespace mln
void
operator+(const graylevel<n>& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -498,6 +501,8 @@ namespace mln
void
operator+(const I& i, const graylevel<n>& rhs)
{
+ (void) i;
+ (void) rhs;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -516,6 +521,8 @@ namespace mln
void
operator-(const graylevel<n>& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -526,6 +533,8 @@ namespace mln
void
operator-(const I& i, const graylevel<n>& rhs)
{
+ (void) i;
+ (void) rhs;
typename graylevel<n>::wrong_use_of_graylevel___Please_use_the__to_enc__method a;
}
@@ -592,7 +601,7 @@ namespace mln
/// \{ Forward declarations.
namespace internal
{
- class gray_f;
+ struct gray_f;
}
/// \}
diff --git a/milena/mln/value/internal/gray_f.hh b/milena/mln/value/internal/gray_f.hh
index 0408ae4..79a443c 100644
--- a/milena/mln/value/internal/gray_f.hh
+++ b/milena/mln/value/internal/gray_f.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2006, 2007, 2008, 2009 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2006, 2007, 2008, 2009, 2011 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -63,7 +63,7 @@ namespace mln
namespace internal
{
template <unsigned n> class gray_;
- class gray_f;
+ struct gray_f;
}
struct float01_f;
@@ -378,6 +378,8 @@ namespace mln
void
operator+(const graylevel_f& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
@@ -388,6 +390,8 @@ namespace mln
void
operator+(const I& i, const graylevel_f& rhs)
{
+ (void) i;
+ (void) rhs;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
@@ -398,6 +402,8 @@ namespace mln
void
operator-(const graylevel_f& lhs, const I& i)
{
+ (void) lhs;
+ (void) i;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
@@ -408,6 +414,8 @@ namespace mln
void
operator-(const I& i, const graylevel_f& rhs)
{
+ (void) i;
+ (void) rhs;
typename Object<I>::wrong_use_of_graylevel_f___Please_use_the__to_enc__method a;
}
diff --git a/milena/mln/value/lut_vec.hh b/milena/mln/value/lut_vec.hh
index b86e541..a3eda5b 100644
--- a/milena/mln/value/lut_vec.hh
+++ b/milena/mln/value/lut_vec.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2007, 2009, 2010 EPITA Research and Development
+// Copyright (C) 2007, 2009, 2010, 2011 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -136,8 +136,9 @@ namespace mln
template <typename S, typename T>
inline
unsigned
- lut_vec<S,T>::index_of(const T& /* v */) const
+ lut_vec<S,T>::index_of(const T& v) const
{
+ (void) v;
mln_invariant(0); // FIXME
return 0;
}
diff --git a/milena/mln/world/binary_2d/enlarge.hh b/milena/mln/world/binary_2d/enlarge.hh
index 1ffd512..da546e1 100644
--- a/milena/mln/world/binary_2d/enlarge.hh
+++ b/milena/mln/world/binary_2d/enlarge.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -328,6 +329,9 @@ namespace mln
mln_concrete(I)
enlarge_dispatch(const I& input, const mln_value(I)&, unsigned n)
{
+ (void) input;
+ (void) n;
+
mlc_abort(I)::check();
return mln_concrete(I)();
}
--
1.7.2.5
1
0
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch unstable/scribo has been updated
discards 48ccb0ee1492695efa215095edfe715af8ab5d78 (commit)
discards 83eb6772d566edfd0825912255955dfabbba50e0 (commit)
discards db8e0805c02f6fa0a06df902501fad5298a9d3ea (commit)
discards 027bd1b24532d2f6bba717dafdc201a6834ef376 (commit)
discards b14a6dbe8c39dc12ef0aa238111f7fa19d91cbb0 (commit)
via b926dc165dc73387115470edbbba0b6b2e0964d1 (commit)
via 0c44c4c4c9b5e9112cde2b58e0131d09153e046f (commit)
via 91bcd8b415ad22099a16cd941b54f459968b348b (commit)
via 19c45fe85a90403b06454eab85b2a1e628f8d617 (commit)
via 93ca680bd5b2d8e1291f4a542c24548828e92e7c (commit)
via 812809e6cc8a720e6e22cdc3c6cc82f74638bead (commit)
via 8f46b1c939d1f110f4ad55ba3c2fdb51c5c1d709 (commit)
via 0c903e4c6d40d4f86ebda65250c26274854f34cc (commit)
via 00537669dbd854328126aa97cb7e7658129de3da (commit)
via 943c281c2157825dac2f7ff7c64f79dec21a0830 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (48ccb0ee1492695efa215095edfe715af8ab5d78)
\
N -- N -- N (b926dc165dc73387115470edbbba0b6b2e0964d1)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
b926dc1 Merge branch 'next' into unstable/scribo
0c44c4c Fix test of Niblack's algorithm.
91bcd8b Update use of the threshold function.
19c45fe Add two variants of the threshold function.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 +
README | 11 ++-
milena/ChangeLog | 85 +++++++++-----------
milena/mln/border/fill.hh | 31 ++++---
milena/mln/core/box_runstart_piter.hh | 2 +
milena/tests/border/Makefile.am | 4 +-
.../niblack.cc => milena/tests/border/fill_0.cc | 42 ++++++----
scribo/ChangeLog | 27 ++++++
scribo/README | 34 +++++++-
scribo/src/README | 9 +-
10 files changed, 160 insertions(+), 89 deletions(-)
copy scribo/tests/binarization/niblack.cc => milena/tests/border/fill_0.cc (66%)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch next has been updated
via 93ca680bd5b2d8e1291f4a542c24548828e92e7c (commit)
via 812809e6cc8a720e6e22cdc3c6cc82f74638bead (commit)
from 8f46b1c939d1f110f4ad55ba3c2fdb51c5c1d709 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
93ca680 Fix compilation issues with g++ 4.6.1 and clang++.
812809e Fix warnings with Clang/g++ 4.6.x
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 146 ++++++++++++++++++
milena/mln/accu/internal/couple.hh | 7 +-
milena/mln/accu/line.hh | 17 +-
milena/mln/algebra/vec.hh | 3 +-
milena/mln/border/duplicate.hh | 4 +-
milena/mln/border/mirror.hh | 3 +-
milena/mln/canvas/browsing/backdiagonal2d.hh | 12 +-
milena/mln/canvas/browsing/breadth_first_search.hh | 13 ++-
milena/mln/canvas/browsing/depth_first_search.hh | 12 ++-
milena/mln/canvas/browsing/diagonal2d.hh | 8 +
.../canvas/browsing/dir_struct_elt_incr_update.hh | 11 ++-
milena/mln/canvas/browsing/directional.hh | 12 ++-
milena/mln/canvas/browsing/fwd.hh | 11 ++-
milena/mln/canvas/browsing/hyper_directional.hh | 11 ++-
.../canvas/browsing/internal/graph_first_search.hh | 1 +
milena/mln/canvas/browsing/snake_fwd.hh | 11 +-
milena/mln/canvas/browsing/snake_generic.hh | 11 +-
milena/mln/canvas/browsing/snake_vert.hh | 5 +-
milena/mln/convert/from_to.hxx | 2 +-
milena/mln/convert/impl/from_double_to_value.hh | 9 +-
milena/mln/convert/impl/from_float_to_value.hh | 8 +-
milena/mln/convert/impl/from_image_to_site_set.hh | 4 +-
milena/mln/convert/impl/from_int_to_value.hh | 6 +-
milena/mln/convert/to_qimage.hh | 2 +
milena/mln/core/concept/box.hh | 3 +-
milena/mln/core/dpoints_pixter.hh | 25 ++--
milena/mln/core/faces_psite.hh | 5 +-
milena/mln/core/image/ch_piter.hh | 5 +-
milena/mln/core/image/complex_window_piter.hh | 5 +-
milena/mln/core/image/dmorph/extended.hh | 5 +-
milena/mln/core/image/dmorph/extension_fun.hh | 5 +-
milena/mln/core/image/dmorph/extension_ima.hh | 6 +-
milena/mln/core/image/dmorph/extension_val.hh | 5 +-
milena/mln/core/image/dmorph/hexa.hh | 5 +-
milena/mln/core/image/dmorph/sub_image.hh | 4 +-
milena/mln/core/image/dmorph/sub_image_if.hh | 7 +-
milena/mln/core/image/dmorph/transformed_image.hh | 7 +-
milena/mln/core/image/flat_image.hh | 5 +-
milena/mln/core/image/graph_elt_mixed_window.hh | 7 +-
milena/mln/core/image/graph_elt_window.hh | 4 +-
milena/mln/core/image/graph_elt_window_if.hh | 7 +-
milena/mln/core/image/graph_window_if_piter.hh | 4 +-
milena/mln/core/image/graph_window_piter.hh | 6 +-
milena/mln/core/image/image2d.hh | 2 +-
milena/mln/core/image/imorph/labeled_image.hh | 5 +-
milena/mln/core/image/imorph/plain.hh | 5 +-
milena/mln/core/image/imorph/safe.hh | 5 +-
milena/mln/core/image/vmorph/cast_image.hh | 5 +-
milena/mln/core/image/vmorph/fun_image.hh | 4 +-
milena/mln/core/image/vmorph/thru_image.hh | 8 +-
milena/mln/core/image/vmorph/thrubin_image.hh | 4 +-
milena/mln/core/image/vmorph/violent_cast_image.hh | 5 +-
.../mln/core/internal/is_masked_impl_selector.hh | 7 +-
milena/mln/core/internal/pixel_impl.hh | 2 +-
milena/mln/core/internal/site_set_iterator_base.hh | 6 +-
milena/mln/core/point.hh | 3 +-
milena/mln/core/routine/init.hxx | 5 +-
milena/mln/core/site_set/attic/p_faces_piter.hh | 4 +-
milena/mln/core/site_set/p_array.hh | 4 +-
milena/mln/core/site_set/p_edges.hh | 5 +-
milena/mln/core/site_set/p_faces.hh | 5 +-
milena/mln/core/site_set/p_if.hh | 6 +-
milena/mln/core/site_set/p_transformed.hh | 5 +-
milena/mln/core/site_set/p_vertices.hh | 4 +-
milena/mln/data/fill.hh | 4 +-
milena/mln/data/was.median.hh | 8 +-
milena/mln/debug/println.spe.hh | 5 +-
milena/mln/extension/fill.hh | 2 +
milena/mln/fun/spe/binary.hh | 1 +
milena/mln/fun/spe/unary.hh | 4 +-
milena/mln/fun/v2v/hsl_to_rgb.hh | 11 +-
milena/mln/fun/x2x/rotation.hh | 7 +-
milena/mln/geom/chamfer.hh | 5 +-
milena/mln/io/fld/max_components.hh | 3 +-
milena/mln/io/pbm/save.hh | 7 +-
milena/mln/io/pgm/save.hh | 7 +-
milena/mln/labeling/flat_zones.hh | 10 +-
milena/mln/labeling/value.hh | 4 +-
milena/mln/literal/black.hh | 14 ++-
milena/mln/literal/colors.hh | 156 ++++++++++++++++----
milena/mln/literal/white.hh | 12 ++-
milena/mln/morpho/attribute/height.hh | 5 +-
milena/mln/morpho/attribute/sharpness.hh | 5 +-
milena/mln/morpho/attribute/volume.hh | 5 +-
.../reconstruction/by_dilation/union_find.hh | 18 ++-
milena/mln/morpho/tree/compute_attribute_image.hh | 9 +-
milena/mln/morpho/tree/data.hh | 4 +-
milena/mln/opt/element.hh | 9 +-
milena/mln/registration/get_rot.hh | 9 +-
milena/mln/subsampling/antialiased.hh | 10 ++
milena/mln/subsampling/gaussian_subsampling.hh | 5 +-
milena/mln/topo/center_only_iter.hh | 5 +-
milena/mln/topo/face.hh | 2 +-
milena/mln/topo/face_data.hh | 4 +-
milena/mln/topo/skeleton/is_simple_point.hh | 1 -
milena/mln/trait/image_from_grid.hh | 5 +-
milena/mln/trait/images.hh | 9 +-
milena/mln/transform/influence_zone_geodesic.hh | 7 +-
milena/mln/util/object_id.hh | 4 +-
milena/mln/value/float01.hh | 5 +-
milena/mln/value/float01_f.hh | 5 +-
milena/mln/value/graylevel.hh | 2 +-
milena/mln/value/graylevel_f.hh | 5 +-
milena/mln/value/internal/gray_.hh | 17 ++-
milena/mln/value/internal/gray_f.hh | 14 ++-
milena/mln/value/lut_vec.hh | 5 +-
milena/mln/world/binary_2d/enlarge.hh | 6 +-
107 files changed, 725 insertions(+), 258 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
22 Nov '11
This is a merge commit message of the following branches:
Merge: 0c44c4c 93ca680
ChangeLog | 4 +
README | 11 +-
milena/ChangeLog | 161 ++++++++++++++++++--
milena/mln/accu/internal/couple.hh | 7 +-
milena/mln/accu/line.hh | 17 +-
milena/mln/algebra/vec.hh | 3 +-
milena/mln/border/duplicate.hh | 4 +-
milena/mln/border/fill.hh | 31 ++--
milena/mln/border/mirror.hh | 3 +-
milena/mln/canvas/browsing/backdiagonal2d.hh | 12 +-
milena/mln/canvas/browsing/breadth_first_search.hh | 13 ++-
milena/mln/canvas/browsing/depth_first_search.hh | 12 ++-
milena/mln/canvas/browsing/diagonal2d.hh | 8 +
.../canvas/browsing/dir_struct_elt_incr_update.hh | 11 ++-
milena/mln/canvas/browsing/directional.hh | 12 ++-
milena/mln/canvas/browsing/fwd.hh | 11 ++-
milena/mln/canvas/browsing/hyper_directional.hh | 11 ++-
.../canvas/browsing/internal/graph_first_search.hh | 1 +
milena/mln/canvas/browsing/snake_fwd.hh | 11 +-
milena/mln/canvas/browsing/snake_generic.hh | 11 +-
milena/mln/canvas/browsing/snake_vert.hh | 5 +-
milena/mln/convert/from_to.hxx | 2 +-
milena/mln/convert/impl/from_double_to_value.hh | 9 +-
milena/mln/convert/impl/from_float_to_value.hh | 8 +-
milena/mln/convert/impl/from_image_to_site_set.hh | 4 +-
milena/mln/convert/impl/from_int_to_value.hh | 6 +-
milena/mln/convert/to_qimage.hh | 2 +
milena/mln/core/box_runstart_piter.hh | 2 +
milena/mln/core/concept/box.hh | 3 +-
milena/mln/core/dpoints_pixter.hh | 25 ++--
milena/mln/core/faces_psite.hh | 5 +-
milena/mln/core/image/ch_piter.hh | 5 +-
milena/mln/core/image/complex_window_piter.hh | 5 +-
milena/mln/core/image/dmorph/extended.hh | 5 +-
milena/mln/core/image/dmorph/extension_fun.hh | 5 +-
milena/mln/core/image/dmorph/extension_ima.hh | 6 +-
milena/mln/core/image/dmorph/extension_val.hh | 5 +-
milena/mln/core/image/dmorph/hexa.hh | 5 +-
milena/mln/core/image/dmorph/sub_image.hh | 4 +-
milena/mln/core/image/dmorph/sub_image_if.hh | 7 +-
milena/mln/core/image/dmorph/transformed_image.hh | 7 +-
milena/mln/core/image/flat_image.hh | 5 +-
milena/mln/core/image/graph_elt_mixed_window.hh | 7 +-
milena/mln/core/image/graph_elt_window.hh | 4 +-
milena/mln/core/image/graph_elt_window_if.hh | 7 +-
milena/mln/core/image/graph_window_if_piter.hh | 4 +-
milena/mln/core/image/graph_window_piter.hh | 6 +-
milena/mln/core/image/image2d.hh | 2 +-
milena/mln/core/image/imorph/labeled_image.hh | 5 +-
milena/mln/core/image/imorph/plain.hh | 5 +-
milena/mln/core/image/imorph/safe.hh | 5 +-
milena/mln/core/image/vmorph/cast_image.hh | 5 +-
milena/mln/core/image/vmorph/fun_image.hh | 4 +-
milena/mln/core/image/vmorph/thru_image.hh | 8 +-
milena/mln/core/image/vmorph/thrubin_image.hh | 4 +-
milena/mln/core/image/vmorph/violent_cast_image.hh | 5 +-
.../mln/core/internal/is_masked_impl_selector.hh | 7 +-
milena/mln/core/internal/pixel_impl.hh | 2 +-
milena/mln/core/internal/site_set_iterator_base.hh | 6 +-
milena/mln/core/point.hh | 3 +-
milena/mln/core/routine/init.hxx | 5 +-
milena/mln/core/site_set/attic/p_faces_piter.hh | 4 +-
milena/mln/core/site_set/p_array.hh | 4 +-
milena/mln/core/site_set/p_edges.hh | 5 +-
milena/mln/core/site_set/p_faces.hh | 5 +-
milena/mln/core/site_set/p_if.hh | 6 +-
milena/mln/core/site_set/p_transformed.hh | 5 +-
milena/mln/core/site_set/p_vertices.hh | 4 +-
milena/mln/data/fill.hh | 4 +-
milena/mln/data/was.median.hh | 8 +-
milena/mln/debug/println.spe.hh | 5 +-
milena/mln/extension/fill.hh | 2 +
milena/mln/fun/spe/binary.hh | 1 +
milena/mln/fun/spe/unary.hh | 4 +-
milena/mln/fun/v2v/hsl_to_rgb.hh | 11 +-
milena/mln/fun/x2x/rotation.hh | 7 +-
milena/mln/geom/chamfer.hh | 5 +-
milena/mln/io/fld/max_components.hh | 3 +-
milena/mln/io/pbm/save.hh | 7 +-
milena/mln/io/pgm/save.hh | 7 +-
milena/mln/labeling/flat_zones.hh | 10 +-
milena/mln/labeling/value.hh | 4 +-
milena/mln/literal/black.hh | 14 ++-
milena/mln/literal/colors.hh | 156 +++++++++++++++----
milena/mln/literal/white.hh | 12 ++-
milena/mln/morpho/attribute/height.hh | 5 +-
milena/mln/morpho/attribute/sharpness.hh | 5 +-
milena/mln/morpho/attribute/volume.hh | 5 +-
.../reconstruction/by_dilation/union_find.hh | 18 ++-
milena/mln/morpho/tree/compute_attribute_image.hh | 9 +-
milena/mln/morpho/tree/data.hh | 4 +-
milena/mln/opt/element.hh | 9 +-
milena/mln/registration/get_rot.hh | 9 +-
milena/mln/subsampling/antialiased.hh | 10 ++
milena/mln/subsampling/gaussian_subsampling.hh | 5 +-
milena/mln/topo/center_only_iter.hh | 5 +-
milena/mln/topo/face.hh | 2 +-
milena/mln/topo/face_data.hh | 4 +-
milena/mln/topo/skeleton/is_simple_point.hh | 1 -
milena/mln/trait/image_from_grid.hh | 5 +-
milena/mln/trait/images.hh | 9 +-
milena/mln/transform/influence_zone_geodesic.hh | 7 +-
milena/mln/util/object_id.hh | 4 +-
milena/mln/value/float01.hh | 5 +-
milena/mln/value/float01_f.hh | 5 +-
milena/mln/value/graylevel.hh | 2 +-
milena/mln/value/graylevel_f.hh | 5 +-
milena/mln/value/internal/gray_.hh | 17 ++-
milena/mln/value/internal/gray_f.hh | 14 ++-
milena/mln/value/lut_vec.hh | 5 +-
milena/mln/world/binary_2d/enlarge.hh | 6 +-
milena/tests/border/Makefile.am | 4 +-
milena/tests/border/fill_0.cc | 60 ++++++++
scribo/ChangeLog | 27 ++++
scribo/README | 34 ++++-
scribo/src/README | 9 +-
116 files changed, 885 insertions(+), 295 deletions(-)
diff --cc ChangeLog
index 87c0702,2515596..6dbac5a
--- a/ChangeLog
+++ b/ChangeLog
@@@ -1,8 -1,7 +1,12 @@@
+ 2011-10-06 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * README (Bibliography): Mention the GRETSI 2011 paper.
+
+2011-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * m4/oln-with-lib.m4: Lookup for multiple AND single libraries
+ while checking Tesseract availability.
+
2011-09-16 Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac, NEWS: Version 2.0a.
diff --cc milena/ChangeLog
index 733afe4,724f344..8817868
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@@ -1,146 -1,48 +1,172 @@@
+2011-11-22 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add two variants of the threshold function.
+
+ * apps/papers/levillain.09.ismm/graph.cc,
+ * doc/examples/tuto4_genericity_and_algorithms.cc,
+ * mln/binarization/threshold.hh,
+ * mln/fun/v2b/all.hh,
+ * mln/fun/v2b/essential.hh,
+ * mln/world/binary_2d/enlarge.hh,
+ * tests/labeling/n_max.cc: Update includes and use of threshold
+ function.
+
+ * mln/fun/v2b/threshold.hh: Replaced...
+
+ * mln/fun/v2b/threshold_ge.hh,
+ * mln/fun/v2b/threshold_le.hh: ... by these files.
+
+ * tests/unit_test/unit-tests.mk: Regen.
+
+2011-11-21 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/geom/crop_without_localization.hh: Fix preconditions.
+
+2011-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix compilation Warnings with latest g++ versions.
+
+ * apps/papers/levillain.09.ismm/graph.cc,
+ * mln/canvas/browsing/diagonal2d.hh,
+ * mln/morpho/watershed/topological.hh: Remove unused variable.
+
+ * mln/canvas/labeling/sorted.hh,
+ * mln/core/concept/accumulator.hh,
+ * mln/core/concept/box.hh,
+ * mln/core/concept/gdpoint.hh,
+ * mln/core/concept/generalized_pixel.hh,
+ * mln/core/concept/gpoint.hh,
+ * mln/core/concept/graph.hh,
+ * mln/core/concept/image.hh,
+ * mln/core/concept/iterator.hh,
+ * mln/core/concept/neighborhood.hh,
+ * mln/core/concept/proxy.hh,
+ * mln/core/concept/pseudo_site.hh,
+ * mln/core/concept/site_iterator.hh,
+ * mln/core/concept/site_proxy.hh,
+ * mln/core/concept/site_set.hh,
+ * mln/core/concept/value_iterator.hh,
+ * mln/core/concept/value_set.hh,
+ * mln/core/concept/weighted_window.hh,
+ * mln/core/concept/window.hh,
+ * mln/core/image/imorph/decorated_image.hh,
+ * mln/core/internal/check/image_fastest.hh,
+ * mln/core/internal/site_relative_iterator_base.hh,
+ * mln/io/off/load.hh,
+ * mln/io/off/save.hh,
+ * mln/morpho/reconstruction/by_erosion/union_find.hh,
+ * mln/topo/internal/complex_relative_iterator_base.hh,
+ * tests/algebra/h_vec.cc,
+ * tests/core/alias/point1d.cc,
+ * tests/metal/unconst.cc,
+ * tests/morpho/complex_image_wst.cc,
+ * apps/papers/levillain.09.ismm/graph.cc,
+ * mln/canvas/browsing/diagonal2d.hh,
+ * mln/canvas/labeling/sorted.hh,
+ * mln/core/concept/accumulator.hh,
+ * mln/core/concept/box.hh,
+ * mln/core/concept/gdpoint.hh,
+ * mln/core/concept/generalized_pixel.hh,
+ * mln/core/concept/gpoint.hh,
+ * mln/core/concept/graph.hh,
+ * mln/core/concept/image.hh,
+ * mln/core/concept/iterator.hh,
+ * mln/core/concept/neighborhood.hh,
+ * mln/core/concept/proxy.hh,
+ * mln/core/concept/pseudo_site.hh,
+ * mln/core/concept/site_iterator.hh,
+ * mln/core/concept/site_proxy.hh,
+ * mln/core/concept/site_set.hh,
+ * mln/core/concept/value_iterator.hh,
+ * mln/core/concept/value_set.hh,
+ * mln/core/concept/weighted_window.hh,
+ * mln/core/concept/window.hh,
+ * mln/core/image/imorph/decorated_image.hh,
+ * mln/core/internal/check/image_fastest.hh,
+ * mln/core/internal/site_relative_iterator_base.hh,
+ * mln/io/off/load.hh,
+ * mln/io/off/save.hh,
+ * mln/morpho/reconstruction/by_erosion/union_find.hh,
+ * mln/morpho/watershed/topological.hh,
+ * mln/topo/internal/complex_relative_iterator_base.hh,
+ * tests/algebra/h_vec.cc,
+ * tests/core/alias/point1d.cc,
+ * tests/metal/unconst.cc,
+ * tests/morpho/complex_image_wst.cc,
+ * tests/trait/super.cc: Fix unused variable warnings.
+
+2011-10-28 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/core/image/dmorph/slice_image.hh: Add operator=() for
+ image2d.
+
+2011-10-18 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/io/dicom/load.hh: Fix memory leak.
+
+2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Invert threshold function test.
+
+ * mln/fun/v2b/threshold.hh: Here.
+
+2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add new crop routines.
+
+ * mln/geom/crop.hh,
+ * mln/geom/crop_without_localization.hh: New.
+
+2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/value/builtin/floatings.hh: Fix string name for builtin
+ double type.
+
- 2011-09-15 Guillaume Lazzara <z(a)lrde.epita.fr>
++2011-10-04 Roland Levillain <roland(a)lrde.epita.fr>
+
- Fix Scribo build system.
++ Handle the case of filling an empty border.
+
- * demo/viewer/Makefile.am: Take into account no-strict-aliasing
- flag.
++ * mln/border/fill.hh (mln::border::impl::fill_size_1): Here.
++ Aesthetic changes.
++ * tests/border/fill_0.cc: New test.
++ * tests/border/Makefile.am (check_PROGRAMS): Add fill_0.
++ (fill_0_SOURCES): New.
+
- * demo/review/Makefile.am,
- * src/toolchain/nepomuk/Makefile.am: Do not distribute some
- examples.
+ 2011-11-21 Guillaume Lazzara <z(a)lrde.epita.fr>
- 2011-09-15 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Fix compilation issues with g++ 4.6.1 and clang++.
- Improve text justification in HTML document reconstruction.
+ * mln/topo/center_only_iter.hh,
+ * mln/topo/face.hh,
+ * mln/trait/images.hh,
+ * mln/convert/from_to.hxx,
+ * mln/core/image/dmorph/sub_image.hh,
+ * mln/core/routine/init.hxx,
+ * mln/algebra/vec.hh: Make declaration and forward declarations
+ consistent.
- * demo/xml2doc/templates/html/css.css,
- * demo/xml2doc/templates/html/main.xsl,
- * demo/xml2doc/templates/html/main_base64.xsl: Add new CSS rules.
+ * mln/canvas/browsing/backdiagonal2d.hh,
+ * mln/canvas/browsing/breadth_first_search.hh,
+ * mln/canvas/browsing/depth_first_search.hh,
+ * mln/canvas/browsing/diagonal2d.hh,
+ * mln/canvas/browsing/dir_struct_elt_incr_update.hh,
+ * mln/canvas/browsing/directional.hh,
+ * mln/canvas/browsing/fwd.hh,
+ * mln/canvas/browsing/hyper_directional.hh,
+ * mln/canvas/browsing/snake_fwd.hh,
+ * mln/canvas/browsing/snake_generic.hh,
+ * mln/canvas/browsing/snake_vert.hh,
+ * mln/fun/v2v/hsl_to_rgb.hh,
+ * mln/literal/black.hh,
+ * mln/literal/colors.hh,
+ * mln/literal/white.hh: Add a default constructor for global
+ variable types.
+
+ * mln/canvas/browsing/internal/graph_first_search.hh: Avoid a
+ warning for an unused variable.
+
+ * mln/data/was.median.hh: Fix type of the reference.
-2011-10-04 Roland Levillain <roland(a)lrde.epita.fr>
-
- Handle the case of filling an empty border.
-
- * mln/border/fill.hh (mln::border::impl::fill_size_1): Here.
- Aesthetic changes.
- * tests/border/fill_0.cc: New test.
- * tests/border/Makefile.am (check_PROGRAMS): Add fill_0.
- (fill_0_SOURCES): New.
-
2011-09-15 Roland Levillain <roland(a)lrde.epita.fr>
Update Milena tests w.r.t. the new version of lena.pgm.
diff --cc scribo/ChangeLog
index 8c536d7,420997a..95b6b98
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@@ -1,92 -1,11 +1,100 @@@
+ 2011-10-06 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Mention the ICDAR 2011 paper in SCRIBO's README.
+
+ * README (Bibliography): Here.
+ Fix copyright header.
+ * src/README: Fix copyright header.
+
+2011-11-22 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix test of Niblack's algorithm.
+
+ * tests/binarization/niblack.ref.pbm: Update.
+
+2011-11-22 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update use of the threshold function.
+
+ * scribo/binarization/global_threshold.hh: Here.
+
+ * scribo/binarization/sauvola_ms_split.hh,
+ * scribo/text/clean.hh,
+ * scribo/text/clean_inplace.hh: Remove useless include.
+
+2011-11-21 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * README: update requirements information.
+
+2011-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * scribo/text/recognition.hh: Fix code for Tesseract 3.01
+ compatibility.
+
+2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Move Otsu's threshold computation in a separate routine.
+
+ * scribo/binarization/otsu.hh,
+ * scribo/binarization/otsu_threshold.hh: Move threshold
+ computation in a separate routine.
+
+2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add Niblack's binarization algorithm.
+
+ * scribo/binarization/all.hh: Update includes.
+
+ * scribo/binarization/internal/compute_local_threshold.hh,
+ * scribo/binarization/internal/compute_sauvola_threshold.hh,
+ * scribo/binarization/internal/first_pass_functor.hh,
+ * scribo/binarization/internal/local_threshold_debug.hh,
+ * scribo/binarization/internal/sauvola_debug.hh,
+ * scribo/binarization/internal/sauvola_formula.hh,
+ * scribo/binarization/sauvola.hh,
+ * scribo/binarization/sauvola_ms.hh,
+ * scribo/binarization/sauvola_threshold.hh,
+ * scribo/binarization/sauvola_threshold_image.hh: Revamp code in
+ order to share some parts with Niblack's algorithm.
+
+ * scribo/binarization/internal/niblack_formula.hh,
+ * scribo/binarization/niblack.hh,
+ * scribo/binarization/niblack_threshold.hh: New.
+
+ * src/binarization/Makefile.am
+ * tests/binarization/Makefile.am: Add new targets.
+
+ * src/binarization/niblack.cc: New tool.
+
+ * tests/binarization/niblack.cc: New test.
+
+ * tests/binarization/niblack.ref.pbm: New test data.
+
+2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add a new tool for global thresholding.
+
+ * src/binarization/Makefile.am: Add a new target.
+
+ * src/binarization/global_threshold.cc: New.
+
+2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * tests/binarization/global_threshold.cc: Fix test.
+
+2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add Otsu's binarization implementation.
+
+ * scribo/binarization/otsu.hh: New routine.
+
+ * src/binarization/Makefile.am,
+ * src/binarization/otsu.cc: New tool.
+
+ * tests/binarization/Makefile.am,
+ * tests/binarization/otsu.cc,
+ * tests/binarization/otsu.ref.pbm: New test data.
+
2011-09-19 Guillaume Lazzara <z(a)lrde.epita.fr>
Fix paths in the SCRIBO viewer.
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
22 Nov '11
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch llvm-support has been deleted
was 887dfe212525fea8f438c84b490ebd7ae1287119
-----------------------------------------------------------------------
887dfe212525fea8f438c84b490ebd7ae1287119 Fix more warnings with Clang 3.0
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch gimpplugin has been deleted
was 6c0b45ce7368a98b667f55af8c63c750931b822c
-----------------------------------------------------------------------
6c0b45ce7368a98b667f55af8c63c750931b822c backup
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
22 Nov '11
* scribo/binarization/all.hh: Update includes.
* scribo/binarization/internal/compute_local_threshold.hh,
* scribo/binarization/internal/compute_sauvola_threshold.hh,
* scribo/binarization/internal/first_pass_functor.hh,
* scribo/binarization/internal/local_threshold_debug.hh,
* scribo/binarization/internal/sauvola_debug.hh,
* scribo/binarization/internal/sauvola_formula.hh,
* scribo/binarization/sauvola.hh,
* scribo/binarization/sauvola_ms.hh,
* scribo/binarization/sauvola_threshold.hh,
* scribo/binarization/sauvola_threshold_image.hh: Revamp code in
order to share some parts with Niblack's algorithm.
* scribo/binarization/internal/niblack_formula.hh,
* scribo/binarization/niblack.hh,
* scribo/binarization/niblack_threshold.hh: New.
* src/binarization/Makefile.am
* tests/binarization/Makefile.am: Add new targets.
* src/binarization/niblack.cc: New tool.
* tests/binarization/niblack.cc: New test.
* tests/binarization/niblack.ref.pbm: New test data.
---
scribo/ChangeLog | 31 ++
scribo/scribo/binarization/all.hh | 5 +-
.../internal/compute_local_threshold.hh | 224 +++++++++++++++
.../internal/compute_sauvola_threshold.hh | 285 ------------------
.../binarization/internal/first_pass_functor.hh | 24 +-
.../binarization/internal/local_threshold_debug.hh | 88 ++++++
.../binarization/internal/niblack_formula.hh | 105 +++++++
.../scribo/binarization/internal/sauvola_debug.hh | 87 ------
.../binarization/internal/sauvola_formula.hh | 121 ++++++++
scribo/scribo/binarization/niblack.hh | 218 ++++++++++++++
scribo/scribo/binarization/niblack_threshold.hh | 299 +++++++++++++++++++
scribo/scribo/binarization/sauvola.hh | 24 +-
scribo/scribo/binarization/sauvola_ms.hh | 21 +-
scribo/scribo/binarization/sauvola_threshold.hh | 296 +++++++++++++++++++
.../scribo/binarization/sauvola_threshold_image.hh | 301 --------------------
scribo/src/binarization/Makefile.am | 12 +-
scribo/src/binarization/niblack.cc | 106 +++++++
.../binarization/pgm_sauvola_threshold_image.cc | 7 +-
scribo/tests/binarization/Makefile.am | 3 +
scribo/tests/binarization/niblack.cc | 52 ++++
scribo/tests/binarization/niblack.ref.pbm | Bin 0 -> 32884 bytes
21 files changed, 1597 insertions(+), 712 deletions(-)
create mode 100644 scribo/scribo/binarization/internal/compute_local_threshold.hh
delete mode 100644 scribo/scribo/binarization/internal/compute_sauvola_threshold.hh
create mode 100644 scribo/scribo/binarization/internal/local_threshold_debug.hh
create mode 100644 scribo/scribo/binarization/internal/niblack_formula.hh
delete mode 100644 scribo/scribo/binarization/internal/sauvola_debug.hh
create mode 100644 scribo/scribo/binarization/internal/sauvola_formula.hh
create mode 100644 scribo/scribo/binarization/niblack.hh
create mode 100644 scribo/scribo/binarization/niblack_threshold.hh
create mode 100644 scribo/scribo/binarization/sauvola_threshold.hh
delete mode 100644 scribo/scribo/binarization/sauvola_threshold_image.hh
create mode 100644 scribo/src/binarization/niblack.cc
create mode 100644 scribo/tests/binarization/niblack.cc
create mode 100644 scribo/tests/binarization/niblack.ref.pbm
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 5aa2a06..0923b28 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,34 @@
+2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add Niblack's binarization algorithm.
+
+ * scribo/binarization/all.hh: Update includes.
+
+ * scribo/binarization/internal/compute_local_threshold.hh,
+ * scribo/binarization/internal/compute_sauvola_threshold.hh,
+ * scribo/binarization/internal/first_pass_functor.hh,
+ * scribo/binarization/internal/local_threshold_debug.hh,
+ * scribo/binarization/internal/sauvola_debug.hh,
+ * scribo/binarization/internal/sauvola_formula.hh,
+ * scribo/binarization/sauvola.hh,
+ * scribo/binarization/sauvola_ms.hh,
+ * scribo/binarization/sauvola_threshold.hh,
+ * scribo/binarization/sauvola_threshold_image.hh: Revamp code in
+ order to share some parts with Niblack's algorithm.
+
+ * scribo/binarization/internal/niblack_formula.hh,
+ * scribo/binarization/niblack.hh,
+ * scribo/binarization/niblack_threshold.hh: New.
+
+ * src/binarization/Makefile.am
+ * tests/binarization/Makefile.am: Add new targets.
+
+ * src/binarization/niblack.cc: New tool.
+
+ * tests/binarization/niblack.cc: New test.
+
+ * tests/binarization/niblack.ref.pbm: New test data.
+
2011-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a new tool for global thresholding.
diff --git a/scribo/scribo/binarization/all.hh b/scribo/scribo/binarization/all.hh
index 6f40505..5530861 100644
--- a/scribo/scribo/binarization/all.hh
+++ b/scribo/scribo/binarization/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -50,6 +51,6 @@ namespace scribo
# include <scribo/binarization/sauvola.hh>
# include <scribo/binarization/sauvola_ms.hh>
# include <scribo/binarization/sauvola_ms_split.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
+# include <scribo/binarization/sauvola_threshold.hh>
#endif // ! SCRIBO_BINARIZATION_ALL_HH
diff --git a/scribo/scribo/binarization/internal/compute_local_threshold.hh b/scribo/scribo/binarization/internal/compute_local_threshold.hh
new file mode 100644
index 0000000..147ef0f
--- /dev/null
+++ b/scribo/scribo/binarization/internal/compute_local_threshold.hh
@@ -0,0 +1,224 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_COMPUTE_LOCAL_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_INTERNAL_COMPUTE_LOCAL_THRESHOLD_HH
+
+
+/// \file
+///
+/// \brief Compute a threshold with Local's binarization formula.
+
+# include <algorithm>
+# include <cmath>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/binarization/internal/local_threshold_debug.hh>
+
+
+
+// extern mln::image2d<double> skewness;
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ namespace internal
+ {
+
+ using namespace mln;
+
+
+ /*! \brief Compute a point wise threshold according to a local
+ binarization formula.
+
+ \param[in] p A site.
+ \param[in] simple An integral image of mean values.
+ \param[in] squared An integral image of squared mean values.
+ \param[in] win_width Window width.
+ \param[in] k Control the threshold value in the local
+ window. The higher, the lower the threshold
+ form the local mean m(x, y).
+ \param[in] R Maximum value of the standard deviation (128
+ for grayscale documents).
+ \param[in] formula The function to use to compute the local
+ threshold.
+
+ \return A threshold.
+ */
+ template <typename P, typename J, typename F>
+ double
+ compute_local_threshold(const P& p,
+ const J& simple,
+ const J& squared,
+ int win_width, double K, double R,
+ const F& formula);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ template <typename P, typename J, typename F>
+ double
+ compute_local_threshold(const P& p,
+ const J& simple,
+ const J& squared,
+ int win_width, double K, double R,
+ const F& formula)
+ {
+ mln_precondition(simple.nrows() == squared.nrows());
+ mln_precondition(simple.ncols() == squared.ncols());
+
+ // Window half width.
+ int w_2 = win_width >> 1;
+
+ int row_min = std::max(0, p.row() - w_2 - 1);
+ int col_min = std::max(0, p.col() - w_2 - 1);
+
+ int row_max = std::min(static_cast<int>(simple.nrows()) - 1,
+ p.row() + w_2);
+ int col_max = std::min(static_cast<int>(simple.ncols()) - 1,
+ p.col() + w_2);
+
+
+ double wh = (row_max - row_min) * (col_max - col_min);
+
+ // Mean.
+ double m_x_y_tmp = (simple.at_(row_max, col_max)
+ + simple.at_(row_min, col_min)
+ - simple.at_(row_max, col_min)
+ - simple.at_(row_min, col_max));
+
+ double m_x_y = m_x_y_tmp / wh;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local mean
+ debug_mean(p) = m_x_y * mean_debug_factor;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Standard deviation.
+ double s_x_y_tmp = (squared.at_(row_max, col_max)
+ + squared.at_(row_min, col_min)
+ - squared.at_(row_max, col_min)
+ - squared.at_(row_min, col_max));
+
+ double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local standard deviation
+ debug_stddev(p) = s_x_y * stddev_debug_factor;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Thresholding.
+ // skewness_ = skewness(p);
+ // b = (p == point2d(5,5));
+ double t_x_y = formula(m_x_y, s_x_y, K, R);
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ double alpha = K * (1 - s_x_y / R);
+ debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
+ debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
+# endif // !SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ return t_x_y;
+ }
+
+
+ template <typename P, typename J, typename F>
+ double
+ compute_local_threshold_single_image(const P& p,
+ const J& integral,
+ int win_width,
+ double K, double R,
+ const F& formula)
+ {
+ // Window half width.
+ int w_2 = win_width >> 1;
+
+ int row_min = std::max(0, p.row() - w_2);
+ int col_min = std::max(0, p.col() - w_2);
+
+ int row_max = std::min(static_cast<int>(integral.nrows()) - 1,
+ p.row() + w_2);
+ int col_max = std::min(static_cast<int>(integral.ncols()) - 1,
+ p.col() + w_2);
+
+
+ double wh = (row_max - row_min + 1) * (col_max - col_min + 1);
+
+ // Mean.
+ double m_x_y_tmp = (integral.at_(row_max, col_max).first()
+ + integral.at_(row_min, col_min).first()
+ - integral.at_(row_max, col_min).first()
+ - integral.at_(row_min, col_max).first());
+
+ double m_x_y = m_x_y_tmp / wh;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local mean
+ debug_mean(p) = m_x_y * mean_debug_factor;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Standard deviation.
+ double s_x_y_tmp = (integral.at_(row_max, col_max).second()
+ + integral.at_(row_min, col_min).second()
+ - integral.at_(row_max, col_min).second()
+ - integral.at_(row_min, col_max).second());
+
+ double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ // Store local standard deviation
+ debug_stddev(p) = s_x_y * stddev_debug_factor;
+# endif // !SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Thresholding.
+ double t_x_y = formula(m_x_y, s_x_y, K, R);
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ double alpha = K * (1 - s_x_y / R);
+ debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
+ debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
+# endif // !SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ return t_x_y;
+ }
+
+
+#endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_COMPUTE_LOCAL_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/internal/compute_sauvola_threshold.hh b/scribo/scribo/binarization/internal/compute_sauvola_threshold.hh
deleted file mode 100644
index d3ca07f..0000000
--- a/scribo/scribo/binarization/internal/compute_sauvola_threshold.hh
+++ /dev/null
@@ -1,285 +0,0 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_BINARIZATION_INTERNAL_COMPUTE_SAUVOLA_THRESHOLD_HH
-# define SCRIBO_BINARIZATION_INTERNAL_COMPUTE_SAUVOLA_THRESHOLD_HH
-
-
-/// \file
-///
-/// \brief Compute a threshold with Sauvola's binarization formula.
-
-# include <algorithm>
-# include <cmath>
-
-# include <mln/core/image/image2d.hh>
-# include <mln/value/int_u8.hh>
-
-# include <scribo/binarization/internal/sauvola_debug.hh>
-
-
-// Setup default Sauvola's formulae parameters values.
-// These macros may be used in other variant of Sauvola's algorithm.
-//
-// Values are set according to the following reference: "Automatic
-// Evaluation of Document Binarization Results", Badekas and al, 2005
-//
-// Badekas et al. said 0.34 was best.
-# define SCRIBO_DEFAULT_SAUVOLA_K 0.34
-//
-// 128 is best for grayscale documents.
-# define SCRIBO_DEFAULT_SAUVOLA_R 128
-
-
-namespace scribo
-{
-
- namespace binarization
- {
-
- namespace internal
- {
-
- using namespace mln;
-
-
- /*! \brief Compute a point wise threshold according Sauvola's
- binarization.
-
- \param[in] p A site.
- \param[in] simple An integral image of mean values.
- \param[in] squared An integral image of squared mean values.
- \param[in] win_width Window width.
- \param[in] k Control the threshold value in the local
- window. The higher, the lower the threshold
- form the local mean m(x, y).
- \param[in] R Maximum value of the standard deviation (128
- for grayscale documents).
-
- \return A threshold.
- */
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width, double K, double R);
-
- /// \overload
- /// K is set to 0.34 and R to 128.
- //
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width);
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
-
- /*! \brief compute Sauvola's threshold applying directly the formula.
-
- \param[in] m_x_y Mean value.
- \param[in] s_x_y Standard deviation.
- \param[in] k Control the threshold value in the local
- window. The higher, the lower the threshold
- form the local mean m(x, y).
- \param[in] R Maximum value of the standard deviation (128
- for grayscale documents).
-
- \return A threshold.
- */
- inline
- double
- sauvola_threshold_formula(const double m_x_y, const double s_x_y,
- const double K, const double R)
- {
- return m_x_y * (1.0 + K * ((s_x_y / R) - 1.0));
- }
-
- /// \overload
- /// K is set to 0.34 and R to 128.
- //
- inline
- double
- sauvola_threshold_formula(double m_x_y, double s_x_y)
- {
- return sauvola_threshold_formula(m_x_y, s_x_y,
- SCRIBO_DEFAULT_SAUVOLA_K,
- SCRIBO_DEFAULT_SAUVOLA_R);
- }
-
-
-
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width, double K, double R)
- {
- mln_precondition(simple.nrows() == squared.nrows());
- mln_precondition(simple.ncols() == squared.ncols());
-
- // Window half width.
- int w_2 = win_width >> 1;
-
- int row_min = std::max(0, p.row() - w_2 - 1);
- int col_min = std::max(0, p.col() - w_2 - 1);
-
- int row_max = std::min(static_cast<int>(simple.nrows()) - 1,
- p.row() + w_2);
- int col_max = std::min(static_cast<int>(simple.ncols()) - 1,
- p.col() + w_2);
-
-
- double wh = (row_max - row_min) * (col_max - col_min);
-
- // Mean.
- double m_x_y_tmp = (simple.at_(row_max, col_max)
- + simple.at_(row_min, col_min)
- - simple.at_(row_max, col_min)
- - simple.at_(row_min, col_max));
-
- double m_x_y = m_x_y_tmp / wh;
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local mean
- debug_mean(p) = m_x_y * mean_debug_factor;
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Standard deviation.
- double s_x_y_tmp = (squared.at_(row_max, col_max)
- + squared.at_(row_min, col_min)
- - squared.at_(row_max, col_min)
- - squared.at_(row_min, col_max));
-
- double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local standard deviation
- debug_stddev(p) = s_x_y * stddev_debug_factor;
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Thresholding.
- double t_x_y = sauvola_threshold_formula(m_x_y, s_x_y, K, R);
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- double alpha = K * (1 - s_x_y / R);
- debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
- debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
-# endif // !SCRIBO_SAUVOLA_DEBUG
-
- return t_x_y;
- }
-
-
- template <typename P, typename J>
- double
- compute_sauvola_threshold_single_image(const P& p,
- const J& integral,
- int win_width,
- double K, double R)
- {
- // Window half width.
- int w_2 = win_width >> 1;
-
- int row_min = std::max(0, p.row() - w_2);
- int col_min = std::max(0, p.col() - w_2);
-
- int row_max = std::min(static_cast<int>(integral.nrows()) - 1,
- p.row() + w_2);
- int col_max = std::min(static_cast<int>(integral.ncols()) - 1,
- p.col() + w_2);
-
-
- double wh = (row_max - row_min + 1) * (col_max - col_min + 1);
-
- // Mean.
- double m_x_y_tmp = (integral.at_(row_max, col_max).first()
- + integral.at_(row_min, col_min).first()
- - integral.at_(row_max, col_min).first()
- - integral.at_(row_min, col_max).first());
-
- double m_x_y = m_x_y_tmp / wh;
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local mean
- debug_mean(p) = m_x_y * mean_debug_factor;
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Standard deviation.
- double s_x_y_tmp = (integral.at_(row_max, col_max).second()
- + integral.at_(row_min, col_min).second()
- - integral.at_(row_max, col_min).second()
- - integral.at_(row_min, col_max).second());
-
- double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- // Store local standard deviation
- debug_stddev(p) = s_x_y * stddev_debug_factor;
-# endif // !SCRIBO_SAUVOLA_DEBUG
-
- // Thresholding.
- double t_x_y = sauvola_threshold_formula(m_x_y, s_x_y, K, R);
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- double alpha = K * (1 - s_x_y / R);
- debug_alpham(p) = alpha * m_x_y * alpham_debug_factor;
- debug_alphacond(p) = (s_x_y < (alpha * m_x_y / 2.));
-# endif // !SCRIBO_SAUVOLA_DEBUG
-
- return t_x_y;
- }
-
-
-
- template <typename P, typename J>
- double
- compute_sauvola_threshold(const P& p,
- const J& simple,
- const J& squared,
- int win_width)
- {
- return compute_sauvola_threshold(p, simple, squared, win_width,
- SCRIBO_DEFAULT_SAUVOLA_K,
- SCRIBO_DEFAULT_SAUVOLA_R);
- }
-
-
-#endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::binarization::internal
-
- } // end of namespace scribo::binarization
-
-} // end of namespace scribo
-
-#endif // ! SCRIBO_BINARIZATION_INTERNAL_COMPUTE_SAUVOLA_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/internal/first_pass_functor.hh b/scribo/scribo/binarization/internal/first_pass_functor.hh
index 0b1a7ac..8da401b 100644
--- a/scribo/scribo/binarization/internal/first_pass_functor.hh
+++ b/scribo/scribo/binarization/internal/first_pass_functor.hh
@@ -37,7 +37,11 @@
# include <mln/value/int_u8.hh>
# include <mln/data/fill.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
+# include <scribo/binarization/internal/sauvola_formula.hh>
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+# include <scribo/binarization/internal/local_threshold_debug.hh>
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
namespace scribo
@@ -67,8 +71,11 @@ namespace scribo
mln::util::array<int> dp;
double K_;
+ double R_;
+
+ sauvola_formula formula_;
- first_pass_functor(const I& input, double K);
+ first_pass_functor(const I& input, double K, double R);
void exec(double mean, double stddev);
void finalize();
@@ -88,10 +95,11 @@ namespace scribo
template <typename I>
- first_pass_functor<I>::first_pass_functor(const I& input, double K)
+ first_pass_functor<I>::first_pass_functor(const I& input, double K, double R)
: input(input),
pxl(input),
- K_(K)
+ K_(K),
+ R_(R)
{
res = 0;
pxl.start();
@@ -100,10 +108,10 @@ namespace scribo
initialize(parent, input);
initialize(msk, input);
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
initialize(debug_mean, input);
initialize(debug_stddev, input);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
mln::extension::fill(msk, false);
@@ -124,9 +132,7 @@ namespace scribo
unsigned p = pxl.offset();
value::int_u8 t_p;
- mln::convert::from_to(sauvola_threshold_formula(mean, stddev,
- K_,
- SCRIBO_DEFAULT_SAUVOLA_R),
+ mln::convert::from_to(formula_(mean, stddev, K_, R_),
t_p);
msk.element(p) = input.element(p) < t_p;
diff --git a/scribo/scribo/binarization/internal/local_threshold_debug.hh b/scribo/scribo/binarization/internal/local_threshold_debug.hh
new file mode 100644
index 0000000..a9da06c
--- /dev/null
+++ b/scribo/scribo/binarization/internal/local_threshold_debug.hh
@@ -0,0 +1,88 @@
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_LOCAL_THRESHOLD_DEBUG_HH
+# define SCRIBO_BINARIZATION_INTERNAL_LOCAL_THRESHOLD_DEBUG_HH
+
+/// \file
+///
+/// \brief Declare all debug related variables for local based
+/// algorithms.
+
+
+/// FIXME: A struct may be a bit better...
+
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+ namespace internal
+ {
+
+ char* stddev_image_output = 0;
+ char* mean_image_output = 0;
+ char* threshold_image_output = 0;
+
+ char* scale_image_output = 0;
+
+ char* alpham_image_output = 0;
+ char* alphacond_image_output = 0;
+
+ // Declare debug images.
+ image2d<double> debug_stddev;
+ image2d<double> debug_mean;
+ image2d<double> debug_threshold;
+
+ image2d<double> debug_alpham;
+ image2d<bool> debug_alphacond;
+
+ double mean_debug_factor = 1.0;
+ double stddev_debug_factor = 1.0;
+ double alpham_debug_factor = 2.0;
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_LOCAL_THRESHOLD_DEBUG_HH
diff --git a/scribo/scribo/binarization/internal/niblack_formula.hh b/scribo/scribo/binarization/internal/niblack_formula.hh
new file mode 100644
index 0000000..54dbc9b
--- /dev/null
+++ b/scribo/scribo/binarization/internal/niblack_formula.hh
@@ -0,0 +1,105 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_NIBLACK_FORMULA_HH
+# define SCRIBO_BINARIZATION_INTERNAL_NIBLACK_FORMULA_HH
+
+
+/// \file
+///
+/// \brief Routines computing a threshold using Niblack's binarization
+/// formula.
+
+// \fixme Having an unused parameter to fulfill the required interface
+// may not be the best solution...
+
+// Setup default Niblack's formula parameters values.
+# define SCRIBO_DEFAULT_NIBLACK_K -0.2
+
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ namespace internal
+ {
+
+ struct niblack_formula
+ {
+
+ /*! \brief compute a threshold using Niblack's formula.
+
+ \param[in] m_x_y Mean value.
+ \param[in] s_x_y Standard deviation.
+ \param[in] k Control the threshold value in the local
+ window. The higher, the lower the threshold
+ form the local mean m(x, y).
+ \param[in] R Maximum value of the standard deviation (128
+ for grayscale documents). Unused in this formula.
+
+ \return A threshold.
+ */
+ double operator()(const double m_x_y, const double s_x_y,
+ const double K, const double R) const;
+
+ /*!
+ \overload K = 0.34.
+ */
+ double operator()(const double m_x_y, const double s_x_y) const;
+
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ double
+ niblack_formula::operator()(const double m_x_y, const double s_x_y,
+ const double K, const double /*R*/) const
+ {
+ return m_x_y + K * s_x_y;
+ }
+
+ inline
+ double
+ niblack_formula::operator()(const double m_x_y, const double s_x_y) const
+ {
+ return (*this)(m_x_y, s_x_y,
+ SCRIBO_DEFAULT_NIBLACK_K, 128);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_NIBLACK_FORMULA_HH
diff --git a/scribo/scribo/binarization/internal/sauvola_debug.hh b/scribo/scribo/binarization/internal/sauvola_debug.hh
deleted file mode 100644
index 0f8ccf0..0000000
--- a/scribo/scribo/binarization/internal/sauvola_debug.hh
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_DEBUG_HH
-# define SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_DEBUG_HH
-
-/// \file
-///
-/// \brief Declare all debug related variables for Sauvola*
-/// algorithms.
-
-
-/// FIXME: A struct may be a bit better...
-
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
-
-# ifndef MLN_INCLUDE_ONLY
-
-
-namespace scribo
-{
-
- namespace binarization
- {
-
- using namespace mln;
-
- namespace internal
- {
-
- char* stddev_image_output = 0;
- char* mean_image_output = 0;
- char* threshold_image_output = 0;
-
- char* scale_image_output = 0;
-
- char* alpham_image_output = 0;
- char* alphacond_image_output = 0;
-
- // Declare debug images.
- image2d<double> debug_stddev;
- image2d<double> debug_mean;
- image2d<double> debug_threshold;
-
- image2d<double> debug_alpham;
- image2d<bool> debug_alphacond;
-
- double mean_debug_factor = 1.0;
- double stddev_debug_factor = 1.0;
- double alpham_debug_factor = 2.0;
-
- } // end of namespace scribo::binarization::internal
-
- } // end of namespace scribo::binarization
-
-} // end of namespace scribo
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
-
-#endif // ! SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_DEBUG_HH
diff --git a/scribo/scribo/binarization/internal/sauvola_formula.hh b/scribo/scribo/binarization/internal/sauvola_formula.hh
new file mode 100644
index 0000000..3251abd
--- /dev/null
+++ b/scribo/scribo/binarization/internal/sauvola_formula.hh
@@ -0,0 +1,121 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_FORMULA_HH
+# define SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_FORMULA_HH
+
+
+/// \file
+///
+/// \brief Routines computing a threshold using Sauvola's binarization
+/// formula.
+
+
+// Setup default Sauvola's formula parameters values.
+// These macros may be used in other variant of Sauvola's algorithms.
+//
+// Values are set according to the following reference: "Automatic
+// Evaluation of Document Binarization Results", Badekas and al, 2005
+//
+// Badekas et al. said 0.34 was best for Sauvola.
+# define SCRIBO_DEFAULT_SAUVOLA_K 0.34
+//
+// 128 is best for grayscale documents.
+# define SCRIBO_DEFAULT_SAUVOLA_R 128
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ namespace internal
+ {
+
+ struct sauvola_formula
+ {
+
+ /*! \brief Compute a threshold using Sauvola's formula.
+
+ \param[in] m_x_y Mean value.
+ \param[in] s_x_y Standard deviation.
+ \param[in] k Control the threshold value in the local
+ window. The higher, the lower the threshold
+ form the local mean m(x, y).
+ \param[in] R Maximum value of the standard deviation (128
+ for grayscale documents).
+
+ \return A threshold.
+ */
+ double operator()(const double m_x_y, const double s_x_y,
+ const double K, const double R) const;
+
+ /*!
+ \overload K = 0.34 and R = 128.
+ */
+ double operator()(const double m_x_y, const double s_x_y) const;
+
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ bool b;
+ double skewness_;
+
+ inline
+ double
+ sauvola_formula::operator()(const double m_x_y, const double s_x_y,
+ const double K, const double R) const
+ {
+ // if (b)
+ // std::cout << skewness_ << " - " << (K * -1 * skewness_) << std::endl;
+ // volatile double new_t = ((skewness_ < 0) ? -skewness_ : 1 * m_x_y * (1.0 + K * ((s_x_y / R) - 1.0)));
+ // volatile double old_t = (m_x_y * (1.0 + K * ((s_x_y / R) - 1.0)));
+ // if (skewness_ > 0)
+ // if (new_t != old_t)
+ // std::cout << skewness_ << " - " << new_t << " vs " << old_t << std::endl;
+
+ return m_x_y * (1.0 + K * ((s_x_y / R) - 1.0));
+ }
+
+ inline
+ double
+ sauvola_formula::operator()(const double m_x_y, const double s_x_y) const
+ {
+ return (*this)(m_x_y, s_x_y,
+ SCRIBO_DEFAULT_SAUVOLA_K, SCRIBO_DEFAULT_SAUVOLA_R);
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization::internal
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+#endif // ! SCRIBO_BINARIZATION_INTERNAL_SAUVOLA_FORMULA_HH
diff --git a/scribo/scribo/binarization/niblack.hh b/scribo/scribo/binarization/niblack.hh
new file mode 100644
index 0000000..e66e7b4
--- /dev/null
+++ b/scribo/scribo/binarization/niblack.hh
@@ -0,0 +1,218 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_NIBLACK_HH
+# define SCRIBO_BINARIZATION_NIBLACK_HH
+
+/// \file
+///
+///
+
+# include <mln/core/concept/image.hh>
+# include <mln/data/transform.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/binarization/niblack_threshold.hh>
+# include <scribo/binarization/local_threshold.hh>
+# include <scribo/binarization/internal/local_threshold_debug.hh>
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+# include <mln/io/pgm/save.hh>
+# include <mln/io/pbm/save.hh>
+# include <mln/data/saturate.hh>
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+
+ /*! \brief Convert an image into a binary image.
+
+ \input[in] input An image.
+ \input[in] window_size The window size.
+ \input[in] K Niblack's formulae constant.
+
+ \return A binary image.
+
+ */
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size, double K);
+
+
+
+ /*! \brief Convert an image into a binary image.
+
+ Niblack's formulae constant K is set to 0.34.
+
+ \input[in] input An image.
+ \input[in] window_size The window size.
+
+ \return A binary image.
+
+ */
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size);
+
+
+ /// \overload
+ /// The window size is set to 11.
+ //
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input);
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementations.
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size, double K)
+ {
+ trace::entering("scribo::binarization::impl::generic::niblack");
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I,value::int_u8)
+ threshold_image = binarization::niblack_threshold(input, window_size, K);
+
+ mln_ch_value(I, bool)
+ output = local_threshold(input, threshold_image);
+
+ trace::exiting("scribo::binarization::impl::generic::niblack");
+ return output;
+ }
+
+ } // end of namespace scribo::binarization::impl::generic
+
+
+ } // end of namespace scribo::binarization::impl
+
+
+
+ // Dispatch
+
+ namespace internal
+ {
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack_dispatch(const mln_value(I)&,
+ const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ return impl::generic::niblack(input, window_size, K);
+ }
+
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack_dispatch(const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ typedef mln_value(I) V;
+ return niblack_dispatch(V(), input, window_size, K);
+ }
+
+ } // end of namespace scribo::binarization::internal
+
+
+
+ // Facades
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size, double K)
+ {
+ trace::entering("scribo::binarization::niblack");
+
+ mln_precondition(exact(input).is_valid());
+
+ mln_ch_value(I, bool)
+ output = internal::niblack_dispatch(input, window_size, K);
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ if (internal::stddev_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_stddev),
+ internal::stddev_image_output);
+ if (internal::mean_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_mean),
+ internal::mean_image_output);
+ if (internal::threshold_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_threshold),
+ internal::threshold_image_output);
+
+ if (internal::alpham_image_output)
+ io::pgm::save(data::saturate(value::int_u8(), internal::debug_alpham),
+ internal::alpham_image_output);
+ if (internal::alphacond_image_output)
+ io::pbm::save(internal::debug_alphacond, internal::alphacond_image_output);
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+
+ trace::exiting("scribo::binarization::niblack");
+ return output;
+ }
+
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input, unsigned window_size)
+ {
+ return niblack(input, window_size, SCRIBO_DEFAULT_NIBLACK_K);
+ }
+
+
+ template <typename I>
+ mln_ch_value(I, bool)
+ niblack(const Image<I>& input)
+ {
+ return niblack(input, 11);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_BINARIZATION_NIBLACK_HH
diff --git a/scribo/scribo/binarization/niblack_threshold.hh b/scribo/scribo/binarization/niblack_threshold.hh
new file mode 100644
index 0000000..db4a74e
--- /dev/null
+++ b/scribo/scribo/binarization/niblack_threshold.hh
@@ -0,0 +1,299 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_NIBLACK_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_NIBLACK_THRESHOLD_HH
+
+/// \file
+///
+/// Compute an image of local threshold using Niblack algorithm.
+
+/// \fixme return type too restrictive!
+/// \fixme Revamp code and merge with sauvola_threshold.hh.
+
+# include <algorithm>
+# include <cmath>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/int_u.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/core/init_integral_image.hh>
+# include <scribo/binarization/internal/compute_local_threshold.hh>
+# include <scribo/binarization/internal/niblack_formula.hh>
+
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+ /*! \brief Compute an image of local threshold using Niblack algorithm.
+
+ \input[in] input A gray level image.
+ \input[in] window_size The window size.
+ \input[out] simple The sum of all intensities of \p input.
+ \input[out] squared The sum of all squared intensities of \p
+ input.
+
+ \return An image of local thresholds.
+
+ */
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared);
+
+ /// \overload
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K);
+
+ /// \overload
+ /// K is set to 0.34
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size);
+
+
+ /// \overload
+ /// The window size is set to 11.
+ //
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation
+
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ niblack_threshold(const Image<I>& input_, unsigned window_size,
+ double K,
+ Image<J>& simple_,
+ Image<J>& squared_)
+ {
+ trace::entering("scribo::binarization::impl::generic::niblack_threshold");
+
+ const I& input = exact(input_);
+ J& simple = exact(simple_);
+ J& squared = exact(squared_);
+
+ mln_assertion(input.is_valid());
+ mln_assertion(simple.is_valid());
+ mln_assertion(squared.is_valid());
+
+ typedef mln_value(I) V;
+ typedef mln_site(I) P;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ initialize(internal::debug_mean, input);
+ initialize(internal::debug_stddev, input);
+ initialize(internal::debug_threshold, input);
+ initialize(internal::debug_alpham, input);
+ initialize(internal::debug_alphacond, input);
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ mln_concrete(I) output;
+ initialize(output, input);
+
+ const mln::def::coord
+ nrows = static_cast<mln::def::coord>(input.nrows()),
+ ncols = static_cast<mln::def::coord>(input.ncols());
+
+
+ internal::niblack_formula formula;
+ for(mln::def::coord row = 0; row < nrows; ++row)
+ for(mln::def::coord col = 0; col < ncols; ++col)
+ {
+ // FIXME: Setting R parameter to 128 should not be
+ // hard-coded. Even though it is not used in Niblack's
+ // formula, this parameter is used for debug images and
+ // should be adapted to the data range values.
+ double t = internal::compute_local_threshold(P(row, col), simple,
+ squared, window_size,
+ K,
+ 128,
+ formula);
+ mln::convert::from_to(t, output.at_(row, col));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ internal::debug_threshold.at_(row, col) = t;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+ }
+
+ trace::exiting("scribo::binarization::impl::generic::niblack_threshold");
+ return output;
+ }
+
+ } // end of namespace scribo::binarization::impl::generic
+
+
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ niblack_threshold_gl(const I& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ return impl::generic::niblack_threshold(input, window_size, K,
+ simple, squared);
+ }
+
+
+ } // end of namespace scribo::binarization::impl
+
+
+
+
+ // Dispatch
+
+ namespace internal
+ {
+
+ template <unsigned n, typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u<n>)
+ niblack_threshold_dispatch(const value::int_u<n>&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ return impl::niblack_threshold_gl(input, window_size, K,
+ simple, squared);
+ }
+
+
+ template <typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold_dispatch(const mln_value(I)&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ // No dispatch for this kind of value type.
+ mlc_abort(I)::check();
+
+ typedef mln_ch_value(I,bool) output_t;
+ return output_t();
+ }
+
+
+ } // end of namespace scribo::binarization::internal
+
+
+
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ trace::entering("scribo::binarization::niblack_threshold");
+
+ mln_precondition(mln_site_(I)::dim == 2);
+ mln_precondition(exact(input).is_valid());
+
+ typedef mln_value(I) value_t;
+ mln_ch_value(I, value::int_u8)
+ output = internal::niblack_threshold_dispatch(value_t(),
+ exact(input),
+ window_size,
+ K,
+ exact(simple),
+ exact(squared));
+
+ trace::exiting("scribo::text::ppm2pbm");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ mln_ch_value(I, double)
+ simple = init_integral_image(input, scribo::internal::identity_),
+ squared = init_integral_image(input, scribo::internal::square_);
+
+ return niblack_threshold(input, window_size,
+ K, simple, squared);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input, unsigned window_size)
+ {
+ return niblack_threshold(input, window_size,
+ SCRIBO_DEFAULT_NIBLACK_K);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ niblack_threshold(const Image<I>& input)
+ {
+ return niblack_threshold(input, 11);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_BINARIZATION_NIBLACK_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/sauvola.hh b/scribo/scribo/binarization/sauvola.hh
index 45891c3..fc3e104 100644
--- a/scribo/scribo/binarization/sauvola.hh
+++ b/scribo/scribo/binarization/sauvola.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -35,15 +35,15 @@
# include <mln/data/transform.hh>
# include <mln/value/int_u8.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
+# include <scribo/binarization/sauvola_threshold.hh>
# include <scribo/binarization/local_threshold.hh>
-# include <scribo/binarization/internal/sauvola_debug.hh>
+# include <scribo/binarization/internal/local_threshold_debug.hh>
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
# include <mln/io/pgm/save.hh>
# include <mln/io/pbm/save.hh>
# include <mln/data/saturate.hh>
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
namespace scribo
{
@@ -110,11 +110,11 @@ namespace scribo
trace::entering("scribo::binarization::impl::generic::sauvola");
mln_precondition(exact(input).is_valid());
+ mln_ch_value(I,value::int_u8)
+ threshold_image = binarization::sauvola_threshold(input, window_size, K);
+
mln_ch_value(I, bool)
- output = local_threshold(input,
- binarization::sauvola_threshold_image(input,
- window_size,
- K));
+ output = local_threshold(input, threshold_image);
trace::exiting("scribo::binarization::impl::generic::sauvola");
return output;
@@ -168,7 +168,7 @@ namespace scribo
mln_ch_value(I, bool)
output = internal::sauvola_dispatch(input, window_size, K);
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::stddev_image_output)
io::pgm::save(data::saturate(value::int_u8(), internal::debug_stddev),
internal::stddev_image_output);
@@ -184,7 +184,7 @@ namespace scribo
internal::alpham_image_output);
if (internal::alphacond_image_output)
io::pbm::save(internal::debug_alphacond, internal::alphacond_image_output);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
trace::exiting("scribo::binarization::sauvola");
diff --git a/scribo/scribo/binarization/sauvola_ms.hh b/scribo/scribo/binarization/sauvola_ms.hh
index c1a3414..36629f9 100644
--- a/scribo/scribo/binarization/sauvola_ms.hh
+++ b/scribo/scribo/binarization/sauvola_ms.hh
@@ -60,16 +60,15 @@
# include <scribo/core/macros.hh>
-# include <scribo/binarization/sauvola_threshold_image.hh>
# include <scribo/binarization/internal/first_pass_functor.hh>
# include <scribo/canvas/integral_browsing.hh>
-# ifdef SCRIBO_SAUVOLA_DEBUG
-# include <scribo/binarization/internal/sauvola_debug.hh>
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+# include <scribo/binarization/internal/local_threshold_debug.hh>
# include <mln/io/pgm/save.hh>
# include <scribo/make/debug_filename.hh>
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
@@ -179,7 +178,7 @@ namespace scribo
// 1st pass
scribo::binarization::internal::first_pass_functor< image2d<int_u8> >
- f(sub, K);
+ f(sub, K, SCRIBO_DEFAULT_SAUVOLA_R);
scribo::canvas::integral_browsing(integral_sum_sum_2,
ratio,
w_local_w, w_local_h,
@@ -259,10 +258,10 @@ namespace scribo
} // end of 2nd pass
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
io::pbm::save(f.msk,
scribo::make::debug_filename(internal::threshold_image_output).c_str());
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
return f.t_sub;
}
@@ -923,18 +922,18 @@ namespace scribo
}
-# ifdef SCRIBO_SAUVOLA_DEBUG
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
if (internal::scale_image_output)
io::pgm::save(e_2, internal::scale_image_output);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
// Propagate scale values.
e_2 = transform::influence_zone_geodesic(e_2, c8());
-// # ifdef SCRIBO_SAUVOLA_DEBUG
+// # ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
// if (internal::scale_image_output)
// io::pgm::save(e_2, internal::scale_image_output);
-// # endif // ! SCRIBO_SAUVOLA_DEBUG
+// # endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
// Binarize
image2d<bool>
diff --git a/scribo/scribo/binarization/sauvola_threshold.hh b/scribo/scribo/binarization/sauvola_threshold.hh
new file mode 100644
index 0000000..df46e95
--- /dev/null
+++ b/scribo/scribo/binarization/sauvola_threshold.hh
@@ -0,0 +1,296 @@
+// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#ifndef SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_HH
+
+/// \file
+///
+/// Compute an image of local threshold using Sauvola algorithm.
+
+/// \fixme return type too restrictive!
+
+# include <algorithm>
+# include <cmath>
+
+# include <mln/core/image/image2d.hh>
+# include <mln/value/int_u.hh>
+# include <mln/value/int_u8.hh>
+
+# include <scribo/core/init_integral_image.hh>
+# include <scribo/binarization/internal/compute_local_threshold.hh>
+# include <scribo/binarization/internal/sauvola_formula.hh>
+
+
+
+namespace scribo
+{
+
+ namespace binarization
+ {
+
+ using namespace mln;
+
+ /*! \brief Compute an image of local threshold using Sauvola algorithm.
+
+ \input[in] input A gray level image.
+ \input[in] window_size The window size.
+ \input[out] simple The sum of all intensities of \p input.
+ \input[out] squared The sum of all squared intensities of \p
+ input.
+
+ \return An image of local thresholds.
+
+ */
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared);
+
+ /// \overload
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K);
+
+ /// \overload
+ /// K is set to 0.34
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size);
+
+
+ /// \overload
+ /// The window size is set to 11.
+ //
+ template <typename I>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation
+
+
+ namespace impl
+ {
+
+ namespace generic
+ {
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ sauvola_threshold(const Image<I>& input_, unsigned window_size,
+ double K,
+ Image<J>& simple_,
+ Image<J>& squared_)
+ {
+ trace::entering("scribo::binarization::impl::generic::sauvola_threshold");
+
+ const I& input = exact(input_);
+ J& simple = exact(simple_);
+ J& squared = exact(squared_);
+
+ mln_assertion(input.is_valid());
+ mln_assertion(simple.is_valid());
+ mln_assertion(squared.is_valid());
+
+ typedef mln_value(I) V;
+ typedef mln_site(I) P;
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ initialize(internal::debug_mean, input);
+ initialize(internal::debug_stddev, input);
+ initialize(internal::debug_threshold, input);
+ initialize(internal::debug_alpham, input);
+ initialize(internal::debug_alphacond, input);
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+
+ // Sauvola Algorithm with I.I.
+
+ mln_concrete(I) output;
+ initialize(output, input);
+
+ const mln::def::coord
+ nrows = static_cast<mln::def::coord>(input.nrows()),
+ ncols = static_cast<mln::def::coord>(input.ncols());
+
+ internal::sauvola_formula formula;
+ for(mln::def::coord row = 0; row < nrows; ++row)
+ for(mln::def::coord col = 0; col < ncols; ++col)
+ {
+ double t = internal::compute_local_threshold(P(row, col), simple,
+ squared, window_size,
+ K,
+ SCRIBO_DEFAULT_SAUVOLA_R,
+ formula);
+ mln::convert::from_to(t, output.at_(row, col));
+
+# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
+ internal::debug_threshold.at_(row, col) = t;
+# endif // ! SCRIBO_LOCAL_THRESHOLD_DEBUG
+ }
+
+ trace::exiting("scribo::binarization::impl::generic::sauvola_threshold");
+ return output;
+ }
+
+ } // end of namespace scribo::binarization::impl::generic
+
+
+
+ template <typename I, typename J>
+ inline
+ mln_concrete(I)
+ sauvola_threshold_gl(const I& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ return impl::generic::sauvola_threshold(input, window_size, K,
+ simple, squared);
+ }
+
+
+ } // end of namespace scribo::binarization::impl
+
+
+
+
+ // Dispatch
+
+ namespace internal
+ {
+
+ template <unsigned n, typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u<n>)
+ sauvola_threshold_dispatch(const value::int_u<n>&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ return impl::sauvola_threshold_gl(input, window_size, K,
+ simple, squared);
+ }
+
+
+ template <typename I, typename J>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold_dispatch(const mln_value(I)&, const I& input,
+ unsigned window_size,
+ double K,
+ J& simple,
+ J& squared)
+ {
+ // No dispatch for this kind of value type.
+ mlc_abort(I)::check();
+
+ typedef mln_ch_value(I,bool) output_t;
+ return output_t();
+ }
+
+
+ } // end of namespace scribo::binarization::internal
+
+
+
+ template <typename I, typename J>
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K,
+ Image<J>& simple,
+ Image<J>& squared)
+ {
+ trace::entering("scribo::binarization::sauvola_threshold");
+
+ mln_precondition(mln_site_(I)::dim == 2);
+ mln_precondition(exact(input).is_valid());
+
+ typedef mln_value(I) value_t;
+ mln_ch_value(I, value::int_u8)
+ output = internal::sauvola_threshold_dispatch(value_t(),
+ exact(input),
+ window_size,
+ K,
+ exact(simple),
+ exact(squared));
+
+ trace::exiting("scribo::text::ppm2pbm");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size,
+ double K)
+ {
+ mln_ch_value(I, double)
+ simple = init_integral_image(input, scribo::internal::identity_),
+ squared = init_integral_image(input, scribo::internal::square_);
+
+ return sauvola_threshold(input, window_size,
+ K, simple, squared);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input, unsigned window_size)
+ {
+ return sauvola_threshold(input, window_size,
+ SCRIBO_DEFAULT_SAUVOLA_K);
+ }
+
+
+ template <typename I>
+ inline
+ mln_ch_value(I, value::int_u8)
+ sauvola_threshold(const Image<I>& input)
+ {
+ return sauvola_threshold(input, 11);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::binarization
+
+} // end of namespace scribo
+
+
+#endif // ! SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_HH
diff --git a/scribo/scribo/binarization/sauvola_threshold_image.hh b/scribo/scribo/binarization/sauvola_threshold_image.hh
deleted file mode 100644
index 94cd688..0000000
--- a/scribo/scribo/binarization/sauvola_threshold_image.hh
+++ /dev/null
@@ -1,301 +0,0 @@
-// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
-// (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_IMAGE_HH
-# define SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_IMAGE_HH
-
-/// \file
-///
-/// Compute an image of local threshold using Sauvola algorithm.
-
-/// \fixme return type too restrictive!
-
-# include <algorithm>
-# include <cmath>
-
-# include <mln/core/image/image2d.hh>
-# include <mln/value/int_u.hh>
-# include <mln/value/int_u8.hh>
-
-# include <scribo/core/init_integral_image.hh>
-# include <scribo/binarization/internal/compute_sauvola_threshold.hh>
-
-
-
-namespace scribo
-{
-
- namespace binarization
- {
-
- using namespace mln;
-
- /*! \brief Compute an image of local threshold using Sauvola algorithm.
-
- \input[in] input An image.
- \input[in] window_size The window size.
- \input[out] simple The sum of all intensities of \p input.
- \input[out] squared The sum of all squared intensities of \p
- input.
-
- \return An image of local thresholds.
-
- */
- template <typename I, typename J>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K,
- Image<J>& simple,
- Image<J>& squared);
-
- /// \overload
- template <typename I>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K);
-
- /// \overload
- /// K is set to 0.34
- template <typename I>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size);
-
-
- /// \overload
- /// The window size is set to 11.
- //
- template <typename I>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input);
-
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- // Implementation
-
-
- namespace impl
- {
-
- namespace generic
- {
-
- template <typename I, typename J>
- inline
- mln_concrete(I)
- sauvola_threshold_image(const Image<I>& input_, unsigned window_size,
- double K,
- Image<J>& simple_,
- Image<J>& squared_)
- {
- trace::entering("scribo::binarization::impl::generic::sauvola_threshold_image");
-
- const I& input = exact(input_);
- J& simple = exact(simple_);
- J& squared = exact(squared_);
-
- mln_assertion(input.is_valid());
- mln_assertion(simple.is_valid());
- mln_assertion(squared.is_valid());
-
- typedef mln_value(I) V;
- typedef mln_site(I) P;
-
-# ifdef SCRIBO_SAUVOLA_DEBUG
- initialize(internal::debug_mean, input);
- initialize(internal::debug_stddev, input);
- initialize(internal::debug_threshold, input);
- initialize(internal::debug_alpham, input);
- initialize(internal::debug_alphacond, input);
-# endif // ! SCRIBO_SAUVOLA_DEBUG
-
- // Sauvola Algorithm with I.I.
-
- mln_concrete(I) output;
- initialize(output, input);
-
- const mln::def::coord
- nrows = static_cast<mln::def::coord>(input.nrows()),
- ncols = static_cast<mln::def::coord>(input.ncols());
-
-
- for(mln::def::coord row = 0; row < nrows; ++row)
- for(mln::def::coord col = 0; col < ncols; ++col)
- {
-# ifdef SCRIBO_SAUVOLA_DEBUG
-
- double t = internal::compute_sauvola_threshold(P(row, col), simple,
- squared, window_size,
- K,
- SCRIBO_DEFAULT_SAUVOLA_R);
- mln::convert::from_to(t, output.at_(row, col));
- internal::debug_threshold.at_(row, col) = t;
-# else
- mln::convert::from_to(
- internal::compute_sauvola_threshold(P(row, col), simple,
- squared, window_size,
- K,
- SCRIBO_DEFAULT_SAUVOLA_R),
- output.at_(row, col));
-# endif // ! SCRIBO_SAUVOLA_DEBUG
- }
-
- trace::exiting("scribo::binarization::impl::generic::sauvola_threshold");
- return output;
- }
-
- } // end of namespace scribo::binarization::impl::generic
-
-
-
- template <typename I, typename J>
- inline
- mln_concrete(I)
- sauvola_threshold_image_gl(const I& input, unsigned window_size,
- double K,
- Image<J>& simple,
- Image<J>& squared)
- {
- return impl::generic::sauvola_threshold_image(input, window_size, K,
- simple, squared);
- }
-
-
- } // end of namespace scribo::binarization::impl
-
-
-
-
- // Dispatch
-
- namespace internal
- {
-
- template <unsigned n, typename I, typename J>
- inline
- mln_ch_value(I, value::int_u<n>)
- sauvola_threshold_image_dispatch(const value::int_u<n>&, const I& input,
- unsigned window_size,
- double K,
- J& simple,
- J& squared)
- {
- return impl::sauvola_threshold_image_gl(input, window_size, K,
- simple, squared);
- }
-
-
- template <typename I, typename J>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image_dispatch(const mln_value(I)&, const I& input,
- unsigned window_size,
- double K,
- J& simple,
- J& squared)
- {
- // No dispatch for this kind of value type.
- mlc_abort(I)::check();
-
- typedef mln_ch_value(I,bool) output_t;
- return output_t();
- }
-
-
- } // end of namespace scribo::binarization::internal
-
-
-
- template <typename I, typename J>
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K,
- Image<J>& simple,
- Image<J>& squared)
- {
- trace::entering("scribo::binarization::sauvola_threshold_image");
-
- mln_precondition(mln_site_(I)::dim == 2);
- mln_precondition(exact(input).is_valid());
-
- typedef mln_value(I) value_t;
- mln_ch_value(I, value::int_u8)
- output = internal::sauvola_threshold_image_dispatch(value_t(),
- exact(input),
- window_size,
- K,
- exact(simple),
- exact(squared));
-
- trace::exiting("scribo::text::ppm2pbm");
- return output;
- }
-
-
- template <typename I>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size,
- double K)
- {
- mln_ch_value(I, double)
- simple = init_integral_image(input, scribo::internal::identity_),
- squared = init_integral_image(input, scribo::internal::square_);
-
- return sauvola_threshold_image(input, window_size,
- K, simple, squared);
- }
-
-
- template <typename I>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input, unsigned window_size)
- {
- return sauvola_threshold_image(input, window_size,
- SCRIBO_DEFAULT_SAUVOLA_K);
- }
-
-
- template <typename I>
- inline
- mln_ch_value(I, value::int_u8)
- sauvola_threshold_image(const Image<I>& input)
- {
- return sauvola_threshold_image(input, 11);
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::binarization
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_BINARIZATION_SAUVOLA_THRESHOLD_IMAGE_HH
diff --git a/scribo/src/binarization/Makefile.am b/scribo/src/binarization/Makefile.am
index 315e621..567972a 100644
--- a/scribo/src/binarization/Makefile.am
+++ b/scribo/src/binarization/Makefile.am
@@ -46,6 +46,7 @@ if HAVE_MAGICKXX
sauvola_ms_debug
utilexec_PROGRAMS = \
+ niblack \
otsu \
sauvola \
sauvola_ms \
@@ -60,6 +61,13 @@ if HAVE_MAGICKXX
$(MAGICKXX_LDFLAGS)
+ niblack_SOURCES = niblack.cc
+ niblack_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(MAGICKXX_CPPFLAGS)
+ niblack_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
+
+
otsu_SOURCES = otsu.cc
otsu_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
@@ -80,7 +88,7 @@ if HAVE_MAGICKXX
sauvola_debug_SOURCES = sauvola_debug.cc
sauvola_debug_CPPFLAGS = $(AM_CPPFLAGS) \
- -DSCRIBO_SAUVOLA_DEBUG \
+ -DSCRIBO_LOCAL_THRESHOLD_DEBUG \
$(MAGICKXX_CPPFLAGS)
sauvola_debug_LDFLAGS = $(AM_LDFLAGS) \
$(MAGICKXX_LDFLAGS)
@@ -94,7 +102,7 @@ if HAVE_MAGICKXX
sauvola_ms_debug_SOURCES = sauvola_ms_debug.cc
sauvola_ms_debug_CPPFLAGS = $(AM_CPPFLAGS) \
- -DSCRIBO_SAUVOLA_DEBUG \
+ -DSCRIBO_LOCAL_THRESHOLD_DEBUG \
$(MAGICKXX_CPPFLAGS)
sauvola_ms_debug_LDFLAGS = $(AM_LDFLAGS) \
$(MAGICKXX_LDFLAGS)
diff --git a/scribo/src/binarization/niblack.cc b/scribo/src/binarization/niblack.cc
new file mode 100644
index 0000000..4b7ed91
--- /dev/null
+++ b/scribo/src/binarization/niblack.cc
@@ -0,0 +1,106 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/value/int_u8.hh>
+#include <mln/io/magick/load.hh>
+#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_luma.hh>
+
+#include <scribo/binarization/niblack.hh>
+#include <scribo/debug/option_parser.hh>
+#include <scribo/debug/logger.hh>
+
+static const scribo::debug::arg_data arg_desc[] =
+{
+ { "input.*", "An image." },
+ { "output.pbm", "A binary image." },
+ {0, 0}
+};
+
+
+// --enable/disable-<name>
+static const scribo::debug::toggle_data toggle_desc[] =
+{
+ // name, description, default value
+ {0, 0, false}
+};
+
+
+// --<name> <args>
+static const scribo::debug::opt_data opt_desc[] =
+{
+ // name, description, arguments, check args function, number of args, default arg
+ { "debug-prefix", "Enable debug image outputs. Prefix image name with that "
+ "given prefix.", "<prefix>", 0, 1, 0 },
+ { "k", "Niblack's formulae parameter", "<value>", 0, 1, "-0.2" },
+ { "verbose", "Enable verbose mode", 0, 0, 0, 0 },
+ { "win-size", "Window size", "<size>", 0, 1, "101" },
+ {0, 0, 0, 0, 0, 0}
+};
+
+
+
+int main(int argc, char *argv[])
+{
+ using namespace mln;
+
+ scribo::debug::option_parser options(arg_desc, toggle_desc, opt_desc);
+
+ if (!options.parse(argc, argv))
+ return 1;
+
+ // Enable debug output.
+ if (options.is_set("debug-prefix"))
+ {
+ scribo::debug::logger().set_filename_prefix(options.opt_value("debug-prefix").c_str());
+ scribo::debug::logger().set_level(scribo::debug::All);
+ }
+
+ Magick::InitializeMagick(*argv);
+
+ trace::entering("main");
+
+ bool verbose = options.is_set("verbose");
+ unsigned w = atoi(options.opt_value("win-size").c_str());
+ double k = atof(options.opt_value("k").c_str());
+
+ if (verbose)
+ std::cout << "Using w=" << w << " and k=" << k << std::endl;
+
+ image2d<value::rgb8> input;
+ io::magick::load(input, options.arg("input.*"));
+
+ // Convert to Gray level image.
+ image2d<value::int_u8>
+ input_1_gl = data::transform(input, mln::fun::v2v::rgb_to_luma<value::int_u8>());
+
+ image2d<bool> out = scribo::binarization::niblack(input_1_gl, w, k);
+
+ io::pbm::save(out, options.arg("output.pbm"));
+
+ trace::exiting("main");
+}
diff --git a/scribo/src/binarization/pgm_sauvola_threshold_image.cc b/scribo/src/binarization/pgm_sauvola_threshold_image.cc
index a38784a..69e2e15 100644
--- a/scribo/src/binarization/pgm_sauvola_threshold_image.cc
+++ b/scribo/src/binarization/pgm_sauvola_threshold_image.cc
@@ -1,4 +1,5 @@
-// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010, 2011 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -25,7 +26,7 @@
#include <mln/io/pgm/all.hh>
-#include <scribo/binarization/sauvola.hh>
+#include <scribo/binarization/sauvola_threshold.hh>
#include <scribo/debug/usage.hh>
const char *args_desc[][2] =
@@ -67,7 +68,7 @@ int main(int argc, char *argv[])
image2d<value::int_u8> input;
io::pgm::load(input, argv[1]);
- image2d<value::int_u8> out = scribo::binarization::sauvola_threshold_image(input, w, k);
+ image2d<value::int_u8> out = scribo::binarization::sauvola_threshold(input, w, k);
io::pgm::save(out, argv[2]);
diff --git a/scribo/tests/binarization/Makefile.am b/scribo/tests/binarization/Makefile.am
index b8ab2d9..a2962bb 100644
--- a/scribo/tests/binarization/Makefile.am
+++ b/scribo/tests/binarization/Makefile.am
@@ -21,6 +21,7 @@
include $(top_srcdir)/scribo/tests/tests.mk
EXTRA_DIST = \
+ niblack.res.pbm \
sauvola_ms.ref.pbm \
sauvola.ref.pbm \
otsu.ref.pbm
@@ -28,6 +29,7 @@ EXTRA_DIST = \
check_PROGRAMS = \
global_threshold \
local_threshold \
+ niblack \
otsu \
sauvola \
sauvola_ms
@@ -35,6 +37,7 @@ check_PROGRAMS = \
global_threshold_SOURCES = global_threshold.cc
local_threshold_SOURCES = local_threshold.cc
+niblack_SOURCES = niblack.cc
otsu_SOURCES = otsu.cc
sauvola_SOURCES = sauvola.cc
sauvola_ms_SOURCES = sauvola_ms.cc
diff --git a/scribo/tests/binarization/niblack.cc b/scribo/tests/binarization/niblack.cc
new file mode 100644
index 0000000..99a58e2
--- /dev/null
+++ b/scribo/tests/binarization/niblack.cc
@@ -0,0 +1,52 @@
+// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+/// \file
+
+#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 <scribo/binarization/niblack.hh>
+
+#include "tests/data.hh"
+
+int main()
+{
+ using namespace mln;
+
+ image2d<value::int_u8> input;
+ io::pgm::load(input, MILENA_IMG_DIR "/lena.pgm");
+
+ image2d<bool> bin = scribo::binarization::niblack(input, 101);
+
+ image2d<bool> ref;
+ io::pbm::load(ref, SCRIBO_TESTS_DIR "binarization/niblack.ref.pbm");
+
+ mln_assertion(bin == ref);
+}
diff --git a/scribo/tests/binarization/niblack.ref.pbm b/scribo/tests/binarization/niblack.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M
z&PU+ak_e(-S~5K3Eljj_`mnFl`^J3gaf(^}B(DCT+Kq!hYIJ<)#@I;zIQXCvrP5-u
zdEw@6{<cu#U0uo?VgWukatrf7rMNKP_9rp^e2a3slDyK**Ug`cyFwESZ$h`Q_W3v%
zzTr<|{2(g}a%}T_NyB5_Lx}Oml|nlj4SAUf!k_WKg@g#ZP2<rz^aPRuU)Y=2;l_hF
zZhB_C>KiJ~#dlX`7P{PT=Du6X^Q<XB_W{I)szOu^iQdoq#o6ZFQ!g8xtvyt_awJCS
zG@~-&LdzF<2`HC|0SX|oal$XpHupcZCHL=ap~Rd%_M}edFZ$UFt-ECURGfY~bmRDC
z<=NK$YmO|&+1f?Ec`!z4z^LfQj^Z->0`h^)-+1Kfmx3=J4D5Xd$}^mK;t<4riBmr!
z9BvnL_@q2X@}?uL-<@giFCO3C3Psp$PW<gbl<t-k6gyt?9q&BvsT*2HXOjKJS4O(u
d96b^JvQo9JDbJxzbz8yn1X}Dz#{V7vzX5`IYFq#S
literal 0
HcmV?d00001
--
1.7.2.5
1
0
olena-2.0-12-g9177e80 Move Otsu's threshold computation in a separate routine.
by Guillaume Lazzara 22 Nov '11
by Guillaume Lazzara 22 Nov '11
22 Nov '11
* scribo/binarization/otsu.hh,
* scribo/binarization/otsu_threshold.hh: Move threshold
computation in a separate routine.
---
scribo/ChangeLog | 8 +++
scribo/scribo/binarization/otsu.hh | 56 +-------------------
.../binarization/{otsu.hh => otsu_threshold.hh} | 31 +++++------
3 files changed, 23 insertions(+), 72 deletions(-)
copy scribo/scribo/binarization/{otsu.hh => otsu_threshold.hh} (84%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0923b28..6381a60 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,13 @@
2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Move Otsu's threshold computation in a separate routine.
+
+ * scribo/binarization/otsu.hh,
+ * scribo/binarization/otsu_threshold.hh: Move threshold
+ computation in a separate routine.
+
+2011-10-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add Niblack's binarization algorithm.
* scribo/binarization/all.hh: Update includes.
diff --git a/scribo/scribo/binarization/otsu.hh b/scribo/scribo/binarization/otsu.hh
index c96a207..6b9d492 100644
--- a/scribo/scribo/binarization/otsu.hh
+++ b/scribo/scribo/binarization/otsu.hh
@@ -27,12 +27,8 @@
# define SCRIBO_BINARIZATION_OTSU_HH
# include <mln/core/concept/image.hh>
-# include <mln/util/array.hh>
-# include <mln/geom/nsites.hh>
-# include <mln/geom/ncols.hh>
-# include <mln/geom/nrows.hh>
-# include <mln/histo/compute.hh>
+# include <scribo/binarization/otsu_threshold.hh>
# include <scribo/binarization/global_threshold.hh>
namespace scribo
@@ -72,55 +68,7 @@ namespace scribo
mlc_is_a(mln_value(I), value::Scalar)::check();
// FIXME: Check that input value is gray level.
- mln_value(I) maxval = mln_max(mln_value(I));
- unsigned nsites = geom::nsites(input);
-
- /* Histogram generation */
- histo::array<mln_value(I)> hist = mln::histo::compute(input);
-
-
- /* calculation of probability density */
- util::array<double> pdf(hist.nvalues()); //probability distribution
- for(int i = 0; i< maxval; ++i)
- pdf[i] = (double)hist[i] / nsites;
-
-
- util::array<double> cdf(hist.nvalues()); //cumulative probability distribution
- util::array<double> myu(hist.nvalues()); // mean value for separation
-
- /* cdf & myu generation */
- cdf[0] = pdf[0];
- myu[0] = 0.0; /* 0.0 times prob[0] equals zero */
-
- for(int i = 1; i < maxval; ++i)
- {
- cdf[i] = cdf[i-1] + pdf[i];
- myu[i] = myu[i-1] + i*pdf[i];
- }
-
- /* sigma maximization
- sigma stands for inter-class variance
- and determines optimal threshold value */
- int threshold = 0;
- double max_sigma = 0.0;
- util::array<double> sigma(hist.nvalues()); // inter-class variance
-
- for(int i = 0; i < maxval - 1; ++i)
- {
- if(cdf[i] != 0.0 && cdf[i] != 1.0)
- {
- double p1p2 = cdf[i] * (1.0 - cdf[i]);
- double mu1mu2diff = myu[maxval - 1] * cdf[i] - myu[i];
- sigma[i] = mu1mu2diff * mu1mu2diff / p1p2;
- }
- else
- sigma[i] = 0.0;
- if(sigma[i] > max_sigma)
- {
- max_sigma = sigma[i];
- threshold = i;
- }
- }
+ mln_value(I) threshold = otsu_threshold(input);
// Computing final result.
mln_ch_value(I,bool) output = global_threshold(input, threshold);
diff --git a/scribo/scribo/binarization/otsu.hh b/scribo/scribo/binarization/otsu_threshold.hh
similarity index 84%
copy from scribo/scribo/binarization/otsu.hh
copy to scribo/scribo/binarization/otsu_threshold.hh
index c96a207..ab663d0 100644
--- a/scribo/scribo/binarization/otsu.hh
+++ b/scribo/scribo/binarization/otsu_threshold.hh
@@ -23,8 +23,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_BINARIZATION_OTSU_HH
-# define SCRIBO_BINARIZATION_OTSU_HH
+#ifndef SCRIBO_BINARIZATION_OTSU_THRESHOLD_HH
+# define SCRIBO_BINARIZATION_OTSU_THRESHOLD_HH
# include <mln/core/concept/image.hh>
# include <mln/util/array.hh>
@@ -33,8 +33,6 @@
# include <mln/geom/nrows.hh>
# include <mln/histo/compute.hh>
-# include <scribo/binarization/global_threshold.hh>
-
namespace scribo
{
@@ -43,29 +41,28 @@ namespace scribo
using namespace mln;
- /*! An implementation of Otsu's binarization algorithm.
+ /*! Compute a global binarization threshold using Otsu's algorithm.
It is based on Ocropus's implementation.
http://code.google.com/p/ocropus/
\param[in] input A gray-scale image.
- \return A binary image. True for foreground, False for
- background.
+ \return A global threshold value.
*/
template <typename I>
- mln_ch_value(I,bool)
- otsu(const Image<I>& input);
+ mln_value(I)
+ otsu_threshold(const Image<I>& input);
# ifndef MLN_INCLUDE_ONLY
template <typename I>
- mln_ch_value(I,bool)
- otsu(const Image<I>& input_)
+ mln_value(I)
+ otsu_threshold(const Image<I>& input_)
{
- trace::entering("scribo::binarization::otsu");
+ trace::entering("scribo::binarization::otsu_threshold");
const I& input = exact(input_);
mln_precondition(input.is_valid());
@@ -101,7 +98,7 @@ namespace scribo
/* sigma maximization
sigma stands for inter-class variance
and determines optimal threshold value */
- int threshold = 0;
+ mln_value(I) threshold = literal::zero;
double max_sigma = 0.0;
util::array<double> sigma(hist.nvalues()); // inter-class variance
@@ -122,10 +119,8 @@ namespace scribo
}
}
- // Computing final result.
- mln_ch_value(I,bool) output = global_threshold(input, threshold);
-
- return output;
+ trace::exiting("scribo::binarization::otsu_threshold");
+ return threshold;
}
# endif // ! MLN_INCLUDE_ONLY
@@ -134,4 +129,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_BINARIZATION_OTSU_HH
+#endif // ! SCRIBO_BINARIZATION_OTSU_THRESHOLD_HH
--
1.7.2.5
1
0