From: Francois Fleuret Date: Thu, 9 Oct 2008 13:57:15 +0000 (+0200) Subject: automatic commit X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=789f96ef05fda4588aa536adb614c0e841be0812;p=folded-ctf.git automatic commit --- diff --git a/pi_referential.cc b/pi_referential.cc index 87d4196..6f56099 100644 --- a/pi_referential.cc +++ b/pi_referential.cc @@ -132,37 +132,12 @@ void PiReferential::draw_window(RGBImage *image, image->draw_line(6, r, g, b, xmax, ymax, xmin, ymax); image->draw_line(6, r, g, b, xmin, ymax, xmin, ymin); -// if(filled) { -// int delta = 6; -// for(int d = ymin - ymax; d <= xmax - xmin; d += delta) { -// int x1 = xmin + d; -// int y1 = ymin; -// int x2 = xmin + d + ymax - ymin; -// int y2 = ymax; -// if(x1 < xmin) { y1 = y1 + (xmin - x1); x1 = xmin; } -// if(x2 > xmax) { y2 = y2 - (x2 - xmax); x2 = xmax; } -// image->draw_line(3, r, g, b, x1, y1, x2, y2); -// } -// } - r = 0; g = 0; b = 0; image->draw_line(2, r, g, b, xmin, ymin, xmax, ymin); image->draw_line(2, r, g, b, xmax, ymin, xmax, ymax); image->draw_line(2, r, g, b, xmax, ymax, xmin, ymax); image->draw_line(2, r, g, b, xmin, ymax, xmin, ymin); -// if(filled) { -// int delta = 6; -// for(int d = ymin - ymax; d <= xmax - xmin; d += delta) { -// int x1 = xmin + d; -// int y1 = ymin; -// int x2 = xmin + d + ymax - ymin; -// int y2 = ymax; -// if(x1 < xmin) { y1 = y1 + (xmin - x1); x1 = xmin; } -// if(x2 > xmax) { y2 = y2 - (x2 - xmax); x2 = xmax; } -// image->draw_line(1, r, g, b, x1, y1, x2, y2); -// } -// } } else { image->draw_line(2, r, g, b, xmin, ymin, xmax, ymin); image->draw_line(2, r, g, b, xmax, ymin, xmax, ymax); @@ -269,9 +244,6 @@ void PiReferential::draw_edge_and_scale(RGBImage *image, scalar_t l = sqrt(dx * dx + dy * dy); -// dx = dx / l; -// dy = dy / l; - if(edges) { int delta = 3; image->draw_ellipse(1, r, g, b, xc, yc, radius + delta, radius + delta, 0); @@ -284,23 +256,11 @@ void PiReferential::draw_edge_and_scale(RGBImage *image, int(xc + u * dx + s * dy), int(yc + u * dy - s * dx)); } -// for(int y = yc - radius; y <= yc + radius; y++) { -// for(int x = xc - radius; x <= xc + radius; x++) { -// if(x >= 0 && x < image->width() && y >= 0 && y < image->height() && -// (x - xc) * dx + (y - yc) * dy >= 0) { -// image->draw_point(r, g, b, x, y); -// } -// } -// } - } else if(_tag == RichImage::variance_tag) { image->draw_ellipse(1, r, g, b, xc, yc, 8, 8, 0); } - - // else if(_tag >= RichImage::first_gray_tag && _tag < RichImage::first_gray_tag + RichImage::nb_gray_tags) { - // } } PiReferential::PiReferential(PoseCell *cell) { @@ -325,6 +285,8 @@ PiReferential::PiReferential(PoseCell *cell) { _body_xc = cell->_belly_xc.middle() * discrete_scale_ratio; _body_yc = cell->_belly_yc.middle() * discrete_scale_ratio; + _body_tilt = 0; + if((_head_xc - _body_xc) * cos(_body_tilt) + (_head_yc - _body_yc) * sin(_body_tilt) > 0) { _body_tilt += M_PI; } @@ -333,14 +295,14 @@ PiReferential::PiReferential(PoseCell *cell) { const scalar_t belly_frame_factor = 2.0; - _belly_xc = _body_xc; - _belly_yc = _body_yc; + _belly_xc = cell->_belly_xc.middle() * discrete_scale_ratio; + _belly_yc = cell->_belly_yc.middle() * discrete_scale_ratio; _belly_window_scaling = _head_window_scaling * belly_frame_factor; // Head-belly location - _head_belly_xc = (_head_xc + _body_xc) * 0.5; - _head_belly_yc = (_head_yc + _body_yc) * 0.5; + _head_belly_xc = (_head_xc + _belly_xc) * 0.5; + _head_belly_yc = (_head_yc + _belly_yc) * 0.5; ////////////////////////////////////////////////////////////////////// // Frames