summaryrefslogtreecommitdiff
path: root/src/testApp.cpp
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/testApp.cpp
parentde68c3e9911616d116135960075d80b6c72efecc (diff)
mode vis
Diffstat (limited to 'src/testApp.cpp')
-rwxr-xr-xsrc/testApp.cpp23
1 files changed, 20 insertions, 3 deletions
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;
}
}