Image/Sensor Control - SW Tone Mapping Dialog
The SW Tone Mapping dialog is used to enable and control the Adaptive Local Tone Mapping (ALTM) algorithm which reduces a high dynamic range (HDR) image of 14 bits or more to 12 bits for further color processing. The ALTM in DevWareX is applied in linear Bayer space to perform a localized tone map such that high dynamic range input is compressed into standard dynamic range output.
Note: The user is expected to have basic knowledge of tone mapping. For more algorithm details, contact your local onsemi support team.
Dialog Usage Overview
In the “Image/Sensor Control” dialog, select the “SW Tone Mapping” page and then enable “Software Adaptive Local Tone Mapping (ALTM)” via its checkbox. Use the parameters in the dialog to adjust to a desirable image. The controls are only active when the sensor is in HDR mode.
ALTM Parameters
When ALTM is enabled the parameters indicated below will take effect.
Min. % and Max. %
These controls help determine the range of pixel values used for tone mapping, on a scale from 0.0 to 1.0, where 0.0 corresponds to the darkest pixel in the image, and 1.0 corresponds to the brightest. The defaults are 0.00135 to 0.99865 (three sigma). Min % combines with Min Factor and Dark Floor to determine what pixel value in the input image is considered ‘black’. Increasing the Min % raises the pixel value that’s considered ‘black’ and decreases the visibility of dark details. Decreasing Min % has the opposite effect. Likewise Max % combines with Max Factor and Bright Floor to determine what pixel level is considered ‘white’.
Min. Factor
The pixel value corresponding to Min % is multiplied by this factor.Max. Factor
The pixel value corresponding to Max % is multiplied by this factor. Increasing this factor helps prevent bright areas (such as traffic lights) from becoming saturated in the output.Dark Floor
An offset subtracted after multiplying by Min. Factor.
Lmin = (Min % pixel value) * (Min. Factor) – (Dark Floor) = ‘black value’
Input pixels darker than Lmin will appear black in the output.Bright Floor
The lower limit for the white value. (Note, Bright Floor is a limit, Dark Floor is an offset.)
Lmax = max((Bright Floor), (Max % pixel value) * (Max. Factor)) = ‘white value’
Input pixels brighter than Lmax will appear white in the output.Key 0 and Key 1
These values affect the overall tone map transfer function. The defaults are 128 and 1024. Increasing Key 1 results in a darker overall image.Lo Gamma
The gamma parameter that’s dominant in dark areas. The DevWareX color pipeline has gamma correction at the end, so this parameter defaults to 1.0 (neutral value).Hi Gamma
Gamma parameter that’s dominant in medium and bright areas. The DevWareX color pipeline has gamma correction at the end, so this parameter defaults to 1.0 (neutral value). This parameter should be kept greater than or equal to Lo Gamma.
Sharpening
Optional sharpening strength applied to a sharpening filter in the tone mapping. The default is 0.0, which results in no sharpening.
Damper
To prevent sudden jumps in image brightness on live images, some calculations can be smoothed out over time. Damper controls this temporal smoothing. If Damper is less than 1.0 then some calculated parameters are only adjusted from their previous values. In this case the images can take a short time to ‘settle’ after the input image brightness changes. Damper should be 1.0 for a still image to get consistent results.
STATE Variables that are affected
The following STATE variables are separate for ALTM case and non-ALTM case.
When ALTM is on, these are used
"HDR Black Correct"
"HDR Saturation"
"HDR Gamma Correction"
"HDR Contrast"
When ALTM is off, these are used
"Black Correct"
"Saturation"
"Gamma Correction"
"Contrast."
Note: With the changing of ALTM status, whether it is from the dialog or from a preset of INI file, DevWareX will switch between the “HDR xxx” state variables and the non HDR state variables accordingly.
Parameters Settings with ALTM Disabled
Without ALTM, high dynamic range images are by default treated like standard dynamic range (12-bit) images, and pixels brighter than 4095 are all treated as ‘white’. It may be desirable to see a wider dynamic range, but without ALTM. These controls let the user select a wider range of pixel values to display, and DevWareX will interpolate between the chosen minimum and maximum. The interpolation can be linear or logarithmic. The controls under “When Software ALTM is off:” are used to make these selections.
Select MSB for DevWare color processing
This is the simplified way of selecting a range. The range is between the sensor black level and the bit level selected here. Maximum value is 2(MSB + 1) - 1. The black level remains as defined in the Data Interpretation dialog page.
Intensity Stretch Between Pixel Values
This selection lets the user select specific minimum and maximum pixel values using the sliders, or automatically from the image histogram.
Auto Min/Max from Histogram
The minimum and maximum range of a pixel value are based on the whole image histogram.
From Mouse Selection Rect.
The minimum and maximum range of a pixel value are based on the image histogram within the Mouse Selection Rectangle.
Minimum / Maximum Sliders and Spin Boxes
The minimum and maximum range of a pixel value controls, for precise selection.
Lock Value Separation
When this box checked, it locks the distance between the Minimum and Maximum slider positions.
Logarithmic Interpolation (doesn’t preserve color)
Use logarithmic interpolation instead of linear interpolation between minimum and maximum. This shows a very wide range of values better, but it doesn’t preserve the color hues.