google / mipnerf

Apache License 2.0
894 stars 109 forks source link

Is dx (or base_radius of cone) all the same for rays of different pixel in a picture? #42

Open qhdqhd opened 1 year ago

qhdqhd commented 1 year ago

`

Distance from each unit-norm direction vector to its x-axis neighbor.

dx = [
    np.sqrt(np.sum((v[:-1, :, :] - v[1:, :, :])**2, -1)) for v in directions
]

dx = [np.concatenate([v, v[-2:-1, :]], 0) for v in dx]

# Cut the distance in half, and then round it out so that it's
# halfway between inscribed by / circumscribed about the pixel.

radii = [v[..., None] * 2 / np.sqrt(12) for v in dx]`
qhdqhd commented 1 year ago

@jonbarron thanks!