-
Notifications
You must be signed in to change notification settings - Fork 0
/
cv.h
44 lines (36 loc) · 1.16 KB
/
cv.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
#ifndef CV_H_
#define CV_H_
#include <stdio.h>
#include <opencv2/opencv.hpp>
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace cv;
using namespace std;
class CV {
public:
float PERCLOS;
struct EyeData {
int radius;
};
struct FrameData {
static const int numOfFrames = 960; // num of frames = 1 minute @ avg 16fps
float numOfPixels[numOfFrames]; // num of black/white pixels per frame
int state[numOfFrames]; // frameData.state per frame
int counter;
float prevFrameWhitePixelNo;
float currFrameWhitePixelNo;
bool close;
};
EyeData eyeData;
FrameData frameData;
CV();
Mat rotate(Mat src, double angle);
void gammaCorrection(const Mat &src, Mat &dst, const float gamma);
Rect getLeftmostEye(vector<Rect> &eyes);
Vec3f getEyeball(Mat &eye, vector<Vec3f> &circles);
Point stabilize( vector<Point> &points, int windowSize);
Rect detectEyes(Mat &frame, CascadeClassifier &eyeCascade);
void detectBlink(Mat &frame);
};
#endif