4118: Compile more examples in Scribo.

* src/Makefile.am: compile new examples. * filter/large_objects.hh: fix use of accu::math::count. * src/extract/primitive/extract_discontinued_hlines.cc, * src/extract/primitive/extract_discontinued_lines.cc, * src/extract/primitive/extract_discontinued_vlines.cc, * src/extract/primitive/extract_thick_hlines.cc, * src/extract/primitive/extract_thick_vlines.cc, * src/extract/primitive/find_discontinued_lines.cc, * src/extract_text_double_several_links.cc, * src/extract_text_several_graph.cc, * src/extract_text_several_left_links.cc, * src/filter/large_objects.cc, * src/filter/small_objects.cc, * src/filter/thick_objects.cc, * src/filter/thin_objects.cc, * src/morpho.cc, * src/rectangularity.cc, * src/thin_bboxes.cc: - Do not use essential/2d.hh - Specify the namespace of the usage() routine. --- scribo/ChangeLog | 27 ++++++++++++++ scribo/filter/large_objects.hh | 4 +- scribo/src/Makefile.am | 4 ++ .../primitive/extract_discontinued_hlines.cc | 7 +++- .../primitive/extract_discontinued_lines.cc | 8 +++-- .../primitive/extract_discontinued_vlines.cc | 7 +++- .../src/extract/primitive/extract_thick_hlines.cc | 7 +++- .../src/extract/primitive/extract_thick_vlines.cc | 7 +++- .../extract/primitive/find_discontinued_lines.cc | 8 +++-- scribo/src/extract_text_double_several_links.cc | 10 +++++- scribo/src/extract_text_several_graph.cc | 18 ++++++++-- scribo/src/extract_text_several_left_links.cc | 15 +++++++- scribo/src/filter/large_objects.cc | 11 ++++-- scribo/src/filter/small_objects.cc | 11 ++++-- scribo/src/filter/thick_objects.cc | 11 ++++-- scribo/src/filter/thin_objects.cc | 11 ++++-- scribo/src/morpho.cc | 23 +++++++++++- scribo/src/rectangularity.cc | 39 ++++++++++++++------ scribo/src/thin_bboxes.cc | 11 +++++- 19 files changed, 188 insertions(+), 51 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index bf302c2..3d9c37d 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,3 +1,30 @@ +2009-06-12 Guillaume Lazzara <lazzara@lrde.epita.fr> + + Compile more examples in Scribo. + + * src/Makefile.am: compile new examples. + + * filter/large_objects.hh: fix use of accu::math::count. + + * src/extract/primitive/extract_discontinued_hlines.cc, + * src/extract/primitive/extract_discontinued_lines.cc, + * src/extract/primitive/extract_discontinued_vlines.cc, + * src/extract/primitive/extract_thick_hlines.cc, + * src/extract/primitive/extract_thick_vlines.cc, + * src/extract/primitive/find_discontinued_lines.cc, + * src/extract_text_double_several_links.cc, + * src/extract_text_several_graph.cc, + * src/extract_text_several_left_links.cc, + * src/filter/large_objects.cc, + * src/filter/small_objects.cc, + * src/filter/thick_objects.cc, + * src/filter/thin_objects.cc, + * src/morpho.cc, + * src/rectangularity.cc, + * src/thin_bboxes.cc: + - Do not use essential/2d.hh + - Specify the namespace of the usage() routine. + 2009-06-11 Roland Levillain <roland@lrde.epita.fr> Fix the generation of headers.mk in SCRIBO. diff --git a/scribo/filter/large_objects.hh b/scribo/filter/large_objects.hh index bf4facb..125cbf0 100644 --- a/scribo/filter/large_objects.hh +++ b/scribo/filter/large_objects.hh @@ -36,7 +36,7 @@ # include <mln/core/concept/function.hh> # include <mln/labeling/compute.hh> -# include <mln/accu/count.hh> +# include <mln/accu/math/count.hh> # include <mln/util/array.hh> @@ -97,7 +97,7 @@ namespace scribo : Function_v2b< large_objects_filter<L> > { - typedef accu::count<mln_psite(L)> card_t; + typedef accu::math::count<mln_psite(L)> card_t; /// Constructor /// diff --git a/scribo/src/Makefile.am b/scribo/src/Makefile.am index 2f537f1..381c567 100644 --- a/scribo/src/Makefile.am +++ b/scribo/src/Makefile.am @@ -21,6 +21,8 @@ include $(top_srcdir)/scribo/scribo.mk SUBDIRS = \ binarization \ + extract \ + filter \ preprocessing \ table @@ -35,6 +37,7 @@ bin_PROGRAMS = \ morpho \ negate \ preprocess \ + rectangularity \ superpose \ table_rebuild_opening \ table_rebuild_rank \ @@ -52,6 +55,7 @@ extract_text_single_link_SOURCES = extract_text_single_link.cc morpho_SOURCES = morpho.cc negate_SOURCES = negate.cc preprocess_SOURCES = preprocess.cc +rectangularity_SOURCES = rectangularity.cc superpose_SOURCES = superpose.cc table_rebuild_opening_SOURCES = table_rebuild_opening.cc table_rebuild_rank_SOURCES = table_rebuild_rank.cc diff --git a/scribo/src/extract/primitive/extract_discontinued_hlines.cc b/scribo/src/extract/primitive/extract_discontinued_hlines.cc index df682a3..8d4c367 100644 --- a/scribo/src/extract/primitive/extract_discontinued_hlines.cc +++ b/scribo/src/extract/primitive/extract_discontinued_hlines.cc @@ -46,8 +46,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 5) - return usage(argv, "Extract discontinued horizontal lines", "input.pbm length rank output.pbm", - args_desc, "A binary image of horizontal lines."); + return scribo::debug::usage(argv, + "Extract discontinued horizontal lines", + "input.pbm length rank output.pbm", + args_desc, + "A binary image of horizontal lines."); trace::entering("main"); diff --git a/scribo/src/extract/primitive/extract_discontinued_lines.cc b/scribo/src/extract/primitive/extract_discontinued_lines.cc index a8388ca..6568928 100644 --- a/scribo/src/extract/primitive/extract_discontinued_lines.cc +++ b/scribo/src/extract/primitive/extract_discontinued_lines.cc @@ -47,9 +47,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 5) - return usage(argv, "Extract discontinued horizontal and vertical lines", - "input.pbm length rank output.pbm", - args_desc, "A binary image of horizontal and vertical lines."); + return scribo::debug::usage(argv, + "Extract discontinued horizontal and vertical lines", + "input.pbm length rank output.pbm", + args_desc, + "A binary image of horizontal and vertical lines."); trace::entering("main"); diff --git a/scribo/src/extract/primitive/extract_discontinued_vlines.cc b/scribo/src/extract/primitive/extract_discontinued_vlines.cc index f39086b..af1f079 100644 --- a/scribo/src/extract/primitive/extract_discontinued_vlines.cc +++ b/scribo/src/extract/primitive/extract_discontinued_vlines.cc @@ -46,8 +46,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 5) - return usage(argv, "Extract discontinued vertical lines", "input.pbm length rank output.pbm", - args_desc, "A binary image of vertical lines."); + return scribo::debug::usage(argv, + "Extract discontinued vertical lines", + "input.pbm length rank output.pbm", + args_desc, + "A binary image of vertical lines."); trace::entering("main"); diff --git a/scribo/src/extract/primitive/extract_thick_hlines.cc b/scribo/src/extract/primitive/extract_thick_hlines.cc index ca6284d..ae8cbd6 100644 --- a/scribo/src/extract/primitive/extract_thick_hlines.cc +++ b/scribo/src/extract/primitive/extract_thick_hlines.cc @@ -45,8 +45,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 4) - return usage(argv, "Extract thick horizontal lines", "input.pbm length output.pbm", - args_desc, "A binary image of horizontal lines."); + return scribo::debug::usage(argv, + "Extract thick horizontal lines", + "input.pbm length output.pbm", + args_desc, + "A binary image of horizontal lines."); trace::entering("main"); diff --git a/scribo/src/extract/primitive/extract_thick_vlines.cc b/scribo/src/extract/primitive/extract_thick_vlines.cc index 52ab1d4..49bec1e 100644 --- a/scribo/src/extract/primitive/extract_thick_vlines.cc +++ b/scribo/src/extract/primitive/extract_thick_vlines.cc @@ -45,8 +45,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 4) - return usage(argv, "Extract thick vertical lines", "input.pbm length output.pbm", - args_desc, "A binary image of vertical lines."); + return scribo::debug::usage(argv, + "Extract thick vertical lines", + "input.pbm length output.pbm", + args_desc, + "A binary image of vertical lines."); trace::entering("main"); diff --git a/scribo/src/extract/primitive/find_discontinued_lines.cc b/scribo/src/extract/primitive/find_discontinued_lines.cc index 09f295b..8f81770 100644 --- a/scribo/src/extract/primitive/find_discontinued_lines.cc +++ b/scribo/src/extract/primitive/find_discontinued_lines.cc @@ -50,9 +50,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 5) - return usage(argv, "Extract discontinued horizontal and vertical lines", - "input.pbm length rank output.pbm", - args_desc, "A binary image of horizontal and vertical lines."); + return scribo::debug::usage(argv, + "Extract discontinued horizontal and vertical lines", + "input.pbm length rank output.pbm", + args_desc, + "A binary image of horizontal and vertical lines."); trace::entering("main"); diff --git a/scribo/src/extract_text_double_several_links.cc b/scribo/src/extract_text_double_several_links.cc index 7dc1bac..c220e77 100644 --- a/scribo/src/extract_text_double_several_links.cc +++ b/scribo/src/extract_text_double_several_links.cc @@ -25,9 +25,17 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> #include <mln/labeling/colorize.hh> +#include <mln/value/label_16.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/io/pbm/load.hh> +#include <mln/io/ppm/save.hh> + +#include <mln/literal/colors.hh> #include <mln/util/timer.hh> +#include <mln/util/array.hh> #include <scribo/extract/primitive/objects.hh> #include <scribo/text/grouping/group_with_several_left_links.hh> diff --git a/scribo/src/extract_text_several_graph.cc b/scribo/src/extract_text_several_graph.cc index 198f325..bc0d3e0 100644 --- a/scribo/src/extract_text_several_graph.cc +++ b/scribo/src/extract_text_several_graph.cc @@ -25,7 +25,19 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/literal/colors.hh> +#include <mln/util/graph.hh> + +#include <mln/labeling/colorize.hh> + +#include <mln/value/rgb8.hh> +#include <mln/value/label_16.hh> + +#include <mln/io/pbm/load.hh> +#include <mln/io/ppm/save.hh> #include <scribo/extract/primitive/objects.hh> #include <scribo/text/grouping/group_with_several_graphes.hh> @@ -74,8 +86,8 @@ int main(int argc, char* argv[]) literal::red, scribo::make::debug_filename("grouped_text.ppm")); io::ppm::save(mln::labeling::colorize(value::rgb8(), - grouped_text, - grouped_text.nlabels()), + grouped_text, + grouped_text.nlabels()), scribo::make::debug_filename("label_color.ppm")); } diff --git a/scribo/src/extract_text_several_left_links.cc b/scribo/src/extract_text_several_left_links.cc index f717a63..6e6f1fa 100644 --- a/scribo/src/extract_text_several_left_links.cc +++ b/scribo/src/extract_text_several_left_links.cc @@ -25,7 +25,20 @@ #include <iostream> -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/literal/colors.hh> +#include <mln/util/graph.hh> + +#include <mln/labeling/colorize.hh> + +#include <mln/value/rgb8.hh> +#include <mln/value/label_16.hh> + +#include <mln/io/pbm/load.hh> +#include <mln/io/ppm/save.hh> + #include <scribo/extract/primitive/objects.hh> #include <scribo/text/grouping/group_with_several_left_links.hh> diff --git a/scribo/src/filter/large_objects.cc b/scribo/src/filter/large_objects.cc index 5e63ba2..51ab029 100644 --- a/scribo/src/filter/large_objects.cc +++ b/scribo/src/filter/large_objects.cc @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/level/convert.hh> +#include <mln/data/convert.hh> #include <mln/io/pbm/all.hh> #include <mln/value/label_16.hh> @@ -47,8 +47,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 4) - return usage(argv, "Filter too large objects", "input.pbm max_area output.pbm", - args_desc, "A binary image."); + return scribo::debug::usage(argv, + "Filter too large objects", + "input.pbm max_area output.pbm", + args_desc, + "A binary image."); trace::entering("main"); @@ -62,7 +65,7 @@ int main(int argc, char *argv[]) = scribo::extract::primitive::objects(input, c8(), nobjects); obj_ima_t filtered = scribo::filter::large_objects(objects, atoi(argv[2])); - io::pbm::save(level::convert(bool(), filtered), argv[3]); + io::pbm::save(data::convert(bool(), filtered), argv[3]); trace::exiting("main"); diff --git a/scribo/src/filter/small_objects.cc b/scribo/src/filter/small_objects.cc index d84e21a..fed6252 100644 --- a/scribo/src/filter/small_objects.cc +++ b/scribo/src/filter/small_objects.cc @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/level/convert.hh> +#include <mln/data/convert.hh> #include <mln/io/pbm/all.hh> #include <mln/value/label_16.hh> @@ -46,8 +46,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 4) - return usage(argv, "Filter too small objects", "input.pbm min_area output.pbm", - args_desc, "A binary image."); + return scribo::debug::usage(argv, + "Filter too small objects", + "input.pbm min_area output.pbm", + args_desc, + "A binary image."); trace::entering("main"); @@ -61,7 +64,7 @@ int main(int argc, char *argv[]) = scribo::extract::primitive::objects(input, c8(), nobjects); obj_ima_t filtered = scribo::filter::small_objects(objects, atoi(argv[2])); - io::pbm::save(level::convert(bool(), filtered), argv[3]); + io::pbm::save(data::convert(bool(), filtered), argv[3]); trace::exiting("main"); diff --git a/scribo/src/filter/thick_objects.cc b/scribo/src/filter/thick_objects.cc index 76f9609..288402c 100644 --- a/scribo/src/filter/thick_objects.cc +++ b/scribo/src/filter/thick_objects.cc @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/level/convert.hh> +#include <mln/data/convert.hh> #include <mln/io/pbm/all.hh> #include <mln/value/label_16.hh> @@ -46,8 +46,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 4) - return usage(argv, "Filter too thick objects", "input.pbm max_thick output.pbm", - args_desc, "A binary image."); + return scribo::debug::usage(argv, + "Filter too thick objects", + "input.pbm max_thick output.pbm", + args_desc, + "A binary image."); trace::entering("main"); @@ -61,7 +64,7 @@ int main(int argc, char *argv[]) = scribo::extract::primitive::objects(input, c8(), nobjects); obj_ima_t filtered = scribo::filter::thick_objects(objects, atoi(argv[2])); - io::pbm::save(level::convert(bool(), filtered), argv[3]); + io::pbm::save(data::convert(bool(), filtered), argv[3]); trace::exiting("main"); diff --git a/scribo/src/filter/thin_objects.cc b/scribo/src/filter/thin_objects.cc index f1458bb..9129231 100644 --- a/scribo/src/filter/thin_objects.cc +++ b/scribo/src/filter/thin_objects.cc @@ -25,7 +25,7 @@ #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> -#include <mln/level/convert.hh> +#include <mln/data/convert.hh> #include <mln/io/pbm/all.hh> #include <mln/value/label_16.hh> @@ -46,8 +46,11 @@ int main(int argc, char *argv[]) using namespace mln; if (argc != 4) - return usage(argv, "Filter too thin objects", "input.pbm min_thin output.pbm", - args_desc, "A binary image."); + return scribo::debug::usage(argv, + "Filter too thin objects", + "input.pbm min_thin output.pbm", + args_desc, + "A binary image."); trace::entering("main"); @@ -61,7 +64,7 @@ int main(int argc, char *argv[]) = scribo::extract::primitive::objects(input, c8(), nobjects); obj_ima_t filtered = scribo::filter::thin_objects(objects, atoi(argv[2])); - io::pbm::save(level::convert(bool(), filtered), argv[3]); + io::pbm::save(data::convert(bool(), filtered), argv[3]); trace::exiting("main"); diff --git a/scribo/src/morpho.cc b/scribo/src/morpho.cc index 91a089a..cdab36e 100644 --- a/scribo/src/morpho.cc +++ b/scribo/src/morpho.cc @@ -23,16 +23,35 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/literal/colors.hh> + +#include <mln/value/label_16.hh> +#include <mln/value/int_u16.hh> + +#include <mln/labeling/wrap.hh> +#include <mln/labeling/colorize.hh> +#include <mln/labeling/blobs.hh> + +#include <mln/io/pbm/load.hh> +#include <mln/io/pgm/save.hh> +#include <mln/io/ppm/save.hh> + #include <mln/transform/distance_and_influence_zone_geodesic.hh> #include <mln/core/var.hh> -#include <mln/labeling/wrap.hh> + #include <mln/win/hline2d.hh> +#include <mln/win/disk2d.hh> + #include <mln/morpho/watershed/flooding.hh> #include <mln/morpho/watershed/superpose.hh> +#include <mln/morpho/closing/structural.hh> #include <scribo/make/debug_filename.hh> + int main(int argc, char *argv[]) { using namespace mln; diff --git a/scribo/src/rectangularity.cc b/scribo/src/rectangularity.cc index bb5fb42..41ffb6a 100644 --- a/scribo/src/rectangularity.cc +++ b/scribo/src/rectangularity.cc @@ -1,5 +1,4 @@ -// Copyright (C) 2009 - EPITA Research and Development Laboratory (LRDE) +// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE) // // This file is part of Olena. // @@ -24,13 +23,31 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/essential/2d.hh> -#include <mln/transform/distance_geodesic.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/alias/neighb2d.hh> #include <mln/core/var.hh> -#include <mln/fun/l2l/wrap.hh> -#include <mln/win/hline2d.hh> -#include <mln/morpho/watershed/flooding.hh> -#include <mln/morpho/watershed/superpose.hh> + +#include <mln/literal/colors.hh> + +#include <mln/labeling/wrap.hh> + +#include <mln/value/label_16.hh> +#include <mln/value/int_u16.hh> + +#include <mln/labeling/blobs.hh> + +#include <mln/io/pbm/load.hh> +#include <mln/io/pgm/save.hh> + +#include <mln/transform/distance_geodesic.hh> + +#include <mln/morpho/closing/structural.hh> +#include <mln/morpho/tree/compute_attribute_image.hh> +#include <mln/morpho/tree/max.hh> + +#include <mln/accu/site_set/rectangularity.hh> + +#include <mln/win/disk2d.hh> #include <scribo/make/debug_filename.hh> @@ -53,12 +70,12 @@ int main(int argc, char *argv[]) mln_VAR(dmap, transform::distance_geodesic(lbl, c8(), mln_max(unsigned))); - io::pgm::save(level::transform(dmap, fun::l2l::wrap<label_8>()), "dmap.pgm"); + io::pgm::save(labeling::wrap(dmap), "dmap.pgm"); { image2d<unsigned> clo = morpho::closing::structural(dmap, win::disk2d(51)); io::pgm::save(clo, scribo::make::debug_filename("clo_disk_51.pgm")); - image2d<float> r = morpho::tree:compute_attribute_image(accu::site_set::rectangularity<point2d>(),clo); - image2d<point2d> r = morpho::tree:max(r,c8()); +// image2d<float> r = morpho::tree::compute_attribute_image(accu::site_set::rectangularity<point2d>(), clo); +// image2d<point2d> r_max = morpho::tree::max(r,c8()); } } diff --git a/scribo/src/thin_bboxes.cc b/scribo/src/thin_bboxes.cc index 49e28bd..db4dfcf 100644 --- a/scribo/src/thin_bboxes.cc +++ b/scribo/src/thin_bboxes.cc @@ -23,7 +23,16 @@ // exception does not however invalidate any other reasons why the // executable file might be covered by the GNU General Public License. -#include <mln/essential/2d.hh> +#include <mln/core/image/image2d.hh> +#include <mln/core/alias/neighb2d.hh> + +#include <mln/literal/colors.hh> + +#include <mln/value/label_16.hh> + +#include <mln/io/pbm/load.hh> + + #include <scribo/text/extract_lines.hh> #include <scribo/filter/thin_objects.hh> -- 1.5.6.5
participants (1)
-
Guillaume Lazzara