forked from opengazer/OpenGazer
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Calibrator.h
60 lines (53 loc) · 1.59 KB
/
Calibrator.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
#pragma once
#include "utils.h"
#include "TrackingSystem.h"
#include "Containers.h"
#include "GraphicalPointer.h"
#include "FeatureDetector.h"
class FrameProcessing;
class FrameFunction:
public Containee<FrameProcessing, FrameFunction>
{
const int &frameno;
int startframe;
protected:
int getFrame() { return frameno - startframe; }
public:
FrameFunction(const int &frameno): frameno(frameno), startframe(frameno) {}
virtual void process()=0;
virtual ~FrameFunction();
};
class FrameProcessing:
public ProcessContainer<FrameProcessing,FrameFunction> {};
class MovingTarget: public FrameFunction {
shared_ptr<WindowPointer> pointer;
public:
MovingTarget(const int &frameno,
const vector<Point>& points,
const shared_ptr<WindowPointer> &pointer,
int dwelltime=20);
virtual ~MovingTarget();
virtual void process();
protected:
vector<Point> points;
const int dwelltime;
int getPointNo();
int getPointFrame();
bool active();
};
class Calibrator: public MovingTarget {
static const Point defaultpointarr[];
shared_ptr<TrackingSystem> trackingsystem;
scoped_ptr<FeatureDetector> averageeye;
public:
static vector<Point> defaultpoints;
static vector<Point> loadpoints(istream& in);
Calibrator(const int &frameno,
const shared_ptr<TrackingSystem> &trackingsystem,
const vector<Point>& points,
const shared_ptr<WindowPointer> &pointer,
int dwelltime=20);
virtual ~Calibrator();
virtual void process();
static vector<Point> scaled(const vector<Point>& points, double x, double y);
};