* scribo/binarization/internal/niblack_functor_fast.hh,
* scribo/binarization/internal/niblack_threshold_functor.hh,
* scribo/binarization/internal/sauvola_functor.hh,
* scribo/binarization/internal/sauvola_threshold_functor.hh,
* scribo/binarization/internal/singh_functor.hh,
* scribo/binarization/internal/wolf_functor_fast.hh,
* scribo/binarization/sauvola_ms.hh,
* scribo/util/init_integral_image.hh,
* scribo/util/integral_sub_sum_sum2_functor.hh: Here.
---
scribo/ChangeLog | 14 ++++++++++++++
.../binarization/internal/niblack_functor_fast.hh | 9 +++++----
.../internal/niblack_threshold_functor.hh | 10 +++++-----
.../binarization/internal/sauvola_functor.hh | 10 +++++-----
.../internal/sauvola_threshold_functor.hh | 10 +++++-----
.../scribo/binarization/internal/singh_functor.hh | 9 +++++----
.../binarization/internal/wolf_functor_fast.hh | 9 +++++----
scribo/scribo/binarization/sauvola_ms.hh | 6 +++---
scribo/scribo/util/init_integral_image.hh | 6 +++---
.../scribo/util/integral_sub_sum_sum2_functor.hh | 5 +++--
10 files changed, 53 insertions(+), 35 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 70b8ae5..a45be28 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,19 @@
2013-03-01 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Rename point_at_index and index_of_point.
+
+ * scribo/binarization/internal/niblack_functor_fast.hh,
+ * scribo/binarization/internal/niblack_threshold_functor.hh,
+ * scribo/binarization/internal/sauvola_functor.hh,
+ * scribo/binarization/internal/sauvola_threshold_functor.hh,
+ * scribo/binarization/internal/singh_functor.hh,
+ * scribo/binarization/internal/wolf_functor_fast.hh,
+ * scribo/binarization/sauvola_ms.hh,
+ * scribo/util/init_integral_image.hh,
+ * scribo/util/integral_sub_sum_sum2_functor.hh: Here.
+
+2013-03-01 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/text/recognition.hh: Fix tesseract includes.
2013-01-28 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/scribo/binarization/internal/niblack_functor_fast.hh
b/scribo/scribo/binarization/internal/niblack_functor_fast.hh
index 8251ecd..fd36756 100644
--- a/scribo/scribo/binarization/internal/niblack_functor_fast.hh
+++ b/scribo/scribo/binarization/internal/niblack_functor_fast.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2012, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -104,11 +105,11 @@ namespace scribo
if (more_offset == - 3)
more_offset = 0; // No offset needed.
- next_line3 = input.delta_index(dpoint2d(+2,0))
+ next_line3 = input.delta_offset(dpoint2d(+2,0))
+ 2 * input.border() + more_offset;
- offset1 = input.delta_index(dpoint2d(+1,0));
- offset2 = input.delta_index(dpoint2d(+2,0));
+ offset1 = input.delta_offset(dpoint2d(+1,0));
+ offset2 = input.delta_offset(dpoint2d(+2,0));
initialize(output, input);
po = &output(output.domain().pmin());
diff --git a/scribo/scribo/binarization/internal/niblack_threshold_functor.hh
b/scribo/scribo/binarization/internal/niblack_threshold_functor.hh
index e9cfbdc..d2f82c9 100644
--- a/scribo/scribo/binarization/internal/niblack_threshold_functor.hh
+++ b/scribo/scribo/binarization/internal/niblack_threshold_functor.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2011, 2012, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -97,10 +97,10 @@ namespace scribo
const I& input = exact(input_);
mln_precondition(input.is_valid());
- next_line3 = input.delta_index(dpoint2d(+2,0)) + 2 * input.border() - 1;
+ next_line3 = input.delta_offset(dpoint2d(+2,0)) + 2 * input.border() - 1;
- offset1 = input.delta_index(dpoint2d(+1,0));
- offset2 = input.delta_index(dpoint2d(+2,0));
+ offset1 = input.delta_offset(dpoint2d(+1,0));
+ offset2 = input.delta_offset(dpoint2d(+2,0));
initialize(output, input);
po = &output(output.domain().pmin());
diff --git a/scribo/scribo/binarization/internal/sauvola_functor.hh
b/scribo/scribo/binarization/internal/sauvola_functor.hh
index f09af1f..613b3e5 100644
--- a/scribo/scribo/binarization/internal/sauvola_functor.hh
+++ b/scribo/scribo/binarization/internal/sauvola_functor.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2011, 2012, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -107,11 +107,11 @@ namespace scribo
if (more_offset == - 3)
more_offset = 0; // No offset needed.
- next_line3 = input.delta_index(dpoint2d(+2,0))
+ next_line3 = input.delta_offset(dpoint2d(+2,0))
+ 2 * input.border() + more_offset;
- offset1 = input.delta_index(dpoint2d(+1,0));
- offset2 = input.delta_index(dpoint2d(+2,0));
+ offset1 = input.delta_offset(dpoint2d(+1,0));
+ offset2 = input.delta_offset(dpoint2d(+2,0));
initialize(output, input);
po = &output(output.domain().pmin());
diff --git a/scribo/scribo/binarization/internal/sauvola_threshold_functor.hh
b/scribo/scribo/binarization/internal/sauvola_threshold_functor.hh
index 1702965..fd5eac8 100644
--- a/scribo/scribo/binarization/internal/sauvola_threshold_functor.hh
+++ b/scribo/scribo/binarization/internal/sauvola_threshold_functor.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2011, 2012 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2011, 2012, 2013 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -99,10 +99,10 @@ namespace scribo
const I& input = exact(input_);
mln_precondition(input.is_valid());
- next_line3 = input.delta_index(dpoint2d(+2,0)) + 2 * input.border() - 1;
+ next_line3 = input.delta_offset(dpoint2d(+2,0)) + 2 * input.border() - 1;
- offset1 = input.delta_index(dpoint2d(+1,0));
- offset2 = input.delta_index(dpoint2d(+2,0));
+ offset1 = input.delta_offset(dpoint2d(+1,0));
+ offset2 = input.delta_offset(dpoint2d(+2,0));
initialize(output, input);
po = &output(output.domain().pmin());
diff --git a/scribo/scribo/binarization/internal/singh_functor.hh
b/scribo/scribo/binarization/internal/singh_functor.hh
index 5e7e66f..fb8f525 100644
--- a/scribo/scribo/binarization/internal/singh_functor.hh
+++ b/scribo/scribo/binarization/internal/singh_functor.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2012, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -105,11 +106,11 @@ namespace scribo
if (more_offset == - 3)
more_offset = 0; // No offset needed.
- next_line3 = input.delta_index(dpoint2d(+2,0))
+ next_line3 = input.delta_offset(dpoint2d(+2,0))
+ 2 * input.border() + more_offset;
- offset1 = input.delta_index(dpoint2d(+1,0));
- offset2 = input.delta_index(dpoint2d(+2,0));
+ offset1 = input.delta_offset(dpoint2d(+1,0));
+ offset2 = input.delta_offset(dpoint2d(+2,0));
initialize(output, input);
po = &output(output.domain().pmin());
diff --git a/scribo/scribo/binarization/internal/wolf_functor_fast.hh
b/scribo/scribo/binarization/internal/wolf_functor_fast.hh
index cce72b6..a61bead 100644
--- a/scribo/scribo/binarization/internal/wolf_functor_fast.hh
+++ b/scribo/scribo/binarization/internal/wolf_functor_fast.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2012, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -115,11 +116,11 @@ namespace scribo
if (more_offset == - 3)
more_offset = 0; // No offset needed.
- next_line3 = input.delta_index(dpoint2d(+2,0))
+ next_line3 = input.delta_offset(dpoint2d(+2,0))
+ 2 * input.border() + more_offset;
- offset1 = input.delta_index(dpoint2d(+1,0));
- offset2 = input.delta_index(dpoint2d(+2,0));
+ offset1 = input.delta_offset(dpoint2d(+1,0));
+ offset2 = input.delta_offset(dpoint2d(+2,0));
initialize(output, input);
po = &output(output.domain().pmin());
diff --git a/scribo/scribo/binarization/sauvola_ms.hh
b/scribo/scribo/binarization/sauvola_ms.hh
index 6fe7bc9..6d882af 100644
--- a/scribo/scribo/binarization/sauvola_ms.hh
+++ b/scribo/scribo/binarization/sauvola_ms.hh
@@ -1,5 +1,5 @@
-// Copyright (C) 2009, 2010, 2011, 2012 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2009, 2010, 2011, 2012, 2013 EPITA Research and
+// Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -247,7 +247,7 @@ namespace scribo
# ifdef SCRIBO_LOCAL_THRESHOLD_DEBUG
f.full_msk.element(p) = f.full_msk.element(f.parent.element(p));
- point2d sqp = f.parent.point_at_index(f.parent.element(p)) * ratio;
+ point2d sqp = f.parent.point_at_offset(f.parent.element(p)) * ratio;
unsigned v = debug_scale_proba(point3d(i - 2, sqp.row(), sqp.col()));
for (unsigned l = 0; l < ratio; ++l)
diff --git a/scribo/scribo/util/init_integral_image.hh
b/scribo/scribo/util/init_integral_image.hh
index 19d914d..d237236 100644
--- a/scribo/scribo/util/init_integral_image.hh
+++ b/scribo/scribo/util/init_integral_image.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009, 2010, 2011 EPITA Research and Development
+// Copyright (C) 2009, 2010, 2011, 2013 EPITA Research and Development
// Laboratory (LRDE)
//
// This file is part of Olena.
@@ -99,14 +99,14 @@ namespace scribo
J integral_sum_sum_2(output_domain, border);
V2* p_integ = integral_sum_sum_2.buffer();
- const int up = integral_sum_sum_2.delta_index(dpoint2d(-1, 0));
+ const int up = integral_sum_sum_2.delta_offset(dpoint2d(-1, 0));
const unsigned nrows = scale * integral_sum_sum_2.nrows();
const unsigned ncols = scale * integral_sum_sum_2.ncols();
unsigned row = 0;
- unsigned b_offset = integral_sum_sum_2.delta_index(dpoint2d(border,
+ unsigned b_offset = integral_sum_sum_2.delta_offset(dpoint2d(border,
border));
// First row (special case)
diff --git a/scribo/scribo/util/integral_sub_sum_sum2_functor.hh
b/scribo/scribo/util/integral_sub_sum_sum2_functor.hh
index 1c312b7..7deba93 100644
--- a/scribo/scribo/util/integral_sub_sum_sum2_functor.hh
+++ b/scribo/scribo/util/integral_sub_sum_sum2_functor.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2011 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2011, 2013 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -110,7 +111,7 @@ namespace scribo
area = scale * scale;
b_next = 2 * border;
- unsigned b_offset = sub.delta_index(dpoint2d(border, border));
+ unsigned b_offset = sub.delta_offset(dpoint2d(border, border));
p_sub = sub.buffer() + b_offset;
}
--
1.7.2.5