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/bin/data/settings.xml | 2 +- gaunt01/src/testApp.cpp | 61 +++++++++++++++++++++++++++++++------------ gaunt01/src/testApp.h | 5 ++++ 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/gaunt01/bin/data/settings.xml b/gaunt01/bin/data/settings.xml index df7427c..3ef506a 100644 --- a/gaunt01/bin/data/settings.xml +++ b/gaunt01/bin/data/settings.xml @@ -1,5 +1,5 @@ - + 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 + #include "ofxRay.h" #include "ofxXmlSettings.h" @@ -21,6 +23,7 @@ #define PLAY 0 #define CALIBRATE 1 +#define CHECKACCUM 2 #define TITLES 0 #define EXPLAIN 1 @@ -77,6 +80,8 @@ class testApp : public ofBaseApp{ ofVideoPlayer vidPlayer; ofxCvColorImage colorImg; + + string testmovie; int diffchannel; -- cgit v1.2.3