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.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/2005/i/robert/src/ovision/see/skittle.cc b/2005/i/robert/src/ovision/see/skittle.cc
index f8437d5..a509b19 100644
--- a/2005/i/robert/src/ovision/see/skittle.cc
+++ b/2005/i/robert/src/ovision/see/skittle.cc
@@ -26,7 +26,7 @@ void
Skittle::pca (Zone &zone)
{
// Agrandissement de la zone de recherche
- const int grow = oconfig_->skittleGrow;
+ 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);
@@ -45,7 +45,7 @@ Skittle::pca (Zone &zone)
for (int x = xmin; x < xmax; x += jump)
if (segm_->giveColor (img_->tabData_ + ((tmpY + x) * 3), true, true) == zone.color)
{
-// *f2 << x << " " << y << std::endl;
+ // *f2 << x << " " << y << std::endl;
Hpoint h (x, y);
l.push_back (h);
if ((x >= zone.xmin) && (x <= zone.xmax) && (y >= zone.ymin) && (y <= zone.ymax))
@@ -163,24 +163,28 @@ Skittle::analyse (Zone &zone, const std::vector<Zone> &listReflectBand)
// group est partiel ?
// if (zone.partial)
// quille verticale sur l'image ?
+ pca (zone);
zone.ratio = (zone.ymax - zone.ymin)/(double)(zone.xmax - zone.xmin);
- if (zone.ratio > oconfig_->skittleVerticalRatio)
- {
+ 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é ?
//bend_ = bend (zone);
whereIsReflectBand (zone, listReflectBand);
}
else
{
- zone.vertical = false;
bend_ = down;
// calcul de l'orientation
pca (zone);
}
bend (zone);
- pca (zone);
feet_ = whereIsBottom (zone);
if (checkArea (zone) == 1)
zone.alone = true;