bazar
1.3.1
Main Page
Modules
Classes
Files
Examples
File List
File Members
garfeild
viewsets
image_classification_forest.h
Go to the documentation of this file.
1
/*
2
Copyright 2005, 2006 Computer Vision Lab,
3
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
4
All rights reserved.
5
6
This file is part of BazAR.
7
8
BazAR is free software; you can redistribute it and/or modify it under the
9
terms of the GNU General Public License as published by the Free Software
10
Foundation; either version 2 of the License, or (at your option) any later
11
version.
12
13
BazAR is distributed in the hope that it will be useful, but WITHOUT ANY
14
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15
PARTICULAR PURPOSE. See the GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License along with
18
BazAR; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
Street, Fifth Floor, Boston, MA 02110-1301, USA
20
*/
21
#ifndef IMAGE_CLASSIFICATION_FOREST_H
22
#define IMAGE_CLASSIFICATION_FOREST_H
23
24
#include "
image_classifier.h
"
25
#include "
image_classification_tree.h
"
26
32
class
image_classification_forest
:
public
image_classifier
33
{
34
public
:
35
image_classification_forest
(
LEARNPROGRESSION
LearnProgress=0);
36
37
image_classification_forest
(
int
image_width
,
int
image_height
,
int
class_number
,
38
int
max_depth
,
int
trees_number,
39
LEARNPROGRESSION
LearnProgress=0);
40
41
~image_classification_forest
();
42
43
void
set_saving_directory_name
(
string
directory_name
);
44
void
create_trees_at_random
(
void
);
45
virtual
void
refine
(
example_generator
* vg,
int
call_number);
46
void
restore_occurances
();
47
void
reset_class_occurances
(
int
class_index);
48
virtual
void
test
(
example_generator
* vg,
int
call_number);
49
int
recognize
(
image_class_example
* pv,
float
* confidence = 0,
int
tree_number
= -1);
50
51
virtual
float
*
posterior_probabilities
(
image_class_example
* pv,
int
tree_number
= -1);
52
virtual
void
posterior_probabilities
(
image_class_example
* pv,
float
* pp,
int
tree_number
= -1);
53
54
void
change_class_number_and_reset_probabilities
(
int
new_class_number);
55
56
float
*
thresholds
;
57
float
*
misclassification_rates
;
58
59
bool
load
(
string
directory_name);
60
bool
save
(
string
directory_name);
61
62
bool
is_ok
() {
return
trees
.size() != 0; }
63
64
//private:
65
vector<image_classification_tree *>
trees
;
66
int
tree_number
,
max_depth
;
67
68
float
*
weights
;
69
70
string
directory_name
;
71
};
72
73
#endif // IMAGE_CLASSIFICATION_FOREST_H
Generated on Tue Jan 15 2013 12:50:21 for bazar by
1.8.1.2