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);
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);
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) {
_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;
}
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