forked from galeone/face-miner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfacialrecognition.h
64 lines (54 loc) · 1.74 KB
/
facialrecognition.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
/*
Face Miner: data mining applied to face detection
Copyright (C) 2016 Paolo Galeone <nessuno@nerdz.eu>
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Exhibit B is not attached; this software is compatible with the
licenses expressed under Section 1.12 of the MPL v2.
*/
#ifndef FACIALRECOGNITION_H
#define FACIALRECOGNITION_H
#include <QMainWindow>
#include <QMessageBox>
#include <QThread>
#include <QMimeData>
#include <QMetaObject>
#include "camstream.h"
#include "videostreamview.h"
#include "cv2qt.h"
#include "facepatternminer.h"
#include "preprocessor.h"
#include "facefinder.h"
#include <opencv2/core.hpp>
#include <opencv2/highgui/highgui.hpp>
namespace Ui {
class FacialRecognition;
}
class FacialRecognition : public QMainWindow {
Q_OBJECT
public:
explicit FacialRecognition(QWidget* parent = 0);
~FacialRecognition();
private:
Ui::FacialRecognition* ui;
VideoStreamView* _getCamStreamView();
VideoStreamView* _getTrainingStreamView();
VideoStreamView* _getPositivePatternStreamView();
VideoStreamView* _getNegativePatternStreamView();
QSize* _streamSize;
QMetaObject::Connection _trackerConnection;
FaceFinder *_faceFinder;
CamStream *_frameStream;
std::vector<std::pair<cv::Rect, cv::Mat1b>> _camFaces;
uint32_t _frameCount;
void _updatePositivePatternStreamView(const cv::Mat&);
void _updateNegativePatternStreamView(const cv::Mat&);
void _startCamStream();
private slots:
void _updateCamView(const cv::Mat&);
void _updateTrainingStreamView(const cv::Mat&);
void _handleClick(const cv::Point&);
void _track(const cv::Mat& im);
};
#endif // FACIALRECOGNITION_H