diff --git a/src/BlobFinder.cpp b/src/BlobFinder.cpp index 06d4f749014f666e45aca2a7362205082e771670..3378baad4466567f1a893d85453f09c8fe72796a 100644 --- a/src/BlobFinder.cpp +++ b/src/BlobFinder.cpp @@ -52,6 +52,9 @@ void BlobFinder::initGUI(ofxGui &gui){ blobGuiGroup->add(eyeInset.set("EyeInset", .8, 0, 1)); panel->loadFromFile("trackings.xml"); + + bool visible = false; + panel->setVisible(visible); } void BlobFinder::allocate(int &value){ diff --git a/src/SkeletonFinder.cpp b/src/SkeletonFinder.cpp index 3802826a3b49a5d5ac13022258f81760b4bae18a..dce56fb28ed49168dc1109d02d9ead0260f3d312 100644 --- a/src/SkeletonFinder.cpp +++ b/src/SkeletonFinder.cpp @@ -12,7 +12,7 @@ void SkeletonFinder::initGUI(ofxGui& gui) { panel = gui.addPanel(); panel->loadTheme("theme/theme_light.json"); - panel->setName("Tracking..."); + panel->setName("Tracking"); sensorBoxLeft.addListener(this, &SkeletonFinder::updateSensorBox); sensorBoxRight.addListener(this, &SkeletonFinder::updateSensorBox); @@ -22,7 +22,7 @@ void SkeletonFinder::initGUI(ofxGui& gui) { sensorBoxBottom.addListener(this, &SkeletonFinder::updateSensorBox); sensorBoxGuiGroup = panel->addGroup("SensorBox"); - sensorBoxGuiGroup->add(filtering.set("Filtering", true)); + sensorBoxGuiGroup->add(filtering.set("Filtering", false)); sensorBoxGuiGroup->add(sensorBoxLeft.set("left", 1000)); sensorBoxGuiGroup->add(sensorBoxRight.set("right", -1000)); sensorBoxGuiGroup->add(sensorBoxFront.set("front", 1000)); @@ -31,6 +31,9 @@ void SkeletonFinder::initGUI(ofxGui& gui) { sensorBoxGuiGroup->add(sensorBoxBottom.set("bottom", 1000)); panel->loadFromFile("trackings.xml"); + + bool visible = false; + panel->setVisible(visible); } void SkeletonFinder::setTransformMatrix(ofMatrix4x4* mat) { diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 9b5d0527243c1460fdb85c2fa6525a42694e83d9..06a5bbdb84a020217b4f2d48a3e792edef309390 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -168,8 +168,6 @@ void ofApp::setup(){ #else nuitracker->run(); #endif - - bPreviewPointCloud = false; ofLog(OF_LOG_NOTICE) << "MainAPP: setting up networking..."; networkMng.setup(gui); @@ -179,8 +177,6 @@ void ofApp::setup(){ capMesh.reSize(4); ofLog(OF_LOG_NOTICE) << "Setup over"; - - lastSettingsWriteTime = boost::filesystem::last_write_time(networkSettingsPath); } //-------------------------------------------------------------- @@ -192,9 +188,6 @@ void ofApp::setupViewports(){ device->setWidth(MENU_WIDTH / 2); device->setPosition(ofGetWidth() - MENU_WIDTH / 2, ofGetHeight() / 2); #endif - - networkMng.panel->setWidth(MENU_WIDTH / 2); - networkMng.panel->setPosition(ofGetWidth() - MENU_WIDTH / 2, 20); } #ifdef BLOB @@ -249,15 +242,15 @@ void ofApp::update(){ ofBackground(100, 100, 100); - checkSettingsUpdate(); - #ifdef BLOB if(realSense->update(ofxRealSenseTwo::PointCloud::VIDEO)) { - if (bUpdateImageMask) { + if (maskUpdatesCounter < MASK_UPDATE_CYCLES) { tracker.captureMaskBegin(); drawCapturePointCloud(true); tracker.captureMaskEnd(); + + maskUpdatesCounter++; } else { // Cature captureCloud to FBO tracker.captureBegin(); @@ -302,16 +295,6 @@ void ofApp::loadSettings() #endif } -void ofApp::checkSettingsUpdate() { - std::time_t newLastWriteTime = boost::filesystem::last_write_time(networkSettingsPath); - - if (newLastWriteTime > lastSettingsWriteTime) { - lastSettingsWriteTime = newLastWriteTime; - - loadSettings(); - } -} - void ofApp::draw() { ofSetColor(255, 255, 255); @@ -460,13 +443,9 @@ void ofApp::createHelp(){ helpStream << "press v -> to show visualizations\n"; helpStream << "press 1 - 3 -> to change the viewport\n"; helpStream << "press p -> to show pointcloud\n"; + helpStream << "\n"; helpStream << "press h -> to show help \n"; - helpStream << "press s -> to save current settings.\n"; helpStream << "press l -> to load last saved settings\n"; -#ifdef BLOB - helpStream << "press m -> to update mask image (currently" << - (bUpdateImageMask ? " " : " not ") << "updating)\n"; -#endif help = helpStream.str(); } @@ -499,15 +478,6 @@ void ofApp::keyPressed(int key){ createHelp(); } break; - - case 'm': -#ifdef BLOB - bUpdateImageMask = !bUpdateImageMask; - if (bUpdateImageMask) { - tracker.clearMask(); - } -#endif - break; case '1': iMainCamera = 0; diff --git a/src/ofApp.h b/src/ofApp.h index 11315b19cb5668c536828d7b4a619d6676884696..69fc23584107f1e015739b054fbb31b5511a050f 100644 --- a/src/ofApp.h +++ b/src/ofApp.h @@ -38,6 +38,7 @@ #define REALSENSE_VIDEO_WIDTH 848 #define REALSENSE_VIDEO_HEIGHT 480 +#define MASK_UPDATE_CYCLES 100 #define N_MEASURMENT_CYCLES 10 using namespace std; @@ -77,7 +78,7 @@ public: ofTrueTypeFont monosm; vector stroke; - bool bShowVisuals = true; + bool bShowVisuals = false; ////////////////// // NETWORK // @@ -113,7 +114,7 @@ public: ofShader shader; BlobFinder tracker; - bool bUpdateImageMask = false; + int maskUpdatesCounter = 0; #else @@ -129,7 +130,7 @@ public: bool dispRaw; - bool bPreviewPointCloud; + bool bPreviewPointCloud = false; CaptureMeshArray capMesh; @@ -168,11 +169,7 @@ public: ofParameter captureVideo; void saveSettings(); - void loadSettings(); - - void checkSettingsUpdate(); - const boost::filesystem::path networkSettingsPath = ofFilePath::getAbsolutePath("broadcast.xml"); - std::time_t lastSettingsWriteTime; + void loadSettings(); ////////// // HELP //