From 3d09f4d4f3fe791432a835bb35bf70801aecc2fc Mon Sep 17 00:00:00 2001 From: "simon.fanetti" <simon.fanetti@etu.hesge.ch> Date: Tue, 11 Aug 2020 15:41:55 +0200 Subject: [PATCH] add comment --- src/components/projection.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/projection.cpp b/src/components/projection.cpp index 93bdd06..21988dc 100644 --- a/src/components/projection.cpp +++ b/src/components/projection.cpp @@ -172,6 +172,8 @@ void Projection::buildFrame(cv::Mat_<float> &depth, cv::Mat_<cv::Point2i> &frame /* fill with value of the 1st non null neighbour + Fixe only the holes formed by the deprojection round up coordinates (because deproject goes from 3D floats values to 2D uint), + not the big deprojection (like a hand moving above the sand). */ void Projection::holeFilling(cv::Mat_<cv::Vec3b> &dst, cv::Mat_<cv::Point2i> &frameMap){ @@ -183,8 +185,8 @@ void Projection::holeFilling(cv::Mat_<cv::Vec3b> &dst, cv::Mat_<cv::Point2i> &fr cv::Vec3b color; bool found = false; - for(int d_y = -1; d_y <= 1 && !found; d_y++){ - for(int d_x = -1; d_x <= 1 && !found; d_x++){ + for(int d_y = -1; d_y <= 1; d_y++){ + for(int d_x = -1; d_x <= 1; d_x++){ if(!(d_x == 0 && d_y == 0)){ @@ -193,9 +195,12 @@ void Projection::holeFilling(cv::Mat_<cv::Vec3b> &dst, cv::Mat_<cv::Point2i> &fr if( ((0 <= x && x < dst.cols) && (0 <= y && y < dst.rows)) && (frameMap.at<cv::Point2i>(y,x) != cv::Point2i(-1,-1)) ){ color = dst.at<cv::Vec3b>(y,x); found = true; + break; } } } + if(found) + break; } if(found){ -- GitLab