summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/ovision/testmap.cc
blob: 191156c257873bacc992c5e501c60729c3d22303 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "imgFile.h"
#include "image/raw_loader.h"
#include "video4linux/video4linux.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("test3.jpg");
    //
/*
    Img img;
    RawLoader rawLoader("im2000.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, &oconfig);
    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();
}