summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/test_segm.cc
blob: ef61b91ad9fdea876b56248623172d75f5cf5b4b (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
// test_segm.cc - Test la segmentation 
// robert - Programme du robot APBteam
// Copyright (C) 2005 Olivier Gaillard
#include <iostream>

#include "imgInterface.hh"
#include "segmLearn.hh"
#include "oconfig.hh"


int main(int argc, char **argv) 
{
    // Usage
    if (argc < 2)
      {
	std::cout << "Usage : test_segm <filename>" << std::endl;
	return 1;
      }
    // Initialisation des classes
    OConfig oconfig_;
    ImgInterface img;
    img.loadRaw (argv[1], Image::rgb, oconfig_.width, oconfig_.height);
    SegmLearn segm;
    segm.buildNN (oconfig_.nnNbColor, Segm::loadFromFile);
    segm.showNodes ();
    segm.segmImg (&img);

    // Cr�ation de l'image segment�e
    img.doImg ();
    img.writeRaw ("../runtime/shots/segm.rgb", img.getTabOut ());
}