Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Use normalized direction vector or not? #43

Open
qhdqhd opened this issue Dec 30, 2022 · 1 comment
Open

Use normalized direction vector or not? #43

qhdqhd opened this issue Dec 30, 2022 · 1 comment

Comments

@qhdqhd
Copy link

qhdqhd commented Dec 30, 2022

AS you said: in

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

BUT you use directions (not-norm) rather than viewdirs (unit-norm):

directions = ((camera_dirs[None, ..., None, :] *
self.camtoworlds[:, None, None, :3, :3]).sum(axis=-1))
origins = np.broadcast_to(self.camtoworlds[:, None, None, :3, -1],
directions.shape)
viewdirs = directions / np.linalg.norm(directions, axis=-1, keepdims=True)
# Distance from each unit-norm direction vector to its x-axis neighbor.
dx = np.sqrt(
np.sum((directions[:, :-1, :, :] - directions[:, 1:, :, :])**2, -1))

This is different,right?
dx = np.sqrt(
np.sum((directions[:, :-1, :, :] - directions[:, 1:, :, :])**2, -1))
dx = np.concatenate([dx, dx[:, -2:-1, :]], 1)
# Cut the distance in half, and then round it out so that it's
# halfway between inscribed by / circumscribed about the pixel.
radii = dx[..., None] * 2 / np.sqrt(12)

If you use directions (not-norm) ,dx (or radii) will be the same for different pixel rays in the image .
If you use viewdirs (unit-norm), dx (or radii) will be smaller for pixel rays away from image center, and bigger for pixel rays around image center.

@qhdqhd qhdqhd changed the title something I don't understand Use normalized direction vector or not? Dec 30, 2022
@qhdqhd
Copy link
Author

qhdqhd commented Dec 30, 2022

@jonbarron Help me please,thank you!

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

No branches or pull requests

1 participant