summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/segmTable.cc
blob: ff428e28cbb35ad0bd8eb590460613b5074fe681 (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
// segmTable.cc - Classe Segmentation
// robert - Programme du robot APBteam
// Copyright (C) 2005 Olivier Gaillard

/// @file segmTable.cc Segmente l'image et cree un tableau contenant des valeurs segmentees, creation du reseau de neurones
#include "segmTable.hh"
#include "convertImg.hh"
#include <fstream>
#include <iostream>

/// Constructor SegmTable

/// @param img classe img permettant d'acceder au donnees de l'image a traiter
/// @param oconfig_ classe oconfig_ permettant d'acceder aux variables de oconfig_uration
SegmTable::SegmTable (ColorTable &tab)
    : tab_ (tab)
{
}

/// Donne la couleur � partir du tableau
/// @param *x pointeur vers un tableau contenant une valeur RGB
unsigned char
SegmTable::giveColor (const unsigned char *x, const bool testOutputMax, const bool index_Process, const bool lumFlag)
{
    if (lumFlag && (lumPos_ >= 0)) addLum (x[lumPos_]); 
//    if (index_Process)
	return index_ [tab_[(int) (x[0] * ColorTable::colorTabSize2 + x[1] * ColorTable::colorTabSize + x[2]) ]];
//    else
//	return colorTable_[ x[0]*colorTabSize2 + x[1]*colorTabSize + x[2] ];
}