From f6a23b8eb7b5105c81ba9e321c868f7c5f8bf038 Mon Sep 17 00:00:00 2001 From: jcjackch <877024951@qq.com> Date: Tue, 24 Oct 2023 17:19:43 +0200 Subject: [PATCH 1/2] Update fisheyecameras.py Typo fix --- pytorch3d/renderer/fisheyecameras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch3d/renderer/fisheyecameras.py b/pytorch3d/renderer/fisheyecameras.py index 3da558df3..0c960bfec 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", ) From 8c7e3cf07a82c7dca6b7deea96474bb70d5869bb Mon Sep 17 00:00:00 2001 From: jcjackch <877024951@qq.com> Date: Thu, 26 Oct 2023 13:01:06 +0200 Subject: [PATCH 2/2] Update fisheyecameras.py To prevent overflow in fisheye distortion --- pytorch3d/renderer/fisheyecameras.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytorch3d/renderer/fisheyecameras.py b/pytorch3d/renderer/fisheyecameras.py index 0c960bfec..c7fded663 100644 --- a/pytorch3d/renderer/fisheyecameras.py +++ b/pytorch3d/renderer/fisheyecameras.py @@ -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)