* scribo/core/macros.hh: Update comments.
* scribo/text/merging.hh: Add comments and fix line data swap.
* scribo/text/recognition.hh: Make use of is_textline.
* src/text_in_picture.cc: Initialize ImageMagick.
---
scribo/ChangeLog | 12 ++++++++++++
scribo/scribo/core/macros.hh | 7 +++----
scribo/scribo/text/merging.hh | 6 +++---
scribo/scribo/text/recognition.hh | 2 +-
4 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index d783c5c..0aa4ba2 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,17 @@
2011-02-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Small fixes in Scribo.
+
+ * scribo/core/macros.hh: Update comments.
+
+ * scribo/text/merging.hh: Add comments and fix line data swap.
+
+ * scribo/text/recognition.hh: Make use of is_textline.
+
+ * src/text_in_picture.cc: Initialize ImageMagick.
+
+2011-02-17 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Improve and cleanup whitespace separator detection.
* scribo/core/tag/anchor.hh: Add new anchors.
diff --git a/scribo/scribo/core/macros.hh b/scribo/scribo/core/macros.hh
index 887539f..c6de1ff 100644
--- a/scribo/scribo/core/macros.hh
+++ b/scribo/scribo/core/macros.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.
//
@@ -33,8 +33,6 @@
# define for_all_elements(E, S) \
for (unsigned E = 0; E < S.nelements(); ++E)
-
-// FIXME: we want to replace previous macros by these ones.
# define for_all_comps(C, S) \
for (unsigned C = 1; C <= S.nelements(); ++C)
@@ -56,6 +54,7 @@
# define for_all_line_comps(E, S) \
for_all_elements(E, S)
+// Internal use only.
# define for_all_lines_info(E, S) \
for_all_comp_data(E, S)
diff --git a/scribo/scribo/text/merging.hh b/scribo/scribo/text/merging.hh
index 3087465..f433e51 100644
--- a/scribo/scribo/text/merging.hh
+++ b/scribo/scribo/text/merging.hh
@@ -192,7 +192,7 @@ namespace scribo
{
// we transfer data from the largest item to the root one.
scribo::line_info<L> tmp = lines(l1);
- lines(l1) = lines(l2);
+ std::swap(lines(l1), lines(l2));
lines(l1).fast_merge(tmp);
// We must set manually the tag for lines(l2) since it is
@@ -504,8 +504,8 @@ namespace scribo
void
one_merge_pass(unsigned ith_pass,
const box2d& domain,
- std::vector<scribo::line_id_t>& v,
- scribo::line_set<L>& lines,
+ std::vector<scribo::line_id_t>& v, // Ids sorted by bbox size.
+ scribo::line_set<L>& lines, // Tagged Lines (looks_like_a_text_line?)
mln::util::array<unsigned>& parent)
{
image2d<unsigned> billboard(domain);
diff --git a/scribo/scribo/text/recognition.hh b/scribo/scribo/text/recognition.hh
index 59f269e..3a9742b 100644
--- a/scribo/scribo/text/recognition.hh
+++ b/scribo/scribo/text/recognition.hh
@@ -127,7 +127,7 @@ namespace scribo
/// Use text bboxes with Tesseract
for_all_lines(i, lines)
{
- if (! lines(i).is_valid() || lines(i).is_hidden() || lines(i).type() != line::Text)
+ if (! lines(i).is_textline())
continue;
mln_domain(I) box = lines(i).bbox();
--
1.5.6.5
Show replies by date