Olena-patches
Threads by month
- ----- 2025 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 9625 discussions
16 Nov '10
* demo/viewer/Makefile.am: Do not install includes.
* scribo.mk (utilexecdir): New variable.
* src/Makefile.am,
* src/binarization/Makefile.am: Install usefull binaries in
utilexecdir.
* src/contest/hdibco-2010/Makefile.am,
* src/debug/Makefile.am,
* src/filter/Makefile.am,
* src/misc/Makefile.am,
* src/postprocessing/Makefile.am,
* src/preprocessing/Makefile.am,
* src/primitive/extract/Makefile.am,
* src/primitive/find/Makefile.am,
* src/primitive/group/Makefile.am,
* src/table/Makefile.am,
* src/text/Makefile.am: Do not install theses binaries.
---
scribo/ChangeLog | 24 +++++++++
scribo/demo/review/Makefile.am | 1 -
scribo/demo/viewer/Makefile.am | 72 ++++++++++++++--------------
scribo/scribo.mk | 2 +
scribo/src/Makefile.am | 10 ++--
scribo/src/binarization/Makefile.am | 63 +++++++++++++-----------
scribo/src/contest/hdibco-2010/Makefile.am | 2 +-
scribo/src/debug/Makefile.am | 6 +-
scribo/src/filter/Makefile.am | 5 +-
scribo/src/misc/Makefile.am | 5 +-
scribo/src/postprocessing/Makefile.am | 2 +-
scribo/src/preprocessing/Makefile.am | 61 +++++++++++-------------
scribo/src/primitive/extract/Makefile.am | 5 +-
scribo/src/primitive/find/Makefile.am | 5 +-
scribo/src/primitive/group/Makefile.am | 2 +-
scribo/src/table/Makefile.am | 7 ++-
scribo/src/text/Makefile.am | 9 ++--
17 files changed, 156 insertions(+), 125 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 8285b94..2f58ec7 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,29 @@
2010-08-26 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Setup what to install with Scribo.
+
+ * demo/viewer/Makefile.am: Do not install includes.
+
+ * scribo.mk (utilexecdir): New variable.
+
+ * src/Makefile.am,
+ * src/binarization/Makefile.am: Install usefull binaries in
+ utilexecdir.
+
+ * src/contest/hdibco-2010/Makefile.am,
+ * src/debug/Makefile.am,
+ * src/filter/Makefile.am,
+ * src/misc/Makefile.am,
+ * src/postprocessing/Makefile.am,
+ * src/preprocessing/Makefile.am,
+ * src/primitive/extract/Makefile.am,
+ * src/primitive/find/Makefile.am,
+ * src/primitive/group/Makefile.am,
+ * src/table/Makefile.am,
+ * src/text/Makefile.am: Do not install theses binaries.
+
+2010-08-26 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Make use of autotroll in demo/review.
* demo/review/Makefile.am: Make use of autotroll.
diff --git a/scribo/demo/review/Makefile.am b/scribo/demo/review/Makefile.am
index cd793db..323647f 100644
--- a/scribo/demo/review/Makefile.am
+++ b/scribo/demo/review/Makefile.am
@@ -38,5 +38,4 @@ noinst_HEADERS = src/mainwindow.hh
EXTRA_DIST = \
- README \
review.qrc
diff --git a/scribo/demo/viewer/Makefile.am b/scribo/demo/viewer/Makefile.am
index a0112c6..eec19b9 100644
--- a/scribo/demo/viewer/Makefile.am
+++ b/scribo/demo/viewer/Makefile.am
@@ -14,27 +14,27 @@
include $(top_srcdir)/build-aux/autotroll.mk
-bin_PROGRAMS = viewer
-viewer_SOURCES = $(BUILT_SOURCES) \
- viewer.cc \
- main.cc \
- image_widget.cc \
- xml_widget.cc \
- key_widget.cc \
- property_widget.cc \
- browser_widget.cc \
- image_scene.cc \
- image_view.cc \
- dommodel.cc \
- domitem.cc \
- image_region.cc \
- help_dialog.cc \
- step_widget.cc
+bin_PROGRAMS = scribo-viewer
+scribo_viewer_SOURCES = $(BUILT_SOURCES) \
+ viewer.cc \
+ main.cc \
+ image_widget.cc \
+ xml_widget.cc \
+ key_widget.cc \
+ property_widget.cc \
+ browser_widget.cc \
+ image_scene.cc \
+ image_view.cc \
+ dommodel.cc \
+ domitem.cc \
+ image_region.cc \
+ help_dialog.cc \
+ step_widget.cc
-viewer_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) -I$(srcdir)
-viewer_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -O3
-viewer_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS)
-viewer_LDADD = $(QT_LIBS) $(LDADD)
+scribo_viewer_CPPFLAGS = $(QT_CPPFLAGS) $(AM_CPPFLAGS) -I$(srcdir)
+scribo_viewer_CXXFLAGS = $(QT_CXXFLAGS) $(AM_CXXFLAGS) -O3
+scribo_viewer_LDFLAGS = $(QT_LDFLAGS) $(LDFLAGS)
+scribo_viewer_LDADD = $(QT_LIBS) $(LDADD)
BUILT_SOURCES = viewer.moc.cc \
image_widget.moc.cc \
@@ -50,21 +50,21 @@ BUILT_SOURCES = viewer.moc.cc \
help_dialog.moc.cc \
step_widget.moc.cc
-include_HEADERS = viewer.hh \
- viewer.hxx \
- image_widget.hh \
- xml_widget.hh \
- key_widget.hh \
- property_widget.hh \
- browser_widget.hh \
- image_scene.hh \
- image_view.hh \
- dommodel.hh \
- domitem.hh \
- image_region.hh \
- image_region.hxx \
- common.hh \
- help_dialog.hh \
- step_widget.hh
+noinst_HEADERS = viewer.hh \
+ viewer.hxx \
+ image_widget.hh \
+ xml_widget.hh \
+ key_widget.hh \
+ property_widget.hh \
+ browser_widget.hh \
+ image_scene.hh \
+ image_view.hh \
+ dommodel.hh \
+ domitem.hh \
+ image_region.hh \
+ image_region.hxx \
+ common.hh \
+ help_dialog.hh \
+ step_widget.hh
EXTRA_DIST = README
diff --git a/scribo/scribo.mk b/scribo/scribo.mk
index c899631..9c11c0f 100644
--- a/scribo/scribo.mk
+++ b/scribo/scribo.mk
@@ -25,3 +25,5 @@ AM_CPPFLAGS = \
SCRIBO_CXXFLAGS = @SCRIBO_CXXFLAGS@
AM_CXXFLAGS = $(SCRIBO_CXXFLAGS)
+
+utilexecdir = $(libexecdir)/scribo
\ No newline at end of file
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 4222554..a977d38 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -32,12 +32,12 @@ SUBDIRS = \
-bin_PROGRAMS =
+utilexec_PROGRAMS =
if HAVE_TESSERACT
- bin_PROGRAMS += pbm_text_in_doc
+ utilexec_PROGRAMS += pbm_text_in_doc
pbm_text_in_doc_SOURCES = pbm_text_in_doc.cc
pbm_text_in_doc_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
@@ -53,7 +53,7 @@ endif HAVE_TESSERACT
if HAVE_MAGICKXX
- bin_PROGRAMS += text_in_doc_preprocess
+ utilexec_PROGRAMS += text_in_doc_preprocess
text_in_doc_preprocess_SOURCES = text_in_doc_preprocess.cc
text_in_doc_preprocess_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
@@ -62,7 +62,7 @@ if HAVE_MAGICKXX
$(MAGICKXX_LDFLAGS)
- bin_PROGRAMS += text_in_picture
+ utilexec_PROGRAMS += text_in_picture
text_in_picture_SOURCES = text_in_picture.cc
text_in_picture_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
@@ -72,7 +72,7 @@ if HAVE_MAGICKXX
if HAVE_TESSERACT
- bin_PROGRAMS += text_recognition_in_picture
+ utilexec_PROGRAMS += text_recognition_in_picture
text_recognition_in_picture_SOURCES = text_recognition_in_picture.cc
text_recognition_in_picture_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
diff --git a/scribo/src/binarization/Makefile.am b/scribo/src/binarization/Makefile.am
index c86b70a..2b01a74 100644
--- a/scribo/src/binarization/Makefile.am
+++ b/scribo/src/binarization/Makefile.am
@@ -17,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
pgm_global_threshold_auto \
pgm_sauvola \
pgm_sauvola_ms \
@@ -37,51 +37,56 @@ ppm_sauvola_ms_split_SOURCES = ppm_sauvola_ms_split.cc
if HAVE_MAGICKXX
- bin_PROGRAMS += \
- sauvola_ms_fg \
+
+ noinst_PROGRAMS += \
+ sauvola_debug \
+ sauvola_ms_debug
+
+ utilexec_PROGRAMS = \
sauvola \
- sauvola_debug \
sauvola_ms \
- sauvola_ms_debug \
+ sauvola_ms_fg \
sauvola_ms_split
- sauvola_ms_fg_SOURCES = sauvola_ms_fg.cc
- sauvola_ms_fg_CPPFLAGS = $(AM_CPPFLAGS) \
+
+ sauvola_ms_fg_SOURCES = sauvola_ms_fg.cc
+ sauvola_ms_fg_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
- sauvola_ms_fg_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS)
+ sauvola_ms_fg_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
- sauvola_SOURCES = sauvola.cc
- sauvola_CPPFLAGS = $(AM_CPPFLAGS) \
+ sauvola_SOURCES = sauvola.cc
+ sauvola_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
- sauvola_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS)
+ sauvola_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
- sauvola_debug_SOURCES = sauvola_debug.cc
- sauvola_debug_CPPFLAGS = $(AM_CPPFLAGS) \
+ sauvola_debug_SOURCES = sauvola_debug.cc
+ sauvola_debug_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
- sauvola_debug_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS)
+ sauvola_debug_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
- sauvola_ms_SOURCES = sauvola_ms.cc
- sauvola_ms_CPPFLAGS = $(AM_CPPFLAGS) \
+ sauvola_ms_SOURCES = sauvola_ms.cc
+ sauvola_ms_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
- sauvola_ms_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS)
+ sauvola_ms_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
- sauvola_ms_debug_SOURCES = sauvola_ms_debug.cc
- sauvola_ms_debug_CPPFLAGS = $(AM_CPPFLAGS) -DSCRIBO_SAUVOLA_DEBUG \
+ sauvola_ms_debug_SOURCES = sauvola_ms_debug.cc
+ sauvola_ms_debug_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DSCRIBO_SAUVOLA_DEBUG \
$(MAGICKXX_CPPFLAGS)
- sauvola_ms_debug_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS)
+ sauvola_ms_debug_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
- sauvola_ms_split_SOURCES = sauvola_ms_split.cc
- sauvola_ms_split_CPPFLAGS = $(AM_CPPFLAGS) \
+ sauvola_ms_split_SOURCES = sauvola_ms_split.cc
+ sauvola_ms_split_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
- sauvola_ms_split_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS)
+ sauvola_ms_split_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS)
endif HAVE_MAGICKXX
diff --git a/scribo/src/contest/hdibco-2010/Makefile.am b/scribo/src/contest/hdibco-2010/Makefile.am
index a59e424..5730b26 100644
--- a/scribo/src/contest/hdibco-2010/Makefile.am
+++ b/scribo/src/contest/hdibco-2010/Makefile.am
@@ -19,7 +19,7 @@
include $(top_srcdir)/scribo/tests/tests.mk
-bin_PROGRAMS = sauvola_ms_hdibco
+noinst_PROGRAMS = sauvola_ms_hdibco
sauvola_ms_hdibco_SOURCES = sauvola_ms_hdibco.cc
diff --git a/scribo/src/debug/Makefile.am b/scribo/src/debug/Makefile.am
index f3dd4f9..d203f5c 100644
--- a/scribo/src/debug/Makefile.am
+++ b/scribo/src/debug/Makefile.am
@@ -17,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
show_info_x_height \
show_info_median_inter_characters \
show_links_left_right_links_validation \
@@ -75,8 +75,8 @@ show_objects_thin_SOURCES = show_objects_thin.cc
if HAVE_MAGICKXX
- bin_PROGRAMS += highlight_text_area
- highlight_text_area_SOURCES = highlight_text_area.cc
+ noinst_PROGRAMS += highlight_text_area
+ highlight_text_area_SOURCES = highlight_text_area.cc
highlight_text_area_CPPFLAGS = $(AM_CPPFLAGS) \
`Magick++-config --cppflags`
highlight_text_area_LDFLAGS = $(AM_LDFLAGS) \
diff --git a/scribo/src/filter/Makefile.am b/scribo/src/filter/Makefile.am
index 4e2b8d1..5d5b721 100644
--- a/scribo/src/filter/Makefile.am
+++ b/scribo/src/filter/Makefile.am
@@ -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.
#
@@ -16,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
objects_large \
objects_small \
objects_thick \
diff --git a/scribo/src/misc/Makefile.am b/scribo/src/misc/Makefile.am
index 693b579..0323aaa 100644
--- a/scribo/src/misc/Makefile.am
+++ b/scribo/src/misc/Makefile.am
@@ -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.
#
@@ -16,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
dmap \
morpho \
negate \
diff --git a/scribo/src/postprocessing/Makefile.am b/scribo/src/postprocessing/Makefile.am
index b21cac2..f0c588d 100644
--- a/scribo/src/postprocessing/Makefile.am
+++ b/scribo/src/postprocessing/Makefile.am
@@ -19,7 +19,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
fill_object_holes
diff --git a/scribo/src/preprocessing/Makefile.am b/scribo/src/preprocessing/Makefile.am
index 0c6e00a..ef62ed6 100644
--- a/scribo/src/preprocessing/Makefile.am
+++ b/scribo/src/preprocessing/Makefile.am
@@ -17,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
denoise_bg \
denoise_fg \
homogeneous_contrast \
@@ -32,49 +32,44 @@ unskew_SOURCES = unskew.cc
if HAVE_MAGICKXX
- bin_PROGRAMS += split_bg_fg
- split_bg_fg_SOURCES = split_bg_fg.cc
+ noinst_PROGRAMS += split_bg_fg
+ split_bg_fg_SOURCES = split_bg_fg.cc
split_bg_fg_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
+ split_bg_fg_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
- split_bg_fg_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS) \
- -lpthread
-
- bin_PROGRAMS += rotate
- rotate_SOURCES = rotate.cc
+ noinst_PROGRAMS += rotate
+ rotate_SOURCES = rotate.cc
rotate_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
+ rotate_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
- rotate_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS) \
- -lpthread
-
- bin_PROGRAMS += rotate_90
- rotate_90_SOURCES = rotate_90.cc
+ noinst_PROGRAMS += rotate_90
+ rotate_90_SOURCES = rotate_90.cc
rotate_90_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
+ rotate_90_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
- rotate_90_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS) \
- -lpthread
-
- bin_PROGRAMS += to_pgm
- to_pgm_SOURCES = to_pgm.cc
- to_pgm_CPPFLAGS = $(AM_CPPFLAGS) \
- $(MAGICKXX_CPPFLAGS)
+ noinst_PROGRAMS += to_pgm
+ to_pgm_SOURCES = to_pgm.cc
+ to_pgm_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(MAGICKXX_CPPFLAGS)
+ to_pgm_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
- to_pgm_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS) \
- -lpthread
-
- bin_PROGRAMS += subsample
- subsample_SOURCES = subsample.cc
+ noinst_PROGRAMS += subsample
+ subsample_SOURCES = subsample.cc
subsample_CPPFLAGS = $(AM_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
-
- subsample_LDFLAGS = $(AM_LDFLAGS) \
- $(MAGICKXX_LDFLAGS) \
- -lpthread
+ subsample_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
endif HAVE_MAGICKXX
diff --git a/scribo/src/primitive/extract/Makefile.am b/scribo/src/primitive/extract/Makefile.am
index 6f20ea3..2c8188e 100644
--- a/scribo/src/primitive/extract/Makefile.am
+++ b/scribo/src/primitive/extract/Makefile.am
@@ -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.
#
@@ -17,7 +18,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
extract_discontinued_lines \
extract_discontinued_vlines \
extract_discontinued_hlines \
diff --git a/scribo/src/primitive/find/Makefile.am b/scribo/src/primitive/find/Makefile.am
index 3b5dbd2..b001f87 100644
--- a/scribo/src/primitive/find/Makefile.am
+++ b/scribo/src/primitive/find/Makefile.am
@@ -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.
#
@@ -17,7 +18,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
find_discontinued_lines \
find_pattern_lines \
find_single_lines \
diff --git a/scribo/src/primitive/group/Makefile.am b/scribo/src/primitive/group/Makefile.am
index afc4f8e..37c32c7 100644
--- a/scribo/src/primitive/group/Makefile.am
+++ b/scribo/src/primitive/group/Makefile.am
@@ -17,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
group_from_double_link \
group_from_double_several_links \
group_from_several_left_links \
diff --git a/scribo/src/table/Makefile.am b/scribo/src/table/Makefile.am
index 50ea8fd..664aeb4 100644
--- a/scribo/src/table/Makefile.am
+++ b/scribo/src/table/Makefile.am
@@ -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.
#
@@ -16,12 +17,12 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS =
+noinst_PROGRAMS =
# Disabled:
#----------
#
-#bin_PROGRAMS = \
+#noinst_PROGRAMS = \
# erase \
# extract \
# rebuild_opening \
diff --git a/scribo/src/text/Makefile.am b/scribo/src/text/Makefile.am
index dbdb1da..879918e 100644
--- a/scribo/src/text/Makefile.am
+++ b/scribo/src/text/Makefile.am
@@ -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.
#
@@ -16,7 +17,7 @@
include $(top_srcdir)/scribo/scribo.mk
-bin_PROGRAMS = \
+noinst_PROGRAMS = \
cleantxt
@@ -26,7 +27,7 @@ cleantxt_SOURCES = cleantxt.cc
if HAVE_TESSERACT
if HAVE_TIFF
- bin_PROGRAMS += pbm_lines_recognition
+ noinst_PROGRAMS += pbm_lines_recognition
pbm_lines_recognition_SOURCES = pbm_lines_recognition.cc
pbm_lines_recognition_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
@@ -37,7 +38,7 @@ if HAVE_TIFF
$(TIFF_LDFLAGS) \
-lpthread
- bin_PROGRAMS += pbm_recognition
+ noinst_PROGRAMS += pbm_recognition
pbm_recognition_SOURCES = pbm_recognition.cc
pbm_recognition_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
--
1.5.6.5
1
0
* src/Makefile.am: Add new rules to generate scribo-cli.
* src/scribo-cli.in: New.
---
scribo/ChangeLog | 8 +++
scribo/src/Makefile.am | 19 +++++++
scribo/src/scribo-cli.in | 135 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 162 insertions(+), 0 deletions(-)
create mode 100755 scribo/src/scribo-cli.in
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 2f58ec7..aacb71e 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,13 @@
2010-08-26 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add scribo-cli script.
+
+ * src/Makefile.am: Add new rules to generate scribo-cli.
+
+ * src/scribo-cli.in: New.
+
+2010-08-26 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Setup what to install with Scribo.
* demo/viewer/Makefile.am: Do not install includes.
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index a977d38..84ee693 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -88,3 +88,22 @@ if HAVE_TESSERACT
endif HAVE_TESSERACT
endif HAVE_MAGICKXX
+
+
+# Generated by configure from scribo-cli.in.
+dist_bin_SCRIPTS = scribo-cli
+
+do_subst = sed -e 's|@utilexecdir[@]|$(utilexecdir)|g'
+
+scribo-cli: $(srcdir)/scribo-cli.in Makefile
+ rm -f $@ $@.tmp
+ srcdir=''; \
+ test -f ./$@.in || srcdir=$(srcdir)/; \
+ $(do_subst) $${srcdir}$@.in >$@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
+CLEANFILES = $(bin_SCRIPTS)
+
+EXTRA_DIST = scribo-cli.in
diff --git a/scribo/src/scribo-cli.in b/scribo/src/scribo-cli.in
new file mode 100755
index 0000000..e271810
--- /dev/null
+++ b/scribo/src/scribo-cli.in
@@ -0,0 +1,135 @@
+# Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+#
+#!/bin/sh
+
+bdir="@utilexecdir@"
+bin=`basename $0`
+
+version()
+{
+ cat <<EOF
+SCRIBO Command LIne tool, version 1.0
+Copyright (C) 2010 LRDE/EPITA
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+EOF
+}
+
+usage()
+{
+ cat <<EOF
+Usage: $bin [version] [help] COMMAND [ARGS]
+
+List of available COMMAND argument:
+
+ Full Toolchains
+ ---------------
+
+
+ * On documents
+
+ doc-ppc Common preprocessing before looking for text.
+
+ doc-ocr Find and recognize text.
+
+
+
+ * On pictures
+
+ pic-loc Try to localize text if there's any.
+
+ pic-ocr Localize and try to recognize text.
+
+
+ Algorithms
+ ----------
+
+
+ * Binarization
+
+ sauvola Sauvola's algorithm.
+
+ sauvola-ms Multi-scale Sauvola's algorithm.
+
+ sauvola-ms-fg Extract foreground objects and run multi-scale
+ Sauvola's algorithm.
+
+ sauvola-ms-split Run multi-scale Sauvola's algorithm on each color
+ component and merge results.
+
+---------------------------------------------------------------------------
+See '$bin COMMAND --help' for more information on a specific command.
+EOF
+}
+
+
+run_cmd()
+{
+ cmd="$1";
+ shift;
+
+ case $cmd in
+
+ doc-ppc)
+ $bdir/text_in_doc_preprocess $@
+ ;;
+
+ doc-ocr)
+ $bdir/pbm_text_in_doc $@
+ ;;
+
+ pic-loc)
+ $bdir/text_in_picture $@
+ ;;
+
+ pic-ocr)
+ $bdir/text_recognition_in_picture $@
+ ;;
+
+ *)
+ cmd_bin=`echo $cmd | sed -e 's/-/_/g'`
+ if test -f $bdir/$cmd_bin; then
+ $bdir/$cmd_bin $@
+ else
+ echo "Error: Invalid command!"
+ usage
+ fi
+ esac
+}
+
+
+case $1 in
+
+ version | --version)
+ version
+ ;;
+
+
+ help | --help)
+
+ usage
+ ;;
+
+ help)
+
+ ;;
+
+ *)
+ run_cmd $1
+ ;;
+
+esac
--
1.5.6.5
1
0
last-svn-commit-556-g7fce05e src/Makefile.am (CLEANFILES): Fix invalid variable name.
by Guillaume Lazzara 16 Nov '10
by Guillaume Lazzara 16 Nov '10
16 Nov '10
---
scribo/ChangeLog | 4 ++++
scribo/src/Makefile.am | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index aacb71e..3fc62ec 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,7 @@
+2010-08-27 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * src/Makefile.am (CLEANFILES): Fix invalid variable name.
+
2010-08-26 Guillaume Lazzara <z(a)lrde.epita.fr>
Add scribo-cli script.
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 84ee693..a2c72b2 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -104,6 +104,6 @@ scribo-cli: $(srcdir)/scribo-cli.in Makefile
chmod a-w $@.tmp
mv $@.tmp $@
-CLEANFILES = $(bin_SCRIPTS)
+CLEANFILES = $(dist_bin_SCRIPTS)
EXTRA_DIST = scribo-cli.in
--
1.5.6.5
1
0
16 Nov '10
* scribo/demo/viewer/viewer.cc,
* scribo/demo/viewer/image_region.hxx: Disable item click if unchecked in item list.
* scribo/demo/viewer/key_widget.cc,
* scribo/demo/viewer/key_widget.hh: Add KeyWidget::checkAll.
---
scribo/ChangeLog | 61 +++++++++++++++++++++++++++++++++++
scribo/demo/viewer/image_region.hxx | 1 +
scribo/demo/viewer/key_widget.cc | 9 +++++
scribo/demo/viewer/key_widget.hh | 1 +
scribo/demo/viewer/viewer.cc | 42 ++++++++++++-----------
5 files changed, 94 insertions(+), 20 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 3fc62ec..d7be39d 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,64 @@
+2010-06-30 Arthur Crepin-Leblond <crepin(a)stockholm.lrde.epita.fr>
+
+ Extended XML mode support.
+
+ * scribo/demo/viewer/Makefile.am
+
+ * demo/viewer/image_region.cc,
+ * viewer/image_region.hh,
+ * viewer/image_region.hxx: Change regions depths to have a
+ hierarchy.
+
+ * demo/viewer/image_scene.cc,
+ * demo/viewer/image_scene.hh: Change mouse click behaviour.
+
+ * demo/viewer/key_widget.cc,
+ * demo/viewer/key_widget.hh: Add new items (text line and
+ paragraph)
+
+ * demo/viewer/viewer.cc,
+ * demo/viewer/viewer.hh: Chnage XML parsing to support extended
+ format.
+
+ * scribo/demo/viewer/common.hh: Add new RegionId's.
+
+2010-06-30 Arthur Crepin-Leblond <crepin(a)stockholm.lrde.epita.fr>
+
+ New features in Qt interface.
+
+ * demo/viewer/browser_widget.hh: Improve picture browser.
+
+ * demo/viewer/step_widget.cc: Add a "step chooser" to load several
+ XML files related to one picture.
+
+
+2010-06-30 Arthur Crepin-Leblond <crepin(a)stockholm.lrde.epita.fr>
+
+ Change XML output (replacement of html markups).
+
+ * io/xml/save.hh: Add internal::html_markups_replace.
+
+2010-06-23 Arthur Crepin-Leblond <crepin(a)stockholm.lrde.epita.fr>
+
+ Add extensions to ICDAR XML format.
+
+ * io/xml/save_text_lines.hh: Rename as...
+ * io/xml/save.hh: ...this.
+
+ * src/pbm_text_in_doc.cc: Update call to io::xml::save.
+
+2010-07-05 Arthur Crepin-Leblond <crepin(a)stockholm.lrde.epita.fr>
+
+ Small fix in Qt interface.
+
+ * scribo/demo/viewer/viewer.cc,
+ * scribo/demo/viewer/image_region.hxx: Disable item click if
+ unchecked in item list.
+
+ * scribo/demo/viewer/key_widget.cc,
+ * scribo/demo/viewer/key_widget.hh: Add KeyWidget::checkAll.
+
+
2010-08-27 Guillaume Lazzara <z(a)lrde.epita.fr>
* src/Makefile.am (CLEANFILES): Fix invalid variable name.
diff --git a/scribo/demo/viewer/image_region.hxx b/scribo/demo/viewer/image_region.hxx
index 50dc93d..efcf493 100644
--- a/scribo/demo/viewer/image_region.hxx
+++ b/scribo/demo/viewer/image_region.hxx
@@ -58,6 +58,7 @@ ImageRegion::setDrawIfSameId(int id, bool draw)
if (id == id_)
{
draw_ = draw;
+ setVisible(draw);
if (scene())
{
scene()->invalidate();
diff --git a/scribo/demo/viewer/key_widget.cc b/scribo/demo/viewer/key_widget.cc
index 93c2cf0..5e371ab 100644
--- a/scribo/demo/viewer/key_widget.cc
+++ b/scribo/demo/viewer/key_widget.cc
@@ -36,6 +36,15 @@ KeyWidget::KeyWidget(const region::KeyMap& key_map)
this, SLOT(update(QListWidgetItem*)));
}
+void KeyWidget::checkAll()
+{
+ for (int i = 0; i < items_->count(); ++i)
+ {
+ items_->item(i)->setCheckState(Qt::Checked);
+ emit updated(i, true);
+ }
+}
+
void
KeyWidget::change_mode(bool b)
{
diff --git a/scribo/demo/viewer/key_widget.hh b/scribo/demo/viewer/key_widget.hh
index e5259e2..71200c8 100644
--- a/scribo/demo/viewer/key_widget.hh
+++ b/scribo/demo/viewer/key_widget.hh
@@ -27,6 +27,7 @@ public:
KeyWidget(const region::KeyMap& key_map);
~KeyWidget();
+ void checkAll();
bool isChecked(region::RegionId id);
signals:
diff --git a/scribo/demo/viewer/viewer.cc b/scribo/demo/viewer/viewer.cc
index 8bafc39..61a57c1 100644
--- a/scribo/demo/viewer/viewer.cc
+++ b/scribo/demo/viewer/viewer.cc
@@ -138,8 +138,8 @@ Viewer::Viewer(int &argc, char** argv)
XmlWidget* xml_wgt = new XmlWidget();
BrowserWidget* browser_wgt =
new BrowserWidget(files_, argc != 2 ? QString() : argv[1]);
- ImageWidget* image_wgt = new ImageWidget(scene_);
key_wgt_ = new KeyWidget(key_map_);
+ ImageWidget* image_wgt = new ImageWidget(scene_);
scene_->setBackgroundBrush(scene_->palette().window());
@@ -212,7 +212,7 @@ Viewer::load_xml(QString filename)
scene_->removeItem(image_);
scene_->clear();
scene_->addItem(image_);
-
+
scene_->update();
if (doc_layout_)
@@ -220,9 +220,9 @@ Viewer::load_xml(QString filename)
doc_layout_->deleteLater();
doc_layout_ = 0;
}
-
+
emit updated(doc_layout_);
-
+
if (QFile::exists(xml_file))
{
QFile file(xml_file);
@@ -267,11 +267,11 @@ Viewer::xml_to_layout()
attributes = doc_layout_->index(i, 1, page);
QString name = doc_layout_->data(region, Qt::DisplayRole).toString();
region::RegionId id = static_cast<region::RegionId>(region_ids_[name]);
-
+
coords = doc_layout_->index(0, 0, region);
if (!region.isValid() || !coords.isValid())
break;
-
+
QVector<QPoint> points;
for (int j = 0; true; ++j)
{
@@ -279,14 +279,14 @@ Viewer::xml_to_layout()
point = doc_layout_->index(j, 1, coords);
if (!point.isValid())
break;
-
+
QMap<QString, QVariant> data =
doc_layout_->data(point, Qt::UserRole).toMap();
int x = data["x"].toInt();
int y = data["y"].toInt();
points << QPoint(x, y);
}
-
+
// Create region
ImageRegion* r = new ImageRegion(id,
key_map_[id].first,
@@ -296,7 +296,7 @@ Viewer::xml_to_layout()
fill_action_->isChecked(),
precise_action_->isChecked(),
key_wgt_->isChecked(id));
-
+
connect(this, SIGNAL(key_updated(int, bool)),
r, SLOT(setDrawIfSameId(int, bool)));
connect(this, SIGNAL(setOutline(bool)),
@@ -305,7 +305,7 @@ Viewer::xml_to_layout()
r, SLOT(setPrecise(bool)));
connect(this, SIGNAL(setFill(bool)),
r, SLOT(setFill(bool)));
-
+
scene_->addItem(r);
// EXTENDED MODE
@@ -325,6 +325,7 @@ Viewer::xml_to_layout()
QModelIndex par_coords = doc_layout_->index(0, 0, paragraph);
QModelIndex point_par;
+
QVector<QPoint> points_par;
for (int m = 0; true; ++m)
{
@@ -332,7 +333,7 @@ Viewer::xml_to_layout()
point_par = doc_layout_->index(m, 1, par_coords);
if (!point_par.isValid())
break;
-
+
QMap<QString, QVariant> data_par =
doc_layout_->data(point_par, Qt::UserRole).toMap();
int x = data_par["x"].toInt();
@@ -349,7 +350,7 @@ Viewer::xml_to_layout()
fill_action_->isChecked(),
precise_action_->isChecked(),
key_wgt_->isChecked(id_par));
-
+
connect(this, SIGNAL(key_updated(int, bool)),
r_par, SLOT(setDrawIfSameId(int, bool)));
connect(this, SIGNAL(setOutline(bool)),
@@ -360,7 +361,7 @@ Viewer::xml_to_layout()
r_par, SLOT(setFill(bool)));
scene_->addItem(r_par);
-
+
for (int l = 1; true; ++l)
{
QModelIndex line = doc_layout_->index(l, 0, paragraph);
@@ -370,7 +371,7 @@ Viewer::xml_to_layout()
QString name_line = doc_layout_->data(line, Qt::DisplayRole).toString();
region::RegionId id_line = static_cast<region::RegionId>(region_ids_[name_line]);
-
+
QModelIndex line_coords = doc_layout_->index(0, 0, line);
QModelIndex point_line;
QVector<QPoint> points_line;
@@ -380,14 +381,14 @@ Viewer::xml_to_layout()
point_line = doc_layout_->index(n, 1, line_coords);
if (!point_line.isValid())
break;
-
+
QMap<QString, QVariant> data_line =
doc_layout_->data(point_line, Qt::UserRole).toMap();
int x = data_line["x"].toInt();
int y = data_line["y"].toInt();
points_line << QPoint(x, y);
}
-
+
// Create region
ImageRegion* r_line = new ImageRegion(id_line,
key_map_[id_line].first,
@@ -397,7 +398,7 @@ Viewer::xml_to_layout()
fill_action_->isChecked(),
precise_action_->isChecked(),
key_wgt_->isChecked(id_line));
-
+
connect(this, SIGNAL(key_updated(int, bool)),
r_line, SLOT(setDrawIfSameId(int, bool)));
connect(this, SIGNAL(setOutline(bool)),
@@ -409,12 +410,12 @@ Viewer::xml_to_layout()
scene_->addItem(r_line);
}
- }
+ }
}
// END OF EXTENDED MODE
-
+
}
-
+
emit updated(doc_layout_);
}
}
@@ -481,6 +482,7 @@ Viewer::maybeChangeCacheMode(qreal scale)
void Viewer::useExtended(bool b)
{
extended_mode_ = b;
+ key_wgt_->checkAll();
if (xml_file_ != QString(""))
load_xml(xml_file_);
--
1.5.6.5
1
0
* arthur/xml_to_html/domitem.cc,
* arthur/xml_to_html/domitem.hh.,
* arthur/xml_to_html/dommodel.cc,
* arthur/xml_to_html/dommodel.hh: XML parsing.
* arthur/xml_to_html/patterns/css.css,
* arthur/xml_to_html/patterns/xsl.xsl: HTML patterns.
* arthur/xml_to_html/xml_to_html.cc,
* arthur/xml_to_html/xml_to_html.hh: Image cropingd XML merging.
* arthur/xml_to_html/README
* arthur/xml_to_html/xml_to_html.pro
* arthur/xml_to_html/main.cc
---
scribo/sandbox/ChangeLog | 19 ++
scribo/sandbox/arthur/xml_to_html/README | 25 ++
.../arthur/xml_to_html}/domitem.cc | 0
.../arthur/xml_to_html}/domitem.hh | 0
.../arthur/xml_to_html}/dommodel.cc | 0
.../arthur/xml_to_html}/dommodel.hh | 0
scribo/sandbox/arthur/xml_to_html/main.cc | 58 ++++
scribo/sandbox/arthur/xml_to_html/patterns/css.css | 28 ++
scribo/sandbox/arthur/xml_to_html/patterns/xsl.xsl | 229 +++++++++++++++
scribo/sandbox/arthur/xml_to_html/xml_to_html.cc | 292 ++++++++++++++++++++
.../arthur/xml_to_html/xml_to_html.hh} | 40 +--
scribo/sandbox/arthur/xml_to_html/xml_to_html.pro | 16 +
12 files changed, 683 insertions(+), 24 deletions(-)
create mode 100644 scribo/sandbox/arthur/xml_to_html/README
copy scribo/{demo/viewer => sandbox/arthur/xml_to_html}/domitem.cc (100%)
copy scribo/{demo/viewer => sandbox/arthur/xml_to_html}/domitem.hh (100%)
copy scribo/{demo/viewer => sandbox/arthur/xml_to_html}/dommodel.cc (100%)
copy scribo/{demo/viewer => sandbox/arthur/xml_to_html}/dommodel.hh (100%)
create mode 100644 scribo/sandbox/arthur/xml_to_html/main.cc
create mode 100644 scribo/sandbox/arthur/xml_to_html/patterns/css.css
create mode 100644 scribo/sandbox/arthur/xml_to_html/patterns/xsl.xsl
create mode 100644 scribo/sandbox/arthur/xml_to_html/xml_to_html.cc
copy scribo/{demo/viewer/step_widget.hh => sandbox/arthur/xml_to_html/xml_to_html.hh} (73%)
create mode 100644 scribo/sandbox/arthur/xml_to_html/xml_to_html.pro
diff --git a/scribo/sandbox/ChangeLog b/scribo/sandbox/ChangeLog
index f428dce..d3f537b 100644
--- a/scribo/sandbox/ChangeLog
+++ b/scribo/sandbox/ChangeLog
@@ -1,3 +1,22 @@
+2010-07-05 Arthur Crepin-Leblond <crepin(a)stockholm.lrde.epita.fr>
+
+ ICDAR XML to HTML.
+
+ * arthur/xml_to_html/domitem.cc,
+ * arthur/xml_to_html/domitem.hh.,
+ * arthur/xml_to_html/dommodel.cc,
+ * arthur/xml_to_html/dommodel.hh: XML parsing.
+
+ * arthur/xml_to_html/patterns/css.css,
+ * arthur/xml_to_html/patterns/xsl.xsl: HTML patterns.
+
+ * arthur/xml_to_html/xml_to_html.cc,
+ * arthur/xml_to_html/xml_to_html.hh: Image croping and XML merging.
+
+ * arthur/xml_to_html/README
+ * arthur/xml_to_html/xml_to_html.pro
+ * arthur/xml_to_html/main.cc
+
2010-06-25 Guillaume Lazzara <z(a)lrde.epita.fr>
Add algorithms to retrieve white spaces.
diff --git a/scribo/sandbox/arthur/xml_to_html/README b/scribo/sandbox/arthur/xml_to_html/README
new file mode 100644
index 0000000..f16f472
--- /dev/null
+++ b/scribo/sandbox/arthur/xml_to_html/README
@@ -0,0 +1,25 @@
+xml_to_html
+
+Produce HTML view from ICDAR (or LRDE extended) XML.
+
+*Compilation:
+
+ Just change the paths to olena and milena in xml_to_html.pro
+
+*Usage:
+
+ -m, --merge: Merge an XML with an other XML
+ args: <xml_file_1> <xml_file_2> [xml_output]
+
+Useful to merge LRDE XML extended mode files with ICDAR XML files to combine both images and recognized text.
+
+
+ -c, --create-html: Crop images (if exist) from the ppm file using the XML file and produce an html output.
+ args: <xml_file> [ppm_file] [output dir]
+
+If no PPM file is given, the program will only produce an HTML output without images.
+If a PPM file is given, the program will crop image_region, separator_region, graphic_regions, chart_region and table_region to output_dir/img/id.png
+
+*Result:
+
+To view the result run your internet browser on output_dir/output.xml (Does not work with Chrome on local, use a LAMPP server to fix this ;-) ).
\ No newline at end of file
diff --git a/scribo/demo/viewer/domitem.cc b/scribo/sandbox/arthur/xml_to_html/domitem.cc
similarity index 100%
copy from scribo/demo/viewer/domitem.cc
copy to scribo/sandbox/arthur/xml_to_html/domitem.cc
diff --git a/scribo/demo/viewer/domitem.hh b/scribo/sandbox/arthur/xml_to_html/domitem.hh
similarity index 100%
copy from scribo/demo/viewer/domitem.hh
copy to scribo/sandbox/arthur/xml_to_html/domitem.hh
diff --git a/scribo/demo/viewer/dommodel.cc b/scribo/sandbox/arthur/xml_to_html/dommodel.cc
similarity index 100%
copy from scribo/demo/viewer/dommodel.cc
copy to scribo/sandbox/arthur/xml_to_html/dommodel.cc
diff --git a/scribo/demo/viewer/dommodel.hh b/scribo/sandbox/arthur/xml_to_html/dommodel.hh
similarity index 100%
copy from scribo/demo/viewer/dommodel.hh
copy to scribo/sandbox/arthur/xml_to_html/dommodel.hh
diff --git a/scribo/sandbox/arthur/xml_to_html/main.cc b/scribo/sandbox/arthur/xml_to_html/main.cc
new file mode 100644
index 0000000..9ec705a
--- /dev/null
+++ b/scribo/sandbox/arthur/xml_to_html/main.cc
@@ -0,0 +1,58 @@
+#include <iostream>
+#include "xml_to_html.hh"
+
+int main(int argc, char **argv)
+{
+
+ std::string man;
+ man = "xml_to_html: ...usage\n -m, --merge: Merge an XML with an other XML\n \targs: <xml_file_1> <xml_file_2> [xml_output]\n\n -c, --create-html: Crop images (if exist) from the ppm file using the XML file and produce an html output.\n \targs: <xml_file> [ppm_file] [output dir]\n";
+
+ if (argc > 2)
+ {
+ new QApplication::QApplication(argc, argv, false);
+ ImageCrop crop;
+
+ std::string merge = "--merge";
+ std::string m = "-m";
+ std::string scrop = "--create-html";
+ std::string c = "-c";
+
+ if (argc == 3 && (scrop.compare(argv[1]) == 0 || c.compare(argv[1]) == 0))
+ {
+ bool b = false;
+ b = crop.load_xml(argv[2], QString::Null());
+
+ if (b)
+ crop.find_image_regions();
+ }
+ else if (argc > 3)
+ {
+ if (merge.compare(argv[1]) == 0 || m.compare(argv[1]) == 0)
+ {
+ if (argc > 4)
+ crop.merge(argv[2], argv[3], argv[4]);
+ else
+ crop.merge(argv[2], argv[3]);
+ }
+ else if (scrop.compare(argv[1]) == 0 || c.compare(argv[1]) == 0)
+ {
+ bool b = false;
+ if (argc > 4)
+ b = crop.load_xml(argv[2], argv[3], argv[4]);
+ else
+ b = crop.load_xml(argv[2], argv[3]);
+
+ if (b)
+ crop.find_image_regions();
+ }
+ else
+ std::cout << man;
+ }
+ else
+ std::cout << man;
+ }
+ else
+ std::cout << man;
+
+ return 0;
+}
diff --git a/scribo/sandbox/arthur/xml_to_html/patterns/css.css b/scribo/sandbox/arthur/xml_to_html/patterns/css.css
new file mode 100644
index 0000000..7171754
--- /dev/null
+++ b/scribo/sandbox/arthur/xml_to_html/patterns/css.css
@@ -0,0 +1,28 @@
+.line
+{
+ position:absolute;
+ background-color:white;
+ z-index:7;
+ display:inline;
+ white-space:pre;
+ letter-spacing:-2px;
+ padding:0px;
+ margin:0px;
+ filter:alpha(opacity=100);
+ font-family:"Times New Roman", Times, serif;
+}
+.para
+{
+ position:absolute;
+ z-index:6;
+}
+.region
+{
+ position:absolute;
+ z-index:5;
+}
+.image
+{
+ position:absolute;
+ border:0;
+}
\ No newline at end of file
diff --git a/scribo/sandbox/arthur/xml_to_html/patterns/xsl.xsl b/scribo/sandbox/arthur/xml_to_html/patterns/xsl.xsl
new file mode 100644
index 0000000..aa5a078
--- /dev/null
+++ b/scribo/sandbox/arthur/xml_to_html/patterns/xsl.xsl
@@ -0,0 +1,229 @@
+<?xml version="1.0"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="/"> <!-- "/" means the whole document (root) -->
+ <html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Fooooooo !</title>
+ <link rel="stylesheet" type="text/css" href="css.css" />
+ </head>
+ <body>
+
+ <div class="image" style="top:0px;left:0px;">
+ <img src="../../ppm/mp00076.png" />
+ </div>
+
+ <!-- BEGIN IMAGE REGION -->
+ <xsl:for-each select="pcGts/page/graphic_region|
+ pcGts/page/image_region|
+ pcGts/page/chart_region|
+ pcGts/page/table_region|
+ pcGts/page/separator_region|
+ pcGts/page/text_region|
+ pcGts/page/text_region/paragraph|
+ pcGts/page/text_region/paragraph/line">
+
+ <!-- y1 -->
+ <xsl:variable name="y1">
+ <xsl:for-each select="coords/point">
+ <xsl:sort select="@y" order="ascending" data-type="number"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="@y" />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <!-- x2 -->
+ <xsl:variable name="x2">
+ <xsl:for-each select="coords/point">
+ <xsl:sort select="@x" order="descending" data-type="number"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="@x" />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <!-- y2 -->
+ <xsl:variable name="y2">
+ <xsl:for-each select="coords/point">
+ <xsl:sort select="@y" order="descending" data-type="number"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="@y" />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <!-- x1 -->
+ <xsl:variable name="x1">
+ <xsl:for-each select="coords/point">
+ <xsl:sort select="@x" order="ascending" data-type="number"/>
+ <xsl:if test="position() = 1">
+ <xsl:value-of select="@x" />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <!-- TEXT LINE-->
+ <xsl:if test="name() = 'line'">
+
+ <xsl:variable name="x_height">
+ <xsl:value-of select="../../@x_height" />
+ </xsl:variable>
+
+ <xsl:variable name="a_height">
+ <xsl:value-of select="../../@a_height" />
+ </xsl:variable>
+
+ <xsl:variable name="colour">
+ <xsl:choose>
+ <xsl:when test="../../@txt_colour != ''">
+ <xsl:value-of select="../../@txt_colour" />
+ </xsl:when>
+ <xsl:otherwise>
+ Black
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="d_height_tmp">
+ <xsl:value-of select="../../@d_height" />
+ </xsl:variable>
+
+ <xsl:variable name="d_height">
+ <xsl:choose>
+ <xsl:when test="$d_height_tmp < 0">
+ <xsl:value-of select="-$d_height_tmp" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$d_height_tmp" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="a">
+ <xsl:choose>
+ <xsl:when test="($a_height - $x_height) < $d_height">
+ <xsl:value-of select="$x_height + $d_height" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$a_height" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="d">
+ <xsl:choose>
+ <xsl:when test="($a_height - $x_height) > $d_height">
+ <xsl:value-of select="-($a_height - $x_height)" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$d_height" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="d_f">
+ <xsl:choose>
+ <xsl:when test="$d < 0">
+ <xsl:value-of select="-$d" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$d" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div class="line" onmouseover="this.style.opacity=0.2;this.filters.alpha.opacity=20"
+ onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100">
+ <xsl:attribute name="style">
+ opacity:1;
+ height:auto;
+ font-size:<xsl:value-of select="$a+$d_f" />px;
+ width:<xsl:value-of select="$x2 - $x1" />px;
+ left:<xsl:value-of select="$x1 " />px;
+ top:<xsl:value-of select="$y1 " />px;
+ color:<xsl:value-of select="$colour" />;
+ </xsl:attribute>
+ <xsl:value-of select="@text"/>
+ </div>
+ </xsl:if>
+ <!-- ENF OF TEXT LINE -->
+
+ <!-- TEXT REGION -->
+ <xsl:if test="name() = 'text_region'">
+ <div class="region">
+ <xsl:attribute name="style">
+ height:<xsl:value-of select="$y2 - $y1" />px;
+ width:<xsl:value-of select="$x2 - $x1" />px;
+ left:<xsl:value-of select="$x1" />px;
+ top:<xsl:value-of select="$y1" />px;
+ </xsl:attribute>
+ </div>
+ </xsl:if>
+ <!-- ENF OF TEXT REGION -->
+
+ <!-- PARAGRAPH -->
+ <xsl:if test="name() = 'paragraph'">
+ <div class="para">
+ <xsl:attribute name="style">
+ height:<xsl:value-of select="$y2 - $y1" />px;
+ width:<xsl:value-of select="$x2 - $x1" />px;
+ left:<xsl:value-of select="$x1" />px;
+ top:<xsl:value-of select="$y1" />px;
+ </xsl:attribute>
+ </div>
+ </xsl:if>
+ <!-- ENF OF PARAGRAPH -->
+
+ <!-- NON-TEXT REGIONS -->
+ <xsl:if test="name() = 'image_region' or name() = 'separator_region' or name() = 'graphic_region' or name() = 'chart_region' or name() = 'table_region'">
+
+ <!-- id -->
+ <xsl:variable name="id">
+ <xsl:value-of select="@id" />
+ </xsl:variable>
+
+ <!-- depth -->
+ <xsl:variable name="depth">
+ <xsl:choose>
+ <xsl:when test="name() = 'separator_region'">
+ 1
+ </xsl:when>
+ <xsl:otherwise>
+ 4
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <div class="image">
+ <xsl:attribute name="style">
+ top:<xsl:value-of select="$y1" />px;
+ left:<xsl:value-of select="$x1" />px;
+ width:<xsl:value-of select="$x2 - $x1"/>px;
+ height:<xsl:value-of select="$y2 - $y1"/>px;
+ z-index:<xsl:value-of select="$depth"/>;
+ </xsl:attribute>
+ <img>
+ <xsl:attribute name="alt">
+ <xsl:value-of select="name()" />
+ </xsl:attribute>
+ <xsl:attribute name="width">
+ <xsl:value-of select="$x2 - $x1" />
+ </xsl:attribute>
+ <xsl:attribute name="height">
+ <xsl:value-of select="$y2 - $y1" />
+ </xsl:attribute>
+ <xsl:attribute name="src">
+ img/<xsl:value-of select="$id"/>.png</xsl:attribute>
+ </img>
+ </div>
+
+ </xsl:if>
+ <!-- END NON-TEXT REGIONS -->
+ </xsl:for-each>
+ </body>
+ </html>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/scribo/sandbox/arthur/xml_to_html/xml_to_html.cc b/scribo/sandbox/arthur/xml_to_html/xml_to_html.cc
new file mode 100644
index 0000000..8267466
--- /dev/null
+++ b/scribo/sandbox/arthur/xml_to_html/xml_to_html.cc
@@ -0,0 +1,292 @@
+// Copyright (C) 2010 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to produce
+// an executable, this file does not by itself cause the resulting
+// executable to be covered by the GNU General Public License. This
+// exception does not however invalidate any other reasons why the
+// executable file might be covered by the GNU General Public License.
+
+# include "xml_to_html.hh"
+# include "dommodel.hh"
+# include <limits.h>
+
+#include <scribo/preprocessing/crop.hh>
+#include <mln/value/rgb8.hh>
+#include <mln/core/alias/box2d.hh>
+#include <mln/core/image/image2d.hh>
+#include <mln/io/magick/save.hh>
+#include <mln/io/ppm/all.hh>
+
+ImageCrop::ImageCrop():
+ regions_(false)
+{
+}
+
+ImageCrop::~ImageCrop()
+{
+}
+
+void ImageCrop::merge(QString in, QString other, QString output)
+{
+ if (in.endsWith(".xml") && other.endsWith(".xml") && output.endsWith(".xml"))
+ {
+ QFile f_in(in);
+ QFile f_other(other);
+ QFile f_output(output);
+
+ qDebug() << "Merging to " << output << "...";
+
+ f_in.open(QIODevice::ReadOnly);
+ f_other.open(QIODevice::ReadOnly);
+ f_output.open(QIODevice::ReadWrite);
+
+ QTextStream stream_in(&f_in);
+ QTextStream stream_other(&f_other);
+ QTextStream output_stream(&f_output);
+
+ QString line = stream_in.readLine();
+ output_stream << line;
+ line = stream_in.readLine();
+
+ while (!line.contains("</page>"))
+ {
+ output_stream << "\n" << line;
+ line = stream_in.readLine();
+ }
+
+ line = stream_other.readLine();
+
+ while (!line.contains("<page"))
+ line = stream_other.readLine();
+
+ line = stream_other.readLine();
+
+ while (!line.contains("</pcGts>"))
+ {
+ output_stream << "\n" << line;
+ line = stream_other.readLine();
+ }
+
+ output_stream << "\n" << line;
+
+ f_in.close();
+ f_other.close();
+ f_output.close();
+ }
+ else
+ std::cout << "merge : error, only xml files are needed." << std::endl;
+}
+
+bool ImageCrop::load_xml(QString xml_file, QString image_file, QString path)
+{
+ if (xml_file.endsWith(".xml") && (image_file.endsWith(".ppm") || image_file == QString::Null()) )
+ {
+ image_file_ = image_file;
+ regions_ = (image_file != QString::Null());
+
+ path_ = path;
+ if (!path_.endsWith("/"))
+ path_.append("/");
+
+ QDir dir(path_);
+
+ if (!dir.mkpath("img"))
+ {
+ path_ = "output/";
+ dir.mkpath(path_);
+ dir.setPath(path_);
+ dir.mkpath("img");
+ }
+
+ if (QFile::exists(xml_file))
+ {
+ QFile file(xml_file);
+ QFile output(path_ + "output.xml");
+ QFile xsl("patterns/xsl.xsl");
+ QFile css("patterns/css.css");
+ xsl.copy(path_ + "xsl.xsl");
+ css.copy(path_ + "css.css");
+
+ if (QFile::exists(path_ + "output.xml"))
+ output.remove();
+
+ output.open(QIODevice::ReadWrite);
+ file.open(QIODevice::ReadOnly);
+
+ QTextStream stream_in(&file);
+ QTextStream stream_out(&output);
+ stream_in.setCodec("UTF-8");
+ stream_out.setCodec("UTF-8");
+
+ QString line = stream_in.readLine();
+ stream_out << line;
+ stream_out << "\n<?xml-stylesheet type=\"text/xsl\" href=\"xsl.xsl\" ?>";
+
+ // /!\ attributes of ICDAR PcGts removed.
+ line = stream_in.readLine();
+ stream_out << "\n<pcGts>";
+
+ line = stream_in.readLine();
+
+ while (!line.contains("</pcGts>"))
+ {
+ stream_out << "\n" << line;
+ line = stream_in.readLine();
+ }
+
+ stream_out << "\n" << line;
+
+ output.close();
+ file.close();
+
+ qDebug() << "Output saved to " + path_;
+
+ if (file.open(QIODevice::ReadOnly))
+ {
+ QDomDocument document;
+ if (document.setContent(&file))
+ {
+ layout_ = new DomModel(document, this);
+ }
+ else
+ qDebug() << "Error while loading the XML file, please choose another.";
+
+ file.close();
+ }
+ }
+ return true;
+ }
+ else
+ {
+ std::cout << "Wrong files format !" << std::endl;
+ return false;
+ }
+}
+
+void ImageCrop::find_image_regions()
+{
+ if (layout_ && regions_)
+ {
+ QModelIndex pgGts = layout_->index(1, 0);
+ QModelIndex page = layout_->index(1, 0, pgGts);
+ QModelIndex region;
+ QModelIndex attributes;
+ QModelIndex coords;
+ QModelIndex point;
+ bool regions_found = false;
+ for (int i = 0; true; ++i)
+ {
+ region = layout_->index(i, 0, page);
+ attributes = layout_->index(i, 1, page);
+ QString name = layout_->data(region, Qt::DisplayRole).toString();
+ coords = layout_->index(0, 0, region);
+
+ bool is_image_region = name == QString("image_region")
+ || name == QString("graphic_region")
+ || name == QString("separator_region")
+ || name == QString("chart_region")
+ || name == QString("table_region") ;
+
+ if (!region.isValid() || !coords.isValid())
+ break;
+
+ if (is_image_region)
+ {
+
+ regions_found = true;
+ QMap<QString, QVariant> data =
+ layout_->data(attributes, Qt::UserRole).toMap();
+
+ QString id;
+ QMap<QString, QVariant>::iterator it = data.find("id");
+
+ if (it == data.end() || it.key() != "id")
+ qDebug() << "No image region.";
+
+ while (it != data.end() && it.key() == "id")
+ {
+ qDebug() << name;
+ id = it.value().toString();
+ qDebug() << it.key() + " = " + it.value().toString();
+ ++it;
+ }
+
+ int x_max = 0;
+ int y_max = 0;
+ int x_min = INT_MAX;
+ int y_min = INT_MAX;
+
+ // QVector<QMap<QString, QVariant> > vect;
+ for (int j = 0; true; ++j)
+ {
+ // Navigate to the coordinate list
+ point = layout_->index(j, 1, coords);
+ if (!point.isValid())
+ break;
+
+ QMap<QString, QVariant> data =
+ layout_->data(point, Qt::UserRole).toMap();
+ int x = data["x"].toInt();
+ int y = data["y"].toInt();
+
+ // vect << data;
+
+ if (x < x_min)
+ x_min = x;
+ if (x > x_max)
+ x_max = x;
+
+ if (y < y_min)
+ y_min = y;
+ if (y > y_max)
+ y_max = y;
+
+ }
+
+ using namespace mln;
+
+ box2d box = make::box2d(y_min, x_min, y_max, x_max);
+
+ image2d<value::rgb8> ima;
+ io::ppm::load(ima, image_file_.toStdString());
+ ima = scribo::preprocessing::crop(ima, box);
+
+ // image2d<bool> mask = make::box2d(y_min, x_min, y_max, x_max);
+ // data::fill(mask, true);
+
+ /*for (int a = 1; a < vect.size(); ++a)
+ {
+ int x = vect[a]["x"].toInt();
+ int y = vect[a]["y"].toInt();
+
+ data::fill((mask | make::box2d(y, x, y, x)).rw(), false);
+ }*/
+
+
+ // io::pbm::save(mask, "output/img/mask_" + id.toStdString());
+ io::magick::save(ima, path_.toStdString() + "img/" + id.toStdString() + ".png");
+
+ }
+ }
+
+ if (!regions_found)
+ qDebug() << "No regions found.";
+ }
+}
diff --git a/scribo/demo/viewer/step_widget.hh b/scribo/sandbox/arthur/xml_to_html/xml_to_html.hh
similarity index 73%
copy from scribo/demo/viewer/step_widget.hh
copy to scribo/sandbox/arthur/xml_to_html/xml_to_html.hh
index 829f814..27a271e 100644
--- a/scribo/demo/viewer/step_widget.hh
+++ b/scribo/sandbox/arthur/xml_to_html/xml_to_html.hh
@@ -23,35 +23,27 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-
-#ifndef STEP_WIDGET_HH_
-# define STEP_WIDGET_HH_
+#ifndef IMAGE_CROP_HH
+# define IMAGE_CROP_HH
# include <QtGui>
-typedef QMap<QString, QString> StepQMap;
+class DomModel;
-class StepWidget
- : public QWidget
+class ImageCrop : public QObject
{
Q_OBJECT
-
-public:
- StepWidget();
- ~StepWidget();
- void add_element(const QString& element);
-
-signals:
- void load_image(QString);
- void load_xml(QString);
-
-public slots:
- void fill_steps(QString file);
- void activate(QListWidgetItem* item);
-
-private:
- QListWidget* view_;
- StepQMap map_;
+ public:
+ ImageCrop();
+ ~ImageCrop();
+ void merge(QString in, QString other, QString output = "output.xml");
+ bool load_xml(QString xml_file, QString image_file = "", QString path = "output");
+ void find_image_regions();
+ private:
+ DomModel* layout_;
+ QString image_file_;
+ QString path_;
+ bool regions_;
};
-#endif /* !STEP_WIDGET_HH_ */
+#endif /* !IMAGE_CROP_HH */
diff --git a/scribo/sandbox/arthur/xml_to_html/xml_to_html.pro b/scribo/sandbox/arthur/xml_to_html/xml_to_html.pro
new file mode 100644
index 0000000..b43b527
--- /dev/null
+++ b/scribo/sandbox/arthur/xml_to_html/xml_to_html.pro
@@ -0,0 +1,16 @@
+######################################################################
+# Automatically generated by qmake (2.01a) lun. juil. 5 16:53:31 2010
+######################################################################
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+QMAKE_CXXFLAGS += -I/amd/beyrouth/home/lrde/stage/crepin/olena/milena -I/amd/beyrouth/home/lrde/stage/crepin/olena/
+QT += xml
+LIBS += `Magick++-config --libs`
+
+
+# Input
+HEADERS += domitem.hh dommodel.hh xml_to_html.hh
+SOURCES += domitem.cc dommodel.cc main.cc xml_to_html.cc
--
1.5.6.5
1
0
16 Nov '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 next-build-test has been created
at 63c3277770ffaa3b4e398d55abda8c5d20dc9457 (commit)
- Log -----------------------------------------------------------------
63c3277 Regen .mk files in Scribo.
b410ac8 Compilation fixes.
47b8275 scribo/core/document.hh: Add new methods.
b36c24d scribo/io/xml/save.hh: Add conditions before saving elements and text.
75906d4 scribo/core/line_set.hh (is_valid()): New method.
0731c7c Regen mk files in Milena.
1ab4203 Introduce world::rgb::invert.
d6086ba Improve dispatch in arith::revert routine.
33bbebf mln/data/paste_without_localization.hh: Remove duplicate declarations.
aa2b96f mln/accu/stat/histo3d_rgb.hh: Import histo3d RGB accu from
9056104 scribo/primitive/group/from_double_link_any.hh: New.
7ae09a2 scribo/primitive/link/with_single_right_link_dmax_ratio_aligned.hh: New.
77cb972 Improve text_in_picture_neg.
7b6381a Do not negate Sauvola's output.
b7fe0b0 scribo/core/component_set.hh: Combine separator images.
b584d0d First draft of text_in_picture_neg
47dbda4 Add merge::components routine.
c30e01c Introduce text_in_picture toolchain.
a37cf92 src/content_in_doc.cc: New example extracting document content.
4e3b22c scribo/toolchain/text_in_doc.hh: Make use of non visible separators information.
c2ce47f scribo/io/xml/save.hh: Make use of document structure.
15f9077 scribo/primitive/extract/elements.hh: New routine.
929109d scribo/primitive/extract/separators_nonvisible.hh: New routine.
f6cd71c mln/clustering/kmean_rgb.hh: Import Kmean RGB from Yann's sandbox.
dc8a597 mln/fun/v2v/rgb8_to_rgbn.hh: Import rgb8 to rgbn conversion function from Yann's sandbox.
a6d10b9 scribo/core/macros.hh: Remove deprecated macro.
bb14430 scribo/core/document.hh: Introduce new document structure.
8de09d4 Merge branch 'exp/green' into next-build-test
f3beb04 Update default value in an example
05e90bb Add conversions from int_u to float and double.
ae08c96 mln/convert/from_to.hh: Make use of value::cast for conversions between built-in types.
4b787b3 mln/data/paste_without_localization.hh: Add a missing dispatch overload.
f046b9f mln/io/plot/save.hh: Remove an inline keyword.
986d2c9 Add missing MLN_WO_GLOBAL_VARS conditions.
f049b3b demo/viewer/Makefile.am: Remove deprecated dependencies.
e41a013 Include scribo.mk instead of tests.mk.
938b829 Add a new debug tool.
5a6d399 scribo/canvas/integral_browsing.hh: Cleanup comments.
5cc2327 src/binarization/sauvola_ms.cc: Add missing includes.
a10c9ac Set default window size to 101 in Sauvola examples.
3081130 Improve debug management and outputs for Sauvola.
68c4e75 Improve debug management and outputs for Sauvola.
e707239 mln/accu/stat/deviation.hh: Set first template parameter of accu::stat:sum to mln_sum(T).
398af6c arthur/xml_transform/xml_transform.pro: Define NDEBUG at compile time.
6f0918c Add missing const references to function arguments.
dc310b6 Changelog: Cleanup.
153406c Open Document bug warning.
af079ed Fix man error.
f0997ba Add arrows shortcuts.
811f992 Delete two build files.
32f92e4 Add shortcuts in Qt interface.
9c0bdaa Fix bug in Qt interface.
09c08ad OpenDocument output (odt and odf).
de57fc4 SVG output.
58691e5 Fix Segfault bug in Qt interface.
99635db Small changes in xml_transform.
e3767ee Files headers change + base64 data hide in xml tree.
ee3e8df Text selectable in Qt interface.
d7ea2d3 Some changes in XML interface.
6d0a92e Base 64 support in Qt interface (xmlc extension)
07a17b9 Two new features in Qt interface.
f7ae8c2 ChangeLog mistake.
e388d79 XML Tranform.
7c0d10c XML transform program.
4a399a3 ICDAR XML to HTML.
11d3d49 Small fix in Qt interface.
7fce05e src/Makefile.am (CLEANFILES): Fix invalid variable name.
af88c25 Add scribo-cli script.
a303457 Setup what to install with Scribo.
a51486d Make use of autotroll in demo/review.
656656d Install Scribo headers in include/scribo.
4f559a7 tests/Makefile.am (EXTRA_DIST): Fix path to files.
5ced6bd tests/Makefile.am (EXTRA_DIST): Add new files.
9735516 Re-enable 'table' directory in SUBDIRS.
28614aa Distribute Scribo.
-----------------------------------------------------------------------
hooks/post-receive
--
Olena, a generic and efficient image processing platform
1
0
* headers.mk,
* tests/unit_test/unit-tests.mk: Regen.
---
scribo/ChangeLog | 7 +++++++
scribo/headers.mk | 10 +++++++++-
scribo/tests/unit_test/unit-tests.mk | 22 ++++++++++++++++++++--
3 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 9812499..6c4d48d 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Regen .mk files in Scribo.
+
+ * headers.mk,
+ * tests/unit_test/unit-tests.mk: Regen.
+
+2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Compilation fixes.
* scribo/binarization/sauvola_threshold_image.hh: Fix namespace
diff --git a/scribo/headers.mk b/scribo/headers.mk
index 30256bb..5585ccc 100644
--- a/scribo/headers.mk
+++ b/scribo/headers.mk
@@ -5,13 +5,14 @@ scribo/all.hh \
scribo/binarization/all.hh \
scribo/binarization/global_threshold.hh \
scribo/binarization/global_threshold_auto.hh \
+scribo/binarization/internal/compute_sauvola_threshold.hh \
scribo/binarization/internal/first_pass_functor.hh \
+scribo/binarization/internal/sauvola_debug.hh \
scribo/binarization/local_threshold.hh \
scribo/binarization/sauvola.hh \
scribo/binarization/sauvola_ms.hh \
scribo/binarization/sauvola_ms_split.hh \
scribo/binarization/sauvola_threshold_image.hh \
-scribo/binarization/sauvola_threshold_image_debug.hh \
scribo/canvas/integral_browsing.hh \
scribo/convert/from_qimage.hh \
scribo/core/all.hh \
@@ -21,6 +22,7 @@ scribo/core/component_set.hh \
scribo/core/concept/dmax_functor.hh \
scribo/core/concept/link_functor.hh \
scribo/core/def/lbl_type.hh \
+scribo/core/document.hh \
scribo/core/erase_objects.hh \
scribo/core/init_integral_image.hh \
scribo/core/line_info.hh \
@@ -109,6 +111,7 @@ scribo/primitive/extract/all.hh \
scribo/primitive/extract/canvas.hh \
scribo/primitive/extract/cells.hh \
scribo/primitive/extract/components.hh \
+scribo/primitive/extract/elements.hh \
scribo/primitive/extract/horizontal_separators.hh \
scribo/primitive/extract/lines_discontinued.hh \
scribo/primitive/extract/lines_h_discontinued.hh \
@@ -124,10 +127,12 @@ scribo/primitive/extract/lines_v_single.hh \
scribo/primitive/extract/lines_v_thick.hh \
scribo/primitive/extract/lines_v_thick_and_single.hh \
scribo/primitive/extract/separators.hh \
+scribo/primitive/extract/separators_nonvisible.hh \
scribo/primitive/extract/vertical_separators.hh \
scribo/primitive/group/all.hh \
scribo/primitive/group/apply.hh \
scribo/primitive/group/from_double_link.hh \
+scribo/primitive/group/from_double_link_any.hh \
scribo/primitive/group/from_graph.hh \
scribo/primitive/group/from_single_link.hh \
scribo/primitive/internal/all.hh \
@@ -165,8 +170,10 @@ scribo/primitive/link/with_single_left_link_dmax_ratio.hh \
scribo/primitive/link/with_single_right_link.hh \
scribo/primitive/link/with_single_right_link_bottom.hh \
scribo/primitive/link/with_single_right_link_dmax_ratio.hh \
+scribo/primitive/link/with_single_right_link_dmax_ratio_aligned.hh \
scribo/primitive/link/with_single_right_link_top.hh \
scribo/primitive/link/with_single_up_link.hh \
+scribo/primitive/merge/components.hh \
scribo/primitive/regroup/from_single_left_link.hh \
scribo/primitive/regroup/from_single_left_link_wrt_h_ratio.hh \
scribo/primitive/remove/separators.hh \
@@ -197,6 +204,7 @@ scribo/text/recognition.hh \
scribo/toolchain/nepomuk/text_extraction.hh \
scribo/toolchain/text_in_doc.hh \
scribo/toolchain/text_in_doc_preprocess.hh \
+scribo/toolchain/text_in_picture.hh \
scribo/upsampling/bs2x.hh \
scribo/upsampling/eagle.hh
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index 57c3c38..bd8b787 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -48,13 +48,14 @@ scribo_all \
scribo_binarization_all \
scribo_binarization_global_threshold \
scribo_binarization_global_threshold_auto \
+scribo_binarization_internal_compute_sauvola_threshold \
scribo_binarization_internal_first_pass_functor \
+scribo_binarization_internal_sauvola_debug \
scribo_binarization_local_threshold \
scribo_binarization_sauvola \
scribo_binarization_sauvola_ms \
scribo_binarization_sauvola_ms_split \
scribo_binarization_sauvola_threshold_image \
-scribo_binarization_sauvola_threshold_image_debug \
scribo_canvas_integral_browsing \
scribo_core_all \
scribo_core_central_sites \
@@ -63,6 +64,7 @@ scribo_core_component_set \
scribo_core_concept_dmax_functor \
scribo_core_concept_link_functor \
scribo_core_def_lbl_type \
+scribo_core_document \
scribo_core_erase_objects \
scribo_core_init_integral_image \
scribo_core_line_info \
@@ -151,6 +153,7 @@ scribo_primitive_extract_all \
scribo_primitive_extract_canvas \
scribo_primitive_extract_cells \
scribo_primitive_extract_components \
+scribo_primitive_extract_elements \
scribo_primitive_extract_horizontal_separators \
scribo_primitive_extract_lines_discontinued \
scribo_primitive_extract_lines_h_discontinued \
@@ -166,10 +169,12 @@ scribo_primitive_extract_lines_v_single \
scribo_primitive_extract_lines_v_thick \
scribo_primitive_extract_lines_v_thick_and_single \
scribo_primitive_extract_separators \
+scribo_primitive_extract_separators_nonvisible \
scribo_primitive_extract_vertical_separators \
scribo_primitive_group_all \
scribo_primitive_group_apply \
scribo_primitive_group_from_double_link \
+scribo_primitive_group_from_double_link_any \
scribo_primitive_group_from_graph \
scribo_primitive_group_from_single_link \
scribo_primitive_internal_all \
@@ -203,8 +208,10 @@ 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_dmax_ratio_aligned \
scribo_primitive_link_with_single_right_link_top \
scribo_primitive_link_with_single_up_link \
+scribo_primitive_merge_components \
scribo_primitive_regroup_from_single_left_link \
scribo_primitive_regroup_from_single_left_link_wrt_h_ratio \
scribo_primitive_remove_separators \
@@ -231,6 +238,8 @@ scribo_text_clean_inplace \
scribo_text_extract_lines \
scribo_text_look_like_text_lines \
scribo_text_merging \
+scribo_toolchain_text_in_doc_preprocess \
+scribo_toolchain_text_in_picture \
scribo_upsampling_bs2x \
scribo_upsampling_eagle
@@ -238,13 +247,14 @@ scribo_all_SOURCES = scribo_all.cc
scribo_binarization_all_SOURCES = scribo_binarization_all.cc
scribo_binarization_global_threshold_SOURCES = scribo_binarization_global_threshold.cc
scribo_binarization_global_threshold_auto_SOURCES = scribo_binarization_global_threshold_auto.cc
+scribo_binarization_internal_compute_sauvola_threshold_SOURCES = scribo_binarization_internal_compute_sauvola_threshold.cc
scribo_binarization_internal_first_pass_functor_SOURCES = scribo_binarization_internal_first_pass_functor.cc
+scribo_binarization_internal_sauvola_debug_SOURCES = scribo_binarization_internal_sauvola_debug.cc
scribo_binarization_local_threshold_SOURCES = scribo_binarization_local_threshold.cc
scribo_binarization_sauvola_SOURCES = scribo_binarization_sauvola.cc
scribo_binarization_sauvola_ms_SOURCES = scribo_binarization_sauvola_ms.cc
scribo_binarization_sauvola_ms_split_SOURCES = scribo_binarization_sauvola_ms_split.cc
scribo_binarization_sauvola_threshold_image_SOURCES = scribo_binarization_sauvola_threshold_image.cc
-scribo_binarization_sauvola_threshold_image_debug_SOURCES = scribo_binarization_sauvola_threshold_image_debug.cc
scribo_canvas_integral_browsing_SOURCES = scribo_canvas_integral_browsing.cc
scribo_core_all_SOURCES = scribo_core_all.cc
scribo_core_central_sites_SOURCES = scribo_core_central_sites.cc
@@ -253,6 +263,7 @@ scribo_core_component_set_SOURCES = scribo_core_component_set.cc
scribo_core_concept_dmax_functor_SOURCES = scribo_core_concept_dmax_functor.cc
scribo_core_concept_link_functor_SOURCES = scribo_core_concept_link_functor.cc
scribo_core_def_lbl_type_SOURCES = scribo_core_def_lbl_type.cc
+scribo_core_document_SOURCES = scribo_core_document.cc
scribo_core_erase_objects_SOURCES = scribo_core_erase_objects.cc
scribo_core_init_integral_image_SOURCES = scribo_core_init_integral_image.cc
scribo_core_line_info_SOURCES = scribo_core_line_info.cc
@@ -341,6 +352,7 @@ scribo_primitive_extract_all_SOURCES = scribo_primitive_extract_all.cc
scribo_primitive_extract_canvas_SOURCES = scribo_primitive_extract_canvas.cc
scribo_primitive_extract_cells_SOURCES = scribo_primitive_extract_cells.cc
scribo_primitive_extract_components_SOURCES = scribo_primitive_extract_components.cc
+scribo_primitive_extract_elements_SOURCES = scribo_primitive_extract_elements.cc
scribo_primitive_extract_horizontal_separators_SOURCES = scribo_primitive_extract_horizontal_separators.cc
scribo_primitive_extract_lines_discontinued_SOURCES = scribo_primitive_extract_lines_discontinued.cc
scribo_primitive_extract_lines_h_discontinued_SOURCES = scribo_primitive_extract_lines_h_discontinued.cc
@@ -356,10 +368,12 @@ scribo_primitive_extract_lines_v_single_SOURCES = scribo_primitive_extract_lines
scribo_primitive_extract_lines_v_thick_SOURCES = scribo_primitive_extract_lines_v_thick.cc
scribo_primitive_extract_lines_v_thick_and_single_SOURCES = scribo_primitive_extract_lines_v_thick_and_single.cc
scribo_primitive_extract_separators_SOURCES = scribo_primitive_extract_separators.cc
+scribo_primitive_extract_separators_nonvisible_SOURCES = scribo_primitive_extract_separators_nonvisible.cc
scribo_primitive_extract_vertical_separators_SOURCES = scribo_primitive_extract_vertical_separators.cc
scribo_primitive_group_all_SOURCES = scribo_primitive_group_all.cc
scribo_primitive_group_apply_SOURCES = scribo_primitive_group_apply.cc
scribo_primitive_group_from_double_link_SOURCES = scribo_primitive_group_from_double_link.cc
+scribo_primitive_group_from_double_link_any_SOURCES = scribo_primitive_group_from_double_link_any.cc
scribo_primitive_group_from_graph_SOURCES = scribo_primitive_group_from_graph.cc
scribo_primitive_group_from_single_link_SOURCES = scribo_primitive_group_from_single_link.cc
scribo_primitive_internal_all_SOURCES = scribo_primitive_internal_all.cc
@@ -393,8 +407,10 @@ scribo_primitive_link_with_single_left_link_dmax_ratio_SOURCES = scribo_primitiv
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_dmax_ratio_aligned_SOURCES = scribo_primitive_link_with_single_right_link_dmax_ratio_aligned.cc
scribo_primitive_link_with_single_right_link_top_SOURCES = scribo_primitive_link_with_single_right_link_top.cc
scribo_primitive_link_with_single_up_link_SOURCES = scribo_primitive_link_with_single_up_link.cc
+scribo_primitive_merge_components_SOURCES = scribo_primitive_merge_components.cc
scribo_primitive_regroup_from_single_left_link_SOURCES = scribo_primitive_regroup_from_single_left_link.cc
scribo_primitive_regroup_from_single_left_link_wrt_h_ratio_SOURCES = scribo_primitive_regroup_from_single_left_link_wrt_h_ratio.cc
scribo_primitive_remove_separators_SOURCES = scribo_primitive_remove_separators.cc
@@ -421,6 +437,8 @@ scribo_text_clean_inplace_SOURCES = scribo_text_clean_inplace.cc
scribo_text_extract_lines_SOURCES = scribo_text_extract_lines.cc
scribo_text_look_like_text_lines_SOURCES = scribo_text_look_like_text_lines.cc
scribo_text_merging_SOURCES = scribo_text_merging.cc
+scribo_toolchain_text_in_doc_preprocess_SOURCES = scribo_toolchain_text_in_doc_preprocess.cc
+scribo_toolchain_text_in_picture_SOURCES = scribo_toolchain_text_in_picture.cc
scribo_upsampling_bs2x_SOURCES = scribo_upsampling_bs2x.cc
scribo_upsampling_eagle_SOURCES = scribo_upsampling_eagle.cc
--
1.5.6.5
1
0
* headers.mk,
* tests/unit_test/unit-tests.mk: Regen.
---
scribo/ChangeLog | 7 +++++++
scribo/headers.mk | 10 +++++++++-
scribo/tests/unit_test/unit-tests.mk | 22 ++++++++++++++++++++--
3 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 8f5a26a..be2365e 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,12 @@
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Regen .mk files in Scribo.
+
+ * headers.mk,
+ * tests/unit_test/unit-tests.mk: Regen.
+
+2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Compilation fixes.
* scribo/binarization/sauvola_threshold_image.hh: Fix namespace
diff --git a/scribo/headers.mk b/scribo/headers.mk
index 30256bb..5585ccc 100644
--- a/scribo/headers.mk
+++ b/scribo/headers.mk
@@ -5,13 +5,14 @@ scribo/all.hh \
scribo/binarization/all.hh \
scribo/binarization/global_threshold.hh \
scribo/binarization/global_threshold_auto.hh \
+scribo/binarization/internal/compute_sauvola_threshold.hh \
scribo/binarization/internal/first_pass_functor.hh \
+scribo/binarization/internal/sauvola_debug.hh \
scribo/binarization/local_threshold.hh \
scribo/binarization/sauvola.hh \
scribo/binarization/sauvola_ms.hh \
scribo/binarization/sauvola_ms_split.hh \
scribo/binarization/sauvola_threshold_image.hh \
-scribo/binarization/sauvola_threshold_image_debug.hh \
scribo/canvas/integral_browsing.hh \
scribo/convert/from_qimage.hh \
scribo/core/all.hh \
@@ -21,6 +22,7 @@ scribo/core/component_set.hh \
scribo/core/concept/dmax_functor.hh \
scribo/core/concept/link_functor.hh \
scribo/core/def/lbl_type.hh \
+scribo/core/document.hh \
scribo/core/erase_objects.hh \
scribo/core/init_integral_image.hh \
scribo/core/line_info.hh \
@@ -109,6 +111,7 @@ scribo/primitive/extract/all.hh \
scribo/primitive/extract/canvas.hh \
scribo/primitive/extract/cells.hh \
scribo/primitive/extract/components.hh \
+scribo/primitive/extract/elements.hh \
scribo/primitive/extract/horizontal_separators.hh \
scribo/primitive/extract/lines_discontinued.hh \
scribo/primitive/extract/lines_h_discontinued.hh \
@@ -124,10 +127,12 @@ scribo/primitive/extract/lines_v_single.hh \
scribo/primitive/extract/lines_v_thick.hh \
scribo/primitive/extract/lines_v_thick_and_single.hh \
scribo/primitive/extract/separators.hh \
+scribo/primitive/extract/separators_nonvisible.hh \
scribo/primitive/extract/vertical_separators.hh \
scribo/primitive/group/all.hh \
scribo/primitive/group/apply.hh \
scribo/primitive/group/from_double_link.hh \
+scribo/primitive/group/from_double_link_any.hh \
scribo/primitive/group/from_graph.hh \
scribo/primitive/group/from_single_link.hh \
scribo/primitive/internal/all.hh \
@@ -165,8 +170,10 @@ scribo/primitive/link/with_single_left_link_dmax_ratio.hh \
scribo/primitive/link/with_single_right_link.hh \
scribo/primitive/link/with_single_right_link_bottom.hh \
scribo/primitive/link/with_single_right_link_dmax_ratio.hh \
+scribo/primitive/link/with_single_right_link_dmax_ratio_aligned.hh \
scribo/primitive/link/with_single_right_link_top.hh \
scribo/primitive/link/with_single_up_link.hh \
+scribo/primitive/merge/components.hh \
scribo/primitive/regroup/from_single_left_link.hh \
scribo/primitive/regroup/from_single_left_link_wrt_h_ratio.hh \
scribo/primitive/remove/separators.hh \
@@ -197,6 +204,7 @@ scribo/text/recognition.hh \
scribo/toolchain/nepomuk/text_extraction.hh \
scribo/toolchain/text_in_doc.hh \
scribo/toolchain/text_in_doc_preprocess.hh \
+scribo/toolchain/text_in_picture.hh \
scribo/upsampling/bs2x.hh \
scribo/upsampling/eagle.hh
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index 57c3c38..bd8b787 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -48,13 +48,14 @@ scribo_all \
scribo_binarization_all \
scribo_binarization_global_threshold \
scribo_binarization_global_threshold_auto \
+scribo_binarization_internal_compute_sauvola_threshold \
scribo_binarization_internal_first_pass_functor \
+scribo_binarization_internal_sauvola_debug \
scribo_binarization_local_threshold \
scribo_binarization_sauvola \
scribo_binarization_sauvola_ms \
scribo_binarization_sauvola_ms_split \
scribo_binarization_sauvola_threshold_image \
-scribo_binarization_sauvola_threshold_image_debug \
scribo_canvas_integral_browsing \
scribo_core_all \
scribo_core_central_sites \
@@ -63,6 +64,7 @@ scribo_core_component_set \
scribo_core_concept_dmax_functor \
scribo_core_concept_link_functor \
scribo_core_def_lbl_type \
+scribo_core_document \
scribo_core_erase_objects \
scribo_core_init_integral_image \
scribo_core_line_info \
@@ -151,6 +153,7 @@ scribo_primitive_extract_all \
scribo_primitive_extract_canvas \
scribo_primitive_extract_cells \
scribo_primitive_extract_components \
+scribo_primitive_extract_elements \
scribo_primitive_extract_horizontal_separators \
scribo_primitive_extract_lines_discontinued \
scribo_primitive_extract_lines_h_discontinued \
@@ -166,10 +169,12 @@ scribo_primitive_extract_lines_v_single \
scribo_primitive_extract_lines_v_thick \
scribo_primitive_extract_lines_v_thick_and_single \
scribo_primitive_extract_separators \
+scribo_primitive_extract_separators_nonvisible \
scribo_primitive_extract_vertical_separators \
scribo_primitive_group_all \
scribo_primitive_group_apply \
scribo_primitive_group_from_double_link \
+scribo_primitive_group_from_double_link_any \
scribo_primitive_group_from_graph \
scribo_primitive_group_from_single_link \
scribo_primitive_internal_all \
@@ -203,8 +208,10 @@ 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_dmax_ratio_aligned \
scribo_primitive_link_with_single_right_link_top \
scribo_primitive_link_with_single_up_link \
+scribo_primitive_merge_components \
scribo_primitive_regroup_from_single_left_link \
scribo_primitive_regroup_from_single_left_link_wrt_h_ratio \
scribo_primitive_remove_separators \
@@ -231,6 +238,8 @@ scribo_text_clean_inplace \
scribo_text_extract_lines \
scribo_text_look_like_text_lines \
scribo_text_merging \
+scribo_toolchain_text_in_doc_preprocess \
+scribo_toolchain_text_in_picture \
scribo_upsampling_bs2x \
scribo_upsampling_eagle
@@ -238,13 +247,14 @@ scribo_all_SOURCES = scribo_all.cc
scribo_binarization_all_SOURCES = scribo_binarization_all.cc
scribo_binarization_global_threshold_SOURCES = scribo_binarization_global_threshold.cc
scribo_binarization_global_threshold_auto_SOURCES = scribo_binarization_global_threshold_auto.cc
+scribo_binarization_internal_compute_sauvola_threshold_SOURCES = scribo_binarization_internal_compute_sauvola_threshold.cc
scribo_binarization_internal_first_pass_functor_SOURCES = scribo_binarization_internal_first_pass_functor.cc
+scribo_binarization_internal_sauvola_debug_SOURCES = scribo_binarization_internal_sauvola_debug.cc
scribo_binarization_local_threshold_SOURCES = scribo_binarization_local_threshold.cc
scribo_binarization_sauvola_SOURCES = scribo_binarization_sauvola.cc
scribo_binarization_sauvola_ms_SOURCES = scribo_binarization_sauvola_ms.cc
scribo_binarization_sauvola_ms_split_SOURCES = scribo_binarization_sauvola_ms_split.cc
scribo_binarization_sauvola_threshold_image_SOURCES = scribo_binarization_sauvola_threshold_image.cc
-scribo_binarization_sauvola_threshold_image_debug_SOURCES = scribo_binarization_sauvola_threshold_image_debug.cc
scribo_canvas_integral_browsing_SOURCES = scribo_canvas_integral_browsing.cc
scribo_core_all_SOURCES = scribo_core_all.cc
scribo_core_central_sites_SOURCES = scribo_core_central_sites.cc
@@ -253,6 +263,7 @@ scribo_core_component_set_SOURCES = scribo_core_component_set.cc
scribo_core_concept_dmax_functor_SOURCES = scribo_core_concept_dmax_functor.cc
scribo_core_concept_link_functor_SOURCES = scribo_core_concept_link_functor.cc
scribo_core_def_lbl_type_SOURCES = scribo_core_def_lbl_type.cc
+scribo_core_document_SOURCES = scribo_core_document.cc
scribo_core_erase_objects_SOURCES = scribo_core_erase_objects.cc
scribo_core_init_integral_image_SOURCES = scribo_core_init_integral_image.cc
scribo_core_line_info_SOURCES = scribo_core_line_info.cc
@@ -341,6 +352,7 @@ scribo_primitive_extract_all_SOURCES = scribo_primitive_extract_all.cc
scribo_primitive_extract_canvas_SOURCES = scribo_primitive_extract_canvas.cc
scribo_primitive_extract_cells_SOURCES = scribo_primitive_extract_cells.cc
scribo_primitive_extract_components_SOURCES = scribo_primitive_extract_components.cc
+scribo_primitive_extract_elements_SOURCES = scribo_primitive_extract_elements.cc
scribo_primitive_extract_horizontal_separators_SOURCES = scribo_primitive_extract_horizontal_separators.cc
scribo_primitive_extract_lines_discontinued_SOURCES = scribo_primitive_extract_lines_discontinued.cc
scribo_primitive_extract_lines_h_discontinued_SOURCES = scribo_primitive_extract_lines_h_discontinued.cc
@@ -356,10 +368,12 @@ scribo_primitive_extract_lines_v_single_SOURCES = scribo_primitive_extract_lines
scribo_primitive_extract_lines_v_thick_SOURCES = scribo_primitive_extract_lines_v_thick.cc
scribo_primitive_extract_lines_v_thick_and_single_SOURCES = scribo_primitive_extract_lines_v_thick_and_single.cc
scribo_primitive_extract_separators_SOURCES = scribo_primitive_extract_separators.cc
+scribo_primitive_extract_separators_nonvisible_SOURCES = scribo_primitive_extract_separators_nonvisible.cc
scribo_primitive_extract_vertical_separators_SOURCES = scribo_primitive_extract_vertical_separators.cc
scribo_primitive_group_all_SOURCES = scribo_primitive_group_all.cc
scribo_primitive_group_apply_SOURCES = scribo_primitive_group_apply.cc
scribo_primitive_group_from_double_link_SOURCES = scribo_primitive_group_from_double_link.cc
+scribo_primitive_group_from_double_link_any_SOURCES = scribo_primitive_group_from_double_link_any.cc
scribo_primitive_group_from_graph_SOURCES = scribo_primitive_group_from_graph.cc
scribo_primitive_group_from_single_link_SOURCES = scribo_primitive_group_from_single_link.cc
scribo_primitive_internal_all_SOURCES = scribo_primitive_internal_all.cc
@@ -393,8 +407,10 @@ scribo_primitive_link_with_single_left_link_dmax_ratio_SOURCES = scribo_primitiv
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_dmax_ratio_aligned_SOURCES = scribo_primitive_link_with_single_right_link_dmax_ratio_aligned.cc
scribo_primitive_link_with_single_right_link_top_SOURCES = scribo_primitive_link_with_single_right_link_top.cc
scribo_primitive_link_with_single_up_link_SOURCES = scribo_primitive_link_with_single_up_link.cc
+scribo_primitive_merge_components_SOURCES = scribo_primitive_merge_components.cc
scribo_primitive_regroup_from_single_left_link_SOURCES = scribo_primitive_regroup_from_single_left_link.cc
scribo_primitive_regroup_from_single_left_link_wrt_h_ratio_SOURCES = scribo_primitive_regroup_from_single_left_link_wrt_h_ratio.cc
scribo_primitive_remove_separators_SOURCES = scribo_primitive_remove_separators.cc
@@ -421,6 +437,8 @@ scribo_text_clean_inplace_SOURCES = scribo_text_clean_inplace.cc
scribo_text_extract_lines_SOURCES = scribo_text_extract_lines.cc
scribo_text_look_like_text_lines_SOURCES = scribo_text_look_like_text_lines.cc
scribo_text_merging_SOURCES = scribo_text_merging.cc
+scribo_toolchain_text_in_doc_preprocess_SOURCES = scribo_toolchain_text_in_doc_preprocess.cc
+scribo_toolchain_text_in_picture_SOURCES = scribo_toolchain_text_in_picture.cc
scribo_upsampling_bs2x_SOURCES = scribo_upsampling_bs2x.cc
scribo_upsampling_eagle_SOURCES = scribo_upsampling_eagle.cc
--
1.5.6.5
1
0
* scribo/binarization/sauvola_threshold_image.hh: Fix namespace
ambiguity.
* scribo/io/xml/save.hh
* scribo/primitive/extract/elements.hh
* scribo/primitive/merge/components.hh
* scribo/toolchain/text_in_doc_preprocess.hh
* scribo/toolchain/text_in_picture.hh
* src/binarization/ppm_sauvola_ms.cc
* src/binarization/ppm_sauvola_ms_fg.cc
* src/binarization/ppm_sauvola_ms_split.cc
* src/binarization/sauvola_ms.cc
* src/binarization/sauvola_ms_fg.cc
* src/binarization/sauvola_ms_split.cc
* src/contest/hdibco-2010/sauvola_ms_hdibco.cc
* src/text_in_picture.cc: Add missing includes.
* scribo/primitive/extract/lines_h_pattern.hh,
* scribo/primitive/extract/lines_v_pattern.hh: Make sure the
rectangle have odd dimensions.
* src/Makefile.am: Remove deprecated include path.
* src/binarization/ppm_sauvola.cc: Convert to gray level.
* src/pbm_text_in_doc.cc: Use doc structure.
* src/text_in_picture_neg.cc: Make use of world::rgb::invert.
---
scribo/ChangeLog | 33 ++++++++++++
.../scribo/binarization/sauvola_threshold_image.hh | 4 +-
scribo/scribo/io/xml/save.hh | 1 +
scribo/scribo/primitive/extract/elements.hh | 12 ++++-
scribo/scribo/primitive/extract/lines_h_pattern.hh | 10 +++-
scribo/scribo/primitive/extract/lines_v_pattern.hh | 10 +++-
scribo/scribo/primitive/merge/components.hh | 5 ++
scribo/scribo/toolchain/text_in_doc_preprocess.hh | 2 +
scribo/scribo/toolchain/text_in_picture.hh | 55 ++++++++++++++++++--
scribo/src/Makefile.am | 2 -
scribo/src/binarization/ppm_sauvola.cc | 10 +++-
scribo/src/binarization/ppm_sauvola_ms.cc | 5 ++
scribo/src/binarization/ppm_sauvola_ms_fg.cc | 6 ++
scribo/src/binarization/ppm_sauvola_ms_split.cc | 8 ++-
scribo/src/binarization/sauvola_ms.cc | 5 ++
scribo/src/binarization/sauvola_ms_fg.cc | 6 ++
scribo/src/binarization/sauvola_ms_split.cc | 3 +-
.../src/contest/hdibco-2010/sauvola_ms_hdibco.cc | 2 +
scribo/src/pbm_text_in_doc.cc | 10 +++-
scribo/src/text_in_picture.cc | 15 -----
scribo/src/text_in_picture_neg.cc | 5 ++-
21 files changed, 172 insertions(+), 37 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index f6248fa..9812499 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,38 @@
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Compilation fixes.
+
+ * scribo/binarization/sauvola_threshold_image.hh: Fix namespace
+ ambiguity.
+
+ * scribo/io/xml/save.hh
+ * scribo/primitive/extract/elements.hh
+ * scribo/primitive/merge/components.hh
+ * scribo/toolchain/text_in_doc_preprocess.hh
+ * scribo/toolchain/text_in_picture.hh
+ * src/binarization/ppm_sauvola_ms.cc
+ * src/binarization/ppm_sauvola_ms_fg.cc
+ * src/binarization/ppm_sauvola_ms_split.cc
+ * src/binarization/sauvola_ms.cc
+ * src/binarization/sauvola_ms_fg.cc
+ * src/binarization/sauvola_ms_split.cc
+ * src/contest/hdibco-2010/sauvola_ms_hdibco.cc
+ * src/text_in_picture.cc: Add missing includes.
+
+ * scribo/primitive/extract/lines_h_pattern.hh,
+ * scribo/primitive/extract/lines_v_pattern.hh: Make sure the
+ rectangle have odd dimensions.
+
+ * src/Makefile.am: Remove deprecated include path.
+
+ * src/binarization/ppm_sauvola.cc: Convert to gray level.
+
+ * src/pbm_text_in_doc.cc: Use doc structure.
+
+ * src/text_in_picture_neg.cc: Make use of world::rgb::invert.
+
+2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/core/document.hh: Add new methods.
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/scribo/binarization/sauvola_threshold_image.hh b/scribo/scribo/binarization/sauvola_threshold_image.hh
index 05a7064..94cd688 100644
--- a/scribo/scribo/binarization/sauvola_threshold_image.hh
+++ b/scribo/scribo/binarization/sauvola_threshold_image.hh
@@ -144,8 +144,8 @@ namespace scribo
ncols = static_cast<mln::def::coord>(input.ncols());
- for(def::coord row = 0; row < nrows; ++row)
- for(def::coord col = 0; col < ncols; ++col)
+ for(mln::def::coord row = 0; row < nrows; ++row)
+ for(mln::def::coord col = 0; col < ncols; ++col)
{
# ifdef SCRIBO_SAUVOLA_DEBUG
diff --git a/scribo/scribo/io/xml/save.hh b/scribo/scribo/io/xml/save.hh
index 928db17..3c182e7 100644
--- a/scribo/scribo/io/xml/save.hh
+++ b/scribo/scribo/io/xml/save.hh
@@ -35,6 +35,7 @@
# include <map>
+# include <scribo/core/document.hh>
# include <scribo/core/line_set.hh>
namespace scribo
diff --git a/scribo/scribo/primitive/extract/elements.hh b/scribo/scribo/primitive/extract/elements.hh
index c083988..2e6a0cb 100644
--- a/scribo/scribo/primitive/extract/elements.hh
+++ b/scribo/scribo/primitive/extract/elements.hh
@@ -33,6 +33,7 @@
# define SCRIBO_PRIMITIVE_EXTRACT_ELEMENTS_HH
# include <mln/core/image/image2d.hh>
+# include <mln/core/alias/neighb2d.hh>
# include <mln/data/fill.hh>
# include <mln/util/array.hh>
# include <mln/labeling/compute.hh>
@@ -40,16 +41,21 @@
# include <mln/accu/math/count.hh>
# include <mln/pw/all.hh>
+# include <mln/draw/box_plain.hh>
+
# include <mln/value/label_8.hh>
+# include <mln/value/rgb.hh>
# include <mln/value/rgb8.hh>
# include <scribo/core/macros.hh>
# include <scribo/core/component_set.hh>
+# include <scribo/core/document.hh>
# include <scribo/core/line_set.hh>
+# include <scribo/core/def/lbl_type.hh>
# include <scribo/filter/objects_small.hh>
-#include <mln/clustering/kmean_rgb.hh>
-#include <mln/fun/v2v/rgb8_to_rgbn.hh>
+# include <mln/clustering/kmean_rgb.hh>
+# include <mln/fun/v2v/rgb8_to_rgbn.hh>
namespace scribo
{
@@ -60,6 +66,8 @@ namespace scribo
namespace extract
{
+ using namespace mln;
+
template <typename L, typename I>
component_set<L>
diff --git a/scribo/scribo/primitive/extract/lines_h_pattern.hh b/scribo/scribo/primitive/extract/lines_h_pattern.hh
index 0da7900..6a1f7f0 100644
--- a/scribo/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_h_pattern.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.
//
@@ -30,6 +31,8 @@
///
/// Extract horizontal lines matching a specific pattern.
+# include <cmath>
+
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
# include <mln/win/rectangle2d.hh>
@@ -103,9 +106,12 @@ namespace scribo
mln_concrete(I) output = lines_pattern(input, length, 1, win);
+ unsigned new_length = length / 2 + delta;
+ new_length += 1 - (new_length % 2); // Guaranty that new_length is odd.
+
mln_concrete(I)
output_dil = morpho::dilation(output,
- win::rectangle2d(3, length / 2 + delta));
+ win::rectangle2d(3, new_length));
output = scribo::primitive::internal::rd(output, input * output_dil);
diff --git a/scribo/scribo/primitive/extract/lines_v_pattern.hh b/scribo/scribo/primitive/extract/lines_v_pattern.hh
index cbdf080..8a103ac 100644
--- a/scribo/scribo/primitive/extract/lines_v_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_v_pattern.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.
//
@@ -30,6 +31,8 @@
///
/// Extract vertical lines matching a specific pattern.
+# include <cmath>
+
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
# include <mln/win/rectangle2d.hh>
@@ -85,9 +88,12 @@ namespace scribo
mln_concrete(I) output = lines_pattern(input, length, 0, win);
+ unsigned new_length = length / 2 + delta;
+ new_length += 1 - (new_length % 2); // Guaranty that new_length is odd.
+
mln_concrete(I)
output_dil = morpho::dilation(output,
- win::rectangle2d(length / 2 + delta, 3));
+ win::rectangle2d(new_length, 3));
output = scribo::primitive::internal::rd(output, input * output_dil);
diff --git a/scribo/scribo/primitive/merge/components.hh b/scribo/scribo/primitive/merge/components.hh
index 7570d2e..72f3e9d 100644
--- a/scribo/scribo/primitive/merge/components.hh
+++ b/scribo/scribo/primitive/merge/components.hh
@@ -30,7 +30,12 @@
#ifndef SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
# define SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
+# include <mln/core/concept/function.hh>
# include <mln/core/image/vmorph/fun_image.hh>
+# include <mln/data/fill.hh>
+# include <mln/pw/all.hh>
+
+# include <scribo/core/component_set.hh>
namespace scribo
diff --git a/scribo/scribo/toolchain/text_in_doc_preprocess.hh b/scribo/scribo/toolchain/text_in_doc_preprocess.hh
index 4b7d1e2..00a626e 100644
--- a/scribo/scribo/toolchain/text_in_doc_preprocess.hh
+++ b/scribo/scribo/toolchain/text_in_doc_preprocess.hh
@@ -32,6 +32,8 @@
#include <mln/core/concept/image.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
diff --git a/scribo/scribo/toolchain/text_in_picture.hh b/scribo/scribo/toolchain/text_in_picture.hh
index 7b34114..9746645 100644
--- a/scribo/scribo/toolchain/text_in_picture.hh
+++ b/scribo/scribo/toolchain/text_in_picture.hh
@@ -33,11 +33,58 @@
/// Localize text in a picture.
+# include <libgen.h>
+# include <iostream>
+# include <mln/core/image/image2d.hh>
+# include <mln/core/alias/neighb2d.hh>
-#include <src/afp/components.hh>
-#include <src/afp/link.hh>
-#include <src/afp/regroup.hh>
+# include <mln/literal/colors.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/value/label_16.hh>
+
+# include <mln/fun/v2v/rgb_to_int_u.hh>
+
+# include <mln/subsampling/antialiased.hh>
+
+# include <scribo/draw/bounding_boxes.hh>
+# include <scribo/draw/groups_bboxes.hh>
+
+# include <scribo/binarization/sauvola_ms.hh>
+# include <scribo/binarization/sauvola.hh>
+
+# include <scribo/primitive/extract/components.hh>
+
+# include <scribo/primitive/link/merge_double_link.hh>
+# include <scribo/primitive/link/with_single_left_link.hh>
+# include <scribo/primitive/link/with_single_right_link.hh>
+
+# include <scribo/primitive/group/apply.hh>
+# include <scribo/primitive/group/from_double_link.hh>
+# include <scribo/primitive/group/from_single_link.hh>
+
+# include <scribo/primitive/regroup/from_single_left_link.hh>
+
+# include <scribo/filter/object_groups_with_holes.hh>
+
+# include <scribo/filter/object_links_bbox_h_ratio.hh>
+# include <scribo/filter/object_links_bbox_overlap.hh>
+
+# include <scribo/filter/object_groups_small.hh>
+# include <scribo/filter/object_groups_v_thickness.hh>
+
+# include <scribo/debug/decision_image.hh>
+# include <scribo/debug/save_linked_bboxes_image.hh>
+
+# include <scribo/debug/usage.hh>
+
+# include <scribo/preprocessing/split_bg_fg.hh>
+
+# include <scribo/make/debug_filename.hh>
+
+# include <src/afp/components.hh>
+# include <src/afp/link.hh>
+# include <src/afp/regroup.hh>
# include <mln/util/timer.hh>
@@ -126,7 +173,7 @@ namespace scribo
trace::entering("scribo::toolchain::text_in_picture");
const I& input_rgb_orig = exact(input_rgb_orig_);
- mln_precondition(input.is_valid());
+ mln_precondition(input_rgb_orig.is_valid());
using namespace scribo;
using namespace scribo::primitive;
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 9efa0da..6cf233c 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -99,8 +99,6 @@ if HAVE_TESSERACT
utilexec_PROGRAMS += content_in_doc
content_in_doc_SOURCES = content_in_doc.cc
content_in_doc_CPPFLAGS = $(AM_CPPFLAGS) \
- -I/home/lazzara/git/oln/scribo/sandbox/green/ \
- -I/home/lazzara/git/oln/scribo/sandbox/z/ \
$(TESSERACT_CPPFLAGS) \
$(TIFF_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
diff --git a/scribo/src/binarization/ppm_sauvola.cc b/scribo/src/binarization/ppm_sauvola.cc
index 330af70..f0cd355 100644
--- a/scribo/src/binarization/ppm_sauvola.cc
+++ b/scribo/src/binarization/ppm_sauvola.cc
@@ -26,6 +26,8 @@
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola.hh>
#include <scribo/debug/usage.hh>
@@ -66,10 +68,16 @@ int main(int argc, char *argv[])
std::cout << "Using w=" << w << " and k=" << k << std::endl;
+ // Load
image2d<value::rgb8> input;
io::ppm::load(input, argv[1]);
- image2d<bool> out = scribo::binarization::sauvola(input, w, k);
+ // Convert to Gray level image.
+ image2d<value::int_u8>
+ input_gl = data::transform(input, mln::fun::v2v::rgb_to_int_u<8>());
+
+ // Binarize
+ image2d<bool> out = scribo::binarization::sauvola(input_gl, w, k);
io::pbm::save(out, argv[2]);
diff --git a/scribo/src/binarization/ppm_sauvola_ms.cc b/scribo/src/binarization/ppm_sauvola_ms.cc
index 9e68b0e..eb694c2 100644
--- a/scribo/src/binarization/ppm_sauvola_ms.cc
+++ b/scribo/src/binarization/ppm_sauvola_ms.cc
@@ -28,6 +28,8 @@
#include <mln/value/int_u8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/debug/usage.hh>
@@ -99,6 +101,9 @@ int main(int argc, char *argv[])
else
k = 0.34f;
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
+
// Load
image2d<value::rgb8> input_1;
io::ppm::load(input_1, argv[1]);
diff --git a/scribo/src/binarization/ppm_sauvola_ms_fg.cc b/scribo/src/binarization/ppm_sauvola_ms_fg.cc
index 33a11ac..20f237f 100644
--- a/scribo/src/binarization/ppm_sauvola_ms_fg.cc
+++ b/scribo/src/binarization/ppm_sauvola_ms_fg.cc
@@ -24,10 +24,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/preprocessing/split_bg_fg.hh>
@@ -103,6 +107,8 @@ int main(int argc, char *argv[])
else
k = 0.34f;
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
// Load
image2d<value::rgb8> input_1;
diff --git a/scribo/src/binarization/ppm_sauvola_ms_split.cc b/scribo/src/binarization/ppm_sauvola_ms_split.cc
index 84e4abf..bb98b38 100644
--- a/scribo/src/binarization/ppm_sauvola_ms_split.cc
+++ b/scribo/src/binarization/ppm_sauvola_ms_split.cc
@@ -28,6 +28,8 @@
#include <mln/value/rgb8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms_split.hh>
#include <scribo/debug/usage.hh>
@@ -113,11 +115,13 @@ int main(int argc, char *argv[])
image2d<value::rgb8> input_1;
io::ppm::load(input_1, argv[1]);
- std::cout << "Using w=" << w_1 << " - s=" << s << " - min_ntrue=" << min_ntrue << " - k=" << k << std::endl;
+ std::cout << "Using w=" << w_1 << " - s=" << s
+ << " - min_ntrue=" << min_ntrue << " - k=" << k << std::endl;
// Binarize
image2d<bool>
- output = scribo::binarization::sauvola_ms_split(input_1, w_1, s, min_ntrue, k);
+ output = scribo::binarization::sauvola_ms_split(input_1, w_1, s,
+ min_ntrue, k);
io::pbm::save(output, argv[2]);
}
diff --git a/scribo/src/binarization/sauvola_ms.cc b/scribo/src/binarization/sauvola_ms.cc
index 5f07484..7c3bcf0 100644
--- a/scribo/src/binarization/sauvola_ms.cc
+++ b/scribo/src/binarization/sauvola_ms.cc
@@ -24,6 +24,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/magick/load.hh>
@@ -102,6 +104,9 @@ int main(int argc, char *argv[])
else
k = 0.34f;
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
+
// Load
image2d<value::rgb8> input_1;
io::magick::load(input_1, argv[1]);
diff --git a/scribo/src/binarization/sauvola_ms_fg.cc b/scribo/src/binarization/sauvola_ms_fg.cc
index cad605f..4227db4 100644
--- a/scribo/src/binarization/sauvola_ms_fg.cc
+++ b/scribo/src/binarization/sauvola_ms_fg.cc
@@ -24,10 +24,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/io/magick/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/preprocessing/split_bg_fg.hh>
@@ -86,6 +90,8 @@ int main(int argc, char *argv[])
unsigned s = atoi(argv[4]);
+ std::cout << "Using w_1=" << w_1 << " - s=" << s << std::endl;
+
// Load
image2d<value::rgb8> input_1;
io::magick::load(input_1, argv[1]);
diff --git a/scribo/src/binarization/sauvola_ms_split.cc b/scribo/src/binarization/sauvola_ms_split.cc
index fc9e15c..691bfc9 100644
--- a/scribo/src/binarization/sauvola_ms_split.cc
+++ b/scribo/src/binarization/sauvola_ms_split.cc
@@ -107,7 +107,8 @@ int main(int argc, char *argv[])
else
k = 0.34f;
-
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
image2d<value::rgb8> input_1;
io::magick::load(input_1, argv[1]);
diff --git a/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc b/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc
index 68fdaac..7ef2455 100644
--- a/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc
+++ b/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc
@@ -29,6 +29,8 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/postprocessing/fill_object_holes.hh>
diff --git a/scribo/src/pbm_text_in_doc.cc b/scribo/src/pbm_text_in_doc.cc
index 23ed9e7..96cb92b 100644
--- a/scribo/src/pbm_text_in_doc.cc
+++ b/scribo/src/pbm_text_in_doc.cc
@@ -40,6 +40,7 @@
#include <scribo/toolchain/text_in_doc.hh>
+#include <scribo/core/document.hh>
#include <scribo/core/line_set.hh>
#include <scribo/debug/usage.hh>
@@ -91,11 +92,11 @@ int main(int argc, char* argv[])
trace::entering("main");
+ typedef image2d<scribo::def::lbl_type> L;
image2d<bool> input;
mln::io::pbm::load(input, argv[1]);
-
// Optional Cropping
point2d crop_shift = literal::origin;
if (argc >= 8)
@@ -119,12 +120,15 @@ int main(int argc, char* argv[])
// Run document toolchain.
- typedef image2d<scribo::def::lbl_type> L;
line_set<L>
lines = scribo::toolchain::text_in_doc(input, denoise, debug);
+ scribo::document<L> doc;
+ doc.set_filename(argv[1]);
+ doc.set_text(lines);
+
// Saving results
- scribo::io::xml::save(argv[1], lines, "out.xml", true);
+ scribo::io::xml::save(doc, "out.xml", true);
// Specify shift due to potential previous crop.
scribo::io::text_boxes::save(lines, argv[2], crop_shift);
diff --git a/scribo/src/text_in_picture.cc b/scribo/src/text_in_picture.cc
index cdd2749..042b8d3 100644
--- a/scribo/src/text_in_picture.cc
+++ b/scribo/src/text_in_picture.cc
@@ -28,33 +28,20 @@
#include <iostream>
#include <mln/core/image/image2d.hh>
-#include <mln/core/image/imorph/tr_image.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/colorize.hh>
-#include <mln/data/stretch.hh>
-
#include <mln/io/pbm/all.hh>
#include <mln/io/ppm/save.hh>
#include <mln/io/magick/all.hh>
-#include <mln/math/min.hh>
-
-#include <mln/logical/not.hh>
-
#include <mln/literal/colors.hh>
#include <mln/value/rgb8.hh>
#include <mln/value/label_16.hh>
#include <mln/fun/v2v/rgb_to_int_u.hh>
-#include <mln/data/wrap.hh>
-
-#include <mln/draw/box.hh>
-
-#include <mln/geom/translate.hh>
-
#include <mln/subsampling/antialiased.hh>
#include <scribo/draw/bounding_boxes.hh>
@@ -81,8 +68,6 @@
#include <scribo/filter/object_links_bbox_h_ratio.hh>
#include <scribo/filter/object_links_bbox_overlap.hh>
-#include <scribo/filter/common/objects_photo.hh>
-
#include <scribo/filter/object_groups_small.hh>
#include <scribo/filter/object_groups_v_thickness.hh>
diff --git a/scribo/src/text_in_picture_neg.cc b/scribo/src/text_in_picture_neg.cc
index 2da27a5..7d6694a 100644
--- a/scribo/src/text_in_picture_neg.cc
+++ b/scribo/src/text_in_picture_neg.cc
@@ -58,6 +58,8 @@
#include <mln/subsampling/antialiased.hh>
+#include <mln/world/rgb/invert.hh>
+
#include <scribo/draw/bounding_boxes.hh>
#include <scribo/draw/groups_bboxes.hh>
@@ -169,7 +171,8 @@ int main(int argc, char* argv[])
typedef image2d<value::label_16> L;
component_set<L>
- comps_neg = toolchain::text_in_picture(arith::revert(input_rgb), bg_removal,
+ comps_neg = toolchain::text_in_picture(world::rgb::invert(input_rgb),
+ bg_removal,
multi_scale_bin,
max_dim_size, lambda, out_base_dir);
--
1.5.6.5
1
0
* scribo/binarization/sauvola_threshold_image.hh: Fix namespace
ambiguity.
* scribo/io/xml/save.hh
* scribo/primitive/extract/elements.hh
* scribo/primitive/merge/components.hh
* scribo/toolchain/text_in_doc_preprocess.hh
* scribo/toolchain/text_in_picture.hh
* src/binarization/ppm_sauvola_ms.cc
* src/binarization/ppm_sauvola_ms_fg.cc
* src/binarization/ppm_sauvola_ms_split.cc
* src/binarization/sauvola_ms.cc
* src/binarization/sauvola_ms_fg.cc
* src/binarization/sauvola_ms_split.cc
* src/contest/hdibco-2010/sauvola_ms_hdibco.cc
* src/text_in_picture.cc: Add missing includes.
* scribo/primitive/extract/lines_h_pattern.hh,
* scribo/primitive/extract/lines_v_pattern.hh: Make sure the
rectangle have odd dimensions.
* src/Makefile.am: Remove deprecated include path.
* src/binarization/ppm_sauvola.cc: Convert to gray level.
* src/pbm_text_in_doc.cc: Use doc structure.
* src/text_in_picture_neg.cc: Make use of world::rgb::invert.
---
scribo/ChangeLog | 33 ++++++++++++
.../scribo/binarization/sauvola_threshold_image.hh | 4 +-
scribo/scribo/io/xml/save.hh | 1 +
scribo/scribo/primitive/extract/elements.hh | 12 ++++-
scribo/scribo/primitive/extract/lines_h_pattern.hh | 10 +++-
scribo/scribo/primitive/extract/lines_v_pattern.hh | 10 +++-
scribo/scribo/primitive/merge/components.hh | 5 ++
scribo/scribo/toolchain/text_in_doc_preprocess.hh | 2 +
scribo/scribo/toolchain/text_in_picture.hh | 55 ++++++++++++++++++--
scribo/src/Makefile.am | 2 -
scribo/src/binarization/ppm_sauvola.cc | 10 +++-
scribo/src/binarization/ppm_sauvola_ms.cc | 5 ++
scribo/src/binarization/ppm_sauvola_ms_fg.cc | 6 ++
scribo/src/binarization/ppm_sauvola_ms_split.cc | 8 ++-
scribo/src/binarization/sauvola_ms.cc | 5 ++
scribo/src/binarization/sauvola_ms_fg.cc | 6 ++
scribo/src/binarization/sauvola_ms_split.cc | 3 +-
.../src/contest/hdibco-2010/sauvola_ms_hdibco.cc | 2 +
scribo/src/pbm_text_in_doc.cc | 10 +++-
scribo/src/text_in_picture.cc | 15 -----
scribo/src/text_in_picture_neg.cc | 5 ++-
21 files changed, 172 insertions(+), 37 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 3db5ad3..8f5a26a 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,38 @@
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Compilation fixes.
+
+ * scribo/binarization/sauvola_threshold_image.hh: Fix namespace
+ ambiguity.
+
+ * scribo/io/xml/save.hh
+ * scribo/primitive/extract/elements.hh
+ * scribo/primitive/merge/components.hh
+ * scribo/toolchain/text_in_doc_preprocess.hh
+ * scribo/toolchain/text_in_picture.hh
+ * src/binarization/ppm_sauvola_ms.cc
+ * src/binarization/ppm_sauvola_ms_fg.cc
+ * src/binarization/ppm_sauvola_ms_split.cc
+ * src/binarization/sauvola_ms.cc
+ * src/binarization/sauvola_ms_fg.cc
+ * src/binarization/sauvola_ms_split.cc
+ * src/contest/hdibco-2010/sauvola_ms_hdibco.cc
+ * src/text_in_picture.cc: Add missing includes.
+
+ * scribo/primitive/extract/lines_h_pattern.hh,
+ * scribo/primitive/extract/lines_v_pattern.hh: Make sure the
+ rectangle have odd dimensions.
+
+ * src/Makefile.am: Remove deprecated include path.
+
+ * src/binarization/ppm_sauvola.cc: Convert to gray level.
+
+ * src/pbm_text_in_doc.cc: Use doc structure.
+
+ * src/text_in_picture_neg.cc: Make use of world::rgb::invert.
+
+2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* scribo/core/document.hh: Add new methods.
2010-11-16 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/scribo/binarization/sauvola_threshold_image.hh b/scribo/scribo/binarization/sauvola_threshold_image.hh
index 05a7064..94cd688 100644
--- a/scribo/scribo/binarization/sauvola_threshold_image.hh
+++ b/scribo/scribo/binarization/sauvola_threshold_image.hh
@@ -144,8 +144,8 @@ namespace scribo
ncols = static_cast<mln::def::coord>(input.ncols());
- for(def::coord row = 0; row < nrows; ++row)
- for(def::coord col = 0; col < ncols; ++col)
+ for(mln::def::coord row = 0; row < nrows; ++row)
+ for(mln::def::coord col = 0; col < ncols; ++col)
{
# ifdef SCRIBO_SAUVOLA_DEBUG
diff --git a/scribo/scribo/io/xml/save.hh b/scribo/scribo/io/xml/save.hh
index 928db17..3c182e7 100644
--- a/scribo/scribo/io/xml/save.hh
+++ b/scribo/scribo/io/xml/save.hh
@@ -35,6 +35,7 @@
# include <map>
+# include <scribo/core/document.hh>
# include <scribo/core/line_set.hh>
namespace scribo
diff --git a/scribo/scribo/primitive/extract/elements.hh b/scribo/scribo/primitive/extract/elements.hh
index c083988..2e6a0cb 100644
--- a/scribo/scribo/primitive/extract/elements.hh
+++ b/scribo/scribo/primitive/extract/elements.hh
@@ -33,6 +33,7 @@
# define SCRIBO_PRIMITIVE_EXTRACT_ELEMENTS_HH
# include <mln/core/image/image2d.hh>
+# include <mln/core/alias/neighb2d.hh>
# include <mln/data/fill.hh>
# include <mln/util/array.hh>
# include <mln/labeling/compute.hh>
@@ -40,16 +41,21 @@
# include <mln/accu/math/count.hh>
# include <mln/pw/all.hh>
+# include <mln/draw/box_plain.hh>
+
# include <mln/value/label_8.hh>
+# include <mln/value/rgb.hh>
# include <mln/value/rgb8.hh>
# include <scribo/core/macros.hh>
# include <scribo/core/component_set.hh>
+# include <scribo/core/document.hh>
# include <scribo/core/line_set.hh>
+# include <scribo/core/def/lbl_type.hh>
# include <scribo/filter/objects_small.hh>
-#include <mln/clustering/kmean_rgb.hh>
-#include <mln/fun/v2v/rgb8_to_rgbn.hh>
+# include <mln/clustering/kmean_rgb.hh>
+# include <mln/fun/v2v/rgb8_to_rgbn.hh>
namespace scribo
{
@@ -60,6 +66,8 @@ namespace scribo
namespace extract
{
+ using namespace mln;
+
template <typename L, typename I>
component_set<L>
diff --git a/scribo/scribo/primitive/extract/lines_h_pattern.hh b/scribo/scribo/primitive/extract/lines_h_pattern.hh
index 0da7900..6a1f7f0 100644
--- a/scribo/scribo/primitive/extract/lines_h_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_h_pattern.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.
//
@@ -30,6 +31,8 @@
///
/// Extract horizontal lines matching a specific pattern.
+# include <cmath>
+
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
# include <mln/win/rectangle2d.hh>
@@ -103,9 +106,12 @@ namespace scribo
mln_concrete(I) output = lines_pattern(input, length, 1, win);
+ unsigned new_length = length / 2 + delta;
+ new_length += 1 - (new_length % 2); // Guaranty that new_length is odd.
+
mln_concrete(I)
output_dil = morpho::dilation(output,
- win::rectangle2d(3, length / 2 + delta));
+ win::rectangle2d(3, new_length));
output = scribo::primitive::internal::rd(output, input * output_dil);
diff --git a/scribo/scribo/primitive/extract/lines_v_pattern.hh b/scribo/scribo/primitive/extract/lines_v_pattern.hh
index cbdf080..8a103ac 100644
--- a/scribo/scribo/primitive/extract/lines_v_pattern.hh
+++ b/scribo/scribo/primitive/extract/lines_v_pattern.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.
//
@@ -30,6 +31,8 @@
///
/// Extract vertical lines matching a specific pattern.
+# include <cmath>
+
# include <mln/core/concept/image.hh>
# include <mln/core/alias/window2d.hh>
# include <mln/win/rectangle2d.hh>
@@ -85,9 +88,12 @@ namespace scribo
mln_concrete(I) output = lines_pattern(input, length, 0, win);
+ unsigned new_length = length / 2 + delta;
+ new_length += 1 - (new_length % 2); // Guaranty that new_length is odd.
+
mln_concrete(I)
output_dil = morpho::dilation(output,
- win::rectangle2d(length / 2 + delta, 3));
+ win::rectangle2d(new_length, 3));
output = scribo::primitive::internal::rd(output, input * output_dil);
diff --git a/scribo/scribo/primitive/merge/components.hh b/scribo/scribo/primitive/merge/components.hh
index 7570d2e..72f3e9d 100644
--- a/scribo/scribo/primitive/merge/components.hh
+++ b/scribo/scribo/primitive/merge/components.hh
@@ -30,7 +30,12 @@
#ifndef SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
# define SCRIBO_PRIMITIVE_MERGE_COMPONENTS_HH
+# include <mln/core/concept/function.hh>
# include <mln/core/image/vmorph/fun_image.hh>
+# include <mln/data/fill.hh>
+# include <mln/pw/all.hh>
+
+# include <scribo/core/component_set.hh>
namespace scribo
diff --git a/scribo/scribo/toolchain/text_in_doc_preprocess.hh b/scribo/scribo/toolchain/text_in_doc_preprocess.hh
index 4b7d1e2..00a626e 100644
--- a/scribo/scribo/toolchain/text_in_doc_preprocess.hh
+++ b/scribo/scribo/toolchain/text_in_doc_preprocess.hh
@@ -32,6 +32,8 @@
#include <mln/core/concept/image.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
diff --git a/scribo/scribo/toolchain/text_in_picture.hh b/scribo/scribo/toolchain/text_in_picture.hh
index 7b34114..9746645 100644
--- a/scribo/scribo/toolchain/text_in_picture.hh
+++ b/scribo/scribo/toolchain/text_in_picture.hh
@@ -33,11 +33,58 @@
/// Localize text in a picture.
+# include <libgen.h>
+# include <iostream>
+# include <mln/core/image/image2d.hh>
+# include <mln/core/alias/neighb2d.hh>
-#include <src/afp/components.hh>
-#include <src/afp/link.hh>
-#include <src/afp/regroup.hh>
+# include <mln/literal/colors.hh>
+# include <mln/value/rgb8.hh>
+# include <mln/value/label_16.hh>
+
+# include <mln/fun/v2v/rgb_to_int_u.hh>
+
+# include <mln/subsampling/antialiased.hh>
+
+# include <scribo/draw/bounding_boxes.hh>
+# include <scribo/draw/groups_bboxes.hh>
+
+# include <scribo/binarization/sauvola_ms.hh>
+# include <scribo/binarization/sauvola.hh>
+
+# include <scribo/primitive/extract/components.hh>
+
+# include <scribo/primitive/link/merge_double_link.hh>
+# include <scribo/primitive/link/with_single_left_link.hh>
+# include <scribo/primitive/link/with_single_right_link.hh>
+
+# include <scribo/primitive/group/apply.hh>
+# include <scribo/primitive/group/from_double_link.hh>
+# include <scribo/primitive/group/from_single_link.hh>
+
+# include <scribo/primitive/regroup/from_single_left_link.hh>
+
+# include <scribo/filter/object_groups_with_holes.hh>
+
+# include <scribo/filter/object_links_bbox_h_ratio.hh>
+# include <scribo/filter/object_links_bbox_overlap.hh>
+
+# include <scribo/filter/object_groups_small.hh>
+# include <scribo/filter/object_groups_v_thickness.hh>
+
+# include <scribo/debug/decision_image.hh>
+# include <scribo/debug/save_linked_bboxes_image.hh>
+
+# include <scribo/debug/usage.hh>
+
+# include <scribo/preprocessing/split_bg_fg.hh>
+
+# include <scribo/make/debug_filename.hh>
+
+# include <src/afp/components.hh>
+# include <src/afp/link.hh>
+# include <src/afp/regroup.hh>
# include <mln/util/timer.hh>
@@ -126,7 +173,7 @@ namespace scribo
trace::entering("scribo::toolchain::text_in_picture");
const I& input_rgb_orig = exact(input_rgb_orig_);
- mln_precondition(input.is_valid());
+ mln_precondition(input_rgb_orig.is_valid());
using namespace scribo;
using namespace scribo::primitive;
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index 9efa0da..6cf233c 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -99,8 +99,6 @@ if HAVE_TESSERACT
utilexec_PROGRAMS += content_in_doc
content_in_doc_SOURCES = content_in_doc.cc
content_in_doc_CPPFLAGS = $(AM_CPPFLAGS) \
- -I/home/lazzara/git/oln/scribo/sandbox/green/ \
- -I/home/lazzara/git/oln/scribo/sandbox/z/ \
$(TESSERACT_CPPFLAGS) \
$(TIFF_CPPFLAGS) \
$(MAGICKXX_CPPFLAGS)
diff --git a/scribo/src/binarization/ppm_sauvola.cc b/scribo/src/binarization/ppm_sauvola.cc
index 330af70..f0cd355 100644
--- a/scribo/src/binarization/ppm_sauvola.cc
+++ b/scribo/src/binarization/ppm_sauvola.cc
@@ -26,6 +26,8 @@
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola.hh>
#include <scribo/debug/usage.hh>
@@ -66,10 +68,16 @@ int main(int argc, char *argv[])
std::cout << "Using w=" << w << " and k=" << k << std::endl;
+ // Load
image2d<value::rgb8> input;
io::ppm::load(input, argv[1]);
- image2d<bool> out = scribo::binarization::sauvola(input, w, k);
+ // Convert to Gray level image.
+ image2d<value::int_u8>
+ input_gl = data::transform(input, mln::fun::v2v::rgb_to_int_u<8>());
+
+ // Binarize
+ image2d<bool> out = scribo::binarization::sauvola(input_gl, w, k);
io::pbm::save(out, argv[2]);
diff --git a/scribo/src/binarization/ppm_sauvola_ms.cc b/scribo/src/binarization/ppm_sauvola_ms.cc
index 9e68b0e..eb694c2 100644
--- a/scribo/src/binarization/ppm_sauvola_ms.cc
+++ b/scribo/src/binarization/ppm_sauvola_ms.cc
@@ -28,6 +28,8 @@
#include <mln/value/int_u8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/debug/usage.hh>
@@ -99,6 +101,9 @@ int main(int argc, char *argv[])
else
k = 0.34f;
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
+
// Load
image2d<value::rgb8> input_1;
io::ppm::load(input_1, argv[1]);
diff --git a/scribo/src/binarization/ppm_sauvola_ms_fg.cc b/scribo/src/binarization/ppm_sauvola_ms_fg.cc
index 33a11ac..20f237f 100644
--- a/scribo/src/binarization/ppm_sauvola_ms_fg.cc
+++ b/scribo/src/binarization/ppm_sauvola_ms_fg.cc
@@ -24,10 +24,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/preprocessing/split_bg_fg.hh>
@@ -103,6 +107,8 @@ int main(int argc, char *argv[])
else
k = 0.34f;
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
// Load
image2d<value::rgb8> input_1;
diff --git a/scribo/src/binarization/ppm_sauvola_ms_split.cc b/scribo/src/binarization/ppm_sauvola_ms_split.cc
index 84e4abf..bb98b38 100644
--- a/scribo/src/binarization/ppm_sauvola_ms_split.cc
+++ b/scribo/src/binarization/ppm_sauvola_ms_split.cc
@@ -28,6 +28,8 @@
#include <mln/value/rgb8.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms_split.hh>
#include <scribo/debug/usage.hh>
@@ -113,11 +115,13 @@ int main(int argc, char *argv[])
image2d<value::rgb8> input_1;
io::ppm::load(input_1, argv[1]);
- std::cout << "Using w=" << w_1 << " - s=" << s << " - min_ntrue=" << min_ntrue << " - k=" << k << std::endl;
+ std::cout << "Using w=" << w_1 << " - s=" << s
+ << " - min_ntrue=" << min_ntrue << " - k=" << k << std::endl;
// Binarize
image2d<bool>
- output = scribo::binarization::sauvola_ms_split(input_1, w_1, s, min_ntrue, k);
+ output = scribo::binarization::sauvola_ms_split(input_1, w_1, s,
+ min_ntrue, k);
io::pbm::save(output, argv[2]);
}
diff --git a/scribo/src/binarization/sauvola_ms.cc b/scribo/src/binarization/sauvola_ms.cc
index 5f07484..7c3bcf0 100644
--- a/scribo/src/binarization/sauvola_ms.cc
+++ b/scribo/src/binarization/sauvola_ms.cc
@@ -24,6 +24,8 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/value/int_u8.hh>
#include <mln/io/magick/load.hh>
@@ -102,6 +104,9 @@ int main(int argc, char *argv[])
else
k = 0.34f;
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
+
// Load
image2d<value::rgb8> input_1;
io::magick::load(input_1, argv[1]);
diff --git a/scribo/src/binarization/sauvola_ms_fg.cc b/scribo/src/binarization/sauvola_ms_fg.cc
index cad605f..4227db4 100644
--- a/scribo/src/binarization/sauvola_ms_fg.cc
+++ b/scribo/src/binarization/sauvola_ms_fg.cc
@@ -24,10 +24,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
+/// \file
+
#include <mln/core/image/image2d.hh>
#include <mln/value/rgb8.hh>
#include <mln/io/magick/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/preprocessing/split_bg_fg.hh>
@@ -86,6 +90,8 @@ int main(int argc, char *argv[])
unsigned s = atoi(argv[4]);
+ std::cout << "Using w_1=" << w_1 << " - s=" << s << std::endl;
+
// Load
image2d<value::rgb8> input_1;
io::magick::load(input_1, argv[1]);
diff --git a/scribo/src/binarization/sauvola_ms_split.cc b/scribo/src/binarization/sauvola_ms_split.cc
index fc9e15c..691bfc9 100644
--- a/scribo/src/binarization/sauvola_ms_split.cc
+++ b/scribo/src/binarization/sauvola_ms_split.cc
@@ -107,7 +107,8 @@ int main(int argc, char *argv[])
else
k = 0.34f;
-
+ std::cout << "Using w_1=" << w_1 << " - s=" << s
+ << " - k=" << k << std::endl;
image2d<value::rgb8> input_1;
io::magick::load(input_1, argv[1]);
diff --git a/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc b/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc
index 68fdaac..7ef2455 100644
--- a/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc
+++ b/scribo/src/contest/hdibco-2010/sauvola_ms_hdibco.cc
@@ -29,6 +29,8 @@
#include <mln/io/pgm/load.hh>
#include <mln/io/ppm/load.hh>
#include <mln/io/pbm/save.hh>
+#include <mln/data/transform.hh>
+#include <mln/fun/v2v/rgb_to_int_u.hh>
#include <scribo/binarization/sauvola_ms.hh>
#include <scribo/postprocessing/fill_object_holes.hh>
diff --git a/scribo/src/pbm_text_in_doc.cc b/scribo/src/pbm_text_in_doc.cc
index 23ed9e7..96cb92b 100644
--- a/scribo/src/pbm_text_in_doc.cc
+++ b/scribo/src/pbm_text_in_doc.cc
@@ -40,6 +40,7 @@
#include <scribo/toolchain/text_in_doc.hh>
+#include <scribo/core/document.hh>
#include <scribo/core/line_set.hh>
#include <scribo/debug/usage.hh>
@@ -91,11 +92,11 @@ int main(int argc, char* argv[])
trace::entering("main");
+ typedef image2d<scribo::def::lbl_type> L;
image2d<bool> input;
mln::io::pbm::load(input, argv[1]);
-
// Optional Cropping
point2d crop_shift = literal::origin;
if (argc >= 8)
@@ -119,12 +120,15 @@ int main(int argc, char* argv[])
// Run document toolchain.
- typedef image2d<scribo::def::lbl_type> L;
line_set<L>
lines = scribo::toolchain::text_in_doc(input, denoise, debug);
+ scribo::document<L> doc;
+ doc.set_filename(argv[1]);
+ doc.set_text(lines);
+
// Saving results
- scribo::io::xml::save(argv[1], lines, "out.xml", true);
+ scribo::io::xml::save(doc, "out.xml", true);
// Specify shift due to potential previous crop.
scribo::io::text_boxes::save(lines, argv[2], crop_shift);
diff --git a/scribo/src/text_in_picture.cc b/scribo/src/text_in_picture.cc
index cdd2749..042b8d3 100644
--- a/scribo/src/text_in_picture.cc
+++ b/scribo/src/text_in_picture.cc
@@ -28,33 +28,20 @@
#include <iostream>
#include <mln/core/image/image2d.hh>
-#include <mln/core/image/imorph/tr_image.hh>
#include <mln/core/alias/neighb2d.hh>
#include <mln/labeling/colorize.hh>
-#include <mln/data/stretch.hh>
-
#include <mln/io/pbm/all.hh>
#include <mln/io/ppm/save.hh>
#include <mln/io/magick/all.hh>
-#include <mln/math/min.hh>
-
-#include <mln/logical/not.hh>
-
#include <mln/literal/colors.hh>
#include <mln/value/rgb8.hh>
#include <mln/value/label_16.hh>
#include <mln/fun/v2v/rgb_to_int_u.hh>
-#include <mln/data/wrap.hh>
-
-#include <mln/draw/box.hh>
-
-#include <mln/geom/translate.hh>
-
#include <mln/subsampling/antialiased.hh>
#include <scribo/draw/bounding_boxes.hh>
@@ -81,8 +68,6 @@
#include <scribo/filter/object_links_bbox_h_ratio.hh>
#include <scribo/filter/object_links_bbox_overlap.hh>
-#include <scribo/filter/common/objects_photo.hh>
-
#include <scribo/filter/object_groups_small.hh>
#include <scribo/filter/object_groups_v_thickness.hh>
diff --git a/scribo/src/text_in_picture_neg.cc b/scribo/src/text_in_picture_neg.cc
index 2da27a5..7d6694a 100644
--- a/scribo/src/text_in_picture_neg.cc
+++ b/scribo/src/text_in_picture_neg.cc
@@ -58,6 +58,8 @@
#include <mln/subsampling/antialiased.hh>
+#include <mln/world/rgb/invert.hh>
+
#include <scribo/draw/bounding_boxes.hh>
#include <scribo/draw/groups_bboxes.hh>
@@ -169,7 +171,8 @@ int main(int argc, char* argv[])
typedef image2d<value::label_16> L;
component_set<L>
- comps_neg = toolchain::text_in_picture(arith::revert(input_rgb), bg_removal,
+ comps_neg = toolchain::text_in_picture(world::rgb::invert(input_rgb),
+ bg_removal,
multi_scale_bin,
max_dim_size, lambda, out_base_dir);
--
1.5.6.5
1
0