Commit 5f1fa927 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Move gaussian filter test out of sandbox.

	* sandbox/nivault/tests/test.cc: Rename as...
	* tests/linear_gaussian.cc: ...this.
	Fix.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@1076 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 82d645ec
2007-09-06 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Move gaussian filter test out of sandbox.
* sandbox/nivault/tests/test.cc: Rename as...
* tests/linear_gaussian.cc: ...this.
Fix.
2007-09-06 Thierry Geraud <thierry.geraud@lrde.epita.fr> 2007-09-06 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Tiny fix and add some preconditions. Tiny fix and add some preconditions.
......
...@@ -25,19 +25,35 @@ ...@@ -25,19 +25,35 @@
// reasons why the executable file might be covered by the GNU General // reasons why the executable file might be covered by the GNU General
// Public License. // Public License.
/*! \file tests/linear_gaussian.cc
*
* \brief Test on mln::linear::gaussian.
*/
#include <mln/core/image2d_b.hh> #include <mln/core/image2d_b.hh>
#include <mln/value/int_u8.hh>
#include <mln/value/int_u_sat.hh>
#include <mln/io/load_pgm.hh> #include <mln/io/load_pgm.hh>
#include <mln/io/save_pgm.hh> #include <mln/io/save_pgm.hh>
#include <fast_gaussian.hh> #include <mln/level/transform.hh>
#include <mln/level/saturate.hh>
#include <mln/math/round.hh>
#include <mln/linear/gaussian.hh>
int main() int main()
{ {
mln::image2d_b<mln::value::int_u<8u> > im1 = mln::io::load_pgm("../../../img/lena.pgm"); using namespace mln;
mln_precondition(im1.has_data());
mln::image2d_b<mln::value::int_u<8u> > im2(im1.domain()); image2d_b< value::int_u8 > lena = io::load_pgm("../img/lena.pgm");
mln::linear::gaussian(im1, 2, im2); image2d_b<float> tmp(lena.domain());
linear::gaussian(lena, 5.1f, tmp);
mln::io::save_pgm(im2, "gausslena.pgm"); image2d_b< value::int_u_sat<8> > out(lena.domain());
level::transform(tmp, math::round<int>(), out);
io::save_pgm(out, "out.pgm");
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment