https://svn.lrde.epita.fr/svn/oln/prototypes/proto-1.0
ChangeLog | 7 +++++++
tests/morpho/tests/elementary_dilation | 28 ++++++++++++++++++++++++++++
tests/morpho/tests/elementary_erosion | 28 ++++++++++++++++++++++++++++
3 files changed, 63 insertions(+)
Index: olena/ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Add tests for elementary dilation/erosion.
* tests/morpho/tests/elementary_dilation,
* tests/morpho/tests/elementary_erosion: New tests.
2005-04-15 Roland Levillain <roland(a)lrde.epita.fr>
Index: olena/tests/morpho/tests/elementary_erosion
--- olena/tests/morpho/tests/elementary_erosion (revision 0)
+++ olena/tests/morpho/tests/elementary_erosion (revision 0)
@@ -0,0 +1,28 @@
+ // -*- C++ -*-
+#include "data.hh"
+#include <oln/utils/md5.hh>
+
+#include <oln/io/read_image.hh>
+#include <oln/basics2d.hh>
+#include <oln/morpho/elementary_erosion.hh>
+#include <oln/level/compare.hh>
+#include <ntg/all.hh>
+
+bool check()
+{
+ // MD5 sum of object.pbm's elementary erosion result.
+ // FIXME: Replace this fake with the actual result.
+ oln::utils::key::value_type data_key[16] =
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ oln::utils::key key(data_key);
+
+ typedef oln::image2d<ntg::bin> im_type;
+ im_type ima;
+ ima = oln::io::read(rdata("16x16.pbm"));
+
+ if (oln::utils::md5(oln::morpho::elementary_erosion(ima) != key)
+ return true;
+
+ return false;
+}
Index: olena/tests/morpho/tests/elementary_dilation
--- olena/tests/morpho/tests/elementary_dilation (revision 0)
+++ olena/tests/morpho/tests/elementary_dilation (revision 0)
@@ -0,0 +1,28 @@
+ // -*- C++ -*-
+#include "data.hh"
+#include <oln/utils/md5.hh>
+
+#include <oln/io/read_image.hh>
+#include <oln/basics2d.hh>
+#include <oln/morpho/elementary_dilation.hh>
+#include <oln/level/compare.hh>
+#include <ntg/all.hh>
+
+bool check()
+{
+ // MD5 sum of object.pbm's elementary dilation result.
+ // FIXME: Replace this fake with the actual result.
+ oln::utils::key::value_type data_key[16] =
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+ oln::utils::key key(data_key);
+
+ typedef oln::image2d<ntg::bin> im_type;
+ im_type ima;
+ ima = oln::io::read(rdata("16x16.pbm"));
+
+ if (oln::utils::md5(oln::morpho::elementary_erosiont(ima) != key)
+ return true;
+
+ return false;
+}