summaryrefslogtreecommitdiff
path: root/2003/i/buzz/src/vision/test_image.cc
diff options
context:
space:
mode:
authorschodet2003-05-01 17:10:58 +0000
committerschodet2003-05-01 17:10:58 +0000
commit30ea7faee31ad69f3f0886dae8bb58e1fe31a74f (patch)
treeec61cfbc35f9a603f8ffd9e6c3ddb72b72a570e7 /2003/i/buzz/src/vision/test_image.cc
parentc306e33f3005ddb5a19c9aa590ef19560471137b (diff)
Ajout du module vision.
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;
+}