#pragma once #include #include "ofMain.h" #include "ofxOpenCv.h" #include "ofxRay.h" #include "ofxXmlSettings.h" #include "ofxBlobsManager.h" #include "trapdoor.h" #include "bird.h" #include "player.h" //#define _USE_LIVE_VIDEO // uncomment this to use a live camera // otherwise, we'll use a movie file #define PLAY 0 #define CALIBRATE 1 class testApp : public ofBaseApp{ public: void setup(); void update(); void draw(); void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y ); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); void dragEvent(ofDragInfo dragInfo); void gotMessage(ofMessage msg); int mode; //utility functions ofVec2f screen2plane(ofVec2f screenpos); ofVec3f plane2world(ofVec2f planepos); void updatePlane(); bool rectsCross(ofRectangle rect1,ofRectangle rect2); ofxXmlSettings XML; void loadSettings(string filename); void saveSettings(string filename); bool useCamera; bool hasCamera; ofVideoGrabber vidGrabber; ofVideoPlayer vidPlayer; ofxCvColorImage colorImg; ofxCvFloatImage accumImg; ofxCvGrayscaleImage bgImg; ofxCvGrayscaleImage grayImage; ofxCvGrayscaleImage grayBg; ofxCvGrayscaleImage grayDiff; ofxCvContourFinder contourFinder; ofxBlobsManager blobsManager; int threshold; bool bLearnBakground; float cam_angle; ofCamera cam; ofRay ray; ofPlane plane; ofProjector projector; ofVec2f pos; //vector players; trapdoor trapDoor; ofMesh ground; ofVec3f* testpts; bird Bird; map players; bool drawStats; bool firstframe; //for background removal float bgnum; ofLight light; ofPlane* bounds; vector border; bool drawingborder; };