* src/text/Makefile.am,
* src/Makefile.am,
* src/filter/Makefile.am,
* src/table/Makefile.am,
* src/preprocessing/Makefile.am: Add new targets.
* src/dmap.cc,
* src/extract/Makefile.am,
* src/extract/Makefile.am,
* src/extract/primitive/Makefile.am,
* src/extract/primitive/Makefile.am,
* src/extract/primitive/extract_discontinued_hlines.cc,
* src/extract/primitive/extract_discontinued_lines.cc,
* src/extract/primitive/extract_discontinued_vlines.cc,
* src/extract/primitive/extract_thick_hlines.cc,
* src/extract/primitive/extract_thick_vlines.cc,
* src/extract/primitive/find_discontinued_lines.cc,
* src/extract/primitive/find_pattern_lines.cc,
* src/extract/primitive/find_single_lines.cc,
* src/extract/primitive/find_thick_and_single_lines.cc,
* src/extract/primitive/find_thick_lines.cc,
* src/filter/large_objects.cc,
* src/filter/small_objects.cc,
* src/filter/thick_objects.cc,
* src/filter/thin_objects.cc,
* src/morpho.cc,
* src/negate.cc,
* src/preprocess.cc,
* src/recognition.cc,
* src/rectangularity.cc,
* src/superpose.cc,
* src/table_rebuild_opening.cc,
* src/table_rebuild_rank.cc,
* src/text/grouping/Makefile.am,
* src/text/grouping/group_from_double_link.cc,
* src/text/grouping/group_from_double_link_filter_non_aligned.cc,
* src/text/grouping/group_from_double_several_links.cc,
* src/text/grouping/group_from_graph.cc,
* src/text/grouping/group_from_several_graph.cc,
* src/text/grouping/group_from_several_left_links.cc,
* src/text/grouping/group_from_single_link.cc: Move ...
* src/filter/objects_large.cc,
* src/filter/objects_small.cc,
* src/filter/objects_thick.cc,
* src/filter/objects_thin.cc,
* src/misc/Makefile.am,
* src/misc/dmap.cc,
* src/misc/morpho.cc,
* src/misc/negate.cc,
* src/misc/rectangularity.cc,
* src/misc/superpose.cc,
* src/preprocessing/preprocess.cc,
* src/primitive/Makefile.am,
* src/primitive/extract/Makefile.am,
* src/primitive/extract/extract_discontinued_hlines.cc,
* src/primitive/extract/extract_discontinued_lines.cc,
* src/primitive/extract/extract_discontinued_vlines.cc,
* src/primitive/extract/extract_thick_hlines.cc,
* src/primitive/extract/extract_thick_vlines.cc,
* src/primitive/find/Makefile.am,
* src/primitive/find/find_discontinued_lines.cc,
* src/primitive/find/find_pattern_lines.cc,
* src/primitive/find/find_single_lines.cc,
* src/primitive/find/find_thick_and_single_lines.cc,
* src/primitive/find/find_thick_lines.cc,
* src/primitive/group/Makefile.am,
* src/primitive/group/group_from_double_link.cc,
* src/primitive/group/group_from_double_link_filter_non_aligned.cc,
* src/primitive/group/group_from_double_several_links.cc,
* src/primitive/group/group_from_graph.cc,
* src/primitive/group/group_from_rag.cc,
* src/primitive/group/group_from_several_graph.cc,
* src/primitive/group/group_from_several_left_links.cc,
* src/primitive/group/group_from_single_link.cc,
* src/table/rebuild_opening.cc,
* src/table/rebuild_rank.cc,
* src/text/recognition.cc: ... here.
* src/table_old.cc: Remove.
---
scribo/ChangeLog | 85 ++++++++++++++++++++
scribo/src/Makefile.am | 44 +++-------
scribo/src/filter/Makefile.am | 16 ++--
.../filter/{large_objects.cc => objects_large.cc} | 0
.../filter/{small_objects.cc => objects_small.cc} | 0
.../filter/{thick_objects.cc => objects_thick.cc} | 0
.../filter/{thin_objects.cc => objects_thin.cc} | 0
scribo/src/{table => misc}/Makefile.am | 14 +++-
scribo/src/{ => misc}/dmap.cc | 0
scribo/src/{ => misc}/morpho.cc | 0
scribo/src/{ => misc}/negate.cc | 0
scribo/src/{ => misc}/rectangularity.cc | 0
scribo/src/{ => misc}/superpose.cc | 0
scribo/src/preprocessing/Makefile.am | 2 +
scribo/src/{ => preprocessing}/preprocess.cc | 0
scribo/src/{extract => primitive}/Makefile.am | 4 +-
.../primitive => primitive/extract}/Makefile.am | 13 +---
.../extract}/extract_discontinued_hlines.cc | 0
.../extract}/extract_discontinued_lines.cc | 0
.../extract}/extract_discontinued_vlines.cc | 0
.../extract}/extract_thick_hlines.cc | 0
.../extract}/extract_thick_vlines.cc | 0
.../primitive => primitive/find}/Makefile.am | 10 ---
.../find}/find_discontinued_lines.cc | 22 ++++-
.../find}/find_pattern_lines.cc | 4 +-
.../find}/find_single_lines.cc | 0
.../find}/find_thick_and_single_lines.cc | 0
.../find}/find_thick_lines.cc | 0
.../{text/grouping => primitive/group}/Makefile.am | 0
.../group}/group_from_double_link.cc | 0
.../group_from_double_link_filter_non_aligned.cc | 0
.../group}/group_from_double_several_links.cc | 0
.../group}/group_from_graph.cc | 0
.../grouping => primitive/group}/group_from_rag.cc | 0
.../group}/group_from_several_graph.cc | 0
.../group}/group_from_several_left_links.cc | 0
.../group}/group_from_single_link.cc | 0
scribo/src/table/Makefile.am | 8 ++-
.../rebuild_opening.cc} | 0
.../rebuild_rank.cc} | 0
scribo/src/table_old.cc | 63 ---------------
scribo/src/text/Makefile.am | 21 ++++-
scribo/src/{ => text}/recognition.cc | 0
scribo/src/thin_bboxes.cc | 66 ---------------
44 files changed, 166 insertions(+), 206 deletions(-)
rename scribo/src/filter/{large_objects.cc => objects_large.cc} (100%)
rename scribo/src/filter/{small_objects.cc => objects_small.cc} (100%)
rename scribo/src/filter/{thick_objects.cc => objects_thick.cc} (100%)
rename scribo/src/filter/{thin_objects.cc => objects_thin.cc} (100%)
copy scribo/src/{table => misc}/Makefile.am (74%)
rename scribo/src/{ => misc}/dmap.cc (100%)
rename scribo/src/{ => misc}/morpho.cc (100%)
rename scribo/src/{ => misc}/negate.cc (100%)
rename scribo/src/{ => misc}/rectangularity.cc (100%)
rename scribo/src/{ => misc}/superpose.cc (100%)
rename scribo/src/{ => preprocessing}/preprocess.cc (100%)
rename scribo/src/{extract => primitive}/Makefile.am (95%)
copy scribo/src/{extract/primitive => primitive/extract}/Makefile.am (73%)
rename scribo/src/{extract/primitive =>
primitive/extract}/extract_discontinued_hlines.cc (100%)
rename scribo/src/{extract/primitive =>
primitive/extract}/extract_discontinued_lines.cc (100%)
rename scribo/src/{extract/primitive =>
primitive/extract}/extract_discontinued_vlines.cc (100%)
rename scribo/src/{extract/primitive => primitive/extract}/extract_thick_hlines.cc
(100%)
rename scribo/src/{extract/primitive => primitive/extract}/extract_thick_vlines.cc
(100%)
rename scribo/src/{extract/primitive => primitive/find}/Makefile.am (71%)
rename scribo/src/{extract/primitive => primitive/find}/find_discontinued_lines.cc
(81%)
rename scribo/src/{extract/primitive => primitive/find}/find_pattern_lines.cc (98%)
rename scribo/src/{extract/primitive => primitive/find}/find_single_lines.cc (100%)
rename scribo/src/{extract/primitive => primitive/find}/find_thick_and_single_lines.cc
(100%)
rename scribo/src/{extract/primitive => primitive/find}/find_thick_lines.cc (100%)
rename scribo/src/{text/grouping => primitive/group}/Makefile.am (100%)
rename scribo/src/{text/grouping => primitive/group}/group_from_double_link.cc (100%)
rename scribo/src/{text/grouping =>
primitive/group}/group_from_double_link_filter_non_aligned.cc (100%)
rename scribo/src/{text/grouping =>
primitive/group}/group_from_double_several_links.cc (100%)
rename scribo/src/{text/grouping => primitive/group}/group_from_graph.cc (100%)
rename scribo/src/{text/grouping => primitive/group}/group_from_rag.cc (100%)
rename scribo/src/{text/grouping => primitive/group}/group_from_several_graph.cc
(100%)
rename scribo/src/{text/grouping => primitive/group}/group_from_several_left_links.cc
(100%)
rename scribo/src/{text/grouping => primitive/group}/group_from_single_link.cc (100%)
rename scribo/src/{table_rebuild_opening.cc => table/rebuild_opening.cc} (100%)
rename scribo/src/{table_rebuild_rank.cc => table/rebuild_rank.cc} (100%)
delete mode 100644 scribo/src/table_old.cc
rename scribo/src/{ => text}/recognition.cc (100%)
delete mode 100644 scribo/src/thin_bboxes.cc
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index ffd15fa..ff13b41 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,90 @@
2009-09-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+ Cleanup scribo/src directory.
+
+ * src/text/Makefile.am,
+ * src/Makefile.am,
+ * src/filter/Makefile.am,
+ * src/table/Makefile.am,
+ * src/preprocessing/Makefile.am: Add new targets.
+
+ * src/dmap.cc,
+ * src/extract/Makefile.am,
+ * src/extract/Makefile.am,
+ * src/extract/primitive/Makefile.am,
+ * src/extract/primitive/Makefile.am,
+ * src/extract/primitive/extract_discontinued_hlines.cc,
+ * src/extract/primitive/extract_discontinued_lines.cc,
+ * src/extract/primitive/extract_discontinued_vlines.cc,
+ * src/extract/primitive/extract_thick_hlines.cc,
+ * src/extract/primitive/extract_thick_vlines.cc,
+ * src/extract/primitive/find_discontinued_lines.cc,
+ * src/extract/primitive/find_pattern_lines.cc,
+ * src/extract/primitive/find_single_lines.cc,
+ * src/extract/primitive/find_thick_and_single_lines.cc,
+ * src/extract/primitive/find_thick_lines.cc,
+ * src/filter/large_objects.cc,
+ * src/filter/small_objects.cc,
+ * src/filter/thick_objects.cc,
+ * src/filter/thin_objects.cc,
+ * src/morpho.cc,
+ * src/negate.cc,
+ * src/preprocess.cc,
+ * src/recognition.cc,
+ * src/rectangularity.cc,
+ * src/superpose.cc,
+ * src/table_rebuild_opening.cc,
+ * src/table_rebuild_rank.cc,
+ * src/text/grouping/Makefile.am,
+ * src/text/grouping/group_from_double_link.cc,
+ * src/text/grouping/group_from_double_link_filter_non_aligned.cc,
+ * src/text/grouping/group_from_double_several_links.cc,
+ * src/text/grouping/group_from_graph.cc,
+ * src/text/grouping/group_from_several_graph.cc,
+ * src/text/grouping/group_from_several_left_links.cc,
+ * src/text/grouping/group_from_single_link.cc: Move ...
+
+ * src/filter/objects_large.cc,
+ * src/filter/objects_small.cc,
+ * src/filter/objects_thick.cc,
+ * src/filter/objects_thin.cc,
+ * src/misc/Makefile.am,
+ * src/misc/dmap.cc,
+ * src/misc/morpho.cc,
+ * src/misc/negate.cc,
+ * src/misc/rectangularity.cc,
+ * src/misc/superpose.cc,
+ * src/preprocessing/preprocess.cc,
+ * src/primitive/Makefile.am,
+ * src/primitive/extract/Makefile.am,
+ * src/primitive/extract/extract_discontinued_hlines.cc,
+ * src/primitive/extract/extract_discontinued_lines.cc,
+ * src/primitive/extract/extract_discontinued_vlines.cc,
+ * src/primitive/extract/extract_thick_hlines.cc,
+ * src/primitive/extract/extract_thick_vlines.cc,
+ * src/primitive/find/Makefile.am,
+ * src/primitive/find/find_discontinued_lines.cc,
+ * src/primitive/find/find_pattern_lines.cc,
+ * src/primitive/find/find_single_lines.cc,
+ * src/primitive/find/find_thick_and_single_lines.cc,
+ * src/primitive/find/find_thick_lines.cc,
+ * src/primitive/group/Makefile.am,
+ * src/primitive/group/group_from_double_link.cc,
+ * src/primitive/group/group_from_double_link_filter_non_aligned.cc,
+ * src/primitive/group/group_from_double_several_links.cc,
+ * src/primitive/group/group_from_graph.cc,
+ * src/primitive/group/group_from_rag.cc,
+ * src/primitive/group/group_from_several_graph.cc,
+ * src/primitive/group/group_from_several_left_links.cc,
+ * src/primitive/group/group_from_single_link.cc,
+ * src/table/rebuild_opening.cc,
+ * src/table/rebuild_rank.cc,
+ * src/text/recognition.cc: ... here.
+
+ * src/table_old.cc: Remove.
+
+2009-09-28 Guillaume Lazzara <lazzara(a)lrde.epita.fr>
+
Add new filters in Scribo.
* filter/objects_h_thin.hh,
diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am
index de051a4..aa82499 100644
--- a/scribo/src/Makefile.am
+++ b/scribo/src/Makefile.am
@@ -21,64 +21,48 @@ include $(top_srcdir)/scribo/scribo.mk
SUBDIRS = \
binarization \
- extract \
+ primitive \
filter \
+ misc \
+ multi_scale \
preprocessing \
table \
text
bin_PROGRAMS = \
- dmap \
- morpho \
- negate \
- preprocess \
- rectangularity \
- superpose \
- table_rebuild_opening \
- table_rebuild_rank \
text_in_photo \
text_in_photo_ppm \
- text_in_photo_invert \
- thin_bboxes
+ text_in_photo_invert
-dmap_SOURCES = dmap.cc
-morpho_SOURCES = morpho.cc
-negate_SOURCES = negate.cc
-preprocess_SOURCES = preprocess.cc
-rectangularity_SOURCES = rectangularity.cc
-superpose_SOURCES = superpose.cc
-table_rebuild_opening_SOURCES = table_rebuild_opening.cc
-table_rebuild_rank_SOURCES = table_rebuild_rank.cc
text_in_photo_SOURCES = text_in_photo.cc
text_in_photo_ppm_SOURCES = text_in_photo_ppm.cc
text_in_photo_invert_SOURCES = text_in_photo_invert.cc
-thin_bboxes_SOURCES = thin_bboxes.cc
if HAVE_TESSERACT
if HAVE_TIFF
- bin_PROGRAMS += recognition
- recognition_SOURCES = recognition.cc
- recognition_CPPFLAGS = $(AM_CPPFLAGS) \
+ bin_PROGRAMS += text_in_doc
+ text_in_doc_SOURCES = text_in_doc.cc
+ text_in_doc_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
$(TIFF_CPPFLAGS)
- recognition_LDFLAGS = $(AM_LDFLAGS) \
+ text_in_doc_LDFLAGS = $(AM_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
- -lpthread
+ -lpthread -lhpdf
- bin_PROGRAMS += text_in_doc
- text_in_doc_SOURCES = text_in_doc.cc
- text_in_doc_CPPFLAGS = $(AM_CPPFLAGS) \
+ bin_PROGRAMS += text_in_doc_ppm
+ text_in_doc_ppm_SOURCES = text_in_doc_ppm.cc
+ text_in_doc_ppm_CPPFLAGS = $(AM_CPPFLAGS) \
$(TESSERACT_CPPFLAGS) \
$(TIFF_CPPFLAGS)
- text_in_doc_LDFLAGS = $(AM_LDFLAGS) \
+ text_in_doc_ppm_LDFLAGS = $(AM_LDFLAGS) \
$(TESSERACT_LDFLAGS) \
$(TIFF_LDFLAGS) \
- -lpthread
+ -lpthread -lhpdf
endif HAVE_TIFF
endif HAVE_TESSERACT
diff --git a/scribo/src/filter/Makefile.am b/scribo/src/filter/Makefile.am
index 2a00108..e8a2b9c 100644
--- a/scribo/src/filter/Makefile.am
+++ b/scribo/src/filter/Makefile.am
@@ -20,12 +20,12 @@
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
- large_objects \
- small_objects \
- thick_objects \
- thin_objects
+ objects_large \
+ objects_small \
+ objects_thick \
+ objects_thin
-large_objects_SOURCES = large_objects.cc
-small_objects_SOURCES = small_objects.cc
-thick_objects_SOURCES = thick_objects.cc
-thin_objects_SOURCES = thin_objects.cc
+objects_large_SOURCES = objects_large.cc
+objects_small_SOURCES = objects_small.cc
+objects_thick_SOURCES = objects_thick.cc
+objects_thin_SOURCES = objects_thin.cc
diff --git a/scribo/src/filter/large_objects.cc b/scribo/src/filter/objects_large.cc
similarity index 100%
rename from scribo/src/filter/large_objects.cc
rename to scribo/src/filter/objects_large.cc
diff --git a/scribo/src/filter/small_objects.cc b/scribo/src/filter/objects_small.cc
similarity index 100%
rename from scribo/src/filter/small_objects.cc
rename to scribo/src/filter/objects_small.cc
diff --git a/scribo/src/filter/thick_objects.cc b/scribo/src/filter/objects_thick.cc
similarity index 100%
rename from scribo/src/filter/thick_objects.cc
rename to scribo/src/filter/objects_thick.cc
diff --git a/scribo/src/filter/thin_objects.cc b/scribo/src/filter/objects_thin.cc
similarity index 100%
rename from scribo/src/filter/thin_objects.cc
rename to scribo/src/filter/objects_thin.cc
diff --git a/scribo/src/table/Makefile.am b/scribo/src/misc/Makefile.am
similarity index 74%
copy from scribo/src/table/Makefile.am
copy to scribo/src/misc/Makefile.am
index f18880f..dc64bb9 100644
--- a/scribo/src/table/Makefile.am
+++ b/scribo/src/misc/Makefile.am
@@ -20,9 +20,15 @@
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
- erase \
- extract
+ dmap \
+ morpho \
+ negate \
+ rectangularity \
+ superpose
-erase_SOURCES = erase.cc
-extract_SOURCES = extract.cc
+dmap_SOURCES = dmap.cc
+morpho_SOURCES = morpho.cc
+negate_SOURCES = negate.cc
+rectangularity_SOURCES = rectangularity.cc
+superpose_SOURCES = superpose.cc
diff --git a/scribo/src/dmap.cc b/scribo/src/misc/dmap.cc
similarity index 100%
rename from scribo/src/dmap.cc
rename to scribo/src/misc/dmap.cc
diff --git a/scribo/src/morpho.cc b/scribo/src/misc/morpho.cc
similarity index 100%
rename from scribo/src/morpho.cc
rename to scribo/src/misc/morpho.cc
diff --git a/scribo/src/negate.cc b/scribo/src/misc/negate.cc
similarity index 100%
rename from scribo/src/negate.cc
rename to scribo/src/misc/negate.cc
diff --git a/scribo/src/rectangularity.cc b/scribo/src/misc/rectangularity.cc
similarity index 100%
rename from scribo/src/rectangularity.cc
rename to scribo/src/misc/rectangularity.cc
diff --git a/scribo/src/superpose.cc b/scribo/src/misc/superpose.cc
similarity index 100%
rename from scribo/src/superpose.cc
rename to scribo/src/misc/superpose.cc
diff --git a/scribo/src/preprocessing/Makefile.am b/scribo/src/preprocessing/Makefile.am
index af6db48..8c1cd80 100644
--- a/scribo/src/preprocessing/Makefile.am
+++ b/scribo/src/preprocessing/Makefile.am
@@ -20,8 +20,10 @@
include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
+ preprocess \
split_bg_fg \
unskew
+preprocess_SOURCES = preprocess.cc
split_bg_fg_SOURCES = split_bg_fg.cc
unskew_SOURCES = unskew.cc
diff --git a/scribo/src/preprocess.cc b/scribo/src/preprocessing/preprocess.cc
similarity index 100%
rename from scribo/src/preprocess.cc
rename to scribo/src/preprocessing/preprocess.cc
diff --git a/scribo/src/extract/Makefile.am b/scribo/src/primitive/Makefile.am
similarity index 95%
rename from scribo/src/extract/Makefile.am
rename to scribo/src/primitive/Makefile.am
index a11d464..44d9434 100644
--- a/scribo/src/extract/Makefile.am
+++ b/scribo/src/primitive/Makefile.am
@@ -20,4 +20,6 @@
include $(top_srcdir)/scribo/scribo.mk
SUBDIRS = \
- primitive
+ extract \
+ find \
+ group
diff --git a/scribo/src/extract/primitive/Makefile.am
b/scribo/src/primitive/extract/Makefile.am
similarity index 73%
copy from scribo/src/extract/primitive/Makefile.am
copy to scribo/src/primitive/extract/Makefile.am
index c4ebeaf..636abc3 100644
--- a/scribo/src/extract/primitive/Makefile.am
+++ b/scribo/src/primitive/extract/Makefile.am
@@ -25,22 +25,11 @@ bin_PROGRAMS = \
extract_discontinued_vlines \
extract_discontinued_hlines \
extract_thick_vlines \
- extract_thick_hlines \
- find_discontinued_lines \
- find_pattern_lines \
- find_single_lines \
- find_thick_lines \
- find_thick_and_single_lines
+ extract_thick_hlines
extract_discontinued_lines_SOURCES = extract_discontinued_lines.cc
extract_discontinued_vlines_SOURCES = extract_discontinued_vlines.cc
extract_discontinued_hlines_SOURCES = extract_discontinued_hlines.cc
extract_thick_vlines_SOURCES = extract_thick_vlines.cc
extract_thick_hlines_SOURCES = extract_thick_hlines.cc
-find_discontinued_lines_SOURCES = find_discontinued_lines.cc
-find_pattern_lines_SOURCES = find_pattern_lines.cc
-find_single_lines_SOURCES = find_single_lines.cc
-find_thick_lines_SOURCES = find_thick_lines.cc
-find_thick_and_single_lines_SOURCES = find_thick_and_single_lines.cc
-
diff --git a/scribo/src/extract/primitive/extract_discontinued_hlines.cc
b/scribo/src/primitive/extract/extract_discontinued_hlines.cc
similarity index 100%
rename from scribo/src/extract/primitive/extract_discontinued_hlines.cc
rename to scribo/src/primitive/extract/extract_discontinued_hlines.cc
diff --git a/scribo/src/extract/primitive/extract_discontinued_lines.cc
b/scribo/src/primitive/extract/extract_discontinued_lines.cc
similarity index 100%
rename from scribo/src/extract/primitive/extract_discontinued_lines.cc
rename to scribo/src/primitive/extract/extract_discontinued_lines.cc
diff --git a/scribo/src/extract/primitive/extract_discontinued_vlines.cc
b/scribo/src/primitive/extract/extract_discontinued_vlines.cc
similarity index 100%
rename from scribo/src/extract/primitive/extract_discontinued_vlines.cc
rename to scribo/src/primitive/extract/extract_discontinued_vlines.cc
diff --git a/scribo/src/extract/primitive/extract_thick_hlines.cc
b/scribo/src/primitive/extract/extract_thick_hlines.cc
similarity index 100%
rename from scribo/src/extract/primitive/extract_thick_hlines.cc
rename to scribo/src/primitive/extract/extract_thick_hlines.cc
diff --git a/scribo/src/extract/primitive/extract_thick_vlines.cc
b/scribo/src/primitive/extract/extract_thick_vlines.cc
similarity index 100%
rename from scribo/src/extract/primitive/extract_thick_vlines.cc
rename to scribo/src/primitive/extract/extract_thick_vlines.cc
diff --git a/scribo/src/extract/primitive/Makefile.am
b/scribo/src/primitive/find/Makefile.am
similarity index 71%
rename from scribo/src/extract/primitive/Makefile.am
rename to scribo/src/primitive/find/Makefile.am
index c4ebeaf..93a3920 100644
--- a/scribo/src/extract/primitive/Makefile.am
+++ b/scribo/src/primitive/find/Makefile.am
@@ -21,22 +21,12 @@ include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
- extract_discontinued_lines \
- extract_discontinued_vlines \
- extract_discontinued_hlines \
- extract_thick_vlines \
- extract_thick_hlines \
find_discontinued_lines \
find_pattern_lines \
find_single_lines \
find_thick_lines \
find_thick_and_single_lines
-extract_discontinued_lines_SOURCES = extract_discontinued_lines.cc
-extract_discontinued_vlines_SOURCES = extract_discontinued_vlines.cc
-extract_discontinued_hlines_SOURCES = extract_discontinued_hlines.cc
-extract_thick_vlines_SOURCES = extract_thick_vlines.cc
-extract_thick_hlines_SOURCES = extract_thick_hlines.cc
find_discontinued_lines_SOURCES = find_discontinued_lines.cc
find_pattern_lines_SOURCES = find_pattern_lines.cc
find_single_lines_SOURCES = find_single_lines.cc
diff --git a/scribo/src/extract/primitive/find_discontinued_lines.cc
b/scribo/src/primitive/find/find_discontinued_lines.cc
similarity index 81%
rename from scribo/src/extract/primitive/find_discontinued_lines.cc
rename to scribo/src/primitive/find/find_discontinued_lines.cc
index eaf2d59..1ed77e3 100644
--- a/scribo/src/extract/primitive/find_discontinued_lines.cc
+++ b/scribo/src/primitive/find/find_discontinued_lines.cc
@@ -35,8 +35,8 @@
#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>
+#include <scribo/primitive/extract/lines_h_discontinued.hh>
+#include <scribo/primitive/extract/lines_v_discontinued.hh>
const char *args_desc[][2] =
{
@@ -63,8 +63,22 @@ int main(int argc, char *argv[])
I input;
io::pbm::load(input, argv[1]);
- I hlines = scribo::primitive::extract::lines_h_pattern(input, atoi(argv[2]));
- I vlines = scribo::primitive::extract::lines_v_pattern(input, atoi(argv[2]));
+ value::label_16
+ nhlines,
+ nvlines;
+
+ typedef image2d<value::label_16> L;
+ object_image(L)
+ hlines = scribo::primitive::extract::lines_h_discontinued(input,
+ c8(),
+ nhlines,
+ atoi(argv[2]),
+ 8),
+ vlines = scribo::primitive::extract::lines_v_discontinued(input,
+ c8(),
+ nvlines,
+ atoi(argv[2]),
+ 8);
image2d<value::rgb8> out = debug::superpose(input, hlines, literal::red);
out = debug::superpose(out, vlines, literal::green);
diff --git a/scribo/src/extract/primitive/find_pattern_lines.cc
b/scribo/src/primitive/find/find_pattern_lines.cc
similarity index 98%
rename from scribo/src/extract/primitive/find_pattern_lines.cc
rename to scribo/src/primitive/find/find_pattern_lines.cc
index eaf2d59..3d8a98f 100644
--- a/scribo/src/extract/primitive/find_pattern_lines.cc
+++ b/scribo/src/primitive/find/find_pattern_lines.cc
@@ -63,8 +63,8 @@ int main(int argc, char *argv[])
I input;
io::pbm::load(input, argv[1]);
- I hlines = scribo::primitive::extract::lines_h_pattern(input, atoi(argv[2]));
- I vlines = scribo::primitive::extract::lines_v_pattern(input, atoi(argv[2]));
+ I hlines = scribo::primitive::extract::lines_h_pattern(input, atoi(argv[2]), 3);
+ I vlines = scribo::primitive::extract::lines_v_pattern(input, atoi(argv[2]), 3);
image2d<value::rgb8> out = debug::superpose(input, hlines, literal::red);
out = debug::superpose(out, vlines, literal::green);
diff --git a/scribo/src/extract/primitive/find_single_lines.cc
b/scribo/src/primitive/find/find_single_lines.cc
similarity index 100%
rename from scribo/src/extract/primitive/find_single_lines.cc
rename to scribo/src/primitive/find/find_single_lines.cc
diff --git a/scribo/src/extract/primitive/find_thick_and_single_lines.cc
b/scribo/src/primitive/find/find_thick_and_single_lines.cc
similarity index 100%
rename from scribo/src/extract/primitive/find_thick_and_single_lines.cc
rename to scribo/src/primitive/find/find_thick_and_single_lines.cc
diff --git a/scribo/src/extract/primitive/find_thick_lines.cc
b/scribo/src/primitive/find/find_thick_lines.cc
similarity index 100%
rename from scribo/src/extract/primitive/find_thick_lines.cc
rename to scribo/src/primitive/find/find_thick_lines.cc
diff --git a/scribo/src/text/grouping/Makefile.am
b/scribo/src/primitive/group/Makefile.am
similarity index 100%
rename from scribo/src/text/grouping/Makefile.am
rename to scribo/src/primitive/group/Makefile.am
diff --git a/scribo/src/text/grouping/group_from_double_link.cc
b/scribo/src/primitive/group/group_from_double_link.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_double_link.cc
rename to scribo/src/primitive/group/group_from_double_link.cc
diff --git a/scribo/src/text/grouping/group_from_double_link_filter_non_aligned.cc
b/scribo/src/primitive/group/group_from_double_link_filter_non_aligned.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_double_link_filter_non_aligned.cc
rename to scribo/src/primitive/group/group_from_double_link_filter_non_aligned.cc
diff --git a/scribo/src/text/grouping/group_from_double_several_links.cc
b/scribo/src/primitive/group/group_from_double_several_links.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_double_several_links.cc
rename to scribo/src/primitive/group/group_from_double_several_links.cc
diff --git a/scribo/src/text/grouping/group_from_graph.cc
b/scribo/src/primitive/group/group_from_graph.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_graph.cc
rename to scribo/src/primitive/group/group_from_graph.cc
diff --git a/scribo/src/text/grouping/group_from_rag.cc
b/scribo/src/primitive/group/group_from_rag.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_rag.cc
rename to scribo/src/primitive/group/group_from_rag.cc
diff --git a/scribo/src/text/grouping/group_from_several_graph.cc
b/scribo/src/primitive/group/group_from_several_graph.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_several_graph.cc
rename to scribo/src/primitive/group/group_from_several_graph.cc
diff --git a/scribo/src/text/grouping/group_from_several_left_links.cc
b/scribo/src/primitive/group/group_from_several_left_links.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_several_left_links.cc
rename to scribo/src/primitive/group/group_from_several_left_links.cc
diff --git a/scribo/src/text/grouping/group_from_single_link.cc
b/scribo/src/primitive/group/group_from_single_link.cc
similarity index 100%
rename from scribo/src/text/grouping/group_from_single_link.cc
rename to scribo/src/primitive/group/group_from_single_link.cc
diff --git a/scribo/src/table/Makefile.am b/scribo/src/table/Makefile.am
index f18880f..334d5f9 100644
--- a/scribo/src/table/Makefile.am
+++ b/scribo/src/table/Makefile.am
@@ -21,8 +21,12 @@ include $(top_srcdir)/scribo/scribo.mk
bin_PROGRAMS = \
erase \
- extract
+ extract \
+ rebuild_opening \
+ rebuild_rank
+
erase_SOURCES = erase.cc
extract_SOURCES = extract.cc
-
+rebuild_opening_SOURCES = rebuild_opening.cc
+rebuild_rank_SOURCES = rebuild_rank.cc
diff --git a/scribo/src/table_rebuild_opening.cc b/scribo/src/table/rebuild_opening.cc
similarity index 100%
rename from scribo/src/table_rebuild_opening.cc
rename to scribo/src/table/rebuild_opening.cc
diff --git a/scribo/src/table_rebuild_rank.cc b/scribo/src/table/rebuild_rank.cc
similarity index 100%
rename from scribo/src/table_rebuild_rank.cc
rename to scribo/src/table/rebuild_rank.cc
diff --git a/scribo/src/table_old.cc b/scribo/src/table_old.cc
deleted file mode 100644
index 29ec1ec..0000000
--- a/scribo/src/table_old.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (C) 2008, 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.
-
-#include "demat.old.hh"
-
-int main(int argc, char*argv[])
-{
- using namespace mln;
- using value::int_u8;
-
- if (argc < 2)
- {
- std::cout << argv[0] << " <in.pbm> <out.pgm> <l>
<bbox_larger> <bbox_distance> <min_comp_nsites>" <<
std::endl
- << std::endl << std::endl
- << std::endl
- << "=========="
- << std::endl << std::endl
- << "<in.pbm> B/W inverted input image."
- << std::endl << std::endl
-/* << "<out.ppm> RGB8 output image."
- << std::endl << std::endl
- << "<l> Line length"
- << std::endl << std::endl
- << "<bbox_distance> Maximum distance between character
bounding boxes. Used for bbox grouping."
- << std::endl << std::endl
- << "<min_comp_nsites> Minimum site count of a character/text
component."
- << std::endl
- << " If a component have a site count lesser than this value, it
is erased."
- << std::endl << std::endl
- << std::endl*/
- << "=========="
- << std::endl << std::endl
- << "HINT: compile with -DNOUT to avoid debug images."
- << std::endl << std::endl;
- return 1;
- }
-
- scribo::demat_table(argv);
-
- return 0;
-}
diff --git a/scribo/src/text/Makefile.am b/scribo/src/text/Makefile.am
index 6b174ef..b84e0dd 100644
--- a/scribo/src/text/Makefile.am
+++ b/scribo/src/text/Makefile.am
@@ -19,11 +19,24 @@
include $(top_srcdir)/scribo/scribo.mk
-SUBDIRS = grouping
-
-
bin_PROGRAMS = \
cleantxt
-cleantxt_SOURCES = cleantxt.cc
\ No newline at end of file
+cleantxt_SOURCES = cleantxt.cc
+
+
+if HAVE_TESSERACT
+if HAVE_TIFF
+
+ bin_PROGRAMS += recognition
+ recognition_SOURCES = recognition.cc
+ recognition_CPPFLAGS = $(AM_CPPFLAGS) \
+ $(TESSERACT_CPPFLAGS) \
+ $(TIFF_CPPFLAGS)
+ recognition_LDFLAGS = $(AM_LDFLAGS) \
+ $(TESSERACT_LDFLAGS) \
+ $(TIFF_LDFLAGS) \
+ -lpthread
+endif HAVE_TIFF
+endif HAVE_TESSERACT
diff --git a/scribo/src/recognition.cc b/scribo/src/text/recognition.cc
similarity index 100%
rename from scribo/src/recognition.cc
rename to scribo/src/text/recognition.cc
diff --git a/scribo/src/thin_bboxes.cc b/scribo/src/thin_bboxes.cc
deleted file mode 100644
index 39c658a..0000000
--- a/scribo/src/thin_bboxes.cc
+++ /dev/null
@@ -1,66 +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.
-
-#include <mln/core/image/image2d.hh>
-#include <mln/core/alias/neighb2d.hh>
-
-#include <mln/literal/colors.hh>
-
-#include <mln/value/label_16.hh>
-
-#include <mln/io/pbm/load.hh>
-
-
-#include <scribo/text/extract_lines.hh>
-#include <scribo/filter/objects_thin.hh>
-
-int usage(const char *name)
-{
- std::cout << "Usage: " << name << " <input.pbm>
" << std::endl;
- return 1;
-}
-
-int main(int argc, char *argv[])
-{
- using namespace mln;
-
- if (argc < 1)
- return usage(argv[0]);
-
- scribo::make::internal::debug_filename_prefix = "objects_thin";
-
- image2d<bool> input;
- io::pbm::load(input, argv[1]);
-
- value::label_16 nlines;
- typedef object_image(image2d<value::label_16>) text_t;
- text_t lines = scribo::text::extract_lines(input, c8(), nlines);
-
- text_t filtered_lines = scribo::filter::objects_thin(lines, 5);
-
- scribo::debug::save_bboxes_image(input, filtered_lines.bboxes(),
- literal::red,
- scribo::make::debug_filename("thickness_filter"));
-}
--
1.5.6.5