From 38f46874aed044d2d7f0b4ae093b41636c7a7a45 Mon Sep 17 00:00:00 2001 From: batters21 Date: Mon, 1 Feb 2021 15:31:04 +0300 Subject: [PATCH] issue 2817 fixed --- modules/rgbd/src/kinfu_frame.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/rgbd/src/kinfu_frame.cpp b/modules/rgbd/src/kinfu_frame.cpp index ce160dd5f3c..76d80902b7b 100644 --- a/modules/rgbd/src/kinfu_frame.cpp +++ b/modules/rgbd/src/kinfu_frame.cpp @@ -623,8 +623,9 @@ void makeFrameFromDepth(InputArray _depth, // looks like OpenCV's bilateral filter works the same as KinFu's Depth smooth; - - bilateralFilter(depth, smooth, kernelSize, sigmaDepth*depthFactor, sigmaSpatial); + Depth depthNoNans = depth.clone(); + patchNaNs(depthNoNans); + bilateralFilter(depthNoNans, smooth, kernelSize, sigmaDepth*depthFactor, sigmaSpatial); // depth truncation can be used in some scenes Depth depthThreshold;