URL:
https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2007-11-05 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Add more tests for FLLT.
* sandbox/garrigues/test_fllt6.cc: New,
* sandbox/garrigues/test_fllt7.cc: New,
* sandbox/garrigues/test_fllt8.cc: New,
* sandbox/garrigues/test_fllt9.cc: New,
* sandbox/garrigues/test_fllt_lena.cc: New,
* sandbox/garrigues/test_fllt_lena_tiles.cc: New, test FLLT with
differents 2d images.
---
test_fllt6.cc | 28 ++++++++++++++++++++++++++++
test_fllt7.cc | 44 ++++++++++++++++++++++++++++++++++++++++++++
test_fllt8.cc | 33 +++++++++++++++++++++++++++++++++
test_fllt9.cc | 41 +++++++++++++++++++++++++++++++++++++++++
test_fllt_lena.cc | 24 ++++++++++++++++++++++++
test_fllt_lena_tiles.cc | 32 ++++++++++++++++++++++++++++++++
6 files changed, 202 insertions(+)
Index: trunk/milena/sandbox/garrigues/test_fllt_lena_tiles.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt_lena_tiles.cc (revision 0)
+++ trunk/milena/sandbox/garrigues/test_fllt_lena_tiles.cc (revision 1427)
@@ -0,0 +1,32 @@
+# include "fllt.hh"
+# include <mln/core/image2d.hh>
+# include <mln/core/clone.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/debug/println.hh>
+# include <mln/convert/to_w_window.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/convert/to_image.hh>
+# include <mln/level/fill.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pbm/load.hh>
+# include <sstream>
+
+
+int main()
+{
+
+ using namespace mln;
+
+ for (int i = 0; i < 16; ++i)
+ for (int j = 0; j < 16; ++j)
+ {
+ std::stringstream path;
+ path << "/lrde/tegucigalpa/theo/pub/mln_docs/lena_tiles/lena_"
<< i << "_" << j << ".pgm";
+ std::cout << path.str () << std::endl;
+ image2d<value::int_u8> ima = io::pgm::load(path.str());
+ image2d<int> ima_int(ima.domain());
+ level::fill(ima_int, ima);
+ debug::println(ima_int);
+ fllt::fllt(ima_int);
+ }
+}
Index: trunk/milena/sandbox/garrigues/test_fllt_lena.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt_lena.cc (revision 0)
+++ trunk/milena/sandbox/garrigues/test_fllt_lena.cc (revision 1427)
@@ -0,0 +1,24 @@
+# include "fllt.hh"
+# include <mln/core/image2d.hh>
+# include <mln/core/clone.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/debug/println.hh>
+# include <mln/convert/to_w_window.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/convert/to_image.hh>
+# include <mln/level/fill.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pbm/load.hh>
+
+int main()
+{
+
+ using namespace mln;
+
+ image2d<value::int_u8> ima = io::pgm::load("../../img/lena.pgm");
+
+ image2d<int> ima_int(ima.domain());
+
+ level::fill(ima_int, ima);
+ fllt::fllt(ima_int);
+}
Index: trunk/milena/sandbox/garrigues/test_fllt6.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt6.cc (revision 0)
+++ trunk/milena/sandbox/garrigues/test_fllt6.cc (revision 1427)
@@ -0,0 +1,28 @@
+# include "fllt.hh"
+# include <mln/core/image2d.hh>
+# include <mln/core/clone.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/debug/println.hh>
+# include <mln/convert/to_w_window.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/convert/to_image.hh>
+# include <mln/level/fill.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pbm/load.hh>
+# include <sstream>
+
+
+int main()
+{
+
+ using namespace mln;
+
+ int ws[25] = {1,1,1, 1,1,
+ 1,255,1, 1, 1,
+ 1,1,1,1, 1,
+ 1,1,1, 255, 1,
+ 1,1,1, 1, 1};
+ w_window2d_int w_win = make::w_window2d(ws);
+ image2d<int> ima = convert::to_image(w_win);
+ fllt::fllt(ima);
+}
Index: trunk/milena/sandbox/garrigues/test_fllt7.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt7.cc (revision 0)
+++ trunk/milena/sandbox/garrigues/test_fllt7.cc (revision 1427)
@@ -0,0 +1,44 @@
+# include "fllt2.hh"
+# include <mln/core/image2d.hh>
+# include <mln/core/clone.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/debug/println.hh>
+# include <mln/convert/to_w_window.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/convert/to_image.hh>
+# include <mln/level/fill.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pgm/save.hh>
+# include <mln/io/pbm/load.hh>
+# include <sstream>
+
+
+int main()
+{
+
+ using namespace mln;
+ using typename value::int_u8;
+
+ int ws[49] = {101, 101, 101, 191, 204, 255, 191,
+ 101, 101, 191, 204, 204, 204, 204,
+ 101, 191, 191, 204, 255, 204, 191,
+ 204, 204, 204, 191, 191, 191, 76,
+ 191, 191, 204, 191, 101, 101, 76,
+ 204, 204, 191, 204, 101, 76, 76,
+ 191, 191, 191, 101, 76, 101, 0};
+
+
+ int vs[5][5] = { {100, 200, 200, 200, 100},
+ {100, 200, 255, 200, 100},
+ {100, 200, 200, 200, 100},
+ {100, 200, 255, 200, 100},
+ {100, 200, 200, 200, 100} };
+
+ image2d<int> ima(make::image2d(vs));
+ image2d<int_u8> out(ima.domain());
+
+ level::fill(out, ima);
+ io::pgm::save(out, "ima.pgm ");
+ fllt::fllt(ima);
+
+}
Index: trunk/milena/sandbox/garrigues/test_fllt8.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt8.cc (revision 0)
+++ trunk/milena/sandbox/garrigues/test_fllt8.cc (revision 1427)
@@ -0,0 +1,33 @@
+# include "fllt2.hh"
+# include <mln/core/image2d.hh>
+# include <mln/core/clone.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/debug/println.hh>
+# include <mln/convert/to_w_window.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/convert/to_image.hh>
+# include <mln/level/fill.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pgm/save.hh>
+# include <mln/io/pbm/load.hh>
+# include <sstream>
+
+
+int main()
+{
+
+ using namespace mln;
+ using typename value::int_u8;
+
+ int vs[3][6] = { {0, 0, 0, 1, 1, 1},
+ {0, 1, 0, 1, 0, 1},
+ {0, 0, 0, 1, 1, 1} };
+
+ image2d<int> ima(make::image2d(vs));
+ image2d<int_u8> out(ima.domain());
+
+ level::fill(out, ima);
+ io::pgm::save(out, "ima.pgm ");
+ fllt::fllt(ima);
+
+}
Index: trunk/milena/sandbox/garrigues/test_fllt9.cc
===================================================================
--- trunk/milena/sandbox/garrigues/test_fllt9.cc (revision 0)
+++ trunk/milena/sandbox/garrigues/test_fllt9.cc (revision 1427)
@@ -0,0 +1,41 @@
+# include "fllt2.hh"
+# include <mln/core/image2d.hh>
+# include <mln/core/clone.hh>
+# include <mln/value/int_u8.hh>
+# include <mln/debug/println.hh>
+# include <mln/convert/to_w_window.hh>
+# include <mln/core/w_window2d_int.hh>
+# include <mln/convert/to_image.hh>
+# include <mln/level/fill.hh>
+# include <mln/io/pgm/load.hh>
+# include <mln/io/pgm/save.hh>
+# include <mln/io/pbm/load.hh>
+# include <sstream>
+
+
+int main()
+{
+
+ using namespace mln;
+ using typename value::int_u8;
+
+ int vs[5][5] = { {100, 100, 100, 100, 100},
+ {100, 200, 255, 200, 100},
+ {100, 200, 200, 200, 100},
+ {100, 200, 255, 200, 100},
+ {100, 100, 100, 100, 100} };
+
+ int vs_inv[5][5] = { {255, 255, 255, 255, 255},
+ {255, 200, 100, 200, 255},
+ {255, 200, 200, 200, 255},
+ {255, 200, 100, 200, 255},
+ {255, 255, 255, 255, 255} };
+
+ image2d<int> ima(make::image2d(vs));
+ image2d<int_u8> out(ima.domain());
+
+ level::fill(out, ima);
+ io::pgm::save(out, "ima.pgm ");
+ fllt::fllt(ima);
+
+}