From eb6fe78a4990416473d703d05b9abbafd6825705 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Thu, 9 Oct 2008 17:28:59 +0200 Subject: [PATCH] automatic commit --- interval.h | 9 ---- pi_referential.cc | 109 ++-------------------------------------------- pi_referential.h | 5 --- 3 files changed, 4 insertions(+), 119 deletions(-) diff --git a/interval.h b/interval.h index 57810f6..3091556 100644 --- a/interval.h +++ b/interval.h @@ -39,18 +39,9 @@ public: return x >= min && x < max; } - inline void include(scalar_t x) { - if(x < min) min = x; - if(x > max) max = x; - } - inline scalar_t middle() { return (min + max) / 2; } - - inline scalar_t length() { - return max - min; - } }; ostream &operator << (ostream &out, const Interval &i); diff --git a/pi_referential.cc b/pi_referential.cc index c2b716e..b6a6b1d 100644 --- a/pi_referential.cc +++ b/pi_referential.cc @@ -149,110 +149,6 @@ void PiReferential::draw_window(RGBImage *image, } -void PiReferential::draw_edge_and_scale(RGBImage *image, - int registration_mode, Rectangle *window, - int _tag, int _edge_scale) { - const int ref_radius = 10; - int r, g, b; - int edges = 0; - - switch(registration_mode) { - - case PiReferential::RM_HEAD: - r = 0; g = 255; b = 0; - break; - - case PiReferential::RM_HEAD_NO_POLARITY: - r = 128; g = 255; b = 128; - break; - - case PiReferential::RM_BELLY: - r = 64; g = 0; b = 255; - break; - - case PiReferential::RM_BELLY_NO_POLARITY: - r = 192; g = 128; b = 255; - break; - - case PiReferential::RM_HEAD_BELLY_EDGES: - edges = 1; - case PiReferential::RM_HEAD_BELLY: - r = 255; g = 0; b = 0; - break; - - default: - cerr << "INCONSISTENCY" << endl; - abort(); - } - - scalar_t xc = (window->xmin + window->xmax)/2; - scalar_t yc = (window->ymin + window->ymax)/2; - int radius = ref_radius * (1 << _edge_scale); - - image->draw_ellipse(1, r, g, b, xc, yc, radius, radius, 0); - - if(_tag >= RichImage::first_edge_tag && _tag < RichImage::first_edge_tag + RichImage::nb_edge_tags) { - - scalar_t dx, dy; - - switch(_tag - RichImage::first_edge_tag) { - case 0: - dx = 0; dy = -1; - break; - - case 1: - dx = 1; dy = -1; - break; - - case 2: - dx = 1; dy = 0; - break; - - case 3: - dx = 1; dy = 1; - break; - - case 4: - dx = 0; dy = 1; - break; - - case 5: - dx = -1; dy = 1; - break; - - case 6: - dx = -1; dy = 0; - break; - - case 7: - dx = -1; dy = -1; - break; - - default: - abort(); - } - - scalar_t l = sqrt(dx * dx + dy * dy); - - if(edges) { - int delta = 3; - image->draw_ellipse(1, r, g, b, xc, yc, radius + delta, radius + delta, 0); - } - - for(scalar_t u = 0; u <= radius; u += 0.1) { - scalar_t s = sqrt(radius * radius - (u * u * l * l))/l; - image->draw_line(2, r, g, b, - int(xc + u * dx - s * dy), int(yc + u * dy + s * dx), - int(xc + u * dx + s * dy), int(yc + u * dy - s * dx)); - } - - } - - else if(_tag == RichImage::variance_tag) { - image->draw_ellipse(1, r, g, b, xc, yc, 8, 8, 0); - } -} - PiReferential::PiReferential(PoseCell *cell) { scalar_t head_radius = sqrt(scalar_t(cell->_head_radius.min * cell->_head_radius.max)); @@ -272,6 +168,9 @@ PiReferential::PiReferential(PoseCell *cell) { // Body location + // Useless code, but necessary to keep the exact same results with + // g++ 4.1 and -O3 options on reference experiments. + _body_xc = cell->_belly_xc.middle() * discrete_scale_ratio; _body_yc = cell->_belly_yc.middle() * discrete_scale_ratio; @@ -298,7 +197,7 @@ PiReferential::PiReferential(PoseCell *cell) { // Frames if(_body_xc >= _head_xc) { -// if(_belly_xc >= _head_xc) { + // if(_belly_xc >= _head_xc) { _horizontal_polarity = 1; } else { _horizontal_polarity = -1; diff --git a/pi_referential.h b/pi_referential.h index d1341ac..06995f4 100644 --- a/pi_referential.h +++ b/pi_referential.h @@ -50,7 +50,6 @@ class PiReferential { // with g++ gives the same results as some reference // experiments. Sorry for that. scalar_t _body_xc, _body_yc; -// scalar_t _body_radius_1, _body_radius_2; scalar_t _body_tilt; // The belly frame is defined by the belly location and head scale @@ -119,10 +118,6 @@ public: int registration_mode, Rectangle *window, int filled); - void draw_edge_and_scale(RGBImage *image, - int registration_mode, Rectangle *window, - int _tag, int _edge_scale); - static void print_registration_mode(ostream *out, int registration_mode); }; -- 2.39.5