// 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 #include /// 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) { if (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] ]; }