cleanup-2008 2550: INIM Bootstrap Classification.

https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena/sandbox Index: ChangeLog from Ugo Jardonnet <ugo.jardonnet@lrde.epita.fr> INIM Bootstrap Classification. Bootstrap classification: * classif/Makefile: New. * classif/iccvg04.cc: New. Add test image: * classif/chiche.pgm: New. * classif/images/caf_0009.jpg: New. * classif/images/caf_0028.jpg: New. * classif/images/edfverso06.JPG: New. * classif/images/capture.png: New. * classif/images/vpc_0001.jpg: New. * classif/images/caf_0010.jpg: New. * classif/images/caf_0013.jpg: New. * classif/images/caf_0005.jpg: New. * classif/images/caf_0034.jpg: New. * classif/lena.ppm: New. * classif/scoolNBR.ppm: New. classif/Makefile | 2 classif/iccvg04.cc | 50 classif/lena.ppm | 541 classif/scoolNBR.ppm |960004 ++++++++++++++++++++++++++++++++++++++ jardonnet/registration/center.hh | 7 jardonnet/registration/exp_val.hh | 6 6 files changed, 960601 insertions(+), 9 deletions(-) Index: jardonnet/registration/exp_val.hh --- jardonnet/registration/exp_val.hh (revision 2549) +++ jardonnet/registration/exp_val.hh (working copy) @@ -58,11 +58,7 @@ algebra::vec<P::dim,float> c(literal::zero); for (unsigned i = 0; i < a.nsites(); ++i) - { - // FIXME : Ugly. - algebra::vec<P::dim,float> ai = a[i]; - c += ai; - } + c += convert::to< algebra::vec<P::dim,float> > (a[i]); return c / a.nsites(); } Index: jardonnet/registration/cross_cov.hh Index: jardonnet/registration/center.hh --- jardonnet/registration/center.hh (revision 2549) +++ jardonnet/registration/center.hh (working copy) @@ -55,9 +55,8 @@ algebra::vec<P::dim,float> c(literal::zero); for (unsigned i = 0; i < a.nsites(); ++i) { - // FIXME : Ugly. - algebra::vec<P::dim,float> ai = a[i]; - c += ai; + //algebra::vec<P::dim,float> ai = a[i]; + c += convert::to< algebra::vec<P::dim,float> > (ai); } return algebra::to_point<P>(c / a.nsites()); @@ -70,4 +69,4 @@ } // end of namespace mln -#endif // ! MLN_MATH_ABS_HH +#endif // ! MLN_GEOM_CENTER_HH Index: classif/iccvg04.cc --- classif/iccvg04.cc (revision 0) +++ classif/iccvg04.cc (revision 0) @@ -0,0 +1,50 @@ + +#include <iostream> + +#include <mln/core/image/image2d.hh> +#include <mln/core/image/image3d.hh> +#include <mln/histo/data.hh> +#include <mln/value/all.hh> + +#include <mln/level/fill.hh> + +#include <mln/io/ppm/load.hh> + +#include <mln/io/pgm/save.hh> + +using namespace mln; + +template <typename I> +mln::image3d<unsigned> +fill_histo(const I& ima) +{ + image3d<unsigned> histo(256,256,256); + level::fill(histo, 0); + + mln_piter(I) p(ima.domain()); + for_all(p) + { + point3d p3(ima(p).red(),ima(p).green(), ima(p).blue()); + histo(p3)++; + } + return histo; +} + +int main(int argc, char **argv) +{ + image2d<value::rgb8> ima; + ima = io::ppm::load<value::rgb8>(argv[1]); + + image3d<unsigned> histo = fill_histo(ima); + + image2d< value::int_u16 > out(256,256); + level::fill(out, 0); + mln_piter_(image2d< value::int_u16 >) p(out.domain()); + for_all(p) + { + for (unsigned i = 0; i < 256; i++) + if ((out(p) + histo(point3d(p[0],p[1],i))) < 65536) + out(p) += histo(point3d(p[0],p[1],i)); + } + io::pgm::save(out,"./chiche.pgm"); +} Index: classif/chiche.pgm Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/chiche.pgm ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: classif/images/caf_0009.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/caf_0009.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/images/caf_0028.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/caf_0028.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/images/edfverso06.JPG Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/edfverso06.JPG ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: classif/images/capture.png Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/capture.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Index: classif/images/vpc_0001.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/vpc_0001.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/images/caf_0010.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/caf_0010.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/images/caf_0013.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/caf_0013.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/images/caf_0005.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/caf_0005.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/images/caf_0034.jpg Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: classif/images/caf_0034.jpg ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Index: classif/lena.ppm --- classif/lena.ppm (revision 0) +++ classif/lena.ppm (revision 0) Cannot display Index: classif/Makefile --- classif/Makefile (revision 0) +++ classif/Makefile (revision 0) @@ -0,0 +1,2 @@ +all: + g++ *.cc -I../../ -O3 \ No newline at end of file
participants (1)
-
Ugo Jardonnet