
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr> Spot differences between step2 and n_cmpt5. * jardonnet/n_cmpt/prob.pgm: Test case. * jardonnet/n_cmpt/fused_filter.cc: Version using boolean image. * jardonnet/n_cmpt/ref_filter.cc: Version using set. * jardonnet/n_cmpt/n_cmpt5.hh: Minor change. * jardonnet/n_cmpt/fused: Log. * jardonnet/n_cmpt/ref: Log. * jardonnet/n_cmpt/Makefile: Add related rules. * jardonnet/n_cmpt/diff_ref_fused_on_small: diff. igr/Makefile | 2 igr/src/igr.cc | 8 - n_cmpt/Makefile | 26 ++-- n_cmpt/diff_ref_fused_on_small | 13 ++ n_cmpt/fused | 26 ++++ n_cmpt/fused_filter.cc | 252 +++++++++++++++++++++++++++++++++++++++++ n_cmpt/n_cmpt5.hh | 14 +- n_cmpt/prob.pgm | 5 n_cmpt/ref | 22 +++ n_cmpt/ref_filter.cc | 224 ++++++++++++++++++++++++++++++++++++ test/big_chess.cc | 21 ++- 11 files changed, 586 insertions(+), 27 deletions(-) Index: jardonnet/test/big_chess.cc --- jardonnet/test/big_chess.cc (revision 3060) +++ jardonnet/test/big_chess.cc (working copy) @@ -8,9 +8,12 @@ #include <mln/core/image/image2d.hh> #include <mln/value/int_u8.hh> +#include <mln/value/rgb8.hh> #include <mln/io/pgm/load.hh> #include <mln/level/paste.hh> -#include <mln/io/pgm/save.hh> + +#include <mln/io/ppm/load.hh> +#include <mln/io/ppm/save.hh> #include <mln/fun/p2b/big_chess.hh> @@ -19,9 +22,9 @@ bool usage(int argc, char ** argv) { - if (argc != 3) + if (argc != 4) { - std::cout << argv[0] << " ima1.pgm ima2.pgm" << std::endl; + std::cout << argv[0] << " ima1.pgm ima2.pgm div" << std::endl; return false; } return true; @@ -52,14 +55,16 @@ if (not usage(argc,argv)) return 1; - typedef image2d<int_u8> I; + typedef image2d<rgb8> I; I ima1; I ima2; - io::pgm::load(ima1, argv[1]); - io::pgm::load(ima2, argv[2]); + io::ppm::load(ima1, argv[1]); + io::ppm::load(ima2, argv[2]); + + int div = atoi(argv[3]); - fun::p2b::big_chess<box2d> fun(ima1.domain(), 4); + fun::p2b::big_chess<box2d> fun(ima1.domain(), div); image_if< I, fun::p2b::big_chess<box2d> > visio = ima1 | fun; @@ -67,5 +72,5 @@ level::paste(visio, ima2); - io::pgm::save(ima2, "out.ppm"); + io::ppm::save(ima2, "out.ppm"); } Index: jardonnet/n_cmpt/prob.pgm --- jardonnet/n_cmpt/prob.pgm (revision 0) +++ jardonnet/n_cmpt/prob.pgm (revision 0) @@ -0,0 +1,5 @@ +P5 +# CREATOR: GIMP PNM Filter Version 1.1 +24 22 +255 +��������`fijjqy~���������������~^chhhpy}���������������^cighpx|��������������~\chghox|�������������}[bgfgowz}~�����������|Ybgfgowz|}~����������~X`ggipx{}~������������}T\bdhovy{|~�����ex���|QYacfkruy{|wyz��zUy���zP[ccekqtxyxou{�`Vz���yR[bdekquy{xnrwx{jXYy���xS\bdekrvyyoousvYZZx���yR[cceksv{soqsv~�Z[Zx���zRYadekru�jmpsz��ZZWv���{PW_bejm~�gnqv���[][u���yNVacdil��emrz}~`b`w���|QZcefln��dksy{~{ccbz���~S[cedim�fhnvy{�cbcz���RZbccfp��nipv{��a`ay����S[bbcds��}imv���`_`{����T\bacas���mp����aad~����QZaab_u���z{��� \ No newline at end of file Index: jardonnet/n_cmpt/fused_filter.cc --- jardonnet/n_cmpt/fused_filter.cc (revision 0) +++ jardonnet/n_cmpt/fused_filter.cc (revision 0) @@ -0,0 +1,252 @@ +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/io/pgm/load.hh> +#include <mln/debug/println.hh> + +#include <mln/core/site_set/p_array.hh> +#include <mln/level/sort_psites.hh> +#include <mln/core/alias/neighb2d.hh> +#include <mln/morpho/tree/data.hh> + +#include <mln/accu/count.hh> +#include <mln/util/set.hh> + +#include <mln/labeling/regional_minima.hh> +#include <mln/morpho/tree/compute_attribute_image.hh> +#include <mln/morpho/closing_area.hh> +#include <mln/level/fill.hh> + +#include <mln/debug/iota.hh> + +#include <mln/pw/all.hh> +#include <mln/core/image/image_if.hh> + +namespace mln +{ + + template <typename I> + void println_par(const I& par) + { + int nr = par.nrows(), nc = par.ncols(); + for (int r = 0; r < nr; ++r) + { + for (int c = 0; c < nc; ++c) + if (par.at(r,c) == point2d(r,c)) + std::cout << "( ) "; + else + std::cout << par.at(r,c) << ' '; + std::cout << std::endl; + } + } + + template <typename P> + inline + mln_value(P) find_root__(P& par, const mln_value(P)& x) + { + if (par(x) == x) + return x; + else + return par(x) = find_root__(par, par(x)); + } + + + template <typename I, typename A, typename N> + mln_ch_value(I, util::set<unsigned>) + compute_labels(const I& f, const A& a, const N& nbh, + unsigned n_objects, + bool echo = false) + { + if (echo) + debug::println("f =", f); + + typedef p_array<mln_psite(I)> S; + S s = level::sort_psites_increasing(a); + // s maps increasing attributes. + + mln_ch_value(I, mln_site(I)) par; + mln_ch_value(I, bool) deja_vu; + mln_ch_value(I, util::set<unsigned>) labels; + unsigned nbassins, current_n; + + // init fused image + mln_ch_value(I, bool) fused; + initialize(fused, a); + mln::level::fill(fused, false); + + // iota + mln_ch_value(I,value::int_u<16>) iota(a.domain()); + debug::iota(iota); + + // labels + mln_ch_value(I, unsigned) regmin = labeling::regional_minima(a, nbh, + nbassins); + + { + // Initialization. + mln_piter(A) p(f.domain()); + + // parent + initialize(par, f); + for_all(p) + par(p) = p; + + // deja_vu + initialize(deja_vu, f); + level::fill(deja_vu, false); + + + if (n_objects >= nbassins) + { + std::cerr << "The number of expected objects is higher than the number of regional minima!" << std::endl; + std::abort(); + } + + if (echo) + debug::println("regmin(f) =", regmin); + + initialize(labels, f); + for_all(p) + if (regmin(p) != 0) // p in a reg min of the attribute image + { + labels(p).insert(regmin(p)); + fused(p) = true; + } + } + + current_n = nbassins; + + // First pass. + mln_site(I) r; + mln_fwd_piter(S) p(s); + mln_niter(N) n(nbh, p); + for_all(p) + { + std::cout << p << std::endl; + for_all(n) + { + if (a.domain().has(n) && deja_vu(n)) + { + std::cout << " " << n << std::endl; + r = find_root__(par, n); + if (r != p) + { + par(r) = p; // Union. + + + /////TMP + if (labels(r).is_empty()) + // No-op. + ; + else + if (labels(p).is_empty()) + labels(p) = labels(r); + else + if (labels(p) == labels(r)) + { + // No-op. + // Should only happen if p and r are minima + } + else + labels(p).insert(labels(r)); + + ///// + + if (p == point2d(1,0) && r == point2d(2,0)) + { + std::cerr << "fused(r) " << fused(r) << std::endl; + std::cerr << "regmin(p) == 0 " << (regmin(p) == 0) << std::endl; + std::cerr << "fused(p) " << fused(p) << std::endl; + std::cerr << "current_n > n_objects " << (current_n > n_objects) << std::endl; + } + + // min_v != 0 <=> volume(p) == 1 ? + if (fused(r) && + regmin(p) == 0 &&// p is not a minima + fused(p) &&// p already belong to a cmpt (fused for an another n) + current_n > n_objects) // union is still allowed + { + std::cerr << p << " <- " << r + << labels(p) << labels(r) << std::endl; + + current_n--; + std::cout << "dec" << std::endl; + } + + //mln_invariant(fused(r) || a(r) == a(p)); + // DOESNT WORK + + // Union made if + if (current_n >= n_objects || // union is still allowed or + not fused(r) || // r not fused or + not fused(p) || // p not fused or + regmin(p) != 0) // p is a minima + { + //par(r) = p; + fused(p) = fused(r); + //iota(p) = iota(r); + +// std::cout << "volume " << a(p) << " - " << current_n << std::endl; +// debug::println(iota | pw::value(fused) == pw::cst(true)); +// std::cout << "---------------------" << std::endl; + } + } + } + } + deja_vu(p) = true; + } + return labels; + } + + +} // end of namespace mln + + +void usage(char* argv[]) +{ + std::cerr << "usage: " << argv[0] << " input.pgm n echo" << std::endl; + std::cerr << "n: number of expected objects (n > 0)" << std::endl; + std::cerr << "echo: 0 (silent) or 1 (verbose)" << std::endl; + std::cerr << "merge using sets of labels from regional minima and save the highest label image" << std::endl; + std::abort(); +} + + +int main(int argc, char* argv[]) +{ + using namespace mln; + using value::int_u8; + + if (argc != 4) + usage(argv); + + typedef image2d<int_u8> I; + I f; + // input image + io::pgm::load(f, argv[1]); + + // n + int n = std::atoi(argv[2]); + if (n <= 0) + usage(argv); + + // echo + int echo = std::atoi(argv[3]); + if (echo != 0 && echo != 1) + usage(argv); + + typedef p_array<point2d> S; + S s = level::sort_psites_decreasing(f); + + // Children go towards lower levels so leafs are regional minima. + // We get a min-tree so that we can perform morphological closings. + + morpho::tree::data<I,S> t(f, s, c4()); + accu::count< util::pix<I> > attr; + + image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); + + + image2d< util::set<unsigned> > labels = compute_labels(f, a, c4(), n, echo); + if (echo) + debug::println("labels =", labels); +} Index: jardonnet/n_cmpt/n_cmpt5.hh --- jardonnet/n_cmpt/n_cmpt5.hh (revision 3060) +++ jardonnet/n_cmpt/n_cmpt5.hh (working copy) @@ -39,6 +39,10 @@ # include <mln/morpho/tree/data.hh> # include <mln/morpho/tree/compute_attribute_image.hh> +# include <mln/pw/all.hh> + +# include <mln/core/image/image_if.hh> + namespace mln { @@ -133,6 +137,9 @@ } } + mln_ch_value(I,value::int_u<16>) iota(ima.domain()); + debug::iota(iota); + // UNION FIND ON VOLUME mln_fwd_piter(S) p(sp); mln_niter(N) n(nbh, p); @@ -175,6 +182,7 @@ } mln_invariant(fused(r) || volume(r) == volume(p)); + //Note at the end of level every fake component have been processed. // Union made if if (cmpts >= lambda || // union is still allowed or @@ -194,6 +202,7 @@ if (fused(r)) fused(p) = true; + iota(p) = iota(r); // If I try to fuse with something never fused I am on a plateau. // not fused(r) => ( volume(r) == volume(p) ) @@ -208,6 +217,8 @@ std::cerr << "volume " << volume(p) << " - " << cmpts << std::endl; //debug::println(fused); + + debug::println(iota | pw::value(fused) == pw::cst(true)); } } } @@ -215,9 +226,6 @@ deja_vu(p) = true; } - mln_ch_value(I,value::int_u<16>) iota(ima.domain()); - debug::iota(iota); - std::cout << std::endl; std::cout << "cmpts : " << cmpts << std::endl; Index: jardonnet/n_cmpt/ref_filter.cc --- jardonnet/n_cmpt/ref_filter.cc (revision 0) +++ jardonnet/n_cmpt/ref_filter.cc (revision 0) @@ -0,0 +1,224 @@ +#include <mln/core/image/image2d.hh> +#include <mln/value/int_u8.hh> +#include <mln/io/pgm/load.hh> +#include <mln/debug/println.hh> + +#include <mln/core/site_set/p_array.hh> +#include <mln/level/sort_psites.hh> +#include <mln/core/alias/neighb2d.hh> +#include <mln/morpho/tree/data.hh> + +#include <mln/accu/count.hh> +#include <mln/util/set.hh> + +#include <mln/labeling/regional_minima.hh> +#include <mln/morpho/tree/compute_attribute_image.hh> +#include <mln/morpho/closing_area.hh> +#include <mln/level/fill.hh> + + +namespace mln +{ + + template <typename I> + void println_par(const I& par) + { + int nr = par.nrows(), nc = par.ncols(); + for (int r = 0; r < nr; ++r) + { + for (int c = 0; c < nc; ++c) + if (par.at(r,c) == point2d(r,c)) + std::cout << "( ) "; + else + std::cout << par.at(r,c) << ' '; + std::cout << std::endl; + } + } + + template <typename P> + inline + mln_value(P) find_root__(P& par, const mln_value(P)& x) + { + if (par(x) == x) + return x; + else + return par(x) = find_root__(par, par(x)); + } + + + template <typename I, typename A, typename N> + mln_ch_value(I, util::set<unsigned>) + compute_labels(const I& f, const A& a, const N& nbh, + unsigned n_objects, + bool echo = false) + { + if (echo) + debug::println("f =", f); + + typedef p_array<mln_psite(I)> S; + S s = level::sort_psites_increasing(a); + // s maps increasing attributes. + + mln_ch_value(I, mln_site(I)) par; + mln_ch_value(I, bool) deja_vu; + mln_ch_value(I, util::set<unsigned>) labels; + unsigned nbassins, current_n; + + // Initialization. + { + mln_piter(A) p(f.domain()); + + // parent + initialize(par, f); + for_all(p) + par(p) = p; + + // deja_vu + initialize(deja_vu, f); + level::fill(deja_vu, false); + + // labels + mln_ch_value(I, unsigned) regmin = labeling::regional_minima(a, nbh, + nbassins); + if (n_objects >= nbassins) + { + std::cerr << "The number of expected objects is higher than the number of regional minima!" << std::endl; + std::abort(); + } + + if (echo) + debug::println("regmin(f) =", regmin); + + initialize(labels, f); + for_all(p) + if (regmin(p) != 0) // p in a reg min of the attribute image + labels(p).insert(regmin(p)); + } + + debug::println(labels); + + current_n = nbassins; + + // First pass. + { + mln_site(I) r; + mln_fwd_piter(S) p(s); + mln_niter(N) n(nbh, p); + for_all(p) + { + std::cout << p << std::endl; + for_all(n) + if (a.domain().has(n) && deja_vu(n)) + { + std::cout << " " << n << std::endl; + r = find_root__(par, n); + if (r != p) + { + par(r) = p; // Union. + + if (labels(r).is_empty()) + // No-op. + ; + else + if (labels(p).is_empty()) + labels(p) = labels(r); + else + if (labels(p) == labels(r)) + { + // No-op. + // Should only happen if p and r are minima + } + else + { + labels(p).insert(labels(r)); + --current_n; + + if (current_n >= n_objects) + std::cerr << p << " <- " << r + << labels(p) << labels(r) << std::endl; + + if (current_n == n_objects && echo) + { + // Filtering. +// mln_concrete(I) g; +// initialize(g, f); +// mln_bkd_piter(S) p(s); +// for_all(p) +// if (par(p) == p) +// g(p) = f(p); +// else +// g(p) = g(par(p)); +// debug::println("g =", g); + + // Testing. +// unsigned n_result; +// mln_ch_value(I, unsigned) g_regmin; +// g_regmin = labeling::regional_minima(g, nbh, n_result); +// debug::println("regmin(g) =", g_regmin); + +// mln_invariant(n_result == n_objects); + } + } + } + } + deja_vu(p) = true; + } + } + + mln_invariant(current_n == 1); // All labels are merged into a single set. + + return labels; + } + + +} // mln + + +void usage(char* argv[]) +{ + std::cerr << "usage: " << argv[0] << " input.pgm n echo" << std::endl; + std::cerr << "n: number of expected objects (n > 0)" << std::endl; + std::cerr << "echo: 0 (silent) or 1 (verbose)" << std::endl; + std::cerr << "merge using sets of labels from regional minima and save the highest label image" << std::endl; + std::abort(); +} + + +int main(int argc, char* argv[]) +{ + using namespace mln; + using value::int_u8; + + if (argc != 4) + usage(argv); + + typedef image2d<int_u8> I; + I f; + // input image + io::pgm::load(f, argv[1]); + + // n + int n = std::atoi(argv[2]); + if (n <= 0) + usage(argv); + + // echo + int echo = std::atoi(argv[3]); + if (echo != 0 && echo != 1) + usage(argv); + + typedef p_array<point2d> S; + S s = level::sort_psites_decreasing(f); + + // Children go towards lower levels so leafs are regional minima. + // We get a min-tree so that we can perform morphological closings. + + morpho::tree::data<I,S> t(f, s, c4()); + accu::count< util::pix<I> > attr; + + image2d<unsigned> a = morpho::tree::compute_attribute_image(attr, t); + + image2d< util::set<unsigned> > labels = compute_labels(f, a, c4(), n, echo); + if (echo) + debug::println("labels =", labels); +} Index: jardonnet/n_cmpt/fused --- jardonnet/n_cmpt/fused (revision 0) +++ jardonnet/n_cmpt/fused (revision 0) @@ -0,0 +1,26 @@ +(11, 2) <- (11, 1){18, 22}{18} +fused(r) 1 +regmin(p) == 0 1 +fused(p) 0 +current_n > n_objects 1 +(11, 8) <- (13, 8){14, 21}{14} +(12, 1) <- (12, 0){16, 18, 22}{16} +(13, 2) <- (14, 2){15, 16, 18, 22}{15} +(17, 8) <- (18, 8){11, 14, 21}{11} +(20, 8) <- (21, 8){7, 11, 14, 21}{7} +(10, 20) <- (14, 19){13, 19, 20}{13, 19} +(17, 1) <- (18, 1){9, 15, 16, 18, 22}{9} +(11, 20) <- (11, 21){13, 17, 19, 20}{17} +(21, 12) <- (20, 13){6, 7, 11, 14, 21}{6} +(4, 10) <- (3, 11){2, 6, 7, 11, 14, 21}{2} +(11, 17) <- (8, 21){2, 6, 7, 11, 13, 14, 17, 19, 20, 21}{13, 17, 19, 20} +(16, 22) <- (16, 23){2, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21}{12} +(4, 20) <- (6, 20){1, 2, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21}{1} +(4, 23) <- (5, 23){1, 2, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23}{23} +(21, 20) <- (21, 21){1, 2, 5, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23}{5} +(0, 17) <- (0, 18){1, 2, 5, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{25} +(20, 21) <- (13, 22){1, 2, 5, 6, 7, 8, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{1, 2, 5, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25} +(21, 22) <- (21, 23){1, 2, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{4} +(19, 22) <- (19, 23){1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{10} +(5, 5) <- (18, 4){1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25}{9, 15, 16, 18, 22} +(5, 2) <- (7, 1){1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}{1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 25} Index: jardonnet/n_cmpt/ref --- jardonnet/n_cmpt/ref (revision 0) +++ jardonnet/n_cmpt/ref (revision 0) @@ -0,0 +1,22 @@ +(11, 2) <- (11, 1){18, 22}{18} +(1, 0) <- (2, 0){3, 24}{24} +(11, 8) <- (13, 8){14, 21}{14} +(12, 1) <- (12, 0){16, 18, 22}{16} +(13, 2) <- (14, 2){15, 16, 18, 22}{15} +(17, 8) <- (18, 8){11, 14, 21}{11} +(20, 8) <- (21, 8){7, 11, 14, 21}{7} +(12, 18) <- (18, 17){13, 19}{13} +(10, 20) <- (14, 19){13, 19, 20}{13, 19} +(17, 1) <- (18, 1){9, 15, 16, 18, 22}{9} +(11, 20) <- (11, 21){13, 17, 19, 20}{17} +(21, 12) <- (20, 13){6, 7, 11, 14, 21}{6} +(4, 10) <- (3, 11){2, 6, 7, 11, 14, 21}{2} +(11, 17) <- (8, 21){2, 6, 7, 11, 13, 14, 17, 19, 20, 21}{13, 17, 19, 20} +(16, 22) <- (16, 23){2, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21}{12} +(4, 20) <- (6, 20){1, 2, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21}{1} +(4, 23) <- (5, 23){1, 2, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23}{23} +(21, 20) <- (21, 21){1, 2, 5, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23}{5} +(0, 17) <- (0, 18){1, 2, 5, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{25} +(20, 21) <- (13, 22){1, 2, 5, 6, 7, 8, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{1, 2, 5, 6, 7, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25} +(21, 22) <- (21, 23){1, 2, 4, 5, 6, 7, 8, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{4} +(19, 22) <- (19, 23){1, 2, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 17, 19, 20, 21, 23, 25}{10} Index: jardonnet/n_cmpt/Makefile --- jardonnet/n_cmpt/Makefile (revision 3060) +++ jardonnet/n_cmpt/Makefile (working copy) @@ -1,21 +1,31 @@ -n_cmpt: n_cmpt.hh n_cmpt.cc - g++ -I../../.. -Wall -W -Wextra n_cmpt.cc -DNDEBUG -O1 -o n_cmpt +n_cmpt6: n_cmpt6.hh n_cmpt6.cc + g++ -I../../.. -Wall -W -Wextra n_cmpt6.cc -DNDEBUG -O1 -o n_cmpt6 -n_cmpt2: n_cmpt2.hh n_cmpt2.cc - g++ -I../../.. -Wall -W -Wextra n_cmpt2.cc -DNDEBUG -O1 -o n_cmpt2 +n_cmpt5: n_cmpt5.hh n_cmpt5.cc + g++ -I../../.. -Wall -W -Wextra n_cmpt5.cc -DNDEBUG -O1 -o n_cmpt5 + +n_cmpt4: n_cmpt4.hh n_cmpt4.cc + g++ -I../../.. -Wall -W -Wextra n_cmpt4.cc -DNDEBUG -O1 -o n_cmpt4 n_cmpt3: n_cmpt3.hh n_cmpt3.cc g++ -I../../.. -Wall -W -Wextra n_cmpt3.cc -DNDEBUG -O1 -o n_cmpt3 -n_cmpt4: n_cmpt4.hh n_cmpt4.cc - g++ -I../../.. -Wall -W -Wextra n_cmpt4.cc -DNDEBUG -O1 -o n_cmpt4 +n_cmpt2: n_cmpt2.hh n_cmpt2.cc + g++ -I../../.. -Wall -W -Wextra n_cmpt2.cc -DNDEBUG -O1 -o n_cmpt2 + +n_cmpt: n_cmpt.hh n_cmpt.cc + g++ -I../../.. -Wall -W -Wextra n_cmpt.cc -DNDEBUG -O1 -o n_cmtp -n_cmpt5: n_cmpt5.hh n_cmpt5.cc - g++ -I../../.. -Wall -W -Wextra n_cmpt5.cc -DNDEBUG -O1 -o n_cmpt5 nwst: nwst.hh nwst.cc g++ -I../../.. -Wall -W -Wextra nwst.cc -DNDEBUG -O1 -o nwst +ref_filter: ref_filter.cc + g++ -I../../.. -Wall -W -Wextra ref_filter.cc -DNDEBUG -O1 -o ref_filter + +ref_seg: ref_seg.cc + g++ -I../../.. -Wall -W -Wextra ref_seg.cc -DNDEBUG -O1 -o ref_seg + debug: n_cmpt.hh n_cmpt.cc g++ -I../../.. -Wall -W -Wextra n_cmpt.cc -g -g3 -o n_cmpt Index: jardonnet/n_cmpt/diff_ref_fused_on_small --- jardonnet/n_cmpt/diff_ref_fused_on_small (revision 0) +++ jardonnet/n_cmpt/diff_ref_fused_on_small (revision 0) @@ -0,0 +1,13 @@ +60d59 +< (1, 0) <- (2, 0) +92d90 +< (12, 18) <- (18, 17) +174d171 +< (62, 51) <- (56, 57) +198d194 +< (57, 46) <- (60, 52) +200d195 +< (49, 47) <- (47, 54) +252a248,249 +> (18, 46) <- (18, 47) +> (46, 61) <- (41, 63) Index: jardonnet/igr/src/igr.cc --- jardonnet/igr/src/igr.cc (revision 3060) +++ jardonnet/igr/src/igr.cc (working copy) @@ -24,11 +24,6 @@ #include <mln/value/hsi.hh> -#include <mln/core/image/thru.hh> - -//FIXME: Alexandre' sandbox -#include <mln/fun/meta/inty.hh> - using namespace mln; using namespace value; @@ -67,7 +62,7 @@ mln_piter_(image2d<rgb8>) p(g_ima.domain()); for_all(p) { - g_ima(p) = hsi(p).inty() * 255; + g_ima(p) = hsi(p).inty(); } io::pgm::save(g_ima, "g_ima.ppm"); @@ -88,7 +83,6 @@ /////////////////// image2d<int_u8> o_ima = morpho::closing_volume(mg_ima, c4(), lambda); - io::pgm::save(o_ima, "o_ima.ppm"); Index: jardonnet/igr/Makefile --- jardonnet/igr/Makefile (revision 3060) +++ jardonnet/igr/Makefile (working copy) @@ -6,7 +6,7 @@ CXXC?=g++ -LFLAGS=-I../../abraham/ -I../../../ +LFLAGS= -I../../../ CFLAGS=-W -Wall -Wextra -O1 -DNDEBUG PROJ=igr-reco