Open zhangliyin126 opened 4 years ago
Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.
I can confirm this bug. It caused random artifacts using voxel_grid_occlusion_estimation.hpp... The provided solution fixed it for me.
@nilsgr I checked voxel_grid_occlusion_estimation.hpp, and getCentroidIndexAt
is used in three places: one, two, three
But in all three places, the for/while loops make sure that the values passed to getCentroidIndexAt
are okay with respect to minb and maxb. Can you say which values minb and maxb have in your case?
Your Environment
Context
Here is original code
If you retrieve points out of voxel grids, and let's see its ijk[0] is large, you will get a index with wrong number rather than -1, due to its use of idx.
Solution
Directly check ijk, add following code to getCentroidIndexAt function: if (ijk[0]<minb[0] || ijk[0]>maxb[0] || ijk[1]<minb[1] || ijk[1]> maxb[1] || ijk[2]<minb[2] || ijk[2]>maxb[2]) return (-1);