summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/ovision/ovision.cc
diff options
context:
space:
mode:
authorgaillaro2004-08-08 11:29:43 +0000
committergaillaro2004-08-08 11:29:43 +0000
commitc2fc583752a443cb6adc8b918d1c3f442137885a (patch)
tree3a981d5e5b88c1adb68f484e0d38c424b321e1e8 /2004/i/nono/src/ovision/ovision.cc
parent71416a4de8daaf0d36bce016c5f34b3fc6576ea5 (diff)
Changement de la prise en charge des differents mode de couleur
Diffstat (limited to '2004/i/nono/src/ovision/ovision.cc')
-rw-r--r--2004/i/nono/src/ovision/ovision.cc54
1 files changed, 39 insertions, 15 deletions
diff --git a/2004/i/nono/src/ovision/ovision.cc b/2004/i/nono/src/ovision/ovision.cc
index a80d62f..63c55e7 100644
--- a/2004/i/nono/src/ovision/ovision.cc
+++ b/2004/i/nono/src/ovision/ovision.cc
@@ -4,13 +4,49 @@
/// Constructeur
OVision::OVision ()
{
+ oconfig = NULL;
+ img = NULL;
+ segm = NULL;
+ group = NULL;
+ map = NULL;
+}
+
+/// Destructeur
+OVision::~OVision ()
+{
+ delete oconfig;
+ delete img;
+ delete segm;
+ delete group;
+ delete map;
+}
+
+/// Iniialisatoin de toutes les classes
+void
+OVision::Init ()
+{
// Initialisation des classes
oconfig = new OConfig;
img = new Img;
// Initialisation caméra
Video4Linux::ColorSpace cs;
- cs = Video4Linux::rgb;
+
+ switch (oconfig->colorAcquisition)
+ {
+ case RGB:
+ cs = Video4Linux::rgb;
+ break;
+
+ case BGR:
+ cs = Video4Linux::bgr;
+ break;
+
+ case YUV:
+ cs = Video4Linux::yuv;
+ break;
+ }
+
v4l = new Video4Linux ("/dev/video", cs, 60000);
v4l->calibrate ();
@@ -27,9 +63,6 @@ OVision::OVision ()
segm->BuildNN (oconfig->nn_NbCouleurs, LOAD_FROM_FILE);
// Calibration des longueurs
-
-
-
space->AddSetupPoint (314, 6, 100, 400);
space->AddSetupPoint (237, 224, 100, 900);
space->AddSetupPoint (275, 113, 100, 550);
@@ -42,21 +75,12 @@ OVision::OVision ()
segm->CreateColorTableFile ();
}
-
-
step = 0;
-}
-/// Destructeur
-OVision::~OVision ()
-{
- delete oconfig;
- delete img;
- delete segm;
- delete group;
- delete map;
+ std::cout << "Chargement OVision ................ OK" << std:endl;
}
+
/// Prends une image avec la caméra
void
OVision::TakeShoot ()