Introduction
The Triton TRI054S featuring the IMX490 (BSI) back-illuminated stacked CMOS sensor allows for simultaneous 120 dB HDR imaging and LED flicker mitigation. With the large 5.4 MP, 2880 x 1860 px resolution this camera enables wide-angle shooting in both daytime and nighttime for Advanced Driver Assistance Systems(ADAS) / Autonomous Driving. This camera model is also well suited for other applications that demand very high HDR imaging such as electrical fuse inspection; high contrast medical imaging; live visible welding analysis; as well as other ITS applications.
These instructions illustrate different tonemapping methods when using the 24-bit image from the TRI054S.
Equipment Used
- Triton TRI054S-CC camera
- Arena SDK v1.0.33.11
- OpenCV 3.4.3
Background
The TRI054S-CC features a 24-bit ISP:
When using a 24-bit pixel format in ArenaView, you will be able to see 8-bits at a time for display.
Consider the following image taken with the following settings:
- Pixel Format: BayerRG24
- Exposure Time: 10000
- Width: 1440
- Height: 928
When you look at the image in ArenaView, you are only looking a specific 8-bit range from the 24-bit image:
In the above screenshots, we can see the camera was able to collect usable data, but we need to compare different ranges of bits to obtain more appropriate results.
Tonemapping with OpenCV
The 24-bit data can be leveraged in various tonemapping methods. This section will discuss some of the tonemapping methods offered by OpenCV 3.4.3:
https://docs.opencv.org/3.4.3/d8/d5e/classcv_1_1Tonemap.html
The following shows the example scene tonemapped with several OpenCV tonemapping methods:
Example Tonemapping Applications using OpenCV
Download the sample application for the TRI054S-CC here:
FILE: Cpp_TRI054S-CC_IMX490.zip (106.3MB)
Please login to download file
The above download has the following applications:
Cpp_Triton_Recorder
This application will set the following parameters:
- Stream Buffer Handling Mode = Oldest First
- Pixel Format = BayerRG24
- Color Transformation Enable = False
- LUT Enable = False
As the camera streams, the application will display a scaled 8-bit image as well as an OpenCV-tonemapped image for visualization. In order to allow the OpenCV algorithms to use the image data, the data is expanded into 32-bit format.
Controls are provided to help fine-tune the parameters used for the OpenCV tonemapping algorithm. Upon pressing ‘r’ the application will record a raw frames to a file until ‘r’ is pressed again. The following controls are available:
Key | Control Description |
t | Change OpenCV tonemap algorithm |
o | Show text overlay on screen |
. | Increase Bit Range +1 in scaled image |
, | Decrease Bit Range -1 in scaled image |
r | Start/Stop recording a raw video |
q | Quit |
Cpp_Triton_OfflineProcessing
This application will open the raw video recorded by Cpp_Triton_Recorder for post-processing. To open the raw input, we must know at minimum the following parameters about the input:
- Pixel Format
- Width
- Height
The application can load a raw video with the following parameters:
Cpp_Triton_OfflineProcessing.exe <filename> <pixel_format> <width> <height> <fps> <gamma=1.0> <v=export_video>
- filename = filename of the raw video
- pixel_format = pixel format of the images
- width = width of the images
- height = height of the images
- fps = framerate of the video
- gamma = gamma value to use for the OpenCV tonemapping algorithm (default = 1.0)
- v = if this parameter is found, a post-processed (tonemapped) video is exported to file
The application will display a scaled 8-bit image as well as an OpenCV-tonemapped image for the current frame. Controls are provided to help fine-tune the parameters used for the OpenCV tonemapping algorithm. Upon pressing ‘v’, the application will export a tonemapped video from the recorded frames.
Key | Control Description |
t | Change OpenCV tonemap algorithm |
r | Reset OpenCV tonemap parameters |
o | Show text overlay on screen |
. | Increase Bit Range +1 in scaled image |
, | Decrease Bit Range -1 in scaled image |
[ | Navigate -1 frame |
] | Navigate +1 frame |
; | Navigate -100 frames |
' | Navigate +100 frames |
s | Save current frame to raw and png |
' | Export tonemapped video |
q | Quit |