From d2d1c7d30111ceecc9a61deece1b95bf72675798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20B=C3=BCrki?= Date: Thu, 9 Jul 2020 14:54:47 +0200 Subject: [PATCH 1/5] Remove "file watcher" --- src/ofApp.cpp | 17 ----------------- src/ofApp.h | 6 +----- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 9b5d052..8cddf1f 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -179,8 +179,6 @@ void ofApp::setup(){ capMesh.reSize(4); ofLog(OF_LOG_NOTICE) << "Setup over"; - - lastSettingsWriteTime = boost::filesystem::last_write_time(networkSettingsPath); } //-------------------------------------------------------------- @@ -192,9 +190,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,8 +244,6 @@ void ofApp::update(){ ofBackground(100, 100, 100); - checkSettingsUpdate(); - #ifdef BLOB if(realSense->update(ofxRealSenseTwo::PointCloud::VIDEO)) { @@ -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); diff --git a/src/ofApp.h b/src/ofApp.h index 11315b1..dcbd262 100644 --- a/src/ofApp.h +++ b/src/ofApp.h @@ -168,11 +168,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 // -- GitLab From 6b155d407e30713484fe6dd73f37f53701e85bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20B=C3=BCrki?= Date: Thu, 9 Jul 2020 14:55:07 +0200 Subject: [PATCH 2/5] Rename setting for consistency --- src/SkeletonFinder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SkeletonFinder.cpp b/src/SkeletonFinder.cpp index 3802826..a1c1ac7 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)); -- GitLab From b80e8c3c58de4d75b40ac4e629512fcbbbec0f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20B=C3=BCrki?= Date: Thu, 9 Jul 2020 14:56:08 +0200 Subject: [PATCH 3/5] Turn bounding box panel invisible --- src/BlobFinder.cpp | 3 +++ src/SkeletonFinder.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/BlobFinder.cpp b/src/BlobFinder.cpp index 06d4f74..3378baa 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 a1c1ac7..dce56fb 100644 --- a/src/SkeletonFinder.cpp +++ b/src/SkeletonFinder.cpp @@ -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) { -- GitLab From e5cfd93c68398f539190168c3874e5bb2d827c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20B=C3=BCrki?= Date: Thu, 9 Jul 2020 15:02:38 +0200 Subject: [PATCH 4/5] Set mask update to happen at startup --- src/ofApp.cpp | 19 ++++--------------- src/ofApp.h | 3 ++- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 8cddf1f..22e3da1 100644 --- a/src/ofApp.cpp +++ b/src/ofApp.cpp @@ -247,10 +247,12 @@ void ofApp::update(){ #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(); @@ -443,13 +445,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(); } @@ -482,15 +480,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 dcbd262..2dacfd8 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; @@ -113,7 +114,7 @@ public: ofShader shader; BlobFinder tracker; - bool bUpdateImageMask = false; + int maskUpdatesCounter = 0; #else -- GitLab From d22c1642507f06f671e2d7b99c07cae391afb76b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20B=C3=BCrki?= Date: Thu, 9 Jul 2020 15:05:02 +0200 Subject: [PATCH 5/5] Disable visual output by default --- src/ofApp.cpp | 2 -- src/ofApp.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ofApp.cpp b/src/ofApp.cpp index 22e3da1..06a5bbd 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); diff --git a/src/ofApp.h b/src/ofApp.h index 2dacfd8..69fc235 100644 --- a/src/ofApp.h +++ b/src/ofApp.h @@ -78,7 +78,7 @@ public: ofTrueTypeFont monosm; vector stroke; - bool bShowVisuals = true; + bool bShowVisuals = false; ////////////////// // NETWORK // @@ -130,7 +130,7 @@ public: bool dispRaw; - bool bPreviewPointCloud; + bool bPreviewPointCloud = false; CaptureMeshArray capMesh; -- GitLab