#include "image/raw_loader.h" #include "map.h" #include "oconfig.h" #include "group.h" #include "space.h" //#include "imgFile.h" int main() { OConfig oconfig("rc/vision.conf"); // ImgFile img; // img.ReadRaw("im.jpg"); // Img img; // RawLoader rawLoader("im2000.rgb", 360, 296, ImageLoader::rgb); // img.load(rawLoader); Video4Linux::ColorSpace cs; cs = Video4Linux::yuv; Video4Linux vid ("/dev/video", cs); vid.calibrate (); int w, h; vid.getSize (w, h); std::cout << w << ' ' << h << std::endl; int s; s = vid.getBufSize (); unsigned char *buf = new unsigned char[s]; s = vid.read (buf, s); 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 (); SegmNN segmNN(&img, &oconfig); segmNN.BuildNN(oconfig.nn_NbCouleurs, LOAD_FROM_FILE); Group group(&img, &segmNN); Map map(&oconfig, &space); segmNN.Segm(); group.JumpPoints(oconfig.groupColor); // group.ShowZones(); map.AddBallsToMap(&group); // map.ShowBalls(); }