From deec703d696b5d7b842dcf4bf3752f8563ee06c0 Mon Sep 17 00:00:00 2001
From: Sebastian Hahta <joseha@utu.fi>
Date: Wed, 26 Jun 2019 16:08:31 +0300
Subject: [PATCH] libsgm uniqueness config option

---
 components/rgbd-sources/src/algorithms/fixstars_sgm.cpp | 3 +--
 components/rgbd-sources/src/algorithms/fixstars_sgm.hpp | 1 +
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp b/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp
index daa1a335b..f8f578778 100644
--- a/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp
+++ b/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp
@@ -12,9 +12,8 @@ using cv::cuda::GpuMat;
 
 FixstarsSGM::FixstarsSGM(nlohmann::json &config) : Disparity(config) {
 	ssgm_ = nullptr;
+	uniqueness_ = value("uniqueness", 0.95f);
 	use_filter_ = value("use_filter", false);
-	// note: (max_disp_ << 4) libsgm subpixel accuracy.
-	//       What is the impact in the filter? (possible artifacts)
 	filter_ = cv::cuda::createDisparityBilateralFilter(max_disp_ << 4, value("filter_radius", 25), value("filter_iter", 1));
 }
 
diff --git a/components/rgbd-sources/src/algorithms/fixstars_sgm.hpp b/components/rgbd-sources/src/algorithms/fixstars_sgm.hpp
index dfbae8411..200775cf3 100644
--- a/components/rgbd-sources/src/algorithms/fixstars_sgm.hpp
+++ b/components/rgbd-sources/src/algorithms/fixstars_sgm.hpp
@@ -35,6 +35,7 @@ class FixstarsSGM : public ftl::rgbd::detail::Disparity {
 	}
 
 	private:
+	float uniqueness_;
 	bool use_filter_;
 	cv::Ptr<cv::cuda::DisparityBilateralFilter> filter_;
 	sgm::StereoSGM *ssgm_;
-- 
GitLab