mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
allows to fall back to the pytorch undistortion
This commit is contained in:
1 parent
abd7558119
commit
cd78b782b0
1 file changed
+6
-6
@@ -654,16 +654,16 @@ class Cameras(TensorDataclass):
|
|||||||
).reshape(-1, 2)
|
).reshape(-1, 2)
|
||||||
else:
|
else:
|
||||||
# try to use nerfacc to accelerate if we don't need to optimize distortion params
|
# try to use nerfacc to accelerate if we don't need to optimize distortion params
|
||||||
# try:
|
try:
|
||||||
coord_stack[coord_mask, :] = opencv_lens_undistortion(
|
coord_stack[coord_mask, :] = opencv_lens_undistortion(
|
||||||
coord_stack[coord_mask, :].reshape(3, -1, 2),
|
coord_stack[coord_mask, :].reshape(3, -1, 2),
|
||||||
distortion_params[mask, :],
|
distortion_params[mask, :],
|
||||||
).reshape(-1, 2)
|
).reshape(-1, 2)
|
||||||
# except:
|
except:
|
||||||
# coord_stack[coord_mask, :] = camera_utils.radial_and_tangential_undistort(
|
coord_stack[coord_mask, :] = camera_utils.radial_and_tangential_undistort(
|
||||||
# coord_stack[coord_mask, :].reshape(3, -1, 2),
|
coord_stack[coord_mask, :].reshape(3, -1, 2),
|
||||||
# distortion_params[mask, :],
|
distortion_params[mask, :],
|
||||||
# ).reshape(-1, 2)
|
).reshape(-1, 2)
|
||||||
|
|
||||||
mask = (self.camera_type[true_indices] == CameraType.FISHEYE.value).squeeze(-1) # (num_rays)
|
mask = (self.camera_type[true_indices] == CameraType.FISHEYE.value).squeeze(-1) # (num_rays)
|
||||||
coord_mask = torch.stack([mask, mask, mask], dim=0)
|
coord_mask = torch.stack([mask, mask, mask], dim=0)
|
||||||
|
|||||||
Reference in new issue
Block a user