From: Francois Fleuret Date: Thu, 9 Oct 2008 09:15:09 +0000 (+0200) Subject: automatic commit X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=folded-ctf.git;a=commitdiff_plain;h=8236ef5635eda3f1532acc126ce0569d6bb8869e automatic commit --- diff --git a/list_to_pool.cc b/list_to_pool.cc index c1496e5..9297cd7 100644 --- a/list_to_pool.cc +++ b/list_to_pool.cc @@ -61,7 +61,7 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { bool open_current_cat = false; bool head_defined = false; bool bounding_box_defined = false; - bool body_defined = false; + bool belly_defined = false; int nb_ears = 0; while(!list_stream.eof() && (global.nb_images < 0 || nb_scenes < global.nb_images)) { @@ -148,7 +148,7 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { open_current_cat = true; head_defined = false; bounding_box_defined = false; - body_defined = false; + belly_defined = false; nb_ears = 0; } @@ -160,7 +160,7 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { parse_error("Undefined bounding box ", list_name, line_number); } - if(head_defined && body_defined) { + if(head_defined && belly_defined) { if(current_image->get_target_pose(nb_cats)->_head_radius > global.min_head_radius && current_image->get_target_pose(nb_cats)->_head_radius < global.max_head_radius) { nb_cats++; @@ -174,7 +174,7 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { cerr.flush(); } } else { - parse_warning("Cat ignored since either the body, head or belly are undefined", + parse_warning("Cat ignored since either the head and/or the belly are undefined", list_name, line_number); } @@ -183,18 +183,18 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { ////////////////////////////////////////////////////////////////////// - else if(strcmp(token, "BODYBOX") == 0) { + else if(strcmp(token, "BOUNDINGBOX") == 0) { if(!open_current_cat) parse_error("Undefined cat ", list_name, line_number); if(bounding_box_defined) parse_error("Two bounding box", list_name, line_number); int xmin = -1, ymin = -1, xmax = -1, ymax = -1; if(s) { s = next_word(token, s, buffer_size); xmin = atoi(token); } - else parse_error("BODYBOX parameter xmin missing ", list_name, line_number); + else parse_error("BOUNDINGBOX parameter xmin missing ", list_name, line_number); if(s) { s = next_word(token, s, buffer_size); ymin = atoi(token); } - else parse_error("BODYBOX parameter ymin missing ", list_name, line_number); + else parse_error("BOUNDINGBOX parameter ymin missing ", list_name, line_number); if(s) { s = next_word(token, s, buffer_size); xmax = atoi(token); } - else parse_error("BODYBOX parameter xmax missing ", list_name, line_number); + else parse_error("BOUNDINGBOX parameter xmax missing ", list_name, line_number); if(s) { s = next_word(token, s, buffer_size); ymax = atoi(token); } - else parse_error("BODYBOX parameter ymax missing ", list_name, line_number); + else parse_error("BOUNDINGBOX parameter ymax missing ", list_name, line_number); current_image->get_target_pose(nb_cats)->_bounding_box_xmin = xmin; current_image->get_target_pose(nb_cats)->_bounding_box_ymin = ymin; current_image->get_target_pose(nb_cats)->_bounding_box_xmax = xmax; @@ -231,8 +231,8 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { if(s) { s = next_word(token, s, buffer_size); y1 = atoi(token); } else parse_error("BELLYLOCATION parameter y1 missing ", list_name, line_number); - if(body_defined) { - parse_error("More than one body location. ", list_name, line_number); + if(belly_defined) { + parse_error("More than one belly location. ", list_name, line_number); } else { Pose *pose = current_image->get_target_pose(nb_cats); @@ -240,7 +240,7 @@ void list_to_pool(char *main_path, char *list_name, char *pool_name) { pose->_belly_xc = x1; pose->_belly_yc = y1; - body_defined = true; + belly_defined = true; } } } diff --git a/pi_feature.cc b/pi_feature.cc index 300ccee..c3be53a 100644 --- a/pi_feature.cc +++ b/pi_feature.cc @@ -45,13 +45,7 @@ int PiFeature::random_registration_mode(int level) { break; case 4: - if(level >= 2) - return PiReferential::RM_BODY; - break; - case 5: - if(level >= 2) - return PiReferential::RM_BODY_EDGES; break; default: diff --git a/pi_referential.cc b/pi_referential.cc index 8c0e8ac..3fe7a27 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(); @@ -489,16 +473,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 +501,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 +513,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 +530,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 +593,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(); } diff --git a/pi_referential.h b/pi_referential.h index 1dcb007..f393b24 100644 --- a/pi_referential.h +++ b/pi_referential.h @@ -99,10 +99,6 @@ public: // Same as above with rotation of the edges RM_HEAD_BELLY_EDGES, - - // Not finished yet - RM_BODY, - RM_BODY_EDGES }; int common_scale();