Open qihangGH opened 1 year ago
Hi, @qihangGH.
I think the inconsistency came from the original NeRF paper & implementation; so called 'Stratified Sampling'. The original volume rendering equation explains the integral of continuous functions.
But we don't have a continuous function but only neural radiance fields. So, we sample some discrete points to optimize the whole continuous scene. In this manner, we try to mimic the continuous integral by adding randomness to sample points.
From original NeRF paper:
Thank you.
Hi @sunset1995, thanks for the great work!
I have a question about the intervals in dmpigo. When sampling the points on rays, as shown by a code fragment of the function
sample_ndc_pts_on_rays_cuda_kernel
inrender_utils_kernel.cu
,the sample interval is
1 / (N_samples-1)
times the length of the vectorrays_d
. The length ofrays_d
varies for different rays, so the sample interval is different among rays.When rendering a ray, the interval is
interval = render_kwargs['stepsize'] * self.voxel_size_ratio
as defined in theforward
method of the dmpigo class. It is a constant and so the interval in the rendering is the same for all rays.I wonder why it is inconsistent in sampling and rendering. Great appreciate it if you can give some explanations.