-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCoHOGParams.hpp
More file actions
125 lines (103 loc) · 3.07 KB
/
CoHOGParams.hpp
File metadata and controls
125 lines (103 loc) · 3.07 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#pragma once
namespace libcohog
{
static const int offsets_x[] = {0, 1, 2, 3, 4, -4, -3, -2, -1, 0, 1, 2, 3, 4, -3, -2, -1, 0, 1, 2, 3, -3, -2, -1, 0, 1, 2, 3, -1, 0, 1};
static const int offsets_y[] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4};
static const int n_offset = sizeof(offsets_x) / sizeof(int);
static const unsigned DefaultBinCount = 8;
static const unsigned DefaultBlockSize = 6;
static const float DefaultMinGradient = 10.0f;
static const unsigned DefaultBlockCountX = 3;
static const unsigned DefaultBlockCountY = 6;
/*!
* Describes the parameters of CoHOG feature extraction.
*/
struct CoHOGParams
{
/*!
* The number of quantization level of orientation.
*/
unsigned BinCount;
/*!
* The minimum norm of gradient (sqrt(dx**2 + dy**2) where the (x,y) components of gradient are (dx,dy)) that is not to be ignored.
*/
float MinGradient;
/*!
* The horizontal count of blocks on a CoHOG window.
*/
unsigned BlockCountX;
/*!
* The vertical count of blocks on a CoHOG window.
*/
unsigned BlockCountY;
/*!
* The width and height of CoHOG block in pixel.
*/
unsigned BlockSize;
/*!
* Calculate the width of CoHOG window in pixel.
*/
unsigned width() const { return BlockCountX * BlockSize; }
/*!
* Calculate the height of CoHOG window in pixel.
*/
unsigned height() const { return BlockCountY * BlockSize; }
/*!
* Calclate the dimension of CoHOG feature come from this parameters
*/
unsigned dimension() const { return BinCount * BinCount * BlockCountX * BlockCountY * n_offset; }
/*!
* Construct an default parameters
*/
CoHOGParams():
BinCount(DefaultBinCount),
MinGradient(DefaultMinGradient),
BlockCountX(DefaultBlockCountX),
BlockCountY(DefaultBlockCountY),
BlockSize(DefaultBlockSize)
{
}
};
static const int DefaultMinHeight = 90;
static const int DefaultMaxHeight = 300;
static const float DefaultScaleFactor = 1.1f;
static const unsigned DefaultSkipSizeX = 2;
static const unsigned DefaultSkipSizeY = 4;
/*!
* Describes the parameters of detection window search
*/
struct ScanParams
{
/*!
* The minimum height of multiple scale detection windows
*/
int MinHeight;
/*!
* The maximum height of multiple scale detection windows
*/
int MaxHeight;
/*!
* The factor search of maginification scale beginning from BeginScale to EndScale for multiple scale
*/
float ScaleFactor;
/*!
* The X shift size of sliding window search
*/
unsigned SkipSizeX;
/*!
* The Y shift size of sliding window search
*/
unsigned SkipSizeY;
/*!
* Construct an default parameters
*/
ScanParams():
MinHeight(DefaultMinHeight),
MaxHeight(DefaultMaxHeight),
ScaleFactor(DefaultScaleFactor),
SkipSizeX(DefaultSkipSizeX),
SkipSizeY(DefaultSkipSizeY)
{
}
};
}