Removed the definition of basename, which confuses an existing system one.
[folded-ctf.git] / labelled_image.cc
index d02313d..4eed0e0 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.  //
-//                                                                       //
-// Written by Francois Fleuret, (C) IDIAP                                //
-// Contact <francois.fleuret@idiap.ch> 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 <francois.fleuret@idiap.ch>
+ *
+ *  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 <http://www.gnu.org/licenses/>.
+ *
+ */
 
 #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);