Skip to content

Commit 162d07d

Browse files
committed
Merge pull request #1833 from savuor:fix/odometry_tests
2 parents c6f783c + bc5a06a commit 162d07d

File tree

3 files changed

+430
-22
lines changed

3 files changed

+430
-22
lines changed

modules/rgbd/src/normal.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,13 @@ namespace rgbd
283283
Vec3T *row_B = B[0];
284284
for (; row_r != row_r_end; ++row_r, ++row_B, ++row_V)
285285
{
286-
if (cvIsNaN(*row_r))
287-
*row_B = Vec3T();
286+
Vec3T val = (*row_V) / (*row_r);
287+
if(cvIsInf(val[0]) || cvIsNaN(val[0]) ||
288+
cvIsInf(val[1]) || cvIsNaN(val[1]) ||
289+
cvIsInf(val[2]) || cvIsNaN(val[2]))
290+
*row_B = Vec3T();
288291
else
289-
*row_B = (*row_V) / (*row_r);
292+
*row_B = val;
290293
}
291294

292295
// Apply a box filter to B

0 commit comments

Comments
 (0)