2 * folded-ctf is an implementation of the folded hierarchy of
3 * classifiers for object detection, developed by Francois Fleuret
6 * Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/
7 * Written by Francois Fleuret <francois.fleuret@idiap.ch>
9 * This file is part of folded-ctf.
11 * folded-ctf is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 3 as
13 * published by the Free Software Foundation.
15 * folded-ctf is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with folded-ctf. If not, see <http://www.gnu.org/licenses/>.
27 A PoseCellHierarchy provides the necessary methods to visit a
28 recursive partitioning of the pose space. The two main methods can
29 give you an root partitioning, or compute a finer partitioning from
34 #ifndef POSE_CELL_HIERARCHY_H
35 #define POSE_CELL_HIERARCHY_H
37 #include "pose_cell_set.h"
38 #include "labelled_image_pool.h"
40 struct RelativeBellyPoseCell {
41 Interval _belly_xc, _belly_yc;
44 class PoseCellHierarchy {
45 static const scalar_t pseudo_infty = 10000;
47 static const scalar_t belly_resolution = 0.5;
49 static const int nb_radius_1 = 16;
50 static const int nb_radius_2 = 16;
51 static const int nb_tilts = 64;
54 scalar_t _min_head_radius;
55 scalar_t _max_head_radius;
56 int _root_cell_nb_xy_per_radius;
60 RelativeBellyPoseCell *_belly_cells;
64 PoseCellHierarchy(LabelledImagePool *train_pool);
65 virtual ~PoseCellHierarchy();
67 virtual int nb_levels();
68 virtual void get_containing_cell(Image *image, int level,
69 Pose *pose, PoseCell *result_cell);
71 virtual void add_root_cells(Image *image, PoseCellSet *cell_set);
72 // level is the level to build, hence should be greater than 1
73 virtual void add_subcells(int level, PoseCell *root, PoseCellSet *cell_set);
75 virtual int nb_incompatible_poses(LabelledImagePool *pool);
77 virtual void write(ostream *os);
78 virtual void read(istream *is);