This repository was archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathYawAnalyser.h
More file actions
73 lines (61 loc) · 1.86 KB
/
Copy pathYawAnalyser.h
File metadata and controls
73 lines (61 loc) · 1.86 KB
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
#ifndef YAWANALYSER_H
#define YAWANALYSER_H
#include <Analyser.h>
#include <WebcamCapture.h>
#include <FaceDetector.h>
#include <FaceAligner.h>
#include <QTimer>
#include <Utils.h>
#include <OpticalFlowCalculater.h>
class YawAnalyser : public Analyser
{
Q_OBJECT
public:
YawAnalyser();
private:
const int totalProgressTimeMS;
QTimer* progressTimer;
QTimer* updateSliderTimer;
WebcamCapture* webcamCapture;
FaceDetector* faceDetector;
FaceAligner* faceAligner;
cv::Mat grayImage;
cv::Mat imageToDisplay;
BoundingBox faceBoundingBox;
OpticalFlowCalculater* opticalFlowCalculater;
bool isCurrentAlignmentValid;
bool isOpticalFlowCalculaterBusy;
cv::Mat_<int> zoneMap;
double sliderPhase;
bool isProgressTimeout;
std::vector<double> faceNormalVector;
std::vector<double> leftBackgroundNormalVector;
std::vector<double> rightBackgroundNormalVector;
std::vector<double> facePhaseVector;
std::vector<double> leftBackgroundPhaseVector;
std::vector<double> rightBackgroundPhaseVector;
bool isSinglePointInFace(int rowIndex, int columnIndex);
void recordIntoVectors();
cv::Mat_<double> currentAlignment;
cv::Mat currentOpticalFlow;
void separateNromAndAngle();
cv::Mat norm;
cv::Mat phaseAngle;
void calculateZoneMap();
void displayZoneMap();
enum zone{noArea,face, leftBackground,rightBackground};
public slots:
virtual void start();
void receiveNewFrame(cv::Mat newFrame);
void receiveNewAlignment(cv::Mat_<double>);
void receiveNewOpticalFlow(bool isOpticalFlowVaild, cv::Mat newOpticalFlow);
private slots:
void finish();
void updateSliderTimeout();
void progressTimeout();
signals:
void done(bool result);
void doAlignment(cv::Mat grayImage, BoundingBox boundingBox);
void doCalcOpticalFlow(cv::Mat);
};
#endif // YAWANALYSER_H