// n2ml.cc // robert - Programme du robot APBteam // Copyright (C) 2005 Olivier Gaillard #include #include #include #include "imgInterface.hh" #include "segmLearn.hh" #include "oconfig.hh" int main(int argc, char **argv) { // Usage if (argc < 4) { std::cout << "Usage : n2ml {rgb| yuv} " << std::endl; return 1; } int nbOutput = atoi(argv[1]); // Parse de la ligne de commande std::string *str = new std::string (argv[2]); Image::PixelFormat pf; if (*str == "rgb") pf = Image::rgb; else if (*str == "yuv") pf = Image::yuv; else std::cerr << "Wrong pixelformat\n"; std::vector list; while (argc-- > 3) { delete str; str = new std::string (argv[argc]); list.push_back(*str); } // Initialisation des classes OConfig oconfig; Img img; img.loadMultipeRaw (list, pf, 360, 296); SegmLearn segm; segm.buildNN (nbOutput, Segm::generate); segm.trainNN (&img); segm.save (); }