r = 255; g = 0; b = 0;
break;
- case PiReferential::RM_BODY:
- case PiReferential::RM_BODY_EDGES:
- r = 0; g = 128; b = 255;
- break;
-
default:
cerr << "INCONSISTENCY" << endl;
abort();
r = 255; g = 0; b = 0;
break;
- case PiReferential::RM_BODY:
- case PiReferential::RM_BODY_EDGES:
- r = 0; g = 128; b = 255;
- break;
-
default:
cerr << "INCONSISTENCY" << endl;
abort();
r = 255; g = 0; b = 0;
break;
- case PiReferential::RM_BODY_EDGES:
- edges = 1;
- case PiReferential::RM_BODY:
- r = 0; g = 128; b = 255;
- break;
-
default:
cerr << "INCONSISTENCY" << endl;
abort();
_body_xc = cell->_belly_xc.middle() * discrete_scale_ratio;
_body_yc = cell->_belly_yc.middle() * discrete_scale_ratio;
- _body_window_scaling = sqrt(_body_radius_1 * _body_radius_2);
if((_head_xc - _body_xc) * cos(_body_tilt) + (_head_yc - _body_yc) * sin(_body_tilt) > 0) {
_body_tilt += M_PI;
_head_belly_vy = _head_belly_vy/l * _head_radius * 2;
_head_belly_edge_shift = int(floor(- RichImage::nb_edge_tags * atan2(_head_belly_ux, _head_belly_uy) / (2 * M_PI) + 0.5));
_head_belly_edge_shift = (RichImage::nb_edge_tags + _head_belly_edge_shift) % RichImage::nb_edge_tags;
-
- // Body frame
-
- _body_ux = cos(_body_tilt) * _body_radius_1 * 2.0;
- _body_uy = sin(_body_tilt) * _body_radius_1 * 2.0;
- _body_vx = - sin(_body_tilt) * _body_radius_2 * 2.0;
- _body_vy = cos(_body_tilt) * _body_radius_2 * 2.0;
-
- _body_edge_shift = int(floor(RichImage::nb_edge_tags * _body_tilt / (2 * M_PI) + 0.5));
- _body_edge_shift = (RichImage::nb_edge_tags + _body_edge_shift) % RichImage::nb_edge_tags;
}
int PiReferential::common_scale() {
}
break;
- case RM_BODY:
- case RM_BODY_EDGES:
- {
- xc = _body_xc + alpha * _body_ux + beta * _body_vx;
- yc = _body_yc + alpha * _body_uy + beta * _body_vy;
- w = (original->xmax - original->xmin) * _body_window_scaling;
- h = (original->ymax - original->ymin) * _body_window_scaling;
- }
- break;
-
default:
cerr << "Undefined registration mode." << endl;
abort();
case PiReferential::RM_HEAD:
case PiReferential::RM_BELLY:
case PiReferential::RM_HEAD_BELLY:
- case PiReferential::RM_BODY:
if(_horizontal_polarity < 0) {
e = (RichImage::nb_edge_tags - e) % RichImage::nb_edge_tags;
}
e += _head_belly_edge_shift;
break;
- case PiReferential::RM_BODY_EDGES:
- if(_horizontal_polarity < 0) {
- e = (RichImage::nb_edge_tags - e) % RichImage::nb_edge_tags;
- }
- e += _body_edge_shift;
- break;
-
default:
cerr << "INCONSISTENCY" << endl;
abort();
void PiReferential::draw(RGBImage *image, int level) {
int x1, y1, x2, y2, x3, y3, x4, y4;
- if(level >= 2) {
-
- // Draw the RM_BODY reference frame
-
- x1 = int(_body_xc + _body_ux + _body_vx);
- y1 = int(_body_yc + _body_uy + _body_vy);
- x2 = int(_body_xc - _body_ux + _body_vx);
- y2 = int(_body_yc - _body_uy + _body_vy);
- x3 = int(_body_xc - _body_ux - _body_vx);
- y3 = int(_body_yc - _body_uy - _body_vy);
- x4 = int(_body_xc + _body_ux - _body_vx);
- y4 = int(_body_yc + _body_uy - _body_vy);
-
- draw_frame(image, RM_BODY, x1, y1, x2, y2, x3, y3, x4, y4);
- }
-
if(level >= 1) {
// Draw the RM_BELLY reference frame
case RM_HEAD_BELLY_EDGES:
(*out) << "RM_HEAD_BELLY_EDGES";
break;
- case RM_BODY:
- (*out) << "RM_BODY";
- break;
- case RM_BODY_EDGES:
- (*out) << "RM_BODY_EDGES";
- break;
default:
abort();
}