Olena-patches
Threads by month
- ----- 2025 -----
- 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
April 2010
- 5 participants
- 182 discussions

last-svn-commit-108-g5da79fe Add A first draft of a README in Scribo.
by Guillaume Lazzara 30 Apr '10
by Guillaume Lazzara 30 Apr '10
30 Apr '10
* README: New.
---
scribo/ChangeLog | 72 +++++++++++++++++++++++++++++------------------------
scribo/README | 51 ++++++++++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+), 33 deletions(-)
create mode 100644 scribo/README
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0a98d9a..b4d325e 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,40 +1,46 @@
2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add A first draft of a README in Scribo.
+
+ * README: New.
+
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Move AFP's GUI into Scribo's demo directory.
- * milena/sandbox/lazzara/afp/photos/gui/gui.pro,
- * milena/sandbox/lazzara/afp/photos/gui/gui.qrc,
- * milena/sandbox/lazzara/afp/photos/gui/icons/next.png,
- * milena/sandbox/lazzara/afp/photos/gui/icons/ok.png,
- * milena/sandbox/lazzara/afp/photos/gui/icons/photos.png,
- * milena/sandbox/lazzara/afp/photos/gui/icons/prev.png,
- * milena/sandbox/lazzara/afp/photos/gui/icons/remove.png,
- * milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc,
- * milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh,
- * milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc,
- * milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh,
- * milena/sandbox/lazzara/afp/photos/gui/src/main.cc,
- * milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc,
- * milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh,
- * milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui,
- * milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui: Move...
-
- * scribo/demo/tip/gui.pro,
- * scribo/demo/tip/gui.qrc,
- * scribo/demo/tip/icons/next.png,
- * scribo/demo/tip/icons/ok.png,
- * scribo/demo/tip/icons/photos.png,
- * scribo/demo/tip/icons/prev.png,
- * scribo/demo/tip/icons/remove.png,
- * scribo/demo/tip/src/custom_delegate.cc,
- * scribo/demo/tip/src/custom_delegate.hh,
- * scribo/demo/tip/src/launch_dialog.cc,
- * scribo/demo/tip/src/launch_dialog.hh,
- * scribo/demo/tip/src/main.cc,
- * scribo/demo/tip/src/main_window.cc,
- * scribo/demo/tip/src/main_window.hh,
- * scribo/demo/tip/ui/launch_dialog.ui,
- * scribo/demo/tip/ui/main_window.ui: ... here.
+ * ../milena/sandbox/lazzara/afp/photos/gui/gui.pro,
+ * ../milena/sandbox/lazzara/afp/photos/gui/gui.qrc,
+ * ../milena/sandbox/lazzara/afp/photos/gui/icons/next.png,
+ * ../milena/sandbox/lazzara/afp/photos/gui/icons/ok.png,
+ * ../milena/sandbox/lazzara/afp/photos/gui/icons/photos.png,
+ * ../milena/sandbox/lazzara/afp/photos/gui/icons/prev.png,
+ * ../milena/sandbox/lazzara/afp/photos/gui/icons/remove.png,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/main.cc,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc,
+ * ../milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh,
+ * ../milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui,
+ * ../milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui: Move...
+
+ * demo/tip/gui.pro,
+ * demo/tip/gui.qrc,
+ * demo/tip/icons/next.png,
+ * demo/tip/icons/ok.png,
+ * demo/tip/icons/photos.png,
+ * demo/tip/icons/prev.png,
+ * demo/tip/icons/remove.png,
+ * demo/tip/src/custom_delegate.cc,
+ * demo/tip/src/custom_delegate.hh,
+ * demo/tip/src/launch_dialog.cc,
+ * demo/tip/src/launch_dialog.hh,
+ * demo/tip/src/main.cc,
+ * demo/tip/src/main_window.cc,
+ * demo/tip/src/main_window.hh,
+ * demo/tip/ui/launch_dialog.ui,
+ * demo/tip/ui/main_window.ui: ... here.
2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/README b/scribo/README
new file mode 100644
index 0000000..b8b7ca2
--- /dev/null
+++ b/scribo/README
@@ -0,0 +1,51 @@
+Copyright (C) 2009, 2010 EPITA Research and Development Laboratory (LRDE)
+
+This file is part of Scribo.
+
+Scribo 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.
+
+Scribo 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/>.
+
+The complete GNU General Public License Notice can also be found in
+the 'COPYING' file in the root directory.
+
+
+======================
+ Introduction to Olena
+======================
+
+Scribo aims to provide tools for Document Image Analysis (DIA).
+
+
+========
+ Content
+========
+
+demo/
+
+ demat
+ Sample GUI used to retrieve text from a whole document or a
+ region of interest.
+
+ wizard
+ Sample GUI used to retrieve text from a whole document or a
+ region of interest.
+
+ tip
+ Sample GUI used to display text localization in picture results.
+
+
+src/
+ text_in_article_pbm
+ Retrieve text from a document.
+
+ text_in_picture_fast
+ Localize text in pictures.
\ No newline at end of file
--
1.5.6.5
1
0

