// test_group.cc // robert - Programme du robot APBteam // Copyright (C) 2005 Olivier Gaillard #include #include #include #include "segmLearn.hh" #include "segmTable.hh" #include "colorTable.hh" #include "oconfig.hh" #include "group.hh" #include "imgInterface.hh" #include "magnifier.hh" int main(int argc, char **argv) { ///////////////////////////////////////////////////////////////////////////////////////// /// Initialisation des classes OConfig *oconfig_; try { oconfig_ = new OConfig; } catch (std::string &e) { std::cerr << e << std::endl; return 1; } Img img; img.loadRaw ("../runtime/shots/test.rgb", Image::rgb, oconfig_->width, oconfig_->height); SegmLearn segm; segm.buildNN (oconfig_->nnNbColor, Segm::loadFromFile); // ColorTable tab; // SegmTable segm (tab); Group group (&img, &segm); Magnifier mag (&img, &segm, Group::redSkittle); ///////////////////////////////////////////////////////////////////////////////////////// /// Initialise les couleurs à chercher std::vector colorList; ObjectColor tmp; tmp.label = "ball"; tmp.color = 4; colorList.push_back (tmp); ///////////////////////////////////////////////////////////////////////////////////////// /// Cherche les groupes group.jumpPoints (colorList); group.showZones (); //////////////////////////////////////////////////////////////////////////////////////// /// Analyse et tri la liste de zones trouvées mag.analyse (group.getZoneList ()); mag.showItems (Group::redSkittle); delete oconfig_; }