X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=folded-ctf.git;a=blobdiff_plain;f=labelled_image.cc;h=d88e42829aeb9e6ae8fe4b3aab07da9c000e08b0;hp=d02313d0c31d7a607abc06fe19e6c3b38c92538f;hb=33852c7b378d419be75d15a9663ee6b071c2f534;hpb=789f96ef05fda4588aa536adb614c0e841be0812 diff --git a/labelled_image.cc b/labelled_image.cc index d02313d..d88e428 100644 --- a/labelled_image.cc +++ b/labelled_image.cc @@ -47,33 +47,6 @@ int LabelledImage::pose_cell_label(PoseCell *cell) { return 0; } -void LabelledImage::crop(int xmin, int ymin, int width, int height) { - RichImage::crop(xmin, ymin, width, height); - for(int t = 0; t < _nb_targets; t++) { - _target_poses[t].translate(- xmin, - ymin); - } -} - -void LabelledImage::reduce() { - int xmin = _width, xmax = 0, ymin = _height, ymax = 0; - if(_nb_targets > 0) { - for(int t = 0; t < _nb_targets; t++) { - xmin = min(xmin, int(_target_poses[t]._bounding_box_xmin)); - ymin = min(ymin, int(_target_poses[t]._bounding_box_ymin)); - xmax = max(xmax, int(_target_poses[t]._bounding_box_xmax)); - ymax = max(ymax, int(_target_poses[t]._bounding_box_ymax)); - } - } else { - xmin = 0; ymin = 0; - xmax = 640; ymax = 480; - } - xmin = max(0, xmin); - ymin = max(0, ymin); - xmax = min(_width, xmax); - ymax = min(_height, ymax); - crop(xmin, ymin, xmax - xmin, ymax - ymin); -} - void LabelledImage::write(ostream *out) { int v = file_format_version; write_var(out, &v);