summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/ovision.cc
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/ovision/see/ovision.cc')
-rw-r--r--2005/i/robert/src/ovision/see/ovision.cc31
1 files changed, 6 insertions, 25 deletions
diff --git a/2005/i/robert/src/ovision/see/ovision.cc b/2005/i/robert/src/ovision/see/ovision.cc
index 9a74c21..d6a8b0b 100644
--- a/2005/i/robert/src/ovision/see/ovision.cc
+++ b/2005/i/robert/src/ovision/see/ovision.cc
@@ -17,9 +17,7 @@ OVision::~OVision ()
delete segm_;
delete group_;
delete mag_;
-// delete map_;
-// delete space_;
-// delete socket_;
+ delete space_;
}
/// Iniialisatoin de toutes les classes
@@ -31,29 +29,24 @@ OVision::init (const Group::ZoneType aim)
oconfig_ = new OConfig;
img_ = new Img;
// Initialisation caméra
- v4l_ = new Video4Linux ("/dev/video", oconfig_->inputColor);
+ v4l_ = new Video4Linux ("/dev/video", oconfig_->inputColor, oconfig_->brightness);
v4l_->calibrate ();
+ v4l_->setAdaptive (0);
// Prendre une image pour que la taille de l'image soit configuré
img_->load (*v4l_);
colorTab_ = new ColorTable;
segm_ = new SegmTable (*colorTab_);
+ segm_->setMode (oconfig_->inputColor);
group_ = new Group (img_, segm_);
mag_ = new Magnifier (img_, segm_, aim_);
// Mode de couleur utilisé pour les la segmentation
segm_->setMode (oconfig_->inputColor);
space_ = new Space (img_->width_, img_->height_);
-// map_ = new Map (space);
// Calibration des longueurs
space_->addSetupPoint (314, 6, 100, 400);
space_->addSetupPoint (237, 224, 100, 900);
space_->addSetupPoint (275, 113, 100, 550);
space_->setup (0.00891157, 0.258144, 403.801);
- // Ouverture ou création de la table de couleur
- /// Initialisation des socket_s
- // socket_ = new SocketClient ("10.42.51.2" , 106560*3);
- // socket_->Init ();
-
- // std::cout << "Chargement OVision ................ OK" << std::endl;
}
/// Prends une image avec la caméra
@@ -82,18 +75,6 @@ OVision::update ()
space->GetLoc (x, y, x, y);
}
*/
- // Mets à jour la map_
- /* map_->AddBallsToMap (group_);
- double balX, balY;
- if (map_->GetCurBallPos (balX, balY))
- std::cout << "Balle Courante: " << balX << " " << balY << std::endl;
- if (map_->IsTree ())
- {
- double treeX, treeY;
- map_->GetTreePos (treeX, treeY);
- std::cout << "Tree: " << treeX << " " << treeY << std::endl;
- }
- */
}
/// Affiche d'info sur l'update
@@ -103,8 +84,8 @@ OVision::showInfo () const
std::cout << "-----------------------------------------------------------------" << std::endl;
std::cout << "image n°" << step_ << std::endl;
// Info sur les zones trouvées
- group_->showZones();
- mag_->showItems (Group::redSkittle);
+// group_->showZones();
+// mag_->showItems (Group::redSkittle);
std::cout << "-------------\n" << std::endl;
std::cout << "-------------\n" << std::endl;
}