// 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) { index_ = new int[nbOutput_]; for (int i = 0; iindex[i]; } /// 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) { static int cts2 = ColorTable::colorTabSize2; static int cts = ColorTable::colorTabSize; if (lumFlag && (lumPos_ >= 0)) addLum (x[lumPos_]); // if (index_Process) return tab_[(int) (x[0] * cts2 + x[1] * cts + x[2]) ]; // else // return colorTable_[ x[0]*colorTabSize2 + x[1]*colorTabSize + x[2] ]; }