summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/vision/test_vision.cc
diff options
context:
space:
mode:
Diffstat (limited to '2004/i/nono/src/vision/test_vision.cc')
-rw-r--r--2004/i/nono/src/vision/test_vision.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/2004/i/nono/src/vision/test_vision.cc b/2004/i/nono/src/vision/test_vision.cc
new file mode 100644
index 0000000..9792910
--- /dev/null
+++ b/2004/i/nono/src/vision/test_vision.cc
@@ -0,0 +1,48 @@
+// test_vision.cc
+// buzz - Programme du robot Efrei Robotique I1-I2 2003
+// Copyright (C) 2003 Nicolas Schodet
+//
+#include "image.h"
+#include "date/date.h"
+
+#include <unistd.h>
+extern "C" {
+#include <ppm.h>
+};
+
+int
+main (int argc, char **argv)
+{
+ Date d;
+ Image *i;
+ Camera *c;
+ Thresholds *t;
+ ppm_init (&argc, argv);
+ try
+ {
+ t = new Thresholds ("rc/vision/palets.rgb");
+ c = new Camera ();
+ i = new Image (c, t);
+ for (int j = 0; j < 5; ++j)
+ {
+ if (i->reread ())
+ {
+ char s[256];
+ i->dumpGroups ();
+ sprintf (s, "dump%d.ppm", j);
+ i->dump (s);
+ }
+ sleep (1);
+ }
+ delete i;
+ delete c;
+ delete t;
+ }
+ catch (const char *s)
+ {
+ fprintf (stderr, "test_vision: %s\n", s);
+ return 1;
+ }
+ return 0;
+}
+