diff options
Diffstat (limited to 'src/testApp.cpp')
| -rwxr-xr-x | src/testApp.cpp | 23 |
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; } } |
