SPRAD86A March   2023  – May 2024 AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM67A , AM68A , AM69A

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Tuning Overview
  6. Hardware Requirement
  7. Software Requirement
    1. 4.1 Processor SDK Linux
    2. 4.2 TI's Reference Imaging Software
    3. 4.3 ISP Tuning Tool
  8. Sensor Software Integration
    1. 5.1 Overview of Image Pipeline Software Architecture
    2. 5.2 Adding Sensor Driver to SDK
    3. 5.3 Updating TIOVX Modules
      1. 5.3.1 Source Code Change
      2. 5.3.2 Rebuild Modules
    4. 5.4 Update GStreamer Plug-in for VISS
      1. 5.4.1 Update VISS Plug-in Property
      2. 5.4.2 Add Exposure Setting for 2A Algorithm
        1. 5.4.2.1 Gain
        2. 5.4.2.2 Exposure Time
        3. 5.4.2.3 Other Parameters
      3. 5.4.3 Rebuild Plug-ins
      4. 5.4.4 Verify New Sensor in GStreamer Plug-in
  9. Tuning Procedure
    1. 6.1 Verify Functional Operation of Camera Capturing
    2. 6.2 Enable Camera Streaming With Initial VPAC Configuration
      1. 6.2.1 Generate Configuration Files
      2. 6.2.2 Generate DCC Binary Files
      3. 6.2.3 Stream Video With the Initial Configuration
    3. 6.3 Adjust Camera Mounting
  10. Perform Basic Tuning
    1. 7.1 Launch the Tuning Tool and Create a Project
    2. 7.2 Tuning Order
    3. 7.3 Black Level Subtraction
    4. 7.4 Hardware 3A (H3A)
    5. 7.5 PCID
    6. 7.6 Auto White Balance (AWB)
      1. 7.6.1 Capture Raw Images for Different Lighting Conditions
      2. 7.6.2 Tuning AWB
    7. 7.7 Color Correction
  11. Perform Fine Tuning
    1. 8.1 Edge Enhancement (EE)
    2. 8.2 Noise Filter 4 (NSF4)
  12. Live Tuning
    1. 9.1 Requirements
    2. 9.2 Supported Features
      1. 9.2.1 RAW Capture
      2. 9.2.2 YUV Capture
      3. 9.2.3 Live DCC Update
      4. 9.2.4 Exposure Control
      5. 9.2.5 White Balance Control
      6. 9.2.6 Sensor Register Read/Write
  13. 10Summary
  14. 11Revision History

Black Level Subtraction

The Black Level Subtraction (BLC) plug-in tuning is only needed for RGB-only sensors. For RGB-IR sensors, this plug-in needs not to be tuned because of the IR subtraction performed by PCID.

For linear sensors including the IMX219, subtract the black level or pedestal from the raw image pixels before applying any gains (for example, gains for white balance) later in the ISP. Even though the pedestal value is coded in the sensor driver, measure the actual value for each sensor working mode supported by the sensor driver. For example, the IMX219 camera has a measured black level around 63 in 10-bit mode (shown in the figure below) and 16 in 8-bit mode.

Follow these steps to tune Black Level Subtraction for the target sensor:

  1. Completely cover the camera lens and capture a black RAW image.
  2. Choose Black Level Subtraction from the Plug-ins drop-down menu.
  3. Select the RAW image in the Browse window and the image ought to appear black in the Preview window.
  4. Provide the raw image in the RAW file window and click Process plugin as shown below.
  5. The measured black level is displayed in the Advanced params tab of the upper right window.
 Black Level Subtraction
                    Tuning Figure 7-4 Black Level Subtraction Tuning

For WDR sensors, the black level subtraction is usually combined with WDR decompanding and re-compression to generate a single lookup table (LUT). This can be achieved by the CFA + WDR plug-in in the tuning tool. See the user guide of the plug-in for more details in case of a WDR sensor.

Once tuning for a plug-in is done, click the Export DCC profile binary button to generate the output XML files for this plug-in. The XML files are located in the .plugoutdir\XML folder under the project folder created in Section 7.1. For Black Level Subtraction, there is only one output XML file: imx219_viss_blc.xml. Replace the same XML file generated from initial configuration. Then rerun the Python script to generate new DCC binary files as described in Generate DCC Binary Files. Use the newly-generated DCC binaries to improve streaming quality in the next step. Complete this action after tuning each plug-in in the following sections.

To see the image quality improvement after tuning each plug-in, capture ISP-processed still images with newly-generated DCC binary files. For example, use the following GStreamer pipeline with new binary files after tuning the Black Level Subtraction plug-in for IMX219:

gst-launch-1.0 -v v4l2src num-buffers=5 device=/dev/video3 io-mode=dmabuf-import ! \
video/x-bayer, width=1920, height=1080, framerate=30/1, format=rggb10 ! \
tiovxisp sink_0::device=/dev/v4l-subdev2 \
sensor-name="SENSOR_SONY_IMX219_RPI" \
dcc-isp-file=/opt/imaging/imx219/dcc_viss_10b.bin \
sink_0::dcc-2a-file=/opt/imaging/imx219/dcc_2a_10b.bin format-msb=9 ! \
video/x-raw, format=NV12, width=1920, height=1080, framerate=30/1 ! \
jpegenc ! multifilesink location="imx219-image-%d.jpg"

Figure 7-5 shows an example of the captured images before Black Level Subtraction tuning (using the initial configuration) and Figure 7-6 shows the image after Black Level Subtraction tuning (compare the appearance of black).

 Image Before Black Level
                        SubtractionFigure 7-5 Image Before Black Level Subtraction
 Image After Black Level
                        SubtractionFigure 7-6 Image After Black Level Subtraction