Removed the definition of basename, which confuses an existing system one.
[folded-ctf.git] / classifier_reader.cc
1 /*
2  *  folded-ctf is an implementation of the folded hierarchy of
3  *  classifiers for object detection, developed by Francois Fleuret
4  *  and Donald Geman.
5  *
6  *  Copyright (c) 2008 Idiap Research Institute, http://www.idiap.ch/
7  *  Written by Francois Fleuret <francois.fleuret@idiap.ch>
8  *
9  *  This file is part of folded-ctf.
10  *
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.
14  *
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.
19  *
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/>.
22  *
23  */
24
25 #include "classifier_reader.h"
26 #include "misc.h"
27 #include "boosted_classifier.h"
28
29 Classifier *read_classifier(istream *is) {
30   Classifier *result;
31   unsigned int id;
32
33   read_var(is, &id);
34
35   switch(id) {
36   case CLASSIFIER_BOOSTED:
37     result = new BoostedClassifier();
38     break;
39   default:
40     cerr << "Unknown classifier ID " << id << endl;
41     exit(1);
42   }
43
44   result->read(is);
45   return result;
46 }