forked from ofZach/ofxControlPanel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackgroundSubtractionExample.h
53 lines (39 loc) · 1.05 KB
/
backgroundSubtractionExample.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
/*
* backgroundSubtractionExample.h
* ofxControlPanelDemo
*
* Created by theo on 31/03/2010.
* Copyright 2010 __MyCompanyName__. All rights reserved.
*
*/
#pragma once
#include "ofMain.h"
#include "ofxOpenCv.h"
typedef enum{
BG_ABS,
BG_GREATER,
BG_LESS
}captureMode;
class backgroundSubtractionExample{
public:
//------------
void setup(int width, int height);
void update(unsigned char * pixelsIn, int width, int height );
//-----------
//here we add up all the directions from the
//vector field and average them out to an overall
//direction - this will be quite small so you will want
//to scale it up.
//-----------
void draw(float x, float y);
void setThreshold(int threshVal);
void setDifferenceMode(int modeIn);
void captureBackground();
ofxCvColorImage color;
ofxCvGrayscaleImage gray;
ofxCvGrayscaleImage background;
ofxCvGrayscaleImage thresh;
captureMode mode;
int numFrames;
float threshAmnt;
};