-
Notifications
You must be signed in to change notification settings - Fork 3
/
opencvfacedetectaction.h
52 lines (39 loc) · 1000 Bytes
/
opencvfacedetectaction.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
#ifndef OPENCVFACEDETECTACTION_H
#define OPENCVFACEDETECTACTION_H
#include "opencvaction.h"
#include <vector>
#include "typedef.h"
class OpenCVfaceDetectAction : public OpenCVaction
{
Q_OBJECT
public:
OpenCVfaceDetectAction(QObject *parent = 0);
~OpenCVfaceDetectAction();
void action(IplImage *imgin, IplImage *&imgout);
void startTrain() {
m_isTrain = true;
}
void startPredict() {
m_isPredict = true;
}
void setLabel(int i) {
m_label = i;
}
signals:
void a();
void train(const Mats &src, const Ints &labels);
void predict(const cv::Mat& src);
private:
CvHaarClassifierCascade* m_cascade;
CvMemStorage* m_storage;
double m_scale;
bool m_isTrain;
bool m_isPredict;
int m_srcNum;
int m_label;
Mats m_mats;
Ints m_labels;
static cv::Mat getSubMat(IplImage *in, const CvRect &rect);
static cv::Mat norm_0_255(cv::InputArray _src);
};
#endif // OPENCVFACEDETECTACTION_H