* binarization/sauvola.hh,
* debug/decision_image.hh,
* debug/save_linked_bboxes_image.hh,
* draw/bounding_box_links.hh,
* filter/object_links_bbox_overlap.hh: Add missing includes.
* src/text_in_photo_invert.cc: Update use of some routines.
* tests/unit_test/unit-tests.mk: Regen.
---
scribo/ChangeLog | 14 ++++++++++
scribo/binarization/sauvola.hh | 1 +
scribo/debug/decision_image.hh | 2 +
scribo/debug/save_linked_bboxes_image.hh | 1 +
scribo/draw/bounding_box_links.hh | 1 +
scribo/filter/object_links_bbox_overlap.hh | 2 +
scribo/src/text_in_photo_invert.cc | 38 ++++++++++++---------------
scribo/tests/unit_test/unit-tests.mk | 16 +++++++++++
8 files changed, 54 insertions(+), 21 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 7d541ff..e8bbe11 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,3 +1,17 @@
+2009-08-31 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
+ Fix compilation issues in Scribo.
+
+ * binarization/sauvola.hh,
+ * debug/decision_image.hh,
+ * debug/save_linked_bboxes_image.hh,
+ * draw/bounding_box_links.hh,
+ * filter/object_links_bbox_overlap.hh: Add missing includes.
+
+ * src/text_in_photo_invert.cc: Update use of some routines.
+
+ * tests/unit_test/unit-tests.mk: Regen.
+
2009-08-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
* tests/table/extract_lines_with_rank.cc: Fix a test in Scribo.
diff --git a/scribo/binarization/sauvola.hh b/scribo/binarization/sauvola.hh
index a726665..9b719e1 100644
--- a/scribo/binarization/sauvola.hh
+++ b/scribo/binarization/sauvola.hh
@@ -36,6 +36,7 @@
# include <mln/core/image/image2d.hh>
# include <mln/value/rgb8.hh>
# include <mln/value/int_u.hh>
+# include <mln/value/int_u8.hh>
# include <mln/data/transform.hh>
# include <mln/pw/all.hh>
diff --git a/scribo/debug/decision_image.hh b/scribo/debug/decision_image.hh
index 46fbcff..1652f8e 100644
--- a/scribo/debug/decision_image.hh
+++ b/scribo/debug/decision_image.hh
@@ -33,8 +33,10 @@
# include <mln/core/concept/image.hh>
# include <mln/data/convert.hh>
# include <mln/value/rgb8.hh>
+# include <mln/literal/colors.hh>
# include <mln/util/array.hh>
+# include <scribo/core/object_groups.hh>
# include <scribo/draw/bounding_boxes.hh>
diff --git a/scribo/debug/save_linked_bboxes_image.hh
b/scribo/debug/save_linked_bboxes_image.hh
index 6ce0ad0..364f06e 100644
--- a/scribo/debug/save_linked_bboxes_image.hh
+++ b/scribo/debug/save_linked_bboxes_image.hh
@@ -39,6 +39,7 @@
# include <mln/util/array.hh>
# include <mln/io/ppm/save.hh>
+# include <scribo/core/object_links.hh>
# include <scribo/core/object_image.hh>
# include <scribo/draw/bounding_boxes.hh>
# include <scribo/draw/bounding_box_links.hh>
diff --git a/scribo/draw/bounding_box_links.hh b/scribo/draw/bounding_box_links.hh
index 9a2919e..47a4f0a 100644
--- a/scribo/draw/bounding_box_links.hh
+++ b/scribo/draw/bounding_box_links.hh
@@ -36,6 +36,7 @@
# include <mln/canvas/browsing/depth_first_search.hh>
# include <scribo/core/macros.hh>
+# include <scribo/core/object_links.hh>
# include <scribo/primitive/internal/is_link_valid.hh>
namespace scribo
diff --git a/scribo/filter/object_links_bbox_overlap.hh
b/scribo/filter/object_links_bbox_overlap.hh
index ff65e92..83b5dfc 100644
--- a/scribo/filter/object_links_bbox_overlap.hh
+++ b/scribo/filter/object_links_bbox_overlap.hh
@@ -32,6 +32,8 @@
/// overlapping too much.
+# include <mln/math/min.hh>
+# include <mln/math/max.hh>
# include <mln/util/array.hh>
# include <scribo/core/macros.hh>
diff --git a/scribo/src/text_in_photo_invert.cc b/scribo/src/text_in_photo_invert.cc
index 81a0e91..71baee6 100644
--- a/scribo/src/text_in_photo_invert.cc
+++ b/scribo/src/text_in_photo_invert.cc
@@ -48,17 +48,22 @@
#include <mln/labeling/superpose.hh>
#include <scribo/primitive/extract/objects.hh>
-#include <scribo/primitive/group/apply.hh>
+
#include <scribo/primitive/link/with_single_left_link.hh>
#include <scribo/primitive/link/with_single_right_link.hh>
+
+#include <scribo/primitive/group/apply.hh>
#include <scribo/primitive/group/from_double_link.hh>
#include <scribo/primitive/group/from_single_link.hh>
+
#include <scribo/filter/objects_small.hh>
#include <scribo/filter/objects_thin.hh>
#include <scribo/filter/objects_thick.hh>
#include <scribo/filter/object_groups_small.hh>
#include <scribo/make/debug_filename.hh>
+
+#include <scribo/debug/decision_image.hh>
#include <scribo/debug/save_bboxes_image.hh>
#include <scribo/debug/save_linked_bboxes_image.hh>
@@ -129,28 +134,20 @@ namespace mln
groups = primitive::group::from_double_link(filtered_objects,
left_link, right_link);
- // Remove objects part of groups with less than 3 objects.
- util::array<bool>
- to_be_kept = filter::object_groups_small(groups, 3);
-
+ // Remove objects part of groups with strictly less than 3 objects.
+ object_groups<L> filtered_groups = filter::object_groups_small(groups, 3);
-
- // FOR DEBUGGING PURPOSE.
#ifndef NOUT
- image2d<value::rgb8> decision_image = data::convert(value::rgb8(), input);
-
-
- for (unsigned i = 1; i < to_be_kept.size(); ++i)
- {
- if (!to_be_kept(i))
- mln::draw::box(decision_image, filtered_objects.bbox(i), literal::red);
- else
- mln::draw::box(decision_image, filtered_objects.bbox(i), literal::green);
- }
-#endif // ! NOUT
+ image2d<value::rgb8>
+ decision_image = scribo::debug::decision_image(input,
+ groups, filtered_groups);
+#endif
- filtered_objects.relabel(to_be_kept);
+ /// Apply grouping in the object image.
+ object_image(L)
+ grouped_objects = primitive::group::apply(filtered_objects,
+ filtered_groups);
// Objects have been removed we need to update object links again.
@@ -164,8 +161,7 @@ namespace mln
// Grouping objects again.
groups = primitive::group::from_single_link(filtered_objects, left_link);
- object_image(L)
- grouped_objects = primitive::group::apply(filtered_objects, groups);
+ grouped_objects = primitive::group::apply(filtered_objects, groups);
#ifndef NOUT
for (unsigned i = 1; i <= grouped_objects.nlabels(); ++i)
diff --git a/scribo/tests/unit_test/unit-tests.mk b/scribo/tests/unit_test/unit-tests.mk
index 89c72d9..51a7da1 100644
--- a/scribo/tests/unit_test/unit-tests.mk
+++ b/scribo/tests/unit_test/unit-tests.mk
@@ -2,6 +2,7 @@
check_PROGRAMS = \
scribo_all \
+scribo_binarization_sauvola \
scribo_binarization_simple \
scribo_core_all \
scribo_core_central_sites \
@@ -11,6 +12,7 @@ scribo_core_object_groups \
scribo_core_object_image \
scribo_core_object_links \
scribo_debug_all \
+scribo_debug_decision_image \
scribo_debug_save_bboxes_image \
scribo_debug_save_label_image \
scribo_debug_save_linked_bboxes_image \
@@ -21,7 +23,13 @@ scribo_draw_bounding_box_links \
scribo_draw_bounding_boxes \
scribo_filter_all \
scribo_filter_object_groups_small \
+scribo_filter_object_links_bbox_h_ratio \
+scribo_filter_object_links_bbox_overlap \
+scribo_filter_object_links_bbox_ratio \
+scribo_filter_object_links_bbox_w_ratio \
+scribo_filter_object_links_bottom_aligned \
scribo_filter_object_links_non_aligned \
+scribo_filter_object_links_non_aligned_simple \
scribo_filter_object_links_non_h_aligned \
scribo_filter_object_links_non_v_aligned \
scribo_filter_objects_large \
@@ -96,6 +104,7 @@ scribo_util_all \
scribo_util_text
scribo_all_SOURCES = scribo_all.cc
+scribo_binarization_sauvola_SOURCES = scribo_binarization_sauvola.cc
scribo_binarization_simple_SOURCES = scribo_binarization_simple.cc
scribo_core_all_SOURCES = scribo_core_all.cc
scribo_core_central_sites_SOURCES = scribo_core_central_sites.cc
@@ -105,6 +114,7 @@ scribo_core_object_groups_SOURCES = scribo_core_object_groups.cc
scribo_core_object_image_SOURCES = scribo_core_object_image.cc
scribo_core_object_links_SOURCES = scribo_core_object_links.cc
scribo_debug_all_SOURCES = scribo_debug_all.cc
+scribo_debug_decision_image_SOURCES = scribo_debug_decision_image.cc
scribo_debug_save_bboxes_image_SOURCES = scribo_debug_save_bboxes_image.cc
scribo_debug_save_label_image_SOURCES = scribo_debug_save_label_image.cc
scribo_debug_save_linked_bboxes_image_SOURCES = scribo_debug_save_linked_bboxes_image.cc
@@ -115,7 +125,13 @@ scribo_draw_bounding_box_links_SOURCES =
scribo_draw_bounding_box_links.cc
scribo_draw_bounding_boxes_SOURCES = scribo_draw_bounding_boxes.cc
scribo_filter_all_SOURCES = scribo_filter_all.cc
scribo_filter_object_groups_small_SOURCES = scribo_filter_object_groups_small.cc
+scribo_filter_object_links_bbox_h_ratio_SOURCES =
scribo_filter_object_links_bbox_h_ratio.cc
+scribo_filter_object_links_bbox_overlap_SOURCES =
scribo_filter_object_links_bbox_overlap.cc
+scribo_filter_object_links_bbox_ratio_SOURCES = scribo_filter_object_links_bbox_ratio.cc
+scribo_filter_object_links_bbox_w_ratio_SOURCES =
scribo_filter_object_links_bbox_w_ratio.cc
+scribo_filter_object_links_bottom_aligned_SOURCES =
scribo_filter_object_links_bottom_aligned.cc
scribo_filter_object_links_non_aligned_SOURCES =
scribo_filter_object_links_non_aligned.cc
+scribo_filter_object_links_non_aligned_simple_SOURCES =
scribo_filter_object_links_non_aligned_simple.cc
scribo_filter_object_links_non_h_aligned_SOURCES =
scribo_filter_object_links_non_h_aligned.cc
scribo_filter_object_links_non_v_aligned_SOURCES =
scribo_filter_object_links_non_v_aligned.cc
scribo_filter_objects_large_SOURCES = scribo_filter_objects_large.cc
--
1.5.6.5