summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/ovision/test_map.cc
diff options
context:
space:
mode:
Diffstat (limited to '2004/i/nono/src/ovision/test_map.cc')
-rw-r--r--2004/i/nono/src/ovision/test_map.cc50
1 files changed, 50 insertions, 0 deletions
diff --git a/2004/i/nono/src/ovision/test_map.cc b/2004/i/nono/src/ovision/test_map.cc
new file mode 100644
index 0000000..f515c32
--- /dev/null
+++ b/2004/i/nono/src/ovision/test_map.cc
@@ -0,0 +1,50 @@
+
+#include "img.h"
+#include "image/raw_loader.h"
+#include "video4linux/video4linux.h"
+#include "map.h"
+#include "oconfig.h"
+#include "group.h"
+#include "space.h"
+#include "segmLearn.h"
+//#include "imgFile.h"
+int
+main()
+{
+ OConfig oconfig("rc/vision.conf");
+
+ Img img;
+ RawLoader rawLoader("test.rgb", 360, 296, ImageLoader::rgb);
+ img.load(rawLoader);
+
+
+ /*
+ Video4Linux::ColorSpace cs;
+ cs = Video4Linux::rgb;
+ Video4Linux v4l("/dev/video", cs, 30000);
+ v4l.calibrate ();
+ img.load(v4l);
+ */
+// if ((oconfig.colorMode == YUV) && (!img.yuv)) img.RGBtoYUV();
+// img.WriteRGB("test.rgb");
+
+ Space space(img.width, img.height);
+ space.AddSetupPoint (109, 36, 150, 900);
+ space.AddSetupPoint (84, 102, 150, 600);
+ space.AddSetupPoint (50, 259, 150, 300);
+ space.Setup (0.00603759, 0.593767, 291.474);
+
+ SegmLearn segmNN(&img);
+ segmNN.BuildNN(oconfig.nn_NbCouleurs, LOAD_FROM_FILE);
+// segmNN.DoColorTable ();
+
+ Group group(&img, &segmNN);
+
+ Map map(&space);
+
+ group.JumpPoints(oconfig.groupColor);
+ group.ShowZones();
+
+ map.AddBallsToMap(&group);
+ map.ShowBalls();
+}