forked from sun11/QTFaceRec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
processImage.h
72 lines (66 loc) · 1.77 KB
/
processImage.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
#ifndef PROCESSIMAGE_H
#define PROCESSIMAGE_H
#include <QtGui>
#include "videodevice.h"
#include <cv.h>
#include <highgui.h>
#include "facedetect.h"
#include "facerecognize.h"
#include "thread.h"
class ProcessImage : public QWidget
{
Q_OBJECT
public:
ProcessImage(QWidget *parent=0);
FaceDetect faceDetect;
FaceRec faceRec;
bool recFlag;
bool smallImageDrawFlag;
bool firstRecFlag;
QImage *QfaceImage;
vector<double> personConfi;
int iperson;
double averConfi;
void start();
int rs;
VideoDevice *vd;
~ProcessImage();
private:
friend class Thread;
Thread *paintThread;
vector<int> count;
QPainter *painter;
QLabel *label;
QImage *frame;
IplImage *cvimg;
//QPixmap *frame;
QTimer *timer;
uchar *pp;
uchar * p;
unsigned int len;
QVector<QRect> listRect;
int vectorMax(vector<int> a);
int convert_yuv_to_rgb_pixel(int y, int u, int v);
int convert_yuv_to_rgb_buffer(unsigned char *yuv, unsigned char *rgb, unsigned int width, unsigned int height);
QImage* convert_iplimage_to_qimage( IplImage *img);
void convert_qimage_to_iplimage( QImage* qImage,IplImage* cvimg);
void queryFrame();
CvHaarClassifierCascade* cascade;
CvMemStorage* storage;
IplImage* detect(IplImage *img);
int nearest;
QString fileName;
private slots:
void paintEvent(QPaintEvent *);
void display_error(QString err);
void changeCascadeDefault();
void changeCascadeAlt();
void changeCascadeAlt2();
void changeCascadeProfileface();
void changeCascadeUpperbody();
void changeCascadeFullbody();
void changeCascadeFromFile();
void faceLearn();
void paintRun();
};
#endif