29 #include <mln/core/image/image2d.hh>
30 #include <mln/labeling/colorize.hh>
31 #include <mln/value/label_16.hh>
32 #include <mln/core/alias/neighb2d.hh>
34 #include <mln/io/pbm/load.hh>
35 #include <mln/io/ppm/save.hh>
37 #include <mln/literal/colors.hh>
38 #include <mln/util/array.hh>
40 #include <scribo/primitive/extract/components.hh>
41 #include <scribo/primitive/group/apply.hh>
42 #include <scribo/primitive/link/with_several_left_links.hh>
43 #include <scribo/primitive/link/with_several_right_links.hh>
44 #include <scribo/debug/linked_bboxes_image.hh>
45 #include <scribo/primitive/group/from_double_link.hh>
46 #include <scribo/filter/objects_small.hh>
48 #include <scribo/debug/bboxes_image.hh>
49 #include <scribo/make/debug_filename.hh>
51 int usage(
const char *name)
53 std::cout <<
"Usage: " << name <<
" <input.pbm> " << std::endl;
58 int main(
int argc,
char* argv[])
60 using namespace scribo;
64 return usage(argv[0]);
66 scribo::make::internal::debug_filename_prefix =
"group_with_double_several_links";
72 value::label_16 nbboxes;
74 std::cout <<
"extract bboxes" << std::endl;
79 std::cout <<
"Remove small components" << std::endl;
82 std::cout <<
"Group with left link" << std::endl;
86 std::cout <<
"Group with right link" << std::endl;
90 std::cout <<
"BEFORE - nbboxes = " << nbboxes << std::endl;
103 std::cout <<
"Group from double link" << std::endl;
111 grouped_comps.labeled_image(),
112 grouped_comps.nelements()),
115 std::cout <<
"AFTER double grouping - nbboxes = " << grouped_comps.nelements() << std::endl;