#pragma once #include #include "ofMain.h" #include "tesselator.h" #include "ofxOpenCv.h" //#include "ofxOpenCvUtilsForeground.h" #include #include "ofxBlobsManager.h" #define CAM_WIDTH_FG 640 #define CAM_HEIGHT_FG 480 #define chan_R 1 #define chan_G 2 #define chan_B 3 #define chan_H 4 #define chan_S 5 #define chan_V 6 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 windowWidth, windowHeight; ofVideoPlayer vidPlayer; //matrix types in ofxOpenCv\libs\opencv\include\opencv2\core\types_c.h //cv::Mat is dynamic //try to accumulate background using SHORT datatype ie CV_16UC / 4 (would 4 be faster, 64 bits) cv::Mat accumulator,outmat,hsvback,outchan,output; // background accumulation int frameno; ofxCvColorImage currentFrame; ofxCvColorImage background; ofxCvColorImage mogoutput; ofxCvGrayscaleImage grayFrame; ofxCvGrayscaleImage grayBg; ofxCvGrayscaleImage grayDiff; float learningRate; bool bFirstFrame; ofxCvContourFinder contourFinder; float threshold; cv::BackgroundSubtractorMOG mog; float mogf; int diffchannel; /* ofxOpenCvUtilsForeground* fg; ofxOpenCvUtilsMeanShift* meanShift; ofxCvColorImage blobFrame; ofxCvColorImage trackFrame; ofxCvGrayscaleImage resultFrame; float blockSize; float minBlobSize; float maxBlobSize; float shadowThreshold; float blur; bool selectEnabled; bool useMoG; bool isTracking; */ };