summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-10-12 11:06:16 +0100
committerTim Redfern <tim@eclectronics.org>2012-10-12 11:06:16 +0100
commit1f8525289c3533805fa235d25804f3413243743a (patch)
tree21378e17f174431f459c889d721149aa66003a35 /src
parentde68c3e9911616d116135960075d80b6c72efecc (diff)
mode vis
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main.cpp2
-rwxr-xr-xsrc/testApp.cpp23
-rwxr-xr-xsrc/testApp.h6
3 files changed, 27 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp
index e502a4d..e922099 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -6,7 +6,7 @@
int main( ){
ofAppGlutWindow window;
- ofSetupOpenGL(&window, 640,480, OF_WINDOW); // <-------- setup the GL context
+ ofSetupOpenGL(&window, 720,576, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
diff --git a/src/testApp.cpp b/src/testApp.cpp
index 28d3ef2..d093497 100755
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -10,8 +10,8 @@ void testApp::setup(){
threshold = 80;
//
- gw=640;
- gh=480;
+ gw=720;
+ gh=576;
vidGrabber.setVerbose(true);
vidGrabber.initGrabber(gw,gh); //base grab size
@@ -20,6 +20,8 @@ void testApp::setup(){
grayImage.allocate(gw,gh);
grayBg.allocate(gw,gh);
grayDiff.allocate(gw,gh);
+
+ mode=COLOUR;
bLearnBakground = true;
@@ -67,7 +69,17 @@ void testApp::update(){
//--------------------------------------------------------------
void testApp::draw(){
ofSetColor(255,255,255);
- colorImg.draw(0,0,gw,gh); //(ofGetHeight()-gh)/2,gw,ofGetHeight()+((gh-ofGetHeight())/2));
+ switch(mode){
+ case COLOUR:
+ colorImg.draw(0,0,gw,gh); //(ofGetHeight()-gh)/2,gw,ofGetHeight()+((gh-ofGetHeight())/2));
+ break;
+ case GREY:
+ grayImage.draw(0,0,gw,gh); //(ofGetHeight()-gh)/2,gw,ofGetHeight()+((gh-ofGetHeight())/2));
+ break;
+ case DIFF:
+ grayDiff.draw(0,0,gw,gh); //(ofGetHeight()-gh)/2,gw,ofGetHeight()+((gh-ofGetHeight())/2));
+ break;
+ }
for (int i = 0; i < contourFinder.nBlobs; i++){
contourFinder.blobs[i].draw(0,0); //(ofGetHeight()-gh)/2);
@@ -128,6 +140,11 @@ void testApp::keyPressed(int key){
case OF_KEY_RIGHT:
boundaries[selectedBoundary].note++;
break;
+ case '1':
+ case '2':
+ case '3':
+ mode=key-48;
+ break;
}
}
diff --git a/src/testApp.h b/src/testApp.h
index 22389a6..9bcf15e 100755
--- a/src/testApp.h
+++ b/src/testApp.h
@@ -8,6 +8,10 @@
#include "ofxOsc.h"
+#define COLOUR 1
+#define GREY 2
+#define DIFF 3
+
class testApp : public ofBaseApp{
public:
@@ -48,6 +52,8 @@ class testApp : public ofBaseApp{
ofxCvGrayscaleImage grayDiff;
ofxCvContourFinder contourFinder;
+
+ int mode;
int threshold;
bool bLearnBakground;