summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--figgis_detect.layout8
-rwxr-xr-xsrc/main.cpp2
-rwxr-xr-xsrc/testApp.cpp23
-rwxr-xr-xsrc/testApp.h6
4 files changed, 31 insertions, 8 deletions
diff --git a/figgis_detect.layout b/figgis_detect.layout
index 1870fbc..4d3d26b 100644
--- a/figgis_detect.layout
+++ b/figgis_detect.layout
@@ -7,7 +7,7 @@
<File name="config.make" open="0" top="0" tabpos="1">
<Cursor position="376" topLine="18" />
</File>
- <File name="src/boundary.cpp" open="1" top="1" tabpos="2">
+ <File name="src/boundary.cpp" open="1" top="0" tabpos="2">
<Cursor position="462" topLine="6" />
</File>
<File name="src/boundary.h" open="1" top="0" tabpos="1">
@@ -17,9 +17,9 @@
<Cursor position="165" topLine="0" />
</File>
<File name="src/testApp.cpp" open="1" top="0" tabpos="3">
- <Cursor position="5345" topLine="185" />
+ <Cursor position="5345" topLine="190" />
</File>
- <File name="src/testApp.h" open="0" top="0" tabpos="4">
- <Cursor position="405" topLine="1" />
+ <File name="src/testApp.h" open="1" top="1" tabpos="5">
+ <Cursor position="1069" topLine="31" />
</File>
</CodeBlocks_layout_file>
diff --git a/src/main.cpp b/src/main.cpp
index e502a4d..e922099 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -6,7 +6,7 @@
int main( ){
ofAppGlutWindow window;
- ofSetupOpenGL(&window, 640,480, OF_WINDOW); // <-------- setup the GL context
+ ofSetupOpenGL(&window, 720,576, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
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;
}
}
diff --git a/src/testApp.h b/src/testApp.h
index 22389a6..9bcf15e 100755
--- a/src/testApp.h
+++ b/src/testApp.h
@@ -8,6 +8,10 @@
#include "ofxOsc.h"
+#define COLOUR 1
+#define GREY 2
+#define DIFF 3
+
class testApp : public ofBaseApp{
public:
@@ -48,6 +52,8 @@ class testApp : public ofBaseApp{
ofxCvGrayscaleImage grayDiff;
ofxCvContourFinder contourFinder;
+
+ int mode;
int threshold;
bool bLearnBakground;