Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
August 2010
- 6 participants
- 204 discussions
last-svn-commit-445-g0545aad Setup conditional unit-tests in Scribo.
by Guillaume Lazzara 10 Aug '10
by Guillaume Lazzara 10 Aug '10
10 Aug '10
* tests/tests.mk: Add specific flags for external dependencies.
* tests/unit_test/Makefile.am
(EXTRA_DIST): Add const_tests_* files.
(regen-am): Use build-aux/build_unit_test.sh.
(scribo_*FLAGS): Remove specific flags for conditional unit-tests.
* tests/unit_test/build_unit_test.sh: Remove. Useless since
build-aux/build_unit_test.sh is used instead.
* tests/unit_test/cond_tests_qt,
* tests/unit_test/cond_tests_qt_tesseract_tiff,
* tests/unit_test/cond_tests_tesseract_tiff: New.
* tests/unit_test/unit-tests.mk: Regen.
---
scribo/ChangeLog | 20 ++
scribo/tests/tests.mk | 14 +
scribo/tests/unit_test/Makefile.am | 51 +---
scribo/tests/unit_test/build_unit_test.sh | 85 ------
scribo/tests/unit_test/cond_tests_qt | 1 +
.../tests/unit_test/cond_tests_qt_tesseract_tiff | 1 +
scribo/tests/unit_test/cond_tests_tesseract_tiff | 1 +
scribo/tests/unit_test/unit-tests.mk | 310 ++++----------------
8 files changed, 107 insertions(+), 376 deletions(-)
delete mode 100755 scribo/tests/unit_test/build_unit_test.sh
create mode 100644 scribo/tests/unit_test/cond_tests_qt
create mode 100644 scribo/tests/unit_test/cond_tests_qt_tesseract_tiff
create mode 100644 scribo/tests/unit_test/cond_tests_tesseract_tiff
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 7f1f52d..ddd39df 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,23 @@
+2010-08-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Setup conditional unit-tests in Scribo.
+
+ * tests/tests.mk: Add specific flags for external dependencies.
+
+ * tests/unit_test/Makefile.am
+ (EXTRA_DIST): Add const_tests_* files.
+ (regen-am): Use build-aux/build_unit_test.sh.
+ (scribo_*FLAGS): Remove specific flags for conditional unit-tests.
+
+ * tests/unit_test/build_unit_test.sh: Remove. Useless since
+ build-aux/build_unit_test.sh is used instead.
+
+ * tests/unit_test/cond_tests_qt,
+ * tests/unit_test/cond_tests_qt_tesseract_tiff,
+ * tests/unit_test/cond_tests_tesseract_tiff: New.
+
+ * tests/unit_test/unit-tests.mk: Regen.
+
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
* tests/unit_test/disabled_tests: Update list of disabled tests.
diff --git a/scribo/tests/tests.mk b/scribo/tests/tests.mk
index d42c206..48a1009 100644
--- a/scribo/tests/tests.mk
+++ b/scribo/tests/tests.mk
@@ -18,3 +18,17 @@ AM_CPPFLAGS = -I$(top_srcdir)/ -I$(top_builddir)/ -I$(top_srcdir)/milena -I$(top
SCRIBO_TESTS_CXXFLAGS = @SCRIBO_TESTS_CXXFLAGS@
AM_CXXFLAGS = $(SCRIBO_TESTS_CXXFLAGS)
+
+# Flags for optional dependencies.
+
+MAGICKXX_CPPFLAGS = @MAGICKXX_CPPFLAGS@
+MAGICKXX_LDFLAGS = @MAGICKXX_LDFLAGS@
+
+TIFF_CPPFLAGS = @TIFF_CPPFLAGS@
+TIFF_LDFLAGS = @TIFF_LDFLAGS@
+
+QT_CPPFLAGS = @QT_CPPFLAGS@
+QT_LDFLAGS = @QT_LDFLAGS@ @QT_LIBS@
+
+TESSERACT_CPPFLAGS = @TESSERACT_CPPFLAGS@
+TESSERACT_LDFLAGS = @TESSERACT_LDFLAGS@
\ No newline at end of file
diff --git a/scribo/tests/unit_test/Makefile.am b/scribo/tests/unit_test/Makefile.am
index 255babf..86721e8 100644
--- a/scribo/tests/unit_test/Makefile.am
+++ b/scribo/tests/unit_test/Makefile.am
@@ -16,16 +16,23 @@
include $(top_srcdir)/scribo/tests/tests.mk
-EXTRA_DIST = build_unit_test.sh disabled_tests
+COND_TESTS = cond_tests_qt \
+ cond_tests_qt_tesseract_tiff \
+ cond_tests_tesseract_tiff
+
+EXTRA_DIST = disabled_tests \
+ $(COND_TESTS)
+
# Regen files.
include $(top_srcdir)/build-aux/regen-recursive.mk
regen-am:
cd $(top_srcdir) \
- && scribo/tests/unit_test/build_unit_test.sh \
+ && ./build-aux/build_unit_test.sh \
scribo \
scribo/tests/unit_test \
- scribo/tests/unit_test/disabled_tests
+ scribo/tests/unit_test/disabled_tests \
+ scribo
# FIXME: Change build_unit_test.sh so that the action looks like this:
#
@@ -33,47 +40,17 @@ regen-am:
#
# `$(abs_top_srcdir)' is required because of the change of directory
# at the beginning og the action.
-$(srcdir)/unit-tests.mk: build_unit_test.sh disabled_tests
+$(srcdir)/unit-tests.mk: build_unit_test.sh disabled_tests $(COND_TESTS)
cd $(top_srcdir) \
- && scribo/tests/unit_test/build_unit_test.sh \
+ && ./build-aux/build_unit_test.sh \
scribo \
scribo/tests/unit_test \
- scribo/tests/unit_test/disabled_tests
+ scribo/tests/unit_test/disabled_tests \
+ scribo
include $(srcdir)/unit-tests.mk
-#FIXME: how to handle that automaticaly during the unit test list
-#generation?
-scribo_convert_from_qimage_CPPFLAGS=\
- $(QT_CPPFLAGS) $(AM_CPPFLAGS) -I$(srcdir)
-scribo_convert_from_qimage_CXXFLAGS=\
- $(QT_CXXFLAGS) $(AM_CXXFLAGS)
-scribo_convert_from_qimage_LDFLAGS=\
- $(QT_LDFLAGS) $(LDFLAGS)
-scribo_convert_from_qimage_LDADD=\
- $(QT_LIBS) $(LDADD)
-
-scribo_toolchain_nepomuk_text_extraction_CPPFLAGS=\
- $(QT_CPPFLAGS) $(TESSERACT_CPPFLAGS) $(TIFF_CPPFLAGS) \
- $(AM_CPPFLAGS) -I$(srcdir)
-scribo_toolchain_nepomuk_text_extraction_CXXFLAGS=\
- $(QT_CXXFLAGS) $(AM_CXXFLAGS)
-scribo_toolchain_nepomuk_text_extraction_LDFLAGS=\
- $(QT_LDFLAGS) $(TESSERACT_LDFLAGS) $(TIFF_LDFLAGS) \
- $(LDFLAGS)
-scribo_toolchain_nepomuk_text_extraction_LDADD=\
- $(QT_LIBS) $(LDADD)
-
-scribo_text_recognition_CPPFLAGS=\
- $(TESSERACT_CPPFLAGS) $(TIFF_CPPFLAGS) \
- $(AM_CPPFLAGS) -I$(srcdir)
-scribo_text_recognition_LDFLAGS=\
- $(TESSERACT_LDFLAGS) $(TIFF_LDFLAGS) \
- $(LDFLAGS)
-
-
-
MAINTAINERCLEANFILES = $(srcdir)/scribo_*.cc
TESTS = $(check_PROGRAMS)
diff --git a/scribo/tests/unit_test/build_unit_test.sh b/scribo/tests/unit_test/build_unit_test.sh
deleted file mode 100755
index 415ff95..0000000
--- a/scribo/tests/unit_test/build_unit_test.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#! /bin/sh
-
-# Copyright (C) 2009, 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/>.
-
-## FIXME: Unify with build-aux/build_unit_test.sh.
-
-## FIXME: Don't use `echo -n', as echo's options are not portable.
-##
-## http://www.gnu.org/software/autoconf/manual/html_node/Limitations-of-Builtiā¦
-##
-## As an ugly workaround, use `printf' instead. The right approach
-## would be to only emit lines ended with newlines.
-ECHO_N=printf
-
-# Use the C locale to have a deterministic sort.
-export LC_ALL=C
-
-test $# -eq 3 || { echo "Usage: $0 <scanned dir> <output_dir> <disabled_tests>" && exit 1; }
-
-scanned_dir=$1
-output_dir=$2
-disabled_tests=$3
-
-HEADERS=$(find $scanned_dir -type f -name "*.hh" \
- | sort \
- | sed -e 's/.*\/scribo\/\(.*\)/scribo\/\1/g' | sed 's/\.\.\/\.\.\///g' \
- | comm -23 - "$disabled_tests")
-
-output="$output_dir/unit-tests.mk"
-
-rm -f "$output"
-rm -f scribo_*.cc
-
-# Build unit-tests.mk.
-echo "## Generated by $0, do not modify." >"$output"
-echo >>"$output"
-$ECHO_N "check_PROGRAMS = " >>"$output"
-
-for i in $HEADERS; do
- FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
-
- # Build .cc.
- cat > "$output_dir/$FILE_CC" << EOF
-// Unit test for $i.
-// Generated by $0, do not modify.
-
-// Include the file twice, so we detect missing inclusion guards.
-#include <$i>
-#include <$i>
-
-int main()
-{
- // Nothing.
-}
-EOF
-
- # Build unit-tests.mk.
- TARGET=`echo "${FILE_CC}" | sed 's/\.cc//'`
- echo " \\" >>"$output"
- $ECHO_N "${TARGET}" >>"$output"
-done
-
-# Build "$output".
-echo "" >>"$output"
-echo "" >>"$output"
-for i in $HEADERS; do
- FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
- NAME=`echo $FILE_CC | sed 's/\.cc//g'`
- echo "${NAME}_SOURCES = $FILE_CC" >>"$output"
-done
diff --git a/scribo/tests/unit_test/cond_tests_qt b/scribo/tests/unit_test/cond_tests_qt
new file mode 100644
index 0000000..5428215
--- /dev/null
+++ b/scribo/tests/unit_test/cond_tests_qt
@@ -0,0 +1 @@
+scribo/convert/from_qimage.hh
diff --git a/scribo/tests/unit_test/cond_tests_qt_tesseract_tiff b/scribo/tests/unit_test/cond_tests_qt_tesseract_tiff
new file mode 100644
index 0000000..7dfe76d
--- /dev/null
+++ b/scribo/tests/unit_test/cond_tests_qt_tesseract_tiff
@@ -0,0 +1 @@
+scribo/toolchain/nepomuk/text_extraction.hh
diff --git a/scribo/tests/unit_test/cond_tests_tesseract_tiff b/scribo/tests/unit_test/cond_tests_tesseract_tiff
new file mode 100644
index 0000000..bce37c9
--- /dev/null
+++ b/scribo/tests/unit_test/cond_tests_tesseract_tiff
@@ -0,0 +1 @@
+scribo/text/recognition.hh
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index a37db3b..82664fa 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -1,11 +1,50 @@
-## Generated by scribo/tests/unit_test/build_unit_test.sh, do not modify.
+## Generated by ./build-aux/build_unit_test.sh, do not modify.
-check_PROGRAMS = \
+check_PROGRAMS =
+
+# Starting a conditional unit test list.
+if HAVE_QT
+check_PROGRAMS += \
+scribo_convert_from_qimage
+
+scribo_convert_from_qimage_CPPFLAGS= ${QT_CPPFLAGS} ${AM_CPPFLAGS}
+scribo_convert_from_qimage_LDFLAGS= ${QT_LDFLAGS} ${AM_LDFLAGS}
+scribo_convert_from_qimage_SOURCES = scribo_convert_from_qimage.cc
+endif HAVE_QT
+
+# Starting a conditional unit test list.
+if HAVE_QT
+if HAVE_TESSERACT
+if HAVE_TIFF
+check_PROGRAMS += \
+scribo_toolchain_nepomuk_text_extraction
+
+scribo_toolchain_nepomuk_text_extraction_CPPFLAGS= ${TIFF_CPPFLAGS} ${TESSERACT_CPPFLAGS} ${QT_CPPFLAGS} ${AM_CPPFLAGS}
+scribo_toolchain_nepomuk_text_extraction_LDFLAGS= ${TIFF_LDFLAGS} ${TESSERACT_LDFLAGS} ${QT_LDFLAGS} ${AM_LDFLAGS}
+scribo_toolchain_nepomuk_text_extraction_SOURCES = scribo_toolchain_nepomuk_text_extraction.cc
+endif HAVE_TIFF
+endif HAVE_TESSERACT
+endif HAVE_QT
+
+# Starting a conditional unit test list.
+if HAVE_TESSERACT
+if HAVE_TIFF
+check_PROGRAMS += \
+scribo_text_recognition
+
+scribo_text_recognition_CPPFLAGS= ${TIFF_CPPFLAGS} ${TESSERACT_CPPFLAGS} ${AM_CPPFLAGS}
+scribo_text_recognition_LDFLAGS= ${TIFF_LDFLAGS} ${TESSERACT_LDFLAGS} ${AM_LDFLAGS}
+scribo_text_recognition_SOURCES = scribo_text_recognition.cc
+endif HAVE_TIFF
+endif HAVE_TESSERACT
+
+# Starting non-conditional unit test list.
+check_PROGRAMS += \
scribo_all \
+scribo_binarization_all \
scribo_binarization_global_threshold \
scribo_binarization_global_threshold_auto \
scribo_binarization_internal_first_pass_functor \
-scribo_binarization_internal_min_mean_max_stddev \
scribo_binarization_local_threshold \
scribo_binarization_sauvola \
scribo_binarization_sauvola_ms \
@@ -13,7 +52,6 @@ scribo_binarization_sauvola_ms_split \
scribo_binarization_sauvola_threshold_image \
scribo_binarization_sauvola_threshold_image_debug \
scribo_canvas_integral_browsing \
-scribo_convert_from_qimage \
scribo_core_all \
scribo_core_central_sites \
scribo_core_component_info \
@@ -23,12 +61,10 @@ scribo_core_concept_link_functor \
scribo_core_def_lbl_type \
scribo_core_erase_objects \
scribo_core_init_integral_image \
-scribo_core_internal_link_functor_base \
scribo_core_line_info \
scribo_core_line_set \
scribo_core_macros \
scribo_core_object_groups \
-scribo_core_object_image \
scribo_core_object_links \
scribo_core_tag_anchor \
scribo_core_tag_component \
@@ -36,72 +72,21 @@ scribo_core_tag_line \
scribo_debug_alignment_decision_image \
scribo_debug_all \
scribo_debug_bboxes_enlarged_image \
+scribo_debug_char_space_image \
scribo_debug_decision_image \
scribo_debug_highlight_text_area \
+scribo_debug_line_info_image \
scribo_debug_links_decision_image \
scribo_debug_looks_like_a_text_line_image \
scribo_debug_mean_and_base_lines_image \
scribo_debug_save_bboxes_image \
+scribo_debug_save_comp_diff \
scribo_debug_save_label_image \
scribo_debug_save_linked_bboxes_image \
-scribo_debug_save_object_diff \
scribo_debug_save_table_image \
scribo_debug_several_links_decision_image \
+scribo_debug_text_areas_image \
scribo_debug_usage \
-scribo_demo_demat_src_doc_type \
-scribo_demo_demat_src_main_window \
-scribo_demo_demat_src_preprocessing_task \
-scribo_demo_demat_src_process_args \
-scribo_demo_demat_src_runner \
-scribo_demo_review_src_mainwindow \
-scribo_demo_shared_src_bak_crop_item \
-scribo_demo_shared_src_bak_image_viewer \
-scribo_demo_shared_src_bak_types \
-scribo_demo_shared_src_browse_widget \
-scribo_demo_shared_src_crop_item \
-scribo_demo_shared_src_image_viewer \
-scribo_demo_shared_src_internal_bak_interactive_scene \
-scribo_demo_shared_src_internal_bak_selection_rectangle \
-scribo_demo_shared_src_internal_interactive_scene \
-scribo_demo_shared_src_internal_selection_rectangle \
-scribo_demo_shared_src_to_mln_image \
-scribo_demo_shared_src_types \
-scribo_demo_shared_ui_interactive_scene \
-scribo_demo_tip_src_custom_delegate \
-scribo_demo_tip_src_launch_dialog \
-scribo_demo_tip_src_main_window \
-scribo_demo_viewer_browser_widget \
-scribo_demo_viewer_common \
-scribo_demo_viewer_domitem \
-scribo_demo_viewer_dommodel \
-scribo_demo_viewer_help_dialog \
-scribo_demo_viewer_image_region \
-scribo_demo_viewer_image_scene \
-scribo_demo_viewer_image_view \
-scribo_demo_viewer_image_widget \
-scribo_demo_viewer_key_widget \
-scribo_demo_viewer_property_widget \
-scribo_demo_viewer_step_widget \
-scribo_demo_viewer_viewer \
-scribo_demo_viewer_xml_widget \
-scribo_demo_wizard_src_crop_page \
-scribo_demo_wizard_src_crop_widget \
-scribo_demo_wizard_src_doc_type \
-scribo_demo_wizard_src_doc_type_page \
-scribo_demo_wizard_src_doc_type_widget \
-scribo_demo_wizard_src_load_page \
-scribo_demo_wizard_src_load_widget \
-scribo_demo_wizard_src_main_window \
-scribo_demo_wizard_src_preprocessing_page \
-scribo_demo_wizard_src_preprocessing_task \
-scribo_demo_wizard_src_preprocessing_widget \
-scribo_demo_wizard_src_process_page \
-scribo_demo_wizard_src_process_widget \
-scribo_demo_wizard_src_result_page \
-scribo_demo_wizard_src_result_widget \
-scribo_demo_wizard_src_rotate_page \
-scribo_demo_wizard_src_rotate_widget \
-scribo_demo_wizard_src_runner \
scribo_draw_all \
scribo_draw_bounding_box_links \
scribo_draw_bounding_boxes \
@@ -144,7 +129,7 @@ scribo_io_xml_save \
scribo_make_all \
scribo_make_debug_filename \
scribo_make_influence_zone_graph \
-scribo_make_text \
+scribo_postprocessing_all \
scribo_postprocessing_fill_object_holes \
scribo_preprocessing_all \
scribo_preprocessing_crop \
@@ -181,22 +166,17 @@ 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_group_from_single_link_robust \
scribo_primitive_internal_all \
scribo_primitive_internal_find_graph_link \
scribo_primitive_internal_find_root \
-scribo_primitive_internal_find_root_robust \
scribo_primitive_internal_have_link_valid \
scribo_primitive_internal_is_link_valid \
scribo_primitive_internal_rd \
scribo_primitive_internal_update_graph_link \
-scribo_primitive_internal_update_link_array \
scribo_primitive_link_all \
scribo_primitive_link_compute \
-scribo_primitive_link_internal_anchors_3 \
scribo_primitive_link_internal_compute_anchor \
scribo_primitive_link_internal_dmax_default \
scribo_primitive_link_internal_dmax_functor_base \
@@ -204,8 +184,6 @@ scribo_primitive_link_internal_dmax_width_and_height \
scribo_primitive_link_internal_dmax_width_only \
scribo_primitive_link_internal_find_link \
scribo_primitive_link_internal_link_functor_base \
-scribo_primitive_link_internal_link_ms_dmax_base \
-scribo_primitive_link_internal_link_ms_dmax_ratio_base \
scribo_primitive_link_internal_link_several_dmax_base \
scribo_primitive_link_internal_link_single_dmax_base \
scribo_primitive_link_internal_link_single_dmax_ratio_base \
@@ -214,7 +192,6 @@ scribo_primitive_link_with_graph \
scribo_primitive_link_with_rag \
scribo_primitive_link_with_several_graphes \
scribo_primitive_link_with_several_left_links \
-scribo_primitive_link_with_several_right_closest_links \
scribo_primitive_link_with_several_right_links \
scribo_primitive_link_with_single_down_link \
scribo_primitive_link_with_single_left_link \
@@ -222,67 +199,11 @@ 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_regroup_from_single_left_link \
+scribo_primitive_regroup_from_single_left_link_wrt_h_ratio \
scribo_primitive_remove_separators \
-scribo_sandbox__julien_hough_hough_hough_pgm \
-scribo_sandbox__julien_hough_hough_hough_v1 \
-scribo_sandbox__julien_hough_hough_hough_v2 \
-scribo_sandbox__julien_hough_hough_hough_v3 \
-scribo_sandbox__julien_hough_hough_hough_v4 \
-scribo_sandbox__julien_hough_kht_buffer_2d \
-scribo_sandbox__julien_hough_kht_closing \
-scribo_sandbox__julien_hough_kht_eigen \
-scribo_sandbox__julien_hough_kht_filter \
-scribo_sandbox__julien_hough_kht_kht \
-scribo_sandbox__julien_hough_kht_linking \
-scribo_sandbox__julien_hough_kht_peak_detection \
-scribo_sandbox__julien_hough_kht_subdivision \
-scribo_sandbox__julien_hough_kht_types \
-scribo_sandbox__julien_hough_kht_voting \
-scribo_sandbox__julien_upsampling_eagle \
-scribo_sandbox__julien_upsampling_pyxies \
-scribo_sandbox_green_mln_accu_stat_histo1d \
-scribo_sandbox_green_mln_accu_stat_histo2d \
-scribo_sandbox_green_mln_accu_stat_histo3d_hsl \
-scribo_sandbox_green_mln_accu_stat_histo3d_rgb \
-scribo_sandbox_green_mln_clustering_k_mean \
-scribo_sandbox_green_mln_clustering_kmean1d \
-scribo_sandbox_green_mln_clustering_kmean2d \
-scribo_sandbox_green_mln_clustering_kmean3d \
-scribo_sandbox_green_mln_clustering_kmean_rgb \
-scribo_sandbox_green_mln_display_display_histo \
-scribo_sandbox_green_mln_display_project_histo \
-scribo_sandbox_green_mln_fun_p2b_achromatic \
-scribo_sandbox_green_mln_fun_p2b_component_equals \
-scribo_sandbox_green_mln_fun_v2v_achromatism \
-scribo_sandbox_green_mln_fun_v2v_hue_concentration \
-scribo_sandbox_green_mln_fun_v2v_int_u16_to_int_u14 \
-scribo_sandbox_green_mln_fun_v2v_log \
-scribo_sandbox_green_mln_fun_v2v_rg_to_rgb \
-scribo_sandbox_green_mln_fun_v2v_rgb8_to_int_u8 \
-scribo_sandbox_green_mln_fun_v2v_rgb8_to_rgbn \
-scribo_sandbox_green_mln_fun_v2v_rgb_to_achromatism_map \
-scribo_sandbox_green_mln_fun_v2v_rgb_to_hsv \
-scribo_sandbox_green_mln_fun_v2v_rgb_to_hue_map \
-scribo_sandbox_green_mln_fun_v2v_rgb_to_rg \
-scribo_sandbox_green_mln_fun_v2v_rgb_to_saturation_map \
-scribo_sandbox_green_mln_fun_v2v_rgb_to_value_map \
-scribo_sandbox_green_mln_img_path \
-scribo_sandbox_green_mln_io_plot_save_image_sh \
-scribo_sandbox_green_mln_math_ceil \
-scribo_sandbox_green_mln_math_floor \
-scribo_sandbox_green_mln_value_hsv \
-scribo_sandbox_green_mln_value_rg \
-scribo_sandbox_green_ok_mln_accu_histo_histo1d \
-scribo_sandbox_green_ok_mln_accu_histo_histo2d \
-scribo_sandbox_green_ok_mln_accu_histo_histo3d \
-scribo_sandbox_green_ok_mln_img_path \
-scribo_src_afp_components \
-scribo_src_afp_link \
-scribo_src_afp_regroup \
scribo_subsampling_bilinear \
scribo_subsampling_integral \
scribo_subsampling_integral_single_image \
@@ -306,16 +227,15 @@ scribo_text_clean_inplace \
scribo_text_extract_lines \
scribo_text_look_like_text_lines \
scribo_text_merging \
-scribo_toolchain_nepomuk_text_extraction \
scribo_toolchain_text_in_doc \
scribo_upsampling_bs2x \
scribo_upsampling_eagle
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_first_pass_functor_SOURCES = scribo_binarization_internal_first_pass_functor.cc
-scribo_binarization_internal_min_mean_max_stddev_SOURCES = scribo_binarization_internal_min_mean_max_stddev.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
@@ -323,7 +243,6 @@ scribo_binarization_sauvola_ms_split_SOURCES = scribo_binarization_sauvola_ms_sp
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_convert_from_qimage_SOURCES = scribo_convert_from_qimage.cc
scribo_core_all_SOURCES = scribo_core_all.cc
scribo_core_central_sites_SOURCES = scribo_core_central_sites.cc
scribo_core_component_info_SOURCES = scribo_core_component_info.cc
@@ -333,12 +252,10 @@ 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_erase_objects_SOURCES = scribo_core_erase_objects.cc
scribo_core_init_integral_image_SOURCES = scribo_core_init_integral_image.cc
-scribo_core_internal_link_functor_base_SOURCES = scribo_core_internal_link_functor_base.cc
scribo_core_line_info_SOURCES = scribo_core_line_info.cc
scribo_core_line_set_SOURCES = scribo_core_line_set.cc
scribo_core_macros_SOURCES = scribo_core_macros.cc
scribo_core_object_groups_SOURCES = scribo_core_object_groups.cc
-scribo_core_object_image_SOURCES = scribo_core_object_image.cc
scribo_core_object_links_SOURCES = scribo_core_object_links.cc
scribo_core_tag_anchor_SOURCES = scribo_core_tag_anchor.cc
scribo_core_tag_component_SOURCES = scribo_core_tag_component.cc
@@ -346,72 +263,21 @@ scribo_core_tag_line_SOURCES = scribo_core_tag_line.cc
scribo_debug_alignment_decision_image_SOURCES = scribo_debug_alignment_decision_image.cc
scribo_debug_all_SOURCES = scribo_debug_all.cc
scribo_debug_bboxes_enlarged_image_SOURCES = scribo_debug_bboxes_enlarged_image.cc
+scribo_debug_char_space_image_SOURCES = scribo_debug_char_space_image.cc
scribo_debug_decision_image_SOURCES = scribo_debug_decision_image.cc
scribo_debug_highlight_text_area_SOURCES = scribo_debug_highlight_text_area.cc
+scribo_debug_line_info_image_SOURCES = scribo_debug_line_info_image.cc
scribo_debug_links_decision_image_SOURCES = scribo_debug_links_decision_image.cc
scribo_debug_looks_like_a_text_line_image_SOURCES = scribo_debug_looks_like_a_text_line_image.cc
scribo_debug_mean_and_base_lines_image_SOURCES = scribo_debug_mean_and_base_lines_image.cc
scribo_debug_save_bboxes_image_SOURCES = scribo_debug_save_bboxes_image.cc
+scribo_debug_save_comp_diff_SOURCES = scribo_debug_save_comp_diff.cc
scribo_debug_save_label_image_SOURCES = scribo_debug_save_label_image.cc
scribo_debug_save_linked_bboxes_image_SOURCES = scribo_debug_save_linked_bboxes_image.cc
-scribo_debug_save_object_diff_SOURCES = scribo_debug_save_object_diff.cc
scribo_debug_save_table_image_SOURCES = scribo_debug_save_table_image.cc
scribo_debug_several_links_decision_image_SOURCES = scribo_debug_several_links_decision_image.cc
+scribo_debug_text_areas_image_SOURCES = scribo_debug_text_areas_image.cc
scribo_debug_usage_SOURCES = scribo_debug_usage.cc
-scribo_demo_demat_src_doc_type_SOURCES = scribo_demo_demat_src_doc_type.cc
-scribo_demo_demat_src_main_window_SOURCES = scribo_demo_demat_src_main_window.cc
-scribo_demo_demat_src_preprocessing_task_SOURCES = scribo_demo_demat_src_preprocessing_task.cc
-scribo_demo_demat_src_process_args_SOURCES = scribo_demo_demat_src_process_args.cc
-scribo_demo_demat_src_runner_SOURCES = scribo_demo_demat_src_runner.cc
-scribo_demo_review_src_mainwindow_SOURCES = scribo_demo_review_src_mainwindow.cc
-scribo_demo_shared_src_bak_crop_item_SOURCES = scribo_demo_shared_src_bak_crop_item.cc
-scribo_demo_shared_src_bak_image_viewer_SOURCES = scribo_demo_shared_src_bak_image_viewer.cc
-scribo_demo_shared_src_bak_types_SOURCES = scribo_demo_shared_src_bak_types.cc
-scribo_demo_shared_src_browse_widget_SOURCES = scribo_demo_shared_src_browse_widget.cc
-scribo_demo_shared_src_crop_item_SOURCES = scribo_demo_shared_src_crop_item.cc
-scribo_demo_shared_src_image_viewer_SOURCES = scribo_demo_shared_src_image_viewer.cc
-scribo_demo_shared_src_internal_bak_interactive_scene_SOURCES = scribo_demo_shared_src_internal_bak_interactive_scene.cc
-scribo_demo_shared_src_internal_bak_selection_rectangle_SOURCES = scribo_demo_shared_src_internal_bak_selection_rectangle.cc
-scribo_demo_shared_src_internal_interactive_scene_SOURCES = scribo_demo_shared_src_internal_interactive_scene.cc
-scribo_demo_shared_src_internal_selection_rectangle_SOURCES = scribo_demo_shared_src_internal_selection_rectangle.cc
-scribo_demo_shared_src_to_mln_image_SOURCES = scribo_demo_shared_src_to_mln_image.cc
-scribo_demo_shared_src_types_SOURCES = scribo_demo_shared_src_types.cc
-scribo_demo_shared_ui_interactive_scene_SOURCES = scribo_demo_shared_ui_interactive_scene.cc
-scribo_demo_tip_src_custom_delegate_SOURCES = scribo_demo_tip_src_custom_delegate.cc
-scribo_demo_tip_src_launch_dialog_SOURCES = scribo_demo_tip_src_launch_dialog.cc
-scribo_demo_tip_src_main_window_SOURCES = scribo_demo_tip_src_main_window.cc
-scribo_demo_viewer_browser_widget_SOURCES = scribo_demo_viewer_browser_widget.cc
-scribo_demo_viewer_common_SOURCES = scribo_demo_viewer_common.cc
-scribo_demo_viewer_domitem_SOURCES = scribo_demo_viewer_domitem.cc
-scribo_demo_viewer_dommodel_SOURCES = scribo_demo_viewer_dommodel.cc
-scribo_demo_viewer_help_dialog_SOURCES = scribo_demo_viewer_help_dialog.cc
-scribo_demo_viewer_image_region_SOURCES = scribo_demo_viewer_image_region.cc
-scribo_demo_viewer_image_scene_SOURCES = scribo_demo_viewer_image_scene.cc
-scribo_demo_viewer_image_view_SOURCES = scribo_demo_viewer_image_view.cc
-scribo_demo_viewer_image_widget_SOURCES = scribo_demo_viewer_image_widget.cc
-scribo_demo_viewer_key_widget_SOURCES = scribo_demo_viewer_key_widget.cc
-scribo_demo_viewer_property_widget_SOURCES = scribo_demo_viewer_property_widget.cc
-scribo_demo_viewer_step_widget_SOURCES = scribo_demo_viewer_step_widget.cc
-scribo_demo_viewer_viewer_SOURCES = scribo_demo_viewer_viewer.cc
-scribo_demo_viewer_xml_widget_SOURCES = scribo_demo_viewer_xml_widget.cc
-scribo_demo_wizard_src_crop_page_SOURCES = scribo_demo_wizard_src_crop_page.cc
-scribo_demo_wizard_src_crop_widget_SOURCES = scribo_demo_wizard_src_crop_widget.cc
-scribo_demo_wizard_src_doc_type_SOURCES = scribo_demo_wizard_src_doc_type.cc
-scribo_demo_wizard_src_doc_type_page_SOURCES = scribo_demo_wizard_src_doc_type_page.cc
-scribo_demo_wizard_src_doc_type_widget_SOURCES = scribo_demo_wizard_src_doc_type_widget.cc
-scribo_demo_wizard_src_load_page_SOURCES = scribo_demo_wizard_src_load_page.cc
-scribo_demo_wizard_src_load_widget_SOURCES = scribo_demo_wizard_src_load_widget.cc
-scribo_demo_wizard_src_main_window_SOURCES = scribo_demo_wizard_src_main_window.cc
-scribo_demo_wizard_src_preprocessing_page_SOURCES = scribo_demo_wizard_src_preprocessing_page.cc
-scribo_demo_wizard_src_preprocessing_task_SOURCES = scribo_demo_wizard_src_preprocessing_task.cc
-scribo_demo_wizard_src_preprocessing_widget_SOURCES = scribo_demo_wizard_src_preprocessing_widget.cc
-scribo_demo_wizard_src_process_page_SOURCES = scribo_demo_wizard_src_process_page.cc
-scribo_demo_wizard_src_process_widget_SOURCES = scribo_demo_wizard_src_process_widget.cc
-scribo_demo_wizard_src_result_page_SOURCES = scribo_demo_wizard_src_result_page.cc
-scribo_demo_wizard_src_result_widget_SOURCES = scribo_demo_wizard_src_result_widget.cc
-scribo_demo_wizard_src_rotate_page_SOURCES = scribo_demo_wizard_src_rotate_page.cc
-scribo_demo_wizard_src_rotate_widget_SOURCES = scribo_demo_wizard_src_rotate_widget.cc
-scribo_demo_wizard_src_runner_SOURCES = scribo_demo_wizard_src_runner.cc
scribo_draw_all_SOURCES = scribo_draw_all.cc
scribo_draw_bounding_box_links_SOURCES = scribo_draw_bounding_box_links.cc
scribo_draw_bounding_boxes_SOURCES = scribo_draw_bounding_boxes.cc
@@ -454,7 +320,7 @@ scribo_io_xml_save_SOURCES = scribo_io_xml_save.cc
scribo_make_all_SOURCES = scribo_make_all.cc
scribo_make_debug_filename_SOURCES = scribo_make_debug_filename.cc
scribo_make_influence_zone_graph_SOURCES = scribo_make_influence_zone_graph.cc
-scribo_make_text_SOURCES = scribo_make_text.cc
+scribo_postprocessing_all_SOURCES = scribo_postprocessing_all.cc
scribo_postprocessing_fill_object_holes_SOURCES = scribo_postprocessing_fill_object_holes.cc
scribo_preprocessing_all_SOURCES = scribo_preprocessing_all.cc
scribo_preprocessing_crop_SOURCES = scribo_preprocessing_crop.cc
@@ -491,22 +357,17 @@ scribo_primitive_extract_vertical_separators_SOURCES = scribo_primitive_extract_
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_group_from_single_link_robust_SOURCES = scribo_primitive_group_from_single_link_robust.cc
scribo_primitive_internal_all_SOURCES = scribo_primitive_internal_all.cc
scribo_primitive_internal_find_graph_link_SOURCES = scribo_primitive_internal_find_graph_link.cc
scribo_primitive_internal_find_root_SOURCES = scribo_primitive_internal_find_root.cc
-scribo_primitive_internal_find_root_robust_SOURCES = scribo_primitive_internal_find_root_robust.cc
scribo_primitive_internal_have_link_valid_SOURCES = scribo_primitive_internal_have_link_valid.cc
scribo_primitive_internal_is_link_valid_SOURCES = scribo_primitive_internal_is_link_valid.cc
scribo_primitive_internal_rd_SOURCES = scribo_primitive_internal_rd.cc
scribo_primitive_internal_update_graph_link_SOURCES = scribo_primitive_internal_update_graph_link.cc
-scribo_primitive_internal_update_link_array_SOURCES = scribo_primitive_internal_update_link_array.cc
scribo_primitive_link_all_SOURCES = scribo_primitive_link_all.cc
scribo_primitive_link_compute_SOURCES = scribo_primitive_link_compute.cc
-scribo_primitive_link_internal_anchors_3_SOURCES = scribo_primitive_link_internal_anchors_3.cc
scribo_primitive_link_internal_compute_anchor_SOURCES = scribo_primitive_link_internal_compute_anchor.cc
scribo_primitive_link_internal_dmax_default_SOURCES = scribo_primitive_link_internal_dmax_default.cc
scribo_primitive_link_internal_dmax_functor_base_SOURCES = scribo_primitive_link_internal_dmax_functor_base.cc
@@ -514,8 +375,6 @@ scribo_primitive_link_internal_dmax_width_and_height_SOURCES = scribo_primitive_
scribo_primitive_link_internal_dmax_width_only_SOURCES = scribo_primitive_link_internal_dmax_width_only.cc
scribo_primitive_link_internal_find_link_SOURCES = scribo_primitive_link_internal_find_link.cc
scribo_primitive_link_internal_link_functor_base_SOURCES = scribo_primitive_link_internal_link_functor_base.cc
-scribo_primitive_link_internal_link_ms_dmax_base_SOURCES = scribo_primitive_link_internal_link_ms_dmax_base.cc
-scribo_primitive_link_internal_link_ms_dmax_ratio_base_SOURCES = scribo_primitive_link_internal_link_ms_dmax_ratio_base.cc
scribo_primitive_link_internal_link_several_dmax_base_SOURCES = scribo_primitive_link_internal_link_several_dmax_base.cc
scribo_primitive_link_internal_link_single_dmax_base_SOURCES = scribo_primitive_link_internal_link_single_dmax_base.cc
scribo_primitive_link_internal_link_single_dmax_ratio_base_SOURCES = scribo_primitive_link_internal_link_single_dmax_ratio_base.cc
@@ -524,7 +383,6 @@ scribo_primitive_link_with_graph_SOURCES = scribo_primitive_link_with_graph.cc
scribo_primitive_link_with_rag_SOURCES = scribo_primitive_link_with_rag.cc
scribo_primitive_link_with_several_graphes_SOURCES = scribo_primitive_link_with_several_graphes.cc
scribo_primitive_link_with_several_left_links_SOURCES = scribo_primitive_link_with_several_left_links.cc
-scribo_primitive_link_with_several_right_closest_links_SOURCES = scribo_primitive_link_with_several_right_closest_links.cc
scribo_primitive_link_with_several_right_links_SOURCES = scribo_primitive_link_with_several_right_links.cc
scribo_primitive_link_with_single_down_link_SOURCES = scribo_primitive_link_with_single_down_link.cc
scribo_primitive_link_with_single_left_link_SOURCES = scribo_primitive_link_with_single_left_link.cc
@@ -532,67 +390,11 @@ 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_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
-scribo_sandbox__julien_hough_hough_hough_pgm_SOURCES = scribo_sandbox__julien_hough_hough_hough_pgm.cc
-scribo_sandbox__julien_hough_hough_hough_v1_SOURCES = scribo_sandbox__julien_hough_hough_hough_v1.cc
-scribo_sandbox__julien_hough_hough_hough_v2_SOURCES = scribo_sandbox__julien_hough_hough_hough_v2.cc
-scribo_sandbox__julien_hough_hough_hough_v3_SOURCES = scribo_sandbox__julien_hough_hough_hough_v3.cc
-scribo_sandbox__julien_hough_hough_hough_v4_SOURCES = scribo_sandbox__julien_hough_hough_hough_v4.cc
-scribo_sandbox__julien_hough_kht_buffer_2d_SOURCES = scribo_sandbox__julien_hough_kht_buffer_2d.cc
-scribo_sandbox__julien_hough_kht_closing_SOURCES = scribo_sandbox__julien_hough_kht_closing.cc
-scribo_sandbox__julien_hough_kht_eigen_SOURCES = scribo_sandbox__julien_hough_kht_eigen.cc
-scribo_sandbox__julien_hough_kht_filter_SOURCES = scribo_sandbox__julien_hough_kht_filter.cc
-scribo_sandbox__julien_hough_kht_kht_SOURCES = scribo_sandbox__julien_hough_kht_kht.cc
-scribo_sandbox__julien_hough_kht_linking_SOURCES = scribo_sandbox__julien_hough_kht_linking.cc
-scribo_sandbox__julien_hough_kht_peak_detection_SOURCES = scribo_sandbox__julien_hough_kht_peak_detection.cc
-scribo_sandbox__julien_hough_kht_subdivision_SOURCES = scribo_sandbox__julien_hough_kht_subdivision.cc
-scribo_sandbox__julien_hough_kht_types_SOURCES = scribo_sandbox__julien_hough_kht_types.cc
-scribo_sandbox__julien_hough_kht_voting_SOURCES = scribo_sandbox__julien_hough_kht_voting.cc
-scribo_sandbox__julien_upsampling_eagle_SOURCES = scribo_sandbox__julien_upsampling_eagle.cc
-scribo_sandbox__julien_upsampling_pyxies_SOURCES = scribo_sandbox__julien_upsampling_pyxies.cc
-scribo_sandbox_green_mln_accu_stat_histo1d_SOURCES = scribo_sandbox_green_mln_accu_stat_histo1d.cc
-scribo_sandbox_green_mln_accu_stat_histo2d_SOURCES = scribo_sandbox_green_mln_accu_stat_histo2d.cc
-scribo_sandbox_green_mln_accu_stat_histo3d_hsl_SOURCES = scribo_sandbox_green_mln_accu_stat_histo3d_hsl.cc
-scribo_sandbox_green_mln_accu_stat_histo3d_rgb_SOURCES = scribo_sandbox_green_mln_accu_stat_histo3d_rgb.cc
-scribo_sandbox_green_mln_clustering_k_mean_SOURCES = scribo_sandbox_green_mln_clustering_k_mean.cc
-scribo_sandbox_green_mln_clustering_kmean1d_SOURCES = scribo_sandbox_green_mln_clustering_kmean1d.cc
-scribo_sandbox_green_mln_clustering_kmean2d_SOURCES = scribo_sandbox_green_mln_clustering_kmean2d.cc
-scribo_sandbox_green_mln_clustering_kmean3d_SOURCES = scribo_sandbox_green_mln_clustering_kmean3d.cc
-scribo_sandbox_green_mln_clustering_kmean_rgb_SOURCES = scribo_sandbox_green_mln_clustering_kmean_rgb.cc
-scribo_sandbox_green_mln_display_display_histo_SOURCES = scribo_sandbox_green_mln_display_display_histo.cc
-scribo_sandbox_green_mln_display_project_histo_SOURCES = scribo_sandbox_green_mln_display_project_histo.cc
-scribo_sandbox_green_mln_fun_p2b_achromatic_SOURCES = scribo_sandbox_green_mln_fun_p2b_achromatic.cc
-scribo_sandbox_green_mln_fun_p2b_component_equals_SOURCES = scribo_sandbox_green_mln_fun_p2b_component_equals.cc
-scribo_sandbox_green_mln_fun_v2v_achromatism_SOURCES = scribo_sandbox_green_mln_fun_v2v_achromatism.cc
-scribo_sandbox_green_mln_fun_v2v_hue_concentration_SOURCES = scribo_sandbox_green_mln_fun_v2v_hue_concentration.cc
-scribo_sandbox_green_mln_fun_v2v_int_u16_to_int_u14_SOURCES = scribo_sandbox_green_mln_fun_v2v_int_u16_to_int_u14.cc
-scribo_sandbox_green_mln_fun_v2v_log_SOURCES = scribo_sandbox_green_mln_fun_v2v_log.cc
-scribo_sandbox_green_mln_fun_v2v_rg_to_rgb_SOURCES = scribo_sandbox_green_mln_fun_v2v_rg_to_rgb.cc
-scribo_sandbox_green_mln_fun_v2v_rgb8_to_int_u8_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb8_to_int_u8.cc
-scribo_sandbox_green_mln_fun_v2v_rgb8_to_rgbn_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb8_to_rgbn.cc
-scribo_sandbox_green_mln_fun_v2v_rgb_to_achromatism_map_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb_to_achromatism_map.cc
-scribo_sandbox_green_mln_fun_v2v_rgb_to_hsv_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb_to_hsv.cc
-scribo_sandbox_green_mln_fun_v2v_rgb_to_hue_map_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb_to_hue_map.cc
-scribo_sandbox_green_mln_fun_v2v_rgb_to_rg_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb_to_rg.cc
-scribo_sandbox_green_mln_fun_v2v_rgb_to_saturation_map_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb_to_saturation_map.cc
-scribo_sandbox_green_mln_fun_v2v_rgb_to_value_map_SOURCES = scribo_sandbox_green_mln_fun_v2v_rgb_to_value_map.cc
-scribo_sandbox_green_mln_img_path_SOURCES = scribo_sandbox_green_mln_img_path.cc
-scribo_sandbox_green_mln_io_plot_save_image_sh_SOURCES = scribo_sandbox_green_mln_io_plot_save_image_sh.cc
-scribo_sandbox_green_mln_math_ceil_SOURCES = scribo_sandbox_green_mln_math_ceil.cc
-scribo_sandbox_green_mln_math_floor_SOURCES = scribo_sandbox_green_mln_math_floor.cc
-scribo_sandbox_green_mln_value_hsv_SOURCES = scribo_sandbox_green_mln_value_hsv.cc
-scribo_sandbox_green_mln_value_rg_SOURCES = scribo_sandbox_green_mln_value_rg.cc
-scribo_sandbox_green_ok_mln_accu_histo_histo1d_SOURCES = scribo_sandbox_green_ok_mln_accu_histo_histo1d.cc
-scribo_sandbox_green_ok_mln_accu_histo_histo2d_SOURCES = scribo_sandbox_green_ok_mln_accu_histo_histo2d.cc
-scribo_sandbox_green_ok_mln_accu_histo_histo3d_SOURCES = scribo_sandbox_green_ok_mln_accu_histo_histo3d.cc
-scribo_sandbox_green_ok_mln_img_path_SOURCES = scribo_sandbox_green_ok_mln_img_path.cc
-scribo_src_afp_components_SOURCES = scribo_src_afp_components.cc
-scribo_src_afp_link_SOURCES = scribo_src_afp_link.cc
-scribo_src_afp_regroup_SOURCES = scribo_src_afp_regroup.cc
scribo_subsampling_bilinear_SOURCES = scribo_subsampling_bilinear.cc
scribo_subsampling_integral_SOURCES = scribo_subsampling_integral.cc
scribo_subsampling_integral_single_image_SOURCES = scribo_subsampling_integral_single_image.cc
@@ -616,7 +418,7 @@ 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_nepomuk_text_extraction_SOURCES = scribo_toolchain_nepomuk_text_extraction.cc
scribo_toolchain_text_in_doc_SOURCES = scribo_toolchain_text_in_doc.cc
scribo_upsampling_bs2x_SOURCES = scribo_upsampling_bs2x.cc
scribo_upsampling_eagle_SOURCES = scribo_upsampling_eagle.cc
+
--
1.5.6.5
1
0
last-svn-commit-444-g324908f Setup conditional unit-tests in Milena.
by Guillaume Lazzara 10 Aug '10
by Guillaume Lazzara 10 Aug '10
10 Aug '10
* tests/unit_test/Makefile.am
(regen-am): Update the use of build_unit_test.sh.
(EXTRA_DIST): Add cond_tests_* files.
* tests/unit_test/cond_tests_cfitsio,
* tests/unit_test/cond_tests_gdcm,
* tests/unit_test/cond_tests_magickxx,
* tests/unit_test/cond_tests_tiff: New.
* tests/unit_test/disabled_tests: Remove some conditional tests.
* tests/unit_test/unit-tests.mk: Regen.
---
milena/ChangeLog | 17 ++++++
milena/tests/unit_test/Makefile.am | 16 ++++--
milena/tests/unit_test/cond_tests_cfitsio | 2 +
milena/tests/unit_test/cond_tests_gdcm | 3 +
milena/tests/unit_test/cond_tests_magickxx | 3 +
milena/tests/unit_test/cond_tests_tiff | 2 +
milena/tests/unit_test/disabled_tests | 10 ----
milena/tests/unit_test/unit-tests.mk | 76 +++++++++++++++++++++++++---
8 files changed, 108 insertions(+), 21 deletions(-)
create mode 100644 milena/tests/unit_test/cond_tests_cfitsio
create mode 100644 milena/tests/unit_test/cond_tests_gdcm
create mode 100644 milena/tests/unit_test/cond_tests_magickxx
create mode 100644 milena/tests/unit_test/cond_tests_tiff
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 15a205c..967d9bb 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,20 @@
+2010-08-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Setup conditional unit-tests in Milena.
+
+ * tests/unit_test/Makefile.am
+ (regen-am): Update the use of build_unit_test.sh.
+ (EXTRA_DIST): Add cond_tests_* files.
+
+ * tests/unit_test/cond_tests_cfitsio,
+ * tests/unit_test/cond_tests_gdcm,
+ * tests/unit_test/cond_tests_magickxx,
+ * tests/unit_test/cond_tests_tiff: New.
+
+ * tests/unit_test/disabled_tests: Remove some conditional tests.
+
+ * tests/unit_test/unit-tests.mk: Regen.
+
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
Small changes in Milena.
diff --git a/milena/tests/unit_test/Makefile.am b/milena/tests/unit_test/Makefile.am
index 7327468..9a6d644 100644
--- a/milena/tests/unit_test/Makefile.am
+++ b/milena/tests/unit_test/Makefile.am
@@ -17,7 +17,13 @@
include $(top_srcdir)/milena/tests/tests.mk
-EXTRA_DIST = disabled_tests
+COND_TESTS = cond_tests_cfitsio \
+ cond_tests_gdcm \
+ cond_tests_magickxx \
+ cond_tests_tiff
+
+EXTRA_DIST = disabled_tests \
+ $(COND_TESTS)
# Regen files.
include $(top_srcdir)/build-aux/regen-recursive.mk
@@ -26,7 +32,8 @@ regen-am:
&& ./build-aux/build_unit_test.sh \
milena/mln \
milena/tests/unit_test \
- milena/tests/unit_test/disabled_tests
+ milena/tests/unit_test/disabled_tests \
+ mln
# FIXME: Change build_unit_test.sh so that the action looks like this:
#
@@ -34,12 +41,13 @@ regen-am:
#
# `$(abs_top_srcdir)' is required because of the change of directory
# at the beginning og the action.
-$(srcdir)/unit-tests.mk: $(top_srcdir)/build-aux/build_unit_test.sh disabled_tests
+$(srcdir)/unit-tests.mk: $(top_srcdir)/build-aux/build_unit_test.sh disabled_tests $(COND_TESTS)
cd $(top_srcdir) \
&& ./build-aux/build_unit_test.sh \
milena/mln \
milena/tests/unit_test \
- milena/tests/unit_test/disabled_tests
+ milena/tests/unit_test/disabled_tests \
+ mln
include $(srcdir)/unit-tests.mk
diff --git a/milena/tests/unit_test/cond_tests_cfitsio b/milena/tests/unit_test/cond_tests_cfitsio
new file mode 100644
index 0000000..2edbb64
--- /dev/null
+++ b/milena/tests/unit_test/cond_tests_cfitsio
@@ -0,0 +1,2 @@
+mln/io/fits/all.hh
+mln/io/fits/load.hh
diff --git a/milena/tests/unit_test/cond_tests_gdcm b/milena/tests/unit_test/cond_tests_gdcm
new file mode 100644
index 0000000..dae71b4
--- /dev/null
+++ b/milena/tests/unit_test/cond_tests_gdcm
@@ -0,0 +1,3 @@
+mln/io/dicom/all.hh
+mln/io/dicom/load.hh
+mln/io/dicom/get_header.hh
diff --git a/milena/tests/unit_test/cond_tests_magickxx b/milena/tests/unit_test/cond_tests_magickxx
new file mode 100644
index 0000000..2d9ff23
--- /dev/null
+++ b/milena/tests/unit_test/cond_tests_magickxx
@@ -0,0 +1,3 @@
+mln/io/magick/all.hh
+mln/io/magick/load.hh
+mln/io/magick/save.hh
diff --git a/milena/tests/unit_test/cond_tests_tiff b/milena/tests/unit_test/cond_tests_tiff
new file mode 100644
index 0000000..9d052ea
--- /dev/null
+++ b/milena/tests/unit_test/cond_tests_tiff
@@ -0,0 +1,2 @@
+mln/io/tiff/all.hh
+mln/io/tiff/load.hh
diff --git a/milena/tests/unit_test/disabled_tests b/milena/tests/unit_test/disabled_tests
index 3943e70..5fd991c 100644
--- a/milena/tests/unit_test/disabled_tests
+++ b/milena/tests/unit_test/disabled_tests
@@ -28,16 +28,6 @@ mln/debug/iota.spe.hh
mln/debug/println.spe.hh
mln/debug/println_with_border.spe.hh
mln/histo/compute.spe.hh
-mln/io/dicom/all.hh
-mln/io/dicom/load.hh
-mln/io/fits/all.hh
-mln/io/fits/load.hh
-mln/io/magick/all.hh
-mln/io/magick/load.hh
-mln/io/magick/save.hh
-mln/io/tiff/all.hh
-mln/io/tiff/load.hh
-mln/io/tiff/save.hh
mln/labeling/value.spe.hh
mln/logical/not.spe.hh
mln/morpho/general.spe.hh
diff --git a/milena/tests/unit_test/unit-tests.mk b/milena/tests/unit_test/unit-tests.mk
index 332c90b..bc0b6df 100644
--- a/milena/tests/unit_test/unit-tests.mk
+++ b/milena/tests/unit_test/unit-tests.mk
@@ -1,7 +1,73 @@
## Generated by ./build-aux/build_unit_test.sh, do not modify.
-check_PROGRAMS = \
-mln_+trash_erosion_tolerant \
+check_PROGRAMS =
+
+# Starting a conditional unit test list.
+if HAVE_CFITSIO
+check_PROGRAMS += \
+mln_io_fits_all \
+mln_io_fits_load
+
+mln_io_fits_all_CPPFLAGS= ${CFITSIO_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_fits_all_LDFLAGS= ${CFITSIO_LDFLAGS} ${AM_LDFLAGS}
+mln_io_fits_all_SOURCES = mln_io_fits_all.cc
+mln_io_fits_load_CPPFLAGS= ${CFITSIO_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_fits_load_LDFLAGS= ${CFITSIO_LDFLAGS} ${AM_LDFLAGS}
+mln_io_fits_load_SOURCES = mln_io_fits_load.cc
+endif HAVE_CFITSIO
+
+# Starting a conditional unit test list.
+if HAVE_GDCM
+check_PROGRAMS += \
+mln_io_dicom_all \
+mln_io_dicom_load \
+mln_io_dicom_get_header
+
+mln_io_dicom_all_CPPFLAGS= ${GDCM_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_dicom_all_LDFLAGS= ${GDCM_LDFLAGS} ${AM_LDFLAGS}
+mln_io_dicom_all_SOURCES = mln_io_dicom_all.cc
+mln_io_dicom_load_CPPFLAGS= ${GDCM_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_dicom_load_LDFLAGS= ${GDCM_LDFLAGS} ${AM_LDFLAGS}
+mln_io_dicom_load_SOURCES = mln_io_dicom_load.cc
+mln_io_dicom_get_header_CPPFLAGS= ${GDCM_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_dicom_get_header_LDFLAGS= ${GDCM_LDFLAGS} ${AM_LDFLAGS}
+mln_io_dicom_get_header_SOURCES = mln_io_dicom_get_header.cc
+endif HAVE_GDCM
+
+# Starting a conditional unit test list.
+if HAVE_MAGICKXX
+check_PROGRAMS += \
+mln_io_magick_all \
+mln_io_magick_load \
+mln_io_magick_save
+
+mln_io_magick_all_CPPFLAGS= ${MAGICKXX_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_magick_all_LDFLAGS= ${MAGICKXX_LDFLAGS} ${AM_LDFLAGS}
+mln_io_magick_all_SOURCES = mln_io_magick_all.cc
+mln_io_magick_load_CPPFLAGS= ${MAGICKXX_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_magick_load_LDFLAGS= ${MAGICKXX_LDFLAGS} ${AM_LDFLAGS}
+mln_io_magick_load_SOURCES = mln_io_magick_load.cc
+mln_io_magick_save_CPPFLAGS= ${MAGICKXX_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_magick_save_LDFLAGS= ${MAGICKXX_LDFLAGS} ${AM_LDFLAGS}
+mln_io_magick_save_SOURCES = mln_io_magick_save.cc
+endif HAVE_MAGICKXX
+
+# Starting a conditional unit test list.
+if HAVE_TIFF
+check_PROGRAMS += \
+mln_io_tiff_all \
+mln_io_tiff_load
+
+mln_io_tiff_all_CPPFLAGS= ${TIFF_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_tiff_all_LDFLAGS= ${TIFF_LDFLAGS} ${AM_LDFLAGS}
+mln_io_tiff_all_SOURCES = mln_io_tiff_all.cc
+mln_io_tiff_load_CPPFLAGS= ${TIFF_CPPFLAGS} ${AM_CPPFLAGS}
+mln_io_tiff_load_LDFLAGS= ${TIFF_LDFLAGS} ${AM_LDFLAGS}
+mln_io_tiff_load_SOURCES = mln_io_tiff_load.cc
+endif HAVE_TIFF
+
+# Starting non-conditional unit test list.
+check_PROGRAMS += \
mln_accu_all \
mln_accu_center \
mln_accu_compute \
@@ -671,7 +737,6 @@ mln_io_all \
mln_io_cloud_all \
mln_io_cloud_load \
mln_io_cloud_save \
-mln_io_dicom_get_header \
mln_io_dump_all \
mln_io_dump_get_header \
mln_io_dump_load \
@@ -1308,7 +1373,6 @@ mln_world_all \
mln_world_binary_2d_all \
mln_world_binary_2d_enlarge \
mln_world_binary_2d_projected_histo \
-mln_world_binary_2d_reduce \
mln_world_binary_2d_subsample \
mln_world_inter_pixel_all \
mln_world_inter_pixel_compute \
@@ -1326,7 +1390,6 @@ mln_world_inter_pixel_is_separator \
mln_world_inter_pixel_neighb2d \
mln_world_inter_pixel_separator_to_pixels
-mln_+trash_erosion_tolerant_SOURCES = mln_+trash_erosion_tolerant.cc
mln_accu_all_SOURCES = mln_accu_all.cc
mln_accu_center_SOURCES = mln_accu_center.cc
mln_accu_compute_SOURCES = mln_accu_compute.cc
@@ -1996,7 +2059,6 @@ mln_io_all_SOURCES = mln_io_all.cc
mln_io_cloud_all_SOURCES = mln_io_cloud_all.cc
mln_io_cloud_load_SOURCES = mln_io_cloud_load.cc
mln_io_cloud_save_SOURCES = mln_io_cloud_save.cc
-mln_io_dicom_get_header_SOURCES = mln_io_dicom_get_header.cc
mln_io_dump_all_SOURCES = mln_io_dump_all.cc
mln_io_dump_get_header_SOURCES = mln_io_dump_get_header.cc
mln_io_dump_load_SOURCES = mln_io_dump_load.cc
@@ -2633,7 +2695,6 @@ mln_world_all_SOURCES = mln_world_all.cc
mln_world_binary_2d_all_SOURCES = mln_world_binary_2d_all.cc
mln_world_binary_2d_enlarge_SOURCES = mln_world_binary_2d_enlarge.cc
mln_world_binary_2d_projected_histo_SOURCES = mln_world_binary_2d_projected_histo.cc
-mln_world_binary_2d_reduce_SOURCES = mln_world_binary_2d_reduce.cc
mln_world_binary_2d_subsample_SOURCES = mln_world_binary_2d_subsample.cc
mln_world_inter_pixel_all_SOURCES = mln_world_inter_pixel_all.cc
mln_world_inter_pixel_compute_SOURCES = mln_world_inter_pixel_compute.cc
@@ -2650,3 +2711,4 @@ mln_world_inter_pixel_is_pixel_SOURCES = mln_world_inter_pixel_is_pixel.cc
mln_world_inter_pixel_is_separator_SOURCES = mln_world_inter_pixel_is_separator.cc
mln_world_inter_pixel_neighb2d_SOURCES = mln_world_inter_pixel_neighb2d.cc
mln_world_inter_pixel_separator_to_pixels_SOURCES = mln_world_inter_pixel_separator_to_pixels.cc
+
--
1.5.6.5
1
0
last-svn-commit-443-g5ee999b build-aux/build_unit_test.sh: Add support for conditional unit-tests.
by Guillaume Lazzara 10 Aug '10
by Guillaume Lazzara 10 Aug '10
10 Aug '10
---
ChangeLog | 5 +
build-aux/build_unit_test.sh | 192 +++++++++++++++++++++++++++++++++---------
2 files changed, 157 insertions(+), 40 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ec948cc..dfa1ef6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-10 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * build-aux/build_unit_test.sh: Add support for conditional
+ unit-tests.
+
2010-08-03 Guillaume Lazzara <z(a)lrde.epita.fr>
* configure.ac: Improve configure's outputs for external library
diff --git a/build-aux/build_unit_test.sh b/build-aux/build_unit_test.sh
index 8080ef2..15310ff 100755
--- a/build-aux/build_unit_test.sh
+++ b/build-aux/build_unit_test.sh
@@ -1,6 +1,6 @@
#! /bin/sh
-# Copyright (C) 2007, 2009 EPITA Research and Development Laboratory
+# Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
# (LRDE)
#
# This file is part of Olena.
@@ -17,6 +17,25 @@
# You should have received a copy of the GNU General Public License
# along with Olena. If not, see <http://www.gnu.org/licenses/>.
+## Build a list of unit tests.
+##
+## Conditional tests (external dependencies) can be handled
+## automaticaly. For each dependency, a file named
+## "cond_tests_{DEPS}" must contain the list of files which need the
+## dependency. If a test needs more than one dependency, several
+## dependency names can be used in the file name.
+##
+## Ex: cond_tests_qt_tesseract
+##
+## All the tests listed in this file will need both qt and tesseract
+## to be compiled.
+##
+## "cond_tests_*" files must be created in the directory where
+## unit-test.mk is generated (usually the unit-tests directory).
+##
+## WARNING: don't forget to add "cond_tests_*" files in the COND_TESTS
+## variable in the right Makefile.am.
+
## FIXME: Don't use `echo -n', as echo's options are not portable.
##
## http://www.gnu.org/software/autoconf/manual/html_node/Limitations-of-Builtiā¦
@@ -25,44 +44,38 @@
## would be to only emit lines ended with newlines.
ECHO_N=printf
-# Use the C locale to have a deterministic sort.
-export LC_ALL=C
-test $# -eq 3 || { echo "Usage: $0 <scanned dir> <output_dir> <disabled_tests>" && exit 1; }
+add_targets()
+{
+ HEADERS_="$1"
+ output_dir="$2"
+ output="$3"
+ IFDEF="$4"
-scanned_dir=$1
-output_dir=$2
-disabled_tests=$3
+ if ! (test -z "$IFDEF"); then
+ echo "# Starting a conditional unit test list." >> "$output"
+ else
+ echo "# Starting non-conditional unit test list." >> "$output"
+ fi
-## FIXME: We do not include these directories
-##
-## mln/io/dicom
-## mln/io/fits
-## mln/io/magick
-## mln/io/tiff
-##
-## because they contain files depending on optional (external)
-## libraries. We should test them conditionally.
-HEADERS=$(find $scanned_dir -type f -name "*.hh" \
- | sort \
- | sed -e 's/.*\/mln\/\(.*\)/mln\/\1/g' | sed 's/\.\.\/\.\.\///g' \
- | comm -23 - "$disabled_tests")
+ # Start conditions if necessary
-output="$output_dir/unit-tests.mk"
+ # Construct a list of conditions in reverse order to write valid
+ # endif further.
+ IFDEF_TMP=""
+ for i in $IFDEF; do
+ echo "if HAVE_$i" >>"$output"
+ IFDEF_TMP="$i $IFDEF_TMP"
+ done
+ IFDEF="$IFDEF_TMP"
-rm -f "$output"
-rm -f mln_*.cc
+ $ECHO_N "check_PROGRAMS += " >>"$output"
-# Build unit-tests.mk.
-echo "## Generated by $0, do not modify." >"$output"
-echo >>"$output"
-$ECHO_N "check_PROGRAMS = " >>"$output"
-
-for i in $HEADERS; do
- FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
+ for i in $HEADERS_; do
+ FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
# Build .cc.
- cat > $output_dir/$FILE_CC << EOF
+ cat > $output_dir/$FILE_CC << EOF
// Unit test for $i.
// Generated by $0, do not modify.
@@ -77,16 +90,115 @@ int main()
EOF
# Build unit-tests.mk.
- TARGET=`echo "${FILE_CC}" | sed 's/\.cc//'`
- echo " \\" >>"$output"
- $ECHO_N "${TARGET}" >>"$output"
+ TARGET=`echo "${FILE_CC}" | sed 's/\.cc//'`
+ echo " \\" >>"$output"
+ $ECHO_N "${TARGET}" >>"$output"
+ done
+
+ # Build "$output".
+ echo "" >>"$output"
+ echo "" >>"$output"
+ for i in $HEADERS_; do
+ FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
+ NAME=`echo $FILE_CC | sed 's/\.cc//g'`
+
+ # Write specific flags if there are dependencies.
+ if ! (test -z "$IFDEF"); then
+ cppflags="${NAME}_CPPFLAGS="
+ ldflags="${NAME}_LDFLAGS="
+ for i in $IFDEF; do
+ cppflags="${cppflags} \${${i}_CPPFLAGS} "
+ ldflags="${ldflags} \${${i}_LDFLAGS} "
+ done
+ echo "$cppflags \${AM_CPPFLAGS}" >>"$output"
+ echo "$ldflags \${AM_LDFLAGS}" >>"$output"
+ fi
+
+ echo "${NAME}_SOURCES = $FILE_CC" >>"$output"
+ done
+
+ # End conditions if necessary
+ for i in $IFDEF; do
+ echo "endif HAVE_$i" >>"$output"
+ done
+
+ echo "" >>"$output"
+}
+
+
+
+# Use the C locale to have a deterministic sort.
+export LC_ALL=C
+
+test $# -eq 4 || { echo "Usage: $0 <scanned dir> <output_dir> <disabled_tests> <base include dir>" && exit 1; }
+
+scanned_dir=$1
+output_dir=$2
+disabled_tests=$3
+base_inc_dir=$4
+
+# Create a list of tests to be disabled or considered as conditional.
+ignored_list="$output_dir/ignored_list.tmp"
+cat "$disabled_tests" > $ignored_list
+COND_TESTS=$(find $output_dir -type f -name "cond_tests_*" | sort)
+for f in $COND_TESTS; do
+ cat "$f" >> "$ignored_list"
done
+cat "$ignored_list" | sort > "$ignored_list.tmp"
+mv -f "$ignored_list.tmp" "$ignored_list"
-# Build "$output".
-echo "" >>"$output"
+HEADERS=$(find $scanned_dir -type f -name "*.hh" \
+ | sort \
+ | sed -e "s/.*\/${base_inc_dir}\/\(.*\)/${base_inc_dir}\/\1/g" \
+ | sed 's/\.\.\/\.\.\///g' \
+ | comm -23 - "$ignored_list")
+
+output="$output_dir/unit-tests.mk"
+
+# Cleanup previously generated data.
+rm -f "$output"
+rm -f ${base_inc_dir}_*.cc
+
+# Build unit-tests.mk.
+echo "## Generated by $0, do not modify." > "$output"
+echo >>"$output"
+
+echo "check_PROGRAMS =" >>"$output"
echo "" >>"$output"
-for i in $HEADERS; do
- FILE_CC=`echo $i | sed 's/[/.]/_/g' | sed 's/_hh/\.cc/g'`
- NAME=`echo $FILE_CC | sed 's/\.cc//g'`
- echo "${NAME}_SOURCES = $FILE_CC" >>"$output"
+
+
+#-----------------------------------
+# Insert lists of conditional tests.
+#-----------------------------------
+
+for f in $COND_TESTS; do
+ # Generate the list of conditions.
+ fpostfix="`echo \"$f\" | sed -e 's/.*\/cond_tests_//g'`_"
+ i=1
+ COND_LIST=""
+ while true; do
+ name=`echo $fpostfix | cut -s -d '_' -f $i \
+ | tr "[:lower:]" "[:upper:]"`
+ i=$(($i+1))
+ if (test -z "$name"); then
+ break;
+ fi
+ COND_LIST="${COND_LIST} $name"
+ done
+
+ COND_HEADERS=$(cat $f)
+
+ # Writing conditional targets
+ add_targets "$COND_HEADERS" "$output_dir" "$output" "$COND_LIST"
done
+
+
+#-------------------------------------
+# Insert list of non-conditional tests
+#-------------------------------------
+
+add_targets "$HEADERS" "$output_dir" "$output" ""
+
+
+# Remove temporary files
+rm -f "$ignored_list"
\ No newline at end of file
--
1.5.6.5
1
0
last-svn-commit-442-gaf62462 tests/unit_test/disabled_tests: Update list of disabled tests.
by Guillaume Lazzara 09 Aug '10
by Guillaume Lazzara 09 Aug '10
09 Aug '10
---
scribo/ChangeLog | 4 ++++
scribo/tests/unit_test/disabled_tests | 3 +--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 2cb39ec..7f1f52d 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * tests/unit_test/disabled_tests: Update list of disabled tests.
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add a new rotation tool.
* src/preprocessing/Makefile.am: Add a new target.
diff --git a/scribo/tests/unit_test/disabled_tests b/scribo/tests/unit_test/disabled_tests
index 9804c82..9d84198 100644
--- a/scribo/tests/unit_test/disabled_tests
+++ b/scribo/tests/unit_test/disabled_tests
@@ -1,5 +1,4 @@
-scribo/demo/src/mainwindow.hh
scribo/primitive/link/compute_several.hh
scribo/primitive/link/internal/find_several_links.hh
scribo/primitive/link/with_several_right_links_overlap.hh
-scribo/text/recognition.hh
+scribo/primitive/link/with_several_right_closest_links.hh
--
1.5.6.5
1
0
* src/preprocessing/Makefile.am: Add a new target.
* src/preprocessing/rotate.cc: New.
---
scribo/ChangeLog | 8 ++++++
scribo/src/preprocessing/Makefile.am | 9 ++++++
.../src/preprocessing/{subsample.cc => rotate.cc} | 27 ++++++++++---------
3 files changed, 31 insertions(+), 13 deletions(-)
copy scribo/src/preprocessing/{subsample.cc => rotate.cc} (80%)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 9882ea6..2cb39ec 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,13 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add a new rotation tool.
+
+ * src/preprocessing/Makefile.am: Add a new target.
+
+ * src/preprocessing/rotate.cc: New.
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Remove deprecated references to object_image.
* core/object_image.hh: Remove.
diff --git a/scribo/src/preprocessing/Makefile.am b/scribo/src/preprocessing/Makefile.am
index 5dabcac..0c6e00a 100644
--- a/scribo/src/preprocessing/Makefile.am
+++ b/scribo/src/preprocessing/Makefile.am
@@ -41,6 +41,15 @@ if HAVE_MAGICKXX
$(MAGICKXX_LDFLAGS) \
-lpthread
+ bin_PROGRAMS += rotate
+ rotate_SOURCES = rotate.cc
+ rotate_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(MAGICKXX_CPPFLAGS)
+
+ rotate_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
+
bin_PROGRAMS += rotate_90
rotate_90_SOURCES = rotate_90.cc
rotate_90_CPPFLAGS = $(AM_CPPFLAGS) \
diff --git a/scribo/src/preprocessing/subsample.cc b/scribo/src/preprocessing/rotate.cc
similarity index 80%
copy from scribo/src/preprocessing/subsample.cc
copy to scribo/src/preprocessing/rotate.cc
index fde31e0..2910684 100644
--- a/scribo/src/preprocessing/subsample.cc
+++ b/scribo/src/preprocessing/rotate.cc
@@ -24,13 +24,13 @@
// executable file might be covered by the GNU General Public License.
#include <mln/core/image/image2d.hh>
-#include <mln/core/alias/neighb2d.hh>
+#include <mln/value/rgb8.hh>
#include <mln/io/magick/load.hh>
#include <mln/io/ppm/save.hh>
-#include <mln/subsampling/antialiased.hh>
+#include <mln/geom/rotate.hh>
-#include <mln/value/rgb8.hh>
+#include <mln/literal/black.hh>
#include <scribo/debug/usage.hh>
@@ -38,30 +38,31 @@
const char *args_desc[][2] =
{
{ "input.*", "An image." },
- { "ratio", "Scale ratio." },
- { "output.ppm", "A color image." },
+ { "output.ppm", "A rotated image." },
+ { "angle", "The rotation angle." },
{0, 0}
};
+
int main(int argc, char *argv[])
{
using namespace mln;
if (argc != 4)
return scribo::debug::usage(argv,
- "Subsample.",
- "input.* ratio output.ppm",
+ "Rotation of an image from an arbitrary "
+ "angle.",
+ "input.* output.ppm angle",
args_desc);
- trace::entering("main");
typedef image2d<value::rgb8> I;
- I input;
- io::magick::load(input, argv[1]);
+ I ima;
+ io::magick::load(ima, argv[1]);
- unsigned ratio = atoi(argv[2]);
- io::ppm::save(mln::subsampling::antialiased(input, ratio), argv[3]);
+ image2d<value::rgb8>
+ out = mln::geom::rotate(ima, atof(argv[3]), literal::black);
- trace::exiting("main");
+ io::ppm::save(out, argv[2]);
}
--
1.5.6.5
1
0
last-svn-commit-440-gcb1501f Remove deprecated references to object_image.
by Guillaume Lazzara 09 Aug '10
by Guillaume Lazzara 09 Aug '10
09 Aug '10
* core/object_image.hh: Remove.
* filter/object_groups_size_ratio.hh,
* filter/object_links_bbox_w_ratio.hh,
* filter/object_links_left_aligned.hh,
* filter/object_links_right_aligned.hh,
* primitive/extract/lines_h_thick_and_single.hh,
* primitive/extract/lines_v_thick_and_single.hh,
* primitive/link/internal/find_several_links.hh,
* primitive/link/internal/link_several_dmax_base.hh,
* primitive/link/with_single_up_link.hh,
* src/debug/show_links_left_right_links_validation.cc,
* src/primitive/find/find_discontinued_lines.cc,
* src/primitive/find/find_pattern_lines.cc,
* tests/filter/small_and_large_bboxes.cc,
* src/primitive/group/group_from_double_link_filter_non_aligned.cc:
Remove include of object_image.hh.
---
scribo/ChangeLog | 22 +++++++++++
scribo/core/object_image.hh | 38 --------------------
scribo/filter/object_groups_size_ratio.hh | 1 -
scribo/filter/object_links_bbox_w_ratio.hh | 1 -
scribo/filter/object_links_left_aligned.hh | 1 -
scribo/filter/object_links_right_aligned.hh | 1 -
.../primitive/extract/lines_h_thick_and_single.hh | 1 -
.../primitive/extract/lines_v_thick_and_single.hh | 1 -
.../primitive/link/internal/find_several_links.hh | 4 +-
.../link/internal/link_several_dmax_base.hh | 1 -
scribo/primitive/link/with_single_up_link.hh | 1 -
.../show_links_left_right_links_validation.cc | 1 -
.../src/primitive/find/find_discontinued_lines.cc | 1 -
scribo/src/primitive/find/find_pattern_lines.cc | 1 -
.../src/primitive/group/group_from_double_link.cc | 1 -
scribo/tests/filter/small_and_large_bboxes.cc | 3 --
16 files changed, 24 insertions(+), 55 deletions(-)
delete mode 100644 scribo/core/object_image.hh
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 7197f41..9882ea6 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,27 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Remove deprecated references to object_image.
+
+ * core/object_image.hh: Remove.
+
+ * filter/object_groups_size_ratio.hh,
+ * filter/object_links_bbox_w_ratio.hh,
+ * filter/object_links_left_aligned.hh,
+ * filter/object_links_right_aligned.hh,
+ * primitive/extract/lines_h_thick_and_single.hh,
+ * primitive/extract/lines_v_thick_and_single.hh,
+ * primitive/link/internal/find_several_links.hh,
+ * primitive/link/internal/link_several_dmax_base.hh,
+ * primitive/link/with_single_up_link.hh,
+ * src/debug/show_links_left_right_links_validation.cc,
+ * src/primitive/find/find_discontinued_lines.cc,
+ * src/primitive/find/find_pattern_lines.cc,
+ * tests/filter/small_and_large_bboxes.cc,
+ * src/primitive/group/group_from_double_link_filter_non_aligned.cc:
+ Remove include of object_image.hh.
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Cleanup Makefiles.
* src/Makefile.am: Disable tests and remove deprecated ones.
diff --git a/scribo/core/object_image.hh b/scribo/core/object_image.hh
deleted file mode 100644
index 7f672b2..0000000
--- a/scribo/core/object_image.hh
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project without restriction. Specifically, if other files
-// instantiate templates or use macros or inline functions from this
-// file, or you compile this file and link it with other files to produce
-// an executable, this file does not by itself cause the resulting
-// executable to be covered by the GNU General Public License. This
-// exception does not however invalidate any other reasons why the
-// executable file might be covered by the GNU General Public License.
-
-#ifndef SCRIBO_CORE_OBJECT_IMAGE_HH
-# define SCRIBO_CORE_OBJECT_IMAGE_HH
-
-/// \file
-///
-/// FIXME.
-
-# include <mln/core/image/imorph/labeled_image.hh>
-
-# define object_image(L) \
- mln::labeled_image<L>
-
-#endif // ! SCRIBO_CORE_OBJECT_IMAGE_HH
diff --git a/scribo/filter/object_groups_size_ratio.hh b/scribo/filter/object_groups_size_ratio.hh
index 94d9b1b..fa59e7f 100644
--- a/scribo/filter/object_groups_size_ratio.hh
+++ b/scribo/filter/object_groups_size_ratio.hh
@@ -35,7 +35,6 @@
# include <scribo/core/macros.hh>
# include <scribo/core/object_groups.hh>
-# include <scribo/core/object_image.hh>
namespace scribo
{
diff --git a/scribo/filter/object_links_bbox_w_ratio.hh b/scribo/filter/object_links_bbox_w_ratio.hh
index 0bb373f..215413c 100644
--- a/scribo/filter/object_links_bbox_w_ratio.hh
+++ b/scribo/filter/object_links_bbox_w_ratio.hh
@@ -39,7 +39,6 @@
# include <scribo/core/macros.hh>
# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/filter/object_links_bbox_ratio.hh>
namespace scribo
diff --git a/scribo/filter/object_links_left_aligned.hh b/scribo/filter/object_links_left_aligned.hh
index 059b423..82d4185 100644
--- a/scribo/filter/object_links_left_aligned.hh
+++ b/scribo/filter/object_links_left_aligned.hh
@@ -38,7 +38,6 @@
# include <scribo/core/macros.hh>
# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/filter/object_links_non_aligned_simple.hh>
diff --git a/scribo/filter/object_links_right_aligned.hh b/scribo/filter/object_links_right_aligned.hh
index dfb06c7..07ca309 100644
--- a/scribo/filter/object_links_right_aligned.hh
+++ b/scribo/filter/object_links_right_aligned.hh
@@ -37,7 +37,6 @@
# include <scribo/core/macros.hh>
# include <scribo/core/object_links.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/filter/object_links_non_aligned_simple.hh>
diff --git a/scribo/primitive/extract/lines_h_thick_and_single.hh b/scribo/primitive/extract/lines_h_thick_and_single.hh
index 551e5d8..dd495a4 100644
--- a/scribo/primitive/extract/lines_h_thick_and_single.hh
+++ b/scribo/primitive/extract/lines_h_thick_and_single.hh
@@ -38,7 +38,6 @@
# include <mln/morpho/opening/structural.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
# include <scribo/primitive/extract/lines_h_thick.hh>
diff --git a/scribo/primitive/extract/lines_v_thick_and_single.hh b/scribo/primitive/extract/lines_v_thick_and_single.hh
index c19ba5a..44f7a9e 100644
--- a/scribo/primitive/extract/lines_v_thick_and_single.hh
+++ b/scribo/primitive/extract/lines_v_thick_and_single.hh
@@ -38,7 +38,6 @@
# include <mln/morpho/opening/structural.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/macros.hh>
# include <scribo/primitive/extract/lines_v_thick.hh>
diff --git a/scribo/primitive/link/internal/find_several_links.hh b/scribo/primitive/link/internal/find_several_links.hh
index 8cca3bd..4d9404e 100644
--- a/scribo/primitive/link/internal/find_several_links.hh
+++ b/scribo/primitive/link/internal/find_several_links.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.
//
@@ -42,7 +43,6 @@
# include <scribo/core/concept/link_functor.hh>
# include <scribo/core/tag/anchor.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/object_links.hh>
diff --git a/scribo/primitive/link/internal/link_several_dmax_base.hh b/scribo/primitive/link/internal/link_several_dmax_base.hh
index 3b4ec4b..e5b9ce2 100644
--- a/scribo/primitive/link/internal/link_several_dmax_base.hh
+++ b/scribo/primitive/link/internal/link_several_dmax_base.hh
@@ -43,7 +43,6 @@
# include <scribo/core/macros.hh>
# include <scribo/core/tag/anchor.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/object_links.hh>
# include <scribo/primitive/link/internal/find_link.hh>
diff --git a/scribo/primitive/link/with_single_up_link.hh b/scribo/primitive/link/with_single_up_link.hh
index 4062275..eccf1fb 100644
--- a/scribo/primitive/link/with_single_up_link.hh
+++ b/scribo/primitive/link/with_single_up_link.hh
@@ -44,7 +44,6 @@
# include <scribo/core/macros.hh>
-# include <scribo/core/object_image.hh>
# include <scribo/core/object_links.hh>
# include <scribo/primitive/link/internal/find_link.hh>
diff --git a/scribo/src/debug/show_links_left_right_links_validation.cc b/scribo/src/debug/show_links_left_right_links_validation.cc
index e022fa5..450232a 100644
--- a/scribo/src/debug/show_links_left_right_links_validation.cc
+++ b/scribo/src/debug/show_links_left_right_links_validation.cc
@@ -38,7 +38,6 @@
#include <mln/value/label_16.hh>
#include <scribo/core/object_links.hh>
-#include <scribo/core/object_image.hh>
#include <scribo/primitive/extract/components.hh>
diff --git a/scribo/src/primitive/find/find_discontinued_lines.cc b/scribo/src/primitive/find/find_discontinued_lines.cc
index 244cae5..eec579a 100644
--- a/scribo/src/primitive/find/find_discontinued_lines.cc
+++ b/scribo/src/primitive/find/find_discontinued_lines.cc
@@ -35,7 +35,6 @@
#include <scribo/debug/usage.hh>
-#include <scribo/core/object_image.hh>
#include <scribo/primitive/extract/lines_h_discontinued.hh>
#include <scribo/primitive/extract/lines_v_discontinued.hh>
diff --git a/scribo/src/primitive/find/find_pattern_lines.cc b/scribo/src/primitive/find/find_pattern_lines.cc
index 540328b..88d22c0 100644
--- a/scribo/src/primitive/find/find_pattern_lines.cc
+++ b/scribo/src/primitive/find/find_pattern_lines.cc
@@ -35,7 +35,6 @@
#include <scribo/debug/usage.hh>
-#include <scribo/core/object_image.hh>
#include <scribo/primitive/extract/lines_h_pattern.hh>
#include <scribo/primitive/extract/lines_v_pattern.hh>
diff --git a/scribo/src/primitive/group/group_from_double_link.cc b/scribo/src/primitive/group/group_from_double_link.cc
index 00c68df..39b1bb9 100644
--- a/scribo/src/primitive/group/group_from_double_link.cc
+++ b/scribo/src/primitive/group/group_from_double_link.cc
@@ -36,7 +36,6 @@
#include <mln/value/label_16.hh>
#include <scribo/core/object_links.hh>
-#include <scribo/core/object_image.hh>
#include <scribo/primitive/extract/components.hh>
#include <scribo/primitive/group/apply.hh>
diff --git a/scribo/tests/filter/small_and_large_bboxes.cc b/scribo/tests/filter/small_and_large_bboxes.cc
index adae46f..653a8ca 100644
--- a/scribo/tests/filter/small_and_large_bboxes.cc
+++ b/scribo/tests/filter/small_and_large_bboxes.cc
@@ -32,9 +32,6 @@
#include <mln/value/label_16.hh>
#include <mln/io/pbm/load.hh>
#include <mln/literal/colors.hh>
-
-#include <scribo/core/object_image.hh>
-
#include <scribo/primitive/extract/components.hh>
#include <scribo/primitive/group/apply.hh>
#include <scribo/primitive/link/with_single_left_link.hh>
--
1.5.6.5
1
0
* src/Makefile.am: Disable tests and remove deprecated ones.
* src/preprocessing/Makefile.am: Use MAGICKXX_* flags.
---
scribo/ChangeLog | 12 +++++++++-
scribo/src/Makefile.am | 9 +++----
scribo/src/preprocessing/Makefile.am | 42 ++++++++++++++++++---------------
3 files changed, 38 insertions(+), 25 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 1ce0459..7197f41 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,8 +1,18 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
- Cleanup and improve text recognition.
+ Cleanup Makefiles.
+
+ * src/Makefile.am: Disable tests and remove deprecated ones.
+ * src/preprocessing/Makefile.am: Use MAGICKXX_* flags.
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Cleanup and improve text recognition.
+
+ * src/text_recognition_in_picture.cc: Use new routines. Cleanup
+ useless comments. Use a height ratio filter to improve OCR
+ results.
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index a7dd7bc..b1a29e8 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -26,14 +26,13 @@ SUBDIRS = \
misc \
postprocessing \
preprocessing \
- table \
text
-bin_PROGRAMS = \
- pbm_lines_in_doc
+# Disabled for the moment:
+# table
-pbm_lines_in_doc_SOURCES = pbm_lines_in_doc.cc
+bin_PROGRAMS =
if HAVE_TESSERACT
@@ -46,7 +45,7 @@ if HAVE_TESSERACT
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
-lpthread
-# -lhpdf
+
pbm_text_in_doc_SOURCES = pbm_text_in_doc.cc
endif HAVE_TESSERACT
diff --git a/scribo/src/preprocessing/Makefile.am b/scribo/src/preprocessing/Makefile.am
index 8b99bf2..5dabcac 100644
--- a/scribo/src/preprocessing/Makefile.am
+++ b/scribo/src/preprocessing/Makefile.am
@@ -22,46 +22,50 @@ bin_PROGRAMS = \
denoise_fg \
homogeneous_contrast \
preprocess \
- split_bg_fg \
unskew
denoise_bg_SOURCES = denoise_bg.cc
denoise_fg_SOURCES = denoise_fg.cc
homogeneous_contrast_SOURCES = homogeneous_contrast.cc
preprocess_SOURCES = preprocess.cc
-split_bg_fg_SOURCES = split_bg_fg.cc
unskew_SOURCES = unskew.cc
if HAVE_MAGICKXX
+ bin_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
+
bin_PROGRAMS += rotate_90
rotate_90_SOURCES = rotate_90.cc
rotate_90_CPPFLAGS = $(AM_CPPFLAGS) \
- $(TESSERACT_CPPFLAGS) \
- `Magick++-config --cppflags`
+ $(MAGICKXX_CPPFLAGS)
- rotate_90_LDFLAGS = $(AM_LDFLAGS) \
- $(TESSERACT_LDFLAGS) \
- -lpthread `Magick++-config --libs`
+ rotate_90_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
- bin_PROGRAMS += to_pgm
+ bin_PROGRAMS += to_pgm
to_pgm_SOURCES = to_pgm.cc
to_pgm_CPPFLAGS = $(AM_CPPFLAGS) \
- $(TESSERACT_CPPFLAGS) \
- `Magick++-config --cppflags`
+ $(MAGICKXX_CPPFLAGS)
- to_pgm_LDFLAGS = $(AM_LDFLAGS) \
- $(TESSERACT_LDFLAGS) \
- -lpthread `Magick++-config --libs`
+ to_pgm_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
- bin_PROGRAMS += subsample
+ bin_PROGRAMS += subsample
subsample_SOURCES = subsample.cc
subsample_CPPFLAGS = $(AM_CPPFLAGS) \
- $(TESSERACT_CPPFLAGS) \
- `Magick++-config --cppflags`
+ $(MAGICKXX_CPPFLAGS)
- subsample_LDFLAGS = $(AM_LDFLAGS) \
- $(TESSERACT_LDFLAGS) \
- -lpthread `Magick++-config --libs`
+ subsample_LDFLAGS = $(AM_LDFLAGS) \
+ $(MAGICKXX_LDFLAGS) \
+ -lpthread
endif HAVE_MAGICKXX
--
1.5.6.5
1
0
09 Aug '10
* src/text_recognition_in_picture.cc: Use new routines. Cleanup
useless comments. Use a height ratio filter to improve OCR
results.
---
scribo/ChangeLog | 6 ++
scribo/src/text_recognition_in_picture.cc | 129 ++++++++++++++---------------
2 files changed, 68 insertions(+), 67 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 54a9d1c..1ce0459 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,11 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Cleanup and improve text recognition.
+
+
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Cleanup and make use of the new routines.
* src/text_in_picture.cc: Here.
diff --git a/scribo/src/text_recognition_in_picture.cc b/scribo/src/text_recognition_in_picture.cc
index 119f757..b69411e 100644
--- a/scribo/src/text_recognition_in_picture.cc
+++ b/scribo/src/text_recognition_in_picture.cc
@@ -74,8 +74,10 @@
#include <scribo/primitive/group/from_single_link.hh>
#include <scribo/primitive/regroup/from_single_left_link.hh>
+#include <scribo/primitive/regroup/from_single_left_link_wrt_h_ratio.hh>
+
+#include <scribo/filter/objects_size_ratio.hh>
-//#include <scribo/filter/objects_with_holes.hh>
#include <scribo/filter/object_groups_with_holes.hh>
#include <scribo/filter/object_links_bbox_h_ratio.hh>
@@ -95,6 +97,7 @@
#include <scribo/debug/usage.hh>
#include <scribo/preprocessing/split_bg_fg.hh>
+#include <scribo/preprocessing/rotate_90.hh>
#include <scribo/make/debug_filename.hh>
@@ -104,7 +107,6 @@
#include <scribo/src/afp/components.hh>
#include <scribo/src/afp/link.hh>
-#include <scribo/src/afp/regroup.hh>
#include <scribo/core/line_set.hh>
#include <scribo/text/recognition.hh>
@@ -116,11 +118,15 @@
const char *args_desc[][2] =
{
- { "input.ppm", "A color image." },
+ { "input.*", "An image." },
{ "ouput.ppm", "A color image where the text is highlighted." },
{ "out.txt", "Text recognized text with its position." },
- { "max_dim_size", "The highest dimension size of the image used for computation. It is used to find a resize factor and impacts on the performance. (1024 by default)" },
- { "lbl.ppm", "A color image with the labeled text components. (Considered as optional debug)" },
+ { "max_dim_size", "The highest dimension size of the image used for "
+ "computation. It is used to find a resize factor and impacts on the"
+ " performance. (1024 by default)" },
+ { "lambda", "Lambda value used for foreground extraction." },
+ { "lbl.ppm", "A color image with the labeled text components. (Considered"
+ " as optional debug)" },
{0, 0}
};
@@ -132,6 +138,7 @@ namespace mln
{
config()
{
+ min_size_ratio = 0.2f;
max_dim_size = 1024;
sauvola_s = 2u; // 3?
@@ -146,6 +153,9 @@ namespace mln
group_min_holes = 3;
}
+ // Component filtering
+ double min_size_ratio;
+
// Image resizing factor
unsigned max_dim_size;
@@ -173,51 +183,6 @@ mln::config conf;
namespace mln
{
- template <typename I, typename L>
- mln_concrete(I)
- compute_text_image(const I& input_rgb,
- const scribo::component_set<L>& grouped_objects)
- {
- unsigned shift = 5;
- float height = 1, width = 0;
- for_all_comps(i, grouped_objects)
- if (grouped_objects(i).is_valid())
- {
- height += grouped_objects(i).bbox().nrows() + shift;
- width = math::max(static_cast<float>(grouped_objects(i).bbox().ncols()),
- width);
- }
- if (width == 0)
- width = 1;
-
- I output(height, width);
- data::fill(output, literal::black);
-
- algebra::vec<2, float> dv;
- dv[0] = 0;
- dv[1] = 0;
- for_all_comps(i, grouped_objects)
- if (grouped_objects(i).is_valid())
- {
- mln_VAR(tmp, duplicate(input_rgb | grouped_objects(i).bbox()));
-
- typedef fun::x2x::translation<mln_site_(I)::dim, float> trans_t;
- trans_t trans(dv - grouped_objects(i).bbox().pmin().to_vec());
-
- mln_domain(I)
- tr_box(grouped_objects(i).bbox().pmin().to_vec() + trans.t(),
- grouped_objects(i).bbox().pmax().to_vec() + trans.t());
-
- tr_image<mln_domain(I), tmp_t, trans_t> tr_ima(tr_box, tmp, trans);
-
- data::paste(tr_ima, output);
- dv[0] += grouped_objects(i).bbox().nrows() + shift;
- }
-
- return output;
- }
-
-
template <typename I>
unsigned get_factor(const I& ima)
{
@@ -238,13 +203,17 @@ namespace mln
int main(int argc, char* argv[])
{
using namespace scribo;
+ using namespace scribo::primitive;
using namespace mln;
- if (argc < 4 || argc > 6)
+ if (argc < 4 || argc > 7)
return scribo::debug::usage(argv,
- "Find text in a photo.\n\n\
-Common usage: ./text_in_photo_fast input.ppm output.ppm out.txt [max_dim_size] [lbl.ppm]",
- "input.ppm output.ppm out.txt [max_dim_size] [lbl.ppm]",
+ "Find text in a photo.\n\n"
+ "Common usage: ./text_recognition_in_picture"
+ " input.* output.ppm out.txt [max_dim_size]"
+ " [lambda] [lbl.ppm]",
+ "input.* output.ppm out.txt [max_dim_size]"
+ " [lambda] [lbl.ppm]",
args_desc);
@@ -266,7 +235,12 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm out.txt [max_dim_size] [
unsigned lambda;
- lambda = 1.2 * (input_rgb.nrows() + input_rgb.ncols());
+ if (argc >= 6)
+ lambda = atoi(argv[5]);
+ else
+ lambda = 1.2 * (input_rgb.nrows() + input_rgb.ncols());
+
+ std::cout << "Using lambda = " << lambda << std::endl;
image2d<value::int_u8> intensity_ima;
@@ -275,6 +249,24 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm out.txt [max_dim_size] [
fg = preprocessing::split_bg_fg(input_rgb, lambda, 32).second();
intensity_ima = data::transform(fg, mln::fun::v2v::rgb_to_int_u<8>());
+// // Perform an initial rotation if needed.
+// // input_rgb = geom::rotate(input_rgb, -45, literal::black);
+// intensity_ima = geom::rotate(intensity_ima, -45);
+
+// // Make sure the domain origin is set to (0,0).
+// box2d rb = intensity_ima.domain();
+// box2d b(geom::nrows(intensity_ima), geom::ncols(intensity_ima));
+// // {
+// // image2d<value::rgb8> tmp(b);
+// // data::paste_without_localization(input_rgb, tmp);
+// // input_rgb = tmp;
+// // }
+// {
+// image2d<value::int_u8> tmp(b);
+// data::paste_without_localization(intensity_ima, tmp);
+// intensity_ima = tmp;
+// }
+
// Binarize foreground to use it in the processing chain.
@@ -292,18 +284,19 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm out.txt [max_dim_size] [
typedef image2d<value::label_16> L;
/// Finding components.
- typedef component_set<L> Obj;
- Obj filtered_components;
-
+ component_set<L> filtered_components;
{
mln::util::array<std::pair<box2d, std::pair<point2d, unsigned> > > attribs;
value::label_16 ncomponents;
L components = extract_components(input, ncomponents, attribs);
- filtered_components = Obj(components, ncomponents, attribs);
+ filtered_components = component_set<L>(components, ncomponents, attribs);
}
+ filtered_components = filter::objects_size_ratio(filtered_components,
+ conf.min_size_ratio);
+
/// linking potential components
mln::util::couple<object_links<L>, object_links<L> >
links = primitive::link::left_right(filtered_components);
@@ -325,8 +318,6 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm out.txt [max_dim_size] [
-
-
//Remove links if bboxes overlap too much.
object_links<L> overlap_filtered_links
= filter::object_links_bbox_overlap(hratio_filtered_links,
@@ -353,22 +344,26 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm out.txt [max_dim_size] [
// Grouping groups together if possible.
- groups = primitive::regroup::from_single_left_link(filtered_thin_groups,
- conf.regroup_dmax);
+ groups = regroup::from_single_left_link_wrt_h_ratio(filtered_thin_groups,
+ conf.regroup_dmax,
+ conf.bbox_h_ratio);
/// Filter grouped objects not having enough background components.
groups = scribo::filter::object_groups_with_holes(groups,
- conf.group_min_holes);
+ conf.group_min_holes);
component_set<L> comps = primitive::group::apply(groups);
- if (argc > 5)
+ if (argc > 6)
mln::io::ppm::save(mln::labeling::colorize(value::rgb8(),
comps.labeled_image(),
comps.nelements()),
- argv[5]);
+ argv[6]);
+// mln::io::ppm::save(scribo::debug::highlight_text_area_rotated(input_rgb,
+// comps, -45, rb),
+// argv[2]);
mln::io::ppm::save(scribo::debug::highlight_text_area(input_rgb, comps),
- argv[2]);
+ argv[2]);
scribo::line_set<L> lines = scribo::make::line_set(groups);
--
1.5.6.5
1
0
last-svn-commit-437-g5a13b71 Cleanup and make use of the new routines.
by Guillaume Lazzara 09 Aug '10
by Guillaume Lazzara 09 Aug '10
09 Aug '10
* src/text_in_picture.cc: Here.
---
scribo/ChangeLog | 6 ++
scribo/src/text_in_picture.cc | 122 ++++++++++++++++-------------------------
2 files changed, 53 insertions(+), 75 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 780a185..54a9d1c 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,11 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Cleanup and make use of the new routines.
+
+ * src/text_in_picture.cc: Here.
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Make use of the new component_set interface.
* filter/internal/compute.hh,
diff --git a/scribo/src/text_in_picture.cc b/scribo/src/text_in_picture.cc
index a7cf8d2..e7b8328 100644
--- a/scribo/src/text_in_picture.cc
+++ b/scribo/src/text_in_picture.cc
@@ -74,8 +74,8 @@
#include <scribo/primitive/group/from_single_link.hh>
#include <scribo/primitive/regroup/from_single_left_link.hh>
+// #include <scribo/primitive/regroup/from_single_left_link_wrt_h_ratio.hh>
-//#include <scribo/filter/objects_with_holes.hh>
#include <scribo/filter/object_groups_with_holes.hh>
#include <scribo/filter/object_links_bbox_h_ratio.hh>
@@ -87,6 +87,7 @@
#include <scribo/filter/object_groups_v_thickness.hh>
#include <scribo/debug/highlight_text_area.hh>
+#include <scribo/debug/text_areas_image.hh>
#include <scribo/debug/decision_image.hh>
#include <scribo/debug/save_bboxes_image.hh>
@@ -106,13 +107,9 @@
#include <scribo/src/afp/link.hh>
#include <scribo/src/afp/regroup.hh>
-// #include <scribo/core/line_set.hh>
-// #include <scribo/text/recognition.hh>
-// #include <scribo/text/merging.hh>
-
const char *args_desc[][2] =
{
- { "input.ppm", "A color image." },
+ { "input.*", "A color image." },
{ "ouput.ppm", "A color image where the text is highlighted." },
{ "debug_output_dir", "Directory were debug images will be saved" },
{ "lambda", "Lambda value used for foreground extraction" },
@@ -128,6 +125,8 @@ namespace mln
{
config()
{
+ max_dim_size = 1024;
+
sauvola_s = 2u; // 3?
sauvola_min_w = 51u;
@@ -140,6 +139,8 @@ namespace mln
group_min_holes = 3;
}
+ // Image resizing factor
+ unsigned max_dim_size;
// Sauvola ms
unsigned sauvola_s;
@@ -155,51 +156,16 @@ namespace mln
};
+} // end of namespace mln
+
+
+// Global config variable.
+mln::config conf;
+
- template <typename I, typename L>
- mln_concrete(I)
- compute_text_image(const I& input_rgb,
- const scribo::component_set<L>& grouped_objects)
- {
- unsigned shift = 5;
- float height = 1, width = 0;
- for_all_comps(i, grouped_objects)
- if (grouped_objects(i).is_valid())
- {
- height += grouped_objects(i).bbox().nrows() + shift;
- width = math::max(static_cast<float>(grouped_objects(i).bbox().ncols()),
- width);
- }
- if (width == 0)
- width = 1;
-
- I output(height, width);
- data::fill(output, literal::black);
-
- algebra::vec<2, float> dv;
- dv[0] = 0;
- dv[1] = 0;
- for_all_comps(i, grouped_objects)
- if (grouped_objects(i).is_valid())
- {
- mln_VAR(tmp, duplicate(input_rgb | grouped_objects(i).bbox()));
-
- typedef fun::x2x::translation<mln_site_(I)::dim, float> trans_t;
- trans_t trans(dv - grouped_objects(i).bbox().pmin().to_vec());
-
- mln_domain(I)
- tr_box(grouped_objects(i).bbox().pmin().to_vec() + trans.t(),
- grouped_objects(i).bbox().pmax().to_vec() + trans.t());
-
- tr_image<mln_domain(I), tmp_t, trans_t> tr_ima(tr_box, tmp, trans);
-
- data::paste(tr_ima, output);
- dv[0] += grouped_objects(i).bbox().nrows() + shift;
- }
-
- return output;
- }
+namespace mln
+{
template <typename I>
unsigned get_factor(const I& ima)
@@ -208,7 +174,7 @@ namespace mln
nrows = ima.nrows(),
ncols = ima.ncols(),
max_dim = std::max(nrows, ncols),
- factor = max_dim / 512;
+ factor = max_dim / conf.max_dim_size;
return factor ? factor : 1;
}
@@ -219,13 +185,20 @@ namespace mln
int main(int argc, char* argv[])
{
using namespace scribo;
+ using namespace scribo::primitive;
using namespace mln;
- if (argc < 3 || argc > 10)
+ if (argc < 3 || argc > 11)
return scribo::debug::usage(argv,
- "Find text in a photo.\n\n\
-Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
- "input.ppm output.ppm <bg/fg enabled> <sauvola_ms enabled> <Bg comp filter enabled> <small group filter enabled> <thin group filter enabled> [debug_output_dir] [lambda]",
+ "Find text in a photo.\n\n"
+ "Common usage: ./text_in_photo_fast input.*"
+ " output.ppm 1 1 1 1 1",
+ "input.ppm output.ppm <bg/fg enabled>"
+ " <sauvola_ms enabled> "
+ "<holes in group filter enabled> "
+ "<small group filter enabled> "
+ "<thin group filter enabled> "
+ "[debug_output_dir] [max_dim_size] [lambda]",
args_desc);
std::string out_base_dir;
@@ -239,11 +212,12 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
trace::entering("main");
- config conf;
-
image2d<value::rgb8> input_rgb;
io::magick::load(input_rgb, argv[1]);
+ if (argc >= 10)
+ conf.max_dim_size = atoi(argv[9]);
+
unsigned factor = get_factor(input_rgb);
std::cout << "Reduction Factor : " << factor << std::endl;
@@ -255,8 +229,8 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
std::cout << "Resized domain: " << input_rgb.domain() << std::endl;
unsigned lambda;
- if (argc == 10)
- lambda = atoi(argv[9]);
+ if (argc == 11)
+ lambda = atoi(argv[10]);
else
lambda = 1.2 * (input_rgb.nrows() + input_rgb.ncols());
@@ -360,7 +334,7 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
/// linking potential components
timer_.restart();
mln::util::couple<object_links<L>, object_links<L> >
- links = primitive::link::left_right(filtered_components);
+ links = link::left_right(filtered_components);
object_links<L>& left_link = links.first();
object_links<L>& right_link = links.second();
@@ -383,11 +357,11 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
{
std::cerr << "BEFORE - ncomponents = " << filtered_components.nelements() << std::endl;
scribo::debug::save_linked_bboxes_image(input,
- filtered_components,
left_link, right_link,
literal::red, literal::cyan,
literal::yellow,
literal::green,
+ anchor::MassCenter,
scribo::make::debug_filename("links.ppm"));
}
#endif
@@ -397,7 +371,7 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
// Validating left and right links.
timer_.restart();
object_links<L>
- merged_links = primitive::link::merge_double_link(left_link, right_link);
+ merged_links = link::merge_double_link(left_link, right_link);
t_ = timer_;
std::cout << "Right/Left Validation. " << t_ << std::endl;
@@ -454,14 +428,14 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
timer_.restart();
object_groups<L>
- groups = primitive::group::from_single_link(overlap_filtered_links);
+ groups = group::from_single_link(overlap_filtered_links);
// Apply grouping in a temporary image (for debug purpose).
#ifndef NOUT
component_set<L>
- raw_group_image = primitive::group::apply(groups);
+ raw_group_image = group::apply(groups);
#endif // !NOUT
t_ = timer_;
@@ -569,12 +543,15 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
g_timer.restart();
// Grouping groups together if possible.
- groups = primitive::regroup::from_single_left_link(filtered_thin_groups,
- conf.regroup_dmax);
+// filtered_thin_groups = regroup::from_single_left_link_wrt_h_ratio(filtered_thin_groups,
+// conf.regroup_dmax,
+// 1.60f);
+ filtered_thin_groups = regroup::from_single_left_link(filtered_thin_groups,
+ conf.regroup_dmax);
// component_set<L>
-// grouped_components = primitive::group::apply(groups);
+// grouped_components = group::apply(groups);
t_ = g_timer;
@@ -599,12 +576,14 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
{
std::cout << "** Using objects_with_two_holes" << std::endl;
- groups = scribo::filter::object_groups_with_holes(groups,
+ groups = scribo::filter::object_groups_with_holes(filtered_thin_groups,
conf.group_min_holes);
t_ = g_timer;
std::cout << "Objects_with_holes " << t_ << std::endl;
}
+ else
+ groups = filtered_thin_groups;
t_ = timer_;
@@ -639,7 +618,7 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
io::ppm::save(scribo::debug::highlight_text_area(input_rgb, comps),
out_base_dir + "_input_with_bboxes.ppm");
- io::ppm::save(compute_text_image(input_rgb, comps),
+ io::ppm::save(scribo::debug::text_areas_image(input_rgb, comps),
out_base_dir + "_out_text.ppm");
t_ = timer_;
@@ -647,13 +626,6 @@ Common usage: ./text_in_photo_fast input.ppm output.ppm 1 1 1 1 1",
std::cout << "# objects = " << comps.nelements() << std::endl;
-
-
-// scribo::line_set<L>
-// lines = scribo::make::line_set(groups);
-// lines = scribo::text::merging(lines);
-// text::recognition(lines, "fra", "out.txt");
-
trace::exiting("main");
return comps.nelements() != 0;
}
--
1.5.6.5
1
0
last-svn-commit-436-g8bd9126 Make use of the new component_set interface.
by Guillaume Lazzara 09 Aug '10
by Guillaume Lazzara 09 Aug '10
09 Aug '10
* filter/internal/compute.hh,
* filter/objects_small.hh,
* filter/objects_thick.hh,
* filter/objects_thin.hh,
* primitive/group/from_double_link.hh,
* primitive/link/compute_several.hh,
* table/align_lines_horizontaly.hh,
* table/erase.hh,
* table/extract.hh: Here.
---
scribo/ChangeLog | 14 ++++++++++++++
scribo/debug/decision_image.hh | 2 +-
scribo/filter/internal/compute.hh | 10 +++++-----
scribo/filter/objects_small.hh | 20 +++++---------------
scribo/filter/objects_thick.hh | 12 ++++++------
scribo/filter/objects_thin.hh | 23 ++++++++++++-----------
scribo/primitive/group/from_double_link.hh | 22 ++++++++++------------
scribo/primitive/link/compute_several.hh | 2 +-
scribo/table/align_lines_horizontaly.hh | 25 +++++++++++++++----------
scribo/table/erase.hh | 14 ++++++--------
scribo/table/extract.hh | 14 ++++++++------
11 files changed, 83 insertions(+), 75 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 4865134..780a185 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,19 @@
2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Make use of the new component_set interface.
+
+ * filter/internal/compute.hh,
+ * filter/objects_small.hh,
+ * filter/objects_thick.hh,
+ * filter/objects_thin.hh,
+ * primitive/group/from_double_link.hh,
+ * primitive/link/compute_several.hh,
+ * table/align_lines_horizontaly.hh,
+ * table/erase.hh,
+ * table/extract.hh: Here.
+
+2010-08-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Fix compilation of Scribo tools.
* src/debug/show_links_bbox_overlap.cc,
diff --git a/scribo/debug/decision_image.hh b/scribo/debug/decision_image.hh
index 1bf2643..aa1a188 100644
--- a/scribo/debug/decision_image.hh
+++ b/scribo/debug/decision_image.hh
@@ -104,7 +104,7 @@ namespace scribo
trace::entering("scribo::debug::decision_image");
const I& input = exact(input_);
- const component_set<L>& components = groups.object_image_();
+ const component_set<L>& components = groups.components();
mln_precondition(input.is_valid());
mln_precondition(groups.is_valid());
diff --git a/scribo/filter/internal/compute.hh b/scribo/filter/internal/compute.hh
index bd00eb6..7c87c5f 100644
--- a/scribo/filter/internal/compute.hh
+++ b/scribo/filter/internal/compute.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.
//
@@ -106,7 +107,7 @@ namespace scribo
component_set<lbl_t> components
= primitive::extract::components(input, nbh, nlabels);
- filter.update_components(components);
+ filter.update_objects(components);
components.relabel(filter);
mln_concrete(I) output = duplicate(input);
@@ -127,9 +128,8 @@ namespace scribo
mln_precondition(components.is_valid());
- component_set<L> output;
- output.init_from_(components);
- output.relabel(filter);
+ component_set<L> output = components.duplicate();
+ output.update_tags(filter, component::Ignored);
trace::exiting("scribo::filter::internal::compute");
return output;
diff --git a/scribo/filter/objects_small.hh b/scribo/filter/objects_small.hh
index f97a79e..ba9a50c 100644
--- a/scribo/filter/objects_small.hh
+++ b/scribo/filter/objects_small.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.
//
@@ -36,20 +37,12 @@
# include <mln/core/concept/function.hh>
# include <mln/core/image/dmorph/image_if.hh>
-# include <mln/labeling/blobs.hh>
-# include <mln/labeling/relabel.hh>
-
-# include <mln/make/relabelfun.hh>
+# include <mln/data/transform.hh>
# include <mln/util/array.hh>
# include <mln/pw/all.hh>
-# include <mln/accu/math/count.hh>
-
-# include <mln/set/compute.hh>
-
-
# include <scribo/core/component_set.hh>
# include <scribo/fun/v2b/objects_small_filter.hh>
# include <scribo/primitive/extract/components.hh>
@@ -120,11 +113,8 @@ namespace scribo
typedef fun::v2b::components_small_filter<mln_ch_value(I,V)> func_t;
func_t fv2b(lbl, min_size);
- lbl.relabel(fv2b);
-
- mln_concrete(I) output = duplicate(input);
- data::fill((output | (pw::value(lbl) == pw::cst(literal::zero))).rw(),
- false);
+ mln_concrete(I)
+ output = mln::data::transform(lbl.labeled_image(), fv2b);
trace::exiting("scribo::filter::components_small");
return output;
diff --git a/scribo/filter/objects_thick.hh b/scribo/filter/objects_thick.hh
index c933532..485092a 100644
--- a/scribo/filter/objects_thick.hh
+++ b/scribo/filter/objects_thick.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -111,8 +112,8 @@ namespace scribo
{
if (l == literal::zero)
return true;
- return components_.bbox(l).nrows() < max_thickness_
- && components_.bbox(l).ncols() < max_thickness_;
+ return components_(l).bbox().nrows() < max_thickness_
+ && components_(l).bbox().ncols() < max_thickness_;
}
@@ -173,9 +174,8 @@ namespace scribo
typedef internal::thick_object_filter<L> func_t;
func_t is_not_too_thick(components, max_thickness);
- component_set<L> output;
- output.init_from_(components);
- output.relabel(is_not_too_thick);
+ component_set<L> output = components.duplicate();
+ output.update_tags(is_not_too_thick, component::Ignored);
trace::exiting("scribo::filter::objects_thick");
return output;
diff --git a/scribo/filter/objects_thin.hh b/scribo/filter/objects_thin.hh
index c821b74..e8591d9 100644
--- a/scribo/filter/objects_thin.hh
+++ b/scribo/filter/objects_thin.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.
//
@@ -37,6 +38,8 @@
# include <mln/util/array.hh>
+# include <mln/data/transform.hh>
+
# include <scribo/core/component_set.hh>
# include <scribo/primitive/extract/components.hh>
# include <scribo/filter/internal/compute.hh>
@@ -111,8 +114,8 @@ namespace scribo
{
if (l == literal::zero)
return true;
- return components_.bbox(l).nrows() > min_thickness_
- && components_.bbox(l).ncols() > min_thickness_;
+ return components_(l).bbox().nrows() > min_thickness_
+ && components_(l).bbox().ncols() > min_thickness_;
}
/// Component bounding boxes.
@@ -145,16 +148,13 @@ namespace scribo
V nlabels;
typedef mln_ch_value(I,V) lbl_t;
- component_set<lbl_t> components
+ component_set<lbl_t> comps
= primitive::extract::components(input, nbh, nlabels);
typedef internal::components_thin_filter<lbl_t> func_t;
- func_t fv2b(components, min_thickness);
- components.relabel(fv2b);
-
- mln_concrete(I) output = duplicate(input);
- data::fill((output | (pw::value(components) == pw::cst(literal::zero))).rw(),
- false);
+ func_t fv2b(comps, min_thickness);
+ mln_concrete(I)
+ output = mln::data::transform(comps.labeled_image(), fv2b);
trace::exiting("scribo::filter::components_thin");
return output;
@@ -174,7 +174,8 @@ namespace scribo
typedef internal::components_thin_filter<L> func_t;
func_t is_not_too_thin(components, min_thickness);
- component_set<L> output = internal::compute(components, is_not_too_thin);
+ component_set<L> output = components.duplicate();
+ output.update_tags(is_not_too_thin, component::Ignored);
trace::exiting("scribo::filter::components_thin");
return output;
diff --git a/scribo/primitive/group/from_double_link.hh b/scribo/primitive/group/from_double_link.hh
index 9367cfa..3af395d 100644
--- a/scribo/primitive/group/from_double_link.hh
+++ b/scribo/primitive/group/from_double_link.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.
//
@@ -69,8 +70,7 @@ namespace scribo
*/
template <typename L>
object_groups<L>
- from_double_link(const component_set<L>& components,
- const object_links<L>& left_link,
+ from_double_link(const object_links<L>& left_link,
const object_links<L>& right_link);
@@ -81,19 +81,17 @@ namespace scribo
template <typename L>
inline
object_groups<L>
- from_double_link(const component_set<L>& components,
- const object_links<L>& left_link,
+ from_double_link(const object_links<L>& left_link,
const object_links<L>& right_link)
{
trace::entering("scribo::primitive::group::from_double_link");
mln_precondition(left_link.nelements() == right_link.nelements());
- mln_precondition(left_link.components_id_() == components.id_());
- mln_precondition(right_link.components_id_() == components.id_());
- object_groups<L> parent(components, left_link.nelements());
+
+ object_groups<L> parent(left_link);
parent.init();
- for_all_ncomponents(i, components.nlabels())
+ for_all_comps(i, left_link.components())
{
mln::util::couple<bool, unsigned>
nbh = internal::is_link_valid(left_link, right_link, i);
@@ -101,14 +99,14 @@ namespace scribo
{
unsigned par = internal::find_root(parent, nbh.second());
if (par < i)
- parent[par] = i;
+ parent(par) = i;
else
- parent[i] = par;
+ parent(i) = par;
}
}
for (unsigned i = parent.nelements() - 1; i < parent.nelements(); --i)
- parent[i] = parent[parent[i]];
+ parent(i) = parent(parent(i));
trace::exiting("scribo::primitive::group::from_double_link");
return parent;
diff --git a/scribo/primitive/link/compute_several.hh b/scribo/primitive/link/compute_several.hh
index 929a7cb..551b16c 100644
--- a/scribo/primitive/link/compute_several.hh
+++ b/scribo/primitive/link/compute_several.hh
@@ -95,7 +95,7 @@ namespace scribo
F& functor = exact(functor_);
- for_all_ncomponents(current_object, functor.objects().nlabels())
+ for_all_comps(current_object, functor.components())
{
functor.start_processing_object(current_object); //<-- start_processing_object
internal::find_several_links(functor, current_object);
diff --git a/scribo/table/align_lines_horizontaly.hh b/scribo/table/align_lines_horizontaly.hh
index cf776ae..25e4036 100644
--- a/scribo/table/align_lines_horizontaly.hh
+++ b/scribo/table/align_lines_horizontaly.hh
@@ -1,4 +1,5 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2009, 2010 EPITA Research and Development Laboratory
+// (LRDE)
//
// This file is part of Olena.
//
@@ -61,30 +62,34 @@ namespace scribo
///
/// \return A list of the resulting aligned rows. Each integer is actually
/// a row number.
- template <typename I>
+ template <typename I, typename L>
mln::util::array<int>
align_lines_horizontaly(const Image<I>& input,
- mln::util::array<box<mln_site(I)> >& line_bboxes,
+ const component_set<L>& lines,
+ component_set<L>& aligned_lines,
unsigned max_alignment_diff);
# ifndef MLN_INCLUDE_ONLY
- template <typename I>
+ template <typename I, typename L>
mln::util::array<int>
align_lines_horizontaly(const Image<I>& input,
- mln::util::array<box<mln_site(I)> >& line_bboxes,
+ const component_set<L>& lines,
+ component_set<L>& aligned_lines,
unsigned max_alignment_diff)
{
trace::entering("scribo::table::align_lines_horizontaly");
mln_precondition(exact(input).is_valid());
- mln::util::array<int> res = internal::align_lines(geom::nrows(input),
- geom::min_row(input),
- geom::max_row(input),
- line_bboxes, 0,
- max_alignment_diff);
+ mln::util::array<int>
+ res = internal::align_lines(geom::nrows(input),
+ geom::min_row(input),
+ geom::max_row(input),
+ lines,
+ aligned_lines, 0,
+ max_alignment_diff);
trace::exiting("scribo::table::align_lines_horizontaly");
return res;
diff --git a/scribo/table/erase.hh b/scribo/table/erase.hh
index a34e5a0..8cdf834 100644
--- a/scribo/table/erase.hh
+++ b/scribo/table/erase.hh
@@ -54,16 +54,16 @@ namespace scribo
///
/// \param[in] input A binary image from which the table lines
/// are extracted.
- /// \param[in] hlines An object image with horizontal lines.
- /// \param[in] vlines An object image with vertical lines.
+ /// \param[in] hlines A component set with horizontal lines.
+ /// \param[in] vlines A component set with vertical lines.
///
/// \return A copy of \p in where the table lines are removed.
//
template <typename I, typename L>
mln_concrete(I)
erase(const Image<I>& input,
- const Image<L>& hlines,
- const Image<L>& vlines);
+ const component_set<L>& hlines,
+ const component_set<L>& vlines);
# ifndef MLN_INCLUDE_ONLY
@@ -73,14 +73,12 @@ namespace scribo
inline
mln_concrete(I)
erase(const Image<I>& input,
- const Image<L>& hlines,
- const Image<L>& vlines)
+ const component_set<L>& hlines,
+ const component_set<L>& vlines)
{
trace::entering("scribo::internal::erase");
mlc_equal(mln_value(I),bool)::check();
mln_precondition(exact(input).is_valid());
- mln_precondition(exact(hlines).is_valid());
- mln_precondition(exact(vlines).is_valid());
I output = duplicate(input);
diff --git a/scribo/table/extract.hh b/scribo/table/extract.hh
index aca2321..49a7d50 100644
--- a/scribo/table/extract.hh
+++ b/scribo/table/extract.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.
//
@@ -90,9 +91,11 @@ namespace scribo
bvlines = scribo::primitive::extract::lines_v_pattern(input, 51, 3);
V nhlines, nvlines;
- object_image(mln_ch_value(I,V))
- hlines = scribo::primitive::extract::objects(bhlines, c8(), nhlines),
- vlines = scribo::primitive::extract::objects(bvlines, c8(), nvlines);
+ component_set<mln_ch_value(I,V)>
+ hlines = scribo::primitive::extract::components(bhlines, c8(),
+ nhlines),
+ vlines = scribo::primitive::extract::components(bvlines, c8(),
+ nvlines);
typedef mln::util::couple<mln_ch_value(I,V),
mln::util::couple<mln::util::array<box<mln_site(I)> >,
@@ -100,8 +103,7 @@ namespace scribo
tables_t;
tables_t tables
= scribo::table::rebuild(input,
- mln::make::couple(vlines.bboxes(), hlines.bboxes()),
- 30, ncells);
+ vlines, hlines, 30, ncells);
trace::exiting("scribo::table::extract");
return tables;
--
1.5.6.5
1
0