getDepth: return invalid depth when value is zero (for float depth images)

This commit is contained in:
matlabbe 2022-11-26 18:03:12 -08:00
parent 3dae0999bb
commit 75342649fa

View File

@ -332,7 +332,7 @@ cv::Vec3f FindObjectROS::getDepth(const cv::Mat & depthImage,
else
{
depth = depthImage.at<float>(y,x);
isValid = std::isfinite(depth);
isValid = std::isfinite(depth) && depth > 0.0f;
}
// Check for invalid measurements