From f65006daf4979d82d67fd8c8a234d3913088821d Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 5 Apr 2012 14:00:51 +0100 Subject: starting to implement bird --- gaunt01/src/testApp.cpp | 72 +++++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 32 deletions(-) (limited to 'gaunt01/src/testApp.cpp') diff --git a/gaunt01/src/testApp.cpp b/gaunt01/src/testApp.cpp index aebbe0b..172190f 100644 --- a/gaunt01/src/testApp.cpp +++ b/gaunt01/src/testApp.cpp @@ -30,11 +30,11 @@ void testApp::setup(){ grayImage.allocate(640,480); grayBg.allocate(640,480); grayDiff.allocate(640,480); - + blobsManager.normalizePercentage = 0.7; - blobsManager.giveLowestPossibleIDs = true; + blobsManager.giveLowestPossibleIDs = false; blobsManager.maxUndetectedTime = 500; - blobsManager.minDetectedTime = 2000; + blobsManager.minDetectedTime = 500; blobsManager.debugDrawCandidates = true; ofVec3f centre=ofVec3f(ofGetWidth()/2,0,0); @@ -54,12 +54,12 @@ void testApp::setup(){ cam.cacheMatrices(); //stop error messages testpts=new ofVec3f[4]; - + trapDoor=trapdoor(screen2plane(ofVec2f(ofGetWidth(),0)),screen2plane(ofVec2f(ofGetWidth(),ofGetHeight())),ofVec2f(30,30)); updatePlane(); mode=PLAY; - + } @@ -80,7 +80,7 @@ bool testApp::rectsCross(ofRectangle rect1,ofRectangle rect2) { else if (rect2.x newPlayers; float movethresh=10; - for (int i = 0; i < contourFinder.nBlobs; i++){ - //do some bounds checking, size threshold and overlap removal - //in order to translate blobs into players - //attempt to track players - maintain ID no - //attempt to base blobs - //TODO attempt to estimate bounds shape - //project all of this into the 3D space - ofRectangle r=contourFinder.blobs[i].boundingRect; + for(int i=0;i