-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrackingEffect.h
58 lines (47 loc) · 1.27 KB
/
TrackingEffect.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
#ifndef DW_TrackingEffect
#define DW_TrackingEffect
#define DW_TE_MAXSUBEFFECTS 5
#include <iostream>
#include <opencv2/opencv.hpp>
#include "AbstractEffect.h"
#include "HandTracker.h"
#include "SimpleMotionTracker.h"
#include "MotionEffect.h"
#include <time.h>
using namespace cv;
using namespace std;
//create an abstract class for all the effects I am going to create.
class TrackingEffect : public AbstractEffect {
public:
TrackingEffect();
virtual string const className() { return "TrackingEffect";}
void init();
void drawEffect();
void togglePresets();
virtual void getRandomConfig(bool doGrid=false);
protected:
// functions.
void drawHappyFaces();
void drawHandSpots();
void drawBGSubtraction();
void drawHandTracking();
void drawMotion();
// variables.
int m_subEffect; // which sub-effect to create.
CascadeClassifier m_faceCascade;
std::vector<Rect> m_faces;
CascadeClassifier m_eyesCascade;
std::vector<Rect> m_eyes;
CascadeClassifier m_palmCascade;
std::vector<Rect> m_palms;
CascadeClassifier m_closedPalmCascade;
std::vector<Rect> m_closedPalms;
CascadeClassifier m_fistCascade;
std::vector<Rect> m_fists;
// hand tracking
HandTracker m_handTracker;
// motion detection.
SimpleMotionTracker m_motionTracker;
MotionEffect m_motionEffect;
};
#endif