last-svn-commit-107-g38d6f4b Move AFP's GUI into Scribo's demo directory.
by Guillaume Lazzara 30 Apr '10
by Guillaume Lazzara 30 Apr '10
30 Apr '10
* milena/sandbox/lazzara/afp/photos/gui/gui.pro,
* milena/sandbox/lazzara/afp/photos/gui/gui.qrc,
* milena/sandbox/lazzara/afp/photos/gui/icons/next.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/ok.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/photos.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/prev.png,
* milena/sandbox/lazzara/afp/photos/gui/icons/remove.png,
* milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh,
* milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh,
* milena/sandbox/lazzara/afp/photos/gui/src/main.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc,
* milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh,
* milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui,
* milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui: Move...
* scribo/demo/tip/gui.pro,
* scribo/demo/tip/gui.qrc,
* scribo/demo/tip/icons/next.png,
* scribo/demo/tip/icons/ok.png,
* scribo/demo/tip/icons/photos.png,
* scribo/demo/tip/icons/prev.png,
* scribo/demo/tip/icons/remove.png,
* scribo/demo/tip/src/custom_delegate.cc,
* scribo/demo/tip/src/custom_delegate.hh,
* scribo/demo/tip/src/launch_dialog.cc,
* scribo/demo/tip/src/launch_dialog.hh,
* scribo/demo/tip/src/main.cc,
* scribo/demo/tip/src/main_window.cc,
* scribo/demo/tip/src/main_window.hh,
* scribo/demo/tip/ui/launch_dialog.ui,
* scribo/demo/tip/ui/main_window.ui: ... here.
---
scribo/ChangeLog | 38 ++++++++++++++++++++
.../afp/photos/gui => scribo/demo/tip}/gui.pro | 0
.../afp/photos/gui => scribo/demo/tip}/gui.qrc | 0
.../photos/gui => scribo/demo/tip}/icons/next.png | Bin 3337 -> 3337 bytes
.../photos/gui => scribo/demo/tip}/icons/ok.png | Bin 3953 -> 3953 bytes
.../gui => scribo/demo/tip}/icons/photos.png | Bin 3750 -> 3750 bytes
.../photos/gui => scribo/demo/tip}/icons/prev.png | Bin 3334 -> 3334 bytes
.../gui => scribo/demo/tip}/icons/remove.png | Bin 3704 -> 3704 bytes
.../gui => scribo/demo/tip}/src/custom_delegate.cc | 0
.../gui => scribo/demo/tip}/src/custom_delegate.hh | 0
.../gui => scribo/demo/tip}/src/launch_dialog.cc | 0
.../gui => scribo/demo/tip}/src/launch_dialog.hh | 0
.../afp/photos/gui => scribo/demo/tip}/src/main.cc | 0
.../gui => scribo/demo/tip}/src/main_window.cc | 0
.../gui => scribo/demo/tip}/src/main_window.hh | 0
.../gui => scribo/demo/tip}/ui/launch_dialog.ui | 0
.../gui => scribo/demo/tip}/ui/main_window.ui | 0
17 files changed, 38 insertions(+), 0 deletions(-)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/gui.pro (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/gui.qrc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/next.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/ok.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/photos.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/prev.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/icons/remove.png (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/custom_delegate.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/custom_delegate.hh (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/launch_dialog.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/launch_dialog.hh (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/main.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/main_window.cc (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/src/main_window.hh (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/ui/launch_dialog.ui (100%)
rename {milena/sandbox/lazzara/afp/photos/gui => scribo/demo/tip}/ui/main_window.ui (100%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 6acc319..0a98d9a 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,43 @@
2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Move AFP's GUI into Scribo's demo directory.
+
+ * milena/sandbox/lazzara/afp/photos/gui/gui.pro,
+ * milena/sandbox/lazzara/afp/photos/gui/gui.qrc,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/next.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/ok.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/photos.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/prev.png,
+ * milena/sandbox/lazzara/afp/photos/gui/icons/remove.png,
+ * milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh,
+ * milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh,
+ * milena/sandbox/lazzara/afp/photos/gui/src/main.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc,
+ * milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh,
+ * milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui,
+ * milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui: Move...
+
+ * scribo/demo/tip/gui.pro,
+ * scribo/demo/tip/gui.qrc,
+ * scribo/demo/tip/icons/next.png,
+ * scribo/demo/tip/icons/ok.png,
+ * scribo/demo/tip/icons/photos.png,
+ * scribo/demo/tip/icons/prev.png,
+ * scribo/demo/tip/icons/remove.png,
+ * scribo/demo/tip/src/custom_delegate.cc,
+ * scribo/demo/tip/src/custom_delegate.hh,
+ * scribo/demo/tip/src/launch_dialog.cc,
+ * scribo/demo/tip/src/launch_dialog.hh,
+ * scribo/demo/tip/src/main.cc,
+ * scribo/demo/tip/src/main_window.cc,
+ * scribo/demo/tip/src/main_window.hh,
+ * scribo/demo/tip/ui/launch_dialog.ui,
+ * scribo/demo/tip/ui/main_window.ui: ... here.
+
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Introduce dmax_functor concept.
* core/concept/dmax_functor.hh,
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.pro b/scribo/demo/tip/gui.pro
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/gui.pro
rename to scribo/demo/tip/gui.pro
diff --git a/milena/sandbox/lazzara/afp/photos/gui/gui.qrc b/scribo/demo/tip/gui.qrc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/gui.qrc
rename to scribo/demo/tip/gui.qrc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/next.png b/scribo/demo/tip/icons/next.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/next.png
rename to scribo/demo/tip/icons/next.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/ok.png b/scribo/demo/tip/icons/ok.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/ok.png
rename to scribo/demo/tip/icons/ok.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/photos.png b/scribo/demo/tip/icons/photos.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/photos.png
rename to scribo/demo/tip/icons/photos.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/prev.png b/scribo/demo/tip/icons/prev.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/prev.png
rename to scribo/demo/tip/icons/prev.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/icons/remove.png b/scribo/demo/tip/icons/remove.png
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/icons/remove.png
rename to scribo/demo/tip/icons/remove.png
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc b/scribo/demo/tip/src/custom_delegate.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.cc
rename to scribo/demo/tip/src/custom_delegate.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh b/scribo/demo/tip/src/custom_delegate.hh
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/custom_delegate.hh
rename to scribo/demo/tip/src/custom_delegate.hh
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc b/scribo/demo/tip/src/launch_dialog.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.cc
rename to scribo/demo/tip/src/launch_dialog.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh b/scribo/demo/tip/src/launch_dialog.hh
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/launch_dialog.hh
rename to scribo/demo/tip/src/launch_dialog.hh
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main.cc b/scribo/demo/tip/src/main.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/main.cc
rename to scribo/demo/tip/src/main.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc b/scribo/demo/tip/src/main_window.cc
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/main_window.cc
rename to scribo/demo/tip/src/main_window.cc
diff --git a/milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh b/scribo/demo/tip/src/main_window.hh
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/src/main_window.hh
rename to scribo/demo/tip/src/main_window.hh
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui b/scribo/demo/tip/ui/launch_dialog.ui
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/ui/launch_dialog.ui
rename to scribo/demo/tip/ui/launch_dialog.ui
diff --git a/milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui b/scribo/demo/tip/ui/main_window.ui
similarity index 100%
rename from milena/sandbox/lazzara/afp/photos/gui/ui/main_window.ui
rename to scribo/demo/tip/ui/main_window.ui
--
1.5.6.5
1
0

30 Apr '10
* core/concept/dmax_functor.hh,
* primitive/link/internal/dmax_default.hh,
* primitive/link/internal/dmax_functor_base.hh,
* primitive/link/internal/dmax_width_and_height.hh,
* primitive/link/internal/dmax_width_only.hh: New.
* primitive/link/internal/link_single_dmax_ratio_base.hh,
* primitive/link/with_single_left_link_dmax_ratio.hh,
* primitive/link/with_single_right_link_dmax_ratio.hh: Make use of
the new functors.
---
scribo/ChangeLog | 15 +++
.../concept/{link_functor.hh => dmax_functor.hh} | 15 +--
.../find_root.hh => link/internal/dmax_default.hh} | 54 ++++++-----
.../internal/dmax_functor_base.hh} | 69 ++++++++++----
.../dmax_width_and_height.hh} | 79 ++++++++--------
.../internal/dmax_width_only.hh} | 66 +++++++++-----
.../link/internal/link_single_dmax_ratio_base.hh | 69 +++++++++-----
.../link/with_single_left_link_dmax_ratio.hh | 100 +++++++++++++++-----
.../link/with_single_right_link_dmax_ratio.hh | 65 +++++++++----
9 files changed, 348 insertions(+), 184 deletions(-)
copy scribo/core/concept/{link_functor.hh => dmax_functor.hh} (80%)
copy scribo/primitive/{internal/find_root.hh => link/internal/dmax_default.hh} (61%)
copy scribo/primitive/{internal/find_root.hh => link/internal/dmax_functor_base.hh} (54%)
copy scribo/primitive/link/{with_rag.hh => internal/dmax_width_and_height.hh} (53%)
copy scribo/primitive/{internal/find_root.hh => link/internal/dmax_width_only.hh} (56%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 0408bf3..6acc319 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,20 @@
2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Introduce dmax_functor concept.
+
+ * core/concept/dmax_functor.hh,
+ * primitive/link/internal/dmax_default.hh,
+ * primitive/link/internal/dmax_functor_base.hh,
+ * primitive/link/internal/dmax_width_and_height.hh,
+ * primitive/link/internal/dmax_width_only.hh: New.
+
+ * primitive/link/internal/link_single_dmax_ratio_base.hh,
+ * primitive/link/with_single_left_link_dmax_ratio.hh,
+ * primitive/link/with_single_right_link_dmax_ratio.hh: Make use of
+ the new functors.
+
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Small fixes in Scribo.
* binarization/sauvola_ms.hh,
diff --git a/scribo/core/concept/link_functor.hh b/scribo/core/concept/dmax_functor.hh
similarity index 80%
copy from scribo/core/concept/link_functor.hh
copy to scribo/core/concept/dmax_functor.hh
index f51843a..755913c 100644
--- a/scribo/core/concept/link_functor.hh
+++ b/scribo/core/concept/dmax_functor.hh
@@ -23,24 +23,21 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_CORE_INTERNAL_LINK_FUNCTOR_HH
-# define SCRIBO_CORE_INTERNAL_LINK_FUNCTOR_HH
+#ifndef SCRIBO_CORE_INTERNAL_DMAX_FUNCTOR_HH
+# define SCRIBO_CORE_INTERNAL_DMAX_FUNCTOR_HH
/// \file
///
-/// Link functor concept.
+/// DMax functor concept.
# include <mln/core/concept/object.hh>
-# define scribo_support(T) typename T::support
-# define scribo_support_(T) T::support
-
namespace scribo
{
- /// \brief Link functor concept.
+ /// \brief Dmax functor concept.
template <typename E>
- class Link_Functor : public mln::Object<E>
+ class DMax_Functor : public mln::Object<E>
{
// typedef L support
@@ -50,4 +47,4 @@ namespace scribo
} // end of namespace scribo
-#endif // SCRIBO_CORE_INTERNAL_LINK_FUNCTOR_HH
+#endif // SCRIBO_CORE_INTERNAL_DMAX_FUNCTOR_HH
diff --git a/scribo/primitive/internal/find_root.hh b/scribo/primitive/link/internal/dmax_default.hh
similarity index 61%
copy from scribo/primitive/internal/find_root.hh
copy to scribo/primitive/link/internal/dmax_default.hh
index 4fa6d20..1444dfe 100644
--- a/scribo/primitive/internal/find_root.hh
+++ b/scribo/primitive/link/internal/dmax_default.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,15 +23,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
-# define SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_DEFAULT_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_DEFAULT_HH
/// \file
///
-/// Find root in a parent array arrays.
+/// Default class for dmax functors.
-
-# include <scribo/core/object_groups.hh>
+# include <scribo/primitive/link/internal/dmax_functor_base.hh>
namespace scribo
@@ -40,34 +39,45 @@ namespace scribo
namespace primitive
{
+ namespace link
+ {
+
namespace internal
{
- /// Find root in a parent array arrays.
- template <typename L>
- unsigned
- find_root(object_groups<L>& parent, unsigned x);
+
+ /// \brief Base class for dmax functors.
+ class dmax_default : public dmax_functor_base<dmax_default>
+ {
+ typedef dmax_functor_base<dmax_default> super_;
+
+ public:
+ dmax_default(const float& dmax_factor);
+
+ protected:
+ using super_::dmax_factor_;
+ };
+
# ifndef MLN_INCLUDE_ONLY
- template <typename L>
- inline
- unsigned
- find_root(object_groups<L>& parent, unsigned x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
+
+ dmax_default::dmax_default(const float& dmax_factor)
+ : super_(dmax_factor)
+ {
}
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::primitive::internal
- } // end of namespace scribo::text
+ } // end of namespace scribo::primitive::link::internal
+
+ } // end of namespace scribo::primitive::link
+
+ } // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_DEFAULT_HH
diff --git a/scribo/primitive/internal/find_root.hh b/scribo/primitive/link/internal/dmax_functor_base.hh
similarity index 54%
copy from scribo/primitive/internal/find_root.hh
copy to scribo/primitive/link/internal/dmax_functor_base.hh
index 4fa6d20..8ff3f10 100644
--- a/scribo/primitive/internal/find_root.hh
+++ b/scribo/primitive/link/internal/dmax_functor_base.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,16 +23,18 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
-# define SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_FUNCTOR_BASE_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_FUNCTOR_BASE_HH
/// \file
///
-/// Find root in a parent array arrays.
+/// Base class for dmax functors.
+# include <mln/core/alias/box2d.hh>
-# include <scribo/core/object_groups.hh>
+# include <mln/math/max.hh>
+# include <scribo/core/concept/dmax_functor.hh>
namespace scribo
{
@@ -40,34 +42,59 @@ namespace scribo
namespace primitive
{
+ namespace link
+ {
+
namespace internal
{
- /// Find root in a parent array arrays.
- template <typename L>
- unsigned
- find_root(object_groups<L>& parent, unsigned x);
+
+ /// \brief Base class for dmax functors.
+ template <typename E>
+ class dmax_functor_base : public DMax_Functor<E>
+ {
+
+ public:
+ dmax_functor_base(const float& dmax_factor);
+ float operator()(const box2d& b) const;
+
+ protected:
+ float dmax_factor_;
+ };
+
# ifndef MLN_INCLUDE_ONLY
- template <typename L>
- inline
- unsigned
- find_root(object_groups<L>& parent, unsigned x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
+
+ template <typename E>
+ dmax_functor_base<E>::dmax_functor_base(const float& dmax_factor)
+ : dmax_factor_(dmax_factor)
+ {
}
+
+ template <typename E>
+ float
+ dmax_functor_base<E>::operator()(const box2d& b) const
+ {
+ float
+ w = b.width(),
+ h = b.height();
+
+ return (w / 2.0f) + (dmax_factor_ * math::max(w, h));
+ }
+
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::primitive::internal
- } // end of namespace scribo::text
+ } // end of namespace scribo::primitive::link::internal
+
+ } // end of namespace scribo::primitive::link
+
+ } // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_FUNCTOR_BASE_HH
diff --git a/scribo/primitive/link/with_rag.hh b/scribo/primitive/link/internal/dmax_width_and_height.hh
similarity index 53%
copy from scribo/primitive/link/with_rag.hh
copy to scribo/primitive/link/internal/dmax_width_and_height.hh
index 3638ec7..3f19f1f 100644
--- a/scribo/primitive/link/with_rag.hh
+++ b/scribo/primitive/link/internal/dmax_width_and_height.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,26 +23,16 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_LINK_WITH_RAG_HH
-# define SCRIBO_PRIMITIVE_LINK_WITH_RAG_HH
-
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_AND_HEIGHT_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_AND_HEIGHT_HH
/// \file
///
-/// Link objects with a region adjacency graph.
-
-# include <mln/core/concept/neighborhood.hh>
-
-# include <mln/util/graph.hh>
-# include <mln/util/couple.hh>
-
-# include <mln/transform/influence_zone_geodesic.hh>
-
-# include <mln/make/influence_zone_adjacency_graph.hh>
-
+/// Dmax functor relying on width only.
+///
+/// For newspapers like ICDAR documents, use dmax_factor = 1.
-# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
+# include <scribo/primitive/link/internal/dmax_functor_base.hh>
namespace scribo
@@ -54,46 +44,55 @@ namespace scribo
namespace link
{
- using namespace mln;
+ namespace internal
+ {
+
+ /// \brief Base class for dmax functors.
+ class dmax_width_and_height : public dmax_functor_base<dmax_width_and_height>
+ {
+ typedef dmax_functor_base<dmax_width_and_height> super_;
- template <typename L, typename N>
- util::couple<mln::util::graph, mln_concrete(L)>
- with_rag(const object_image(L)& objects,
- const Neighborhood<N>& nbh);
+ public:
+ dmax_width_and_height(const float& dmax_factor);
+ float operator()(const box2d&) const;
-# ifndef MLN_INCLUDE_ONLY
+ protected:
+ using super_::dmax_factor_;
+ };
- template <typename L, typename N>
- util::couple<mln::util::graph, mln_concrete(L)>
- with_rag(const object_image(L)& objects,
- const Neighborhood<N>& nbh)
- {
- trace::entering("scribo::primitive::link::with_rag");
+# ifndef MLN_INCLUDE_ONLY
- mln_precondition(objects.is_valid());
- mln_concrete(L)
- iz = transform::influence_zone_geodesic(objects, nbh);
+ dmax_width_and_height::dmax_width_and_height(const float& dmax_factor)
+ : super_(dmax_factor)
+ {
+ }
- mln::util::graph
- g = mln::make::influence_zone_adjacency_graph(iz,
- nbh,
- objects.nlabels());
- trace::exiting("scribo::primitive::link::with_rag");
- return make::couple(g, iz);
- }
+ float
+ dmax_width_and_height::operator()(const box2d& b) const
+ {
+ float
+ w = b.width(),
+ h = b.height();
+
+ return (w / 2.0f) + dmax_factor_ * (h + w);
+ }
# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace scribo::primitive::link::internal
+
} // end of namespace scribo::primitive::link
} // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_LINK_WITH_RAG_HH
+
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_AND_HEIGHT_HH
diff --git a/scribo/primitive/internal/find_root.hh b/scribo/primitive/link/internal/dmax_width_only.hh
similarity index 56%
copy from scribo/primitive/internal/find_root.hh
copy to scribo/primitive/link/internal/dmax_width_only.hh
index 4fa6d20..034d40b 100644
--- a/scribo/primitive/internal/find_root.hh
+++ b/scribo/primitive/link/internal/dmax_width_only.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,15 +23,16 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
-# define SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#ifndef SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_ONLY_HH
+# define SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_ONLY_HH
/// \file
///
-/// Find root in a parent array arrays.
-
+/// Dmax functor relying on width only.
+///
+/// To use for paragraph alignment.
-# include <scribo/core/object_groups.hh>
+# include <scribo/primitive/link/internal/dmax_functor_base.hh>
namespace scribo
@@ -40,34 +41,55 @@ namespace scribo
namespace primitive
{
+ namespace link
+ {
+
namespace internal
{
- /// Find root in a parent array arrays.
- template <typename L>
- unsigned
- find_root(object_groups<L>& parent, unsigned x);
+
+ /// \brief Base class for dmax functors.
+ class dmax_width_only : public dmax_functor_base<dmax_width_only>
+ {
+ typedef dmax_functor_base<dmax_width_only> super_;
+
+
+ public:
+ dmax_width_only();
+ float operator()(const box2d&) const;
+
+ protected:
+ using super_::dmax_factor_;
+ };
+
# ifndef MLN_INCLUDE_ONLY
- template <typename L>
- inline
- unsigned
- find_root(object_groups<L>& parent, unsigned x)
- {
- if (parent(x) == x)
- return x;
- else
- return parent(x) = find_root(parent, parent(x));
+
+ dmax_width_only::dmax_width_only()
+ : super_(0)
+ {
+ }
+
+
+ float
+ dmax_width_only::operator()(const box2d& b) const
+ {
+ float w = b.width();
+ return (w / 2.0f) + (dmax_factor_ * w);
}
+
# endif // ! MLN_INCLUDE_ONLY
- } // end of namespace scribo::primitive::internal
- } // end of namespace scribo::text
+ } // end of namespace scribo::primitive::link::internal
+
+ } // end of namespace scribo::primitive::link
+
+ } // end of namespace scribo::primitive
} // end of namespace scribo
-#endif // ! SCRIBO_PRIMITIVE_INTERNAL_FIND_ROOT_LINK_ARRAY_HH
+#endif // ! SCRIBO_PRIMITIVE_LINK_INTERNAL_DMAX_WIDTH_ONLY_HH
diff --git a/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh b/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh
index 1a4cb73..d3aba42 100644
--- a/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh
+++ b/scribo/primitive/link/internal/link_single_dmax_ratio_base.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -43,6 +44,8 @@
# include <scribo/core/component_set.hh>
# include <scribo/core/object_links.hh>
+# include <scribo/core/concept/dmax_functor.hh>
+
# include <scribo/primitive/link/internal/compute_anchor.hh>
# include <scribo/primitive/link/internal/find_link.hh>
# include <scribo/primitive/link/internal/link_functor_base.hh>
@@ -65,9 +68,9 @@ namespace scribo
/// \brief Base class for link functors using bounding box
/// center and a proportional max distance.
//
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
class link_single_dmax_ratio_base
- : public link_functor_base<L, E>
+ : public link_functor_base<L,E>
{
typedef link_functor_base<L,E> super_;
typedef mln_result(accu::center<mln_psite(L)>) ms_t;
@@ -76,10 +79,9 @@ namespace scribo
typedef mln_site(L) P;
-
link_single_dmax_ratio_base(const component_set<L>& components,
- float dmax_ratio,
- anchor::Direction direction);
+ anchor::Direction direction,
+ const DMax_Functor<F>& dmax_f);
@@ -91,8 +93,8 @@ namespace scribo
void start_processing_object_(unsigned current_object);
- private:
- float dmax_ratio_;
+ protected:
+ const F dmax_f_;
float dmax_;
anchor::Direction direction_;
};
@@ -101,24 +103,24 @@ namespace scribo
# ifndef MLN_INCLUDE_ONLY
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
- link_single_dmax_ratio_base<L, E>::link_single_dmax_ratio_base(
+ link_single_dmax_ratio_base<L, F, E>::link_single_dmax_ratio_base(
const component_set<L>& components,
- float dmax_ratio,
- anchor::Direction direction)
+ anchor::Direction direction,
+ const DMax_Functor<F>& dmax_f)
- : super_(components),
- dmax_ratio_(dmax_ratio),
+ : super_(components),
+ dmax_f_(exact(dmax_f)),
dmax_(0),
direction_(direction)
{
}
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
bool
- link_single_dmax_ratio_base<L, E>::verify_link_criterion_(
+ link_single_dmax_ratio_base<L, F, E>::verify_link_criterion_(
unsigned current_object,
const P& start_point,
const P& p) const
@@ -130,10 +132,10 @@ namespace scribo
}
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
mln_site(L)
- link_single_dmax_ratio_base<L, E>::start_point_(unsigned current_object,
+ link_single_dmax_ratio_base<L, F, E>::start_point_(unsigned current_object,
anchor::Type anchor)
{
(void) anchor;
@@ -142,18 +144,33 @@ namespace scribo
}
- template <typename L, typename E>
+ template <typename L, typename F, typename E>
inline
void
- link_single_dmax_ratio_base<L, E>::start_processing_object_(
+ link_single_dmax_ratio_base<L, F, E>::start_processing_object_(
unsigned current_object)
{
- float
- w = this->components_.info(current_object).bbox().width(),
- h = this->components_.info(current_object).bbox().height();
-// dmax_ = (w / 2.0f) + (dmax_ratio_ * math::max(w, h));
-// dmax_ = (w / 2.0f) + (dmax_ratio_ * w);
- dmax_ = (w / 2.0f) + (h + w);
+ dmax_ = dmax_f_(this->components_.info(current_object).bbox());
+
+
+// float
+// w = this->components_.info(current_object).bbox().width();
+// // h = this->components_.info(current_object).bbox().height();
+
+// // FIXME: default case
+// // dmax_ = (w / 2.0f) + (dmax_ratio_ * math::max(w, h));
+
+// // FIXME: to use for paragraph alignment
+// dmax_ = (w / 2.0f) + (dmax_ratio_ * w);
+
+ // FIXME: to use for newspapers like ICDAR documents!
+// dmax_ = (w / 2.0f) + (h + w);
+
+ // FIXME: more general use case for newspapers
+// dmax_ = (w / 2.0f) + dmax_ratio_ * (h + w);
+
+
+ // FIXME: WE WANT TO PROVIDE A DMAX RULE THROUGH A FUNCTOR.
}
diff --git a/scribo/primitive/link/with_single_left_link_dmax_ratio.hh b/scribo/primitive/link/with_single_left_link_dmax_ratio.hh
index 8be4ae2..dc99728 100644
--- a/scribo/primitive/link/with_single_left_link_dmax_ratio.hh
+++ b/scribo/primitive/link/with_single_left_link_dmax_ratio.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -40,10 +41,12 @@
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/concept/dmax_functor.hh>
# include <scribo/core/component_set.hh>
# include <scribo/core/object_links.hh>
# include <scribo/primitive/link/internal/find_link.hh>
+# include <scribo/primitive/link/internal/dmax_default.hh>
# include <scribo/primitive/link/internal/link_single_dmax_ratio_base.hh>
# include <scribo/primitive/link/compute.hh>
@@ -60,19 +63,38 @@ namespace scribo
/*! \brief Link components with their left neighbor if exists.
- \param[in] components An component image.
- \param[in] dmax_ratio
+ \param[in] components A component set.
+ \param[in] anchor Starting point for the neighbor lookup.
+ \param[in] dmax_f DMax functor defining the maximum lookup
+ distance.
\return Object links data.
+ Look for a neighbor until a maximum distance is reached. The
+ maximum distance is defined thanks to a functor \p dmax_f.
+ */
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor);
- Look for a neighbor until a maximum distance defined by :
-
- dmax = w / 2 + dmax_ratio * max(h, w)
+ /// \overload
+ ///
+ /// The default dmax functor is used (internal::dmax_default).
+ //
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio,
+ anchor::Type anchor);
- where w is the bounding box width and h the bounding box height.
- */
+ /// \overload
+ /// anchor is set to anchor::MassCenter.
+ //
template <typename L>
inline
object_links<L>
@@ -81,14 +103,18 @@ namespace scribo
/// \overload
- /// dmax_ratio is set to 3.
- template <typename L>
+ ///
+ /// The default dmax functor is used (internal::dmax_default)
+ /// with dmax_ratio set to 3.
+ ///
+ /// anchor is set to anchor::MassCenter.
+ //
+ template <typename L, typename F>
inline
object_links<L>
with_single_left_link_dmax_ratio(const component_set<L>& components);
-
# ifndef MLN_INCLUDE_ONLY
@@ -97,20 +123,20 @@ namespace scribo
// Functor
- template <typename L>
+ template <typename L, typename F>
class single_left_dmax_ratio_functor
- : public internal::link_single_dmax_ratio_base<L,
- single_left_dmax_ratio_functor<L> >
+ : public internal::link_single_dmax_ratio_base<L, F,
+ single_left_dmax_ratio_functor<L, F> >
{
- typedef single_left_dmax_ratio_functor<L> self_t;
- typedef internal::link_single_dmax_ratio_base<L, self_t> super_;
+ typedef single_left_dmax_ratio_functor<L, F> self_t;
+ typedef internal::link_single_dmax_ratio_base<L, F, self_t> super_;
public:
typedef mln_site(L) P;
single_left_dmax_ratio_functor(const component_set<L>& components,
- unsigned dmax)
- : super_(components, dmax, anchor::Horizontal)
+ const DMax_Functor<F>& dmax_f)
+ : super_(components, anchor::Horizontal, exact(dmax_f))
{
}
@@ -127,26 +153,54 @@ namespace scribo
// Facades
- template <typename L>
+ template <typename L, typename F>
inline
object_links<L>
with_single_left_link_dmax_ratio(const component_set<L>& components,
- float dmax_ratio)
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor)
{
trace::entering("scribo::primitive::link::with_single_left_link_dmax_ratio");
mln_precondition(components.is_valid());
- internal::single_left_dmax_ratio_functor<L>
- functor(components, dmax_ratio);
+ internal::single_left_dmax_ratio_functor<L, F>
+ functor(components, dmax_f);
- object_links<L> output = compute(functor);
+ object_links<L> output = compute(functor, anchor);
trace::exiting("scribo::primitive::link::with_single_left_link_dmax_ratio");
return output;
}
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio,
+ anchor::Type anchor)
+ {
+ return
+ with_single_left_link_dmax_ratio(components,
+ internal::dmax_default(dmax_ratio),
+ anchor);
+ }
+
+
+ template <typename L>
+ inline
+ object_links<L>
+ with_single_left_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio)
+ {
+ return
+ with_single_left_link_dmax_ratio(components,
+ internal::dmax_default(dmax_ratio),
+ anchor::MassCenter);
+ }
+
+
template <typename L>
inline
object_links<L>
diff --git a/scribo/primitive/link/with_single_right_link_dmax_ratio.hh b/scribo/primitive/link/with_single_right_link_dmax_ratio.hh
index d3637ef..dea51d1 100644
--- a/scribo/primitive/link/with_single_right_link_dmax_ratio.hh
+++ b/scribo/primitive/link/with_single_right_link_dmax_ratio.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -61,25 +62,32 @@ namespace scribo
/*! \brief Link objects with their right neighbor if exists.
\param[in] components A component set.
- \param[in] dmax_ratio Size ratio defining the maximum lookup
- distance.
\param[in] anchor Starting point for the neighbor lookup.
+ \param[in] dmax_f DMax functor defining the maximum lookup
+ distance.
\return Object links data.
- Look for a neighbor until a maximum distance defined by :
-
- dmax = w / 2 + dmax_ratio * max(h, w)
+ Look for a neighbor until a maximum distance is reached. The
+ maximum distance is defined thanks to a functor \p dmax_f.
+ */
+ template <typename L, typename F>
+ inline
+ object_links<L>
+ with_single_right_link_dmax_ratio(const component_set<L>& components,
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor);
- where w is the bounding box width and h the bounding box height.
- */
+ /// \overload
+ /// \p dmax_f is set to internal::dmax_default.
template <typename L>
inline
object_links<L>
with_single_right_link_dmax_ratio(const component_set<L>& components,
- float dmax_ratio, anchor::Type anchor);
+ float dmax_ratio,
+ anchor::Type anchor);
/// \overload
/// anchor is set to MassCenter.
@@ -108,20 +116,20 @@ namespace scribo
// Functor
- template <typename L>
+ template <typename L, typename F>
class single_right_dmax_ratio_functor
- : public link_single_dmax_ratio_base<L,
- single_right_dmax_ratio_functor<L> >
+ : public link_single_dmax_ratio_base<L, F,
+ single_right_dmax_ratio_functor<L,F> >
{
- typedef single_right_dmax_ratio_functor<L> self_t;
- typedef link_single_dmax_ratio_base<L, self_t> super_;
+ typedef single_right_dmax_ratio_functor<L, F> self_t;
+ typedef link_single_dmax_ratio_base<L, F, self_t> super_;
public:
typedef mln_site(L) P;
single_right_dmax_ratio_functor(const component_set<L>& components,
- unsigned dmax)
- : super_(components, dmax, anchor::Horizontal)
+ const DMax_Functor<F>& dmax_f)
+ : super_(components, anchor::Horizontal, exact(dmax_f))
{
}
@@ -139,18 +147,19 @@ namespace scribo
// Facades
- template <typename L>
+ template <typename L, typename F>
inline
object_links<L>
with_single_right_link_dmax_ratio(const component_set<L>& components,
- float dmax_ratio, anchor::Type anchor)
+ const DMax_Functor<F>& dmax_f,
+ anchor::Type anchor)
{
trace::entering("scribo::primitive::link::with_single_right_link_dmax_ratio");
mln_precondition(components.is_valid());
- internal::single_right_dmax_ratio_functor<L>
- functor(components, dmax_ratio);
+ internal::single_right_dmax_ratio_functor<L, F>
+ functor(components, dmax_f);
object_links<L> output = compute(functor, anchor);
@@ -158,6 +167,19 @@ namespace scribo
return output;
}
+ template <typename L>
+ inline
+ object_links<L>
+ with_single_right_link_dmax_ratio(const component_set<L>& components,
+ float dmax_ratio,
+ anchor::Type anchor)
+ {
+ return
+ with_single_right_link_dmax_ratio(components,
+ internal::dmax_default(dmax_ratio),
+ anchor);
+ }
+
template <typename L>
@@ -166,7 +188,8 @@ namespace scribo
with_single_right_link_dmax_ratio(const component_set<L>& components,
float dmax_ratio)
{
- return with_single_right_link_dmax_ratio(components, dmax_ratio,
+ return with_single_right_link_dmax_ratio(components,
+ dmax_ratio,
anchor::MassCenter);
}
--
1.5.6.5
1
0
* binarization/sauvola_ms.hh,
* binarization/sauvola_threshold_image_debug.hh: Update prototypes.
* primitive/internal/rd.hh,
* primitive/group/apply.hh,
* debug/save_bboxes_image.hh: Add missing mln:: namespace prefix.
* filter/objects_large.hh: Split into a routine and a functor.
* fun/v2b/objects_large_filter.hh: New.
* io/xml/save_text_lines.hh: Save line type.
* table/internal/repair_lines.hh,
* table/internal/align_lines.hh,
* make/text.hh: Update macro name.
* core/erase_objects.hh,
* primitive/extract/lines_discontinued.hh,
* primitive/extract/lines_h_discontinued.hh,
* primitive/extract/lines_h_pattern.hh,
* primitive/extract/lines_h_single.hh,
* primitive/extract/lines_h_thick.hh,
* primitive/extract/lines_thick.hh,
* primitive/extract/lines_v_discontinued.hh,
* primitive/extract/lines_v_single.hh,
* primitive/extract/lines_v_thick.hh,
* primitive/group/from_graph.hh,
* primitive/internal/find_graph_link.hh,
* primitive/link/with_graph.hh,
* primitive/link/with_several_graphes.hh,
* primitive/link/with_several_left_links.hh,
* primitive/link/with_several_right_links.hh,
* table/erase.hh,
* table/extract.hh: Remove any references to object_image.
* table/internal/connect_lines.hh: use
influence_zone_geodesic_saturated
* filter/objects_small.hh: Duplicate component set.
* primitive/internal/all.hh,
* primitive/extract/all.hh,
* filter/all.hh,
* core/all.hh: Remove non existing includes.
* core/macros.hh: New macro.
* core/line_info.hh: Fix stats.
* filter/object_links_non_aligned.hh,
* filter/object_links_non_h_aligned.hh,
* filter/object_links_non_v_aligned.hh: Removed.
---
scribo/ChangeLog | 58 ++++++++
scribo/binarization/sauvola_ms.hh | 6 +-
.../binarization/sauvola_threshold_image_debug.hh | 44 +++---
scribo/core/all.hh | 4 +-
scribo/core/erase_objects.hh | 13 +-
scribo/core/line_info.hh | 2 +-
scribo/core/macros.hh | 3 +
scribo/debug/save_bboxes_image.hh | 6 +-
scribo/filter/all.hh | 3 -
scribo/filter/object_links_non_aligned.hh | 138 --------------------
scribo/filter/object_links_non_h_aligned.hh | 109 ---------------
scribo/filter/object_links_non_v_aligned.hh | 122 -----------------
scribo/filter/objects_large.hh | 130 +++----------------
scribo/filter/objects_small.hh | 2 +-
...cts_small_filter.hh => objects_large_filter.hh} | 36 +++---
scribo/io/xml/save_text_lines.hh | 1 +
scribo/make/text.hh | 2 +-
scribo/primitive/extract/all.hh | 5 +-
scribo/primitive/extract/lines_discontinued.hh | 14 +-
scribo/primitive/extract/lines_h_discontinued.hh | 10 +-
scribo/primitive/extract/lines_h_pattern.hh | 39 +++---
scribo/primitive/extract/lines_h_single.hh | 47 ++++----
scribo/primitive/extract/lines_h_thick.hh | 8 +-
scribo/primitive/extract/lines_thick.hh | 11 +-
scribo/primitive/extract/lines_v_discontinued.hh | 10 +-
scribo/primitive/extract/lines_v_single.hh | 47 +++----
scribo/primitive/extract/lines_v_thick.hh | 14 +-
scribo/primitive/group/apply.hh | 4 +-
scribo/primitive/group/from_graph.hh | 1 -
scribo/primitive/internal/all.hh | 3 -
scribo/primitive/internal/find_graph_link.hh | 1 -
scribo/primitive/internal/rd.hh | 2 +-
scribo/primitive/link/with_graph.hh | 2 -
scribo/primitive/link/with_several_graphes.hh | 6 +-
scribo/primitive/link/with_several_left_links.hh | 2 -
scribo/primitive/link/with_several_right_links.hh | 3 -
scribo/table/erase.hh | 10 +-
scribo/table/extract.hh | 3 +-
scribo/table/internal/align_lines.hh | 2 +-
scribo/table/internal/connect_lines.hh | 7 +-
scribo/table/internal/repair_lines.hh | 2 +-
41 files changed, 255 insertions(+), 677 deletions(-)
delete mode 100644 scribo/filter/object_links_non_aligned.hh
delete mode 100644 scribo/filter/object_links_non_h_aligned.hh
delete mode 100644 scribo/filter/object_links_non_v_aligned.hh
copy scribo/fun/v2b/{objects_small_filter.hh => objects_large_filter.hh} (74%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index a36b5e1..0408bf3 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,61 @@
+2010-04-30 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Small fixes in Scribo.
+
+ * binarization/sauvola_ms.hh,
+ * binarization/sauvola_threshold_image_debug.hh: Update prototypes.
+
+ * primitive/internal/rd.hh,
+ * primitive/group/apply.hh,
+ * debug/save_bboxes_image.hh: Add missing mln:: namespace prefix.
+
+ * filter/objects_large.hh: Split into a routine and a functor.
+
+ * fun/v2b/objects_large_filter.hh: New.
+
+ * io/xml/save_text_lines.hh: Save line type.
+
+ * table/internal/repair_lines.hh,
+ * table/internal/align_lines.hh,
+ * make/text.hh: Update macro name.
+
+ * core/erase_objects.hh,
+ * primitive/extract/lines_discontinued.hh,
+ * primitive/extract/lines_h_discontinued.hh,
+ * primitive/extract/lines_h_pattern.hh,
+ * primitive/extract/lines_h_single.hh,
+ * primitive/extract/lines_h_thick.hh,
+ * primitive/extract/lines_thick.hh,
+ * primitive/extract/lines_v_discontinued.hh,
+ * primitive/extract/lines_v_single.hh,
+ * primitive/extract/lines_v_thick.hh,
+ * primitive/group/from_graph.hh,
+ * primitive/internal/find_graph_link.hh,
+ * primitive/link/with_graph.hh,
+ * primitive/link/with_several_graphes.hh,
+ * primitive/link/with_several_left_links.hh,
+ * primitive/link/with_several_right_links.hh,
+ * table/erase.hh,
+ * table/extract.hh: Remove any references to object_image.
+
+ * table/internal/connect_lines.hh: use
+ influence_zone_geodesic_saturated
+
+ * filter/objects_small.hh: Duplicate component set.
+
+ * primitive/internal/all.hh,
+ * primitive/extract/all.hh,
+ * filter/all.hh,
+ * core/all.hh: Remove non existing includes.
+
+ * core/macros.hh: New macro.
+
+ * core/line_info.hh: Fix stats.
+
+ * filter/object_links_non_aligned.hh,
+ * filter/object_links_non_h_aligned.hh,
+ * filter/object_links_non_v_aligned.hh: Removed.
+
2010-03-19 Guillaume Lazzara <z(a)lrde.epita.fr>
Improve dematerialization wizard.
diff --git a/scribo/binarization/sauvola_ms.hh b/scribo/binarization/sauvola_ms.hh
index 6e70e04..621c638 100644
--- a/scribo/binarization/sauvola_ms.hh
+++ b/scribo/binarization/sauvola_ms.hh
@@ -94,16 +94,14 @@ namespace scribo
*/
template <typename I>
mln_ch_value(I,bool)
- sauvola_ms(const Image<I>& input_1_, unsigned w_1,
- unsigned s, unsigned lambda_min_1, double K);
+ sauvola_ms(const Image<I>& input_1_, unsigned w_1, unsigned s, double K);
/// \overload
/// K is set to 0.34.
//
template <typename I>
mln_ch_value(I,bool)
- sauvola_ms(const Image<I>& input_1, unsigned w_1,
- unsigned s, unsigned lambda_min_1);
+ sauvola_ms(const Image<I>& input_1, unsigned w_1, unsigned s);
diff --git a/scribo/binarization/sauvola_threshold_image_debug.hh b/scribo/binarization/sauvola_threshold_image_debug.hh
index 18216a6..359bb57 100644
--- a/scribo/binarization/sauvola_threshold_image_debug.hh
+++ b/scribo/binarization/sauvola_threshold_image_debug.hh
@@ -123,10 +123,10 @@ namespace scribo
\return A threshold.
*/
- template <typename P, typename I, typename J>
+ template <typename P, typename M, typename J>
double
compute_sauvola_threshold(const P& p,
- I& mean, I& stddev,
+ M& mean, M& stddev,
const J& simple,
const J& squared,
int win_width, double K, double R)
@@ -156,7 +156,7 @@ namespace scribo
double m_x_y = m_x_y_tmp / wh;
- mean(p) = m_x_y * mean_debug_factor;
+ mean(p) = m_x_y;// * mean_debug_factor;
// Standard deviation.
double s_x_y_tmp = (squared.at_(row_max, col_max)
@@ -166,7 +166,7 @@ namespace scribo
double s_x_y = std::sqrt((s_x_y_tmp - (m_x_y_tmp * m_x_y_tmp) / wh) / (wh - 1.f));
- stddev(p) = s_x_y * stddev_debug_factor;
+ stddev(p) = s_x_y;// * stddev_debug_factor;
// Thresholding.
double t_x_y = sauvola_threshold_formula(m_x_y, s_x_y, K, R);
@@ -198,21 +198,21 @@ namespace scribo
namespace generic
{
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_concrete(I)
sauvola_threshold_image_debug(const Image<I>& input_,
unsigned window_size,
double K,
- Image<I>& mean_, Image<I>& stddev_,
+ Image<M>& mean_, Image<M>& stddev_,
Image<J>& simple_,
Image<J>& squared_)
{
trace::entering("scribo::binarization::impl::generic::sauvola_threshold_image_debug");
const I& input = exact(input_);
- I& mean = exact(mean_);
- I& stddev = exact(stddev_);
+ M& mean = exact(mean_);
+ M& stddev = exact(stddev_);
J& simple = exact(simple_);
J& squared = exact(squared_);
@@ -248,13 +248,13 @@ namespace scribo
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_concrete(I)
sauvola_threshold_image_debug_gl(const Image<I>& input,
unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev,
+ Image<M>& mean, Image<M>& stddev,
Image<J>& simple,
Image<J>& squared)
{
@@ -265,13 +265,13 @@ namespace scribo
}
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug_rgb8(const Image<I>& input,
unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev,
+ Image<M>& mean, Image<M>& stddev,
Image<J>& simple,
Image<J>& squared)
{
@@ -302,14 +302,14 @@ namespace scribo
namespace internal
{
- template <unsigned n, typename I, typename J>
+ template <unsigned n, typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u<n>)
sauvola_threshold_image_debug_dispatch(const value::int_u<n>&,
const I& input,
unsigned window_size,
double K,
- I& mean, I& stddev,
+ M& mean, M& stddev,
J& simple,
J& squared)
{
@@ -318,13 +318,13 @@ namespace scribo
simple, squared);
}
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug_dispatch(const value::rgb8&, const I& input,
unsigned window_size,
double K,
- I& mean, I& stddev,
+ M& mean, M& stddev,
J& simple,
J& squared)
{
@@ -333,11 +333,11 @@ namespace scribo
simple, squared);
}
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug_dispatch(const mln_value(I)&, const I& input,
- I& mean, I& stddev,
+ M& mean, M& stddev,
unsigned window_size,
double K,
J& simple,
@@ -355,11 +355,11 @@ namespace scribo
- template <typename I, typename J>
+ template <typename I, typename M, typename J>
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug(const Image<I>& input, unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev,
+ Image<M>& mean, Image<M>& stddev,
Image<J>& simple,
Image<J>& squared)
{
@@ -384,12 +384,12 @@ namespace scribo
}
- template <typename I>
+ template <typename I, typename M>
inline
mln_ch_value(I, value::int_u8)
sauvola_threshold_image_debug(const Image<I>& input, unsigned window_size,
double K,
- Image<I>& mean, Image<I>& stddev)
+ Image<M>& mean, Image<M>& stddev)
{
mln_ch_value(I, double)
simple = init_integral_image(input, scribo::internal::identity_),
diff --git a/scribo/core/all.hh b/scribo/core/all.hh
index b98bf04..d00ccf8 100644
--- a/scribo/core/all.hh
+++ b/scribo/core/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -44,6 +45,5 @@ namespace scribo
#include <scribo/core/central_sites.hh>
#include <scribo/core/erase_objects.hh>
#include <scribo/core/macros.hh>
-#include <scribo/core/object_image.hh>
#endif // ! SCRIBO_CORE_ALL_HH
diff --git a/scribo/core/erase_objects.hh b/scribo/core/erase_objects.hh
index 59a1346..3e401f0 100644
--- a/scribo/core/erase_objects.hh
+++ b/scribo/core/erase_objects.hh
@@ -32,12 +32,11 @@
# include <mln/core/concept/image.hh>
# include <mln/core/site_set/box.hh>
-# include <mln/data/paste.hh>
+# include <mln/data/fill.hh>
# include <mln/pw/all.hh>
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
namespace scribo
{
@@ -47,14 +46,13 @@ namespace scribo
/// Remove labeled components from a binary image.
///
/// \param[in,out] input_ A binary image.
- /// \param[in] objects An object image. Objects will be set to
- /// false in \p input_.
+ /// \param[in] objects An image of objects (object value must be
+ /// different from 0).
///
//
template <typename I, typename L>
void
- erase_objects(Image<I>& input_,
- const object_image(L)& objects);
+ erase_objects(Image<I>& input, const Image<L>& objects);
# ifndef MLN_INCLUDE_ONLY
@@ -63,13 +61,14 @@ namespace scribo
template <typename I, typename L>
void
erase_objects(Image<I>& input_,
- const object_image(L)& objects)
+ const Image<L>& objects_)
{
trace::entering("scribo::erase_objects");
mlc_equal(mln_value(I),bool)::check();
I& input = exact(input_);
+ I& objects = exact(objects_);
mln_precondition(input.is_valid());
mln_precondition(objects.is_valid());
diff --git a/scribo/core/line_info.hh b/scribo/core/line_info.hh
index 0445f85..9ecf600 100644
--- a/scribo/core/line_info.hh
+++ b/scribo/core/line_info.hh
@@ -795,7 +795,7 @@ namespace scribo
// Space between characters.
int space = bb.pmin().col()
- - comp_set(holder_.links()(c)).bbox().pmax().col();
+ - comp_set(holder_.links()(c)).bbox().pmax().col() + 1;
// -- Ignore overlapped characters.
if (space > 0)
diff --git a/scribo/core/macros.hh b/scribo/core/macros.hh
index f644db3..040220c 100644
--- a/scribo/core/macros.hh
+++ b/scribo/core/macros.hh
@@ -52,6 +52,9 @@
# define for_all_lines(E, S) \
for_all_comps(E, S)
+# define for_all_line_comps(E, S) \
+ for_all_elements(E, S)
+
# define for_all_lines_info(E, S) \
for_all_comp_data(E, S)
diff --git a/scribo/debug/save_bboxes_image.hh b/scribo/debug/save_bboxes_image.hh
index f2c34e8..356ea6e 100644
--- a/scribo/debug/save_bboxes_image.hh
+++ b/scribo/debug/save_bboxes_image.hh
@@ -35,6 +35,7 @@
# include <mln/value/rgb8.hh>
# include <mln/util/array.hh>
# include <mln/io/ppm/save.hh>
+# include <mln/literal/colors.hh>
# include <scribo/core/line_set.hh>
# include <scribo/draw/bounding_boxes.hh>
@@ -108,13 +109,14 @@ namespace scribo
trace::entering("scribo::debug::save_bboxes_image");
mln_precondition(exact(input).is_valid());
- image2d<value::rgb8> output = data::convert(value::rgb8(), input);
+ mln_ch_value(I, value::rgb8)
+ output = data::convert(value::rgb8(), input);
for_all_lines(l, lines)
if (! lines(l).hidden())
mln::draw::box(output, lines(l).bbox(), value);
- io::ppm::save(output, filename);
+ mln::io::ppm::save(output, filename);
trace::exiting("scribo::debug::save_bboxes_image");
}
diff --git a/scribo/filter/all.hh b/scribo/filter/all.hh
index f9ef9ce..0b5bc11 100644
--- a/scribo/filter/all.hh
+++ b/scribo/filter/all.hh
@@ -42,9 +42,6 @@ namespace scribo
} // end of namespace scribo
# include <scribo/filter/object_groups_small.hh>
-# include <scribo/filter/object_links_non_aligned.hh>
-# include <scribo/filter/object_links_non_h_aligned.hh>
-# include <scribo/filter/object_links_non_v_aligned.hh>
# include <scribo/filter/objects_large.hh>
# include <scribo/filter/objects_small.hh>
# include <scribo/filter/objects_thick.hh>
diff --git a/scribo/filter/object_links_non_aligned.hh b/scribo/filter/object_links_non_aligned.hh
deleted file mode 100644
index b81a0ab..0000000
--- a/scribo/filter/object_links_non_aligned.hh
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright (C) 2009 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_FILTER_OBJECT_LINKS_NON_ALIGNED_HH
-# define SCRIBO_FILTER_OBJECT_LINKS_NON_ALIGNED_HH
-
-/// \file
-///
-/// Invalidate links between two non aligned objects.
-
-
-# include <mln/math/abs.hh>
-# include <mln/util/array.hh>
-
-# include <scribo/core/macros.hh>
-# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
-
-namespace scribo
-{
-
- namespace filter
- {
-
- using namespace mln;
-
- /*! \brief Invalidate links between two non aligned objects.
- Alignment is based on object bounding boxes.
-
- \param[in] objects An object image.
- \param[in] links Object links information.
- \param[in] dim Choose the dimension on which applying the
- filter.
- \param[in] max_delta Maximum delta.
-
-
- Exemple with dim == 1 (horizontal filter):
-
- \verbatim
- v
- ------ ~ ~ ~
- | | |\
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ \
- | | | | ^ \
- | x------------x | => delta, must be < to max_delta
- | | | | v /
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ /
- object1 | | |/
- ------ ~ ~ ~
- object2 ^
-
- \endverbatim
-
- */
- template <typename L>
- object_links<L>
- object_links_non_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- unsigned dim,
- unsigned max_delta);
-
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename L>
- object_links<L>
- object_links_non_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- unsigned dim,
- unsigned max_delta)
- {
- trace::entering("scribo::filter::object_links_non_aligned");
-
- mln_precondition(objects.is_valid());
-
-
- typedef typename object_image(L)::bbox_t bbox_t;
- const mln::util::array<bbox_t>& bboxes = objects.bboxes();
- object_links<L> output(links);
-
- for_all_components(i, objects.bboxes())
- if (links[i] != i)
- {
- unsigned
- lnbh = bboxes(links[i]).pmax()[dim] - bboxes(links[i]).pmin()[dim],
- lcurrent = bboxes(i).pmax()[dim] - bboxes(i).pmin()[dim],
- hmin = i,
- hmax = links[i];
-
- if (lnbh < lcurrent)
- {
- hmin = links[i];
- hmax = i;
- }
-
- if (static_cast<unsigned>(math::abs((bboxes[hmin].pmin()[dim] - bboxes[hmax].pmin()[dim]))) > max_delta
- || static_cast<unsigned>(math::abs((bboxes[hmin].pmax()[dim] - bboxes[hmax].pmax()[dim]))) > max_delta)
- output[i] = i;
-
- }
-
- trace::exiting("scribo::filter::object_links_non_aligned");
- return output;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-
- } // end of namespace scribo::filter
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_FILTER_OBJECT_LINKS_NON_ALIGNED_HH
diff --git a/scribo/filter/object_links_non_h_aligned.hh b/scribo/filter/object_links_non_h_aligned.hh
deleted file mode 100644
index 8216316..0000000
--- a/scribo/filter/object_links_non_h_aligned.hh
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (C) 2009 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_FILTER_OBJECT_LINKS_NON_H_ALIGNED_HH
-# define SCRIBO_FILTER_OBJECT_LINKS_NON_H_ALIGNED_HH
-
-/// \file
-///
-/// Invalidate links between two non horizontaly aligned objects.
-
-
-# include <mln/util/array.hh>
-
-# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/filter/object_links_non_aligned.hh>
-
-namespace scribo
-{
-
- namespace filter
- {
-
- using namespace mln;
-
-
- /*! \brief Invalidate links between two non horizontaly aligned objects.
- Alignment is based on object bounding boxes.
-
- \param[in] objects An object image.
- \param[in] links Object links information.
- \param[in] max_delta Maximum delta.
-
- \result Filtered object links data.
-
- \verbatim
- v
- ------ ~ ~ ~
- | | |\
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ \
- | | | | ^ \
- | x- - - - - --x | => delta, must be < to max_delta
- | | | | v /
- ------ ~ ~ ~ |~ ~ | ~ ~ ~ /
- object1 | | |/
- ------ ~ ~ ~
- object2 ^
-
- \endverbatim
-
-
- */
- template <typename L>
- object_links<L>
- object_links_non_h_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float max_delta);
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename L>
- object_links<L>
- object_links_non_h_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float max_delta)
- {
- trace::entering("scribo::filter::object_links_non_h_aligned");
-
- mln_precondition(objects.is_valid());
-
- object_links<L>
- output = object_links_non_aligned(objects, links, 0, max_delta);
-
- trace::exiting("scribo::filter::object_links_non_h_aligned");
- return output;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
- } // end of namespace scribo::filter
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_FILTER_OBJECT_LINKS_NON_H_ALIGNED_HH
diff --git a/scribo/filter/object_links_non_v_aligned.hh b/scribo/filter/object_links_non_v_aligned.hh
deleted file mode 100644
index bd2aeee..0000000
--- a/scribo/filter/object_links_non_v_aligned.hh
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright (C) 2009 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_FILTER_OBJECT_LINKS_NON_V_ALIGNED_HH
-# define SCRIBO_FILTER_OBJECT_LINKS_NON_V_ALIGNED_HH
-
-/// \file
-///
-/// Invalidate links between two non verticaly aligned objects.
-
-
-# include <mln/util/array.hh>
-
-# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/filter/object_links_non_aligned.hh>
-
-namespace scribo
-{
-
- namespace filter
- {
-
- using namespace mln;
-
- /*! \brief Invalidate links between two non verticaly aligned objects.
- Alignment is based on object bounding boxes.
-
- \param[in] objects An object image.
- \param[in] links Object links information.
- \param[in] max_delta Maximum delta.
-
-
- \verbatim
-
- delta (must be < to max_delta)
- /\
- / \
- / \
- >:-:<>:-:<
- : :
- : :
- : ---:--
- | |
- : | x: | object1
- | | |
- : --|:--
-
- : |:
-
- : |:
- -- ---
- | ||
- | |
- | ||
- | x| object2
- | |
- | |
- | |
- ------
-
- \endverbatim
-
- */
- template <typename L>
- object_links<L>
- object_links_non_v_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float ratio);
-
-# ifndef MLN_INCLUDE_ONLY
-
-
- template <typename L>
- object_links<L>
- object_links_non_v_aligned(const object_image(L)& objects,
- const object_links<L>& links,
- float ratio)
- {
- trace::entering("scribo::object_links::object_links_non_v_aligned");
-
- mln_precondition(objects.is_valid());
-
- object_links<L>
- output = object_links_non_aligned(objects, links, 0, ratio);
-
- trace::exiting("scribo::filter::object_links_non_v_aligned");
- return output;
- }
-
-
-# endif // ! MLN_INCLUDE_ONLY
-
-
- } // end of namespace scribo::filter
-
-} // end of namespace scribo
-
-
-#endif // ! SCRIBO_FILTER_OBJECT_LINKS_NON_V_ALIGNED_HH
diff --git a/scribo/filter/objects_large.hh b/scribo/filter/objects_large.hh
index dfef95c..81986e4 100644
--- a/scribo/filter/objects_large.hh
+++ b/scribo/filter/objects_large.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -23,8 +24,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FILTER_OBJECTS_LARGE_HH
-# define SCRIBO_FILTER_OBJECTS_LARGE_HH
+#ifndef SCRIBO_FILTER_COMPONENTS_LARGE_HH
+# define SCRIBO_FILTER_COMPONENTS_LARGE_HH
/// \file
///
@@ -42,8 +43,9 @@
# include <mln/pw/all.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/core/component_set.hh>
+# include <scribo/primitive/extract/components.hh>
+# include <scribo/fun/v2b/objects_large_filter.hh>
namespace scribo
{
@@ -65,134 +67,40 @@ namespace scribo
/// \return A binary image without large objects.
template <typename I, typename N, typename V>
mln_concrete(I)
- objects_large(const Image<I>& input_,
+ components_large(const Image<I>& input_,
const Neighborhood<N>& nbh_,
const V& label_type,
unsigned max_size);
- /// Remove too large text objects.
- ///
- /// \param[in] objects An object image.
- /// \param[in] max_size The minimum cardinality of an object.
- ///
- /// \return updated text data.
- template <typename L>
- object_image(L)
- objects_large(const object_image(L)& objects,
- unsigned max_size);
-
-
# ifndef MLN_INCLUDE_ONLY
- namespace internal
- {
-
-
- /// Filter Functor.
- /// Return false for all objects which are too large.
- template <typename L>
- struct objects_large_filter
- : Function_v2b< objects_large_filter<L> >
- {
-
- typedef accu::math::count<mln_psite(L)> card_t;
-
- /// Constructor
- ///
- /// \param[in] compbboxes Component bounding boxes.
- /// \param[in] max_size Maximum object size.
- objects_large_filter(const object_image(L)& objects,
- unsigned max_size)
- {
- card_ = labeling::compute(card_t(), objects, objects.nlabels());
- max_size_ = max_size;
- }
-
-
- /// Check if the object is large enough.
- ///
- /// \param l A label.
- ///
- /// \return false if the object area is strictly inferior to
- /// \p max_size_.
- bool operator()(const mln_value(L)& l) const
- {
- if (l == literal::zero)
- return true;
- return card_[l] <= max_size_;
- }
-
-
- /// The object bounding boxes.
- mln::util::array<mln_result(card_t)> card_;
- /// The maximum area.
- unsigned max_size_;
- };
-
-
- } // end of namespace scribo::filter::internal
-
-
-
- template <typename I, typename N, typename V>
- inline
- mln_concrete(I)
- objects_large(const Image<I>& input_,
- const Neighborhood<N>& nbh_,
- const V& label_type,
- unsigned max_size)
- {
- trace::entering("scribo::filter::objects_large");
-
- const I& input = exact(input_);
- const N& nbh = exact(nbh_);
-
- mln_precondition(input.is_valid());
- mln_precondition(nbh.is_valid());
-
- V nlabels;
- typedef object_image(mln_ch_value(I,V)) lbl_t;
- lbl_t lbl = primitive::extract::objects(input, nbh, nlabels);
-
- typedef internal::objects_large_filter<lbl_t> func_t;
- func_t fv2b(lbl, max_size);
- labeling::relabel_inplace(lbl, nlabels, fv2b);
-
- mln_concrete(I) output = duplicate(input);
- data::fill((output | pw::value(lbl) == literal::zero).rw(), false);
-
- trace::exiting("scribo::filter::objects_large");
- return output;
- }
-
-
template <typename L>
inline
- object_image(L)
- objects_large(const object_image(L)& objects,
- unsigned max_size)
+ component_set<L>
+ components_large(const component_set<L>& components,
+ unsigned max_size)
{
- trace::entering("scribo::filter::objects_large");
+ trace::entering("scribo::filter::components_large");
- mln_precondition(objects.is_valid());
+ mln_precondition(components.is_valid());
- internal::objects_large_filter<L> f(objects, max_size);
+ fun::v2b::components_large_filter<L> f(components, max_size);
- object_image(L) output;
- output.init_from_(objects);
- output.relabel(f);
+ component_set<L> output = components.duplicate();
+ output.update_tags(f, component::Ignored);
- trace::exiting("scribo::filter::objects_large");
+ trace::exiting("scribo::filter::components_large");
return output;
}
+
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace scribo::filter
} // end of namespace scribo
-#endif // ! SCRIBO_FILTER_OBJECTS_LARGE_HH
+#endif // ! SCRIBO_FILTER_COMPONENTS_LARGE_HH
diff --git a/scribo/filter/objects_small.hh b/scribo/filter/objects_small.hh
index 31112c9..f97a79e 100644
--- a/scribo/filter/objects_small.hh
+++ b/scribo/filter/objects_small.hh
@@ -143,7 +143,7 @@ namespace scribo
fun::v2b::components_small_filter<L> f(components, min_size);
- component_set<L> output = components;
+ component_set<L> output = components.duplicate();
output.update_tags(f, component::Ignored);
trace::exiting("scribo::filter::components_small");
diff --git a/scribo/fun/v2b/objects_small_filter.hh b/scribo/fun/v2b/objects_large_filter.hh
similarity index 74%
copy from scribo/fun/v2b/objects_small_filter.hh
copy to scribo/fun/v2b/objects_large_filter.hh
index 8e0ae8a..1707c9c 100644
--- a/scribo/fun/v2b/objects_small_filter.hh
+++ b/scribo/fun/v2b/objects_large_filter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -23,12 +23,12 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef SCRIBO_FUN_V2B_COMPONENTS_SMALL_FILTER_HH
-# define SCRIBO_FUN_V2B_COMPONENTS_SMALL_FILTER_HH
+#ifndef SCRIBO_FUN_V2B_COMPONENTS_LARGE_FILTER_HH
+# define SCRIBO_FUN_V2B_COMPONENTS_LARGE_FILTER_HH
/// \file
///
-/// Remove small components in a binary image.
+/// Remove large components in a binary image.
@@ -56,20 +56,20 @@ namespace scribo
/// Filter Functor.
- /// Return false for all components which are too small.
+ /// Return false for all components which are too large.
template <typename L>
- struct components_small_filter
- : Function_v2b< components_small_filter<L> >
+ struct components_large_filter
+ : Function_v2b< components_large_filter<L> >
{
typedef accu::math::count<mln_psite(L)> card_t;
/// Constructor
///
/// \param[in] components Component bounding boxes.
- /// \param[in] min_size Minimum component size.
+ /// \param[in] max_size Maximum component size.
//
- components_small_filter(const component_set<L>& components,
- unsigned min_size);
+ components_large_filter(const component_set<L>& components,
+ unsigned max_size);
/// Check if the component is large enough.
@@ -77,12 +77,12 @@ namespace scribo
/// \param l A label.
///
/// \return false if the component area is strictly inferion to
- /// \p min_size_.
+ /// \p max_size_.
//
bool operator()(const mln_value(L)& l) const;
/// The minimum area.
- unsigned min_size_;
+ unsigned max_size_;
/// The component set to filter.
const component_set<L> components_;
@@ -96,10 +96,10 @@ namespace scribo
template <typename L>
inline
- components_small_filter<L>::components_small_filter(
+ components_large_filter<L>::components_large_filter(
const component_set<L>& components,
- unsigned min_size)
- : min_size_(min_size), components_(components)
+ unsigned max_size)
+ : max_size_(max_size), components_(components)
{
}
@@ -108,11 +108,11 @@ namespace scribo
template <typename L>
inline
bool
- components_small_filter<L>::operator()(const mln_value(L)& l) const
+ components_large_filter<L>::operator()(const mln_value(L)& l) const
{
if (l == literal::zero)
return true;
- return components_.info(l).card() >= min_size_;
+ return components_.info(l).card() <= max_size_;
}
@@ -125,4 +125,4 @@ namespace scribo
} // end of namespace scribo
-#endif // ! SCRIBO_FUN_V2B_COMPONENTS_SMALL_FILTER_HH
+#endif // ! SCRIBO_FUN_V2B_COMPONENTS_LARGE_FILTER_HH
diff --git a/scribo/io/xml/save_text_lines.hh b/scribo/io/xml/save_text_lines.hh
index 7f0fdf4..06caf58 100644
--- a/scribo/io/xml/save_text_lines.hh
+++ b/scribo/io/xml/save_text_lines.hh
@@ -104,6 +104,7 @@ namespace scribo
<< "\" txt_orientation=\"" << lines(l).orientation()
<< "\" txt_reading_orientation=\"" << lines(l).reading_orientation()
<< "\" txt_reading_direction=\"" << lines(l).reading_direction()
+ << "\" txt_text_type=\"" << lines(l).type()
<< "\" txt_reverse_video=\"" << (lines(l).reverse_video() ? "true" : "false")
<< "\" txt_indented=\"" << (lines(l).indented() ? "true" : "false")
<< "\" kerning=\"" << lines(l).char_space()
diff --git a/scribo/make/text.hh b/scribo/make/text.hh
index 7a8456b..6d10ef3 100644
--- a/scribo/make/text.hh
+++ b/scribo/make/text.hh
@@ -154,7 +154,7 @@ namespace scribo
mln::util::array< accu::shape::bbox<mln_site(L)> > tboxes(new_nbboxes.next());
mln::util::array< accu::center<mln_site(L)> > tcenters(new_nbboxes.next());
- for_all_components(i, text.bboxes())
+ for_all_comps(i, text.bboxes())
{
tboxes[fv2v(i)].take(text.bbox(i));
tcenters[fv2v(i)].take(text.mass_center(i));
diff --git a/scribo/primitive/extract/all.hh b/scribo/primitive/extract/all.hh
index de1688e..5ccb83b 100644
--- a/scribo/primitive/extract/all.hh
+++ b/scribo/primitive/extract/all.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -58,7 +59,7 @@ namespace scribo
# include <scribo/primitive/extract/lines_v_thick.hh>
# include <scribo/primitive/extract/lines_v_discontinued.hh>
# include <scribo/primitive/extract/lines_h_pattern.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
# include <scribo/primitive/extract/cells.hh>
# include <scribo/primitive/extract/lines_thick.hh>
# include <scribo/primitive/extract/lines_h_discontinued.hh>
diff --git a/scribo/primitive/extract/lines_discontinued.hh b/scribo/primitive/extract/lines_discontinued.hh
index 2ea7de6..63953ac 100644
--- a/scribo/primitive/extract/lines_discontinued.hh
+++ b/scribo/primitive/extract/lines_discontinued.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -41,8 +42,7 @@
# include <mln/morpho/dilation.hh>
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
namespace scribo
{
@@ -70,7 +70,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_discontinued(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_, unsigned rank_k);
@@ -111,7 +111,7 @@ namespace scribo
template <typename I, typename N, typename V, typename W>
inline
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_discontinued(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_, unsigned rank_k)
@@ -132,8 +132,8 @@ namespace scribo
mln_ch_value(I,bool) filter
= morpho::dilation(morpho::rank_filter(input, win, rank_k), W(dil));
- object_image(mln_ch_value(I,V)) output
- = primitive::extract::objects(filter, nbh, nlines);
+ component_set<mln_ch_value(I,V)> output
+ = primitive::extract::components(filter, nbh, nlines);
trace::exiting("scribo::primitive::extract::lines_discontinued");
return output;
diff --git a/scribo/primitive/extract/lines_h_discontinued.hh b/scribo/primitive/extract/lines_h_discontinued.hh
index 48ba12a..f1deb98 100644
--- a/scribo/primitive/extract/lines_h_discontinued.hh
+++ b/scribo/primitive/extract/lines_h_discontinued.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -34,7 +35,6 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/extract/lines_discontinued.hh>
@@ -63,7 +63,7 @@ namespace scribo
* from 0.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k);
@@ -101,7 +101,7 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k)
@@ -113,7 +113,7 @@ namespace scribo
win::hline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_discontinued(input, nbh, nlines, win, rank_k);
trace::exiting("scribo::primitive::lines_h_discontinued");
diff --git a/scribo/primitive/extract/lines_h_pattern.hh b/scribo/primitive/extract/lines_h_pattern.hh
index fa1823d..08025a1 100644
--- a/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/primitive/extract/lines_h_pattern.hh
@@ -30,15 +30,18 @@
///
/// Extract horizontal lines matching a specific pattern.
-#include <mln/core/concept/image.hh>
-#include <mln/core/alias/window2d.hh>
-
-# include <mln/win/hline2d.hh>
-
+# include <mln/core/concept/image.hh>
+# include <mln/core/alias/window2d.hh>
+# include <mln/win/rectangle2d.hh>
# include <mln/morpho/dilation.hh>
+# include <mln/arith/times.hh>
+
# include <scribo/primitive/extract/lines_pattern.hh>
+# include <scribo/primitive/internal/rd.hh>
+
+
namespace scribo
{
@@ -74,17 +77,6 @@ namespace scribo
mln_precondition(exact(input).is_valid());
mln_precondition(length % 2 == 1);
-// bool win_def[7][1] = { {1},
-// {0},
-// {0},
-// {0},
-// {0},
-// {0},
-// {1} };
-
-// window2d win;
-// convert::from_to(win_def, win);
-
// FIXME: not generic.
window2d win;
mln_deduce(I, site, dpsite)
@@ -93,11 +85,16 @@ namespace scribo
win.insert(dp1);
win.insert(dp2);
- //FIXME: Add reconstruction instead of this arbitrary dilation.
- win::hline2d hwin(length/2 + 2);
-// win::hline2d hwin(length);
- return morpho::dilation(lines_pattern(input, length, 1, win), hwin);
-// return lines_pattern(input, length, 1, win);
+ mln_concrete(I) output = lines_pattern(input, length, 1, win);
+
+ mln_concrete(I)
+ output_dil = morpho::dilation(output,
+ win::rectangle2d(3, length / 2 + delta));
+
+ output = scribo::primitive::internal::rd(output, input * output_dil);
+
+ trace::exiting("scribo::primitive::extract::lines_h_pattern");
+ return output;
}
# endif // ! MLN_INCLUDE_ONLY
diff --git a/scribo/primitive/extract/lines_h_single.hh b/scribo/primitive/extract/lines_h_single.hh
index 4e9cb74..ad6b794 100644
--- a/scribo/primitive/extract/lines_h_single.hh
+++ b/scribo/primitive/extract/lines_h_single.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -34,7 +35,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
+# include <scribo/primitive/extract/components.hh>
namespace scribo
@@ -67,9 +68,9 @@ namespace scribo
* labeled.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_single(const Image<I>& input,
- const Neighborhood<N>& nbh, V& nlines,
+ const Neighborhood<N>& nbh, const V& nlines,
unsigned min_line_length,
float w_h_ratio);
@@ -79,7 +80,7 @@ namespace scribo
* Only single non discontinued lines are correctly extracted
* with this routine.
*
- * \param[in] objects A labeled image.
+ * \param[in] components A labeled image.
* \param[in] line_length The minimum line length.
* \param[in] w_h_ratio The minimum ratio width/height object
* bounding boxes to consider an
@@ -89,8 +90,8 @@ namespace scribo
* labeled.
*/
template <typename L>
- object_image(L)
- lines_h_single(const object_image(L)& objects,
+ component_set<L>
+ lines_h_single(const component_set<L>& components,
unsigned min_line_length,
float w_h_ratio);
@@ -106,17 +107,17 @@ namespace scribo
{
typedef bool result;
- is_line_h_single(const object_image(L)& objects,
+ is_line_h_single(const component_set<L>& components,
float w_h_ratio, unsigned min_line_length)
: w_h_ratio_(w_h_ratio), min_line_length_(min_line_length),
- objects_(objects)
+ components_(components)
{
}
bool operator()(const mln_value(L)& label) const
{
- mln_domain(L) box = objects_.bbox(label);
+ const mln_domain(L)& box = components_(label).bbox();
unsigned
height = box.pmax().row() - box.pmin().row() + 1,
@@ -129,7 +130,7 @@ namespace scribo
float w_h_ratio_;
unsigned min_line_length_;
- object_image(L) objects_;
+ component_set<L> components_;
};
@@ -139,9 +140,9 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_single(const Image<I>& input_,
- const Neighborhood<N>& nbh_, V& nlines,
+ const Neighborhood<N>& nbh_, const V& nlines,
unsigned min_line_length,
float w_h_ratio)
{
@@ -153,14 +154,13 @@ namespace scribo
mln_precondition(nbh.is_valid());
typedef mln_ch_value(I,V) L;
- object_image(L)
- output = objects(input, nbh, nlines);
+ component_set<L>
+ output = primitive::extract::components(input, nbh, nlines);
internal::is_line_h_single<L>
is_line(output, w_h_ratio, min_line_length);
- output.relabel(is_line);
- nlines = output.nlabels();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_h_single");
return output;
@@ -170,21 +170,20 @@ namespace scribo
template <typename L>
- object_image(L)
- lines_h_single(const object_image(L)& objects,
+ component_set<L>
+ lines_h_single(const component_set<L>& components,
unsigned min_line_length,
float w_h_ratio)
{
trace::entering("scribo::primitive::lines_h_single");
- mln_precondition(objects.is_valid());
+ mln_precondition(components.is_valid());
internal::is_line_h_single<L>
- is_line(objects, w_h_ratio, min_line_length);
+ is_line(components, w_h_ratio, min_line_length);
- object_image(L) output;
- output.init_from_(objects);
- output.relabel(is_line);
+ component_set<L> output = components.duplicate();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_h_single");
return output;
diff --git a/scribo/primitive/extract/lines_h_thick.hh b/scribo/primitive/extract/lines_h_thick.hh
index 817f47d..b1dfcfd 100644
--- a/scribo/primitive/extract/lines_h_thick.hh
+++ b/scribo/primitive/extract/lines_h_thick.hh
@@ -34,7 +34,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
+# include <scribo/core/component_set.hh>
# include <scribo/primitive/extract/lines_thick.hh>
namespace scribo
@@ -61,7 +61,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
unsigned line_length);
@@ -99,7 +99,7 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_h_thick(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length)
@@ -111,7 +111,7 @@ namespace scribo
win::hline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_thick(input, nbh, nlines, win);
trace::exiting("scribo::primitive::lines_h_thick");
diff --git a/scribo/primitive/extract/lines_thick.hh b/scribo/primitive/extract/lines_thick.hh
index 230b63c..726dab4 100644
--- a/scribo/primitive/extract/lines_thick.hh
+++ b/scribo/primitive/extract/lines_thick.hh
@@ -37,9 +37,8 @@
# include <mln/morpho/opening/structural.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
namespace scribo
{
@@ -66,7 +65,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_);
@@ -105,7 +104,7 @@ namespace scribo
template <typename I, typename N, typename V, typename W>
inline
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
const Window<W>& win_)
@@ -119,8 +118,8 @@ namespace scribo
const W& win = exact(win_);
mln_ch_value(I,bool) filter = morpho::opening::structural(input, win);
- object_image(mln_ch_value(I,V)) output
- = primitive::extract::objects(filter, nbh, nlines);
+ component_set<mln_ch_value(I,V)> output
+ = primitive::extract::components(filter, nbh, nlines);
trace::exiting("scribo::primitive::lines_thick");
return output;
diff --git a/scribo/primitive/extract/lines_v_discontinued.hh b/scribo/primitive/extract/lines_v_discontinued.hh
index 8f64472..c0e8b92 100644
--- a/scribo/primitive/extract/lines_v_discontinued.hh
+++ b/scribo/primitive/extract/lines_v_discontinued.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -33,7 +34,6 @@
# include <mln/core/concept/image.hh>
# include <mln/core/concept/neighborhood.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/extract/lines_discontinued.hh>
@@ -61,7 +61,7 @@ namespace scribo
* from 0.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k);
@@ -99,7 +99,7 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_discontinued(const Image<I>& input,
const Neighborhood<N>& nbh, V& nlines,
unsigned line_length, unsigned rank_k)
@@ -111,7 +111,7 @@ namespace scribo
win::vline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_discontinued(input, nbh, nlines, win, rank_k);
trace::exiting("scribo::primitive::lines_v_discontinued");
diff --git a/scribo/primitive/extract/lines_v_single.hh b/scribo/primitive/extract/lines_v_single.hh
index 74391f6..c67dfca 100644
--- a/scribo/primitive/extract/lines_v_single.hh
+++ b/scribo/primitive/extract/lines_v_single.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -34,8 +35,6 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/hline2d.hh>
-# include <scribo/core/object_image.hh>
-
namespace scribo
{
@@ -66,9 +65,9 @@ namespace scribo
* labeled.
*/
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_single(const Image<I>& input,
- const Neighborhood<N>& nbh, V& nlines,
+ const Neighborhood<N>& nbh, const V& nlines,
unsigned min_line_length,
float h_w_ratio);
@@ -78,7 +77,7 @@ namespace scribo
* Only single non discontinued lines are correctly extracted
* with this routine.
*
- * \param[in] objects A labeled image.
+ * \param[in] components A labeled image.
* \param[in] line_length The minimum line length.
* \param[in] h_w_ratio The minimum ratio height/width object
* bounding boxes to consider an
@@ -88,8 +87,8 @@ namespace scribo
* labeled.
*/
template <typename L>
- object_image(L)
- lines_v_single(const object_image(L)& objects,
+ component_set<L>
+ lines_v_single(const component_set<L>& components,
unsigned min_line_length,
float h_w_ratio);
@@ -105,17 +104,17 @@ namespace scribo
{
typedef bool result;
- is_line_v_single(const object_image(L)& objects,
+ is_line_v_single(const component_set<L>& components,
float h_w_ratio, unsigned min_line_length)
: h_w_ratio_(h_w_ratio), min_line_length_(min_line_length),
- objects_(objects)
+ components_(components)
{
}
bool operator()(const mln_value(L)& label) const
{
- mln_domain(L) box = objects_.bbox(label);
+ const mln_domain(L)& box = components_(label).bbox();
unsigned
height = box.pmax().row() - box.pmin().row() + 1,
width = box.pmax().col() - box.pmin().col() + 1;
@@ -127,7 +126,7 @@ namespace scribo
float h_w_ratio_;
unsigned min_line_length_;
- object_image(L) objects_;
+ component_set<L> components_;
};
@@ -136,9 +135,9 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_single(const Image<I>& input_,
- const Neighborhood<N>& nbh_, V& nlines,
+ const Neighborhood<N>& nbh_, const V& nlines,
unsigned min_line_length,
float h_w_ratio)
{
@@ -150,14 +149,13 @@ namespace scribo
mln_precondition(nbh.is_valid());
typedef mln_ch_value(I,V) L;
- object_image(L)
- output = objects(input, nbh, nlines);
+ component_set<L>
+ output = primitive::extract::components(input, nbh, nlines);
internal::is_line_v_single<L>
is_line(output, h_w_ratio, min_line_length);
- output.relabel(is_line);
- nlines = output.nlabels();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_v_single");
return output;
@@ -166,21 +164,20 @@ namespace scribo
template <typename L>
- object_image(L)
- lines_v_single(const object_image(L)& objects,
+ component_set<L>
+ lines_v_single(const component_set<L>& components,
unsigned min_line_length,
float h_w_ratio)
{
trace::entering("scribo::primitive::lines_v_single");
- mln_precondition(objects.is_valid());
+ mln_precondition(components.is_valid());
internal::is_line_v_single<L>
- is_line(objects, h_w_ratio, min_line_length);
+ is_line(components, h_w_ratio, min_line_length);
- object_image(L) output;
- output.init_from_(objects);
- output.relabel(is_line);
+ component_set<L> output = components.duplicate();
+ output.update_tags(is_line, component::Ignored);
trace::exiting("scribo::primitive::lines_v_single");
return output;
diff --git a/scribo/primitive/extract/lines_v_thick.hh b/scribo/primitive/extract/lines_v_thick.hh
index 2ee09dd..8b8a656 100644
--- a/scribo/primitive/extract/lines_v_thick.hh
+++ b/scribo/primitive/extract/lines_v_thick.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -34,7 +35,6 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/win/vline2d.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/extract/lines_thick.hh>
namespace scribo
@@ -61,7 +61,7 @@ namespace scribo
* \return An image in which lines are labeled.
*/
template <typename I, typename N, typename V, typename W>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_thick(const Image<I>& input_,
const Neighborhood<N>& nbh_, V& nlines,
unsigned line_length);
@@ -99,10 +99,10 @@ namespace scribo
template <typename I, typename N, typename V>
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
lines_v_thick(const Image<I>& input,
- const Neighborhood<N>& nbh, V& nlines,
- unsigned line_length)
+ const Neighborhood<N>& nbh, V& nlines,
+ unsigned line_length)
{
trace::entering("scribo::primitive::extract::lines_v_thick");
@@ -111,7 +111,7 @@ namespace scribo
win::vline2d win(line_length);
- object_image(mln_ch_value(I,V))
+ component_set<mln_ch_value(I,V)>
output = lines_thick(input, nbh, nlines, win);
trace::exiting("scribo::primitive::extract::lines_v_thick");
diff --git a/scribo/primitive/group/apply.hh b/scribo/primitive/group/apply.hh
index 026171d..3370104 100644
--- a/scribo/primitive/group/apply.hh
+++ b/scribo/primitive/group/apply.hh
@@ -75,7 +75,7 @@ namespace scribo
template <typename L>
component_set<L>
apply(const object_groups<L>& groups,
- fun::i2v::array<mln_value(L)>& relabel_fun)
+ mln::fun::i2v::array<mln_value(L)>& relabel_fun)
{
trace::entering("scribo::primitive::group::apply");
@@ -105,7 +105,7 @@ namespace scribo
component_set<L>
apply(const object_groups<L>& groups)
{
- fun::i2v::array<mln_value(L)> relabel_fun;
+ mln::fun::i2v::array<mln_value(L)> relabel_fun;
return apply(groups, relabel_fun);
}
diff --git a/scribo/primitive/group/from_graph.hh b/scribo/primitive/group/from_graph.hh
index 55cb56d..602be90 100644
--- a/scribo/primitive/group/from_graph.hh
+++ b/scribo/primitive/group/from_graph.hh
@@ -48,7 +48,6 @@
# include <scribo/core/object_links.hh>
# include <scribo/core/object_groups.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
diff --git a/scribo/primitive/internal/all.hh b/scribo/primitive/internal/all.hh
index 86aa62a..26f5d5b 100644
--- a/scribo/primitive/internal/all.hh
+++ b/scribo/primitive/internal/all.hh
@@ -47,14 +47,11 @@ namespace scribo
} // end of namespace scribo
-# include <scribo/primitive/internal/init_link_array.hh>
# include <scribo/primitive/internal/is_link_valid.hh>
# include <scribo/primitive/internal/find_root.hh>
# include <scribo/primitive/internal/find_graph_link.hh>
-# include <scribo/primitive/internal/find_right_link.hh>
# include <scribo/primitive/internal/update_graph_link.hh>
# include <scribo/primitive/internal/update_link_array.hh>
-# include <scribo/primitive/internal/find_left_link.hh>
#endif // ! SCRIBO_PRIMITIVE_INTERNAL_ALL_HH
diff --git a/scribo/primitive/internal/find_graph_link.hh b/scribo/primitive/internal/find_graph_link.hh
index b2f6549..f5a1039 100644
--- a/scribo/primitive/internal/find_graph_link.hh
+++ b/scribo/primitive/internal/find_graph_link.hh
@@ -37,7 +37,6 @@
# include <mln/util/array.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/primitive/internal/update_graph_link.hh>
//FIXME: not generic.
diff --git a/scribo/primitive/internal/rd.hh b/scribo/primitive/internal/rd.hh
index 7b8f069..49b6abb 100644
--- a/scribo/primitive/internal/rd.hh
+++ b/scribo/primitive/internal/rd.hh
@@ -100,7 +100,7 @@ namespace scribo
initialize(parent, f);
}
- util::array<int> dp = negative_offsets_wrt(f, nbh);
+ mln::util::array<int> dp = negative_offsets_wrt(f, nbh);
const unsigned n_nbhs = dp.nelements();
// First pass.
diff --git a/scribo/primitive/link/with_graph.hh b/scribo/primitive/link/with_graph.hh
index 5f16ec8..2d579aa 100644
--- a/scribo/primitive/link/with_graph.hh
+++ b/scribo/primitive/link/with_graph.hh
@@ -42,8 +42,6 @@
# include <mln/util/graph.hh>
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
# include <scribo/primitive/internal/find_graph_link.hh>
diff --git a/scribo/primitive/link/with_several_graphes.hh b/scribo/primitive/link/with_several_graphes.hh
index 148d3cc..98d631e 100644
--- a/scribo/primitive/link/with_several_graphes.hh
+++ b/scribo/primitive/link/with_several_graphes.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -38,10 +39,7 @@
# include <mln/util/array.hh>
# include <mln/util/graph.hh>
-
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
# include <scribo/primitive/internal/find_graph_link.hh>
namespace scribo
diff --git a/scribo/primitive/link/with_several_left_links.hh b/scribo/primitive/link/with_several_left_links.hh
index 2de4cee..5a685a1 100644
--- a/scribo/primitive/link/with_several_left_links.hh
+++ b/scribo/primitive/link/with_several_left_links.hh
@@ -37,8 +37,6 @@
# include <scribo/core/object_links.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
-# include <scribo/primitive/internal/find_left_link.hh>
# include <scribo/util/text.hh>
diff --git a/scribo/primitive/link/with_several_right_links.hh b/scribo/primitive/link/with_several_right_links.hh
index b302dcb..14d3229 100644
--- a/scribo/primitive/link/with_several_right_links.hh
+++ b/scribo/primitive/link/with_several_right_links.hh
@@ -38,10 +38,7 @@
# include <mln/util/array.hh>
# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
-# include <scribo/primitive/internal/init_link_array.hh>
-# include <scribo/primitive/internal/find_right_link.hh>
# include <scribo/util/text.hh>
diff --git a/scribo/table/erase.hh b/scribo/table/erase.hh
index 7cc9461..a34e5a0 100644
--- a/scribo/table/erase.hh
+++ b/scribo/table/erase.hh
@@ -62,8 +62,8 @@ namespace scribo
template <typename I, typename L>
mln_concrete(I)
erase(const Image<I>& input,
- const object_image(L)& hlines,
- const object_image(L)& vlines);
+ const Image<L>& hlines,
+ const Image<L>& vlines);
# ifndef MLN_INCLUDE_ONLY
@@ -73,12 +73,14 @@ namespace scribo
inline
mln_concrete(I)
erase(const Image<I>& input,
- const object_image(L)& hlines,
- const object_image(L)& vlines)
+ const Image<L>& hlines,
+ const Image<L>& vlines)
{
trace::entering("scribo::internal::erase");
mlc_equal(mln_value(I),bool)::check();
mln_precondition(exact(input).is_valid());
+ mln_precondition(exact(hlines).is_valid());
+ mln_precondition(exact(vlines).is_valid());
I output = duplicate(input);
diff --git a/scribo/table/extract.hh b/scribo/table/extract.hh
index efd030c..aca2321 100644
--- a/scribo/table/extract.hh
+++ b/scribo/table/extract.hh
@@ -38,12 +38,11 @@
# include <mln/io/ppm/all.hh>
# include <mln/labeling/colorize.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/table/rebuild.hh>
# include <scribo/table/erase.hh>
# include <scribo/primitive/extract/lines_h_pattern.hh>
# include <scribo/primitive/extract/lines_v_pattern.hh>
-# include <scribo/primitive/extract/objects.hh>
+# include <scribo/primitive/extract/components.hh>
# include <scribo/debug/save_bboxes_image.hh>
diff --git a/scribo/table/internal/align_lines.hh b/scribo/table/internal/align_lines.hh
index bd72af8..9af00fc 100644
--- a/scribo/table/internal/align_lines.hh
+++ b/scribo/table/internal/align_lines.hh
@@ -124,7 +124,7 @@ namespace scribo
lines.resize(nsites);
// Map components with actual lines.
- for_all_components(i, line_bboxes)
+ for_all_comps(i, line_bboxes)
{
int minline = line_bboxes[i].pmin()[dim] - max_alignment_diff;
minline = (minline < min_coord ? min_coord : minline);
diff --git a/scribo/table/internal/connect_lines.hh b/scribo/table/internal/connect_lines.hh
index b2f9273..667060a 100644
--- a/scribo/table/internal/connect_lines.hh
+++ b/scribo/table/internal/connect_lines.hh
@@ -43,7 +43,7 @@
# include <mln/opt/at.hh>
-# include <mln/transform/influence_zone_geodesic.hh>
+# include <mln/transform/influence_zone_geodesic_saturated.hh>
# include <scribo/core/macros.hh>
# include <scribo/core/central_sites.hh>
@@ -96,9 +96,10 @@ namespace scribo
for_all_elements(i, aligned_lines)
opt::at(l, aligned_lines[i]) = aligned_lines[i];
- l = transform::influence_zone_geodesic(l, c2(), max_distance, -1);
+ l = transform::influence_zone_geodesic_saturated(l, c2(),
+ max_distance, -1);
- for_all_components(i, boxes)
+ for_all_comps(i, boxes)
{
mln::util::couple<P,P> cp = central_sites(boxes[i], dim);
if (opt::at(l, cp.first()[dim]) != -1
diff --git a/scribo/table/internal/repair_lines.hh b/scribo/table/internal/repair_lines.hh
index f197979..481728c 100644
--- a/scribo/table/internal/repair_lines.hh
+++ b/scribo/table/internal/repair_lines.hh
@@ -112,7 +112,7 @@ namespace scribo
typedef mln_ch_value(I,value::label_16) L;
L l(input.domain());
data::fill(l, literal::zero);
- for_all_components(i, tableboxes)
+ for_all_comps(i, tableboxes)
{
mln::util::couple<P,P> cp = central_sites(tableboxes[i], axis);
l(cp.first()) = i;
--
1.5.6.5
1
0

29 Apr '10
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 fix-lrde-upload has been updated
via 68d80d9e1c6f2b66a45e6bb107c7697871386426 (commit)
via e30e6d746ca7e83560ad0e2a52324f0af553255d (commit)
via d843b6cdad0df4b25e11da900abe87f67153ab65 (commit)
via 81ebf3143f310e04f99738afb8b5ad9cbc39eaa7 (commit)
via 04e7d8027ac1a88bc151aa0174a3b1ee572c4e4b (commit)
from c260d597d0718762ff60972c3a9834f5f1a9db8f (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 -----------------------------------------------------------------
68d80d9 Upload only the HTML version of the user reference manual.
e30e6d7 Change permissions on uploaded files instead of on original files.
d843b6c Fix read permissions on uploaded PDF files.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 18 ++++++++++++++++++
lrde-upload.sh | 21 ++++++++++++---------
milena/ChangeLog | 8 ++++++++
milena/apps/graph-morpho/convert.hh | 7 +++----
scribo/ChangeLog | 7 +++++++
scribo/text/clean.hh | 2 +-
6 files changed, 49 insertions(+), 14 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0

last-svn-commit-153-g68d80d9 Upload only the HTML version of the user reference manual.
by Roland Levillain 29 Apr '10
by Roland Levillain 29 Apr '10
29 Apr '10
* lrde-upload.sh: Here.
---
ChangeLog | 6 ++++++
lrde-upload.sh | 3 ++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c537871..777b51f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2010-04-29 Roland Levillain <roland(a)lrde.epita.fr>
+ Upload only the HTML version of the user reference manual.
+
+ * lrde-upload.sh: Here.
+
+2010-04-29 Roland Levillain <roland(a)lrde.epita.fr>
+
Change permissions on uploaded files instead of on original files.
* lrde-upload.sh: Here.
diff --git a/lrde-upload.sh b/lrde-upload.sh
index 023f346..a4441c5 100755
--- a/lrde-upload.sh
+++ b/lrde-upload.sh
@@ -46,7 +46,8 @@ cp milena/doc/white-paper.pdf $DEST_DOC && chmod a+r $DEST_DOC/white-paper.pdf
rm -rf $DEST_DOC/user-refman.tmp
rm -rf $DEST_DOC/white-paper.tmp
-cp -pR milena/doc/user-refman $DEST_DOC/user-refman.tmp
+# Upload only the HTML version of the user reference manual.
+cp -pR milena/doc/user-refman/html $DEST_DOC/user-refman.tmp
cp -pR milena/doc/white-paper $DEST_DOC/white-paper.tmp
# Likewise, set permissions for all on uploaded directories.
--
1.5.6.5
1
0

last-svn-commit-152-ge30e6d7 Change permissions on uploaded files instead of on original files.
by Roland Levillain 29 Apr '10
by Roland Levillain 29 Apr '10
29 Apr '10
* lrde-upload.sh: Here.
---
ChangeLog | 6 ++++++
lrde-upload.sh | 8 ++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c06a0ff..c537871 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2010-04-29 Roland Levillain <roland(a)lrde.epita.fr>
+ Change permissions on uploaded files instead of on original files.
+
+ * lrde-upload.sh: Here.
+
+2010-04-29 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix read permissions on uploaded PDF files.
* lrde-upload.sh: Here.
diff --git a/lrde-upload.sh b/lrde-upload.sh
index 80244e8..023f346 100755
--- a/lrde-upload.sh
+++ b/lrde-upload.sh
@@ -46,13 +46,13 @@ cp milena/doc/white-paper.pdf $DEST_DOC && chmod a+r $DEST_DOC/white-paper.pdf
rm -rf $DEST_DOC/user-refman.tmp
rm -rf $DEST_DOC/white-paper.tmp
-# `make distcheck' sets umask to 077. Restore read permissions for all.
-chmod -R a+rX milena/doc/user-refman
-chmod -R a+rX milena/doc/white-paper
-
cp -pR milena/doc/user-refman $DEST_DOC/user-refman.tmp
cp -pR milena/doc/white-paper $DEST_DOC/white-paper.tmp
+# Likewise, set permissions for all on uploaded directories.
+chmod -R a+rX $DEST_DOC/user-refman.tmp
+chmod -R a+rX $DEST_DOC/white-paper.tmp
+
if test -e $DEST_DOC/user-refman; then
rm -rf $DEST_DOC/user-refman.old
mv -f $DEST_DOC/user-refman $DEST_DOC/user-refman.old
--
1.5.6.5
1
0

last-svn-commit-151-gd843b6c Fix read permissions on uploaded PDF files.
by Roland Levillain 29 Apr '10
by Roland Levillain 29 Apr '10
29 Apr '10
* lrde-upload.sh: Here.
---
ChangeLog | 6 ++++++
lrde-upload.sh | 10 ++++++----
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 534624a..c06a0ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-29 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix read permissions on uploaded PDF files.
+
+ * lrde-upload.sh: Here.
+
2010-04-27 Roland Levillain <roland(a)lrde.epita.fr>
Improve lrde-upload.sh.
diff --git a/lrde-upload.sh b/lrde-upload.sh
index e2481d9..80244e8 100755
--- a/lrde-upload.sh
+++ b/lrde-upload.sh
@@ -36,10 +36,12 @@ chmod -R a+r $DEST/olena-$REV.tar.bz2
# Upload a copy of the reference manual and other documentation.
mkdir -p $DEST_DOC
-cp milena/doc/ref-guide.pdf $DEST_DOC
-cp milena/doc/tutorial.pdf $DEST_DOC
-cp milena/doc/user-refman.pdf $DEST_DOC
-cp milena/doc/white-paper.pdf $DEST_DOC
+# BuildBots' buildslaves set umask to 077 in their default
+# configuration. Set read permissions for all on uploaded files.
+cp milena/doc/ref-guide.pdf $DEST_DOC && chmod a+r $DEST_DOC/ref-guide.pdf
+cp milena/doc/tutorial.pdf $DEST_DOC && chmod a+r $DEST_DOC/tutorial.pdf
+cp milena/doc/user-refman.pdf $DEST_DOC && chmod a+r $DEST_DOC/user-refman.pdf
+cp milena/doc/white-paper.pdf $DEST_DOC && chmod a+r $DEST_DOC/white-paper.pdf
rm -rf $DEST_DOC/user-refman.tmp
rm -rf $DEST_DOC/white-paper.tmp
--
1.5.6.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 next has been updated
via 81ebf3143f310e04f99738afb8b5ad9cbc39eaa7 (commit)
via 04e7d8027ac1a88bc151aa0174a3b1ee572c4e4b (commit)
via c260d597d0718762ff60972c3a9834f5f1a9db8f (commit)
from 7b351ecac19fd1c42ae0382ef7179496a1e565c8 (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 -----------------------------------------------------------------
No new revisions were added by this update.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
lrde-upload.sh | 10 ++++++++--
milena/ChangeLog | 8 ++++++++
milena/apps/graph-morpho/convert.hh | 7 +++----
scribo/ChangeLog | 7 +++++++
scribo/text/clean.hh | 2 +-
6 files changed, 33 insertions(+), 7 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0

27 Apr '10
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 g++-3.3-compatibility has been created
at 81ebf3143f310e04f99738afb8b5ad9cbc39eaa7 (commit)
- Log -----------------------------------------------------------------
81ebf31 Help g++ 3.3 compile Scribo code.
04e7d80 Help g++ 3.3 compile Milena code.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0