efb750a71d8d3003cb1f29390b1db22a7b897592
[platform/upstream/opencv.git] / modules / objdetect / src / _lsvm_types.h
1 #ifndef SVM_TYPE
2 #define SVM_TYPE
3
4 #include "float.h"
5
6 //#define FFT_CONV
7
8 #define PI    CV_PI
9
10 #define EPS 0.000001
11
12 #define F_MAX FLT_MAX
13 #define F_MIN -FLT_MAX
14
15 // The number of elements in bin
16 // The number of sectors in gradient histogram building
17 #define NUM_SECTOR 9
18
19 // The number of levels in image resize procedure
20 // We need Lambda levels to resize image twice
21 #define LAMBDA 10
22
23 // Block size. Used in feature pyramid building procedure
24 #define SIDE_LENGTH 8
25
26 #define VAL_OF_TRUNCATE 0.2f
27
28 //////////////////////////////////////////////////////////////
29 // main data structures                                     //
30 //////////////////////////////////////////////////////////////
31
32 // DataType: STRUCT featureMap
33 // FEATURE MAP DESCRIPTION
34 //   Rectangular map (sizeX x sizeY),
35 //   every cell stores feature vector (dimension = numFeatures)
36 // map             - matrix of feature vectors
37 //                   to set and get feature vectors (i,j)
38 //                   used formula map[(j * sizeX + i) * p + k], where
39 //                   k - component of feature vector in cell (i, j)
40 typedef struct{
41     int sizeX;
42     int sizeY;
43     int numFeatures;
44     float *map;
45 } CvLSVMFeatureMap;
46
47 // DataType: STRUCT featurePyramid
48 //
49 // numLevels    - number of levels in the feature pyramid
50 // pyramid      - array of pointers to feature map at different levels
51 typedef struct{
52     int numLevels;
53     CvLSVMFeatureMap **pyramid;
54 } CvLSVMFeaturePyramid;
55
56 // DataType: STRUCT filterDisposition
57 // The structure stores preliminary results in optimization process
58 // with objective function D
59 //
60 // x            - array with X coordinates of optimization problems solutions
61 // y            - array with Y coordinates of optimization problems solutions
62 // score        - array with optimal objective values
63 typedef struct{
64     float *score;
65     int *x;
66     int *y;
67 } CvLSVMFilterDisposition;
68
69 // DataType: STRUCT fftImage
70 // The structure stores FFT image
71 //
72 // numFeatures  - number of channels
73 // x            - array of FFT images for 2d signals
74 // n            - number of rows
75 // m            - number of collums
76 typedef struct{
77     int numFeatures;
78     int dimX;
79     int dimY;
80     float **channels;
81 } CvLSVMFftImage;
82
83 #endif