tarashakhurana / 4d-occ-forecasting

CVPR 2023: Official code for `Point Cloud Forecasting as a Proxy for 4D Occupancy Forecasting'
https://www.cs.cmu.edu/~tkhurana/ff4d/index.html
MIT License
215 stars 23 forks source link

About the ray direction #2

Closed Korace0v0 closed 1 year ago

Korace0v0 commented 1 year ago

Hi, thanks for your great work. I noticed that in dvr.cu , only setp>0 will be considered as the next voxel border. Will this be okay since in the Lidar axis, there are 360 directions which also contains the negative directions of rays? Looking forward to your help.


        // Distance along the ray to the next voxel border from the current position (tMaxX, tMaxY, tMaxZ).
        const double next_voxel_boundary_x = vx + (stepX < 0 ? 0 : 1);
        const double next_voxel_boundary_y = vy + (stepY < 0 ? 0 : 1);
        const double next_voxel_boundary_z = vz + (stepZ < 0 ? 0 : 1);
tarashakhurana commented 1 year ago

Hi, thanks for diving into our work! Hopefully the diagram of a 2D voxel grid below answers your doubt.

SmartSelect_20230423_132003_Samsung Notes

First of all, you can think of next_voxel_boundary as an intermediate quantity to computing tMax values. tMax is just storing the time to hit the next voxel boundaries in the x, y, z directions. "Time" is referred to as distance in the code. When you mark the voxel indices and the boundary values as in the figure above, the following observations are clear:

  1. For a ray moving in the positive x/y/z direction, the next x/y/z voxel boundary lies at an incremented voxel index
  2. For a ray moving in the negative x/y/z direction, the next x/y/z voxel boundary lies at the voxel index it is already at.

I think the confusing part is that we are conflating the indexing of voxels with the indexing of the voxel boundaries. For more in-depth understanding, I usually find this blogpost helpful: https://github.com/cgyurgyik/fast-voxel-traversal-algorithm/blob/master/overview/FastVoxelTraversalOverview.md. Let me know if something is not clear!

Korace0v0 commented 1 year ago

Many thanks! I understand it. next_voxel_boundary is just an intermediate quantity used to calculate tMax, and has nothing to do with the voxel index (vx, vy, vz) that the ray will reach. I just figured it out. Thanks for your kindly help again!