00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <cstdlib>
00029
00030 #include <ntg/int.hh>
00031 #include <ntg/color/rgb.hh>
00032
00033 #include <oln/basics2d.hh>
00034 #include <oln/level/fill.hh>
00035
00036
00037 #if defined(FIORIO_VERSION) && FIORIO_VERSION == 3
00038 # include <oln/lrde/ufmt/fiorio-3.hh>
00039 #else
00040 # if defined(FIORIO_VERSION) && FIORIO_VERSION == 2
00041 # include <oln/lrde/ufmt/fiorio-2.hh>
00042 # else
00043 # include <oln/lrde/ufmt/fiorio-1.hh>
00044 # endif
00045 #endif
00046
00047
00048 void usage(char* argv[])
00049 {
00050 std::cerr << "usage: " << argv[0] << " input.pgm"
00051 << std::endl
00052 << "Max-tree computation with Fiorio's and Gustedt's algorithm."
00053 << std::endl;
00054 exit(1);
00055 }
00056
00057
00058 int main(int argc, char* argv[])
00059 {
00060 if (argc != 2)
00061 usage(argv);
00062
00063 typedef oln::image2d<ntg::int_u8> image_type;
00064 image_type input = oln::io::load(argv[1]);
00065
00066 typedef oln::lrde::ufmt::fiorio<image_type> algorithm_type;
00067 algorithm_type run(input);
00068 std::cout << "npoint = " << run.ima().npoints()
00069 << std::endl;
00070 run.go();
00071 std::cout << "n level roots (first method) = " << run.n_level_roots1()
00072 << std::endl
00073 << "n level roots (second method) = " << run.n_level_roots2()
00074 << std::endl;
00075 }