summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/test_group.cc
diff options
context:
space:
mode:
authorgaillaro2005-04-05 18:26:18 +0000
committergaillaro2005-04-05 18:26:18 +0000
commit97b69507c877a4644c0caac4f61e052e188f9d8e (patch)
tree1a81f341ab6577003fa60ca3fb135e7b4baeecba /2005/i/robert/src/ovision/see/test_group.cc
parent0062520c9cc87eeeb8828361bbb33033a6f07b7e (diff)
Renaissance de la vision :
- code standard robot - presque du C++ - apprentissage du RN sur plusieurs images - tableau de données couleurs compressé - reconnaissance de plusieurs objets possibles
Diffstat (limited to '2005/i/robert/src/ovision/see/test_group.cc')
-rw-r--r--2005/i/robert/src/ovision/see/test_group.cc55
1 files changed, 55 insertions, 0 deletions
diff --git a/2005/i/robert/src/ovision/see/test_group.cc b/2005/i/robert/src/ovision/see/test_group.cc
new file mode 100644
index 0000000..bcd4ae2
--- /dev/null
+++ b/2005/i/robert/src/ovision/see/test_group.cc
@@ -0,0 +1,55 @@
+// test_group.cc
+// robert - Programme du robot APBteam
+// Copyright (C) 2005 Olivier Gaillard
+
+#include <iostream>
+#include <vector>
+#include <string>
+
+#include "segmLearn.hh"
+#include "segmTable.hh"
+#include "colorTable.hh"
+#include "oconfig.hh"
+#include "group.hh"
+#include "imgInterface.hh"
+
+int
+main(int argc, char **argv)
+{
+ /////////////////////////////////////////////////////////////////////////////////////////
+ /// Initialisation des classes
+ OConfig *oconfig_;
+ try
+ {
+ oconfig_ = new OConfig ("rc/vision.conf");
+ }
+ catch (std::string &e)
+ {
+ std::cerr << e << std::endl;
+ return 1;
+ }
+ ImgInterface img;
+ img.loadRaw ("shots/test.rgb", Image::rgb, 360, 296);
+ SegmLearn segm;
+ segm.buildNN (oconfig_->nnNbColor, Segm::loadFromFile);
+ Group group(&img, &segm);
+ /////////////////////////////////////////////////////////////////////////////////////////
+ /// Initialise les couleurs chercher
+ std::vector<ObjectColor> colorList;
+ ObjectColor tmp;
+ tmp.label = "ball";
+ tmp.color = 4;
+ colorList.push_back (tmp);
+ /////////////////////////////////////////////////////////////////////////////////////////
+ /// Cherche les groupes
+ group.jumpPoints(colorList);
+ group.showZones();
+ ////////////////////////////////////////////////////////////////////////////////////////
+ /// Cre une image pour afficher les groups
+ group.jumpPoints(colorList);
+ std::vector<Zone> &test = group.getZoneList ();
+ img.doGroupImg (test);
+ img.doImg (img.getTabSegm ());
+ img.writeRaw ("shots/group.rgb", img.getTabOut ());
+}
+