X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=folded-ctf.git;a=blobdiff_plain;f=pi_referential.cc;h=87d41969e559562ede4f9a384bed0648ca687926;hp=6e7eb3e4c43d1135f69548a0305eb8e5d00cbf91;hb=6e1801915cc847204e8ae8a4ff04463b2e85f538;hpb=d922ad61d35e9a6996730bec24b16f8bf7bc426c diff --git a/pi_referential.cc b/pi_referential.cc index 6e7eb3e..87d4196 100644 --- a/pi_referential.cc +++ b/pi_referential.cc @@ -52,11 +52,6 @@ void PiReferential::draw_frame(RGBImage *image, 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(); @@ -120,11 +115,6 @@ void PiReferential::draw_window(RGBImage *image, 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(); @@ -225,12 +215,6 @@ void PiReferential::draw_edge_and_scale(RGBImage *image, 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(); @@ -338,9 +322,8 @@ PiReferential::PiReferential(PoseCell *cell) { // Body location - _body_xc = cell->_body_xc.middle() * discrete_scale_ratio; - _body_yc = cell->_body_yc.middle() * discrete_scale_ratio; - _body_window_scaling = sqrt(_body_radius_1 * _body_radius_2); + _body_xc = cell->_belly_xc.middle() * discrete_scale_ratio; + _body_yc = cell->_belly_yc.middle() * discrete_scale_ratio; if((_head_xc - _body_xc) * cos(_body_tilt) + (_head_yc - _body_yc) * sin(_body_tilt) > 0) { _body_tilt += M_PI; @@ -417,16 +400,6 @@ PiReferential::PiReferential(PoseCell *cell) { _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() { @@ -489,16 +462,6 @@ void PiReferential::register_rectangle(int registration_mode, } 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(); @@ -527,7 +490,6 @@ int PiReferential::register_edge(int registration_mode, int edge_type) { 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; } @@ -540,13 +502,6 @@ int PiReferential::register_edge(int registration_mode, int edge_type) { 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(); @@ -564,22 +519,6 @@ int PiReferential::register_edge(int registration_mode, int edge_type) { 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 @@ -643,12 +582,6 @@ void PiReferential::print_registration_mode(ostream *out, int registration_mode) 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(); }