X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=folded-ctf.git;a=blobdiff_plain;f=labelled_image.cc;h=4eed0e0597fe54c87d7f9b8abfebeb4f43b56ce6;hp=d02313d0c31d7a607abc06fe19e6c3b38c92538f;hb=HEAD;hpb=d922ad61d35e9a6996730bec24b16f8bf7bc426c diff --git a/labelled_image.cc b/labelled_image.cc index d02313d..4eed0e0 100644 --- a/labelled_image.cc +++ b/labelled_image.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 "labelled_image.h" @@ -47,33 +53,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);