
https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr> INIM: Classif: Update max tree version. * classif/v2.cc: Update. v2.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) Index: classif/v2.cc --- classif/v2.cc (revision 2706) +++ classif/v2.cc (working copy) @@ -38,13 +38,23 @@ return histo; } -template <typename I, typename N> +template <typename I, typename J, typename N> unsigned -compute_max_tree(const I& ima, const J& histo, const N& nbh) +compute_max_tree(const I& ima, const J& histo, const N& nbh, const unsigned f) { - max_tree_<I,N> run(ima, nbh); - + max_tree_<J,N> run(histo, nbh); + I out(ima.domain()); + mln_piter(I) p(ima.domain()); + for_all(p) + { + algebra::vec<3, value::int_u8> v = make::vec(ima(p).red() / f, + ima(p).green() / f, + ima(p).blue() / f); + point3d pn = run.parent(v); + out(p) = value::rgb8(pn[0] * f, pn[1] * f, pn[2] * f); + } + io::ppm::save(out, "tmp.ppm"); } bool usage(int argc, char ** argv) @@ -75,5 +85,5 @@ //debug::println(phisto); // Compute max_tree - max_tree_<I,N> run(ima, nbh); + compute_max_tree(ima, histo, c6(), div_factor); }