mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-05 23:38:42 +08:00
1 parent
695d9a1777
commit
25c8fc31a8
1 file changed
+4
-2
@@ -26,6 +26,7 @@ import torchvision
|
|||||||
from torch.nn.functional import normalize
|
from torch.nn.functional import normalize
|
||||||
from torchtyping import TensorType
|
from torchtyping import TensorType
|
||||||
|
|
||||||
|
from nerfactory.cameras import utils as camera_utils
|
||||||
from nerfactory.cameras.rays import RayBundle
|
from nerfactory.cameras.rays import RayBundle
|
||||||
|
|
||||||
|
|
||||||
@@ -187,13 +188,14 @@ class Cameras:
|
|||||||
|
|
||||||
distortion_params = None
|
distortion_params = None
|
||||||
if self.distortion_params is not None:
|
if self.distortion_params is not None:
|
||||||
|
distortion_params = self.distortion_params[camera_indices]
|
||||||
if distortion_params_delta is not None:
|
if distortion_params_delta is not None:
|
||||||
distortion_params = self.distortion_params[camera_indices] + distortion_params_delta
|
distortion_params = distortion_params + distortion_params_delta
|
||||||
elif distortion_params_delta is not None:
|
elif distortion_params_delta is not None:
|
||||||
distortion_params = distortion_params_delta
|
distortion_params = distortion_params_delta
|
||||||
|
|
||||||
if distortion_params is not None:
|
if distortion_params is not None:
|
||||||
raise NotImplementedError("Camera distortion not implemented.")
|
coord_stack = camera_utils.radial_and_tangential_undistort(coord_stack, distortion_params)
|
||||||
|
|
||||||
if self.camera_type == CameraType.PERSPECTIVE:
|
if self.camera_type == CameraType.PERSPECTIVE:
|
||||||
directions_stack = torch.stack(
|
directions_stack = torch.stack(
|
||||||
|
|||||||
Reference in new issue
Block a user