From 5512f8052afeb8ad222bfa0f331c76b47c2b408b Mon Sep 17 00:00:00 2001 From: Sebastian Hahta <joseha@utu.fi> Date: Thu, 13 Jun 2019 14:12:15 +0300 Subject: [PATCH] mask left area (max_disp) --- components/rgbd-sources/src/algorithms/fixstars_sgm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp b/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp index 1267b168e..cbba8cb47 100644 --- a/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp +++ b/components/rgbd-sources/src/algorithms/fixstars_sgm.cpp @@ -42,8 +42,11 @@ void FixstarsSGM::compute(const cv::Mat &l, const cv::Mat &r, cv::Mat &disp) { // todo: fix libSGM (return float data or provide mask separately) // disparity values set to (256 << 5) in libSGM consistency check Mat bad_pixels = (disp == (256 << 5)); - disp.setTo(0, bad_pixels); + disp.setTo(0, bad_pixels); + Mat left_pixels(cv::Rect(0, 0, max_disp_, disp.rows)); + left_pixels = 0; + if (use_filter_) { cv::cuda::GpuMat l_gpu, disp_gpu, disp_gpu_out; // parameters need benchmarking, impact of image -- GitLab