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)) {
open_current_cat = true;
head_defined = false;
bounding_box_defined = false;
- body_defined = false;
+ belly_defined = false;
nb_ears = 0;
}
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++;
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);
}
//////////////////////////////////////////////////////////////////////
- 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;
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);
pose->_belly_xc = x1;
pose->_belly_yc = y1;
- body_defined = true;
+ belly_defined = true;
}
}
}
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();
}
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();
}