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 as published
13 * by the Free Software Foundation, either version 3 of the License,
14 * or (at your option) any later version.
16 * folded-ctf is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with folded-ctf. If not, see <http://www.gnu.org/licenses/>.
28 A PoseCellHierarchy provides the necessary methods to visit a
29 recursive partitioning of the pose space. The two main methods can
30 give you an root partitioning, or compute a finer partitioning from
35 #ifndef POSE_CELL_HIERARCHY_H
36 #define POSE_CELL_HIERARCHY_H
38 #include "pose_cell_set.h"
39 #include "labelled_image_pool.h"
41 struct RelativeBellyPoseCell {
42 Interval _belly_xc, _belly_yc;
45 class PoseCellHierarchy {
46 static const scalar_t pseudo_infty = 10000;
48 static const scalar_t belly_resolution = 0.5;
50 static const int nb_radius_1 = 16;
51 static const int nb_radius_2 = 16;
52 static const int nb_tilts = 64;
55 scalar_t _min_head_radius;
56 scalar_t _max_head_radius;
57 int _root_cell_nb_xy_per_radius;
61 RelativeBellyPoseCell *_belly_cells;
65 PoseCellHierarchy(LabelledImagePool *train_pool);
66 virtual ~PoseCellHierarchy();
68 virtual int nb_levels();
69 virtual void get_containing_cell(Image *image, int level,
70 Pose *pose, PoseCell *result_cell);
72 virtual void add_root_cells(Image *image, PoseCellSet *cell_set);
73 // level is the level to build, hence should be greater than 1
74 virtual void add_subcells(int level, PoseCell *root, PoseCellSet *cell_set);
76 virtual int nb_incompatible_poses(LabelledImagePool *pool);
78 virtual void write(ostream *os);
79 virtual void read(istream *is);