Removed the definition of basename, which confuses an existing system one.
[folded-ctf.git] / pi_referential.h
index d0747f2..a3fc29e 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/>.
+ *
+ */
 
 /*
 
@@ -46,18 +52,21 @@ class PiReferential {
   scalar_t _head_ux, _head_uy, _head_vx, _head_vy;
   scalar_t _head_ux_nopolarity, _head_uy_nopolarity, _head_vx_nopolarity, _head_vy_nopolarity;
 
-  // The body frame in that _common_scale. The vectors are of length the radii of the ellipse
+  //**********************************************************************
+  // Useless fields, but they are necessary so that the optimized code
+  // with g++ gives the same results as some reference
+  // experiments. Sorry for that.
   scalar_t _body_xc, _body_yc;
-  scalar_t _body_radius_1, _body_radius_2, _body_tilt;
+  scalar_t _body_tilt;
+  //**********************************************************************
 
-  // The belly frame is defined by the body location and head scale
+  // The belly frame is defined by the belly location and head scale
   scalar_t _belly_xc, _belly_yc;
   scalar_t _belly_ux, _belly_uy, _belly_vx, _belly_vy;
   scalar_t _belly_ux_nopolarity, _belly_uy_nopolarity, _belly_vx_nopolarity, _belly_vy_nopolarity;
   scalar_t _belly_window_scaling;
 
-  // The head-belly frame is defined by the head location and the body
-  // center location
+  // The head-belly frame is defined by the head location and the belly
   scalar_t _head_belly_xc, _head_belly_yc;
   scalar_t _head_belly_ux, _head_belly_uy, _head_belly_vx, _head_belly_vy;
   int _head_belly_edge_shift;
@@ -73,36 +82,37 @@ public:
   PiReferential(PoseCell *cell);
 
   enum {
-    // A frame centered on the head, of size four times the head radius
-    // and, flipped verically if the body center is on the left of the
-    // head center
+    // A square frame centered on the head, of size four times the
+    // head radius and, flipped horizontally if the belly is on the
+    // left of the head center
     RM_HEAD,
 
     // Same as above, without the flipping
     RM_HEAD_NO_POLARITY,
-    // A frame centered on the body center, of size size times the
-    // head rardius, flipped vertically if the body center is on the
-    // left of the head center
+
+    // A frame centered on the belly, of size eight times the head
+    // radius, flipped horizontally if the belly is on the left of the
+    // head center
     RM_BELLY,
 
     // Same as above, without the flipping
     RM_BELLY_NO_POLARITY,
 
     // A frame centered on the middle point between the head center
-    // and the body center, of size twice the distance head center -
-    // body center in the head-body direction, and of four times the
-    // head radius in the other
+    // and the belly, of size twice the distance head center - belly
+    // in the head-belly direction, and of four times the head radius
+    // in the other
     RM_HEAD_BELLY,
 
     // Same as above with rotation of the edges
-    RM_HEAD_BELLY_EDGES,
+    RM_HEAD_BELLY_EDGES
   };
 
   int common_scale();
 
   // The rectangle coordinates are in the reference frames. For the
-  // head for instance , [-1,1] x [-1,1] corresponds to the head
-  // bounding box
+  // head for instance [-0.5, 0.5] x [-0.5, 0.5] corresponds to the
+  // head bounding box
 
   void register_rectangle(int registration_mode,
                           Rectangle *original,
@@ -116,10 +126,6 @@ public:
                    int registration_mode, Rectangle *window,
                    int filled);
 
-  void draw_edge_and_scale(RGBImage *image,
-                           int registration_mode, Rectangle *window,
-                           int _tag, int _edge_scale);
-
   static void print_registration_mode(ostream *out, int registration_mode);
 };