This article is a guide to Speos Sensor System Exporter (SSS Exporter), a powerful solution for post-processing a camera (or sensor-based) simulation result. The aim of this article is, through a generic example, to understand how to use it properly. The step-by-step process described here is applicable to any use case.
Overview
The SSS Exporter is a powerful standalone tool designed to perform the post-processing of camera simulation results from Speos.
The Spectral Exposure map produced by Speos is a map of illuminance/irradiance values accounting for the photometric/radiometric power reaching the camera sensor. It can easily be converted to an exposure map by enabling the timeline parameter in camera simulation and specifying integration time and trajectory files in Camera Sensor definition. For further insights into Speos Camera simulation, it is recommended to explore the article of CMOS Sensor Camera - Image Quality Analysis in a 3D Scene.
Then the SSS Exporter comes into play by automatically converting the exposure map into a Raw image, an electron map, based on a Reduced Order Model (ROM) of the sensor following the EMVA 1288 standard (release 3.1), and finally into a developed image.
Speos exposure map vs developed image
Since this tool doesn’t have a Graphical User Interface, it is critical to understand the file management and the process to follow to make it work as intended.
File management
To generate a developed image from an exposure map, the user needs different input files:
- A batch script that triggers the processing. In the example provided, it is located right inside the "Example" folder and is named "Launch Speos Sensor System Exporter.bat". This file should not be modified: it is launching the executable of the SSS Exporter with the correct input file (see below). If needed, you can find the executable inside the installation files of Speos (usually in "C:\Program Files\ANSYS Inc\v232\Optical Products\Viewers\SSSExporter.exe").
Note:
- If your local installation is not on the above-mentioned path, you need to adjust it in the batch file.
- If you see the error message "Impossible to connect to the Virtual Photometric Lab", you need to run the corresponding version of Virtual Photometric Lab as administrator once.
- An Inputs file, formatted in YAML. This file specifies the general processing parameters, such as maps to be processed, sensor file to use (see below), data to export, destination folder, etc.). The content of this file will have to be adapted to the user’s needs. Its content is described in more detail in the “Inputs template” section.
- A Sensor file, formatted in YAML. This file contains useful parameters about the sensor, such as operating conditions, ROM parameters, development methods, etc.). The content of this file will have to be adapted to the user’s needs. Its content is described in more detail in the “Sensor template” section.
- At least one exposure map to be processed. Exposure maps are generated from Speos in xmp format.
- External files for the sensor specifications (example: Spectrum file for quantum efficiency, python script for development algorithm). Their type and number will depend on the use case.
The folder architecture should look like this:
The batch script and the "Inputs.yaml" file must be at the same location. All other files ("Sensor.yaml", exposure maps, external files) can be placed at any place relative to this location, but a good practice is to place them in a folder named "Inputs".
Batch script file template
The generic template for this file is provided in the "Templates" folder. It looks like this:
Batch script template
Inputs YAML file template
The generic template for this file is provided in the "Templates" folder. It looks like this:
Inputs file template
It contains two main sections:
- Logging level - When running an instance of the SSS Exporter, a command prompt is displayed with log information, and a text file for log is generated as well. For each of those logs you can specify the level of detail you want to have – ‘INFO’ gives you minimal information (ideal for the command prompt) and ‘DEBUG’ gives you more details about the operation performed by the SSS Exporter (more suitable for the text file).
- Processing mode - The SSS Exporter can process exposure maps in two ways: file by file (‘Given files’) or all the files located in a specific folder (‘All in folder’). You need to specify the right mode in the “Mode” key. Then according to the mode you chose, you need to fill in general information such as input & output folders, what result you want to export, in which format, etc.
You can find more detailed information about how to fill out this file here.
Sensor YAML file template
The generic template for this file is provided in the "Templates" folder. It looks like this:
Sensor file template
It is made of three main sections:
- Operating conditions - Here you can specify the temperature of the sensor, the operating gain, etc.
- Sensor reduced order model (EMVA 1288 Standard) - In this section you will be able to characterize the sensor more accurately by filling the temporal and dark noise, the pixel Bayer Matrix and efficiency, the system gain, etc.
- Development - This section is quite flexible, since the development method for a sensor to convert a raw image to a developed one varies from one sensor to another. You can fill in generic proposed parameters such as demosaicing algorithm, shoot illuminant, color rescaling factors, but you can also plug in any custom method for development based on a python script.
You can find more detailed information about how to fill out this file here.
Running your first example
File architecture
Open the folder "Example". Inside of it, you will find the file architecture suggested in the previous section.
You can have a look inside the pre-filled "Inputs.yaml" file:
We can see that we are going to process map by map, since “Given files” mode is selected. We can see that there is only the “Set 0” specified, so we are only converting one set of maps. The map is in the "Inputs" folder and is named "Exposure.xmp". It will be processed by the sensor whose specifications have been written in the "Sensor.yaml" file, also located in the "Inputs" folder. We ask the SSS Exporter to export the processed image in the "Outputs" folder (this folder doesn’t have to exist prior to running the SSS Exporter), in PNG format.
You can also have a look inside the pre-filled "Sensor.yaml" file:
Without going into all the details, you will notice that, for example, the sensor acquired the image with 10ms exposure time (line 14 to 16), it has a perfect quantum efficiency (line 35 to 37), i.e. every collected photon is converted into an electron across the whole spectral band.
Virtual 100% QE.spectrum
Also, the sensor’s pixel matrix is composed of a classic 2x2 RGGB Bayer Matrix (line 38 to 44).
Finally, you can have a look at the exposure map we will start with.
Exposure.xmp
Running the SSS Exporter
To start the SSS Exporter, once you are satisfied with the content of the input files, you just need to double click on "Launch Speos Sensor System Exporter.bat".
A command prompt will open and display the ongoing progress:
Once the process is finished, you can simply press another key to exit the command prompt and look at the generated result inside the "Outputs" folder.
Speos exposure map vs developed image
In this example, we have post processed the exposure map with a sensor that has an RGGB Bayer pixel matrix. It is a “perfectly efficient” sensor thanks to its quantum efficiency spectrum (see above). The color was shifted towards the “Best RGB” color space.
Modifying the inputs
Now you can make the inputs vary to see the impact of sensor parameters on the processed image. For instance, you can artificially modify line 36 of the sensor YAML file to point towards the "Virtual degraded QE.spectrum" file.
Virtual degraded QE.spectrum
Tip: In the inputs YAML file you can add a sub key “Rename: ‘degraded’” to generate another result and not overwrite the previous one.
Then you can have a look at the new results obtained:
Speos exposure map vs developed image (perfect QE) vs developed image (degraded QE)
In this last example, we can see the impact of the quantum efficiency on the result. Since the second sensor does not efficiently convert photons with "green" wavelengths to electrons, the developed image shows a homogeneous color artifact.
To go further
To get a deeper understanding of the sensor characterization in the SSS Exporter, you can refer to Speos Sensor System Exporter - Sensor Characterization with EMVA and Lumerical.
If you are looking for more insights on the development step of the tool, you can refer to Speos Sensor System Exporter - Development methods and capabilities.