Revision 56 TBetaBase.h
| TBetaBase.h (revision 56) | ||
|---|---|---|
| 25 | 25 |
|
| 26 | 26 |
#include "Filters/CPUImageFilter.h" |
| 27 | 27 |
|
| 28 |
#include "Camera/Camera.h" |
|
| 29 |
|
|
| 30 | 28 |
#include "Calibration/Calibration.h" |
| 31 | 29 |
|
| 32 | 30 |
//#include "ConfigurationApp.h" |
| 33 |
|
|
| 34 |
class Camera |
|
| 35 |
{
|
|
| 36 |
public: |
|
| 37 |
|
|
| 38 |
Camera(); |
|
| 39 |
~Camera(); |
|
| 40 |
|
|
| 41 |
void grabFrameToCPU(); |
|
| 42 |
void grabFrameToGPU(GLuint target); |
|
| 43 |
|
|
| 44 |
int deviceID; |
|
| 45 |
int camRate; |
|
| 46 |
int camWidth; |
|
| 47 |
int camHeight; |
|
| 48 |
|
|
| 49 |
bool bcamera; |
|
| 50 |
|
|
| 51 |
ofxCvColorImage sourceImg; |
|
| 52 |
|
|
| 53 |
/*************************************************************** |
|
| 54 |
* Video Settings |
|
| 55 |
***************************************************************/ |
|
| 56 |
ofVideoGrabber vidGrabber; |
|
| 57 |
ofVideoPlayer vidPlayer; |
|
| 58 |
}; |
|
| 59 |
|
|
| 31 |
|
|
| 32 |
#include "ofxTouchAdaptiveFilter.h" |
|
| 33 |
|
|
| 60 | 34 |
class TBetaBase : public ofSimpleApp, public ofxGuiListener, public TouchListener//, public BlobManager |
| 61 | 35 |
{
|
| 62 | 36 |
//ofxGUI setup stuff |
| ... | ... | |
| 118 | 92 |
TouchEvents.addListener(this); |
| 119 | 93 |
showConfiguration = false; |
| 120 | 94 |
} |
| 121 |
|
|
| 122 |
Camera camera; |
|
| 123 | 95 |
|
| 124 | 96 |
/**************************************************************** |
| 125 | 97 |
* Public functions |
| 126 | 98 |
****************************************************************/ |
| 127 |
|
|
| 128 | 99 |
//Basic Methods |
| 129 | 100 |
void setup(); |
| 130 | 101 |
void update(); |
| ... | ... | |
| 151 | 122 |
void TouchUp( ofxTBetaCvBlob b ); |
| 152 | 123 |
|
| 153 | 124 |
//image processing stuff |
| 154 |
//void grabFrameToCPU(); //moved to Camera.h |
|
| 155 |
void applyImageFilters(); |
|
| 125 |
void grabFrameToCPU(); |
|
| 126 |
void grabFrameToGPU(GLuint target); |
|
| 156 | 127 |
|
| 157 |
//void grabFrameToGPU(GLuint target); //moved to Camera.h |
|
| 158 |
void applyGPUImageFilters(); |
|
| 159 |
void resetGPUTextures(); |
|
| 160 |
|
|
| 161 |
void bgCapture(ofxCvGrayscaleImage & _giLive); //Background Capture |
|
| 162 |
void learnBackground( ofxCvGrayscaleImage & _giLive, //Background Learn (bgCapture and dynamic Bg subtraction |
|
| 163 |
ofxCvGrayscaleImage & _grayBg, |
|
| 164 |
ofxCvFloatImage & _fiLearn, |
|
| 165 |
float _fLearnRate ); |
|
| 166 |
|
|
| 167 | 128 |
void drawToScreen(); |
| 168 | 129 |
void drawFingerOutlines(); |
| 169 | 130 |
|
| 170 | 131 |
//Other Methods |
| 171 | 132 |
void loadXMLSettings(); // Load Settings |
| 172 | 133 |
void saveConfiguration(); |
| 173 |
|
|
| 174 |
|
|
| 175 |
|
|
| 176 |
|
|
| 177 |
/**************************************************************** |
|
| 178 |
* Video Crap |
|
| 179 |
*****************************************************************/ |
|
| 180 |
//ofVideoPlayer vidPlayer; //this and grabber are in Camera.h |
|
| 181 |
|
|
| 182 |
|
|
| 183 | 134 |
|
| 135 |
/*************************************************************** |
|
| 136 |
* Video Settings |
|
| 137 |
***************************************************************/ |
|
| 138 |
ofVideoGrabber vidGrabber; |
|
| 139 |
ofVideoPlayer vidPlayer; |
|
| 140 |
|
|
| 184 | 141 |
/**************************************************************** |
| 185 | 142 |
* Variables in config.xml Settings file |
| 186 | 143 |
*****************************************************************/ |
| 187 |
|
|
| 188 |
//int deviceID; //moved to Camera.h |
|
| 144 |
int deviceID; |
|
| 189 | 145 |
int frameseq; |
| 190 | 146 |
int threshold; |
| 191 |
int blurValue; |
|
| 192 |
int blurGaussianValue; |
|
| 193 | 147 |
int wobbleThreshold; |
| 194 |
//int camRate; //moved |
|
| 195 |
//int camWidth; //to |
|
| 196 |
//int camHeight; //Camera.h |
|
| 148 |
int camRate; |
|
| 149 |
int camWidth; |
|
| 150 |
int camHeight; |
|
| 197 | 151 |
int winWidth; |
| 198 | 152 |
int winHeight; |
| 199 | 153 |
int minWidth; |
| 200 |
int minHeight; |
|
| 201 |
int highpassBlur; |
|
| 202 |
int highpassNoise; |
|
| 203 |
int highpassAmp; |
|
| 204 |
int smooth; |
|
| 154 |
int minHeight; |
|
| 205 | 155 |
|
| 206 | 156 |
bool showConfiguration; |
| 207 | 157 |
|
| 208 |
//bool bcamera; //moved to Camera.h |
|
| 158 |
bool bcamera; |
|
| 209 | 159 |
bool bDrawVideo; |
| 210 | 160 |
bool bFastMode; |
| 211 | 161 |
bool bShowInterface; |
| 212 | 162 |
bool bShowPressure; |
| 213 |
bool bLearnBakground; |
|
| 214 |
bool bInvertVideo; |
|
| 215 | 163 |
bool bDrawOutlines; |
| 216 | 164 |
bool bTUIOMode; |
| 217 | 165 |
bool bFullscreen; |
| ... | ... | |
| 220 | 168 |
bool bHorizontalMirror; |
| 221 | 169 |
bool bShowLabels; |
| 222 | 170 |
bool bNewFrame; |
| 223 |
|
|
| 224 | 171 |
//filters |
| 225 |
bool bHighpass; |
|
| 226 |
bool bAmplify; |
|
| 227 |
bool bThreshold; |
|
| 228 |
bool bSmooth; |
|
| 229 |
bool bDynamicBG; |
|
| 230 | 172 |
bool bAutoBackground; |
| 231 |
|
|
| 232 | 173 |
//modes |
| 233 | 174 |
bool bGPUMode; |
| 234 | 175 |
|
| 235 | 176 |
/**************************************************** |
| 236 | 177 |
*End config.xml variables |
| 237 | 178 |
*****************************************************/ |
| 238 |
|
|
| 239 | 179 |
bool activeInput; |
| 240 | 180 |
|
| 241 |
float fLearnRate;// rate to learn background |
|
| 242 |
|
|
| 243 | 181 |
//FPS variables |
| 244 | 182 |
int frames; |
| 245 | 183 |
int fps; |
| ... | ... | |
| 259 | 197 |
BlobTracker tracker; |
| 260 | 198 |
|
| 261 | 199 |
string tmpLocalHost; |
| 262 |
int tmpPort; |
|
| 200 |
int tmpPort; |
|
| 201 |
|
|
| 202 |
//---------------------------------------Blob Tracker |
|
| 203 |
ofxTouchFilter* filter; |
|
| 263 | 204 |
|
| 264 |
|
|
| 265 | 205 |
/**************************************************************** |
| 266 | 206 |
* Private Stuff |
| 267 |
****************************************************************/ |
|
| 268 |
|
|
| 207 |
****************************************************************/ |
|
| 269 | 208 |
string videoFileName; |
| 270 | 209 |
int maxBlobs; |
| 271 | 210 |
|
| ... | ... | |
| 276 | 215 |
|
| 277 | 216 |
//---------------------------------------Images |
| 278 | 217 |
CPUImageFilter processedImg; |
| 218 |
ofxCvColorImage sourceImg; |
|
| 279 | 219 |
|
| 280 |
//ofxCvColorImage sourceImg; //moved to Camera.h |
|
| 281 |
ofxCvGrayscaleImage grayImg; |
|
| 282 |
ofxCvGrayscaleImage grayBg; |
|
| 283 |
ofxCvGrayscaleImage subtractBg; |
|
| 284 |
ofxCvGrayscaleImage grayDiff; |
|
| 285 |
ofxCvGrayscaleImage highpassImg; |
|
| 286 |
ofxCvGrayscaleImage ampImg; |
|
| 287 |
|
|
| 288 |
//---------------------------------------Pressure Map |
|
| 289 |
ofxCvColorImage pressureMap; |
|
| 290 |
|
|
| 291 |
//---------------------------------------Background Subtraction |
|
| 292 |
ofxCvFloatImage fiLearn; |
|
| 293 |
|
|
| 294 | 220 |
//---------------------------------------XML Settings Vars (BLOATED) |
| 295 | 221 |
ofxXmlSettings XML; |
| 296 | 222 |
string message; |
| 297 | 223 |
|
| 298 | 224 |
//---------------------------------------FOR NETWORK |
| 299 | 225 |
TUIOOSC myTUIO; |
| 300 |
|
|
| 301 |
//---------------------------------------FOR gpuTracker |
|
| 302 |
GLuint gpuSourceTex; |
|
| 303 |
GLuint gpuBGTex; |
|
| 304 |
|
|
| 305 |
unsigned char * gpuReadBackBuffer; |
|
| 306 |
ofxCvColorImage gpuReadBackImage; |
|
| 307 |
ofxCvGrayscaleImage gpuReadBackImageGS; |
|
| 308 |
|
|
| 309 |
ImageFilter* contrastFilter; |
|
| 310 |
ImageFilter* subtractFilter; |
|
| 311 |
ImageFilter* subtractFilter2; //we need 2 because we are showing the output of each |
|
| 312 |
ImageFilter* gaussVFilter; |
|
| 313 |
ImageFilter* gaussVFilter2; |
|
| 314 |
ImageFilter* gaussHFilter; |
|
| 315 |
ImageFilter* gaussHFilter2; |
|
| 316 |
ImageFilter* threshFilter; |
|
| 317 | 226 |
}; |
| 318 | 227 |
|
| 319 | 228 |
#endif |
Also available in: Unified diff
