X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=folded-ctf.git;a=blobdiff_plain;f=list_to_pool.cc;h=5d7eaa007e722cefd82d1e1d81192d1c538a8a6b;hp=c1496e59912b877126c5b0c6884353d15e91a3d9;hb=HEAD;hpb=f7e3efe41ffb65d89e8f2ce814c23ff90ad24f34 diff --git a/list_to_pool.cc b/list_to_pool.cc index c1496e5..5d7eaa0 100644 --- a/list_to_pool.cc +++ b/list_to_pool.cc @@ -1,20 +1,26 @@ - -/////////////////////////////////////////////////////////////////////////// -// This program is free software: you can redistribute it and/or modify // -// it under the terms of the version 3 of the GNU General Public License // -// as published by the Free Software Foundation. // -// // -// This program is distributed in the hope that it will be useful, but // -// WITHOUT ANY WARRANTY; without even the implied warranty of // -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // -// General Public License for more details. // -// // -// You should have received a copy of the GNU General Public License // -// along with this program. If not, see . // -// // -// Written by Francois Fleuret, (C) IDIAP // -// Contact for comments & bug reports // -/////////////////////////////////////////////////////////////////////////// +/* + * folded-ctf is an implementation of the folded hierarchy of + * classifiers for object detection, developed by Francois Fleuret + * and Donald Geman. + * + * Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/ + * Written by Francois Fleuret + * + * This file is part of folded-ctf. + * + * folded-ctf is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 3 as + * published by the Free Software Foundation. + * + * folded-ctf is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with folded-ctf. If not, see . + * + */ #include @@ -61,7 +67,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 +154,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 +166,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 +180,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 +189,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 +237,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 +246,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; } } }