Stray light analysis of an optical system and image quality assessment require consideration of the lens geometries and the optomechanical components that constrain them. Due to a high number of ray-object interactions inside the camera system, simulations using all camera geometries take more time or require more rays to achieve the same level of signal compared to simulations using a Speos Camera sensor based on a Reduced Order Model (ROM). The Speos Camera sensor approximates the camera system using a Reduced Order Model, considering only the chief rays (main optical path sequence). In contrast, simulations that include the geometries of the complete camera system allow for the assessment and analysis of stray light from secondary optical paths (higher-order sequences) caused by unintended sources of light reaching the sensor.
Overview
The purpose of the Physical Camera sensor is to accelerate the simulation of the entire camera system within a 3D scene by introducing an aiming area on the first optical surface and accounting for stray light contributions from predetermined ray path sequences based on overall or peak energy. The Physical Camera sensor enables the analysis and separation of these sequences in the result.
Working principle:
The Physical Camera sensor is compatible with direct and inverse simulations.
- Direct simulations are recommended for scenarios with individual or "non-ambient" light sources (Ray-file, Luminaire, Surface, Display), to get ghost effects, for instance.
- Inverse simulations are recommended for scenarios with ambient light sources (without sun). Since 1 pass of an inverse corresponds to one ray/pixel, per sequence, per wavelength, it is recommended to focus on the main optical path (first sequence) to get the ambient contribution.
- Results from direct and inverse simulations can be combined in post-processing.
The Physical Camera sensor can be operated in two modes: either without a sequence file (Mode 1) or with a sequence file included in the sensor (Mode 2), depending on the use-case.
Mode 1 - Without a Sequence File: In this mode, Speos uses a standard Monte-Carlo ray propagation engine to simulate a 3D scene and the optical system. It considers specular and scattering interactions within the optical and optomechanical system. To increase the probability of rays entering the optical system's aperture for a direct simulation, an aiming area (bounding box) is introduced at the first face of the optical system to direct the rays towards it. This approach is also compatible with wide FOV lenses (e.g., "Fish-Eye lenses") since rays entering from wide angles are also efficiently traced. Speos performs importance sampling towards the aiming area on all scattering surfaces. The power of the aimed rays is then rebalanced to ensure unbiased results.
In scenarios where the optical system contains many elements, ray convergence can still take a long time, especially for sequences other than the main optical path.
Setup for Mode 2: During the first simulation with the Physical Camera sensor, an *.OptSequence file is generated in the “Speos output” directory. This file contains a list of ray path sequences sorted by energy. It can be used in a subsequent simulation with the Speos Physical Camera sensor to allow faster result convergence using a predefined number of sequences (Mode 2).
Note: The Physical Camera sensor is compatible with direct and inverse simulations. The content of the *.OptSequence file depends on the simulation type. An *.OptSequence file generated with a direct simulation can only be used as input in a direct simulation and vice versa.
Mode 2 - With a Sequence File: The Physical Camera sensor, including a sequence file, takes advantage of the aiming area and performs optimized ray propagation inside the optical system on the most energetic ray path sequences (included in the sequence file) with a deterministic raytracing algorithm considering only specular interactions (transmission and reflection). To achieve high convergence for the secondary sequences, the same number of rays is launched for each individual sequence. The number of sequences can be specified in the definition panel of the Physical Camera sensor. This enables quick visualization of ghost reflections (lens flare), caused by specular reflections on the optically polished lens faces, even when high-resolution irradiance (image) sensors are used. By changing the active "Layer" in the result, the contribution of each sequence can be displayed and separately evaluated.
Note: Sequences including non-specular interactions are changed to specular interactions. This might lead to incorrect results.
To illustrate the performance gain of using a Physical Camera sensor over a conventional simulation of the complete camera system with an irradiance sensor, a test chart image was simulated, and the image quality of the first three sequences was compared.
The Physical Camera results demonstrate a significant performance improvement (~x100) compared to a conventional simulation, closely matching the image quality in Sequence 1, with noticeable gains in reduced noise and detail in Sequences 2 and 3 (especially with Mode 2). This highlights the effectiveness of the Physical Camera sensor in reducing simulation time while maintaining high image quality for a predefined number of sequences.
The Physical Camera sensor is suitable for camera applications where considerations regarding lens flare and stray light are crucial, as these factors can negatively impact the optical performance and final image quality. Furthermore, it can drastically reduce simulation time for use cases involving a camera system with a transparent lens cover.
Guide - How to set up a Physical Camera sensor?
In the following example, we are going through the workflow to set up and run simulations, including a Physical Camera sensor.
Prerequisites:
- Optional: Import the lens system from Ansys Zemax OpticStudio via .odx file exchange to Speos (Described here in Step 3a).
- Definition of the reference axis system for the Light Box and Physical Camera sensor.
Step 1: Setup of the Physical Camera sensor
- Generation of a Light Box (containing all geometries related to the camera system, lenses, and, if available, optomechanical parts).
- Definition of the Physical Camera sensor.
Step 2: Stray light simulation without a sequence file (Mode 1).
Step 3: Stray light simulation with a sequence file (Mode 2).
Before proceeding, it is highly recommended to read this article: "Stray Light Analysis - Smartphone Camera"
[[NOTES:]] Software Prerequisites
To follow this example, ensure the following tools are installed on your computer:
- Ansys Speos 2024 R1 SP2 or Ansys Speos 2024R2.
Data: The dataset can be downloaded here: "How_to_setup_Physical_Camera_Sensor_start_data.zip"
Note: The "Start" dataset can be used to follow the step by step instructions. The folder includes a .html link to download the "End" dataset including all simulation results.
How to set up and use the Physical Camera sensor
Prerequisites (not required for the example dataset):
-
Optional: Import the lens system from Ansys Zemax OpticStudio via .odx file exchange to Speos (Described here in Step 3a). The optomechanical components can be imported from external CAD tools or designed natively in Speos, thanks to its direct modeling capabilities.
-
Definition of the reference axis system for the Light Box and Physical Camera sensor:
-
The origin of the reference axis system for the Light Box and Physical Camera sensor needs to be placed with a small offset (in the -z direction) in front of the first lens face. To avoid any tangency issues, an offset of 10x Geometrical Distance Tolerance (GDT) is recommended.
- The axis system of the Light Box must be defined so the optical axis of the lens system follows the Z axis.
-
Step 1: Setup of the Physical Camera sensor
Generation of a Light Box:
In the first step, we will prepare the export of the Speos Light Box (containing the lens stack (.odx) and the optomechanics), which will be used as input for the Physical Camera sensor. The Speos Light Box component is a meshed representation of the geometries including their material properties. Running consecutive simulations with a Speos Light Box will save initialization time because the geometry included doesn’t need to be remeshed before the simulation.
Furthermore, the Speos Light Box can be "black-boxed" and shared with camera integrator or OEM.
Note: The mesh settings of the .odx component included in the Light Box must be defined within the options of the .odx component itself. They are accessible by right-clicking > Options.
ODX mesh settings cannot be redefined in the meshing settings of the Light Box component. After applying any changes to the meshing, the Light Box must be recomputed.
Note: ODX is a file container that includes the optical elements' design and associated material information. Therefore, it needs to be selected from the Speos "Simulation panel."
Tip for easier selection: You can hide the "Optical Design Exchange.1" component from the structure panel, then select all geometries in the 3D view and add the "Optical Design Exchange.1" component from the simulation panel while pressing Ctrl on the keyboard.
Please follow these 5 steps to export the Speos Light Box of the complete camera system:
- Project (start data)
- How to setup and use the Physical Camera sensor -w/o results
- Project (end data)
- How to setup and use the Physical Camera sensor with results (.html download link is provided in the "start data" folder)
Recommended Speos Camera learning path including content from Ansys Learning Hub (ALH):
- Speos Crash Course
- Speos Rendering Crash Course
- Ansys Speos Getting Started (Condensed Version)
- Ansys Speos Camera Training (Video)
- Using the Export to Speos Lens System Tool (Camera ROM)
- Ansys Speos Camera Sensor Visualization
- CMOS Sensor Camera - Image Quality Analysis in a 3D Scene
- Stray Light Analysis Theory
- Stray Light Analysis – Smartphone Camera
More information about smart phone lens design and stray light analysis in Ansys Zemax OpticStudio can be found in:
- Designing Cell phone Camera Lenses Part 1: Optics
- Designing Cell phone Camera Lenses Part 2: Optomechanical Packaging
- Designing Cell phone Camera Lenses Part 3: STOP analysis by using STAR module and ZOS-API
- Introduction to stray light analysis - Part 1
- Introduction to stray light analysis - Part 2
- Introduction to stray light analysis - Part 3