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