Skip to content

Commit

Permalink
Added fisheye62 projection_type to undistort (mapillary#957)
Browse files Browse the repository at this point in the history
Summary:
The projection_type for the Fisheye62 cameras was missing in the switch-statements.

Pull Request resolved: mapillary#957

Reviewed By: YanNoun

Differential Revision: D41580786

Pulled By: fabianschenk

fbshipit-source-id: 2bf5cf758fadd1643f289bf77e3c770de1c84691
  • Loading branch information
kielnino authored and facebook-github-bot committed Nov 29, 2022
1 parent 28d2add commit bfa0249
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions opensfm/undistort.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@ def undistort_reconstruction(
elif shot.camera.projection_type == "brown":
urec.add_camera(perspective_camera_from_brown(shot.camera))
subshots = [get_shot_with_different_camera(urec, shot, image_format)]
elif shot.camera.projection_type in ["fisheye", "fisheye_opencv"]:
elif shot.camera.projection_type == "fisheye":
urec.add_camera(perspective_camera_from_fisheye(shot.camera))
subshots = [get_shot_with_different_camera(urec, shot, image_format)]
elif shot.camera.projection_type == "fisheye_opencv":
urec.add_camera(perspective_camera_from_fisheye_opencv(shot.camera))
subshots = [get_shot_with_different_camera(urec, shot, image_format)]
elif shot.camera.projection_type == "fisheye62":
urec.add_camera(perspective_camera_from_fisheye62(shot.camera))
subshots = [get_shot_with_different_camera(urec, shot, image_format)]
elif pygeometry.Camera.is_panorama(shot.camera.projection_type):
subshot_width = int(data.config["depthmap_resolution"])
subshots = perspective_views_of_a_panorama(
Expand Down Expand Up @@ -173,7 +179,7 @@ def undistort_image(
return {}

projection_type = shot.camera.projection_type
if projection_type in ["perspective", "brown", "fisheye", "fisheye_opencv"]:
if projection_type in ["perspective", "brown", "fisheye", "fisheye_opencv", "fisheye62"]:
[undistorted_shot] = undistorted_shots
new_camera = undistorted_shot.camera
height, width = original.shape[:2]
Expand Down

0 comments on commit bfa0249

Please sign in to comment.