
--- milena/sandbox/ChangeLog | 253 ++++++++++++++ milena/sandbox/scribo/Makefile | 65 ---- milena/sandbox/scribo/scribo.mk | 5 - scribo/Doxyfile | 346 ++++++++++++++++++++ scribo/Doxyfile_tex | 346 ++++++++++++++++++++ {milena/sandbox/scribo => scribo}/Makefile.am | 0 {milena/sandbox/scribo => scribo}/all.hh | 0 .../scribo => scribo}/binarization/simple.hh | 0 {milena/sandbox/scribo => scribo}/core/all.hh | 0 .../scribo => scribo}/core/central_sites.hh | 0 .../scribo => scribo}/core/component_bboxes.hh | 0 .../sandbox/scribo => scribo}/core/erase_bboxes.hh | 0 {milena/sandbox/scribo => scribo}/core/macros.hh | 0 {milena/sandbox/scribo => scribo}/debug/all.hh | 0 .../scribo => scribo}/debug/save_label_image.hh | 0 .../debug/save_linked_textbboxes_image.hh | 0 .../scribo => scribo}/debug/save_table_image.hh | 0 .../debug/save_textbboxes_image.hh | 0 {milena/sandbox/scribo => scribo}/demat.hh | 0 {milena/sandbox/scribo => scribo}/draw/all.hh | 0 .../scribo => scribo}/draw/bounding_box_links.hh | 0 .../scribo => scribo}/draw/bounding_boxes.hh | 0 .../scribo => scribo}/extract/primitive/canvas.hh | 0 .../scribo => scribo}/extract/primitive/cells.hh | 0 .../extract/primitive/lines_discontinued.hh | 0 .../extract/primitive/lines_h_discontinued.hh | 0 .../extract/primitive/lines_thick.hh | 0 .../extract/primitive/lines_v_discontinued.hh | 0 .../scribo => scribo}/extract/primitive/objects.hh | 0 {milena/sandbox/scribo => scribo}/filter/all.hh | 0 .../scribo => scribo}/filter/large_components.hh | 12 +- .../scribo => scribo}/filter/small_components.hh | 39 +-- .../scribo => scribo}/filter/thick_bboxes.hh | 11 +- .../scribo => scribo}/filter/thin_bboxes.hh | 15 +- {milena/sandbox/scribo => scribo}/make/all.hh | 0 .../scribo => scribo}/make/debug_filename.hh | 0 .../scribo => scribo}/make/influence_zone_graph.hh | 0 {milena/sandbox/scribo => scribo}/make/text.hh | 63 ++-- .../sandbox/scribo => scribo}/preprocessing/all.hh | 0 .../scribo => scribo}/preprocessing/unskew.hh | 0 scribo/scribo.mk | 5 + {milena/sandbox/scribo => scribo}/src/Makefile.am | 0 .../scribo => scribo}/src/binarization/Makefile.am | 0 .../scribo => scribo}/src/binarization/simple.cc | 0 {milena/sandbox/scribo => scribo}/src/dmap.cc | 0 .../src/extract_text_double_link.cc | 6 +- .../src/extract_text_double_several_links.cc | 0 .../scribo => scribo}/src/extract_text_graph.cc | 10 +- .../src/extract_text_several_graph.cc | 0 .../src/extract_text_several_left_links.cc | 0 .../src/extract_text_single_link.cc | 0 {milena/sandbox/scribo => scribo}/src/morpho.cc | 0 {milena/sandbox/scribo => scribo}/src/photo.cc | 0 .../sandbox/scribo => scribo}/src/photo_basic.cc | 0 .../src/recognition.cc | 85 ++--- .../scribo => scribo}/src/rectangularity.cc | 0 {milena/sandbox/scribo => scribo}/src/table.cc | 0 .../sandbox/scribo => scribo}/src/table_erase.cc | 19 +- .../sandbox/scribo => scribo}/src/table_extract.cc | 0 .../scribo/src/table.cc => scribo/src/table_old.cc | 2 +- .../scribo => scribo}/src/table_rebuild_opening.cc | 0 .../scribo => scribo}/src/table_rebuild_rank.cc | 0 .../sandbox/scribo => scribo}/src/thin_bboxes.cc | 0 .../table/align_lines_horizontaly.hh | 0 .../table/align_lines_verticaly.hh | 0 {milena/sandbox/scribo => scribo}/table/all.hh | 0 .../table/connect_horizontal_lines.hh | 0 .../table/connect_vertical_lines.hh | 0 {milena/sandbox/scribo => scribo}/table/erase.hh | 0 {milena/sandbox/scribo => scribo}/table/extract.hh | 0 .../table/extract_lines_with_opening.hh | 0 .../table/extract_lines_with_rank.hh | 0 .../table/internal/align_lines.hh | 3 + .../scribo => scribo}/table/internal/all.hh | 0 .../table/internal/connect_lines.hh | 0 .../table/internal/repair_lines.hh | 19 +- {milena/sandbox/scribo => scribo}/table/rebuild.hh | 6 +- .../table/repair_horizontal_lines.hh | 0 .../table/repair_vertical_lines.hh | 0 scribo/test.cc | 18 + .../sandbox/scribo => scribo}/tests/Makefile.am | 0 {milena/sandbox/scribo => scribo}/tests/data.hh.in | 2 +- .../scribo => scribo}/tests/filter/Makefile.am | 2 +- .../tests/filter/small_and_large_bboxes.cc | 0 .../scribo => scribo}/tests/table/Makefile.am | 2 +- .../tests/table/extract_lines_with_rank.cc | 31 +- .../scribo => scribo}/tests/table/repair_lines.cc | 0 .../scribo => scribo}/tests/text/Makefile.am | 2 +- {milena/sandbox/scribo => scribo}/text/all.hh | 0 scribo/text/clean.hh | 109 ++++++ .../scribo => scribo}/text/extract_bboxes.hh | 0 .../scribo => scribo}/text/extract_lines.hh | 0 .../sandbox/scribo => scribo}/text/grouping/all.hh | 0 .../text/grouping/group_from_double_link.hh | 33 +-- .../text/grouping/group_from_graph.hh | 47 ++-- .../text/grouping/group_from_single_link.hh | 0 .../text/grouping/group_with_graph.hh | 1 + .../text/grouping/group_with_several_graphes.hh | 0 .../text/grouping/group_with_several_left_links.hh | 0 .../grouping/group_with_several_right_links.hh | 0 .../text/grouping/group_with_single_left_link.hh | 0 .../text/grouping/group_with_single_right_link.hh | 0 .../text/grouping/internal/all.hh | 0 .../text/grouping/internal/find_graph_link.hh | 0 .../text/grouping/internal/find_left_link.hh | 0 .../text/grouping/internal/find_right_link.hh | 0 .../text/grouping/internal/find_root.hh | 0 .../text/grouping/internal/init_link_array.hh | 0 .../text/grouping/internal/is_link_valid.hh | 0 .../text/grouping/internal/update_graph_link.hh | 0 .../text/grouping/internal/update_link_array.hh | 0 .../sandbox/scribo => scribo}/text/recognition.hh | 86 ++++-- {milena/sandbox/scribo => scribo}/util/all.hh | 0 {milena/sandbox/scribo => scribo}/util/text.hh | 29 ++- 114 files changed, 1367 insertions(+), 305 deletions(-) delete mode 100644 milena/sandbox/scribo/Makefile delete mode 100644 milena/sandbox/scribo/scribo.mk create mode 100644 scribo/Doxyfile create mode 100644 scribo/Doxyfile_tex rename {milena/sandbox/scribo => scribo}/Makefile.am (100%) rename {milena/sandbox/scribo => scribo}/all.hh (100%) rename {milena/sandbox/scribo => scribo}/binarization/simple.hh (100%) rename {milena/sandbox/scribo => scribo}/core/all.hh (100%) rename {milena/sandbox/scribo => scribo}/core/central_sites.hh (100%) rename {milena/sandbox/scribo => scribo}/core/component_bboxes.hh (100%) rename {milena/sandbox/scribo => scribo}/core/erase_bboxes.hh (100%) rename {milena/sandbox/scribo => scribo}/core/macros.hh (100%) rename {milena/sandbox/scribo => scribo}/debug/all.hh (100%) rename {milena/sandbox/scribo => scribo}/debug/save_label_image.hh (100%) rename {milena/sandbox/scribo => scribo}/debug/save_linked_textbboxes_image.hh (100%) rename {milena/sandbox/scribo => scribo}/debug/save_table_image.hh (100%) rename {milena/sandbox/scribo => scribo}/debug/save_textbboxes_image.hh (100%) rename {milena/sandbox/scribo => scribo}/demat.hh (100%) rename {milena/sandbox/scribo => scribo}/draw/all.hh (100%) rename {milena/sandbox/scribo => scribo}/draw/bounding_box_links.hh (100%) rename {milena/sandbox/scribo => scribo}/draw/bounding_boxes.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/canvas.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/cells.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/lines_discontinued.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/lines_h_discontinued.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/lines_thick.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/lines_v_discontinued.hh (100%) rename {milena/sandbox/scribo => scribo}/extract/primitive/objects.hh (100%) rename {milena/sandbox/scribo => scribo}/filter/all.hh (100%) rename {milena/sandbox/scribo => scribo}/filter/large_components.hh (94%) rename {milena/sandbox/scribo => scribo}/filter/small_components.hh (86%) rename {milena/sandbox/scribo => scribo}/filter/thick_bboxes.hh (95%) rename {milena/sandbox/scribo => scribo}/filter/thin_bboxes.hh (91%) rename {milena/sandbox/scribo => scribo}/make/all.hh (100%) rename {milena/sandbox/scribo => scribo}/make/debug_filename.hh (100%) rename {milena/sandbox/scribo => scribo}/make/influence_zone_graph.hh (100%) rename {milena/sandbox/scribo => scribo}/make/text.hh (77%) rename {milena/sandbox/scribo => scribo}/preprocessing/all.hh (100%) rename {milena/sandbox/scribo => scribo}/preprocessing/unskew.hh (100%) create mode 100644 scribo/scribo.mk rename {milena/sandbox/scribo => scribo}/src/Makefile.am (100%) rename {milena/sandbox/scribo => scribo}/src/binarization/Makefile.am (100%) rename {milena/sandbox/scribo => scribo}/src/binarization/simple.cc (100%) rename {milena/sandbox/scribo => scribo}/src/dmap.cc (100%) rename {milena/sandbox/scribo => scribo}/src/extract_text_double_link.cc (96%) copy {milena/sandbox/scribo => scribo}/src/extract_text_double_several_links.cc (100%) rename {milena/sandbox/scribo => scribo}/src/extract_text_graph.cc (91%) rename {milena/sandbox/scribo => scribo}/src/extract_text_several_graph.cc (100%) rename {milena/sandbox/scribo => scribo}/src/extract_text_several_left_links.cc (100%) rename {milena/sandbox/scribo => scribo}/src/extract_text_single_link.cc (100%) rename {milena/sandbox/scribo => scribo}/src/morpho.cc (100%) rename {milena/sandbox/scribo => scribo}/src/photo.cc (100%) rename {milena/sandbox/scribo => scribo}/src/photo_basic.cc (100%) rename milena/sandbox/scribo/src/extract_text_double_several_links.cc => scribo/src/recognition.cc (56%) rename {milena/sandbox/scribo => scribo}/src/rectangularity.cc (100%) copy {milena/sandbox/scribo => scribo}/src/table.cc (100%) rename {milena/sandbox/scribo => scribo}/src/table_erase.cc (78%) rename {milena/sandbox/scribo => scribo}/src/table_extract.cc (100%) rename milena/sandbox/scribo/src/table.cc => scribo/src/table_old.cc (99%) rename {milena/sandbox/scribo => scribo}/src/table_rebuild_opening.cc (100%) rename {milena/sandbox/scribo => scribo}/src/table_rebuild_rank.cc (100%) rename {milena/sandbox/scribo => scribo}/src/thin_bboxes.cc (100%) rename {milena/sandbox/scribo => scribo}/table/align_lines_horizontaly.hh (100%) rename {milena/sandbox/scribo => scribo}/table/align_lines_verticaly.hh (100%) rename {milena/sandbox/scribo => scribo}/table/all.hh (100%) rename {milena/sandbox/scribo => scribo}/table/connect_horizontal_lines.hh (100%) rename {milena/sandbox/scribo => scribo}/table/connect_vertical_lines.hh (100%) rename {milena/sandbox/scribo => scribo}/table/erase.hh (100%) rename {milena/sandbox/scribo => scribo}/table/extract.hh (100%) rename {milena/sandbox/scribo => scribo}/table/extract_lines_with_opening.hh (100%) rename {milena/sandbox/scribo => scribo}/table/extract_lines_with_rank.hh (100%) rename {milena/sandbox/scribo => scribo}/table/internal/align_lines.hh (99%) rename {milena/sandbox/scribo => scribo}/table/internal/all.hh (100%) rename {milena/sandbox/scribo => scribo}/table/internal/connect_lines.hh (100%) rename {milena/sandbox/scribo => scribo}/table/internal/repair_lines.hh (95%) rename {milena/sandbox/scribo => scribo}/table/rebuild.hh (96%) rename {milena/sandbox/scribo => scribo}/table/repair_horizontal_lines.hh (100%) rename {milena/sandbox/scribo => scribo}/table/repair_vertical_lines.hh (100%) create mode 100644 scribo/test.cc rename {milena/sandbox/scribo => scribo}/tests/Makefile.am (100%) rename {milena/sandbox/scribo => scribo}/tests/data.hh.in (95%) rename {milena/sandbox/scribo => scribo}/tests/filter/Makefile.am (78%) rename {milena/sandbox/scribo => scribo}/tests/filter/small_and_large_bboxes.cc (100%) rename {milena/sandbox/scribo => scribo}/tests/table/Makefile.am (82%) rename {milena/sandbox/scribo => scribo}/tests/table/extract_lines_with_rank.cc (72%) rename {milena/sandbox/scribo => scribo}/tests/table/repair_lines.cc (100%) rename {milena/sandbox/scribo => scribo}/tests/text/Makefile.am (66%) rename {milena/sandbox/scribo => scribo}/text/all.hh (100%) create mode 100644 scribo/text/clean.hh rename {milena/sandbox/scribo => scribo}/text/extract_bboxes.hh (100%) rename {milena/sandbox/scribo => scribo}/text/extract_lines.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/all.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_from_double_link.hh (85%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_from_graph.hh (84%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_from_single_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_with_graph.hh (99%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_with_several_graphes.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_with_several_left_links.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_with_several_right_links.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_with_single_left_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/group_with_single_right_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/all.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/find_graph_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/find_left_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/find_right_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/find_root.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/init_link_array.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/is_link_valid.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/update_graph_link.hh (100%) rename {milena/sandbox/scribo => scribo}/text/grouping/internal/update_link_array.hh (100%) rename {milena/sandbox/scribo => scribo}/text/recognition.hh (65%) rename {milena/sandbox/scribo => scribo}/util/all.hh (100%) rename {milena/sandbox/scribo => scribo}/util/text.hh (94%) diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog index 4ae194b..0bbd9e6 100644 --- a/milena/sandbox/ChangeLog +++ b/milena/sandbox/ChangeLog @@ -1,3 +1,256 @@ +2009-05-18 Guillaume Lazzara <lazzara@lrde.epita.fr> + + Move Scribo from sandbox to the root directory. + + * milena/sandbox/scribo/Makefile, + * milena/sandbox/scribo/Makefile.am, + * milena/sandbox/scribo/all.hh, + * milena/sandbox/scribo/binarization/simple.hh, + * milena/sandbox/scribo/core/all.hh, + * milena/sandbox/scribo/core/central_sites.hh, + * milena/sandbox/scribo/core/component_bboxes.hh, + * milena/sandbox/scribo/core/erase_bboxes.hh, + * milena/sandbox/scribo/core/macros.hh, + * milena/sandbox/scribo/debug/all.hh, + * milena/sandbox/scribo/debug/save_label_image.hh, + * milena/sandbox/scribo/debug/save_linked_textbboxes_image.hh, + * milena/sandbox/scribo/debug/save_table_image.hh, + * milena/sandbox/scribo/debug/save_textbboxes_image.hh, + * milena/sandbox/scribo/demat.hh, + * milena/sandbox/scribo/draw/all.hh, + * milena/sandbox/scribo/draw/bounding_box_links.hh, + * milena/sandbox/scribo/draw/bounding_boxes.hh, + * milena/sandbox/scribo/extract/primitive/canvas.hh, + * milena/sandbox/scribo/extract/primitive/cells.hh, + * milena/sandbox/scribo/extract/primitive/lines_discontinued.hh, + * milena/sandbox/scribo/extract/primitive/lines_h_discontinued.hh, + * milena/sandbox/scribo/extract/primitive/lines_thick.hh, + * milena/sandbox/scribo/extract/primitive/lines_v_discontinued.hh, + * milena/sandbox/scribo/extract/primitive/objects.hh, + * milena/sandbox/scribo/filter/all.hh, + * milena/sandbox/scribo/filter/large_components.hh, + * milena/sandbox/scribo/filter/small_components.hh, + * milena/sandbox/scribo/filter/thick_bboxes.hh, + * milena/sandbox/scribo/filter/thin_bboxes.hh, + * milena/sandbox/scribo/make/all.hh, + * milena/sandbox/scribo/make/debug_filename.hh, + * milena/sandbox/scribo/make/influence_zone_graph.hh, + * milena/sandbox/scribo/make/text.hh, + * milena/sandbox/scribo/preprocessing/all.hh, + * milena/sandbox/scribo/preprocessing/unskew.hh, + * milena/sandbox/scribo/scribo.mk, + * milena/sandbox/scribo/src/Makefile.am, + * milena/sandbox/scribo/src/binarization/Makefile.am, + * milena/sandbox/scribo/src/binarization/simple.cc, + * milena/sandbox/scribo/src/dmap.cc, + * milena/sandbox/scribo/src/extract_text_double_link.cc, + * milena/sandbox/scribo/src/extract_text_double_several_links.cc, + * milena/sandbox/scribo/src/extract_text_graph.cc, + * milena/sandbox/scribo/src/extract_text_several_graph.cc, + * milena/sandbox/scribo/src/extract_text_several_left_links.cc, + * milena/sandbox/scribo/src/extract_text_single_link.cc, + * milena/sandbox/scribo/src/morpho.cc, + * milena/sandbox/scribo/src/photo.cc, + * milena/sandbox/scribo/src/photo_basic.cc, + * milena/sandbox/scribo/src/rectangularity.cc, + * milena/sandbox/scribo/src/table.cc, + * milena/sandbox/scribo/src/table_erase.cc, + * milena/sandbox/scribo/src/table_extract.cc, + * milena/sandbox/scribo/src/table_rebuild_opening.cc, + * milena/sandbox/scribo/src/table_rebuild_rank.cc, + * milena/sandbox/scribo/src/thin_bboxes.cc, + * milena/sandbox/scribo/table/align_lines_horizontaly.hh, + * milena/sandbox/scribo/table/align_lines_verticaly.hh, + * milena/sandbox/scribo/table/all.hh, + * milena/sandbox/scribo/table/connect_horizontal_lines.hh, + * milena/sandbox/scribo/table/connect_vertical_lines.hh, + * milena/sandbox/scribo/table/erase.hh, + * milena/sandbox/scribo/table/extract.hh, + * milena/sandbox/scribo/table/extract_lines_with_opening.hh, + * milena/sandbox/scribo/table/extract_lines_with_rank.hh, + * milena/sandbox/scribo/table/internal/align_lines.hh, + * milena/sandbox/scribo/table/internal/all.hh, + * milena/sandbox/scribo/table/internal/connect_lines.hh, + * milena/sandbox/scribo/table/internal/repair_lines.hh, + * milena/sandbox/scribo/table/rebuild.hh, + * milena/sandbox/scribo/table/repair_horizontal_lines.hh, + * milena/sandbox/scribo/table/repair_vertical_lines.hh, + * milena/sandbox/scribo/tests/Makefile.am, + * milena/sandbox/scribo/tests/data.hh.in, + * milena/sandbox/scribo/tests/filter/Makefile.am, + * milena/sandbox/scribo/tests/filter/small_and_large_bboxes.cc, + * milena/sandbox/scribo/tests/table/Makefile.am, + * milena/sandbox/scribo/tests/table/extract_lines_with_rank.cc, + * milena/sandbox/scribo/tests/table/repair_lines.cc, + * milena/sandbox/scribo/tests/text/Makefile.am, + * milena/sandbox/scribo/text/all.hh, + * milena/sandbox/scribo/text/extract_bboxes.hh, + * milena/sandbox/scribo/text/extract_lines.hh, + * milena/sandbox/scribo/text/grouping/all.hh, + * milena/sandbox/scribo/text/grouping/group_from_double_link.hh, + * milena/sandbox/scribo/text/grouping/group_from_graph.hh, + * milena/sandbox/scribo/text/grouping/group_from_single_link.hh, + * milena/sandbox/scribo/text/grouping/group_with_graph.hh, + * milena/sandbox/scribo/text/grouping/group_with_several_graphes.hh, + * milena/sandbox/scribo/text/grouping/group_with_several_left_links.hh, + * milena/sandbox/scribo/text/grouping/group_with_several_right_links.hh, + * milena/sandbox/scribo/text/grouping/group_with_single_left_link.hh, + * milena/sandbox/scribo/text/grouping/group_with_single_right_link.hh, + * milena/sandbox/scribo/text/grouping/internal/all.hh, + * milena/sandbox/scribo/text/grouping/internal/find_graph_link.hh, + * milena/sandbox/scribo/text/grouping/internal/find_left_link.hh, + * milena/sandbox/scribo/text/grouping/internal/find_right_link.hh, + * milena/sandbox/scribo/text/grouping/internal/find_root.hh, + * milena/sandbox/scribo/text/grouping/internal/init_link_array.hh, + * milena/sandbox/scribo/text/grouping/internal/is_link_valid.hh, + * milena/sandbox/scribo/text/grouping/internal/update_graph_link.hh, + * milena/sandbox/scribo/text/grouping/internal/update_link_array.hh, + * milena/sandbox/scribo/text/recognition.hh, + * milena/sandbox/scribo/util/all.hh, + * milena/sandbox/scribo/util/text.hh: move ... + + * scribo/Doxyfile, + * scribo/Doxyfile_tex, + * scribo/Makefile.am, + * scribo/all.hh, + * scribo/binarization/simple.hh, + * scribo/core/all.hh, + * scribo/core/central_sites.hh, + * scribo/core/component_bboxes.hh, + * scribo/core/erase_bboxes.hh, + * scribo/core/macros.hh, + * scribo/debug/all.hh, + * scribo/debug/save_label_image.hh, + * scribo/debug/save_linked_textbboxes_image.hh, + * scribo/debug/save_table_image.hh, + * scribo/debug/save_textbboxes_image.hh, + * scribo/demat.hh, + * scribo/draw/all.hh, + * scribo/draw/bounding_box_links.hh, + * scribo/draw/bounding_boxes.hh, + * scribo/extract/primitive/canvas.hh, + * scribo/extract/primitive/cells.hh, + * scribo/extract/primitive/lines_discontinued.hh, + * scribo/extract/primitive/lines_h_discontinued.hh, + * scribo/extract/primitive/lines_thick.hh, + * scribo/extract/primitive/lines_v_discontinued.hh, + * scribo/extract/primitive/objects.hh, + * scribo/filter/all.hh, + * scribo/filter/large_components.hh, + * scribo/filter/small_components.hh, + * scribo/filter/thick_bboxes.hh, + * scribo/filter/thin_bboxes.hh, + * scribo/make/all.hh, + * scribo/make/debug_filename.hh, + * scribo/make/influence_zone_graph.hh, + * scribo/make/text.hh, + * scribo/preprocessing/all.hh, + * scribo/preprocessing/unskew.hh, + * scribo/scribo.mk, + * scribo/src/Makefile.am, + * scribo/src/binarization/Makefile.am, + * scribo/src/binarization/simple.cc, + * scribo/src/dmap.cc, + * scribo/src/extract_text_double_link.cc, + * scribo/src/extract_text_double_several_links.cc, + * scribo/src/extract_text_graph.cc, + * scribo/src/extract_text_several_graph.cc, + * scribo/src/extract_text_several_left_links.cc, + * scribo/src/extract_text_single_link.cc, + * scribo/src/morpho.cc, + * scribo/src/photo.cc, + * scribo/src/photo_basic.cc, + * scribo/src/recognition.cc, + * scribo/src/rectangularity.cc, + * scribo/src/table.cc, + * scribo/src/table_erase.cc, + * scribo/src/table_extract.cc, + * scribo/src/table_old.cc, + * scribo/src/table_rebuild_opening.cc, + * scribo/src/table_rebuild_rank.cc, + * scribo/src/thin_bboxes.cc, + * scribo/table/align_lines_horizontaly.hh, + * scribo/table/align_lines_verticaly.hh, + * scribo/table/all.hh, + * scribo/table/connect_horizontal_lines.hh, + * scribo/table/connect_vertical_lines.hh, + * scribo/table/erase.hh, + * scribo/table/extract.hh, + * scribo/table/extract_lines_with_opening.hh, + * scribo/table/extract_lines_with_rank.hh, + * scribo/table/internal/align_lines.hh, + * scribo/table/internal/all.hh, + * scribo/table/internal/connect_lines.hh, + * scribo/table/internal/repair_lines.hh, + * scribo/table/rebuild.hh, + * scribo/table/repair_horizontal_lines.hh, + * scribo/table/repair_vertical_lines.hh, + * scribo/test.cc, + * scribo/tests/Makefile.am, + * scribo/tests/data.hh.in, + * scribo/src/photo.cc, + * scribo/src/photo_basic.cc, + * scribo/src/recognition.cc, + * scribo/src/rectangularity.cc, + * scribo/src/table.cc, + * scribo/src/table_erase.cc, + * scribo/src/table_extract.cc, + * scribo/src/table_old.cc, + * scribo/src/table_rebuild_opening.cc, + * scribo/src/table_rebuild_rank.cc, + * scribo/src/thin_bboxes.cc, + * scribo/table/align_lines_horizontaly.hh, + * scribo/table/align_lines_verticaly.hh, + * scribo/table/all.hh, + * scribo/table/connect_horizontal_lines.hh, + * scribo/table/connect_vertical_lines.hh, + * scribo/table/erase.hh, + * scribo/table/extract.hh, + * scribo/table/extract_lines_with_opening.hh, + * scribo/table/extract_lines_with_rank.hh, + * scribo/table/internal/align_lines.hh, + * scribo/table/internal/all.hh, + * scribo/table/internal/connect_lines.hh, + * scribo/table/internal/repair_lines.hh, + * scribo/table/rebuild.hh, + * scribo/table/repair_horizontal_lines.hh, + * scribo/table/repair_vertical_lines.hh, + * scribo/test.cc, + * scribo/tests/Makefile.am, + * scribo/tests/data.hh.in, + * scribo/tests/filter/Makefile.am, + * scribo/tests/filter/small_and_large_bboxes.cc, + * scribo/tests/table/Makefile.am, + * scribo/tests/table/extract_lines_with_rank.cc, + * scribo/tests/table/repair_lines.cc, + * scribo/tests/text/Makefile.am, + * scribo/text/all.hh, + * scribo/text/clean.hh, + * scribo/text/extract_bboxes.hh, + * scribo/text/extract_lines.hh, + * scribo/text/grouping/all.hh, + * scribo/text/grouping/group_from_double_link.hh, + * scribo/text/grouping/group_from_graph.hh, + * scribo/text/grouping/group_from_single_link.hh, + * scribo/text/grouping/group_with_graph.hh, + * scribo/text/grouping/group_with_several_graphes.hh, + * scribo/text/grouping/group_with_several_left_links.hh, + * scribo/text/grouping/group_with_several_right_links.hh, + * scribo/text/grouping/group_with_single_left_link.hh, + * scribo/text/grouping/group_with_single_right_link.hh, + * scribo/text/grouping/internal/all.hh, + * scribo/text/grouping/internal/find_graph_link.hh, + * scribo/text/grouping/internal/find_left_link.hh, + * scribo/text/grouping/internal/find_right_link.hh, + * scribo/text/grouping/internal/find_root.hh, + * scribo/text/grouping/internal/init_link_array.hh, + * scribo/text/grouping/internal/is_link_valid.hh, + * scribo/text/grouping/internal/update_graph_link.hh, + * scribo/text/grouping/internal/update_link_array.hh, + * scribo/text/recognition.hh, + * scribo/util/all.hh, + * scribo/util/text.hh: ... here. + 2009-05-19 Thierry Geraud <thierry.geraud@lrde.epita.fr> Make Etienne's code compile. diff --git a/milena/sandbox/scribo/Makefile b/milena/sandbox/scribo/Makefile deleted file mode 100644 index d8b9a68..0000000 --- a/milena/sandbox/scribo/Makefile +++ /dev/null @@ -1,65 +0,0 @@ -CXX_FLAGS = -Wextra -Wall -I../.. -I../ -I$(HOME)/local/include -O1 -DNDEBUG # -ggdb #-O1 -DNDEBUG - -all: table photo - -tabledbg: demat.hh - g++ -Wextra -Wall -I../.. -I../ -I. -I$(HOME)/local/include -O1 -g src/table.cc $(HOME)/local/lib/libtesseract_full.a -lpthread -o bin/table.out - -table: demat.hh - g++ $(CXX_FLAGS) src/table.cc $(HOME)/local/lib/libtesseract_full.a -lpthread -o bin/table.out - -oldtable: demat.old.hh - g++ $(CXX_FLAGS) src/table_old.cc $(HOME)/local/lib/libtesseract_full.a -lpthread -o bin/table_old.out - -photo: demat.hh - g++ $(CXX_FLAGS) src/photo.cc $(HOME)/local/lib/libtesseract_full.a -lpthread -o bin/photo.out - - -dmap: - g++ $(CXX_FLAGS) src/dmap.cc -o bin/dmap.out - -rectangularity: - g++ $(CXX_FLAGS) src/rectangularity.cc -o bin/rectangularity.out - - -extract_text_single_link: - g++ $(CXX_FLAGS) src/extract_text_single_link.cc -o bin/extract_text_single_link.out - -extract_text_double_link: - g++ $(CXX_FLAGS) src/extract_text_double_link.cc -o bin/extract_text_double_link.out - -extract_text_double_several_links: - g++ $(CXX_FLAGS) src/extract_text_double_several_links.cc -o bin/extract_text_double_several_links.out - -extract_text_multiple_links: - g++ $(CXX_FLAGS) src/extract_text_multiple_links.cc -o bin/extract_text_multiple_links.out - -extract_text_several_multiple_links: - g++ $(CXX_FLAGS) src/extract_text_several_multiple_links.cc -o bin/extract_text_several_multiple_links.out - -extract_text_several_left_links: - g++ $(CXX_FLAGS) src/extract_text_several_left_links.cc -o bin/extract_text_several_left_links.out - -table_rebuild_rank: - g++ $(CXX_FLAGS) src/table_rebuild_rank.cc -o bin/table_rebuild_rank.out - -table_rebuild_opening: - g++ $(CXX_FLAGS) src/table_rebuild_opening.cc -o bin/table_rebuild_opening.out - -table_extract: - g++ $(CXX_FLAGS) src/table_extract.cc -o bin/table_extract.out - -table_erase: - g++ $(CXX_FLAGS) src/table_erase.cc -o bin/table_erase.out - -thin_bboxes: - g++ $(CXX_FLAGS) src/thin_bboxes.cc -o bin/thin_bboxes.out - -photo_basic: - g++ $(CXX_FLAGS) src/photo_basic.cc -o bin/photo_basic.out - -clean: - rm *.ppm *.pgm *.pbm - -dist-clean: clean - rm -f bin/table.out bin/photo.out diff --git a/milena/sandbox/scribo/scribo.mk b/milena/sandbox/scribo/scribo.mk deleted file mode 100644 index 13b617a..0000000 --- a/milena/sandbox/scribo/scribo.mk +++ /dev/null @@ -1,5 +0,0 @@ -include $(top_srcdir)/milena/tests/tests.mk - -# Add path to Scribo's headers -AM_CPPFLAGS += -I$(top_srcdir)/milena/sandbox/ -I$(top_builddir)/milena/sandbox/ - diff --git a/scribo/Doxyfile b/scribo/Doxyfile new file mode 100644 index 0000000..1f2f484 --- /dev/null +++ b/scribo/Doxyfile @@ -0,0 +1,346 @@ +# Doxyfile 1.5.6 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "Scribo (Olena)" +PROJECT_NUMBER = "User documentation" +OUTPUT_DIRECTORY = ./user/ +CREATE_SUBDIRS = YES +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = ../../../milena \ + ../../milena \ + ../../milena/sandbox/scribo \ + ../../../milena/sandbox/scribo +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = YES +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = YES +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = YES +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = YES +SORT_GROUP_NAMES = YES +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +SHOW_FILES = YES +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = . +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.cc \ + *.hh \ + *.hxx \ + *.hcc +RECURSIVE = YES +EXCLUDE = user \ + demat.hh \ + demat.old.hh +EXCLUDE_SYMLINKS = YES +EXCLUDE_PATTERNS = *spe.hh +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/samples \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/outputs \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/examples \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/examples \ + /lrde/stockholm/lazzara/svn/olena/git/build/milena/doc/tutorial/samples \ + /lrde/stockholm/lazzara/svn/olena/git/build/milena/doc/tutorial/outputs +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/figures \ + /lrde/stockholm/lazzara/svn/olena/git/build/milena/doc/tutorial/figures \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/img +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = YES +REFERENCES_RELATION = YES +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +HTML_DYNAMIC_SECTIONS = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = FRAME +TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = YES +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = "mlc_unqualif(T)=typename mln::metal::unqualif<T>::ret" \ + "mln_piter(T)=typename T::piter" \ + "mln_fwd_piter(T)=typename T::fwd_piter" \ + "mln_bkd_piter(T)=typename T::bkd_piter" \ + "mln_qiter(T)=typename T::qiter" \ + "mln_fwd_qiter(T)=typename T::fwd_qiter" \ + "mln_bkd_qiter(T)=typename T::bkd_qiter" \ + "mln_niter(T)=typename T::niter" \ + "mln_fwd_niter(T)=typename T::fwd_niter" \ + "mln_bkd_niter(T)=typename T::bkd_niter" \ + "mln_viter(T)=typename T::viter" \ + "mln_fwd_viter(T)=typename T::fwd_viter" \ + "mln_bkd_viter(T)=typename T::bkd_viter" \ + "mln_result(T)=typename T::result" \ + "mln_enc(T)=typename T::enc" \ + "mln_value(T)=typename T::value" \ + "mln_qlf_value(T)=typename T::qlf_value" \ + "mln_pset(T)=typename T::pset" \ + "mln_sum(T)=typename mln::value::props<T>::sum" \ + "mln_vset(T)=typename T::vset" \ + "mln_rvalue(T)=typename T::rvalue" \ + "mln_lvalue(T)=typename T::lvalue" \ + "mln_mesh(T)=typename T::mesh" \ + "mln_coord(T)=typename T::coord" \ + "mln_site(T)=typename T::site" \ + "mln_psite(T)=typename T::psite" \ + "mln_dpsite(T)=typename T::dpsite" \ + "mln_accu_with(A, T)=typename A::template with< T >::ret" \ + "mln_trait_op_plus(L, R)=typename mln::trait::op::plus< L , R >::ret" \ + "mln_trait_op_minus(L, R)=typename mln::trait::op::minus< L , R >::ret" \ + "mln_trait_op_times(L, R)=typename mln::trait::op::times< L , R >::ret" \ + "mln_trait_op_div(L, R)=typename mln::trait::op::div< L , R >::ret" \ + "mln_trait_op_mod(L, R)=typename mln::trait::op::mod< L , R >::ret" \ + "mln_trait_op_uminus(T)=typename mln::trait::op::uminus< T >::ret" \ + "mln_ch_value(I, V)=typename mln::trait::ch_value< I, V >::ret" \ + "mlc_unqualif_(T)=mln::metal::unqualif<T>::ret" \ + "mln_piter_(T)=T::piter" \ + "mln_fwd_piter_(T)=T::fwd_piter" \ + "mln_bkd_piter_(T)=T::bkd_piter" \ + "mln_qiter_(T)=T::qiter" \ + "mln_fwd_qiter_(T)=T::fwd_qiter" \ + "mln_bkd_qiter_(T)=T::bkd_qiter" \ + "mln_niter_(T)=T::niter" \ + "mln_fwd_niter_(T)=T::fwd_niter" \ + "mln_bkd_niter_(T)=T::bkd_niter" \ + "mln_viter_(T)=T::viter" \ + "mln_fwd_viter_(T)=T::fwd_viter" \ + "mln_bkd_viter_(T)=T::bkd_viter" \ + "mln_result_(T)=T::result" \ + "mln_enc_(T)=T::enc" \ + "mln_value_(T)=T::value" \ + "mln_qlf_value_(T)=T::qlf_value" \ + "mln_pset_(T)=T::pset" \ + "mln_sum_(T)=mln::value::props<T>::sum" \ + "mln_vset_(T)=T::vset" \ + "mln_rvalue_(T)=T::rvalue" \ + "mln_lvalue_(T)=T::lvalue" \ + "mln_mesh_(T)=T::mesh" \ + "mln_coord_(T)=T::coord" \ + "mln_site_(T)=T::site" \ + "mln_psite_(T)=T::psite" \ + "mln_dpsite_(T)=T::dpsite" \ + "mln_accu_with_(A, T)=A::template with< T >::ret" \ + "mln_trait_op_plus_(L, R)=mln::trait::op::plus< L , R >::ret" \ + "mln_trait_op_minus_(L, R)=mln::trait::op::minus< L , R >::ret" \ + "mln_trait_op_times_(L, R)=mln::trait::op::times< L , R >::ret" \ + "mln_trait_op_div_(L, R)=mln::trait::op::div< L , R >::ret" \ + "mln_trait_op_mod_(L, R)=mln::trait::op::mod< L , R >::ret" \ + "mln_trait_op_uminus_(T)=mln::trait::op::uminus< T >::ret" \ + "mln_ch_value_(I, V)=typename mln::trait::ch_value< I, V >::ret" \ + "mln_ch_value(I, V)_=mln::trait::ch_value< I, V >::ret" \ + "mln_morpher_lvalue(I)=typename internal::morpher_lvalue_<I>::ret" \ + "mln_concrete(I)=typename mln::trait::concrete< I >::ret" \ + "mln_concrete_ch_value(I, V)=typename mln::trait::ch_value< typename mln::trait::concrete< I >::ret, V >::ret" \ + "mlc_const(T)=typename mln::metal::const_< T >::ret" \ + "mlc_const_return(T)=typename mln::metal::const_return_< T >::ret" \ + "mln_element(T)=typename T::element" \ + "mln_element_(T)=T::element" \ + "mln_delta(T)=typename T::delta" \ + "mln_delta_(T)=T::delta" \ + "mln_dpoint(T)=typename T::dpoint" \ + "mln_dpoint_(T)=T::dpoint" \ + "mln_point(T)=typename T::point" \ + "mln_point_(T)=T::point" \ + "mln_gradient_component(I)=typename mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret" \ + "mln_gradient(I)=mln::value::stack_image< I::point::dim, mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret >" +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +DOT_FONTNAME = FreeSans +DOT_FONTPATH = +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/scribo/Doxyfile_tex b/scribo/Doxyfile_tex new file mode 100644 index 0000000..d2f4b19 --- /dev/null +++ b/scribo/Doxyfile_tex @@ -0,0 +1,346 @@ +# Doxyfile 1.5.6 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = Scribo +PROJECT_NUMBER = "User documentation" +OUTPUT_DIRECTORY = ./user/ +CREATE_SUBDIRS = YES +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = YES +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = ../../../milena \ + ../../milena \ + ../../milena/sandbox/scribo \ + ../../../milena/sandbox/scribo +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +QT_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 2 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +OPTIMIZE_FOR_FORTRAN = NO +OPTIMIZE_OUTPUT_VHDL = NO +BUILTIN_STL_SUPPORT = YES +CPP_CLI_SUPPORT = NO +SIP_SUPPORT = NO +IDL_PROPERTY_SUPPORT = YES +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +TYPEDEF_HIDES_STRUCT = NO +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = NO +EXTRACT_LOCAL_CLASSES = NO +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = YES +HIDE_IN_BODY_DOCS = YES +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = YES +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = YES +SORT_GROUP_NAMES = YES +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = NO +GENERATE_TESTLIST = NO +GENERATE_BUGLIST = NO +GENERATE_DEPRECATEDLIST= NO +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = NO +SHOW_DIRECTORIES = NO +SHOW_FILES = NO +SHOW_NAMESPACES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = YES +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = . +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.cc \ + *.hh \ + *.hxx \ + *.hcc +RECURSIVE = YES +EXCLUDE = user +EXCLUDE_SYMLINKS = YES +EXCLUDE_PATTERNS = *spe.hh \ + demat.hh \ + demat.old.hh +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/samples \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/outputs \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/examples \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/examples \ + /lrde/stockholm/lazzara/svn/olena/git/build/milena/doc/tutorial/samples \ + /lrde/stockholm/lazzara/svn/olena/git/build/milena/doc/tutorial/outputs +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = /lrde/stockholm/lazzara/svn/olena/git/oln/milena/doc/tutorial/figures \ + /lrde/stockholm/lazzara/svn/olena/git/build/milena/doc/tutorial/figures \ + /lrde/stockholm/lazzara/svn/olena/git/oln/milena/img +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = NO +USE_HTAGS = NO +VERBATIM_HEADERS = YES +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = NO +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +GENERATE_DOCSET = NO +DOCSET_FEEDNAME = "Doxygen generated docs" +DOCSET_BUNDLE_ID = org.doxygen.Project +HTML_DYNAMIC_SECTIONS = YES +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +CHM_INDEX_ENCODING = +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = FRAME +TREEVIEW_WIDTH = 250 +FORMULA_FONTSIZE = 10 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4 +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = YES +USE_PDFLATEX = YES +LATEX_BATCHMODE = YES +LATEX_HIDE_INDICES = YES +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = "mlc_unqualif(T)=typename mln::metal::unqualif<T>::ret" \ + "mln_piter(T)=typename T::piter" \ + "mln_fwd_piter(T)=typename T::fwd_piter" \ + "mln_bkd_piter(T)=typename T::bkd_piter" \ + "mln_qiter(T)=typename T::qiter" \ + "mln_fwd_qiter(T)=typename T::fwd_qiter" \ + "mln_bkd_qiter(T)=typename T::bkd_qiter" \ + "mln_niter(T)=typename T::niter" \ + "mln_fwd_niter(T)=typename T::fwd_niter" \ + "mln_bkd_niter(T)=typename T::bkd_niter" \ + "mln_viter(T)=typename T::viter" \ + "mln_fwd_viter(T)=typename T::fwd_viter" \ + "mln_bkd_viter(T)=typename T::bkd_viter" \ + "mln_result(T)=typename T::result" \ + "mln_enc(T)=typename T::enc" \ + "mln_value(T)=typename T::value" \ + "mln_qlf_value(T)=typename T::qlf_value" \ + "mln_pset(T)=typename T::pset" \ + "mln_sum(T)=typename mln::value::props<T>::sum" \ + "mln_vset(T)=typename T::vset" \ + "mln_rvalue(T)=typename T::rvalue" \ + "mln_lvalue(T)=typename T::lvalue" \ + "mln_mesh(T)=typename T::mesh" \ + "mln_coord(T)=typename T::coord" \ + "mln_site(T)=typename T::site" \ + "mln_psite(T)=typename T::psite" \ + "mln_dpsite(T)=typename T::dpsite" \ + "mln_accu_with(A, T)=typename A::template with< T >::ret" \ + "mln_trait_op_plus(L, R)=typename mln::trait::op::plus< L , R >::ret" \ + "mln_trait_op_minus(L, R)=typename mln::trait::op::minus< L , R >::ret" \ + "mln_trait_op_times(L, R)=typename mln::trait::op::times< L , R >::ret" \ + "mln_trait_op_div(L, R)=typename mln::trait::op::div< L , R >::ret" \ + "mln_trait_op_mod(L, R)=typename mln::trait::op::mod< L , R >::ret" \ + "mln_trait_op_uminus(T)=typename mln::trait::op::uminus< T >::ret" \ + "mln_ch_value(I, V)=typename mln::trait::ch_value< I, V >::ret" \ + "mlc_unqualif_(T)=mln::metal::unqualif<T>::ret" \ + "mln_piter_(T)=T::piter" \ + "mln_fwd_piter_(T)=T::fwd_piter" \ + "mln_bkd_piter_(T)=T::bkd_piter" \ + "mln_qiter_(T)=T::qiter" \ + "mln_fwd_qiter_(T)=T::fwd_qiter" \ + "mln_bkd_qiter_(T)=T::bkd_qiter" \ + "mln_niter_(T)=T::niter" \ + "mln_fwd_niter_(T)=T::fwd_niter" \ + "mln_bkd_niter_(T)=T::bkd_niter" \ + "mln_viter_(T)=T::viter" \ + "mln_fwd_viter_(T)=T::fwd_viter" \ + "mln_bkd_viter_(T)=T::bkd_viter" \ + "mln_result_(T)=T::result" \ + "mln_enc_(T)=T::enc" \ + "mln_value_(T)=T::value" \ + "mln_qlf_value_(T)=T::qlf_value" \ + "mln_pset_(T)=T::pset" \ + "mln_sum_(T)=mln::value::props<T>::sum" \ + "mln_vset_(T)=T::vset" \ + "mln_rvalue_(T)=T::rvalue" \ + "mln_lvalue_(T)=T::lvalue" \ + "mln_mesh_(T)=T::mesh" \ + "mln_coord_(T)=T::coord" \ + "mln_site_(T)=T::site" \ + "mln_psite_(T)=T::psite" \ + "mln_dpsite_(T)=T::dpsite" \ + "mln_accu_with_(A, T)=A::template with< T >::ret" \ + "mln_trait_op_plus_(L, R)=mln::trait::op::plus< L , R >::ret" \ + "mln_trait_op_minus_(L, R)=mln::trait::op::minus< L , R >::ret" \ + "mln_trait_op_times_(L, R)=mln::trait::op::times< L , R >::ret" \ + "mln_trait_op_div_(L, R)=mln::trait::op::div< L , R >::ret" \ + "mln_trait_op_mod_(L, R)=mln::trait::op::mod< L , R >::ret" \ + "mln_trait_op_uminus_(T)=mln::trait::op::uminus< T >::ret" \ + "mln_ch_value_(I, V)=typename mln::trait::ch_value< I, V >::ret" \ + "mln_ch_value(I, V)_=mln::trait::ch_value< I, V >::ret" \ + "mln_morpher_lvalue(I)=typename internal::morpher_lvalue_<I>::ret" \ + "mln_concrete(I)=typename mln::trait::concrete< I >::ret" \ + "mln_concrete_ch_value(I, V)=typename mln::trait::ch_value< typename mln::trait::concrete< I >::ret, V >::ret" \ + "mlc_const(T)=typename mln::metal::const_< T >::ret" \ + "mlc_const_return(T)=typename mln::metal::const_return_< T >::ret" \ + "mln_element(T)=typename T::element" \ + "mln_element_(T)=T::element" \ + "mln_delta(T)=typename T::delta" \ + "mln_delta_(T)=T::delta" \ + "mln_dpoint(T)=typename T::dpoint" \ + "mln_dpoint_(T)=T::dpoint" \ + "mln_point(T)=typename T::point" \ + "mln_point_(T)=T::point" \ + "mln_gradient_component(I)=typename mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret" \ + "mln_gradient(I)=mln::value::stack_image< I::point::dim, mln::trait::ch_value< I, mln::value::props< typename I::value >::sum >::ret >" +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = NO +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = NO +HAVE_DOT = NO +DOT_FONTNAME = FreeSans +DOT_FONTPATH = +CLASS_GRAPH = NO +COLLABORATION_GRAPH = NO +GROUP_GRAPHS = NO +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = NO +INCLUDED_BY_GRAPH = NO +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = NO +DIRECTORY_GRAPH = NO +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 1000 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = NO +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO diff --git a/milena/sandbox/scribo/Makefile.am b/scribo/Makefile.am similarity index 100% rename from milena/sandbox/scribo/Makefile.am rename to scribo/Makefile.am diff --git a/milena/sandbox/scribo/all.hh b/scribo/all.hh similarity index 100% rename from milena/sandbox/scribo/all.hh rename to scribo/all.hh diff --git a/milena/sandbox/scribo/binarization/simple.hh b/scribo/binarization/simple.hh similarity index 100% rename from milena/sandbox/scribo/binarization/simple.hh rename to scribo/binarization/simple.hh diff --git a/milena/sandbox/scribo/core/all.hh b/scribo/core/all.hh similarity index 100% rename from milena/sandbox/scribo/core/all.hh rename to scribo/core/all.hh diff --git a/milena/sandbox/scribo/core/central_sites.hh b/scribo/core/central_sites.hh similarity index 100% rename from milena/sandbox/scribo/core/central_sites.hh rename to scribo/core/central_sites.hh diff --git a/milena/sandbox/scribo/core/component_bboxes.hh b/scribo/core/component_bboxes.hh similarity index 100% rename from milena/sandbox/scribo/core/component_bboxes.hh rename to scribo/core/component_bboxes.hh diff --git a/milena/sandbox/scribo/core/erase_bboxes.hh b/scribo/core/erase_bboxes.hh similarity index 100% rename from milena/sandbox/scribo/core/erase_bboxes.hh rename to scribo/core/erase_bboxes.hh diff --git a/milena/sandbox/scribo/core/macros.hh b/scribo/core/macros.hh similarity index 100% rename from milena/sandbox/scribo/core/macros.hh rename to scribo/core/macros.hh diff --git a/milena/sandbox/scribo/debug/all.hh b/scribo/debug/all.hh similarity index 100% rename from milena/sandbox/scribo/debug/all.hh rename to scribo/debug/all.hh diff --git a/milena/sandbox/scribo/debug/save_label_image.hh b/scribo/debug/save_label_image.hh similarity index 100% rename from milena/sandbox/scribo/debug/save_label_image.hh rename to scribo/debug/save_label_image.hh diff --git a/milena/sandbox/scribo/debug/save_linked_textbboxes_image.hh b/scribo/debug/save_linked_textbboxes_image.hh similarity index 100% rename from milena/sandbox/scribo/debug/save_linked_textbboxes_image.hh rename to scribo/debug/save_linked_textbboxes_image.hh diff --git a/milena/sandbox/scribo/debug/save_table_image.hh b/scribo/debug/save_table_image.hh similarity index 100% rename from milena/sandbox/scribo/debug/save_table_image.hh rename to scribo/debug/save_table_image.hh diff --git a/milena/sandbox/scribo/debug/save_textbboxes_image.hh b/scribo/debug/save_textbboxes_image.hh similarity index 100% rename from milena/sandbox/scribo/debug/save_textbboxes_image.hh rename to scribo/debug/save_textbboxes_image.hh diff --git a/milena/sandbox/scribo/demat.hh b/scribo/demat.hh similarity index 100% rename from milena/sandbox/scribo/demat.hh rename to scribo/demat.hh diff --git a/milena/sandbox/scribo/draw/all.hh b/scribo/draw/all.hh similarity index 100% rename from milena/sandbox/scribo/draw/all.hh rename to scribo/draw/all.hh diff --git a/milena/sandbox/scribo/draw/bounding_box_links.hh b/scribo/draw/bounding_box_links.hh similarity index 100% rename from milena/sandbox/scribo/draw/bounding_box_links.hh rename to scribo/draw/bounding_box_links.hh diff --git a/milena/sandbox/scribo/draw/bounding_boxes.hh b/scribo/draw/bounding_boxes.hh similarity index 100% rename from milena/sandbox/scribo/draw/bounding_boxes.hh rename to scribo/draw/bounding_boxes.hh diff --git a/milena/sandbox/scribo/extract/primitive/canvas.hh b/scribo/extract/primitive/canvas.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/canvas.hh rename to scribo/extract/primitive/canvas.hh diff --git a/milena/sandbox/scribo/extract/primitive/cells.hh b/scribo/extract/primitive/cells.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/cells.hh rename to scribo/extract/primitive/cells.hh diff --git a/milena/sandbox/scribo/extract/primitive/lines_discontinued.hh b/scribo/extract/primitive/lines_discontinued.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/lines_discontinued.hh rename to scribo/extract/primitive/lines_discontinued.hh diff --git a/milena/sandbox/scribo/extract/primitive/lines_h_discontinued.hh b/scribo/extract/primitive/lines_h_discontinued.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/lines_h_discontinued.hh rename to scribo/extract/primitive/lines_h_discontinued.hh diff --git a/milena/sandbox/scribo/extract/primitive/lines_thick.hh b/scribo/extract/primitive/lines_thick.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/lines_thick.hh rename to scribo/extract/primitive/lines_thick.hh diff --git a/milena/sandbox/scribo/extract/primitive/lines_v_discontinued.hh b/scribo/extract/primitive/lines_v_discontinued.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/lines_v_discontinued.hh rename to scribo/extract/primitive/lines_v_discontinued.hh diff --git a/milena/sandbox/scribo/extract/primitive/objects.hh b/scribo/extract/primitive/objects.hh similarity index 100% rename from milena/sandbox/scribo/extract/primitive/objects.hh rename to scribo/extract/primitive/objects.hh diff --git a/milena/sandbox/scribo/filter/all.hh b/scribo/filter/all.hh similarity index 100% rename from milena/sandbox/scribo/filter/all.hh rename to scribo/filter/all.hh diff --git a/milena/sandbox/scribo/filter/large_components.hh b/scribo/filter/large_components.hh similarity index 94% rename from milena/sandbox/scribo/filter/large_components.hh rename to scribo/filter/large_components.hh index 814f4ed..c3ea79b 100644 --- a/milena/sandbox/scribo/filter/large_components.hh +++ b/scribo/filter/large_components.hh @@ -45,6 +45,8 @@ # include <mln/pw/all.hh> +# include <scribo/make/text.hh> + namespace scribo { @@ -196,16 +198,10 @@ namespace scribo } } - mln_value(I) new_nbboxes; - I new_lbl = labeling::relabel(text.label_image(), text.nbboxes(), - mln::make::relabelfun(f, text.nbboxes(), - new_nbboxes)); - - mln_assertion(new_nbboxes.next() == bresult.nelements()); + util::text<I> output = scribo::make::text(text, f); trace::exiting("scribo::filter::large_components"); - /// FIXME: construct a new util::text from the old one. - return scribo::make::text(bresult, new_lbl, new_nbboxes); + return output; } diff --git a/milena/sandbox/scribo/filter/small_components.hh b/scribo/filter/small_components.hh similarity index 86% rename from milena/sandbox/scribo/filter/small_components.hh rename to scribo/filter/small_components.hh index 7439ce5..c28772b 100644 --- a/milena/sandbox/scribo/filter/small_components.hh +++ b/scribo/filter/small_components.hh @@ -41,11 +41,15 @@ # include <mln/labeling/relabel.hh> # include <mln/make/relabelfun.hh> + # include <mln/util/array.hh> -# include <mln/value/label_16.hh> # include <mln/pw/all.hh> +# include <mln/accu/count.hh> + +# include <mln/set/compute.hh> + # include <scribo/util/text.hh> # include <scribo/make/text.hh> @@ -97,16 +101,16 @@ namespace scribo /// Filter Functor. /// Return false for all components which are too small. - template <typename R> + template <typename B> struct filter_small_components_functor - : Function_l2b< filter_small_components_functor<R> > + : Function_v2b< filter_small_components_functor<B> > { /// Constructor /// /// \param[in] compbboxes Component bounding boxes. /// \param[in] min_size Minimum component size. - filter_small_components_functor(const mln::util::array<R>& compbboxes, + filter_small_components_functor(const mln::util::array<B>& compbboxes, unsigned min_size) : compbboxes_(compbboxes), min_size_(min_size) { @@ -119,13 +123,14 @@ namespace scribo /// /// \return false if the component area is strictly inferion to /// \p min_size_. - bool operator()(const value::label_16& l) const + template <typename L> + bool operator()(const L& l) const { return compbboxes_[l] >= min_size_; } /// The component bounding boxes. - const mln::util::array<R>& compbboxes_; + const mln::util::array<B>& compbboxes_; /// The minimum area. unsigned min_size_; @@ -161,8 +166,8 @@ namespace scribo compbboxes_t compbboxes = labeling::compute(accu_count_t(), lbl, nlabels); typedef internal::filter_small_components_functor<accu_count_res_t> func_t; - func_t fl2b(compbboxes, min_size); - labeling::relabel_inplace(lbl, nlabels, fl2b); + func_t fv2b(compbboxes, min_size); + labeling::relabel_inplace(lbl, nlabels, fv2b); mln_concrete(I) output = duplicate(input); data::fill((output | pw::value(lbl) == literal::zero).rw(), false); @@ -172,17 +177,17 @@ namespace scribo } - template <typename I> + template <typename L> inline - scribo::util::text<I> - small_components(const scribo::util::text<I>& text, + scribo::util::text<L> + small_components(const scribo::util::text<L>& text, unsigned min_size) { trace::entering("scribo::filter::small_components"); mln_precondition(text.is_valid()); - typedef mln_site(I) P; + typedef mln_site(L) P; typedef accu::count<P> accu_count_t; typedef mln_result(accu_count_t) accu_count_res_t; typedef mln::util::array<accu_count_res_t> nsitecomp_t; @@ -201,16 +206,10 @@ namespace scribo } } - mln_value(I) new_nbboxes; - I new_lbl = labeling::relabel(text.label_image(), text.nbboxes(), - mln::make::relabelfun(f, text.nbboxes(), - new_nbboxes)); - - mln_assertion(new_nbboxes.next() == bresult.nelements()); + util::text<L> output = scribo::make::text(text, f); trace::exiting("scribo::filter::small_components"); - /// FIXME: construct a new util::text from the old one. - return scribo::make::text(bresult, new_lbl, new_nbboxes); + return output; } diff --git a/milena/sandbox/scribo/filter/thick_bboxes.hh b/scribo/filter/thick_bboxes.hh similarity index 95% rename from milena/sandbox/scribo/filter/thick_bboxes.hh rename to scribo/filter/thick_bboxes.hh index ba097f8..9f717b3 100644 --- a/milena/sandbox/scribo/filter/thick_bboxes.hh +++ b/scribo/filter/thick_bboxes.hh @@ -38,6 +38,9 @@ # include <scribo/util/text.hh> +# include <scribo/make/text.hh> + + namespace scribo { @@ -184,15 +187,11 @@ namespace scribo f(i) = true; } - mln_value(L) new_nbboxes; - L new_lbl = labeling::relabel(text.label_image(), text.nbboxes(), - mln::make::relabelfun(f, text.nbboxes(), new_nbboxes)); - - mln_assertion(new_nbboxes.next() == bresult.nelements()); + util::text<L> output = scribo::make::text(text, f); trace::exiting("scribo::filter::thick_bboxes"); /// FIXME: construct a new util::text from the old one. - return scribo::make::text(bresult, new_lbl, new_nbboxes); + return output; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/sandbox/scribo/filter/thin_bboxes.hh b/scribo/filter/thin_bboxes.hh similarity index 91% rename from milena/sandbox/scribo/filter/thin_bboxes.hh rename to scribo/filter/thin_bboxes.hh index 14aeec0..1463a64 100644 --- a/milena/sandbox/scribo/filter/thin_bboxes.hh +++ b/scribo/filter/thin_bboxes.hh @@ -83,7 +83,7 @@ namespace scribo /// Return false for all components which are too large. template <typename R> struct filter_too_thin_component_functor - : Function_l2b< filter_too_thin_component_functor<R> > + : Function_v2b< filter_too_thin_component_functor<R> > { /// Constructor @@ -144,8 +144,8 @@ namespace scribo compbboxes_t compbboxes = labeling::compute(accu_bbox_t(), lbl, nlabels); typedef internal::filter_too_thin_component_functor<accu_bbox_res_t> func_t; - func_t fl2b(compbboxes, min_thickness); - labeling::relabel_inplace(lbl, nlabels, fl2b); + func_t fv2b(compbboxes, min_thickness); + labeling::relabel_inplace(lbl, nlabels, fv2b); mln_concrete(I) output = duplicate(input); data::fill((output | pw::value(lbl) == literal::zero).rw(), false); @@ -184,15 +184,10 @@ namespace scribo f(i) = true; } - mln_value(L) new_nbboxes; - L new_lbl = labeling::relabel(text.label_image(), text.nbboxes(), - mln::make::relabelfun(f, text.nbboxes(), new_nbboxes)); - - mln_assertion(new_nbboxes.next() == bresult.nelements()); + util::text<L> output = scribo::make::text(text, f); trace::exiting("scribo::filter::thin_bboxes"); - /// FIXME: construct a new util::text from the old one. - return scribo::make::text(bresult, new_lbl, new_nbboxes); + return output; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/sandbox/scribo/make/all.hh b/scribo/make/all.hh similarity index 100% rename from milena/sandbox/scribo/make/all.hh rename to scribo/make/all.hh diff --git a/milena/sandbox/scribo/make/debug_filename.hh b/scribo/make/debug_filename.hh similarity index 100% rename from milena/sandbox/scribo/make/debug_filename.hh rename to scribo/make/debug_filename.hh diff --git a/milena/sandbox/scribo/make/influence_zone_graph.hh b/scribo/make/influence_zone_graph.hh similarity index 100% rename from milena/sandbox/scribo/make/influence_zone_graph.hh rename to scribo/make/influence_zone_graph.hh diff --git a/milena/sandbox/scribo/make/text.hh b/scribo/make/text.hh similarity index 77% rename from milena/sandbox/scribo/make/text.hh rename to scribo/make/text.hh index f46def8..cac6356 100644 --- a/milena/sandbox/scribo/make/text.hh +++ b/scribo/make/text.hh @@ -38,8 +38,11 @@ # include <mln/fun/i2v/array.hh> # include <mln/labeling/blobs.hh> # include <mln/labeling/compute.hh> +# include <mln/labeling/relabel.hh> # include <mln/util/array.hh> +# include <mln/make/relabelfun.hh> +# include <scribo/core/macros.hh> # include <scribo/util/text.hh> @@ -123,34 +126,38 @@ namespace scribo //FIXME: we want the following routine to construct a new util::text // from another one and a relabeling function. It avoids recomputing // the whole underlying data (mass centers, bboxes...) -// template <typename L> -// scribo::util::text<L> -// text(const scribo::util::text<L>& text, -// const Function_v2b<F>& f) -// { -// trace::entering("scribo::make::text"); -// -// mln_precondition(text.is_valid()); -// -// mln_value(L) new_nbboxes; -// mln::fun::i2v::array<mln_value(L)> fl2l -// = mln::make::relabelfun(f, text.nbboxes(), new_nbboxes); -// lbl_ = labeling::relabel(text.label_image(), text.nbboxes(), l2l); -// text.nbboxes() = new_nbboxes; -// -// mln::util::array< accu::bbox<mln_site(I)> > tboxes(text.nbboxes().next()); -// mln::util::array< accu::center<mln_site(I)> > tcenters(text.nbboxes().next()); -// for_all_components(i, text.bboxes()) -// { -// abboxes[fl2l(i)].take(text.bbox(i)); -// acenters[fl2l(i)].take(text.bbox(i)); -// } -// convert::from_to(abboxes, text.bboxes()); -// convert::from_to(acenters, text.mass_centers()); -// -// trace::exiting("scribo::make::text"); -// return scribo::util::text<L>(); -// } + template <typename L, typename F> + scribo::util::text<L> + text(const scribo::util::text<L>& text, + const Function<F>& f_) + { + trace::entering("scribo::make::text"); + + mln_precondition(text.is_valid()); + const F& f = exact(f_); + + mln_value(L) new_nbboxes; + mln::fun::i2v::array<mln_value(L)> fv2v + = mln::make::relabelfun(f, text.nbboxes(), new_nbboxes); + L lbl = labeling::relabel(text.label_image(), text.nbboxes(), fv2v); + + mln::util::array< accu::bbox<mln_site(L)> > tboxes(new_nbboxes.next()); + mln::util::array< accu::center<mln_site(L)> > tcenters(new_nbboxes.next()); + for_all_components(i, text.bboxes()) + { + tboxes[fv2v(i)].take(text.bbox(i)); + tcenters[fv2v(i)].take(text.mass_center(i)); + } + + scribo::util::text<L> new_text; + new_text.nbboxes() = new_nbboxes; + new_text.label_image() = lbl; + convert::from_to(tboxes, new_text.bboxes()); + convert::from_to(tcenters, new_text.mass_centers()); + + trace::exiting("scribo::make::text"); + return new_text; + } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/sandbox/scribo/preprocessing/all.hh b/scribo/preprocessing/all.hh similarity index 100% rename from milena/sandbox/scribo/preprocessing/all.hh rename to scribo/preprocessing/all.hh diff --git a/milena/sandbox/scribo/preprocessing/unskew.hh b/scribo/preprocessing/unskew.hh similarity index 100% rename from milena/sandbox/scribo/preprocessing/unskew.hh rename to scribo/preprocessing/unskew.hh diff --git a/scribo/scribo.mk b/scribo/scribo.mk new file mode 100644 index 0000000..866d51a --- /dev/null +++ b/scribo/scribo.mk @@ -0,0 +1,5 @@ +include $(top_srcdir)/milena/tests/tests.mk + +# Add path to Scribo's headers +AM_CPPFLAGS += -I$(top_srcdir)/ -I$(top_builddir)/ + diff --git a/milena/sandbox/scribo/src/Makefile.am b/scribo/src/Makefile.am similarity index 100% rename from milena/sandbox/scribo/src/Makefile.am rename to scribo/src/Makefile.am diff --git a/milena/sandbox/scribo/src/binarization/Makefile.am b/scribo/src/binarization/Makefile.am similarity index 100% rename from milena/sandbox/scribo/src/binarization/Makefile.am rename to scribo/src/binarization/Makefile.am diff --git a/milena/sandbox/scribo/src/binarization/simple.cc b/scribo/src/binarization/simple.cc similarity index 100% rename from milena/sandbox/scribo/src/binarization/simple.cc rename to scribo/src/binarization/simple.cc diff --git a/milena/sandbox/scribo/src/dmap.cc b/scribo/src/dmap.cc similarity index 100% rename from milena/sandbox/scribo/src/dmap.cc rename to scribo/src/dmap.cc diff --git a/milena/sandbox/scribo/src/extract_text_double_link.cc b/scribo/src/extract_text_double_link.cc similarity index 96% rename from milena/sandbox/scribo/src/extract_text_double_link.cc rename to scribo/src/extract_text_double_link.cc index 88f8247..1b2c640 100644 --- a/milena/sandbox/scribo/src/extract_text_double_link.cc +++ b/scribo/src/extract_text_double_link.cc @@ -27,9 +27,13 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> #include <mln/labeling/colorize.hh> #include <mln/debug/println.hh> +#include <mln/util/array.hh> +#include <mln/literal/colors.hh> +#include <mln/io/pbm/load.hh> +#include <mln/core/alias/neighb2d.hh> #include <scribo/text/extract_bboxes.hh> #include <scribo/text/grouping/group_with_single_left_link.hh> diff --git a/milena/sandbox/scribo/src/extract_text_double_several_links.cc b/scribo/src/extract_text_double_several_links.cc similarity index 100% copy from milena/sandbox/scribo/src/extract_text_double_several_links.cc copy to scribo/src/extract_text_double_several_links.cc diff --git a/milena/sandbox/scribo/src/extract_text_graph.cc b/scribo/src/extract_text_graph.cc similarity index 91% rename from milena/sandbox/scribo/src/extract_text_graph.cc rename to scribo/src/extract_text_graph.cc index 99f9a18..190714b 100644 --- a/milena/sandbox/scribo/src/extract_text_graph.cc +++ b/scribo/src/extract_text_graph.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -27,7 +27,13 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> +#include <mln/value/label_16.hh> +#include <mln/io/ppm/save.hh> +#include <mln/io/pbm/load.hh> +#include <mln/core/alias/neighb2d.hh> +#include <mln/literal/colors.hh> +#include <mln/labeling/colorize.hh> #include <scribo/text/extract_bboxes.hh> #include <scribo/text/grouping/group_with_graph.hh> diff --git a/milena/sandbox/scribo/src/extract_text_several_graph.cc b/scribo/src/extract_text_several_graph.cc similarity index 100% rename from milena/sandbox/scribo/src/extract_text_several_graph.cc rename to scribo/src/extract_text_several_graph.cc diff --git a/milena/sandbox/scribo/src/extract_text_several_left_links.cc b/scribo/src/extract_text_several_left_links.cc similarity index 100% rename from milena/sandbox/scribo/src/extract_text_several_left_links.cc rename to scribo/src/extract_text_several_left_links.cc diff --git a/milena/sandbox/scribo/src/extract_text_single_link.cc b/scribo/src/extract_text_single_link.cc similarity index 100% rename from milena/sandbox/scribo/src/extract_text_single_link.cc rename to scribo/src/extract_text_single_link.cc diff --git a/milena/sandbox/scribo/src/morpho.cc b/scribo/src/morpho.cc similarity index 100% rename from milena/sandbox/scribo/src/morpho.cc rename to scribo/src/morpho.cc diff --git a/milena/sandbox/scribo/src/photo.cc b/scribo/src/photo.cc similarity index 100% rename from milena/sandbox/scribo/src/photo.cc rename to scribo/src/photo.cc diff --git a/milena/sandbox/scribo/src/photo_basic.cc b/scribo/src/photo_basic.cc similarity index 100% rename from milena/sandbox/scribo/src/photo_basic.cc rename to scribo/src/photo_basic.cc diff --git a/milena/sandbox/scribo/src/extract_text_double_several_links.cc b/scribo/src/recognition.cc similarity index 56% rename from milena/sandbox/scribo/src/extract_text_double_several_links.cc rename to scribo/src/recognition.cc index 59dad73..4c270f5 100644 --- a/milena/sandbox/scribo/src/extract_text_double_several_links.cc +++ b/scribo/src/recognition.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2009 EPITA Research and Development Laboratory +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -27,9 +27,22 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> + #include <mln/labeling/colorize.hh> +#include <mln/labeling/wrap.hh> + #include <mln/util/timer.hh> +#include <mln/util/array.hh> + +#include <mln/io/txt/save.hh> +#include <mln/io/pbm/load.hh> +#include <mln/io/ppm/save.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/value/label_16.hh> + +#include <mln/core/alias/neighb2d.hh> #include <scribo/text/extract_bboxes.hh> #include <scribo/text/grouping/group_with_several_left_links.hh> @@ -37,13 +50,18 @@ #include <scribo/debug/save_linked_textbboxes_image.hh> #include <scribo/text/grouping/group_from_double_link.hh> #include <scribo/filter/small_components.hh> +#include <scribo/filter/thin_bboxes.hh> +#include <scribo/text/recognition.hh> #include <scribo/debug/save_textbboxes_image.hh> #include <scribo/make/debug_filename.hh> +#include <scribo/preprocessing/unskew.hh> + + int usage(const char *name) { - std::cout << "Usage: " << name << " <input.pbm> " << std::endl; + std::cout << "Usage: " << name << " <input.pbm> <output.txt>" << std::endl; return 1; } @@ -53,73 +71,36 @@ int main(int argc, char* argv[]) using namespace scribo; using namespace mln; - if (argc < 1) + if (argc < 3) return usage(argv[0]); - scribo::make::internal::debug_filename_prefix = "extract_text_double_several_links"; + scribo::make::internal::debug_filename_prefix = argv[2]; - mln::util::timer t, t2; image2d<bool> input; - std::cout << "Loading" << std::endl; - t.start(); io::pbm::load(input, argv[1]); - std::cout << t << std::endl; + input = preprocessing::unskew(input); + /// Extract text. value::label_16 nbboxes; - std::cout << "extract bboxes" << std::endl; - t.restart(); - t2.start(); scribo::util::text<image2d<value::label_16> > text = text::extract_bboxes(input, c8(), nbboxes); - std::cout << t << std::endl; - - mln::util::timer t3; - std::cout << "Remove small components" << std::endl; - t.restart(); - t3.start(); text = filter::small_components(text,4); - std::cout << t << std::endl; - - std::cout << "Group with left link" << std::endl; - t.restart(); + text = filter::thin_bboxes(text,2); mln::util::array<unsigned> left_link = text::grouping::group_with_several_left_links(text, 30); - std::cout << t << std::endl; - - std::cout << "Group with right link" << std::endl; - t.restart(); mln::util::array<unsigned> right_link = text::grouping::group_with_several_right_links(text, 30); - std::cout << t << std::endl; - - std::cout << "BEFORE - nbboxes = " << nbboxes << std::endl; - - scribo::debug::save_linked_textbboxes_image(input, - text, left_link, right_link, - literal::red, literal::cyan, literal::yellow, - literal::green, - scribo::make::debug_filename("links.ppm")); - - // With validation. - std::cout << "Group from double link" << std::endl; - t.restart(); - scribo::util::text<image2d<value::label_16> > grouped_text - = text::grouping::group_from_double_link(text, left_link, right_link); - std::cout << t << std::endl; - std::cout << "Full process: " << t2 << std::endl; - std::cout << "Cleanup and grouping process: " << t3 << std::endl; + text = text::grouping::group_from_double_link(text, left_link, right_link); io::ppm::save(mln::labeling::colorize(value::rgb8(), - grouped_text.label_image(), - grouped_text.nbboxes()), - scribo::make::debug_filename("label_color.ppm")); - - std::cout << "AFTER double grouping - nbboxes = " << grouped_text.bboxes().nelements() << std::endl; + labeling::wrap(text.label_image())), + scribo::make::debug_filename("lbl_color.ppm")); + io::pgm::save(labeling::wrap(text.label_image()), + scribo::make::debug_filename("lbl.pgm")); - scribo::debug::save_textbboxes_image(input, grouped_text.bboxes(), - literal::red, - scribo::make::debug_filename("bboxes.ppm")); + image2d<char> ima_txt = scribo::text::recognition(text, "fra"); + io::txt::save(ima_txt, argv[2]); } diff --git a/milena/sandbox/scribo/src/rectangularity.cc b/scribo/src/rectangularity.cc similarity index 100% rename from milena/sandbox/scribo/src/rectangularity.cc rename to scribo/src/rectangularity.cc diff --git a/milena/sandbox/scribo/src/table.cc b/scribo/src/table.cc similarity index 100% copy from milena/sandbox/scribo/src/table.cc copy to scribo/src/table.cc diff --git a/milena/sandbox/scribo/src/table_erase.cc b/scribo/src/table_erase.cc similarity index 78% rename from milena/sandbox/scribo/src/table_erase.cc rename to scribo/src/table_erase.cc index 3cfcb46..15cf880 100644 --- a/milena/sandbox/scribo/src/table_erase.cc +++ b/scribo/src/table_erase.cc @@ -27,11 +27,17 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> +#include <mln/io/pbm/load.hh> +#include <mln/io/pbm/save.hh> #include <mln/io/dump/save.hh> +#include <mln/value/label_16.hh> +#include <mln/core/alias/neighb2d.hh> #include <scribo/table/extract.hh> +#include <scribo/primitive/lines_h_discontinued.hh> +#include <scribo/primitive/lines_v_discontinued.hh> int usage(const char *name) { @@ -44,6 +50,7 @@ int main(int argc, char* argv[]) { using namespace scribo; using namespace mln; + using mln::value::label_16; if (argc < 1) return usage(argv[0]); @@ -57,10 +64,12 @@ int main(int argc, char* argv[]) typedef util::couple<util::array<box2d>, util::array<box2d> > tables_t; - value::label_16 ncells; - tables_t tables = scribo::table::extract_lines_with_rank(input, c8(), ncells, - win::vline2d(51), win::hline2d(51), - 8,6); + label_16 nhlines, nvlines; + util::array<box2d> vlines, hlines; + image2d<label_16> lbl_v = primitive::lines_v_discontinued(input, c8(), + nvlines, 51, 8); + image2d<label_16> lbl_h = primitive::lines_h_discontinued(input, c8(), + nhlines, 51, 6); image2d<bool> input_notables = scribo::table::erase(input, tables); io::pbm::save(input_notables, scribo::make::debug_filename("input_notables.pbm")); diff --git a/milena/sandbox/scribo/src/table_extract.cc b/scribo/src/table_extract.cc similarity index 100% rename from milena/sandbox/scribo/src/table_extract.cc rename to scribo/src/table_extract.cc diff --git a/milena/sandbox/scribo/src/table.cc b/scribo/src/table_old.cc similarity index 99% rename from milena/sandbox/scribo/src/table.cc rename to scribo/src/table_old.cc index 3a12c57..86e039b 100644 --- a/milena/sandbox/scribo/src/table.cc +++ b/scribo/src/table_old.cc @@ -26,7 +26,7 @@ // Public License. -#include <demat.hh> +#include "demat.old.hh" int main(int argc, char*argv[]) { diff --git a/milena/sandbox/scribo/src/table_rebuild_opening.cc b/scribo/src/table_rebuild_opening.cc similarity index 100% rename from milena/sandbox/scribo/src/table_rebuild_opening.cc rename to scribo/src/table_rebuild_opening.cc diff --git a/milena/sandbox/scribo/src/table_rebuild_rank.cc b/scribo/src/table_rebuild_rank.cc similarity index 100% rename from milena/sandbox/scribo/src/table_rebuild_rank.cc rename to scribo/src/table_rebuild_rank.cc diff --git a/milena/sandbox/scribo/src/thin_bboxes.cc b/scribo/src/thin_bboxes.cc similarity index 100% rename from milena/sandbox/scribo/src/thin_bboxes.cc rename to scribo/src/thin_bboxes.cc diff --git a/milena/sandbox/scribo/table/align_lines_horizontaly.hh b/scribo/table/align_lines_horizontaly.hh similarity index 100% rename from milena/sandbox/scribo/table/align_lines_horizontaly.hh rename to scribo/table/align_lines_horizontaly.hh diff --git a/milena/sandbox/scribo/table/align_lines_verticaly.hh b/scribo/table/align_lines_verticaly.hh similarity index 100% rename from milena/sandbox/scribo/table/align_lines_verticaly.hh rename to scribo/table/align_lines_verticaly.hh diff --git a/milena/sandbox/scribo/table/all.hh b/scribo/table/all.hh similarity index 100% rename from milena/sandbox/scribo/table/all.hh rename to scribo/table/all.hh diff --git a/milena/sandbox/scribo/table/connect_horizontal_lines.hh b/scribo/table/connect_horizontal_lines.hh similarity index 100% rename from milena/sandbox/scribo/table/connect_horizontal_lines.hh rename to scribo/table/connect_horizontal_lines.hh diff --git a/milena/sandbox/scribo/table/connect_vertical_lines.hh b/scribo/table/connect_vertical_lines.hh similarity index 100% rename from milena/sandbox/scribo/table/connect_vertical_lines.hh rename to scribo/table/connect_vertical_lines.hh diff --git a/milena/sandbox/scribo/table/erase.hh b/scribo/table/erase.hh similarity index 100% rename from milena/sandbox/scribo/table/erase.hh rename to scribo/table/erase.hh diff --git a/milena/sandbox/scribo/table/extract.hh b/scribo/table/extract.hh similarity index 100% rename from milena/sandbox/scribo/table/extract.hh rename to scribo/table/extract.hh diff --git a/milena/sandbox/scribo/table/extract_lines_with_opening.hh b/scribo/table/extract_lines_with_opening.hh similarity index 100% rename from milena/sandbox/scribo/table/extract_lines_with_opening.hh rename to scribo/table/extract_lines_with_opening.hh diff --git a/milena/sandbox/scribo/table/extract_lines_with_rank.hh b/scribo/table/extract_lines_with_rank.hh similarity index 100% rename from milena/sandbox/scribo/table/extract_lines_with_rank.hh rename to scribo/table/extract_lines_with_rank.hh diff --git a/milena/sandbox/scribo/table/internal/align_lines.hh b/scribo/table/internal/align_lines.hh similarity index 99% rename from milena/sandbox/scribo/table/internal/align_lines.hh rename to scribo/table/internal/align_lines.hh index 0902bd4..78ee511 100644 --- a/milena/sandbox/scribo/table/internal/align_lines.hh +++ b/scribo/table/internal/align_lines.hh @@ -36,6 +36,9 @@ # include <mln/core/site_set/box.hh> + +# include <mln/accu/mean.hh> + # include <mln/util/array.hh> # include <mln/util/set.hh> diff --git a/milena/sandbox/scribo/table/internal/all.hh b/scribo/table/internal/all.hh similarity index 100% rename from milena/sandbox/scribo/table/internal/all.hh rename to scribo/table/internal/all.hh diff --git a/milena/sandbox/scribo/table/internal/connect_lines.hh b/scribo/table/internal/connect_lines.hh similarity index 100% rename from milena/sandbox/scribo/table/internal/connect_lines.hh rename to scribo/table/internal/connect_lines.hh diff --git a/milena/sandbox/scribo/table/internal/repair_lines.hh b/scribo/table/internal/repair_lines.hh similarity index 95% rename from milena/sandbox/scribo/table/internal/repair_lines.hh rename to scribo/table/internal/repair_lines.hh index 017737c..8b4b297 100644 --- a/milena/sandbox/scribo/table/internal/repair_lines.hh +++ b/scribo/table/internal/repair_lines.hh @@ -35,19 +35,32 @@ # include <vector> -# include <mln/core/concept/image.hh> +# include <mln/core/image/image_if.hh> # include <mln/core/image/extension_val.hh> + +# include <mln/pw/all.hh> + +# include <mln/literal/zero.hh> + # include <mln/core/site_set/box.hh> + +# include <mln/core/routine/extend.hh> + # include <mln/data/fill.hh> + # include <mln/util/couple.hh> # include <mln/util/array.hh> # include <mln/util/ord.hh> + # include <mln/win/line.hh> -# include <mln/pw/all.hh> # include <mln/labeling/colorize.hh> + # include <mln/value/rgb8.hh> # include <mln/value/label_16.hh> + +# include <mln/core/var.hh> + # include <scribo/make/debug_filename.hh> # include <scribo/core/central_sites.hh> @@ -106,7 +119,7 @@ namespace scribo util::array<box<P> > result; std::vector<bool> to_keep(tableboxes.nelements(), true); - mln_VAR(tbb_ima, extend(l | pw::value(l) != pw::cst(literal::zero), l)); + mln_VAR(tbb_ima, extend(l | (pw::value(l) != pw::cst(literal::zero)), l)); //FIXME: use a half window, just the bottom of the vertical line. line_t vl(max_discontinuity); mln_piter(tbb_ima_t) p(tbb_ima.domain()); diff --git a/milena/sandbox/scribo/table/rebuild.hh b/scribo/table/rebuild.hh similarity index 96% rename from milena/sandbox/scribo/table/rebuild.hh rename to scribo/table/rebuild.hh index a446c3a..da53432 100644 --- a/milena/sandbox/scribo/table/rebuild.hh +++ b/scribo/table/rebuild.hh @@ -34,10 +34,12 @@ /// Rebuild a table from its line bounding boxes. # include <mln/core/concept/image.hh> +# include <mln/core/alias/neighb2d.hh> # include <mln/labeling/background.hh> # include <mln/util/array.hh> # include <mln/util/couple.hh> # include <mln/value/label_8.hh> +# include <mln/literal/colors.hh> # include <scribo/table/align_lines_verticaly.hh> # include <scribo/table/align_lines_horizontaly.hh> @@ -116,8 +118,8 @@ namespace scribo literal::red, "table-aligned.ppm"); # endif - repair_vertical_lines(input, linebboxes, 30); - repair_horizontal_lines(input, linebboxes, 30); + repair_vertical_lines(input, linebboxes, 10); + repair_horizontal_lines(input, linebboxes, 10); # ifndef SCRIBO_NDEBUG scribo::debug::save_table_image(input, linebboxes, diff --git a/milena/sandbox/scribo/table/repair_horizontal_lines.hh b/scribo/table/repair_horizontal_lines.hh similarity index 100% rename from milena/sandbox/scribo/table/repair_horizontal_lines.hh rename to scribo/table/repair_horizontal_lines.hh diff --git a/milena/sandbox/scribo/table/repair_vertical_lines.hh b/scribo/table/repair_vertical_lines.hh similarity index 100% rename from milena/sandbox/scribo/table/repair_vertical_lines.hh rename to scribo/table/repair_vertical_lines.hh diff --git a/scribo/test.cc b/scribo/test.cc new file mode 100644 index 0000000..ea39c12 --- /dev/null +++ b/scribo/test.cc @@ -0,0 +1,18 @@ +#include <mln/essential/2d.hh> +#include <mln/util/ord.hh> + +int main() +{ + using namespace mln; + + + point2d p1(0, 2); + point2d p2(0, 2); + + std::cout << util::ord_strict(p1, p2) << std::endl; + std::cout << util::ord_weak(p1, p2) << std::endl; + + std::cout << util::ord_strict(p2, p1) << std::endl; + std::cout << util::ord_weak(p2, p1) << std::endl; + +} diff --git a/milena/sandbox/scribo/tests/Makefile.am b/scribo/tests/Makefile.am similarity index 100% rename from milena/sandbox/scribo/tests/Makefile.am rename to scribo/tests/Makefile.am diff --git a/milena/sandbox/scribo/tests/data.hh.in b/scribo/tests/data.hh.in similarity index 95% rename from milena/sandbox/scribo/tests/data.hh.in rename to scribo/tests/data.hh.in index 7196653..6a6f95f 100644 --- a/milena/sandbox/scribo/tests/data.hh.in +++ b/scribo/tests/data.hh.in @@ -34,6 +34,6 @@ (as well as additional burden in Makefiles, too.). */ /// \brief The absolute path to the img directory of Scribo. -# define SCRIBO_IMG_DIR "@abs_top_srcdir@/milena/sandbox/scribo/tests/img" +# define SCRIBO_IMG_DIR "@abs_top_srcdir@/scribo/tests/img" #endif // ! SCRIBO_TESTS_DATA_HH diff --git a/milena/sandbox/scribo/tests/filter/Makefile.am b/scribo/tests/filter/Makefile.am similarity index 78% rename from milena/sandbox/scribo/tests/filter/Makefile.am rename to scribo/tests/filter/Makefile.am index 0f01eea..d8b1d93 100644 --- a/milena/sandbox/scribo/tests/filter/Makefile.am +++ b/scribo/tests/filter/Makefile.am @@ -1,6 +1,6 @@ ## Process this file through Automake to create Makefile.in. -include $(top_srcdir)/milena/sandbox/scribo/scribo.mk +include $(top_srcdir)/scribo/scribo.mk check_PROGRAMS = \ small_and_large_bboxes diff --git a/milena/sandbox/scribo/tests/filter/small_and_large_bboxes.cc b/scribo/tests/filter/small_and_large_bboxes.cc similarity index 100% rename from milena/sandbox/scribo/tests/filter/small_and_large_bboxes.cc rename to scribo/tests/filter/small_and_large_bboxes.cc diff --git a/milena/sandbox/scribo/tests/table/Makefile.am b/scribo/tests/table/Makefile.am similarity index 82% rename from milena/sandbox/scribo/tests/table/Makefile.am rename to scribo/tests/table/Makefile.am index 0e008bc..7ad10ad 100644 --- a/milena/sandbox/scribo/tests/table/Makefile.am +++ b/scribo/tests/table/Makefile.am @@ -1,6 +1,6 @@ ## Process this file through Automake to create Makefile.in. -include $(top_srcdir)/milena/sandbox/scribo/scribo.mk +include $(top_srcdir)/scribo/scribo.mk check_PROGRAMS = \ extract_lines_with_rank \ diff --git a/milena/sandbox/scribo/tests/table/extract_lines_with_rank.cc b/scribo/tests/table/extract_lines_with_rank.cc similarity index 72% rename from milena/sandbox/scribo/tests/table/extract_lines_with_rank.cc rename to scribo/tests/table/extract_lines_with_rank.cc index 6b36b35..16e8066 100644 --- a/milena/sandbox/scribo/tests/table/extract_lines_with_rank.cc +++ b/scribo/tests/table/extract_lines_with_rank.cc @@ -29,7 +29,7 @@ #include <mln/essential/2d.hh> #include <mln/util/couple.hh> -#include <scribo/table/extract_lines_with_rank.hh> +#include <scribo/primitive/discontinued_lines.hh> #include <scribo/debug/save_table_image.hh> #include <scribo/tests/data.hh> @@ -47,21 +47,24 @@ int main(int argc, char *argv[]) image2d<bool> input; io::pbm::load(input, img.c_str()); - typedef util::couple<util::array<box2d>, - util::array<box2d> > tblboxes_t; + typedef util::array<box2d> lineboxes_t; - tblboxes_t lineboxes; - lineboxes.first().append(make::box2d(0,0, 59,59)); - lineboxes.first().append(make::box2d(0,28, 27, 32)); - lineboxes.first().append(make::box2d(31,28, 59,32)); - lineboxes.second().append(make::box2d(0,0, 59,59)); - lineboxes.second().append(make::box2d(27,0, 31, 26)); - lineboxes.second().append(make::box2d(27,34, 31,59)); + lineboxes_t + vboxes, + hboxes; + vboxes.append(make::box2d(0,0, 59,59)); + vboxes.append(make::box2d(0,28, 27, 32)); + vboxes.append(make::box2d(31,28, 59,32)); + hboxes.append(make::box2d(0,0, 59,59)); + hboxes.append(make::box2d(27,0, 31, 26)); + hboxes.append(make::box2d(27,34, 31,59)); value::label_16 nbboxes; - tblboxes_t lineboxes_test = scribo::table::extract_lines_with_rank(input, c8(), - nbboxes, win::vline2d(11), - win::hline2d(11), 2, 2); - mln_assertion(lineboxes == lineboxes_test); + lineboxes_t hboxes_ = scribo::primitive::discontinued_lines(input, c8(), + nbboxes, win::hline2d(11), 2); + lineboxes_t vboxes_ = scribo::primitive::discontinued_lines(input, c8(), + nbboxes, win::vline2d(11), 2); + mln_assertion(hboxes_ == hboxes); + mln_assertion(vboxes_ == vboxes); } diff --git a/milena/sandbox/scribo/tests/table/repair_lines.cc b/scribo/tests/table/repair_lines.cc similarity index 100% rename from milena/sandbox/scribo/tests/table/repair_lines.cc rename to scribo/tests/table/repair_lines.cc diff --git a/milena/sandbox/scribo/tests/text/Makefile.am b/scribo/tests/text/Makefile.am similarity index 66% rename from milena/sandbox/scribo/tests/text/Makefile.am rename to scribo/tests/text/Makefile.am index 70e77bf..aef6460 100644 --- a/milena/sandbox/scribo/tests/text/Makefile.am +++ b/scribo/tests/text/Makefile.am @@ -1,6 +1,6 @@ ## Process this file through Automake to create Makefile.in. -include $(top_srcdir)/milena/sandbox/scribo/scribo.mk +include $(top_srcdir)/scribo/scribo.mk check_PROGRAMS = diff --git a/milena/sandbox/scribo/text/all.hh b/scribo/text/all.hh similarity index 100% rename from milena/sandbox/scribo/text/all.hh rename to scribo/text/all.hh diff --git a/scribo/text/clean.hh b/scribo/text/clean.hh new file mode 100644 index 0000000..c8fa552 --- /dev/null +++ b/scribo/text/clean.hh @@ -0,0 +1,109 @@ +// Copyright (C) 2009 EPITA Research and Development Laboratory +// (LRDE) +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library 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 this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library 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_TEXT_CLEAN_HH +# define SCRIBO_TEXT_CLEAN_HH + +/// \file scribo/text/clean.hh +/// +/// Improve the quality of a text area. + +# include <mln/core/concept/weighted_window.hh> +# include <mln/morpho/skeleton_constrained.hh> +# include <mln/topo/skeleton/is_simple_point.hh> +# include <mln/topo/skeleton/crest.hh> + +# include <mln/logical/not.hh> + +//# include <mln/debug/filename.hh> +//# include <mln/io/pbm/save.hh> + +namespace scribo +{ + + namespace text + { + + template <typename I, typename W> + mln_concrete(I) + clean(const Image<I>& input_, const Weighted_Window<W>& dmap_win_); + + +# ifndef MLN_INCLUDE_ONLY + + +// static int plop = 0; + + template <typename I, typename W> + mln_concrete(I) + clean(const Image<I>& input_, const Weighted_Window<W>& dmap_win_) + { + trace::entering("scribo::text::clean"); + + const I& input = exact(input_); + const W& dmap_win = exact(dmap_win_); + mlc_bool(mln_site_(I)::dim == 2)::check(); + mlc_equal(mln_value(I),bool)::check(); + mln_precondition(input.is_valid()); + mln_precondition(dmap_win.is_valid()); + + mln_ch_value(I,unsigned) + dmap = transform::distance_front(logical::not_(input), c8(), + dmap_win, + mln_max(unsigned)); + + I constraint = topo::skeleton::crest(input, dmap, c8()); + mln_postcondition(constraint.is_valid()); + + I skeleton = + morpho::skeleton_constrained(input, c8(), + topo::skeleton::is_simple_point<I,neighb2d>, + extend(constraint, false), dmap); + + win::rectangle2d disk(3,3); + I output = morpho::dilation(skeleton, disk); + +// if (plop < 10) +// { +// io::pbm::save(input, mln::debug::filename("input.pbm")); +// io::pbm::save(skeleton, mln::debug::filename("skeleton.pbm")); +// io::pbm::save(output, mln::debug::filename("dil_skel.pbm")); +// ++plop; +// } + + trace::exiting("scribo::text::clean"); + return output; + } + +# endif // ! MLN_INCLUDE_ONLY + + } // end of namespace scribo::text + +} // end of namespace scribo + +#endif // ! SCRIBO_TEXT_CLEAN_HH diff --git a/milena/sandbox/scribo/text/extract_bboxes.hh b/scribo/text/extract_bboxes.hh similarity index 100% rename from milena/sandbox/scribo/text/extract_bboxes.hh rename to scribo/text/extract_bboxes.hh diff --git a/milena/sandbox/scribo/text/extract_lines.hh b/scribo/text/extract_lines.hh similarity index 100% rename from milena/sandbox/scribo/text/extract_lines.hh rename to scribo/text/extract_lines.hh diff --git a/milena/sandbox/scribo/text/grouping/all.hh b/scribo/text/grouping/all.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/all.hh rename to scribo/text/grouping/all.hh diff --git a/milena/sandbox/scribo/text/grouping/group_from_double_link.hh b/scribo/text/grouping/group_from_double_link.hh similarity index 85% rename from milena/sandbox/scribo/text/grouping/group_from_double_link.hh rename to scribo/text/grouping/group_from_double_link.hh index 3ce5521..7caac87 100644 --- a/milena/sandbox/scribo/text/grouping/group_from_double_link.hh +++ b/scribo/text/grouping/group_from_double_link.hh @@ -30,9 +30,12 @@ #ifndef SCRIBO_TEXT_GROUPING_GROUP_FROM_DOUBLE_LINK_HH # define SCRIBO_TEXT_GROUPING_GROUP_FROM_DOUBLE_LINK_HH + /// \file scribo/text/grouping/group_from_double_link.hh /// -/// Link text bounding boxes with their left neighbor. +/// Group text bounding boxes from left and right links and validate +/// These links. A link must exist in both ways to be validated. + # include <mln/core/concept/image.hh> # include <mln/core/site_set/box.hh> @@ -45,6 +48,8 @@ # include <scribo/util/text.hh> +# include <scribo/make/text.hh> + # include <scribo/text/grouping/internal/find_root.hh> # include <scribo/text/grouping/internal/is_link_valid.hh> @@ -74,8 +79,11 @@ namespace scribo const mln::util::array<unsigned>& left_link, const mln::util::array<unsigned>& right_link); + + # ifndef MLN_INCLUDE_ONLY + template <typename I> inline scribo::util::text<I> @@ -116,32 +124,15 @@ namespace scribo fun::i2v::array<unsigned> f; convert::from_to(parent, f); - // Update bounding boxes information. - mln::util::array< box<mln_site(I)> > bresult; - // component 0, the background, has an invalid box. - bresult.append(box<mln_site(I)>()); - for_all_components(i, tboxes) - if (tboxes[i].is_valid()) - bresult.append(tboxes[i]); - - // Update label image. - mln_value(I) new_nbboxes; - I new_lbl = labeling::relabel(text.label_image(), - text.nbboxes(), - mln::make::relabelfun(f, text.nbboxes(), - new_nbboxes)); - - mln_assertion(bresult.nelements() == new_nbboxes.next()); - - /// FIXME: construct a new util::text from the old one. - scribo::util::text<I> result(bresult, new_lbl, new_nbboxes); - + scribo::util::text<I> result = make::text(text, f); trace::exiting("scribo::text::grouping::group_from_double_link"); return result; } + # endif // ! MLN_INCLUDE_ONLY + } // end of namespace scribo::text::grouping } // end of namespace scribo::text diff --git a/milena/sandbox/scribo/text/grouping/group_from_graph.hh b/scribo/text/grouping/group_from_graph.hh similarity index 84% rename from milena/sandbox/scribo/text/grouping/group_from_graph.hh rename to scribo/text/grouping/group_from_graph.hh index 774ed6b..3c6ac3a 100644 --- a/milena/sandbox/scribo/text/grouping/group_from_graph.hh +++ b/scribo/text/grouping/group_from_graph.hh @@ -150,32 +150,33 @@ namespace scribo internal::map_vertex_to_component_id_functor<mln_value(I)> f; canvas::browsing::depth_first_search(g, f); - mln::util::array< accu::bbox<mln_site(I)> > tboxes; - tboxes.resize(text.nbboxes().next()); - for_all_components(i, text.bboxes()) - tboxes[f.vertextocomp(i)].take(text.bbox(i)); - - // Update bounding boxes. - mln::util::array<box<mln_site(I)> > bresult; - // Component 0 - the background has not valid bboxes. - bresult.append(box<mln_site(I)>()); - for_all_components(i, text.bboxes()) - if (tboxes[i].is_valid()) - bresult.append(tboxes[i].to_result()); - - mln_assertion(bresult.nelements() == f.ncomp); - - // Update label image. - mln_value(I) new_nbboxes; - I new_lbl = labeling::relabel(text.label_image(), - text.nbboxes(), - f.vertextocomp); - - mln_assertion(new_nbboxes.next() == bresult.nelements()); +// mln::util::array< accu::bbox<mln_site(I)> > tboxes; +// tboxes.resize(text.nbboxes().next()); +// for_all_components(i, text.bboxes()) +// tboxes[f.vertextocomp(i)].take(text.bbox(i)); +// +// // Update bounding boxes. +// mln::util::array<box<mln_site(I)> > bresult; +// // Component 0 - the background has not valid bboxes. +// bresult.append(box<mln_site(I)>()); +// for_all_components(i, text.bboxes()) +// if (tboxes[i].is_valid()) +// bresult.append(tboxes[i].to_result()); +// +// mln_assertion(bresult.nelements() == f.ncomp); +// +// // Update label image. +// mln_value(I) new_nbboxes; +// I new_lbl = labeling::relabel(text.label_image(), +// text.nbboxes(), +// f.vertextocomp); +// +// mln_assertion(new_nbboxes.next() == bresult.nelements()); trace::exiting("scribo::text::grouping::group_from_graph"); /// FIXME: construct a new util::text from the old one. - return scribo::make::text(bresult, new_lbl, new_nbboxes); +// return scribo::make::text(bresult, new_lbl, new_nbboxes); + return scribo::make::text(text, f.vertextocomp); } diff --git a/milena/sandbox/scribo/text/grouping/group_from_single_link.hh b/scribo/text/grouping/group_from_single_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/group_from_single_link.hh rename to scribo/text/grouping/group_from_single_link.hh diff --git a/milena/sandbox/scribo/text/grouping/group_with_graph.hh b/scribo/text/grouping/group_with_graph.hh similarity index 99% rename from milena/sandbox/scribo/text/grouping/group_with_graph.hh rename to scribo/text/grouping/group_with_graph.hh index 490d0d3..555e3c2 100644 --- a/milena/sandbox/scribo/text/grouping/group_with_graph.hh +++ b/scribo/text/grouping/group_with_graph.hh @@ -39,6 +39,7 @@ # include <mln/math/abs.hh> # include <mln/util/array.hh> +# include <mln/util/graph.hh> # include <scribo/core/macros.hh> # include <scribo/text/grouping/internal/init_link_array.hh> diff --git a/milena/sandbox/scribo/text/grouping/group_with_several_graphes.hh b/scribo/text/grouping/group_with_several_graphes.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/group_with_several_graphes.hh rename to scribo/text/grouping/group_with_several_graphes.hh diff --git a/milena/sandbox/scribo/text/grouping/group_with_several_left_links.hh b/scribo/text/grouping/group_with_several_left_links.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/group_with_several_left_links.hh rename to scribo/text/grouping/group_with_several_left_links.hh diff --git a/milena/sandbox/scribo/text/grouping/group_with_several_right_links.hh b/scribo/text/grouping/group_with_several_right_links.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/group_with_several_right_links.hh rename to scribo/text/grouping/group_with_several_right_links.hh diff --git a/milena/sandbox/scribo/text/grouping/group_with_single_left_link.hh b/scribo/text/grouping/group_with_single_left_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/group_with_single_left_link.hh rename to scribo/text/grouping/group_with_single_left_link.hh diff --git a/milena/sandbox/scribo/text/grouping/group_with_single_right_link.hh b/scribo/text/grouping/group_with_single_right_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/group_with_single_right_link.hh rename to scribo/text/grouping/group_with_single_right_link.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/all.hh b/scribo/text/grouping/internal/all.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/all.hh rename to scribo/text/grouping/internal/all.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/find_graph_link.hh b/scribo/text/grouping/internal/find_graph_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/find_graph_link.hh rename to scribo/text/grouping/internal/find_graph_link.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/find_left_link.hh b/scribo/text/grouping/internal/find_left_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/find_left_link.hh rename to scribo/text/grouping/internal/find_left_link.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/find_right_link.hh b/scribo/text/grouping/internal/find_right_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/find_right_link.hh rename to scribo/text/grouping/internal/find_right_link.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/find_root.hh b/scribo/text/grouping/internal/find_root.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/find_root.hh rename to scribo/text/grouping/internal/find_root.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/init_link_array.hh b/scribo/text/grouping/internal/init_link_array.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/init_link_array.hh rename to scribo/text/grouping/internal/init_link_array.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/is_link_valid.hh b/scribo/text/grouping/internal/is_link_valid.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/is_link_valid.hh rename to scribo/text/grouping/internal/is_link_valid.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/update_graph_link.hh b/scribo/text/grouping/internal/update_graph_link.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/update_graph_link.hh rename to scribo/text/grouping/internal/update_graph_link.hh diff --git a/milena/sandbox/scribo/text/grouping/internal/update_link_array.hh b/scribo/text/grouping/internal/update_link_array.hh similarity index 100% rename from milena/sandbox/scribo/text/grouping/internal/update_link_array.hh rename to scribo/text/grouping/internal/update_link_array.hh diff --git a/milena/sandbox/scribo/text/recognition.hh b/scribo/text/recognition.hh similarity index 65% rename from milena/sandbox/scribo/text/recognition.hh rename to scribo/text/recognition.hh index 1fa3905..287be34 100644 --- a/milena/sandbox/scribo/text/recognition.hh +++ b/scribo/text/recognition.hh @@ -36,20 +36,37 @@ /// \todo For each text bbox, we create a new image. We may like to avoid that. /// \todo Do not store the result in an image? -# include <mln/core/concept/image.hh> +# include <mln/core/image/image_if.hh> # include <mln/core/concept/neighborhood.hh> # include <mln/core/site_set/box.hh> # include <mln/util/array.hh> # include <mln/labeling/blobs.hh> # include <mln/data/fill.hh> # include <mln/pw/all.hh> -# include <mln/debug/put_words.hh> + +# include <mln/transform/distance_front.hh> + +# include <mln/morpho/thickening.hh> +# include <mln/morpho/dilation.hh> + +# include <mln/core/alias/w_window2d_int.hh> +# include <mln/make/w_window2d_int.hh> + +# include <mln/border/resize.hh> + +# include <mln/win/rectangle2d.hh> +# include <mln/win/disk2d.hh> +# include <mln/win/octagon2d.hh> + +# include <mln/debug/put_word.hh> # include <scribo/core/macros.hh> + # include <scribo/util/text.hh> -# include <tesseract/baseapi.h> +# include <scribo/text/clean.hh> +# include <tesseract/baseapi.h> namespace scribo @@ -62,65 +79,74 @@ namespace scribo /// Passes the text bboxes to Tesseract (OCR). /// - /// \param[in] input_ Image from where the text is extracted. /// \param[in] text The lines of text. /// \param[in] language the language which should be recognized by Tesseract. /// (fra, en, ...) /// /// \return An image of characters. - template <typename I, typename L> - mln_ch_value(I,char) - text_recognition(const Image<I>& input_, - const scribo::util::text<L>& text, - const char *language); + template <typename L> + mln_ch_value(L,char) + recognition(const scribo::util::text<L>& text, + const char *language); + # ifndef MLN_INCLUDE_ONLY - template <typename I, typename L> - mln_ch_value(I,char) - text_recognition(const Image<I>& input_, - const scribo::util::text<L>& text, - const char *language) + + template <typename L> + mln_ch_value(L,char) + recognition(const scribo::util::text<L>& text, + const char *language) { trace::entering("scribo::text::recognition"); - mlc_equal(mln_value(I), bool)::check(); - const I& input = exact(input_); - mln_precondition(input.is_valid()); mln_precondition(text.is_valid()); // Initialize Tesseract. TessBaseAPI::InitWithLanguage(NULL, NULL, language, NULL, false, 0, NULL); - mln_ch_value(I,char) txt(input.domain()); + mln_ch_value(L,char) txt(text.label_image().domain()); data::fill(txt, ' '); + typedef mln_ch_value(L,bool) I; + int vals[] = { 0, 9, 0, 9, 0, + 9, 6, 4, 6, 9, + 0, 4, 0, 4, 0, + 9, 6, 4, 6, 9, + 0, 9, 0, 9, 0 }; + w_window2d_int dmap_win = mln::make::w_window2d_int(vals); + /// Use text bboxes with Tesseract for_all_components(i, text.bboxes()) { - mln_ch_value(I,bool) b(text.bbox(i), 0); - data::fill(b, false); - data::fill((b | (pw::value(text.label_image()) == pw::cst(i))).rw(), + I text_ima(text.bbox(i)); + data::fill(text_ima, false); + data::fill((text_ima | (pw::value(text.label_image()) == pw::cst(i))).rw(), true); + + /// Improve text quality. + I text_ima_cleaned = text::clean(text_ima, dmap_win); + border::resize(text_ima_cleaned, 0); // Make sure there is no border. + // Recognize characters. char* s = TessBaseAPI::TesseractRect( - (unsigned char*) b.buffer(), - sizeof (bool), // Pixel size. - b.ncols() * sizeof (bool), // Row_offset - 0, // Left - 0, // Top - b.ncols(), // n cols - b.nrows()); // n rows + (unsigned char*) text_ima_cleaned.buffer(), + sizeof (bool), // Pixel size. + text_ima.ncols() * sizeof (bool), // Row_offset + 0, // Left + 0, // Top + text_ima.ncols(), // n cols + text_ima.nrows()); // n rows - mln_site(I) p = text.bbox(i).center(); + mln_site(L) p = text.bbox(i).center(); p.col() -= (text.bbox(i).pmax().col() - text.bbox(i).pmin().col()) / 2; if (s != 0) - debug::put_word(txt, p, s); + mln::debug::put_word(txt, p, s); // The string has been allocated by Tesseract. We must free it. free(s); diff --git a/milena/sandbox/scribo/util/all.hh b/scribo/util/all.hh similarity index 100% rename from milena/sandbox/scribo/util/all.hh rename to scribo/util/all.hh diff --git a/milena/sandbox/scribo/util/text.hh b/scribo/util/text.hh similarity index 94% rename from milena/sandbox/scribo/util/text.hh rename to scribo/util/text.hh index ceb5765..b9f7406 100644 --- a/milena/sandbox/scribo/util/text.hh +++ b/scribo/util/text.hh @@ -86,12 +86,10 @@ namespace scribo /// @} /// Return the underlying label image. + /// @{ const L& label_image() const; - - /// Update the label image. - /// Note: Updating the label image update the bounding boxes - /// and the mass centers as well. - void set_label_image(const Image<L>& lbl); + L& label_image(); + /// @} /// Return the number of bounding boxes. const mln_value(L)& nbboxes() const; @@ -109,7 +107,11 @@ namespace scribo box<mln_site(L)>& bbox(unsigned i); /// Return the mass centers. + /// @{ const mln::util::array<mln_site(L)::vec>& mass_centers() const; + mln::util::array<mln_site(L)::vec>& mass_centers(); + /// @} + /// Return the i-th mass centers. mln_site(L) mass_center(unsigned i) const; @@ -169,6 +171,15 @@ namespace scribo template <typename L> inline + L& + text<L>::label_image() + { +// mln_precondition(lbl_.is_valid()); + return lbl_; + } + + template <typename L> + inline const mln_value(L)& text<L>::nbboxes() const { @@ -230,6 +241,14 @@ namespace scribo template <typename L> inline + mln::util::array<mln_site(L)::vec>& + text<L>::mass_centers() + { + return mass_centers_; + } + + template <typename L> + inline mln_site(L) text<L>::mass_center(unsigned i) const { -- 1.5.6.5