tarashakhurana / 4d-occ-forecasting

CVPR 2023: Official code for `Point Cloud Forecasting as a Proxy for 4D Occupancy Forecasting'

Home Page:https://www.cs.cmu.edu/~tkhurana/ff4d/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the ray direction

Korace0v0 opened this issue · comments

commented

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);

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!

commented

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!