From 75342649fa63b89d6306e6de969cdd517b7be643 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Sat, 26 Nov 2022 18:03:12 -0800 Subject: [PATCH] getDepth: return invalid depth when value is zero (for float depth images) --- src/ros/FindObjectROS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ros/FindObjectROS.cpp b/src/ros/FindObjectROS.cpp index 01bd6cd8..8650ab5f 100644 --- a/src/ros/FindObjectROS.cpp +++ b/src/ros/FindObjectROS.cpp @@ -332,7 +332,7 @@ cv::Vec3f FindObjectROS::getDepth(const cv::Mat & depthImage, else { depth = depthImage.at(y,x); - isValid = std::isfinite(depth); + isValid = std::isfinite(depth) && depth > 0.0f; } // Check for invalid measurements