-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEigenMethod.H
98 lines (68 loc) · 1.6 KB
/
EigenMethod.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
95
96
//
// HEADER Recognizer
// Recognizer.H
//
//
// Date: 2007-12-31
//
#ifndef EIGEN_METHOD_HEADER
#define EIGEN_METHOD_HEADER
#include <stdio.h>
#include "Recognizer.H"
#include "common.H"
#include "Face.H"
////////////////////////////////////////////////////////////////////////////////////////
// Eigen Method
////////////////////////////////////////////////////////////////////////////////////////
#define EIGEN_DIFF 0
enum Indices
{
INDEX_FACE=0,
INDEX_EIG,
MAX_INDEX
};
class EigenMethod: public Recognizer
{
public:
EigenMethod();
virtual ~EigenMethod(){}
int Init();
void Cleanup();
void CleanupData();
int OnPrimaryLoadUp(FaceDB* pDB);
void OnPrimaryCleanUp();
int OnSecondaryLoadUp(FaceDB* pDB);
void OnSecondaryCleanUp();
Person* Recognize(Face* pFace);
void RunSelfTest(FaceDB* pDB);
void RunSelfTest(Person* pPerson);
private:
Person* Recognize(Face* pFace, const char* zOutputPath);
// Primary Loadup
void CalcEigenMethod();
void CalcEigenMethod_Cleanup();
void SaveStructures();
// Secondary Loadup
int LoadStructures();
void LoadStructures_Cleanup();
void CalcAvgCoeffs();
void CalcAvgCoeffs_Cleanup();
void SavePlots(const char* zPath);
// check if Face matches Person
// self test
void RunNormalTest(Person* pPerson, Face* pProtectedFace, const char* zOutputPath);
int i_Width;
int i_Height;
int i_NumFaces;
int i_NumEigens;
IplImage** pp_EigenVects;
float* p_EigenVals;
float** pp_Coeffs;
CvMat** pp_AvgCoeffs;
IplImage* p_AvgImg;
CvMat** pp_CoeffMat;
int* pi_Data;
char z_ImgDir[1000];
int i_MaxSelfTest;
};
#endif // EIGEN_METHOD_HEADER