summaryrefslogtreecommitdiff
path: root/2005/i
diff options
context:
space:
mode:
authorgaillaro2005-04-09 17:40:06 +0000
committergaillaro2005-04-09 17:40:06 +0000
commit7cc8bf6a4cbd062f5d4f6e2b310cd603ab2c60e1 (patch)
tree7bc2ebf03a3d181f5e343ef648b12991a3a48c6d /2005/i
parent294fe97ae1b8e0b8ec341cb31fb7a5d7fd02066a (diff)
qq modifs sur l'interface
Diffstat (limited to '2005/i')
-rw-r--r--2005/i/robert/runtime/rc/poids21
-rw-r--r--2005/i/robert/runtime/rc/vision.conf9
-rw-r--r--2005/i/robert/src/ovision/see/Makefile.defs2
-rw-r--r--2005/i/robert/src/ovision/see/oconfig.cc5
-rw-r--r--2005/i/robert/src/ovision/see/segmLearn.cc16
-rw-r--r--2005/i/robert/src/ovision/ui/comm.cc13
-rw-r--r--2005/i/robert/src/ovision/ui/live.cc23
-rw-r--r--2005/i/robert/src/ovision/ui/live.hh9
-rw-r--r--2005/i/robert/src/ovision/ui/liveView.cc67
-rw-r--r--2005/i/robert/src/ovision/ui/ui.cc141
-rw-r--r--2005/i/robert/src/ovision/ui/ui.hh3
11 files changed, 244 insertions, 65 deletions
diff --git a/2005/i/robert/runtime/rc/poids b/2005/i/robert/runtime/rc/poids
index d9c160f..655a80a 100644
--- a/2005/i/robert/runtime/rc/poids
+++ b/2005/i/robert/runtime/rc/poids
@@ -1,14 +1,15 @@
-#couleur
-redSkittle -1
-greenSkittle 2
+redSkittle 4
+greenSkittle 1
gap -1
border -1
base -1
-
#index #x1 x2 x3
-0 245 245 176
-1 220 205 91
-2 245 245 117
-3 72 189 220
-4 195 127 60
-5 98 125 105
+0 35 114 133
+1 87 100 131
+2 71 104 128
+3 59 110 128
+4 72 104 154
+5 109 68 133
+0 194 80 131
+105 30 220 215
+152 31 30 220
diff --git a/2005/i/robert/runtime/rc/vision.conf b/2005/i/robert/runtime/rc/vision.conf
index 0b2f240..7e43dce 100644
--- a/2005/i/robert/runtime/rc/vision.conf
+++ b/2005/i/robert/runtime/rc/vision.conf
@@ -1,7 +1,7 @@
#############################################
# Camera #
#############################################
-Cam_color = RGB
+Cam_color = YUV
#############################################
# Segm #
@@ -9,16 +9,15 @@ Cam_color = RGB
NN_step_learning = 0.1
NN_neighborhood_learning = 0.01
NN_number_of_iteration_learning = 5000
-NN_number_of_color_to_segment = 6
-NN_luminosity_influence = 0.5
+NN_luminosity_influence = 0.1
NN_lazy_threshold = 3
NN_threshold_output = 10000
#############################################
# Group #
#############################################
-Group_minimum_length_zone = 20
-Group_jump_point_distance = 10
+Group_minimum_length_zone = 70
+Group_jump_point_distance = 20
#############################################
# Space #
diff --git a/2005/i/robert/src/ovision/see/Makefile.defs b/2005/i/robert/src/ovision/see/Makefile.defs
index 42aed85..92b9671 100644
--- a/2005/i/robert/src/ovision/see/Makefile.defs
+++ b/2005/i/robert/src/ovision/see/Makefile.defs
@@ -5,6 +5,7 @@ LDFLAGS= -Wall -g -fprofile-arcs -ftest-coverage -fmessage-length=0
ovision_OBJECTS = convertImg.o img.o oconfig.o ovision.o segm.o imgInterface.o colorTable.o segmTable.o segmLearn.o group.o magnifier.o #space.o map.o
test_img_OBJECTS = test_img.o img.o imgInterface.o oconfig.o $(image_OBJECTS)
+test_hotelling_OBJECTS = test_hotelling.o hotelling.o oconfig.o
test_cam_OBJECTS = test_cam.o img.o imgInterface.o oconfig.o $(video4linux_OBJECTS) $(image_OBJECTS) $(utils_OBJECTS)
test_segm_OBJECTS = test_segm.o img.o segm.o segmLearn.o oconfig.o imgInterface.o colorTable.o segmTable.o $(image_OBJECTS)
test_ovision_OBJECTS = test_ovision.cc $(ovision_OBJECTS) $(image_OBJECTS) $(video4linux_OBJECTS) $(utils_OBJECTS)
@@ -17,6 +18,7 @@ test_group_OBJECTS = test_group.o group.o img.o segm.o segmLearn.o oconfig.o img
test_magnifier_OBJECTS = test_magnifier.o magnifier.o group.o img.o segm.o segmLearn.o oconfig.o imgInterface.o $(image_OBJECTS)
test_img: $(test_img_OBJECTS:%.o=%.o)
+test_hotelling: $(test_hotelling_OBJECTS:%.o=%.o)
test_cam: $(test_cam_OBJECTS:%.o=%.o)
test_segm: $(test_segm_OBJECTS:%.o=%.o)
$(CXX) $(LDFLAGS) -lz $^ -o $@
diff --git a/2005/i/robert/src/ovision/see/oconfig.cc b/2005/i/robert/src/ovision/see/oconfig.cc
index 784d031..663337a 100644
--- a/2005/i/robert/src/ovision/see/oconfig.cc
+++ b/2005/i/robert/src/ovision/see/oconfig.cc
@@ -51,7 +51,6 @@ OConfig::parse(const char *var, const char *arg)
if (varName == "NN_step_learning") nnSl = atof(arg);
else if (varName == "NN_neighborhood_learning") nnNl = atof(arg);
else if (varName == "NN_number_of_iteration_learning") nnNil = atol(arg);
- else if (varName == "NN_number_of_color_to_segment") nnNbColor = atoi(arg);
else if (varName == "NN_threshold_output") nnThresholdOutput = atoi(arg);
else if (varName == "NN_lum_inosity_influence") nnInfluLum = atof(arg);
else if (varName == "UI_img_path ") strcpy(imgPath, arg);
@@ -118,6 +117,7 @@ OConfig::loadNNFile (const char *filePath)
}
// Chargement des couleurs
char buf [maxChar];
+ groupColor.clear ();
while (!file.eof ())
{
file.getline (buf, maxChar);
@@ -159,6 +159,7 @@ OConfig::loadNNFile (const char *filePath)
for (unsigned int i=0; i<tmpIndex.size (); ++i)
index[i] = (unsigned char)tmpIndex[i];
nnNbNodeMax = tmpIndex.size ();
+ nnNbColor = nnNbNodeMax;
}
/// Creation d'un fichier de poids pour le reseau de neurones
@@ -184,7 +185,7 @@ OConfig::createNNFile (const char *filename, const int nbOutput_) const
{
file << index[i] << "\t";
for (int j=0; j<3; j++)
- file << node[i*3+j] << "\t";
+ file << (int)node[i*3+j] << "\t";
file << "\n";
}
file.close ();
diff --git a/2005/i/robert/src/ovision/see/segmLearn.cc b/2005/i/robert/src/ovision/see/segmLearn.cc
index e13abd2..627f656 100644
--- a/2005/i/robert/src/ovision/see/segmLearn.cc
+++ b/2005/i/robert/src/ovision/see/segmLearn.cc
@@ -43,9 +43,9 @@ SegmLearn::weightsGen (const int numNode)
/// @param nbOutput_ nombre de noeuds de la couche de sortie du NN
/// @param loadFromFile (GENERATE ou LOADFROMFILE) indique si les poids sont charges d'un fichier ou generes aleatoirement
void
-SegmLearn::buildNN (const int nbOutput_, const bool loadFromFile)
+SegmLearn::buildNN (const int nbOutput, const bool loadFromFile)
{
- this->nbOutput_ = nbOutput_;
+ nbOutput_ = nbOutput;
// Initialisation des noeuds du NN
delete [] node_;
node_ = new unsigned char[nbOutput_*3];
@@ -101,8 +101,16 @@ SegmLearn::trainNN (Img *img)
// Mis a jour des poids
for(int k=0; k<3; k++)
{
- node_[numOutputMax*3+k] =
- (unsigned char)((node_[numOutputMax*3+k] + oconfig_->nnSl*tabData_[pixelNum*3+k])/(1+oconfig_->nnSl));
+ // Si on est en yuv ou hsi et que c'est la composante de lum_inosite, on ajoute un poids pour affecter son influence
+ if (k == lumPos_)
+ node_[numOutputMax*3+k] =
+ (unsigned char)(oconfig_->nnSl*(node_[numOutputMax*3+k]
+ + oconfig_->nnSl*tabData_[pixelNum*3+k])/(1+oconfig_->nnSl));
+ // Sinon calcul normal
+ else
+ node_[numOutputMax*3+k] =
+ (unsigned char)((node_[numOutputMax*3+k]
+ + oconfig_->nnSl*tabData_[pixelNum*3+k])/(1+oconfig_->nnSl));
// Recompense pour la sortie qui travaille
freq_[numOutputMax]++;
}
diff --git a/2005/i/robert/src/ovision/ui/comm.cc b/2005/i/robert/src/ovision/ui/comm.cc
index 906ad51..beb4be8 100644
--- a/2005/i/robert/src/ovision/ui/comm.cc
+++ b/2005/i/robert/src/ovision/ui/comm.cc
@@ -213,6 +213,13 @@ Comm::executeUiCmds (const char *buffer)
live_->rootPics ();
}
break;
+ case 'f': // Format de couleur
+ {
+ int fc;
+ ss >> fc;
+ if (fc == 0) live_->segm->setMode (Image::rgb);
+ else if (fc == 1) live_->segm->setMode (Image::yuv);
+ }
/*
case 'g': // Selection du live_->groupe
ss >> live_->oconfig->live_->groupColor;
@@ -308,9 +315,9 @@ Comm::executeUiCmds (const char *buffer)
live_->img->loadRaw(fname, Image::yuv, 360, 296);
break;
*/
- case 'z':
- live_->group->showZones();
- break;
+ case 'z':
+ live_->group->showZones();
+ break;
/*
case 'f':
{
diff --git a/2005/i/robert/src/ovision/ui/live.cc b/2005/i/robert/src/ovision/ui/live.cc
index 5bc87ac..caa4e1b 100644
--- a/2005/i/robert/src/ovision/ui/live.cc
+++ b/2005/i/robert/src/ovision/ui/live.cc
@@ -20,14 +20,17 @@
/// Constructeur
/// @param *filename nom de l'image a utiliser
Live::Live (const unsigned nbImg, const ImageInput imgInput)
- : group (0), imgInput_ (imgInput)
+ : colorToFind_ (-1), group (0), imgInput_ (imgInput)
{
if (nbImg < 6) nbImg_ = 6;
else nbImg_ = nbImg;
}
+
+/// Initialisation
void
-Live::init (const char *filename)
+Live::init (const char *filename, const Image::PixelFormat pf,
+ const unsigned width, const unsigned height)
{
tex = new unsigned[nbImg_];
data = new unsigned char*[nbImg_];
@@ -36,7 +39,6 @@ Live::init (const char *filename)
// Création de l'image
img = new ImgInterface;
// Ouverture de l'image pilote et stockage
- Image::PixelFormat pf = Image::rgb;
switch (imgInput_)
{
case file:
@@ -46,7 +48,7 @@ Live::init (const char *filename)
std::string f (fname);
DataInputFile *dif = new DataInputFile (f);
DataInput *di = reinterpret_cast<DataInput*> (dif);
- reader_ = new RawReader (*di, 360, 296, pf);
+ reader_ = new RawReader (*di, width, height, pf);
}
break;
case cam:
@@ -68,6 +70,7 @@ Live::init (const char *filename)
tex[0] = loadImage(img->width_, img->height_, data[0], tex[0]);
// Initialisation de la segmentation
segm = new SegmLearn;
+ segm->setMode (pf);
segm->buildNN (oconfig->nnNbColor, Segm::loadFromFile);
mag = new Magnifier (img, segm);
segmAndGroup ();
@@ -85,20 +88,22 @@ Live::init (const char *filename)
/// Mis à jour de l'image
void
-Live::updateImg (const char *filename)
+Live::updateImg (const char *filename, const Image::PixelFormat pf,
+ const unsigned width, const unsigned height)
{
- Image::PixelFormat pf = Image::rgb;
+ segm->setMode (pf);
switch (imgInput_)
{
case file:
{
+ std::cout << "<Live::updateImg> Changement d'image : " << filename << std::endl;
// Copie du nom de l'image courante
strcpy (fname, filename);
std::string f (filename);
DataInputFile *dif = new DataInputFile (f);
DataInput *di = reinterpret_cast<DataInput*> (dif);
delete reader_;
- reader_ = new RawReader (*di, 360, 296, pf);
+ reader_ = new RawReader (*di, width, height, pf);
}
break;
case cam:
@@ -108,7 +113,7 @@ Live::updateImg (const char *filename)
img->load (*reader_);
memcpy(data[0], img->tabData_, sizeof(char) * img->nbPixels_ * 3);
tex[0] = loadImage(img->width_, img->height_, data[0], tex[0]);
- segmAndGroup ();
+ segmAndGroup (colorToFind_);
rootPics ();
}
@@ -145,6 +150,7 @@ Live::reloadConfig (const char *filename)
void
Live::segmAndGroup (const int numColorToShow)
{
+ std::cout << numColorToShow << std::endl;
// Création des groupes
delete group;
group = new Group(img, segm);
@@ -177,4 +183,3 @@ Live::segmAndGroup (const int numColorToShow)
tex[2] = loadImage(img->width_, img->height_, data[2], tex[2]);
tex[5] = loadImage(img->width_, img->height_, data[5], tex[5]);
}
-
diff --git a/2005/i/robert/src/ovision/ui/live.hh b/2005/i/robert/src/ovision/ui/live.hh
index 9b8936b..1f9ad7c 100644
--- a/2005/i/robert/src/ovision/ui/live.hh
+++ b/2005/i/robert/src/ovision/ui/live.hh
@@ -38,6 +38,7 @@ class Live
{
unsigned nbImg_;
ImageReader *reader_;
+ int colorToFind_;
public:
enum ImageInput {file, cam, socket};
/// Constructeur
@@ -63,7 +64,8 @@ class Live
char fname[100];
/// Initialisation
- void init (const char *filename);
+ void init (const char *filename, const Image::PixelFormat pf = Image::rgb,
+ const unsigned width=360, const unsigned height=296);
/// Recharge le fichier de config
void reloadConfig (const char *filename);
/// Segmentation et groupement des couleurs
@@ -71,7 +73,10 @@ class Live
/// Fixe une image ségmentée et une image de groupe dans la partie centrale
void rootPics ();
/// Mis à jour de l'image
- void updateImg (const char *filename);
+ void updateImg (const char *filename, const Image::PixelFormat pf = Image::rgb,
+ const unsigned width=360, const unsigned height=296);
+ /// Accessors
+ void setColorToFind (const int color) {colorToFind_ = color;}
private:
ImageInput imgInput_;
diff --git a/2005/i/robert/src/ovision/ui/liveView.cc b/2005/i/robert/src/ovision/ui/liveView.cc
index f85916c..6aef4e1 100644
--- a/2005/i/robert/src/ovision/ui/liveView.cc
+++ b/2005/i/robert/src/ovision/ui/liveView.cc
@@ -26,6 +26,8 @@ std::vector<std::string> *fileList;
Live::ImageInput ii;
unsigned iFileList;
unsigned nnNbColor;
+Image::PixelFormat pf;
+int colorToFind;
/// Chargement d'une texture a partir de donnees RGB
unsigned int
@@ -144,7 +146,36 @@ keyPressed(unsigned char key, int x, int y)
if (iFileList < (fileList->size ()-1))
{
++iFileList;
+ live->updateImg ((*fileList)[iFileList].c_str (), pf);
+ }
+ }
+ else if (key == 8)
+ {
+ if (iFileList > 0)
+ {
+ --iFileList;
+ live->updateImg ((*fileList)[iFileList].c_str (), pf);
+ }
+ }
+ else if (key == 'b')
+ {
+ if (colorToFind > -1)
+ {
+ --colorToFind;
+ live->setColorToFind (colorToFind);
+ live->updateImg ((*fileList)[iFileList].c_str ());
+ live->updateImg ((*fileList)[iFileList].c_str ());
+ std::cout << "Couleur sélectionnée " << colorToFind << std::endl;
+ }
+ }
+ else if (key == 'n')
+ {
+ if (live->oconfig->nnNbColor > colorToFind)
+ {
+ ++colorToFind;
+ live->setColorToFind (colorToFind);
live->updateImg ((*fileList)[iFileList].c_str ());
+ std::cout << "Couleur sélectionnée " << colorToFind << std::endl;
}
}
else if (key == 'r')
@@ -152,9 +183,10 @@ keyPressed(unsigned char key, int x, int y)
else if (key == 'm')
std::cout << "Nombre de couleurs du prochain réseau de neurones : " << ++nnNbColor << std::endl;
else if (key == 'l')
- std::cout << "Nombre de couleurs du prochain réseau de neurones : " << ++nnNbColor << std::endl;
+ std::cout << "Nombre de couleurs du prochain réseau de neurones : " << --nnNbColor << std::endl;
else if (key == 13)
{
+ live->segm->setMode (pf);
live->segm->buildNN (nnNbColor, Segm::generate);
live->segm->trainNN (live->img);
live->updateImg ((*fileList)[iFileList].c_str ());
@@ -168,25 +200,33 @@ mouseFunc(int button, int state, int x, int y)
{
}
+/// Usage
+void
+usage ()
+{
+ std::cerr << "Usage : ./liveView {file, cam, socket} format_image [liste d'images]" << std::endl;
+ exit (1);
+}
+
+
/// Analyse la ligne de commande
void
parseCommandLine (int argc, char **argv, Live::ImageInput &ii, std::vector<std::string> &list)
{
- if (argc < 2)
- {
- std::cerr << "Usage : ./liveView {file, cam, socket} [liste d'images]" << std::endl;
- exit (1);
- }
+ if (argc < 3)
+ usage ();
std::string str (argv[1]);
if (str == "file") ii = Live::file;
else if (str == "cam") ii = Live::cam;
else if (str == "socket") ii = Live::socket;
- if ((argc < 3) && (ii == Live::file))
- {
- std::cerr << "Usage : ./liveView {file, cam, socket} [liste d'images]" << std::endl;
- exit (1);
- }
- while (--argc > 0)
+ else usage ();
+ if ((argc < 4) && (ii == Live::file))
+ usage ();
+ std::string str2 (argv[2]);
+ if (str2 == "rgb") pf = Image::rgb;
+ else if (str2 == "yuv") pf = Image::yuv;
+ else usage ();
+ while (--argc > 2)
{
std::string *str = new std::string (argv[argc]);
list.push_back (*str);
@@ -214,9 +254,10 @@ main(int argc, char **argv)
iFileList = 0;
nnNbColor = 6;
+ colorToFind = -1;
live = new Live (nbImg, ii);
- live->init ((*fileList)[0].c_str ());
+ live->init ((*fileList)[0].c_str (), pf);
// Boucle principale
glutMainLoop();
diff --git a/2005/i/robert/src/ovision/ui/ui.cc b/2005/i/robert/src/ovision/ui/ui.cc
index 525fca2..7183c4c 100644
--- a/2005/i/robert/src/ovision/ui/ui.cc
+++ b/2005/i/robert/src/ovision/ui/ui.cc
@@ -17,7 +17,7 @@
#include "mainui.hh"
/// Nombre d'items du menu
-#define NBITEMS 12
+#define NBITEMS 13
@@ -27,6 +27,7 @@ char *itemsName[NBITEMS][2] = {{"Move color", "Permet d'ajuster les niveaux d'un
{"Merge colors", "Groupe plusieurs couleurs ensembles"},
{"Object to display", "Selectionne l'object à afficher"},
{"Change object color", "Selectionne l'index de la couleur d'un objet"},
+ {"Change color format", "Selectionne l'index le mode de couleur"},
{"Show objets found", "Affiche les balles et poteaux trouvés"},
{"Training", "Entraine le reseau de neurones"},
{"New network", "Regenere de nouveaux poids pour le reseau"},
@@ -142,7 +143,6 @@ void
UI::updateNodes ()
{
char buf[10];
-
// On parcours toutes les couleurs
for (int i=0; i < oconfig->nnNbColor*3; i++)
{
@@ -244,7 +244,7 @@ UI::chooseColor (const int type, const int current)
// Nombre d'item a afficher
if (type == NB_COULEUR)
- oconfig->nnNbColor = 10;
+ oconfig->nnNbColor = 15;
// Creation des items
ITEM **colorItem = new ITEM*[oconfig->nnNbColor+2];
@@ -264,7 +264,7 @@ UI::chooseColor (const int type, const int current)
colorItem[oconfig->nnNbColor+1] = NULL;
// Creation de la fenetre
- WINDOW *colorWindow = newwin(11, 15, 9, 35);
+ WINDOW *colorWindow = newwin(16, 15, 3, 35);
keypad(colorWindow, TRUE);
// Creation du menu
@@ -340,7 +340,7 @@ UI::chooseColor (const int type, const int current)
free_item(colorItem[i]);
free_menu(colormenu);
delwin(colorWindow);
- colorWindow = newwin(11, 15, 9, 35);
+ colorWindow = newwin(16, 15, 3, 35);
wrefresh(colorWindow);
delwin(colorWindow);
delete [] colorName;
@@ -434,6 +434,92 @@ UI::chooseObject (const int current)
return obj;
}
+/// menu de selection de format de couleur
+int
+UI::chooseColorFormat (const int current)
+{
+ const int nbObjects = 2;
+
+ // Creation des items
+ const char *objectName[15] = {"rgb", "yuv", "annuler"};
+ ITEM **objectItem = new ITEM*[nbObjects+2];
+ for (int i = 0; i < nbObjects+1; ++i)
+ objectItem[i] = new_item(objectName[i], NULL);
+ objectItem[nbObjects+1] = NULL;
+
+ // Creation de la fenetre
+ WINDOW *objectWindow = newwin(7, 18, 12, 45);
+ keypad(objectWindow, TRUE);
+
+ // Creation du menu
+ MENU *objectmenu = new_menu(objectItem);
+ set_menu_win(objectmenu, objectWindow);
+ set_menu_mark(objectmenu, " -> ");
+ post_menu(objectmenu);
+ wrefresh(objectWindow);
+
+ // Affichage d'info
+ printStatus("Utiliser ENTREE pour selectionner le format de couleur\n");
+
+ int car;
+ int obj=0;
+
+ set_current_item(objectmenu, objectItem[current]);
+ obj = current;
+
+ wrefresh(objectWindow);
+
+ while((car = wgetch(objectWindow)) != 10)
+ {
+ switch (car)
+ {
+ case KEY_DOWN: // Touche BAS
+ // Deplacement dans le menu
+ if (obj < nbObjects)
+ {
+ menu_driver(objectmenu, REQ_DOWN_ITEM);
+ obj++;
+ }
+ break;
+
+ case KEY_UP: // Touche HAUT
+ // Deplacement dans le menu
+ if (obj > 0)
+ {
+ menu_driver(objectmenu, REQ_UP_ITEM);
+ obj--;
+ }
+ break;
+ }
+
+// if ( (type == NUM_COULEUR) && (obj < oconfig->nnNbColor))
+// {
+// // Cree une image de la couleur selectionnee
+// sprintf(buf, "s %i\n", obj);
+// sendSignal(buf);
+// }
+
+ wrefresh(objectWindow);
+ }
+
+ // Cas d'annulation
+ if (obj == nbObjects)
+ obj = -1;
+
+ // Liberation memoire
+ for(int i=0; i<nbObjects; i++)
+ free_item(objectItem[i]);
+ free_menu(objectmenu);
+ delwin(objectWindow);
+ objectWindow = newwin(7, 18, 10, 45);
+ wrefresh(objectWindow);
+ delwin(objectWindow);
+
+ // Retourne la valeur choisie par l'utilisateur
+ return obj;
+}
+
+
/// menu de melange de couleurs
@@ -947,11 +1033,11 @@ UI::menu ()
{
int obj;
obj = chooseObject(0);
- if (obj >= 0)
- {
- sprintf(buf, "a %i\n", obj);
- sendSignal(buf);
- }
+ if (obj >= 0)
+ {
+ sprintf(buf, "a %i\n", obj);
+ sendSignal(buf);
+ }
}
break;
@@ -965,20 +1051,41 @@ UI::menu ()
if (col >= 0)
{
std::string name = Group::translateToColorName (obj);
+ for (std::vector<ObjectColor>::iterator iter = oconfig->groupColor.begin ();
+ iter != oconfig->groupColor.end (); ++iter)
+ {
+ if (name == iter->label)
+ {
+ iter->color = col;
+ break;
+ }
+ }
sprintf(buf, "b %s %i\n", name.c_str (), col);
sendSignal(buf);
}
}
}
break;
-
-
- case 5: // Affiche les objets trouvés
+
+ case 5: // Selectionne le mode de couleur
+ {
+ int fc;
+ fc = chooseColorFormat(0);
+ if (fc >= 0)
+ {
+ sprintf(buf, "b %i\n", fc);
+ sendSignal(buf);
+ }
+ }
+ break;
+
+
+ case 6: // Affiche les objets trouvés
showObjectsFound ();
wrefresh (mainWindow);
break;
- case 6: // Entraine le NN
+ case 7: // Entraine le NN
sprintf(buf, "t\n");
sendSignal(buf);
@@ -988,13 +1095,13 @@ UI::menu ()
printStatus ("Réseau de neurones entrainé\n");
break;
- case 7: // Regeneration de poids
+ case 8: // Regeneration de poids
int nbColor;
nbColor = chooseColor (NB_COULEUR, oconfig->nnNbColor);
newNN (nbColor);
break;
- case 8:// Annuler les changements
+ case 9:// Annuler les changements
// Reload du fichier de poids initial
oconfig->loadNNFile();
@@ -1006,7 +1113,7 @@ UI::menu ()
printStatus("Les changements ont été annulés\n");
break;
- case 9: // Sauver les changements
+ case 10: // Sauver les changements
// Sauvegarde des poids dans le fichier poids
oconfig->createNNFile("rc/poids", oconfig->nnNbColor);
diff --git a/2005/i/robert/src/ovision/ui/ui.hh b/2005/i/robert/src/ovision/ui/ui.hh
index 049ac6d..2e687ee 100644
--- a/2005/i/robert/src/ovision/ui/ui.hh
+++ b/2005/i/robert/src/ovision/ui/ui.hh
@@ -93,6 +93,9 @@ class UI {
/// menu de selection d'objet
int chooseObject (const int current);
+ /// menu de selection de format de couleur
+ int chooseColorFormat (const int current);
+
/// Menu de selection du group a former
void goSelectGroup (const int type);