Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
March 2010
- 4 participants
- 277 discussions
02 Mar '10
* Makefile.am (LRDE_STRIPPED_DIST_FILES): Remove
$(distdir)/milena/doc/Makefile.am,
$(distdir)/milena/doc/ref_guide/Makefile.am,
$(distdir)/milena/doc/tutorial/Makefile.am and
$(distdir)/milena/doc/white_paper/Makefile.am.
---
ChangeLog | 10 ++++++++++
Makefile.am | 4 ----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 76c3a44..500750c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Stop pruning Makefiles under milena/doc/.
+
+ * Makefile.am (LRDE_STRIPPED_DIST_FILES): Remove
+ $(distdir)/milena/doc/Makefile.am,
+ $(distdir)/milena/doc/ref_guide/Makefile.am,
+ $(distdir)/milena/doc/tutorial/Makefile.am and
+ $(distdir)/milena/doc/white_paper/Makefile.am.
+
2009-10-27 Roland Levillain <roland(a)lrde.epita.fr>
Add missing copyright headers to M4 files.
diff --git a/Makefile.am b/Makefile.am
index f5646f0..3f44260 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,10 +50,6 @@ REGEN_SUBDIRS += milena scribo
LRDE_STRIPPED_DIST_FILES = \
$(distdir)/Makefile.am \
$(distdir)/configure.ac \
- $(distdir)/milena/doc/Makefile.am \
- $(distdir)/milena/doc/ref_guide/Makefile.am \
- $(distdir)/milena/doc/tutorial/Makefile.am \
- $(distdir)/milena/doc/white_paper/Makefile.am \
$(distdir)/milena/mln/accu/math/all.hh \
$(distdir)/milena/mln/all.hh \
$(distdir)/milena/mln/core/image/vmorph/all.hh \
--
1.5.6.5
1
0
last-svn-commit-4-g0964a88 Get rid of Make targets `fake-doc' and `void-doc'.
by Roland Levillain 02 Mar '10
by Roland Levillain 02 Mar '10
02 Mar '10
* doc/Makefile.am,
* doc/ref_guide/Makefile.am,
* doc/technical/Makefile.am,
* doc/tutorial/Makefile.am,
* doc/white_paper/Makefile.am
(fake-doc, void-doc): Remove targets.
---
milena/ChangeLog | 11 ++++++++++
milena/doc/Makefile.am | 37 +-----------------------------------
milena/doc/ref_guide/Makefile.am | 16 +--------------
milena/doc/technical/Makefile.am | 16 +--------------
milena/doc/tutorial/Makefile.am | 17 +--------------
milena/doc/white_paper/Makefile.am | 19 +-----------------
6 files changed, 17 insertions(+), 99 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 2c40c47..9c4f57f 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,16 @@
2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+ Get rid of Make targets `fake-doc' and `void-doc'.
+
+ * doc/Makefile.am,
+ * doc/ref_guide/Makefile.am,
+ * doc/technical/Makefile.am,
+ * doc/tutorial/Makefile.am,
+ * doc/white_paper/Makefile.am
+ (fake-doc, void-doc): Remove targets.
+
+2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+
Regen Milena's Makefile helpers.
* headers.mk, tests/unit_test/unit-tests.mk: Here.
diff --git a/milena/doc/Makefile.am b/milena/doc/Makefile.am
index de65f3e..5d80a1c 100644
--- a/milena/doc/Makefile.am
+++ b/milena/doc/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+# Copyright (C) 2007, 2008, 2009, 2010 EPITA Research and Development
# Laboratory (LRDE).
#
# This file is part of Olena.
@@ -316,38 +316,3 @@ $(srcdir)/Doxyfile_devel: $(srcdir)/Doxyfile.in
$(srcdir)/Doxyfile_devel_pdf: Doxyfile_devel
$(edit_pdf) $< >$@
-
-
-#<<lrde
-# Pretend the documentation is up-to-date. This is really useful for
-# developers who want to check the distribution mechanism, for
-# generating the Doxygen documentation make take up to 1 hour.
-#
-# We selectively refresh files by hand in a certain order (some
-# of them being already listed in EXTRA_DIST), to satisfy the
-# dependencies.
-.PHONY: fake-doc
-fake-doc:
- cd $(srcdir) && touch $(EXTRA_DIST)
- cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) $@
- cd tutorial && $(MAKE) $(AM_MAKEFLAGS) $@
- cd white_paper && $(MAKE) $(AM_MAKEFLAGS) $@
- touch $(EXTRA_DEPS)
- touch $(srcdir)/Doxyfile_devel
- touch $(srcdir)/Doxyfile_devel_pdf
- touch $(srcdir)/Doxyfile_user
- touch $(srcdir)/Doxyfile_user_pdf
- cd $(srcdir) && test -d user || mkdir user
- for d in $(srcdir)/$(USER_REFMAN_HTML) $(srcdir)/user/latex; do \
- if test -d $$d; then touch $$d; else mkdir $$d; fi; \
- done
- touch $(srcdir)/$(USER_REFMAN_PDF)
-
-# The converse of the previous rule, voiding the timestamps.
-.PHONY: void-doc
-void-doc:
- touch $(srcdir)/Doxyfile.in
- cd ref_guide && $(MAKE) $(AM_MAKEFLAGS) $@
- cd tutorial && $(MAKE) $(AM_MAKEFLAGS) $@
- cd white_paper && $(MAKE) $(AM_MAKEFLAGS) $@
-#>>
diff --git a/milena/doc/ref_guide/Makefile.am b/milena/doc/ref_guide/Makefile.am
index 9870a07..fa953e4 100644
--- a/milena/doc/ref_guide/Makefile.am
+++ b/milena/doc/ref_guide/Makefile.am
@@ -1,4 +1,4 @@
-# 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.
#
@@ -96,17 +96,3 @@ CLEANFILES = \
ref_guide.html \
ref_guide.idx \
$(REF_GUIDE_HH)
-
-
-#<<lrde
-# Pretend the documentation is up-to-date.
-.PHONY: fake-doc
-fake-doc:
- touch $(REF_GUIDE_HH)
- touch $(REF_GUIDE_PDF)
-
-# The converse of the previous rule, voiding the timestamps.
-.PHONY: void-doc
-void-doc:
- touch $(srcdir)/ref_guide.tex
-#>>
diff --git a/milena/doc/technical/Makefile.am b/milena/doc/technical/Makefile.am
index 14cdeb3..3789b91 100644
--- a/milena/doc/technical/Makefile.am
+++ b/milena/doc/technical/Makefile.am
@@ -1,4 +1,4 @@
-# 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.
#
@@ -96,17 +96,3 @@ CLEANFILES = \
technical.html \
technical.idx \
$(TECHNICAL_HH)
-
-
-#<<lrde
-# Pretend the documentation is up-to-date.
-.PHONY: fake-doc
-fake-doc:
- touch $(TECHNICAL_HH)
- touch $(TECHNICAL_PDF)
-
-# The converse of the previous rule, voiding the timestamps.
-.PHONY: void-doc
-void-doc:
- touch $(srcdir)/technical.tex
-#>>
diff --git a/milena/doc/tutorial/Makefile.am b/milena/doc/tutorial/Makefile.am
index 12f52ad..5085633 100644
--- a/milena/doc/tutorial/Makefile.am
+++ b/milena/doc/tutorial/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE).
+# Copyright (C) 2008, 2009, 2010 EPITA Research and Development
+# Laboratory (LRDE).
#
# This file is part of Olena.
#
@@ -95,17 +96,3 @@ CLEANFILES = \
tutorial.html \
tutorial.idx \
$(TUTORIAL_HH)
-
-
-#<<lrde
-# Pretend the documentation is up-to-date.
-.PHONY: fake-doc
-fake-doc:
- touch $(TUTORIAL_HH)
- touch $(TUTORIAL_PDF)
-
-# The converse of the previous rule, voiding the timestamps.
-.PHONY: void-doc
-void-doc:
- touch $(srcdir)/tutorial.tex
-#>>
diff --git a/milena/doc/white_paper/Makefile.am b/milena/doc/white_paper/Makefile.am
index 66b42cb..24d619d 100644
--- a/milena/doc/white_paper/Makefile.am
+++ b/milena/doc/white_paper/Makefile.am
@@ -1,4 +1,4 @@
-# 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.
#
@@ -96,20 +96,3 @@ CLEANFILES = \
clean-local:
-rm -rf white_paper_html figures
-
-
-#<<lrde
-# Pretend the documentation is up-to-date.
-.PHONY: fake-doc
-fake-doc:
- test -d figures || mkdir figures
- touch $(EPSS)
- test -d $(srcdir)/white_paper_html || mkdir $(srcdir)/white_paper_html
- touch $(WHITE_PAPER_HTML)
- touch $(WHITE_PAPER_PDF)
-
-# The converse of the previous rule, voiding the timestamps.
-.PHONY: void-doc
-void-doc:
- touch $(srcdir)/white_paper.tex
-#>>
--
1.5.6.5
1
0
02 Mar '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 copyright-headers has been deleted
was 1c31ba76b4a505703f466e7d91eecc87437526a2
-----------------------------------------------------------------------
1c31ba76b4a505703f466e7d91eecc87437526a2 Add missing copyright headers to M4 files.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Olena, a generic and efficient image processing platform".
The branch next has been updated
via f9ac5d4d841e31df0aa208435d302202852a9a6b (commit)
via c81c18f8fda28be370e9d8a01f2b1162db514c8d (commit)
from 1c31ba76b4a505703f466e7d91eecc87437526a2 (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 -----------------------------------------------------------------
f9ac5d4 Regen SCRIBO's Makefile helpers.
c81c18f Regen Milena's Makefile helpers.
-----------------------------------------------------------------------
Summary of changes:
milena/ChangeLog | 6 +++
milena/headers.mk | 5 +++
milena/tests/unit_test/unit-tests.mk | 10 ++++++
scribo/ChangeLog | 6 +++
scribo/headers.mk | 36 ++++++++++++++++++++-
scribo/tests/unit_test/unit-tests.mk | 58 ++++++++++++++++++++++++++++++++++
6 files changed, 119 insertions(+), 2 deletions(-)
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
02 Mar '10
* headers.mk, tests/unit_test/unit-tests.mk: Here.
---
scribo/ChangeLog | 6 +++
scribo/headers.mk | 36 ++++++++++++++++++++-
scribo/tests/unit_test/unit-tests.mk | 58 ++++++++++++++++++++++++++++++++++
3 files changed, 98 insertions(+), 2 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 4fed85c..33307f4 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Regen SCRIBO's Makefile helpers.
+
+ * headers.mk, tests/unit_test/unit-tests.mk: Here.
+
2009-11-03 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a new example in Scribo.
diff --git a/scribo/headers.mk b/scribo/headers.mk
index 15d9b2a..4127a31 100644
--- a/scribo/headers.mk
+++ b/scribo/headers.mk
@@ -2,21 +2,29 @@
scribodir = $(includedir)/scribo
nobase_scribo_HEADERS = \
./all.hh \
+./binarization/binarize.hh \
./binarization/sauvola.hh \
+./binarization/sauvola_threshold.hh \
./binarization/simple.hh \
./core/all.hh \
./core/central_sites.hh \
+./core/concept/link_functor.hh \
./core/erase_objects.hh \
+./core/internal/link_functor_base.hh \
./core/macros.hh \
./core/object_groups.hh \
./core/object_image.hh \
./core/object_links.hh \
+./debug/alignment_decision_image.hh \
./debug/all.hh \
./debug/decision_image.hh \
+./debug/links_decision_image.hh \
./debug/save_bboxes_image.hh \
./debug/save_label_image.hh \
./debug/save_linked_bboxes_image.hh \
+./debug/save_object_diff.hh \
./debug/save_table_image.hh \
+./debug/several_links_decision_image.hh \
./debug/usage.hh \
./demo/src/mainwindow.hh \
./draw/all.hh \
@@ -24,9 +32,9 @@ nobase_scribo_HEADERS = \
./draw/bounding_boxes.hh \
./estim/object_groups_v_thickness.hh \
./filter/all.hh \
-./filter/common/object_groups_photo.hh \
-./filter/common/object_links_photo.hh \
./filter/common/objects_photo.hh \
+./filter/internal/compute.hh \
+./filter/object_groups_size_ratio.hh \
./filter/object_groups_small.hh \
./filter/object_groups_v_thickness.hh \
./filter/object_links_bbox_h_ratio.hh \
@@ -34,14 +42,21 @@ nobase_scribo_HEADERS = \
./filter/object_links_bbox_ratio.hh \
./filter/object_links_bbox_w_ratio.hh \
./filter/object_links_bottom_aligned.hh \
+./filter/object_links_center_aligned.hh \
./filter/object_links_non_aligned.hh \
./filter/object_links_non_aligned_simple.hh \
./filter/object_links_non_h_aligned.hh \
./filter/object_links_non_v_aligned.hh \
+./filter/object_links_top_aligned.hh \
+./filter/objects_h_thick.hh \
+./filter/objects_h_thin.hh \
./filter/objects_large.hh \
+./filter/objects_size_ratio.hh \
./filter/objects_small.hh \
./filter/objects_thick.hh \
./filter/objects_thin.hh \
+./filter/objects_v_thick.hh \
+./filter/objects_v_thin.hh \
./fun/v2b/objects_small_filter.hh \
./make/all.hh \
./make/debug_filename.hh \
@@ -80,18 +95,35 @@ nobase_scribo_HEADERS = \
./primitive/internal/find_root.hh \
./primitive/internal/have_link_valid.hh \
./primitive/internal/init_link_array.hh \
+./primitive/internal/is_invalid_link.hh \
./primitive/internal/is_link_valid.hh \
./primitive/internal/update_graph_link.hh \
./primitive/internal/update_link_array.hh \
./primitive/link/all.hh \
+./primitive/link/compute.hh \
+./primitive/link/compute_several.hh \
+./primitive/link/internal/anchors_3.hh \
+./primitive/link/internal/find_link.hh \
+./primitive/link/internal/find_several_links.hh \
+./primitive/link/internal/link_center_dmax_base.hh \
+./primitive/link/internal/link_center_dmax_ratio_base.hh \
+./primitive/link/internal/link_functor_base.hh \
+./primitive/link/internal/link_ms_dmax_base.hh \
+./primitive/link/internal/link_ms_dmax_ratio_base.hh \
./primitive/link/merge_double_link.hh \
./primitive/link/with_graph.hh \
./primitive/link/with_rag.hh \
./primitive/link/with_several_graphes.hh \
./primitive/link/with_several_left_links.hh \
+./primitive/link/with_several_right_closest_links.hh \
./primitive/link/with_several_right_links.hh \
+./primitive/link/with_several_right_links_overlap.hh \
./primitive/link/with_single_left_link.hh \
+./primitive/link/with_single_left_link_dmax_ratio.hh \
./primitive/link/with_single_right_link.hh \
+./primitive/link/with_single_right_link_bottom.hh \
+./primitive/link/with_single_right_link_dmax_ratio.hh \
+./primitive/link/with_single_right_link_top.hh \
./table/align_lines_horizontaly.hh \
./table/align_lines_verticaly.hh \
./table/all.hh \
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index 63998b0..2467334 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -2,21 +2,29 @@
check_PROGRAMS = \
scribo_all \
+scribo_binarization_binarize \
scribo_binarization_sauvola \
+scribo_binarization_sauvola_threshold \
scribo_binarization_simple \
scribo_core_all \
scribo_core_central_sites \
+scribo_core_concept_link_functor \
scribo_core_erase_objects \
+scribo_core_internal_link_functor_base \
scribo_core_macros \
scribo_core_object_groups \
scribo_core_object_image \
scribo_core_object_links \
+scribo_debug_alignment_decision_image \
scribo_debug_all \
scribo_debug_decision_image \
+scribo_debug_links_decision_image \
scribo_debug_save_bboxes_image \
scribo_debug_save_label_image \
scribo_debug_save_linked_bboxes_image \
+scribo_debug_save_object_diff \
scribo_debug_save_table_image \
+scribo_debug_several_links_decision_image \
scribo_debug_usage \
scribo_draw_all \
scribo_draw_bounding_box_links \
@@ -24,6 +32,7 @@ scribo_draw_bounding_boxes \
scribo_estim_object_groups_v_thickness \
scribo_filter_all \
scribo_filter_common_objects_photo \
+scribo_filter_internal_compute \
scribo_filter_object_groups_size_ratio \
scribo_filter_object_groups_small \
scribo_filter_object_groups_v_thickness \
@@ -32,16 +41,20 @@ scribo_filter_object_links_bbox_overlap \
scribo_filter_object_links_bbox_ratio \
scribo_filter_object_links_bbox_w_ratio \
scribo_filter_object_links_bottom_aligned \
+scribo_filter_object_links_center_aligned \
scribo_filter_object_links_non_aligned \
scribo_filter_object_links_non_aligned_simple \
scribo_filter_object_links_non_h_aligned \
scribo_filter_object_links_non_v_aligned \
+scribo_filter_object_links_top_aligned \
+scribo_filter_objects_h_thick \
scribo_filter_objects_h_thin \
scribo_filter_objects_large \
scribo_filter_objects_size_ratio \
scribo_filter_objects_small \
scribo_filter_objects_thick \
scribo_filter_objects_thin \
+scribo_filter_objects_v_thick \
scribo_filter_objects_v_thin \
scribo_fun_v2b_objects_small_filter \
scribo_make_all \
@@ -86,14 +99,30 @@ scribo_primitive_internal_is_link_valid \
scribo_primitive_internal_update_graph_link \
scribo_primitive_internal_update_link_array \
scribo_primitive_link_all \
+scribo_primitive_link_compute \
+scribo_primitive_link_compute_several \
+scribo_primitive_link_internal_anchors_3 \
+scribo_primitive_link_internal_find_link \
+scribo_primitive_link_internal_find_several_links \
+scribo_primitive_link_internal_link_center_dmax_base \
+scribo_primitive_link_internal_link_center_dmax_ratio_base \
+scribo_primitive_link_internal_link_functor_base \
+scribo_primitive_link_internal_link_ms_dmax_base \
+scribo_primitive_link_internal_link_ms_dmax_ratio_base \
scribo_primitive_link_merge_double_link \
scribo_primitive_link_with_graph \
scribo_primitive_link_with_rag \
scribo_primitive_link_with_several_graphes \
scribo_primitive_link_with_several_left_links \
+scribo_primitive_link_with_several_right_closest_links \
scribo_primitive_link_with_several_right_links \
+scribo_primitive_link_with_several_right_links_overlap \
scribo_primitive_link_with_single_left_link \
+scribo_primitive_link_with_single_left_link_dmax_ratio \
scribo_primitive_link_with_single_right_link \
+scribo_primitive_link_with_single_right_link_bottom \
+scribo_primitive_link_with_single_right_link_dmax_ratio \
+scribo_primitive_link_with_single_right_link_top \
scribo_table_align_lines_horizontaly \
scribo_table_align_lines_verticaly \
scribo_table_all \
@@ -115,21 +144,29 @@ scribo_util_all \
scribo_util_text
scribo_all_SOURCES = scribo_all.cc
+scribo_binarization_binarize_SOURCES = scribo_binarization_binarize.cc
scribo_binarization_sauvola_SOURCES = scribo_binarization_sauvola.cc
+scribo_binarization_sauvola_threshold_SOURCES = scribo_binarization_sauvola_threshold.cc
scribo_binarization_simple_SOURCES = scribo_binarization_simple.cc
scribo_core_all_SOURCES = scribo_core_all.cc
scribo_core_central_sites_SOURCES = scribo_core_central_sites.cc
+scribo_core_concept_link_functor_SOURCES = scribo_core_concept_link_functor.cc
scribo_core_erase_objects_SOURCES = scribo_core_erase_objects.cc
+scribo_core_internal_link_functor_base_SOURCES = scribo_core_internal_link_functor_base.cc
scribo_core_macros_SOURCES = scribo_core_macros.cc
scribo_core_object_groups_SOURCES = scribo_core_object_groups.cc
scribo_core_object_image_SOURCES = scribo_core_object_image.cc
scribo_core_object_links_SOURCES = scribo_core_object_links.cc
+scribo_debug_alignment_decision_image_SOURCES = scribo_debug_alignment_decision_image.cc
scribo_debug_all_SOURCES = scribo_debug_all.cc
scribo_debug_decision_image_SOURCES = scribo_debug_decision_image.cc
+scribo_debug_links_decision_image_SOURCES = scribo_debug_links_decision_image.cc
scribo_debug_save_bboxes_image_SOURCES = scribo_debug_save_bboxes_image.cc
scribo_debug_save_label_image_SOURCES = scribo_debug_save_label_image.cc
scribo_debug_save_linked_bboxes_image_SOURCES = scribo_debug_save_linked_bboxes_image.cc
+scribo_debug_save_object_diff_SOURCES = scribo_debug_save_object_diff.cc
scribo_debug_save_table_image_SOURCES = scribo_debug_save_table_image.cc
+scribo_debug_several_links_decision_image_SOURCES = scribo_debug_several_links_decision_image.cc
scribo_debug_usage_SOURCES = scribo_debug_usage.cc
scribo_draw_all_SOURCES = scribo_draw_all.cc
scribo_draw_bounding_box_links_SOURCES = scribo_draw_bounding_box_links.cc
@@ -137,6 +174,7 @@ scribo_draw_bounding_boxes_SOURCES = scribo_draw_bounding_boxes.cc
scribo_estim_object_groups_v_thickness_SOURCES = scribo_estim_object_groups_v_thickness.cc
scribo_filter_all_SOURCES = scribo_filter_all.cc
scribo_filter_common_objects_photo_SOURCES = scribo_filter_common_objects_photo.cc
+scribo_filter_internal_compute_SOURCES = scribo_filter_internal_compute.cc
scribo_filter_object_groups_size_ratio_SOURCES = scribo_filter_object_groups_size_ratio.cc
scribo_filter_object_groups_small_SOURCES = scribo_filter_object_groups_small.cc
scribo_filter_object_groups_v_thickness_SOURCES = scribo_filter_object_groups_v_thickness.cc
@@ -145,16 +183,20 @@ scribo_filter_object_links_bbox_overlap_SOURCES = scribo_filter_object_links_bbo
scribo_filter_object_links_bbox_ratio_SOURCES = scribo_filter_object_links_bbox_ratio.cc
scribo_filter_object_links_bbox_w_ratio_SOURCES = scribo_filter_object_links_bbox_w_ratio.cc
scribo_filter_object_links_bottom_aligned_SOURCES = scribo_filter_object_links_bottom_aligned.cc
+scribo_filter_object_links_center_aligned_SOURCES = scribo_filter_object_links_center_aligned.cc
scribo_filter_object_links_non_aligned_SOURCES = scribo_filter_object_links_non_aligned.cc
scribo_filter_object_links_non_aligned_simple_SOURCES = scribo_filter_object_links_non_aligned_simple.cc
scribo_filter_object_links_non_h_aligned_SOURCES = scribo_filter_object_links_non_h_aligned.cc
scribo_filter_object_links_non_v_aligned_SOURCES = scribo_filter_object_links_non_v_aligned.cc
+scribo_filter_object_links_top_aligned_SOURCES = scribo_filter_object_links_top_aligned.cc
+scribo_filter_objects_h_thick_SOURCES = scribo_filter_objects_h_thick.cc
scribo_filter_objects_h_thin_SOURCES = scribo_filter_objects_h_thin.cc
scribo_filter_objects_large_SOURCES = scribo_filter_objects_large.cc
scribo_filter_objects_size_ratio_SOURCES = scribo_filter_objects_size_ratio.cc
scribo_filter_objects_small_SOURCES = scribo_filter_objects_small.cc
scribo_filter_objects_thick_SOURCES = scribo_filter_objects_thick.cc
scribo_filter_objects_thin_SOURCES = scribo_filter_objects_thin.cc
+scribo_filter_objects_v_thick_SOURCES = scribo_filter_objects_v_thick.cc
scribo_filter_objects_v_thin_SOURCES = scribo_filter_objects_v_thin.cc
scribo_fun_v2b_objects_small_filter_SOURCES = scribo_fun_v2b_objects_small_filter.cc
scribo_make_all_SOURCES = scribo_make_all.cc
@@ -199,14 +241,30 @@ scribo_primitive_internal_is_link_valid_SOURCES = scribo_primitive_internal_is_l
scribo_primitive_internal_update_graph_link_SOURCES = scribo_primitive_internal_update_graph_link.cc
scribo_primitive_internal_update_link_array_SOURCES = scribo_primitive_internal_update_link_array.cc
scribo_primitive_link_all_SOURCES = scribo_primitive_link_all.cc
+scribo_primitive_link_compute_SOURCES = scribo_primitive_link_compute.cc
+scribo_primitive_link_compute_several_SOURCES = scribo_primitive_link_compute_several.cc
+scribo_primitive_link_internal_anchors_3_SOURCES = scribo_primitive_link_internal_anchors_3.cc
+scribo_primitive_link_internal_find_link_SOURCES = scribo_primitive_link_internal_find_link.cc
+scribo_primitive_link_internal_find_several_links_SOURCES = scribo_primitive_link_internal_find_several_links.cc
+scribo_primitive_link_internal_link_center_dmax_base_SOURCES = scribo_primitive_link_internal_link_center_dmax_base.cc
+scribo_primitive_link_internal_link_center_dmax_ratio_base_SOURCES = scribo_primitive_link_internal_link_center_dmax_ratio_base.cc
+scribo_primitive_link_internal_link_functor_base_SOURCES = scribo_primitive_link_internal_link_functor_base.cc
+scribo_primitive_link_internal_link_ms_dmax_base_SOURCES = scribo_primitive_link_internal_link_ms_dmax_base.cc
+scribo_primitive_link_internal_link_ms_dmax_ratio_base_SOURCES = scribo_primitive_link_internal_link_ms_dmax_ratio_base.cc
scribo_primitive_link_merge_double_link_SOURCES = scribo_primitive_link_merge_double_link.cc
scribo_primitive_link_with_graph_SOURCES = scribo_primitive_link_with_graph.cc
scribo_primitive_link_with_rag_SOURCES = scribo_primitive_link_with_rag.cc
scribo_primitive_link_with_several_graphes_SOURCES = scribo_primitive_link_with_several_graphes.cc
scribo_primitive_link_with_several_left_links_SOURCES = scribo_primitive_link_with_several_left_links.cc
+scribo_primitive_link_with_several_right_closest_links_SOURCES = scribo_primitive_link_with_several_right_closest_links.cc
scribo_primitive_link_with_several_right_links_SOURCES = scribo_primitive_link_with_several_right_links.cc
+scribo_primitive_link_with_several_right_links_overlap_SOURCES = scribo_primitive_link_with_several_right_links_overlap.cc
scribo_primitive_link_with_single_left_link_SOURCES = scribo_primitive_link_with_single_left_link.cc
+scribo_primitive_link_with_single_left_link_dmax_ratio_SOURCES = scribo_primitive_link_with_single_left_link_dmax_ratio.cc
scribo_primitive_link_with_single_right_link_SOURCES = scribo_primitive_link_with_single_right_link.cc
+scribo_primitive_link_with_single_right_link_bottom_SOURCES = scribo_primitive_link_with_single_right_link_bottom.cc
+scribo_primitive_link_with_single_right_link_dmax_ratio_SOURCES = scribo_primitive_link_with_single_right_link_dmax_ratio.cc
+scribo_primitive_link_with_single_right_link_top_SOURCES = scribo_primitive_link_with_single_right_link_top.cc
scribo_table_align_lines_horizontaly_SOURCES = scribo_table_align_lines_horizontaly.cc
scribo_table_align_lines_verticaly_SOURCES = scribo_table_align_lines_verticaly.cc
scribo_table_all_SOURCES = scribo_table_all.cc
--
1.5.6.5
1
0
02 Mar '10
* headers.mk, tests/unit_test/unit-tests.mk: Here.
---
milena/ChangeLog | 6 ++++++
milena/headers.mk | 5 +++++
milena/tests/unit_test/unit-tests.mk | 10 ++++++++++
3 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b3cd42e..2c40c47 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-02 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Regen Milena's Makefile helpers.
+
+ * headers.mk, tests/unit_test/unit-tests.mk: Here.
+
2009-11-18 Guillaume Lazzara <z(a)lrde.epita.fr>
* doc/white_paper/white_paper.tex: Fix an invalid URL.
diff --git a/milena/headers.mk b/milena/headers.mk
index eb27c99..110caa6 100644
--- a/milena/headers.mk
+++ b/milena/headers.mk
@@ -194,6 +194,7 @@ mln/core/alias/window1d.hh \
mln/core/alias/window2d.hh \
mln/core/alias/window3d.hh \
mln/core/all.hh \
+mln/core/box_runend_piter.hh \
mln/core/box_runstart_piter.hh \
mln/core/category.hh \
mln/core/concept/accumulator.hh \
@@ -332,6 +333,7 @@ mln/core/internal/image_morpher.hh \
mln/core/internal/image_primary.hh \
mln/core/internal/image_value_morpher.hh \
mln/core/internal/is_masked_impl_selector.hh \
+mln/core/internal/labeled_image_base.hh \
mln/core/internal/morpher_lvalue.hh \
mln/core/internal/neighb_base.hh \
mln/core/internal/neighb_niter_base.hh \
@@ -451,6 +453,7 @@ mln/data/transform.hh \
mln/data/transform.spe.hh \
mln/data/transform_inplace.hh \
mln/data/update.hh \
+mln/data/wrap.hh \
mln/debug/all.hh \
mln/debug/draw_graph.hh \
mln/debug/essential.hh \
@@ -1088,6 +1091,7 @@ mln/transform/essential.hh \
mln/transform/hough.hh \
mln/transform/influence_zone_front.hh \
mln/transform/influence_zone_geodesic.hh \
+mln/transform/influence_zone_geodesic_saturated.hh \
mln/transform/internal/all.hh \
mln/transform/internal/closest_point_functor.hh \
mln/transform/internal/distance_functor.hh \
@@ -1198,6 +1202,7 @@ mln/value/internal/value_like.hh \
mln/value/interval.hh \
mln/value/label.hh \
mln/value/label_16.hh \
+mln/value/label_32.hh \
mln/value/label_8.hh \
mln/value/lut_vec.hh \
mln/value/mixin.hh \
diff --git a/milena/tests/unit_test/unit-tests.mk b/milena/tests/unit_test/unit-tests.mk
index d9d29aa..6a9d5d5 100644
--- a/milena/tests/unit_test/unit-tests.mk
+++ b/milena/tests/unit_test/unit-tests.mk
@@ -191,6 +191,7 @@ mln_core_alias_window1d \
mln_core_alias_window2d \
mln_core_alias_window3d \
mln_core_all \
+mln_core_box_runend_piter \
mln_core_box_runstart_piter \
mln_core_category \
mln_core_concept_accumulator \
@@ -313,6 +314,7 @@ mln_core_internal_image_morpher \
mln_core_internal_image_primary \
mln_core_internal_image_value_morpher \
mln_core_internal_is_masked_impl_selector \
+mln_core_internal_labeled_image_base \
mln_core_internal_morpher_lvalue \
mln_core_internal_neighb_base \
mln_core_internal_neighb_niter_base \
@@ -427,6 +429,7 @@ mln_data_transform \
mln_data_transform_inplace \
mln_data_update \
mln_data_was_median \
+mln_data_wrap \
mln_debug_all \
mln_debug_draw_graph \
mln_debug_essential \
@@ -1123,6 +1126,7 @@ mln_transform_essential \
mln_transform_hough \
mln_transform_influence_zone_front \
mln_transform_influence_zone_geodesic \
+mln_transform_influence_zone_geodesic_saturated \
mln_transform_internal_all \
mln_transform_internal_closest_point_functor \
mln_transform_internal_distance_functor \
@@ -1235,6 +1239,7 @@ mln_value_internal_value_like \
mln_value_interval \
mln_value_label \
mln_value_label_16 \
+mln_value_label_32 \
mln_value_label_8 \
mln_value_lut_vec \
mln_value_mixin \
@@ -1484,6 +1489,7 @@ mln_core_alias_window1d_SOURCES = mln_core_alias_window1d.cc
mln_core_alias_window2d_SOURCES = mln_core_alias_window2d.cc
mln_core_alias_window3d_SOURCES = mln_core_alias_window3d.cc
mln_core_all_SOURCES = mln_core_all.cc
+mln_core_box_runend_piter_SOURCES = mln_core_box_runend_piter.cc
mln_core_box_runstart_piter_SOURCES = mln_core_box_runstart_piter.cc
mln_core_category_SOURCES = mln_core_category.cc
mln_core_concept_accumulator_SOURCES = mln_core_concept_accumulator.cc
@@ -1606,6 +1612,7 @@ mln_core_internal_image_morpher_SOURCES = mln_core_internal_image_morpher.cc
mln_core_internal_image_primary_SOURCES = mln_core_internal_image_primary.cc
mln_core_internal_image_value_morpher_SOURCES = mln_core_internal_image_value_morpher.cc
mln_core_internal_is_masked_impl_selector_SOURCES = mln_core_internal_is_masked_impl_selector.cc
+mln_core_internal_labeled_image_base_SOURCES = mln_core_internal_labeled_image_base.cc
mln_core_internal_morpher_lvalue_SOURCES = mln_core_internal_morpher_lvalue.cc
mln_core_internal_neighb_base_SOURCES = mln_core_internal_neighb_base.cc
mln_core_internal_neighb_niter_base_SOURCES = mln_core_internal_neighb_niter_base.cc
@@ -1720,6 +1727,7 @@ mln_data_transform_SOURCES = mln_data_transform.cc
mln_data_transform_inplace_SOURCES = mln_data_transform_inplace.cc
mln_data_update_SOURCES = mln_data_update.cc
mln_data_was_median_SOURCES = mln_data_was_median.cc
+mln_data_wrap_SOURCES = mln_data_wrap.cc
mln_debug_all_SOURCES = mln_debug_all.cc
mln_debug_draw_graph_SOURCES = mln_debug_draw_graph.cc
mln_debug_essential_SOURCES = mln_debug_essential.cc
@@ -2416,6 +2424,7 @@ mln_transform_essential_SOURCES = mln_transform_essential.cc
mln_transform_hough_SOURCES = mln_transform_hough.cc
mln_transform_influence_zone_front_SOURCES = mln_transform_influence_zone_front.cc
mln_transform_influence_zone_geodesic_SOURCES = mln_transform_influence_zone_geodesic.cc
+mln_transform_influence_zone_geodesic_saturated_SOURCES = mln_transform_influence_zone_geodesic_saturated.cc
mln_transform_internal_all_SOURCES = mln_transform_internal_all.cc
mln_transform_internal_closest_point_functor_SOURCES = mln_transform_internal_closest_point_functor.cc
mln_transform_internal_distance_functor_SOURCES = mln_transform_internal_distance_functor.cc
@@ -2528,6 +2537,7 @@ mln_value_internal_value_like_SOURCES = mln_value_internal_value_like.cc
mln_value_interval_SOURCES = mln_value_interval.cc
mln_value_label_SOURCES = mln_value_label.cc
mln_value_label_16_SOURCES = mln_value_label_16.cc
+mln_value_label_32_SOURCES = mln_value_label_32.cc
mln_value_label_8_SOURCES = mln_value_label_8.cc
mln_value_lut_vec_SOURCES = mln_value_lut_vec.cc
mln_value_mixin_SOURCES = mln_value_mixin.cc
--
1.5.6.5
1
0
last-svn-commit-53-g5fe933b text/merging.hh (scribo): Update code with lastest Theo's changes.
by Guillaume Lazzara 02 Mar '10
by Guillaume Lazzara 02 Mar '10
02 Mar '10
---
scribo/ChangeLog | 5 +
scribo/text/merging.hh | 857 +++++++++++++++++++++++++-----------------------
2 files changed, 446 insertions(+), 416 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index b29f31e..ee26d66 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-02 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * text/merging.hh (scribo): Update code with lastest Theo's
+ changes.
+
2010-02-19 Guillaume Lazzara <z(a)lrde.epita.fr>
Add a small tool to recognize text in a binary image.
diff --git a/scribo/text/merging.hh b/scribo/text/merging.hh
index d0fcfff..2dba26c 100644
--- a/scribo/text/merging.hh
+++ b/scribo/text/merging.hh
@@ -2,6 +2,7 @@
#include <fstream>
#include <sstream>
#include <vector>
+#include <set>
#include <algorithm>
#include <mln/core/image/image2d.hh>
@@ -13,6 +14,8 @@
#include <mln/data/fill.hh>
#include <mln/data/wrap.hh>
+#include <mln/make/box2d.hh>
+
#include <mln/util/timer.hh>
@@ -30,11 +33,82 @@ namespace scribo
using value::int_u8;
+ template <typename L>
+ inline
+ int delta_of_line(const scribo::line_info<L>& l)
+ {
+ return l.char_width() + l.char_space();
+ }
+
+
+ template <typename L>
+ inline
+ bool looks_like_a_text_line(const scribo::line_info<L>& l)
+ {
+ return
+ l.card() >= 3 // at least 3 components
+ && l.bbox().height() > 10 // and minimal height
+ && l.bbox().width() > l.bbox().height(); // and more horizontal-like than vertical
+ // FIXME: Later on, add a criterion based on the number
+ // of alignments (on top and bot).
+ }
+
+
+ /*!
+
+ */
+ template <typename L>
+ struct group_data_t
+ {
+ group_data_t()
+ : info(0)
+ {
+ }
+
+ group_data_t(const scribo::line_info<L>& info_)
+ : info(&info_)
+ {
+ finalize();
+ }
+
+ const scribo::line_info<L>* info;
+
+ // deduced:
+ int meanline;
+ bool looks_like_a_line;
+ unsigned delta;
+ box2d ebox;
+
+ void finalize()
+ {
+ if (info->x_height() == 0)
+ std::cerr << "oops" << std::endl;
+
+ meanline = info->baseline() - int(info->x_height()) + 1;
+
+ looks_like_a_line = looks_like_a_text_line(*info);
+
+ // delta = looks_like_a_line ? char_space + char_width : 0;
+ delta = delta_of_line(*info);
+ // FIXME: choose between:
+ // char_width + char_space
+ // 2 * char_width
+ // char_width + 2 * char_space
+
+ int A = info->a_height() - info->x_height(), D = - info->d_height();
+ if (A <= 2 && D > 2)
+ A = D;
+ if (D <= 2 && A > 2)
+ D = A;
+ ebox = mln::make::box2d(meanline - A, info->bbox().pmin().col() - delta,
+ info->baseline() + D, info->bbox().pmax().col() + delta);
+ }
+
+ };
template <typename T, typename T2>
void draw_box(image2d<T>& input, const box2d& b, T2 l)
{
-// data::fill((input | b).rw(), l);
const unsigned
delta = input.delta_index(dpoint2d(1,0)),
nrows = b.nrows(),
@@ -114,40 +188,40 @@ namespace scribo
template <typename L>
- unsigned do_union(scribo::line_set<L>& lines,
+ unsigned do_union(util::array<group_data_t<L> >& dta,
+ scribo::line_set<L>& lines,
unsigned l1,
unsigned l2,
util::array<unsigned>& parent)
{
- unsigned
- l1r = my_find_root(parent, l1),
- l2r = my_find_root(parent, l2);
- if (l1r == l2r)
- {
- std::cout << '.' << std::endl;
- return l1r;
- }
-
-// swap_ordering(l1, l2);
-
-// parent[l2] = l1; // The smallest label value is root.
-// lines(l1).fast_merge(lines(l2));
+ l1 = my_find_root(parent, l1);
+ l2 = my_find_root(parent, l2);
+ if (l1 == l2)
+ return l1;
- if (lines(l1).card() < lines(l2).card())
- std::swap(l1, l2);
+ swap_ordering(l1, l2);
+ parent[l2] = l1; // The smallest label value is root.
- parent[l2] = l1; // The text line with the most component count is root.
- lines(l1).fast_merge(lines(l2));
-
-// looks_like_a_text_line_[l1] = looks_like_a_text_line(lines(l1));
+ if (lines(l2).card() > lines(l1).card())
+ {
+ // we transfer data from the largest item to the root one.
+ scribo::line_info<L> tmp = lines(l1);
+ lines(l1) = lines(l2);
+ lines(l1).fast_merge(tmp);
+
+ // We must set manually the tag for lines(l2) since it is
+ // not used directly in merge process so its tag cannot be
+ // updated automatically.
+ lines(l2).update_tag(line::Merged);
+ }
+ else
+ lines(l1).fast_merge(lines(l2));
+ dta[l1].finalize();
// l1's tag is automatically set to line::Needs_Precise_Stats_Update
// l2's tag is automatically set to line::Merged
- // looks_like_txt_line[l1] = looks_like_txt_line[l1] || looks_like_txt_line[l2];
- // merge of "approximate stats": (n, (n x sum)) => useful for computing the enlarging delta
-
return l1;
}
@@ -160,168 +234,252 @@ namespace scribo
}
- void compute_data(// in
- unsigned tl, unsigned tr, unsigned bl, unsigned br,
- // out
- unsigned& l1, unsigned& l2, unsigned& l3, unsigned& l4,
- unsigned& count_non_zero,
- unsigned& count_different_labels)
+ template <typename L>
+ void draw_enlarged_box(image2d<unsigned>& output,
+ const util::array<group_data_t<L> >& dta,
+ unsigned l)
{
- l1 = l2 = l3 = l4 = 0;
- count_non_zero = 0;
- if (tl)
- {
- l1 = tl;
- ++count_non_zero;
- }
- if (tr)
- {
- if (! l1) l1 = tr;
- else if (tr != l1) l2 = tr;
- ++count_non_zero;
- }
- if (bl)
+ box2d b = dta[l].ebox;
+ b.crop_wrt(output.domain());
+ draw_box(output, b, l);
+ }
+
+
+ /*! \brief Check whether two lines can merge.
+
+ Criterions:
+ - Height ratio must be <= 1.7
+ - Baselines delta must be <= 3
+ - Boxes must not overlap too much.
+
+ */
+ template <typename L>
+ bool lines_can_merge(const scribo::line_info<L>& l1,
+ const scribo::line_info<L>& l2)
+ {
+ // Parameters.
+ const float x_ratio_max = 1.7, baseline_delta_max = 3;
+
+ // Similarity of x_height.
{
- if (! l1) l1 = bl;
- else if (! l2) { if (bl != l1) l2 = bl; }
- else if (bl != l1 && bl != l2) l3 = bl;
- ++count_non_zero;
+ float x1 = l1.x_height(), x2 = l2.x_height();
+ float x_ratio = std::max(x1, x2) / std::min(x1, x2);
+ if (x_ratio > x_ratio_max)
+ return false;
}
- if (br)
+
+ // Same baseline.
{
- if (! l1) l1 = br;
- else if (! l2) { if (br != l1) l2 = br; }
- else if (! l3) { if (br != l1 && br != l2) l3 = br; }
- else if (br != l1 && br != l2 && br != l3) l4 = br;
- ++count_non_zero;
+ if (std::abs(l1.baseline() - l2.baseline()) > baseline_delta_max)
+ return false;
}
- if (l1 == 0)
- count_different_labels = 0;
- else if (l2 == 0)
- count_different_labels = 1;
- else if (l3 == 0)
- count_different_labels = 2;
- else if (l4 == 0)
- count_different_labels = 3;
+ // left / right
+ unsigned
+ col1 = l1.bbox().pcenter().col(),
+ col2 = l2.bbox().pcenter().col();
+ if (col1 < col2)
+ return col1 + l1.bbox().width() / 4 < col2 - l2.bbox().width() / 4;
else
- count_different_labels = 4;
-
- if (count_different_labels == 0)
- std::cerr << "bug 0" << std::endl;
+ return col2 + l2.bbox().width() / 4 < col1 - l1.bbox().width() / 4;
}
template <typename L>
- bool looks_like_a_text_line(const scribo::line_info<L>& l)
+ int horizontal_distance(const scribo::line_info<L>& l1,
+ const scribo::line_info<L>& l2)
{
- return
- /*l.card() > 2 // suffisient cardinality
- && */l.bbox().height() > 20 // and suffisient height
- && l.bbox().width() > 50 // and suffisient width
- && l.bbox().width() > 2 * l.bbox().height(); // and horizontal-like.
-
- // FIXME:
- // if (n_comps > 2)
- // return true;
- // FIXME: Refine?
+ if (l1.bbox().pcenter().col() < l2.bbox().pcenter().col())
+ return l2.bbox().pmin().col() - l1.bbox().pmax().col();
+ else
+ return l1.bbox().pmin().col() - l2.bbox().pmax().col();
}
- template <typename L>
- int delta_of_line(const scribo::line_info<L>& l)
- {
- return l.char_width() /* / 2 */ + l.char_space();
- }
+ /*! \brief Check whether a non line component and a line can merge.
+ Criterions:
+ - Small height (c.height < l.x_height)
+ - Character width mean in 'c' must be lower than the character
+ width median of 'l'. (c.width / c.ncomps < l.char_width)
- template <typename L>
- void draw_enlarged_box(image2d<unsigned>& output,
- const scribo::line_info<L>& l)
- {
- if (looks_like_a_text_line(l))
- draw_box(output, enlarge(l.bbox(), delta_of_line(l)), l.id());
- else
- draw_box(output, l.bbox(), l.id());
- }
+ OR
+ - Small height (c.height < l.x_height)
+ - Not so long width (c.width < 5 * l.char_width)
+ - Aligned with the 'x' center ((l.baseline + l.meanline / 2) - c.center.row < 7)
+ - tiny spacing (horizontal distance < 5)
+ */
template <typename L>
- bool lines_can_merge(const scribo::line_info<L>& l1, const scribo::line_info<L>& l2)
+ bool non_line_and_line_can_merge(const scribo::line_info<L>& l_cur,
+ const group_data_t<L>& dta_cur, // current
+ const scribo::line_info<L>& l_ted,
+ const group_data_t<L>& dta_ted) // touched
{
- float hratio = float(l1.bbox().height()) / float(l2.bbox().height());
- float xhratio = float(l1.x_height()) / float(l2.x_height());
- if ((hratio < 0.5 || hratio > 2.) && (xhratio < 0.8 || xhratio > 1.25)) // too different heights
+ if (dta_cur.looks_like_a_line || ! dta_ted.looks_like_a_line)
return false;
+ // the current object is a NON-textline
+ // the background (touched) object is a textline
+
+
+ // FIXME: THERE IS A BUG
+ // The second condition should be replaced by the commented one.
+ //
+ // General case (for tiny components like --> ',:."; <--):
+ if (l_cur.bbox().height() < l_ted.x_height()
+ && float(l_cur.char_width()) / float(l_cur.card()) < l_ted.char_width())
+// && float(l_cur.bbox().width()) / float(l_cur.card()) < l_ted.char_width())
+ return true;
+
+
+ // Special case for '---':
+ if (// small height:
+ l_cur.bbox().height() < l_ted.x_height()
+ // // not so long width:
+ && l_cur.bbox().width() < 5 * l_ted.char_width()
+ // align with the 'x' center:
+ && std::abs((l_ted.baseline() + dta_ted.meanline) / 2 - l_cur.bbox().pcenter().row()) < 7
+ // tiny spacing:
+ && horizontal_distance(l_cur, l_ted) < 5
+ )
+ {
+ return true;
+ }
- unsigned
- col1 = l1.bbox().pcenter().col(),
- col2 = l2.bbox().pcenter().col();
- if (col1 < col2)
- return col1 + l1.bbox().width() / 4 < col2 - l2.bbox().width() / 4;
- else
- return col2 + l2.bbox().width() / 4 < col1 - l1.bbox().width() / 4;
- }
+ // Special case
+// // FIXME: Box are aligned; the main problem is that we can have multiple valid box
+// // depending on the presence of descent and/or ascent!
+// if (std::abs(dta_cur.box.pmin().row() - dta_ted.box.pmin().row()) < 5 // top
+// && std::abs(dta_cur.box.pmax().row() - dta_ted.box.pmax().row()) < 5 // bot
+// && ((dta_ted.box.pcenter().col() < dta_cur.box.pcenter().col() && dta_cur.box.pmin().col() - dta_ted.box.pmax().col() < 10) // small distance when cur is at right
+// || (dta_cur.box.pcenter().col() < dta_ted.box.pcenter().col() && dta_ted.box.pmin().col() - dta_cur.box.pmax().col() < 10)) // or when is at left.
+// )
+// return true;
-// struct line_info<L>
-// {
-// bool looks_like_a_text_line; // pre-computed
-// int delta_of_line; // pre-computed before each merging pass
-// // FIXME:
-// //
-// // Important note: after merging two lines, we draw the
-// // merged line over the existing one; we have to ensure that we
-// // cover the previous rectangle (otherwise we have a label in
-// // 'output' that is not used anymore! and it can mix up the
-// // detection of upcoming merges...) so this delta has to remain
-// // the same during one pass. Another solution (yet more costly)
-// // could be of erasing the previous rectangle before re-drawing...
-// };
+ return false;
+
+ // The unused criterion below is too restrictive; it does not work
+ // for ending '-', and neither for ',' when there's no descent.
+ // dta_ted.box.has(dta_cur.box.pcenter())
+ }
+ /*! \brief Merge text lines.
+
+ This algorithm iterates over all the components ordered by size.
+ It uses a 2d labeled image, tmp_box, to draw component bounding
+ boxes and uses that image to check bounding box collisions.
+ Depending on that collisions and whether the component looks like
+ a text line or not, bounding boxes are merged.
+
+ \verbatim
+ ALGORITHM:
+ for each component 'cur' in decreasing order
+ if already merged
+ continue
+
+ ///
+ /// x-----------x
+ /// | |
+ /// x x x
+ /// | |
+ /// x-----------x
+ ///
+
+ Set labels <- Every labels corresponding to the colliding bounding
+ boxes (uses only the 7 sites detailled above).
+
+ If label.card == 1
+ l = label.get(0);
+ If l != background
+ If looks_like_a_line(cur)
+ If looks_like_a_line(l)
+ // Error case: a line is included in a line.
+ else
+ // Line cur is included in a frame or a drawing.
+ draw_enlarged_box(l)
+ end
+ else
+ If looks_like_a_line(l)
+ // Component cur is a punctuation overlapping with line l.
+ l_ <- do_union(cur, l)
+ draw_enlarged_box(l_)
+ end
+ end
+ else
+ If looks_like_a_line(cur)
+ // Component cur is a new line.
+ draw_enlarged_box(l)
+ end
+ end
+ else
+ for each label l in labels
+ If l == background
+ continue
+ end
+
+ If lines_can_merge(cur, l)
+ l_ <- do_union(cur, l)
+ draw_enlarged_box(l_)
+ continue
+ end
+
+ If !looks_like_a_line(cur) and looks_like_a_line(l)
+ If non_line_and_line_can_merge(cur, l)
+ // A punctuation merge with a line
+ l_ <- do_union(cur, l)
+ draw_enlarged_box(l_)
+ continue
+ else
+ // None
+ end
+ else
+ // Error case
+ end
+ end
+
+ \endverbatim
+ */
+ // FIXME:
+ //
+ // Important note: after merging two lines, we draw the
+ // merged line over the existing one; we have to ensure that we
+ // cover the previous rectangle (otherwise we have a label in
+ // 'output' that is not used anymore! and it can mix up the
+ // detection of upcoming merges...) so this delta has to remain
+ // the same during one pass. Another solution (yet more costly)
+ // could be of erasing the previous rectangle before re-drawing...
+ //
template <typename L>
image2d<unsigned>
one_merge_pass(unsigned ith_pass,
const box2d& domain,
std::vector<scribo::line_id_t>& v,
scribo::line_set<L>& lines,
- util::array<unsigned>& parent,
- util::array<bool>& looks_like_a_text_line_,
- bool last_pass = false)
+ util::array<group_data_t<L> >& dta,
+ util::array<unsigned>& parent)
{
- image2d<unsigned> canvas(domain);
- data::fill(canvas, 0);
+ image2d<unsigned> output(domain);
+ data::fill(output, 0);
image2d<value::int_u8> log(domain);
data::fill(log, 0);
- unsigned
- count_new = 0,
- count_include = 0,
- count_merge = 0,
- count_grow = 0,
- count_bad_3 = 0,
- count_bad_4 = 0;
+ const unsigned n = dta.nelements() - 1;
+ unsigned l_;
unsigned
-
- count_1_grow_ok = 0,
- count_1_grow_KO = 0,
- count_1_merge_ok = 0,
- count_1_merge_KO = 0,
- count_1_other = 0,
-
- count_2_merge_hyphen_ok = 0,
- count_2_merge_hyphen_KO = 0,
- count_2_merge_all_ok = 0,
- count_2_merge_all_KO = 0,
- count_2_merge_other = 0;
-
- const unsigned n = lines.nelements();
- unsigned l_;
+ count_txtline_IN_txtline = 0,
+ count_txtline_IN_junk = 0,
+ count_two_lines_merge = 0,
+ count_new_txtline = 0,
+ count_comp_IN_txtline = 0,
+ count_comp_HITS_txtline = 0,
+ count_WTF = 0;
for (int i = n - 1; i >= 0; --i)
{
@@ -332,324 +490,191 @@ namespace scribo
box2d b = lines(l).bbox();
- unsigned tl, tr, bl, br;
+ unsigned tl, tr, ml, mc, mr, bl, br;
{
- box2d b_ =
- looks_like_a_text_line_(lines(l).id()) ?
- enlarge(b, delta_of_line(lines(l))) :
- b;
- tl = canvas(b_.pmin());
- tr = canvas.at_(b_.pmin().row(), b_.pmax().col());
- bl = canvas.at_(b_.pmax().row(), b_.pmin().col());
- br = canvas(b_.pmax());
- }
+ box2d b_;
-// {
-// tl = canvas(b.pmin());
-// tr = canvas.at_(b.pmin().row(), b.pmax().col());
-// bl = canvas.at_(b.pmax().row(), b.pmin().col());
-// br = canvas(b.pmax());
-// }
+ b_ = enlarge(lines(l).bbox(), dta[l].delta);
+ b_.crop_wrt(output.domain());
- if (tl == tr && bl == br && tl == bl) // Same behavior for all corners.
- {
- if (tl != 0)
- {
- // Main case: it is an "included" box (falling in an already drawn box)
- ++count_include;
- // Merge lines #tl and #l.
- l_ = do_union(lines, tl, l, parent);
- // We have to re-draw the original largest line since
- // it may change of label (take the one of the included line).
- draw_enlarged_box(canvas, lines(l_));
-
- // Log:
- draw_box(log, b, 128);
- }
- else
- {
- // Main case: it is a "new" box, to be drawn in the background.
- ++count_new;
-
- // Extra test:
- if (canvas(b.pcenter()) == 0)
- // confirmation that we are not in this rare pathological case:
- //
- // o---o
- // +----|---|---------+
- // | | ? | |
- // +----|---|---------+
- // o---o
- {
- draw_enlarged_box(canvas, lines(l));
- // Log:
- draw_box(log, b, 127);
- }
- else
- {
- // FIXME:
- // We have to tag as pathological the line l.
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
- std::cout << "pathological ''new box''" << std::endl;
- }
- }
- }
- else
- {
- // Particular cases.
- unsigned
- l1, l2, l3, l4,
- count_non_zero, count_different_labels;
-
- compute_data(// in
- tl, tr, bl, br,
- // out
- l1, l2, l3, l4,
- count_non_zero, count_different_labels);
+ /*
+ tl tr
+ x---------------x
+ | |
+ | mc |
+ ml x x x mr
+ | |
+ | |
+ x---------------x
+ bl br
+ */
- if (count_different_labels == 0)
- std::cout << "bug 0000" << std::endl;
+ tl = output(b_.pmin());
+ tr = output.at_(b_.pmin().row(), b_.pmax().col());
+ ml = output.at_(b_.pcenter().row(), b_.pmin().col());
+ mc = output.at_(b_.pcenter().row(), b_.pcenter().col());
+ mr = output.at_(b_.pcenter().row(), b_.pmax().col());
+ bl = output.at_(b_.pmax().row(), b_.pmin().col());
+ br = output(b_.pmax());
+ }
- if (count_different_labels == 1 && count_non_zero == 3)
- {
- // +----------+
- // | x--x |
- // | | | |
- // | x--0 !! |
- // +----------+
- std::cout << "bug 1-3" << std::endl;
- }
-
- // FIXME: Handle the case where count_different_labels ==
- // 2 && count_non_zero == 3?
-
-
- if (count_different_labels == 4)
- {
- ++count_bad_4;
-
- // FIXME:
- // We have to tag as pathological the line l.
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
-
- // Log:
- draw_box(log, b, 254);
- }
-
-
- if (count_different_labels == 3)
- {
- ++count_bad_3;
-
- // FIXME:
- // We have to tag as pathological the line l.
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
-
- // Log:
- draw_box(log, b, 253);
- }
+ typedef std::set<unsigned> set_t;
+ std::set<unsigned> labels;
+ labels.insert(tl);
+ labels.insert(tl);
+ labels.insert(tr);
+ labels.insert(ml);
+ labels.insert(mc);
+ labels.insert(mr);
+ labels.insert(bl);
+ labels.insert(br);
- if (count_different_labels == 1) // Usually a "grow" case thanks to comma, hyphen, etc.
+ if (labels.size() == 1) // Same behavior for all ancors.
+ {
+ if (mc != 0)
{
- ++count_grow;
-
- if (count_non_zero == 0 || count_non_zero == 4)
- std::cerr << "bug 1-04" << std::endl;
-
- // We have to test if we shall merge!
-
- bool
- l_is_line = looks_like_a_text_line_(lines(l).id()),
- l1_is_line = looks_like_a_text_line_(lines(l1).id());
+ // Main case: it is an "included" box (falling in an already drawn box)
- if (! l_is_line && l1_is_line)
+ if (dta[l].looks_like_a_line)
{
- // This is the classical "grow" case: a small component
- // makes a larger one grow.
-
- // l should be a comma, hyphen, etc. of the line l1
- // so we try to make line l1 grow.
- if (lines(l).bbox().height() < lines(l1).bbox().height()
- && lines(l).bbox().width() < lines(l1).bbox().width())
+ if (dta[mc].looks_like_a_line)
{
- // line l height and width are resp. smaller than line l1 height and width.
- ++count_1_grow_ok;
- l_ = do_union(lines, l, l1, parent);
- draw_enlarged_box(canvas, lines(l_));
- // Log:
- draw_box(log, b, 100);
+ ++count_txtline_IN_txtline;
+ std::cout << "weird: inclusion of a txt_line in a txt_line!" << std::endl;
}
else
{
- ++count_1_grow_KO;
-
- // ,-.
- // | | l etait une fois...
- // | |
- // | | bla bla bla.
- // | |
- // | | bla bla bla
- // `-'
- //
- // It is usually the case of a dropped initial...
- //
- // FIXME: Do we want to set this line as pathological?
-
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
-
- draw_box(canvas, b, l);
+ ++count_txtline_IN_junk;
+ // a non-line (probably a drawing or a frame) includes a line
+ draw_enlarged_box(output, dta, l);
// Log:
- draw_box(log, b, 101);
+ draw_box(log, b, 100);
}
- // It seems better to distinguish between the
- // different cases : if the height of line l is
- // larger than the width, I can be a comma so I
- // only merge if my location is at the bottom of
- // line l1, and so on.
}
-
- else if (l_is_line && l1_is_line)
+ else // the current object is NOT a line
{
- // Less common case than the above "grow" one:
- // two lines merge.
-
- if (lines_can_merge(lines(l), lines(l1)))
- {
- ++count_1_merge_ok;
- l_ = do_union(lines, l, l1, parent);
- draw_enlarged_box(canvas, lines(l_));
- // Log:
- draw_box(log, b, 110);
- }
- else
+ if (dta[mc].looks_like_a_line)
{
- ++count_1_merge_KO;
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
+ ++count_comp_IN_txtline;
+ // FIXME: critere petouille a ajouter ici
+
+ // Merge non-line #l into line #mc.
+ l_ = do_union(dta, lines, mc, l, parent);
+ // We have to re-draw the original largest line since
+ // it may change of label (take the one of the included line).
+ draw_enlarged_box(output, dta, l_);
// Log:
- draw_box(log, b, 111);
+ draw_box(log, b, 128);
}
}
- else
+ }
+ else
+ {
+ // Main case: it is a "new" box, that might be drawn in the background.
+
+ // we only draw this box if it is a text-line!!!
+ if (dta[l].looks_like_a_line)
{
- ++count_1_other;
+ ++count_new_txtline;
+ draw_enlarged_box(output, dta, l);
// Log:
- draw_box(log, b, 120);
+ draw_box(log, b, 127);
}
+ else
+ draw_box(log, b, 1);
}
-
-
- if (count_different_labels == 2)
+ }
+ else
+ {
+ // Particular cases.
+ for (set_t::const_iterator it = labels.begin();
+ it != labels.end();
+ ++it)
{
+ unsigned lcand = *it;
- bool
- l_is_line = looks_like_a_text_line_(lines(l).id()),
- l1_is_line = looks_like_a_text_line_(lines(l1).id()),
- l2_is_line = looks_like_a_text_line_(lines(l2).id());
+ if (lcand == 0) // Skip background.
+ continue;
- if (! l_is_line && l1_is_line && l2_is_line)
+ if (lines_can_merge(lines(l), lines(lcand)))
{
- // Typically an hyphen joins two tines (two chunks of the same line).
- if (lines_can_merge(lines(l1), lines(l2)))
- {
- ++count_2_merge_hyphen_ok;
- do_union(lines, l1, l2, parent);
- l_ = do_union(lines, l, l2, parent);
- draw_enlarged_box(canvas, lines(l_));
- // Log:
- draw_box(log, b, 80);
- }
- else
- {
- ++count_2_merge_hyphen_KO;
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
- // Log:
- draw_box(log, b, 81);
- }
+ ++count_two_lines_merge;
+ l_ = do_union(dta, lines, l, lcand, parent);
+ draw_enlarged_box(output, dta, l_);
+ // Log:
+ draw_box(log, b, 151);
+ continue;
}
- else if (l_is_line && l1_is_line && l2_is_line)
+
+
+ if (! dta[l].looks_like_a_line && dta[lcand].looks_like_a_line)
{
- // Typically three chunks of the same line.
- if (lines_can_merge(lines(l1), lines(l2))
- && lines_can_merge(lines(l), lines(l1))
- && lines_can_merge(lines(l), lines(l2)))
+ ++count_comp_HITS_txtline;
+ if (non_line_and_line_can_merge(lines(l), dta[l], lines(lcand), dta[lcand]))
+ // a petouille merges with a text line?
{
- ++count_2_merge_all_ok;
- do_union(lines, l1, l2, parent);
- l_ = do_union(lines, l, l2, parent);
- draw_enlarged_box(canvas, lines(l_));
+ ++count_comp_HITS_txtline;
+ l_ = do_union(dta, lines, l, lcand, parent);
+ draw_enlarged_box(output, dta, l_);
// Log:
- draw_box(log, b, 90);
+ draw_box(log, b, 169);
+ continue;
}
else
{
- ++count_2_merge_all_KO;
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
// Log:
- draw_box(log, b, 91);
+ draw_box(log, b, 254);
}
}
else
{
- ++count_2_merge_other;
- if (last_pass)
- lines(l).update_tag(scribo::line::Pathological);
+ ++count_WTF;
// Log:
draw_box(log, b, 255);
}
- // FIXME: Perhaps there is only one merge...
-
}
-
}
+
}
- std::cout
- << "new = " << count_new << std::endl
- << "inc = " << count_include << std::endl
- << "mrg = " << count_merge << std::endl
- << "grw = " << count_grow << std::endl
- << "bd3 = " << count_bad_3 << std::endl
- << "bd4 = " << count_bad_4 << std::endl;
std::cout
- << std::endl
- << "#1 grow ok = " << count_1_grow_ok << std::endl
- << "#1 grow KO = " << count_1_grow_KO << std::endl
- << "#1 merge ok = " << count_1_merge_ok << std::endl
- << "#1 merge KO = " << count_1_merge_KO << std::endl
- << "#1 other = " << count_1_other << std::endl;
+ << " new txtline = " << count_new_txtline << std::endl
+ << " comp IN txtline = " << count_comp_IN_txtline << std::endl
+ << " 2 lines merge = " << count_two_lines_merge << std::endl
+ << " comp HITS txtline = " << count_comp_HITS_txtline << std::endl
+ << " txtline IN junk = " << count_txtline_IN_junk << std::endl
+ << " txtline IN txtline = " << count_txtline_IN_txtline << std::endl
+ << " WTF! = " << count_WTF << std::endl;
+
+
+ (void) ith_pass;
+// if (ith_pass == 1)
+// {
+// mln::io::pgm::save(log, "log_1.pgm");
+// mln::io::pgm::save(data::wrap(int_u8(), output), "log_1e.pgm");
+// }
+// else if (ith_pass == 2)
+// {
+// mln::io::pgm::save(log, "log_2.pgm");
+// mln::io::pgm::save(data::wrap(int_u8(), output), "log_2e.pgm");
+// }
+// else if (ith_pass == 3)
+// {
+// mln::io::pgm::save(log, "log_3.pgm");
+// mln::io::pgm::save(data::wrap(int_u8(), output), "log_3e.pgm");
+// }
+
+ return output;
- std::cout
- << std::endl
- << "#2 merge hyphen ok = " << count_2_merge_hyphen_ok << std::endl
- << "#2 merge hyphen KO = " << count_2_merge_hyphen_KO << std::endl
- << "#2 merge all ok = " << count_2_merge_all_ok << std::endl
- << "#2 merge all KO = " << count_2_merge_all_KO << std::endl
- << "#2 merge other = " << count_2_merge_other << std::endl;
-
- if (ith_pass == 1)
- mln::io::pgm::save(log, "log_1.pgm");
- else if (ith_pass == 2)
- mln::io::pgm::save(log, "log_2.pgm");
- else if (ith_pass == 3)
- mln::io::pgm::save(log, "log_3.pgm");
-
- return canvas;
}
@@ -672,6 +697,8 @@ namespace scribo
scribo::line_set<L> lines_;
};
+
+
template <typename L>
scribo::line_set<L>
draw_boxes(const box2d& input_domain,
@@ -702,34 +729,32 @@ namespace scribo
util::timer t;
- // Caching whether a line looks like a text line.
- util::array<bool>
- looks_like_a_text_line_(unsigned(lines.nelements()) + 1);
+ // Caching line temporary data.
+ util::array<group_data_t<L> >
+ dta;
+ dta.reserve(unsigned(lines.nelements()) + 1);
+ dta.append(group_data_t<L>());
for_all_lines(l, lines)
- looks_like_a_text_line_[l] = looks_like_a_text_line(lines(l));
-
+ dta.append(group_data_t<L>(lines(l)));
// First pass
t.start();
- one_merge_pass(1, input_domain, v, lines,
- parent, looks_like_a_text_line_);
+ one_merge_pass(1, input_domain, v, lines, dta, parent);
float ts = t.stop();
std::cout << "time " << ts << std::endl;
// Second pass
t.start();
- canvas = one_merge_pass(2, input_domain, v, lines,
- parent, looks_like_a_text_line_,
- true); // <- last pass
+ canvas = one_merge_pass(2, input_domain, v, lines, dta, parent); // <- last pass
ts = t.stop();
std::cout << "time " << ts << std::endl;
- using value::int_u8;
+// using value::int_u8;
//io::pgm::save(data::wrap(int_u8(), canvas), "merge_result.pgm");
- mln::io::ppm::save(labeling::colorize(value::rgb8(), canvas),
- "merge_result.ppm");
+// mln::io::ppm::save(labeling::colorize(value::rgb8(), canvas),
+// "merge_result.ppm");
return lines;
--
1.5.6.5
1
0