Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about the intervals in dmpigo #51

Open
qihangGH opened this issue Jan 4, 2023 · 1 comment
Open

Question about the intervals in dmpigo #51

qihangGH opened this issue Jan 4, 2023 · 1 comment

Comments

@qihangGH
Copy link

qihangGH commented Jan 4, 2023

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 in render_utils_kernel.cu,

const float dist = ((float)i_step) / (N_samples-1);
const float px = rays_o[offset_r  ] + rays_d[offset_r  ] * dist;
const float py = rays_o[offset_r+1] + rays_d[offset_r+1] * dist;
const float pz = rays_o[offset_r+2] + rays_d[offset_r+2] * dist;

the sample interval is 1 / (N_samples-1) times the length of the vector rays_d. The length of rays_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 the forward 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.

@sangminkim-99
Copy link

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.

image

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:
image

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants