oln 10.57: New gaussian tests

Index: olena/ChangeLog from Giovanni Palma <giovanni@lrde.epita.fr> * tests/convol/tests/uniform_gauss: Add test to make sure fast_gaussian take care of the borders. * tests/convol/tests/uniform2_gauss: Add test to make sure fast_gaussian take care of the borders. Index: olena/tests/convol/tests/uniform2_gauss --- olena/tests/convol/tests/uniform2_gauss Fri, 30 Jan 2004 10:24:22 +0100 palma_g () +++ olena/tests/convol/tests/uniform2_gauss Thu, 29 Jan 2004 17:26:24 +0100 palma_g (oln/j/40_uniform2_g 644) @@ -0,0 +1,32 @@ +// -*- c++ -*- +#include <oln/basics2d.hh> +#include <oln/convol/fast_gaussian.hh> +#include <oln/convert/basics.hh> + +#include "check.hh" +#include "data.hh" + +#include <iostream> +using std::cout; +using std::endl; + +using namespace oln; +using namespace mlc; +using namespace ntg; + +// check if the gaussian of an uniform image doesn't destroy the image +// this test will fail since the relation between the border size and sigma is non linear +bool check() +{ + image2d<int_u8> img(50, 50); + image2d<int_u8>::iter_type it(img); + + for_all(it) + img[it] = 42; + image2d<int_u8> img2 = convol::fast::gaussian(img, 50); // XFAIL + + for_all(it) + if (img[it] != img2[it]) + return true; + return false; +} Index: olena/tests/convol/tests/uniform_gauss --- olena/tests/convol/tests/uniform_gauss Fri, 30 Jan 2004 10:24:22 +0100 palma_g () +++ olena/tests/convol/tests/uniform_gauss Thu, 29 Jan 2004 17:21:49 +0100 palma_g (oln/j/41_uniform_ga 644) @@ -0,0 +1,31 @@ +// -*- c++ -*- +#include <oln/basics2d.hh> +#include <oln/convol/fast_gaussian.hh> +#include <oln/convert/basics.hh> + +#include "check.hh" +#include "data.hh" + +#include <iostream> +using std::cout; +using std::endl; + +using namespace oln; +using namespace mlc; +using namespace ntg; + +// check if the gaussian of an uniform image doesn't destroy the image +bool check() +{ + image2d<int_u8> img(50, 50); + image2d<int_u8>::iter_type it(img); + + for_all(it) + img[it] = 42; + image2d<int_u8> img2 = convol::fast::gaussian(img, 5); + + for_all(it) + if (img[it] != img2[it]) + return true; + return false; +} -- Giovanni Palma EPITA - promo 2005 - membre d'EpX - LRDE Mob. : +33 (0)6 60 97 31 74
participants (1)
-
Giovanni Palma