From f280b5942611a2fe77422aa2bef6ea0025915b28 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 24 Jun 2020 17:21:52 +0100 Subject: [PATCH 01/13] set window title --- GUI/Tools/GUI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GUI/Tools/GUI.h b/GUI/Tools/GUI.h index 05f4fc3a..baa915f9 100644 --- a/GUI/Tools/GUI.h +++ b/GUI/Tools/GUI.h @@ -72,7 +72,7 @@ class GUI { windowParams.Set("SAMPLE_BUFFERS", 0); windowParams.Set("SAMPLES", 0); - pangolin::CreateWindowAndBind("Main", width, height, windowParams); + pangolin::CreateWindowAndBind("Co-Fusion", width, height, windowParams); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); From 300bb7f42b0d7e63adebc1bbf11026612359125a Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Thu, 2 Jul 2020 18:22:29 +0100 Subject: [PATCH 02/13] update OpenCV API --- Core/Segmentation/Slic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Segmentation/Slic.h b/Core/Segmentation/Slic.h index 6ecdb7b8..ddfe2725 100644 --- a/Core/Segmentation/Slic.h +++ b/Core/Segmentation/Slic.h @@ -136,7 +136,7 @@ class Slic { assert(input.isContinuous()); assert(input.total() == spixelNum); - cv::Mat result = cv::Mat(slicInput->noDims[1], slicInput->noDims[0], cv::DataType::type); + cv::Mat result = cv::Mat(slicInput->noDims[1], slicInput->noDims[0], cv::traits::Type::value); Tout* resData = (Tout*)result.data; Tin* inData = (Tin*)input.data; @@ -173,7 +173,7 @@ class Slic { if (image.type() == CV_8UC3) image.copyTo(res); else if (image.type() == CV_8UC1) - cv::cvtColor(image, res, CV_GRAY2RGB); + cv::cvtColor(image, res, cv::COLOR_GRAY2RGB); else assert(0); if (swapRedBlue) cv::cvtColor(res, res, cv::COLOR_RGB2BGR); From a84ae61a2490832fc57881a98b80c6832344d8a6 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Mon, 10 Aug 2020 19:09:02 +0100 Subject: [PATCH 03/13] next frame with key 's' --- GUI/Tools/GUI.h | 1 + 1 file changed, 1 insertion(+) diff --git a/GUI/Tools/GUI.h b/GUI/Tools/GUI.h index baa915f9..e7913af5 100644 --- a/GUI/Tools/GUI.h +++ b/GUI/Tools/GUI.h @@ -268,6 +268,7 @@ class GUI { pangolin::RegisterKeyPressCallback('q', [&]() { savePoses->Ref().Set(true); }); pangolin::RegisterKeyPressCallback('w', [&]() { saveCloud->Ref().Set(true); }); pangolin::RegisterKeyPressCallback('e', [&]() { saveView->Ref().Set(true); }); + pangolin::RegisterKeyPressCallback('s', [&]() { step->Ref().Set(true); }); } virtual ~GUI() { From e5c56ec168696cc28499fd78c4e56c62f3568aed Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Mon, 24 Aug 2020 14:26:20 +0100 Subject: [PATCH 04/13] export inactive models --- Core/CoFusion.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/CoFusion.cpp b/Core/CoFusion.cpp index b880f405..cb68321a 100644 --- a/Core/CoFusion.cpp +++ b/Core/CoFusion.cpp @@ -753,6 +753,7 @@ void CoFusion::savePly() { }; for (auto& m : models) exportModelPLY(m); + for (auto& m : inactiveModels) exportModelPLY(m); } void CoFusion::exportPoses() { From 6da010b329540da1d68b7035239b8e2a74811adb Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 13 Oct 2020 15:19:03 +0100 Subject: [PATCH 05/13] fix 'class-memaccess' error by replacing C array with STL vector --- Core/CMakeLists.txt | 3 --- Core/Ferns.cpp | 9 +++++---- Core/Ferns.h | 22 ++++++++-------------- Core/Model/Deformation.cpp | 8 ++------ Core/Model/Deformation.h | 4 ++-- GUI/CMakeLists.txt | 3 --- 6 files changed, 17 insertions(+), 32 deletions(-) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 99044889..99228971 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -138,9 +138,6 @@ target_link_libraries(${PROJECT_NAME} set_target_properties(${PROJECT_NAME} PROPERTIES INTERFACE_LINK_LIBRARIES "") -# deactivate 'class-memaccess' error for direct memcpy of list of 'Eigen::Vector4f' -target_compile_options(${PROJECT_NAME} PRIVATE "-Wno-error=class-memaccess") - target_include_directories(${PROJECT_NAME} PUBLIC $ diff --git a/Core/Ferns.cpp b/Core/Ferns.cpp index 2b354d4a..2570b74f 100644 --- a/Core/Ferns.cpp +++ b/Core/Ferns.cpp @@ -79,8 +79,9 @@ bool Ferns::addFrame(GPUTexture* imageTexture, GPUTexture* vertexTexture, GPUTex resize.vertex(vertexTexture, verts); resize.vertex(normalTexture, norms); - Frame* frame = new Frame(num, frames.size(), pose, srcTime, width * height, (unsigned char*)img.data, (Eigen::Vector4f*)verts.data, - (Eigen::Vector4f*)norms.data); + Frame* frame = new Frame(num, frames.size(), pose, srcTime, width * height, (unsigned char*)img.data, + std::vector(verts.data, verts.data + (width * height)), + std::vector(norms.data, norms.data + (width * height))); int* coOccurrences = new int[frames.size()]; @@ -202,10 +203,10 @@ Eigen::Matrix4f Ferns::findFrame(std::vector& constraints, co if (minId != -1 && blockHDAware(frame, frames.at(minId)) > 0.3) { Eigen::Matrix4f fernPose = frames.at(minId)->pose; - vertFern.texture->Upload(frames.at(minId)->initVerts, GL_RGBA, GL_FLOAT); + vertFern.texture->Upload(frames.at(minId)->initVerts.data(), GL_RGBA, GL_FLOAT); vertCurrent.texture->Upload(vertSmall.data, GL_RGBA, GL_FLOAT); - normFern.texture->Upload(frames.at(minId)->initNorms, GL_RGBA, GL_FLOAT); + normFern.texture->Upload(frames.at(minId)->initNorms.data(), GL_RGBA, GL_FLOAT); normCurrent.texture->Upload(normSmall.data, GL_RGBA, GL_FLOAT); // colorFern.texture->Upload(frames.at(minId)->initRgb, GL_RGB, GL_UNSIGNED_BYTE); diff --git a/Core/Ferns.h b/Core/Ferns.h index edb814be..57213301 100644 --- a/Core/Ferns.h +++ b/Core/Ferns.h @@ -63,8 +63,8 @@ class Ferns { class Frame { public: Frame(int n, int id, const Eigen::Matrix4f& pose, const int srcTime, const int numPixels, unsigned char* rgb = 0, - Eigen::Vector4f* verts = 0, Eigen::Vector4f* norms = 0) - : goodCodes(0), id(id), pose(pose), srcTime(srcTime), initRgb(rgb), initVerts(verts), initNorms(norms) { + const std::vector &verts = {}, const std::vector &norms = {}) + : goodCodes(0), id(id), pose(pose), srcTime(srcTime), initRgb(rgb) { codes = new unsigned char[n]; if (rgb) { @@ -72,14 +72,12 @@ class Ferns { memcpy(this->initRgb, rgb, numPixels * 3); } - if (verts) { - this->initVerts = new Eigen::Vector4f[numPixels]; - memcpy(this->initVerts, verts, numPixels * sizeof(Eigen::Vector4f)); + if (!verts.empty()) { + this->initVerts = verts; } - if (norms) { - this->initNorms = new Eigen::Vector4f[numPixels]; - memcpy(this->initNorms, norms, numPixels * sizeof(Eigen::Vector4f)); + if (!norms.empty()) { + this->initNorms = norms; } } @@ -87,10 +85,6 @@ class Ferns { delete[] codes; if (initRgb) delete[] initRgb; - - if (initVerts) delete[] initVerts; - - if (initNorms) delete[] initNorms; } unsigned char* codes; @@ -99,8 +93,8 @@ class Ferns { Eigen::Matrix4f pose; const int srcTime; unsigned char* initRgb; - Eigen::Vector4f* initVerts; - Eigen::Vector4f* initNorms; + std::vector initVerts; + std::vector initNorms; }; std::vector frames; diff --git a/Core/Model/Deformation.cpp b/Core/Model/Deformation.cpp index 8559d6ec..d691f446 100644 --- a/Core/Model/Deformation.cpp +++ b/Core/Model/Deformation.cpp @@ -25,12 +25,9 @@ Deformation::Deformation() sampleProgram(loadProgramGeomFromFile("sample.vert", "sample.geom")), bufferSize(1024), // max nodes basically count(0), - vertices(new Eigen::Vector4f[bufferSize]), + vertices(size_t(bufferSize)), graphPosePoints(new std::vector), lastDeformTime(0) { - // x, y, z and init time - memset(&vertices[0], 0, bufferSize); - glGenTransformFeedbacks(1, &fid); glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); @@ -51,7 +48,6 @@ Deformation::Deformation() } Deformation::~Deformation() { - delete[] vertices; glDeleteTransformFeedbacks(1, &fid); glDeleteBuffers(1, &vbo); glDeleteQueries(1, &countQuery); @@ -252,7 +248,7 @@ void Deformation::sampleGraphModel(const OutputBuffer& model) { if ((int)count > def.k) { glBindBuffer(GL_ARRAY_BUFFER, vbo); - glGetBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Eigen::Vector4f) * count, vertices); + glGetBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(Eigen::Vector4f) * count, vertices.data()); glBindBuffer(GL_ARRAY_BUFFER, 0); diff --git a/Core/Model/Deformation.h b/Core/Model/Deformation.h index cfa86e14..5eb993d6 100644 --- a/Core/Model/Deformation.h +++ b/Core/Model/Deformation.h @@ -76,7 +76,7 @@ class Deformation { /*std::vector > & poseGraph,*/ const bool relaxGraph, std::vector* newRelativeCons = 0); - Eigen::Vector4f* getVertices() { return vertices; } + Eigen::Vector4f* getVertices() { return vertices.data(); } int getCount() { return int(count); } @@ -96,7 +96,7 @@ class Deformation { const int bufferSize; GLuint countQuery; unsigned int count; - Eigen::Vector4f* vertices; + std::vector vertices; // x, y, z and init time std::vector > poseGraphPoints; std::vector graphPoseTimes; diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt index 3513ccd5..f5671460 100644 --- a/GUI/CMakeLists.txt +++ b/GUI/CMakeLists.txt @@ -62,9 +62,6 @@ target_link_libraries(CoFusion ${JPEG_LIBRARIES} ) -# deactivate 'class-memaccess' error for direct memcpy of list of 'Eigen::Vector4f' -target_compile_options(CoFusion PRIVATE "-Wno-error=class-memaccess") - add_library(CoFusionTools SHARED ${tools_srcs}) From b14c2fc2d35fb41eaa9879733e63ef7984a0bf51 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 13 Oct 2020 15:33:45 +0100 Subject: [PATCH 06/13] enable more warnings as errors --- CMakeLists.txt | 5 ++--- Core/CMakeLists.txt | 1 - GUI/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af7c564c..46226040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,8 @@ project(cofusion) set(CMAKE_CXX_STANDARD 14) # Warnings / Errors -add_compile_options(-Wall -Wno-unused-function -Wno-unused-variable - -Wno-unused-but-set-variable -Wno-unused-but-set-variable -Wno-write-strings - -Wno-deprecated -Wno-deprecated-declarations -Werror -Wno-unknown-pragmas) +add_compile_options(-Wall -Werror -Wno-unused-variable -Wno-write-strings + -Wno-deprecated -Wno-deprecated-declarations) # Don't follow symlinks when FILE GLOB_RECURSE (and don't warn) cmake_policy(SET CMP0009 NEW) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 99228971..75a90b77 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -102,7 +102,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug) else(CMAKE_BUILD_TYPE MATCHES Release) message(STATUS "Release build.") add_compile_options(-O3) - add_compile_options(-Wno-maybe-uninitialized) endif(CMAKE_BUILD_TYPE MATCHES Debug) add_library(${PROJECT_NAME} SHARED diff --git a/GUI/CMakeLists.txt b/GUI/CMakeLists.txt index f5671460..cdada296 100644 --- a/GUI/CMakeLists.txt +++ b/GUI/CMakeLists.txt @@ -38,7 +38,6 @@ if(CMAKE_BUILD_TYPE MATCHES Debug) else(CMAKE_BUILD_TYPE MATCHES Release) message(STATUS "Release build.") add_compile_options(-O3) - add_compile_options(-Wno-maybe-uninitialized) endif(CMAKE_BUILD_TYPE MATCHES Debug) add_definitions(-Dlinux=1) From fcf58c8fcdeec88d5efd68fc9c2059839c3808ec Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 13 Oct 2020 16:29:04 +0100 Subject: [PATCH 07/13] replace deprecated '__shfl_down' with '__shfl_down_sync' --- CMakeLists.txt | 2 +- Core/Cuda/reduce.cu | 122 +++++++++++++++++--------------------------- 2 files changed, 49 insertions(+), 75 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 46226040..69def0c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_CXX_STANDARD 14) # Warnings / Errors add_compile_options(-Wall -Werror -Wno-unused-variable -Wno-write-strings - -Wno-deprecated -Wno-deprecated-declarations) + -Wno-deprecated-declarations) # Don't follow symlinks when FILE GLOB_RECURSE (and don't warn) cmake_policy(SET CMP0009 NEW) diff --git a/Core/Cuda/reduce.cu b/Core/Cuda/reduce.cu index 9109890f..6dc5e75a 100644 --- a/Core/Cuda/reduce.cu +++ b/Core/Cuda/reduce.cu @@ -53,32 +53,6 @@ #include "convenience.cuh" #include "operators.cuh" -#if __CUDA_ARCH__ < 300 || __CUDA_ARCH__ > 700 -__inline__ __device__ -float __shfl_down(float val, int offset, int width = 32) -{ - static __shared__ float shared[MAX_THREADS]; - int lane = threadIdx.x % 32; - shared[threadIdx.x] = val; - __syncthreads(); - val = (lane + offset < width) ? shared[threadIdx.x + offset] : 0; - __syncthreads(); - return val; -} - -__inline__ __device__ -int __shfl_down(int val, int offset, int width = 32) -{ - static __shared__ int shared[MAX_THREADS]; - int lane = threadIdx.x % 32; - shared[threadIdx.x] = val; - __syncthreads(); - val = (lane + offset < width) ? shared[threadIdx.x + offset] : 0; - __syncthreads(); - return val; -} -#endif - #if __CUDA_ARCH__ < 350 template __device__ __forceinline__ T __ldg(const T* ptr) @@ -91,41 +65,41 @@ __inline__ __device__ JtJJtrSE3 warpReduceSum(JtJJtrSE3 val) { for(int offset = warpSize / 2; offset > 0; offset /= 2) { - val.aa += __shfl_down(val.aa, offset); - val.ab += __shfl_down(val.ab, offset); - val.ac += __shfl_down(val.ac, offset); - val.ad += __shfl_down(val.ad, offset); - val.ae += __shfl_down(val.ae, offset); - val.af += __shfl_down(val.af, offset); - val.ag += __shfl_down(val.ag, offset); - - val.bb += __shfl_down(val.bb, offset); - val.bc += __shfl_down(val.bc, offset); - val.bd += __shfl_down(val.bd, offset); - val.be += __shfl_down(val.be, offset); - val.bf += __shfl_down(val.bf, offset); - val.bg += __shfl_down(val.bg, offset); - - val.cc += __shfl_down(val.cc, offset); - val.cd += __shfl_down(val.cd, offset); - val.ce += __shfl_down(val.ce, offset); - val.cf += __shfl_down(val.cf, offset); - val.cg += __shfl_down(val.cg, offset); - - val.dd += __shfl_down(val.dd, offset); - val.de += __shfl_down(val.de, offset); - val.df += __shfl_down(val.df, offset); - val.dg += __shfl_down(val.dg, offset); - - val.ee += __shfl_down(val.ee, offset); - val.ef += __shfl_down(val.ef, offset); - val.eg += __shfl_down(val.eg, offset); - - val.ff += __shfl_down(val.ff, offset); - val.fg += __shfl_down(val.fg, offset); - - val.residual += __shfl_down(val.residual, offset); - val.inliers += __shfl_down(val.inliers, offset); + val.aa += __shfl_down_sync(0xFFFFFFFF, val.aa, offset); + val.ab += __shfl_down_sync(0xFFFFFFFF, val.ab, offset); + val.ac += __shfl_down_sync(0xFFFFFFFF, val.ac, offset); + val.ad += __shfl_down_sync(0xFFFFFFFF, val.ad, offset); + val.ae += __shfl_down_sync(0xFFFFFFFF, val.ae, offset); + val.af += __shfl_down_sync(0xFFFFFFFF, val.af, offset); + val.ag += __shfl_down_sync(0xFFFFFFFF, val.ag, offset); + + val.bb += __shfl_down_sync(0xFFFFFFFF, val.bb, offset); + val.bc += __shfl_down_sync(0xFFFFFFFF, val.bc, offset); + val.bd += __shfl_down_sync(0xFFFFFFFF, val.bd, offset); + val.be += __shfl_down_sync(0xFFFFFFFF, val.be, offset); + val.bf += __shfl_down_sync(0xFFFFFFFF, val.bf, offset); + val.bg += __shfl_down_sync(0xFFFFFFFF, val.bg, offset); + + val.cc += __shfl_down_sync(0xFFFFFFFF, val.cc, offset); + val.cd += __shfl_down_sync(0xFFFFFFFF, val.cd, offset); + val.ce += __shfl_down_sync(0xFFFFFFFF, val.ce, offset); + val.cf += __shfl_down_sync(0xFFFFFFFF, val.cf, offset); + val.cg += __shfl_down_sync(0xFFFFFFFF, val.cg, offset); + + val.dd += __shfl_down_sync(0xFFFFFFFF, val.dd, offset); + val.de += __shfl_down_sync(0xFFFFFFFF, val.de, offset); + val.df += __shfl_down_sync(0xFFFFFFFF, val.df, offset); + val.dg += __shfl_down_sync(0xFFFFFFFF, val.dg, offset); + + val.ee += __shfl_down_sync(0xFFFFFFFF, val.ee, offset); + val.ef += __shfl_down_sync(0xFFFFFFFF, val.ef, offset); + val.eg += __shfl_down_sync(0xFFFFFFFF, val.eg, offset); + + val.ff += __shfl_down_sync(0xFFFFFFFF, val.ff, offset); + val.fg += __shfl_down_sync(0xFFFFFFFF, val.fg, offset); + + val.residual += __shfl_down_sync(0xFFFFFFFF, val.residual, offset); + val.inliers += __shfl_down_sync(0xFFFFFFFF, val.inliers, offset); } return val; @@ -188,20 +162,20 @@ __inline__ __device__ JtJJtrSO3 warpReduceSum(JtJJtrSO3 val) { for(int offset = warpSize / 2; offset > 0; offset /= 2) { - val.aa += __shfl_down(val.aa, offset); - val.ab += __shfl_down(val.ab, offset); - val.ac += __shfl_down(val.ac, offset); - val.ad += __shfl_down(val.ad, offset); + val.aa += __shfl_down_sync(0xFFFFFFFF, val.aa, offset); + val.ab += __shfl_down_sync(0xFFFFFFFF, val.ab, offset); + val.ac += __shfl_down_sync(0xFFFFFFFF, val.ac, offset); + val.ad += __shfl_down_sync(0xFFFFFFFF, val.ad, offset); - val.bb += __shfl_down(val.bb, offset); - val.bc += __shfl_down(val.bc, offset); - val.bd += __shfl_down(val.bd, offset); + val.bb += __shfl_down_sync(0xFFFFFFFF, val.bb, offset); + val.bc += __shfl_down_sync(0xFFFFFFFF, val.bc, offset); + val.bd += __shfl_down_sync(0xFFFFFFFF, val.bd, offset); - val.cc += __shfl_down(val.cc, offset); - val.cd += __shfl_down(val.cd, offset); + val.cc += __shfl_down_sync(0xFFFFFFFF, val.cc, offset); + val.cd += __shfl_down_sync(0xFFFFFFFF, val.cd, offset); - val.residual += __shfl_down(val.residual, offset); - val.inliers += __shfl_down(val.inliers, offset); + val.residual += __shfl_down_sync(0xFFFFFFFF, val.residual, offset); + val.inliers += __shfl_down_sync(0xFFFFFFFF, val.inliers, offset); } return val; @@ -690,8 +664,8 @@ __inline__ __device__ int2 warpReduceSum(int2 val) { for(int offset = warpSize / 2; offset > 0; offset /= 2) { - val.x += __shfl_down(val.x, offset); - val.y += __shfl_down(val.y, offset); + val.x += __shfl_down_sync(0xFFFFFFFF, val.x, offset); + val.y += __shfl_down_sync(0xFFFFFFFF, val.y, offset); } return val; From 2043879913fa3d54b35851ee30bbfe5a7faa8212 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 13 Oct 2020 17:03:05 +0100 Subject: [PATCH 08/13] fix 'unused-variable' warnings --- CMakeLists.txt | 3 +-- Core/Segmentation/Segmentation.cpp | 1 - GUI/Tools/GroundTruthOdometry.cpp | 3 +++ GUI/Tools/PangolinReader.cpp | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69def0c5..14ca7451 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,8 +4,7 @@ project(cofusion) set(CMAKE_CXX_STANDARD 14) # Warnings / Errors -add_compile_options(-Wall -Werror -Wno-unused-variable -Wno-write-strings - -Wno-deprecated-declarations) +add_compile_options(-Wall -Werror -Wno-write-strings -Wno-deprecated-declarations) # Don't follow symlinks when FILE GLOB_RECURSE (and don't warn) cmake_policy(SET CMP0009 NEW) diff --git a/Core/Segmentation/Segmentation.cpp b/Core/Segmentation/Segmentation.cpp index 04b8282d..b6410bf5 100644 --- a/Core/Segmentation/Segmentation.cpp +++ b/Core/Segmentation/Segmentation.cpp @@ -147,7 +147,6 @@ SegmentationResult Segmentation::performSegmentationCRF(std::list Date: Tue, 14 Sep 2021 14:26:27 +0100 Subject: [PATCH 09/13] remove unused pangolin header --- Core/CoFusion.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Core/CoFusion.h b/Core/CoFusion.h index 581957fb..74f7b4b6 100644 --- a/Core/CoFusion.h +++ b/Core/CoFusion.h @@ -39,7 +39,6 @@ #include #include #include -#include class CoFusion { public: From 5abc4812108c5263122d708486506690c221df7c Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 14 Sep 2021 14:26:43 +0100 Subject: [PATCH 10/13] adapt to Pangolin API changes --- Core/Shaders/FeedbackBuffer.h | 2 +- GUI/MainController.cpp | 58 +++++++++++++++++------------------ GUI/Tools/GUI.h | 25 ++++++--------- 3 files changed, 40 insertions(+), 45 deletions(-) diff --git a/Core/Shaders/FeedbackBuffer.h b/Core/Shaders/FeedbackBuffer.h index ea94a840..c5aea0b2 100644 --- a/Core/Shaders/FeedbackBuffer.h +++ b/Core/Shaders/FeedbackBuffer.h @@ -25,7 +25,7 @@ #include "../Utils/Resolution.h" #include "../Utils/Intrinsics.h" #include -#include +#include /// A feedback buffer holds one vertex per pixel (see uvo) class FeedbackBuffer { diff --git a/GUI/MainController.cpp b/GUI/MainController.cpp index b01eedea..70ec1cc9 100644 --- a/GUI/MainController.cpp +++ b/GUI/MainController.cpp @@ -216,32 +216,32 @@ MainController::MainController(int argc, char* argv[]) showcaseMode = Parse::get().arg(argc, argv, "-sc", empty) > -1; gui = new GUI(logFile.length() == 0, showcaseMode); - if (Parse::get().arg(argc, argv, "-d", tmpFloat) > -1) gui->depthCutoff->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-i", tmpFloat) > -1) gui->icpWeight->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-or", tmpFloat) > -1) gui->outlierCoefficient->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-segMinNew", tmpFloat) > -1) gui->minRelSizeNew->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-segMaxNew", tmpFloat) > -1) gui->maxRelSizeNew->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-crfRGB", tmpFloat) > -1) gui->pairwiseRGBSTD->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-crfDepth", tmpFloat) > -1) gui->pairwiseDepthSTD->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-crfPos", tmpFloat) > -1) gui->pairwisePosSTD->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-crfAppearance", tmpFloat) > -1) gui->pairwiseAppearanceWeight->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-crfSmooth", tmpFloat) > -1) gui->pairwiseSmoothnessWeight->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-offset", tmpFloat) > -1) gui->modelSpawnOffset->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-thNew", tmpFloat) > -1) gui->thresholdNew->Ref().Set(tmpFloat); - if (Parse::get().arg(argc, argv, "-k", tmpFloat) > -1) gui->unaryErrorK->Ref().Set(tmpFloat); - - gui->flipColors->Ref().Set(logReader->flipColors); - gui->rgbOnly->Ref().Set(false); - gui->enableMultiModel->Ref().Set(Parse::get().arg(argc, argv, "-static", empty) <= -1); - gui->enableSmartDelete->Ref().Set(Parse::get().arg(argc, argv, "-keep", empty) <= -1); - gui->pyramid->Ref().Set(true); - gui->fastOdom->Ref().Set(fastOdom); - // gui->confidenceThreshold->Ref().Set(confidence); - gui->so3->Ref().Set(so3); - gui->frameToFrameRGB->Ref().Set(frameToFrameRGB); - gui->pause->Ref().Set((Parse::get().arg(argc, argv, "-run", empty) <= -1)); - // gui->pause->Ref().Set(logFile.length()); - // gui->pause->Ref().Set(!showcaseMode); + if (Parse::get().arg(argc, argv, "-d", tmpFloat) > -1) gui->depthCutoff->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-i", tmpFloat) > -1) gui->icpWeight->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-or", tmpFloat) > -1) gui->outlierCoefficient->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-segMinNew", tmpFloat) > -1) gui->minRelSizeNew->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-segMaxNew", tmpFloat) > -1) gui->maxRelSizeNew->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-crfRGB", tmpFloat) > -1) gui->pairwiseRGBSTD->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-crfDepth", tmpFloat) > -1) gui->pairwiseDepthSTD->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-crfPos", tmpFloat) > -1) gui->pairwisePosSTD->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-crfAppearance", tmpFloat) > -1) gui->pairwiseAppearanceWeight->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-crfSmooth", tmpFloat) > -1) gui->pairwiseSmoothnessWeight->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-offset", tmpFloat) > -1) gui->modelSpawnOffset->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-thNew", tmpFloat) > -1) gui->thresholdNew->Ref()->Set(tmpFloat); + if (Parse::get().arg(argc, argv, "-k", tmpFloat) > -1) gui->unaryErrorK->Ref()->Set(tmpFloat); + + gui->flipColors->Ref()->Set(logReader->flipColors); + gui->rgbOnly->Ref()->Set(false); + gui->enableMultiModel->Ref()->Set(Parse::get().arg(argc, argv, "-static", empty) <= -1); + gui->enableSmartDelete->Ref()->Set(Parse::get().arg(argc, argv, "-keep", empty) <= -1); + gui->pyramid->Ref()->Set(true); + gui->fastOdom->Ref()->Set(fastOdom); + // gui->confidenceThreshold->Ref()->Set(confidence); + gui->so3->Ref()->Set(so3); + gui->frameToFrameRGB->Ref()->Set(frameToFrameRGB); + gui->pause->Ref()->Set((Parse::get().arg(argc, argv, "-run", empty) <= -1)); + // gui->pause->Ref()->Set(logFile.length()); + // gui->pause->Ref()->Set(!showcaseMode); resizeStream = new GPUResize(Resolution::getInstance().width(), Resolution::getInstance().height(), Resolution::getInstance().width() / 2, Resolution::getInstance().height() / 2); @@ -388,7 +388,7 @@ void MainController::run() { } if (coFusion->processFrame(logReader->getFrameData(), currentPose, weightMultiplier) && !showcaseMode) { - gui->pause->Ref().Set(true); + gui->pause->Ref()->Set(true); } if (exportLabels) { @@ -430,11 +430,11 @@ void MainController::run() { std::stringstream stri; stri << coFusion->getModelToModel().lastICPCount; - gui->trackInliers->Ref().Set(stri.str()); + gui->trackInliers->Ref()->Set(stri.str()); std::stringstream stre; stre << (std::isnan(coFusion->getModelToModel().lastICPError) ? 0 : coFusion->getModelToModel().lastICPError); - gui->trackRes->Ref().Set(stre.str()); + gui->trackRes->Ref()->Set(stre.str()); if (!gui->pause->Get()) { gui->resLog.Log((std::isnan(coFusion->getModelToModel().lastICPError) ? std::numeric_limits::max() diff --git a/GUI/Tools/GUI.h b/GUI/Tools/GUI.h index e7913af5..bdb8640a 100644 --- a/GUI/Tools/GUI.h +++ b/GUI/Tools/GUI.h @@ -67,12 +67,7 @@ class GUI { width += widthPanel; - pangolin::Params windowParams; - - windowParams.Set("SAMPLE_BUFFERS", 0); - windowParams.Set("SAMPLES", 0); - - pangolin::CreateWindowAndBind("Co-Fusion", width, height, windowParams); + pangolin::CreateWindowAndBind("Co-Fusion", width, height); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); @@ -260,15 +255,15 @@ class GUI { pangolin::RegisterKeyPressCallback(' ', pangolin::SetVarFunctor("ui.Reset", true)); } - pangolin::RegisterKeyPressCallback('p', [&]() { pause->Ref().Set(!pause->Get()); }); - pangolin::RegisterKeyPressCallback('c', [&]() { drawColors->Ref().Set(!drawColors->Get()); }); - pangolin::RegisterKeyPressCallback('l', [&]() { drawLabelColors->Ref().Set(!drawLabelColors->Get()); }); - pangolin::RegisterKeyPressCallback('x', [&]() { drawFxaa->Ref().Set(!drawFxaa->Get()); }); - pangolin::RegisterKeyPressCallback('f', [&]() { followPose->Ref().Set(!followPose->Get()); }); - pangolin::RegisterKeyPressCallback('q', [&]() { savePoses->Ref().Set(true); }); - pangolin::RegisterKeyPressCallback('w', [&]() { saveCloud->Ref().Set(true); }); - pangolin::RegisterKeyPressCallback('e', [&]() { saveView->Ref().Set(true); }); - pangolin::RegisterKeyPressCallback('s', [&]() { step->Ref().Set(true); }); + pangolin::RegisterKeyPressCallback('p', [&]() { pause->Ref()->Set(!pause->Get()); }); + pangolin::RegisterKeyPressCallback('c', [&]() { drawColors->Ref()->Set(!drawColors->Get()); }); + pangolin::RegisterKeyPressCallback('l', [&]() { drawLabelColors->Ref()->Set(!drawLabelColors->Get()); }); + pangolin::RegisterKeyPressCallback('x', [&]() { drawFxaa->Ref()->Set(!drawFxaa->Get()); }); + pangolin::RegisterKeyPressCallback('f', [&]() { followPose->Ref()->Set(!followPose->Get()); }); + pangolin::RegisterKeyPressCallback('q', [&]() { savePoses->Ref()->Set(true); }); + pangolin::RegisterKeyPressCallback('w', [&]() { saveCloud->Ref()->Set(true); }); + pangolin::RegisterKeyPressCallback('e', [&]() { saveView->Ref()->Set(true); }); + pangolin::RegisterKeyPressCallback('s', [&]() { step->Ref()->Set(true); }); } virtual ~GUI() { From ae6f36550102547134228f8e3a9e2a0f5ca1867e Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Mon, 23 May 2022 11:30:21 +0100 Subject: [PATCH 11/13] fix "gSLICr" dependency name --- package.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.xml b/package.xml index a73b7d95..64a633ce 100644 --- a/package.xml +++ b/package.xml @@ -43,16 +43,16 @@ cmake eigen - gSLICr + gslicr densecrf libboost-dev pangolin eigen - gSLICr + gslicr libboost-dev pangolin eigen - gSLICr + gslicr densecrf libboost-dev pangolin From cb032f8e2ec8eaaf2b2a1525b17cff1386418288 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 24 May 2022 13:51:37 +0100 Subject: [PATCH 12/13] add suitesparse --- package.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.xml b/package.xml index 64a633ce..3c3ee2ec 100644 --- a/package.xml +++ b/package.xml @@ -47,15 +47,18 @@ densecrf libboost-dev pangolin + suitesparse eigen gslicr libboost-dev pangolin + suitesparse eigen gslicr densecrf libboost-dev pangolin + suitesparse cmake From 392d991e4b296a3a181429ada4a1a8fc35baeee3 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Tue, 24 May 2022 14:31:03 +0100 Subject: [PATCH 13/13] add libopenni2-dev --- package.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.xml b/package.xml index 3c3ee2ec..b7afc47d 100644 --- a/package.xml +++ b/package.xml @@ -48,17 +48,20 @@ libboost-dev pangolin suitesparse + libopenni2-dev eigen gslicr libboost-dev pangolin suitesparse + libopenni2-dev eigen gslicr densecrf libboost-dev pangolin suitesparse + libopenni2-dev cmake