diff --git a/pytorch3d/renderer/fisheyecameras.py b/pytorch3d/renderer/fisheyecameras.py index 3da558df3..c7fded663 100644 --- a/pytorch3d/renderer/fisheyecameras.py +++ b/pytorch3d/renderer/fisheyecameras.py @@ -60,7 +60,7 @@ class FishEyeCameras(CamerasBase): "world_coordinates", "use_radial", "use_tangential", - "use_tin_prism", + "use_thin_prism", "device", "image_size", ) @@ -171,7 +171,10 @@ def _project_points_batch( """ assert points.shape[-1] == 3, "points shape incorrect" - ab = points[..., :2] / points[..., 2:] + denom = points[..., 2:] + denom_sign = denom.sign() + (denom == 0).type_as(denom) + denom = denom_sign * torch.clamp(denom.abs(), self.epsilon) + ab = points[..., :2] / denom uv_distorted = ab r = ab.norm(dim=-1)