summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/skittle.cc
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/ovision/see/skittle.cc')
-rw-r--r--2005/i/robert/src/ovision/see/skittle.cc58
1 files changed, 30 insertions, 28 deletions
diff --git a/2005/i/robert/src/ovision/see/skittle.cc b/2005/i/robert/src/ovision/see/skittle.cc
index a509b19..602f77a 100644
--- a/2005/i/robert/src/ovision/see/skittle.cc
+++ b/2005/i/robert/src/ovision/see/skittle.cc
@@ -26,24 +26,26 @@ void
Skittle::pca (Zone &zone)
{
// Agrandissement de la zone de recherche
- const int grow = 0;//oconfig_->skittleGrow;
- int ymin = img_->minWithBorder (zone.ymin - grow, 0);
- int ymax = img_->maxWithBorder (zone.ymax + grow, img_->height_);
- int xmin = img_->minWithBorder (zone.xmin - grow, 0);
- int xmax = img_->maxWithBorder (zone.xmax + grow, img_->width_);
+ /*const int grow = 0;//oconfig_->skittleGrow;
+ ymin = img_->minWithBorder (zone.ymin - grow, 0);
+ ymax = img_->maxWithBorder (zone.ymax + grow, img_->height_);
+ xmin = img_->minWithBorder (zone.xmin - grow, 0);
+ xmax = img_->maxWithBorder (zone.xmax + grow, img_->width_);*/
+ int ymin, ymax, xmin, xmax;
+ ymin = zone.ymin; ymax = zone.ymax;
+ xmin = zone.xmin; xmax = zone.xmax;
/// Initialisation du saut de point
- int jump = oconfig_->jumpPointDist/oconfig_->skittleDivJump;
- if (!jump) jump = 1;
+ //int jump = oconfig_->jumpPointDist/oconfig_->skittleDivJump;
+ //if (!jump) jump = 1;
+ int jump = 5;
// Parcours d'une partie des pixels de l'image
// Sauvegarde des points et de la densité
- int tmpY;
int nbPoints = 0;
std::vector<Hpoint> l;
for (int y = ymin; y < ymax; y += jump)
{
- tmpY = y*img_->width_;
for (int x = xmin; x < xmax; x += jump)
- if (segm_->giveColor (img_->tabData_ + ((tmpY + x) * 3), true, true) == zone.color)
+ if (segm_->giveColor (img_->tabData_ + ((img_->tabY_[y] + x) * 3), true, true) == zone.color)
{
// *f2 << x << " " << y << std::endl;
Hpoint h (x, y);
@@ -168,27 +170,27 @@ Skittle::analyse (Zone &zone, const std::vector<Zone> &listReflectBand)
if ((pcY_ > 0.95) || (pcY_ < -0.95))
zone.vertical = true;
else zone.vertical = false;
- if ((zone.centery > 140) && (pcX_ > 0.98) && (zone.density > 0.7)
- && (zone.density < 0.85) && (zone.ratio > 0.6) && (zone.ratio < 0.8))
- return false;
- if (zone.vertical)
- {
- // debout ou couché ?
+// if ((zone.centery > 140) && (pcX_ > 0.98) && (zone.density > 0.7)
+// && (zone.density < 0.85) && (zone.ratio > 0.6) && (zone.ratio < 0.8))
+// return false;
+// if (zone.vertical)
+// {
+// // debout ou couché ?
//bend_ = bend (zone);
- whereIsReflectBand (zone, listReflectBand);
- }
- else
- {
- bend_ = down;
+// whereIsReflectBand (zone, listReflectBand);
+// }
+// else
+// {
+// bend_ = down;
// calcul de l'orientation
- pca (zone);
- }
+// pca (zone);
+// }
- bend (zone);
- feet_ = whereIsBottom (zone);
- if (checkArea (zone) == 1)
- zone.alone = true;
- else zone.alone = false;
+// bend (zone);
+// feet_ = whereIsBottom (zone);
+// if (checkArea (zone) == 1)
+// zone.alone = true;
+// else zone.alone = false;
// f->close ();