Update dataset loaders (#319)

* Update dataset loaders

* Set ngp default to blender
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-08-31 17:30:56 -07:00
1 parent 2a94afd9ec
commit 6ee6934581
6 files changed
+185 -113

No files matched your search

+23
View File
@@ -326,6 +326,29 @@ def viewmatrix(lookat, up, pos):
return m
def get_distortion_params(
k1: float = 0.0,
k2: float = 0.0,
k3: float = 0.0,
k4: float = 0.0,
p1: float = 0.0,
p2: float = 0.0,
):
"""Returns a distortion parameters matrix.
Args:
k1: The first radial distortion parameter.
k2: The second radial distortion parameter.
k3: The third radial distortion parameter.
k4: The fourth radial distortion parameter.
p1: The first tangential distortion parameter.
p2: The second tangential distortion parameter.
Returns:
torch.Tensor: A distortion parameters matrix.
"""
return torch.Tensor([k1, k2, k3, k4, p1, p2])
# Addapted from MultiNeRF
# https://github.com/google-research/multinerf/blob/b02228160d3179300c7d499dca28cb9ca3677f32/internal/camera_utils.py#L477-L509
def radial_and_tangential_undistort(