From 685e82c6b33038cdfc4e9836002bfe1ff2f9897a Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 21 Aug 2012 15:37:26 +0100 Subject: had enough --- gaunt01/src/testApp.cpp | 61 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 17 deletions(-) (limited to 'gaunt01/src/testApp.cpp') diff --git a/gaunt01/src/testApp.cpp b/gaunt01/src/testApp.cpp index 8fe42cc..226e694 100644 --- a/gaunt01/src/testApp.cpp +++ b/gaunt01/src/testApp.cpp @@ -41,7 +41,7 @@ void testApp::setup(){ { hasCamera=false; useCamera=false; - vidPlayer.loadMovie("camoutput.mov"); //footage/ camera needs to be the same res as opencv planes and output + vidPlayer.loadMovie(testmovie); //footage/ camera needs to be the same res as opencv planes and output vidPlayer.setLoopState(OF_LOOP_NORMAL); vidPlayer.play(); } @@ -160,8 +160,8 @@ void testApp::setup(){ cam.begin(); cam.end(); - - updatePlane(); + + //mog=cv::BackgroundSubtractorMOG(100,10,.1,.1); } @@ -501,6 +501,9 @@ void testApp::update(){ */ cv::Mat img = colorImg.getCvImage(); + + + //if (frameno%1==0) { //I THINK THIS APPROACH IS OK to attempt to lower cpu hit from accumulating? @@ -530,6 +533,8 @@ void testApp::update(){ //get correct channel into backchan + + vector chans; @@ -606,7 +611,7 @@ void testApp::update(){ //convert back into RGB if necessary - if (diffchannelwidth,tmp->height,tmp->nChannels,tmp->depth); //printf("grayDiff: %ix%i channels: %i depth:%i\n",grayDiff.getCvImage()->width,grayDiff.getCvImage()->height,grayDiff.getCvImage()->nChannels,grayDiff.getCvImage()->depth); grayDiff=tmp1; //copy to ofx -*/ + + */ + + + + if (mode==CHECKACCUM) colorImg=grayDiff; grayDiff.resize(windowWidth,windowHeight); //wasteful?? + + - contourFinder.findContours(grayDiff, 500, (640*480)/3, 20, false); // find holes + contourFinder.findContours(grayDiff, 500, (640*480)/3, 20,false); // find holes blobsManager.update(contourFinder.blobs); //check players against blob ids - bland do ray casting, update players @@ -724,7 +742,7 @@ void testApp::draw(){ ofSetHexColor(0xffffff); glDisable(GL_BLEND); - if (gameState::iterator it; - for(int i=0;i::iterator it; + for(int i=0;i