Fisheye Lens
This tutorial introduces the Fisheye Lens, a sensor that projects 3D scene points onto the image plane using
a distinct perspective transformation. Unlike standard lenses, a fisheye lens captures a wide field of view,
often up to 180 degrees, creating a hemispherical projection that heavily distorts peripheral areas. This
projection closely mimics the human eye and is widely used in photography, surveillance, and VR to achieve
immersive, ultra-wide-angle images. The unique mapping of fisheye lenses emphasizes peripheral details,
making it ideal for applications requiring maximum scene coverage.
Agenda:
- Fisheye lens model
- FisheyeLens basic usage
Scene setup
Let's use custom scene composer to set up the scene.
from skyrenderer.cases.utils import SensorSceneComposer
scene_composer = SensorSceneComposer(antialiasing_level=1)
scene_composer.setup_scene()
scene_composer.reset_camera_position([0, 0, -5])
renderer_context = scene_composer.renderer_context
2025-02-14 11:55:21,943 | skyrenderer.scene.renderer_context | INFO: Root paths: - root path: /home/skyengine/anaconda/lib/python3.6/site-packages/skyrenderer - assets path: /dli/mount/assets - config path: /home/skyengine/anaconda/lib/python3.6/site-packages/skyrenderer/config - gpu sources path: /home/skyengine/anaconda/lib/python3.6/site-packages/skyrenderer/optix_sources/sources - cache path: /dli/mount/cache - ptx cache path: compiled_ptx/ptx - ocio path: ocio_configs/aces_1.2/config.ocio
FisheyeLens basic usage
In our implementation of the FisheyeLens, we can adjust a bunch of parameters, however in this tutorial we will
present only basic usage - how to set up fisheye lens in rendering pipeline. For more information about
parameters, check out SENSOR_FisheyeLensParameters tutorial and FisheyeLens class documentation.
FisheyeLens setup and visualization
Lens is one of the parameters of the CameraRenderStep class which is the base class of all cameras in SkyRenderer,
thus we can easily change lens model of the camera separately from overall camera definition.
from skyrenderer.render_chain import RenderChain, VisibleLightRenderStep, Denoiser
from skyrenderer.render_chain.camera_steps.Lens.fisheye_lens import FisheyeLens
lens = FisheyeLens(renderer_context)
rs = VisibleLightRenderStep(
renderer_context,
lens=lens,
origin_name="camera_CAM_NUL",
target_name="top_node",
)
renderer_context.define_render_chain(
RenderChain(render_steps=[rs, Denoiser(renderer_context)], width=1600, height=1000)
)
scene_composer.visualize()
2025-02-14 11:55:22,534 | skyrenderer.utils.time_measurement | INFO: Setup time: 546 ms 2025-02-14 11:55:23,055 | skyrenderer.utils.time_measurement | INFO: Context update time: 521 ms 2025-02-14 11:55:23,902 | skyrenderer.utils.time_measurement | INFO: Key points calculation time: 0 ms 2025-02-14 11:55:23,903 | skyrenderer.utils.time_measurement | INFO: Render time: 846 ms
Summary
In this section you have learnt:
- Fisheye camera lens is the model of lens that captures a wide field of view, often up to 180 degrees, creating
a hemispherical projection that heavily distorts peripheral areas. - FisheyeLens in SkyRenderer is the parameter of CameraRenderStep (and, by extension, VisibleLightRenderStep).