summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/vision/test_image.cc
diff options
context:
space:
mode:
Diffstat (limited to '2003/i/buzz/src/vision/test_image.cc')
-rw-r--r--2003/i/buzz/src/vision/test_image.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/2003/i/buzz/src/vision/test_image.cc b/2003/i/buzz/src/vision/test_image.cc
new file mode 100644
index 0000000..cbdbd1e
--- /dev/null
+++ b/2003/i/buzz/src/vision/test_image.cc
@@ -0,0 +1,37 @@
+// test_image.cc - Teste la classe Image.
+// buzz - Programme du robot Efrei Robotique I1-I2 2003
+// Copyright (C) 2003 Nicolas Schodet
+#include "image.h"
+
+extern "C" {
+#include <ppm.h>
+};
+
+int
+main (int argc, char **argv)
+{
+ Image *i;
+ Thresholds *t;
+ SizeThresholds *st;
+ ppm_init (&argc, argv);
+ try
+ {
+ t = new Thresholds ("palets.rgb");
+ st = new SizeThresholds ("palets.size");
+ i = new Image (argc == 2 ? argv[1] : "test.ppm", t, 0);
+ i->filter ();
+ i->group ();
+ i->groupFilter ();
+ i->dumpGroups ();
+ i->dump ("dump.ppm");
+ delete i;
+ delete t;
+ delete st;
+ }
+ catch (const char *s)
+ {
+ fprintf (stderr, "test_image: %s\n", s);
+ return 1;
+ }
+ return 0;
+}