-
Notifications
You must be signed in to change notification settings - Fork 305
/
model.h
94 lines (84 loc) · 2.82 KB
/
model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// AUTORIGHTS
// -------------------------------------------------------
// Copyright (C) 2009-2012 Ross Girshick
//
// This file is part of the voc-releaseX code
// (http://people.cs.uchicago.edu/~rbg/latent/)
// and is available under the terms of an MIT-like license
// provided in COPYING. Please retain this notice and
// COPYING if you use this file (or a portion of it) in
// your project.
// -------------------------------------------------------
#ifndef MODEL_H
#define MODEL_H
class Model {
public:
// model data
// size of HOG feature cell (e.g., 8 pixels)
int sbin;
// number of dimensions used for the PCA filter projection
int pcadim;
// dimenions of the HOG features
int numfeatures;
// component indexed array of root filters
float **rootfilters;
// sizes of root filters
mwSize **rootfilterdims;
// array of arrays of part filters
// partfilters[0] holds non-PCA filters
// partfilters[1] holds PCA filters
float **partfilters[2];
// dimensions of part filters
mwSize **partfilterdims;
// component indexed offset (a.k.a. bias) values
double *offsets;
// location/scale scores
double **loc_scores;
// number of components in the model
int numcomponents;
// number of parts per component
int *numparts;
// global detection threshold
double thresh;
// component indexed arrays of part orderings
int **partorder;
// component indexed arrays of pruning thresholds
double **t;
// ideal relative positions for each deformation model
double ***anchors;
// array of deformation models
double **defs;
// maps from (component,part#) -> part filter or deformation model index
// this enables supporting models with parts and deformation models that are
// shared between components (not currently used)
// map: pfind[component][part#] => part filter index
int **pfind;
// map: defind[component][part#] => def param index
int **defind;
// pooled part filter and def model counts
int numpartfilters;
int numdefparams;
// feature pyramid data
int numlevels;
// dimensions of each feature pyramid level
int **featdims;
// number of positions in each feature pyramid level
int *featdimsprod;
// feature pyramid levels
// feat[0] holds non-PCA HOG features
// feat[1] holds PCA of HOG features
float **feat[2];
// number of levels per octave in feature pyramid
int interval;
// root PCA filter score + offset (stage 0 computed in cascade_detect.m)
int numrootlocs;
Model() {};
Model(const mxArray *model) { initmodel(model); };
~Model();
// fill in above model data using the mex struct pointed to by model
void initmodel(const mxArray *model);
// fill in above feature pyramid data using the mex structs pointed to
// by pyramid and projpyramid
void initpyramid(const mxArray *pyramid, const mxArray *projpyramid);
};
#endif /* MODEL_H */