Rockchip Tunning Guide ISP20
:::info 文档信息
文档标识:RK-SM-YF-601 · 发布版本:V1.6.2 · 发布日期:2021-2-6 · 页数:146 · 语言:英文
原始文档:Rockchip_Tuning_Guide_ISP20_EN_v1.6.2.pdf
:::
章节大纲
- Rockchip Tunning Guide ISP20(P1)
- 1 IQ Tuning Guide Relationship Description(P10)
- 2 ISP System Overview(P10)
- 2.1 Function Brief(P10)
- 2.2 ISP Functional Block Diagram(P11)
- 2.3 Introduction of each Module(P11)
- 3 IQ Tuning Overview(P13)
- 3.1 Overview of IPC Applying IQ tuning(P13)
- 3.1.1 Linear Mode IQ Tuning(P13)
- 3.1.2 HDR mode IQ tuning(P21)
- 3.1 Overview of IPC Applying IQ tuning(P13)
- 4 Module Introduction(P25)
- 4.1 AEC(P26)
- 4.1.1 Function Description(P26)
- 4.1.2 Key Parameter(P26)
- 4.1.2.1 AEC Module Common Control Parameters(P27)
- Enable(P27)
- AecRunInterval(P27)
- AecOpType(P27)
- HistStatsMode(P27)
- RawStatsMode(P27)
- YrangeMode(P27)
- AecSpeed(P27)
- AecFrameRateMode(P28)
- AecAntiFlicker(P29)
- AecInitValue(P30)
- AecGridWeight(P30)
- AecRoute(P31)
- AecManualCtrl(P33)
- AecIrisCtrl(P34)
- AecDNSwitch(P40)
- 4.1.2.2 Tuning parameters of linear exposure in AEC module(P40)
- RawStatsEn(P40)
- SetPoint(P41)
- NightSetPoint(P41)
- EvBias(P41)
- ToleranceIn/Out(P41)
- StrategyMode(P41)
- DySetPointEn(P41)
- DynamicSetpoint(P41)
- BackLightCtrl(P42)
- OverExpCtrl(P44)
- 4.1.2.3 Tuning parameters of HDR exposure in AEC module(P45)
- ToleranceIn/Out(P45)
- StrategyMode(P46)
- EvBias(P46)
- ExpRatioCtrl(P46)
- LongFrmMode(P48)
- LframeCtrl(P48)
- MframeCtrl(P49)
- SframeCtrl(P50)
- 4.1.2.4 SensorInfo Parameters(P50)
- GainRange(P50)
- TimeFactor(P52)
- CISLinTimeRegMaxFac(P52)
- CISHdrTimeRegSumFac(P53)
- CISHdrTimeRegOdevity(P53)
- CISTimeRegUnEqualEn(P53)
- CISTimeRegMin(P53)
- CISHdrTimeRegMin(P54)
- CISHdrTimeRegMax(P54)
- CISMinFps(P54)
- CISAgainRange(P54)
- CISExtraAgainRange(P54)
- CISDgainRange(P55)
- CISISPDgainRange(P55)
- CISHdrGainIndSetEn(P55)
- SensorFlip(P55)
- 4.1.2.5 System Parameters(P55)
- HDR(P55)
- DCG_SETTING(P56)
- EXP_DELAY(P56)
- 4.1.2.1 AEC Module Common Control Parameters(P27)
- 4.1.3 Tuning Steps(P57)
- Step 1. Sensor exposure parameters and system parameter settings(P57)
- Step2.Set AE weight parameters(P58)
- Step3.Set AE exposure seperation route(P59)
- Step4.Set AE target brightness value(P59)
- Step5.Set AE convergence and response speed(P59)
- 4.2 NR & SHARP(P60)
- 4.2.1 BayerNR(P60)
- 4.2.1.1 Function Description(P60)
- 4.2.1.2 Key Parameter(P61)
- Enable(P61)
- Mode(P61)
- Setting(P61)
- SNR_Mode(P61)
- ISO(P61)
- Calibration data(P62)
- luLevel/ luLevelVal(P62)
- luRatio(P62)
- Gauss-oriented parameters(P62)
- gauss_en(P62)
- Denoising intensity parameter(P62)
- filtPara(P62)
- Random noise backfill parameters(P62)
- Lamda(P62)
- fixW(P63)
- 4.2.1.3 Tuning steps(P63)
- 4.2.2 MFNR(P63)
- 4.2.2.1 Function Description(P63)
- 4.2.2.2 Key Parameter(P65)
- Enable:(P65)
- mode_3to1(P65)
- local_gain_en(P65)
- Mode(P66)
- Setting(P66)
- SNR_Mode(P66)
- MFNR_ISO(P66)
- MFNR_ISO / Iso(P66)
- MFNR_ISO /weight_limit_y(P66)
- MFNR_ISO / weight_limit_uv(P67)
- MFNR_ISO / ratio_frq(P67)
- MFNR_ISO / luma_w_in_chroma(P67)
- Y calibration data(P67)
- MFNR_ISO / noise_curve(P67)
- MFNR_ISO / noise_curve_x00(P68)
- MFNR_ISO / y_lo_noiseprofile(P68)
- MFNR_ISO / y_hi_noiseprofile(P68)
- Y low frequency denoising adjustment parameters(P68)
- MFNR_ISO / y_lo_bfscale(P68)
- MFNR_ISO / y_lumanrpoint(P68)
- MFNR_ISO / y_lumanrcurve(P68)
- MFNR_ISO / y_denoisestrength(P69)
- MFNR_ISO / y_lo_lvl0_gfdelta(P69)
- MFNR_ISO / y_lo_lvl1_gfdelta(P69)
- MFNR_ISO / y_lo_lvl2_gfdelta(P69)
- MFNR_ISO / y_lo_lvl3_gfdelta(P69)
- UV calibration parameters(P69)
- MFNR_ISO / uv_lo_noiseprofile(P69)
- MFNR_ISO / uv_hi_noiseprofile(P70)
- UV low frequency denoising parameters(P70)
- MFNR_ISO / uv_lo_bfscale(P70)
- MFNR_ISO / uv_lumanrpoint(P70)
- MFNR_ISO / uv_lumanrcurve(P70)
- MFNR_ISO / uv_denoisestrength(P70)
- MFNR_ISO / uv_lo_lvl0_gfdelta(P70)
- MFNR_ISO / uv_lo_lvl1_gfdelta(P71)
- MFNR_ISO / uv_lo_lvl2_gfdelta(P71)
- UV high frequency denoising parameters(P71)
- MFNR_ISO / uv_hi_bfscale(P71)
- MFNR_ISO / uv_hi_lvl0_gfdelta(P71)
- MFNR_ISO / uv_hi_lvl1_gfdelta(P71)
- MFNR_ISO / uv_hi_lvl2_gfdelta(P71)
- Gaussian filter operator parameters(P72)
- MFNR_ISO / lvl0_gfsigma(P72)
- MFNR_ISO / lvl1_gfsigma(P72)
- MFNR_ISO / lvl2_gfsigma(P72)
- MFNR_ISO / Lvl3_gfsigma(P72)
- Motion and static judgment parameters motion_detection(P72)
- Enable(P73)
- ISO(P73)
- sigmaHScale(P73)
- sigmaLScale(P73)
- light_clp(P73)
- uv_weight(P73)
- mfnr_sigma_scale(P74)
- yuvnr_gain_scale0(P74)
- yuvnr_gain_scale1(P74)
- yuvnr_gain_scale2(P74)
- 4.2.2.3 Tuning steps(P74)
- 4.2.3 YNR(P75)
- 4.2.3.1 Function Description(P75)
- 4.2.3.2 Key Parameter(P76)
- Enable:(P76)
- Mode(P76)
- Setting(P77)
- SNR_Mode(P77)
- YNR_ISO(P77)
- YNR_ISO / Iso(P77)
- Calibration Data(P77)
- YNR_ISO / sigma_curve(P77)
- YNR_ISO / ynr_lci, ynr_lhci, ynr_hlci, ynr_hhci(P77)
- Low-frequency layer denoising adjustment parameters(P78)
- YNR_ISO / lo_lumaPoint(P78)
- YNR_ISO / lo_lumaRatio(P78)
- YNR_ISO / lo_directionStrength(P78)
- YNR_ISO / lo_bfScale(P78)
- YNR_ISO / imerge_ratio(P78)
- YNR_ISO / imerge_bound(P79)
- YNR_ISO / denoise_weight(P79)
- High-frequency layer denoising adjustment parameters(P79)
- YNR_ISO / hi_lumaPoint(P79)
- YNR_ISO / hi_lumaRatio(P79)
- YNR_ISO / hi_bfScale(P79)
- YNR_ISO / hwith_d(P79)
- YNR_ISO / hi_denoiseStrength(P80)
- YNR_ISO / hi_detailMinAdjDnW(P80)
- YNR_ISO / hi_denoiseWeight(P80)
- YNR_ISO / y_luma_point(P80)
- YNR_ISO / hgrad_y_level1~4(P80)
- YNR_ISO / hi_soft_thresh_scale(P81)
- 4.2.3.3 Tuning steps(P81)
- 4.2.4 UVNR(P82)
- 4.2.4.1 Function Description(P82)
- 4.2.4.2 Key parameters(P83)
- Enable:(P83)
- Mode(P83)
- Setting(P83)
- SNR_Mode(P83)
- UVNR_ISO(P83)
- UVNR_ISO / Iso(P83)
- UVNR_ISO / step0_uvgrad_ratio(P83)
- UVNR_ISO / step0_uvgrad_offset(P84)
- Denoising adjustment parameters on scale 1(P84)
- UVNR_ISO / step1_median_ratio(P84)
- UVNR_ISO / step1_bf_sigmaR(P84)
- UVNR_ISO / step1_bf_uvgain(P84)
- UVNR_ISO / step1_bf_ratio(P84)
- Denoising adjustment parameters on scale 2(P85)
- UVNR_ISO / Step2_median_ratio(P85)
- UVNR_ISO / step2_bf_sigmaR(P85)
- UVNR_ISO / step2_bf_uvgain(P85)
- UVNR_ISO / step2_bf_ratio(P85)
- Denoising adjustment parameters on scale 3(P85)
- UVNR_ISO / Step3_bf_sigmaR(P85)
- UVNR_ISO / Step3_bf_uvgain(P85)
- UVNR_ISO / Step3_bf_ratio(P86)
- Adjustable parameters of bilateral distance weight(P86)
- UVNR_ISO / kernel_3x3(P86)
- UVNR_ISO / kernel_5x5(P86)
- UVNR_ISO / kernel_9x9(P86)
- UVNR_ISO / kernel_9x9_num(P86)
- 4.2.4.3 Tuning steps(P86)
- 4.2.5 SHARP(P88)
- 4.2.5.1 Function description(P88)
- 4.2.5.2 Key parameters(P88)
- Enable:(P88)
- Mode(P89)
- Setting(P89)
- SNR_Mode(P89)
- SHARP_ISO(P89)
- SHARP_ISO / Iso(P89)
- range clip to limit related adjustment parameters(P89)
- SHARP_ISO / Lratio(P89)
- SHARP_ISO / Hratio(P90)
- Pre-filtering related adjustment parameters(P90)
- SHARP_ISO / luma_sigma(P90)
- SHARP_ISO / pbf_gain(P90)
- SHARP_ISO / pbf_ratio(P90)
- SHARP_ISO / pbf_add(P90)
- Intermediate frequency sharpening related adjustment parameters(P90)
- SHARP_ISO / mf_sharp_ratio(P90)
- SHARP_ISO / mf_clip_pos(P90)
- SHARP_ISO / mf_clip_neg(P91)
- SHARP_ISO / mbf_gain(P91)
- SHARP_ISO / mbf_add(P91)
- High-frequency sharpening related adjustment parameters(P91)
- SHARP_ISO / hf_sharp_ratio(P91)
- SHARP_ISO / hf_clip(P91)
- SHARP_ISO / hbf_gain(P91)
- SHARP_ISO / hbf_ratio(P92)
- SHARP_ISO / hbf_add(P92)
- SHARP_ISO / local_sharp_strength(P92)
- 4.2.5.3 Tuning steps(P92)
- 4.2.6 Edgefilter(P93)
- 4.2.6.1 Function description(P93)
- 4.2.6.2 Key Parameter(P93)
- Enable:(P93)
- Mode(P93)
- Setting(P94)
- SNR_Mode(P94)
- EDGEFILTER_ISO(P94)
- EDGEFILTER_ISO / iso(P94)
- Edge filtering related adjustment parameters(P94)
- EDGEFILTER_ISO / direct_filter_coeff(P94)
- EDGEFILTER_ISO / edge_thed(P94)
- EDGEFILTER_ISO / src_wgt(P94)
- EDGEFILTER_ISO / alpha_adp_en(P95)
- EDGEFILTER_ISO / local_alpha(P95)
- EDGEFILTER_ISO / global_alpha(P95)
- EDGEFILTER_ISO / noise_clip(P95)
- DOG related adjustment parameters(P95)
- EDGEFILTER_ISO / dog_clip_pos(P95)
- EDGEFILTER_ISO / dog_clip_neg(P95)
- EDGEFILTER_ISO / dog_alpha(P96)
- EDGEFILTER_ISO / dog_kernel_row0~4(P96)
- 4.2.6.3 Tuning steps(P96)
- 4.2.7 NR & Sharp Tuning steps(P96)
- 4.2.7.1 Scale concept understanding(P96)
- 4.2.7.2 Module Association Debugging(P96)
- 4.2.7.2.1 Debugging of low frequency signal(P97)
- 4.2.7.2.2 Debugging of high-frequency signals(P97)
- 4.7.2.2.3 Debugging of noise patterns(P98)
- 4.2.1 BayerNR(P60)
- 4.3 MERGE(P98)
- 4.3.1 Function Description(P98)
- 4.3.2 Key Parameter(P99)
- 4.3.2.1 EnvLv(P99)
- 4.3.2.2 OECurve_smooth(P99)
- 4.3.2.3 OECurve_offset(P99)
- 4.3.2.4 MoveCoef(P100)
- 4.3.2.5 MDCurveLM_smooth(P100)
- 4.3.2.6 MDCurveLM_offset(P100)
- 4.3.2.7 MDCurveMS_smooth(P100)
- 4.3.2.8 MDCurveMS_offset(P100)
- 4.3.2.9 OECurve_damp(P100)
- 4.3.2.10 MDCurveLM_damp(P100)
- 4.3.2.11 MDCurveMS_damp(P101)
- 4.3.3 Tuning steps(P101)
- 4.3.3.1 Overexposure curve debugging(P101)
- 4.3.3.2 Motion curve debugging(P103)
- 4.4 TMO(P106)
- 4.4.1 Function description(P106)
- 4.4.2 Key Parameter(P107)
- 4.4.2.1 Enable(P107)
- 4.4.2.2 GlobalLuma(P107)
- 4.4.2.3 DetailsHighLight(P108)
- 4.4.2.4 DetailsLowLight(P108)
- 4.4.2.5 GlobalTMO(P109)
- 4.4.2.6 LocalTMO(P109)
- 4.4.2.7 Damp(P110)
- 4.4.3 Tuning steps(P110)
- 4.4.3.1 GlobalLuma debugging(P110)
- 4.4.3.2 Highlight details debugging(P111)
- 4.4.3.3 Low-light detail debugging(P112)
- 4.4.3.4 GlobalTMO debugging(P113)
- 4.4.3.5 LocalTMO debugging(P113)
- 4.5 FEC(P114)
- 4.5.1 Function description(P114)
- 4.5.2 Key Parameter(P115)
- 4.5.2.1 enable(P115)
- 4.5.2.2 correct_level(P115)
- 4.5.2.3 light_center(P115)
- 4.5.2.4 distortion_coeff(P115)
- 4.6 LDCH(P115)
- 4.6.1 Function Description(P115)
- 4.6.2 Key Parameter(P115)
- 4.6.2.1 enable(P116)
- 4.6.2.2 correct_level(P116)
- 4.6.2.3 correct_level_max(P116)
- 4.6.2.4 light_center(P116)
- 4.6.2.5 distortion_coeff(P116)
- 4.7 Dehaze & Enhance(P116)
- 4.7.1 Function Description(P116)
- 4.7.2 Key Parameter(P117)
- 4.7.2.1 Enable(P117)
- 4.7.2.2 cfg_alpha_normal(P117)
- 4.7.2.3 cfg_alpha_HDR(P117)
- 4.7.2.4 cfg_alpha_night(P118)
- 4.7.2.5 Dehaze_Setting(P118)
- 4.7.2.6 Enhance_Setting(P120)
- 4.7.2.7 Hist_Setting(P120)
- 4.7.3 Tuning steps(P121)
- 4.7.3.1 Dehaze debugging(P121)
- 4.7.3.2 Enhance debugging(P123)
- 4.7.3.3 Hist debugging(P123)
- 4.8 DPCC(P124)
- 4.8.1 Function description(P124)
- 4.8.2 Key Parameter(P125)
- 4.8.2.1 Enable(P125)
- 4.8.2.2 Fast_mode(P125)
- 4.8.2.3 Expert_mode(P126)
- 4.8.2.4 set_cell(P126)
- 4.8.2.4.1 RK(P127)
- 4.8.2.4.2 LC(P128)
- 4.8.2.4.3 PG(P128)
- 4.8.2.4.4 RND(P129)
- 4.8.2.4.5 RG(P129)
- 4.8.2.4.6 RO(P130)
- 4.8.2.5 sensor_dpcc(P130)
- 4.8.3 Tuning steps(P131)
- 4.8.3.1 Fast_mode debugging(P131)
- 4.8.3.2 Expert_mode debugging(P131)
- 4.8.3.2.1 RK(P132)
- 4.8.3.2.2 LC(P133)
- 4.8.3.2.3 PG(P133)
- 4.8.3.2.4 RND(P133)
- 4.8.3.2.5 RG(P134)
- 4.8.3.2.6 RO(P134)
- 4.8.3.3 sensor_dpcc debugging(P134)
- 4.9 Gamma(P135)
- 4.9.1 Function Description(P135)
- 4.9.2 Key parameters(P135)
- 4.9.2.1 gamma_en(P135)
- 4.9.2.2 gamma_out_segnum(P135)
- 4.9.2.3 gamma_out_offset(P136)
- 4.9.2.4 curve_normal(P136)
- 4.9.2.5 curve_hdr(P136)
- 4.9.2.6 curve_night(P136)
- 4.9.3 Tuning steps(P136)
- 4.10 Debayer(P136)
- 4.10.1 Function Description(P136)
- 4.10.2 Key Parameter(P137)
- Enable:(P137)
- debayer_filter1(P137)
- debayer_filter2(P137)
- debayer_gain_offset(P137)
- ISO(P137)
- sharp_strength(P137)
- debayer_hf_offset(P138)
- debayer_offset(P138)
- debayer_clip_en(P138)
- debayer_filter_g_en(P138)
- debayer_filter_c_en(P138)
- debayer_thed0(P138)
- debayer_thed1(P138)
- debayer_dist_scale(P138)
- debayer_cnr_strength(P138)
- debayer_shift_num(P139)
- 4.10.3 Glossary(P139)
- 4.11 CPSL(P139)
- 4.11.1 Function Description(P139)
- 4.11.2 Key parameters(P139)
- enable(P139)
- mode(P139)
- force_gray(P139)
- light_src(P140)
- auto_adjust_sens(P140)
- auto_on2off_t(P140)
- auto_off2on_th(P140)
- auto_sw_interval(P140)
- manual_on(P140)
- manual_strength(P140)
- 4.12 GIC(P141)
- 4.12.1 Function description(P141)
- 4.12.2 Key parameters(P141)
- 4.12.2.1 enable(P141)
- 4.12.2.2 edge_en(P141)
- 4.12.2.3 gr_ration(P141)
- 4.12.2.4 noise_cut_en(P141)
- 4.12.2.5 GIC_ISO(P141)
- 4.12.3 Steps for debugging(P144)
- 4.12.3.1 GIC_ISO debugging(P144)
- 4.1 AEC(P26)
在线预览
若预览无法显示,请直接下载 PDF 后用本地阅读器打开。
2.1 Function Brief
ISP module supports standard sensor image data processing functions, including auto white balance, auto exposure, Demosaic, defect pixel correction, and lens shadow correction. It also supports advanced image processing functions, such as HDR, defogging,noise reduction.
The functions are listed as follows:
Black level correction Static and dynamic DPC and defect pixel cluster correction Bayer noise reduction FPN removal Advanced demosaic Gamma correction 3-in-1, and 2-in-1 WDRs Sensor built-in wide dynamic range (HDR) AWB AE Automatic focus (AF) 3A (AE, AF, AWB) statistics output lens shadow correction Lens shading correction (LSC) Automatic defogging Local contrast enhancement 2D brightness and color noise reduction 3D noise reductionicture Distortion correction processing 3D lut processing 1D small angle distortion correction Feature point detection
2.2 ISP Functional Block Diagram
Figure 2-1 ISP2.0 functional block diagram
2.3 Introduction of each Module
| Module | Description |
|---|---|
| FPN | Through phenotypic black frame or black line, to correct sensor input image and achieve the purpose of removing the sensor FPN. |
| BLC | Provide sensor related black level correction |
| DPCC | Provides detection and correction of static and dynamic breakpoints. |
| GIC | Correct the imbalance between Gr and Gb channels and improve the image quality of some scenes. |
| BNR | Provides image denoising function in Bayer Domain. |
| LSC | Used for lens shadow correction. |
| AEC | Auto exposure control. Adjust the sensor according to the statistical information, to realize the function of auto exposure control. |
| AIris | Auto iris control, support two types of apeture: P-iris and DC-iris |
| AF | Support image sharpness evaluation information statistics, used to complete the support of autofocus function. |
| AWB | The module outputs global statistics and regional statistics, and the software completes the automatic white balance function based on the statistics. |
| Demosaic | Convert Raw images in Bayer format to RGB images. |
| CCM | Linear correction of the color space is accomplished with standard 3X3 matrix and vector offsets. |
| Gamma | The module is divided into three channels of R\G\B to adjust the brightness according to the gamma curve. |
| Dehaze & Enhance | Provides powerful defogging capability to improve video contrast and clarity in haze scenes. |
| CSC | Convert inputs (R,G,B) to (Y,U,V) with standard 3X3 matrix and vector offsets |
| Sharp | Realize the image sharpness, improve the image definition. |
| 3D-LUT | The 9x9x9 3DLUT implements complex color adjustment operations, such as brightness adjustment, saturation adjustment. |
| HDR MERGE | Wide dynamic composition of 2 or 3 frames. |
| HDR TMO | The LUT curve in the LOG domain is used to adjust the complex brightness. |
| YNR | Wavelet denoising for luminance in YUV region. |
| UVNR | Separate color noise removal. |
| TNR or MFNR | Time domain multi-frame denoising, remove noise in the premise of ensuring clarity |
3 IQ Tuning Overview
RK1109/RV1126 mainly faces two application scenarios at present, which are IPC security application and consumer application. IPC security application scenario includes linear mode and HDR mode. Consumer application scenario mainly include product forms such as motion DV, dashcam, and snapshot. Due to the special requirements of the monitoring industry, IPC security application scenario have different focus on image quality compared with consumer application scenario
3.1 Overview of IPC Applying IQ tuning
IPC application scenarios mainly include two typical applications, which are linear mode and HDR mode. The image quality focus in linear mode mainly include the rationality of image brightness, the accuracy of color restoration, the overall clarity of image, the overall sharpness of image and the transparency of image. The image quality focus of HDR mode mainly includes the overall dynamic range of the image is reasonable (bright area but exposure, dark area details can be seen), the color restoration as accurate as possible, the overall image clarity, sharpness, and transparency, etc. For the image quality tuning of these two modes, the following introduces the tuning steps and the considerations for ISP single-point algorithm tuning respectively.
3.1.1 Linear Mode IQ Tuning
The whole frame diagram of linear mode IQ tuning of IPC application scene is shown below (Figure 3-1) :
Figure3-1 Flowchart of image tuning in linear mode for IPC application scenarios
Before IQ tuning, the work need to be carried out is as follows:
- Sensor docking: according to the definition of the product, the CSI of the sensor should be setted, including frame rate, resolution, HDR mode and AE mode. At the same time, according to the sensor datasheet from the manufacturer or the initialization register sequence in each mode FAE provided, the initialization sequence should be fitted to the MIPI configuration of the RK platform. Completion criteria: Docking mode access and AE basic work are normal, which can shoot RAW normally.Details refer to《Rockchip_Driver_Guide_ISP2x》. 2. Module calibration work: calibration work mainly involves black level calibration, RAWNR /YUV NR/3DNR calibration, static bad point calibration, lens shading calibration, AWB calibration, CCM calibration, lens distortion parameter calibration, etc. For calibration details of each module, please refer to the module description in Chapter 4. For details of AWB and CCM, please refer to《Rockchip_Color_Optimization_Guide_ISP2x》
This calibration step should be carried out in strict accordance with the process as shown in Figure 3-2: Figure 3-2 Module calibration flow chart
- Joint tuning of each ISP modules: when docking sensor and sensor camera calibration is accomplished, you can enter the joint tuning of ISP modules. Linear image quality tuning includes multiple sets of ISO image quality optimization under illumination, the star level sensor generally need to ISO 204800. The ISO linkage of BayerNR, Demosaic, sharpen, YUVNR, 3 DNR and Dehaze, enhance, ect algorithm module, not only the open Mipi interface parameters, but also the internal default parameters. The scene of linear mode tuning mainly includes the laboratory static scene and the outdoor actual scene. Generally, the laboratory static scene is used to simulate each ISO scene, and then the brightness, color, permeability, clarity, and noise under each illumination degree are adjusted reasonably.Then on this basis, it is necessary to fine-tune the actual scene according to different application scenarios of IPC, covering day and night scenes at traffic junctures, outdoor low-illumination scenes at night, outdoor scenes with texture details in the daytime, including sunny and cloudy weather, outdoor scenes with rich texture at sunset, etc. The specific sequence of tuning for linear mode is shown in Figure 3-3.
Figure 3-3 Linear mode image tuning scene diagram
There are four concern dimension of linear mode ISP image quality. The basic tuning process of linear mode ISP image quality concern dimension is shown in Figure 3-4.
Figure 3-4 Flow chart of image quality attention dimension debugging
Dimension one: Brightness Dimension
The main tuning module responsible for brightness dimension is AE, which mainly includes the tuning of target brightness value, AE Route, AE weight table, the speed and smoothness of AE convergence, etc. Below environments should be prepared before AE tuning: correct calibration of black level, complete shading calibration, correct calibration of AWB and CCM, presetted Gamma parameters for different modes, etc.
Step 1: The first step in AE tuning is to determine the weight table for AE. The weight table determines the ROI for AE, and will also vary with different application requirements. Generally, for IPC application scenarios, the main ROI of the scene is in the middle of the picture. It is suggestted to set the AE weight table of the middle part higher than the surrounding part. Figure 3-5 is an example of AE weight table:
Figure 3-5 AE weight table
Step 2: After determining AE weight table , the AE route should be determined, which mainly determines the seperation of exposure value, namely, the allocation of exposure time and gain. Different scenarios need to set up different AE route. For example, in order to focus on fast moving objects, gain will be used prior and exposure time will be limitted. Capturing the car license plate in daytime scene generally needs to limit exposure time in 2 ~ 4 ms with the prior use of gain, while at night scene with low luminance, in order to balance the noise performance of the screen, the seperation of exposure value should be prioritize over exposure time.
Step 3:To adjust the target values of AE under different exposure. For laboratory static scene, AE tuning requirement is that the brightest area in the center of the picture has no obvious over-exposure. As shown in figure 3-6, the texture card and the ceramic coffee cup in the middle should not be over exposured, and the brightness of leaves and rosess should be reasonable. The AE target values are mainly related to the params SetPoint, DynamicSetpoint and the selection of AE backlight mode. Figure 3-6 Schematic diagram of static scene
Step 4: Finally, the convergence speed and smoothness of AE need to be adjusted. The convergence speed and smoothness of AE are a pair of equilibrium points.On the premise of preventing AE vibration, the convergence speed of AE should be appropriately improved. Especially for the application of dashcam and motion DV, the convergence speed of AE needs to be appropriately improved to adapt to the drastic changes of the scene. The convergence speed and convergence stability of AE can generally be tested by turning on and off lights in laboratory still life scenes.
The specific adjustment parameter of AE module can refer to the description section of AE module in this document. It should be noted that the LSC module will also affect the brightness of the image, so it is suggested to linkage attenuation according to ISO when tuing LSC, so as to avoid increasing the noise in the dark corner of the image when the illumination is slightly lower.
---The end of Brightness Dimension
Dimension two: Color Dimension
On the basis of reasonable adjustment of AE, the next step is to adjust the color-related parameters, mainly involving AWB and CCM modules.
Below environments should be prepared before color tuning: accurate black level correction , complete LSC calibration, reasonable AE module parameter tuning.
Step 1: It is necessary to capture raw calibration of 24 color cards under seven groups of different color temperatures (D75, D65, D50, TL84, CWF, A, HZ) in the laboratory light box scene to obtain AWB static white balance coefficient, and generate white balance white spot condition frame. More details can be seen in section 4 of chapter 4 of <Rockchip_IQ_Tools_Guide_ISP2x v1.1>
Step 2: Using the RAW image used for AWB calibration, the CCM matrix under the corresponding saturation and light source was generated with the tool. Before doing this, you need to confirm the gamma curve whose default is Gamma 2.2. If you have special requirements for gamma, you need to fill in the gamma curve first. The operation interface is as follows: Figure 3-7 CCM calibration interface
Step 3: After finishing steps 1 and 2, we can shoot the 24 color card picture under each light
source in the standard light box, and then test the color index of the 24 color card with iMatest
software. If the indicators meet the requirements, it can be preliminarily determined that the calibrated AWB parameters and CCM matrix meet the requirements.
Step 4: The rationality of the parameters of AWB and CCM modules also requires a lot of testing and tuning in practical application scenarios. Usually practical application scenarios include typical outdoor scenes, including straight light, backlight, overcast, sunset, night, and mixed light. If there are gray blocks in the scene and the restoration is not accurate, the AWB parameters need to be adjusted, and some colors in the scene will be color biased, oversaturated or light. It is suggested to tune the parameters of CCM first. For the mixed light source application scene, the scene detection parameters in AWB need to be adjusted. For the inaccurate restoration of the skin color of the characters in the actual scene, the CCM parameter or 3DLUT parameter need to be adjusted. For specific tuning of AWB and CCM modules, please refer to <Rockchip_Color_Optimization_Guide_ISP2XV1.0>.
---The end of Color Dimension
Dimension three: Contrast Dimension
After the brightness dimension and color dimension reasonable, the contrast dimension should be optimized. The modules that affect the contrast mainly include Gamma, Dehaze, Enhance, etc. The general focus is still on the Gamma parameter adjustment in different scenes, while Dehaze and Enhance are auxiliary modules.
Below environments should be prepared before contrast tuning:accurate black level correction , complete LSC calibration, reasonable AE module parameter tuning, reasonable AWB and CCM parameters calibration .
Step 1: Adjust the Gamma parameter, which is the basic module of image contrast. Taking the static real scene as an example, by adjusting the Gamma parameter, the color card in the bright area in the middle of the picture and the light and dark texture of the three-dimensional plants on the edge of the picture will not be lost, and the contrast of the picture will be better visually.The details are shown in the following figure. Figure 3-8 Example of the area affected by the Gamma curve in a static scene
Step 2: After adjusting the Gamma parameter, if the image contrast has higher requirements, you can adjust the Dehaze or Enhance to improve the contrast. For instructions on the regulation of Dehaze and Enhance, please refer to parameters 4.21 "Dehaze" and 4.22 "Enhance".
Step 3: After optimizing the relevant parameters of contrast, it is necessary to objectively test the overall contrast effect. Test the gray scale card in the D65 light source environment to observe whether the gray level can reach 18 or above, and test whether the gray level can reach 14steps with Imatest.
Figure 3-9 An example of the grayscale card in the D65 light source environment of the laboratory light box and the imatest analysis result
Step 4: In the actual static scene, it is necessary to adjust Gamma, Dehaze,Enhance and other parameters according to different application occasions and different illumination to achieve the contrast balance in each scene. It is certain that there are differences in contrast tuning styles between normal illumination and low illumination. For example, in night mode, Gamma will be appropriately lowered to reduce the burden of dark noise.
---The end of Contrast Dimension
Dimension four: Clarity and noise Dimension
Sharpness and noise are a balance, due to the different intensity of illumination, image noise performance is also different. Under normal low illumination, image noise will be too serious to influence visual perception severely, so we have to reduce clarity requirement as a sacrifices. Therefore, sharpness and noise parameters need to be linkage controled according to the scenario of different ISO . For the tuning of sharpness and noise dimension, it is suggested to give priority to sharpness first, and show the sharpened details before noise reduction. If tuning is done in the actual on- demand environment, it is necessary to set the code rate high and reduce the level of 3DNR to the minimum, and observe whether the details of the still picture are sharpened. It is better to tune the noise reduction module on the premise that the clarity meets the requirements, and finally achieve the balance of clarity and noise. The preparation environment before adjusting the clarity and noise: correct correction of black level, complete calibration of LSC, reasonable adjustment of AE exposure, reasonable calibration of AWB and CCM parameters, and reasonable adjustment of Gamma/Dehaze/Enhance.
Modules affecting clarity and noise mainly include Bayer NR, Demosaic, DPCC, YNR, UVNR, 3DNR, Sharpen, EdgeFilter and so on.
Step 1:The first point for the basic texture details of an image is Demosaic. Before tuning this module, we need to confirm that: black level calibration is accurate, RAWNR calibration is reasonable, AWB/CCM calibration is reasonable.
First of all, we need to tuning Demosaic parameters against the resolution card under ISO50 under the laboratory light box environment D65 light source, so that the resolution card's analytical force can meet the requirements of objective indicators. At the same time, we need to check whether the high-frequency texture of the star map in the static scene can be interpolated in the ISO50 environment, so as to iterate back and forth. The same adjustment is then required for the other ISO to balance the high frequency noise with the interpolated noise and whether the sharpness is appropriate. Figure 3-10 shows a schematic diagram of a resolution card in a D50 light source environment. The red frame is the 4:3 field of view, and the blue frame is the central area of attention. Refer to Section 4.4 "Demosaic" for specific tuning methods of Demosaic.
Figure 3-10 Schematic diagram of the definition card in the laboratory light box D65 light source environment
Step 2: After the parameter tuning of Demosaic is reasonable, then focus on the joint tuning of Bayernr,YNR,UVNR, 3DNR, Sharpen and DPCC modules.
Below environments should be prepared before Bayer NR module:accurate black level correction , reasonable RAWNR calibration, reasonable AWB/CCM calibration.
Bayer NR, as the most advanced noise processing module, should not turn the intensity too high, otherwise it will lose the clarity of the picture. Please refer to Section 4.5 "Bayer NR" for specific tuning methods of Bayer NR. Step 3: YNR and UVNR are noise reduction modules where we should place emphasis on. YNR can independently control the intensity for whether high-frequency, low-frequency or medium- frequency noises of the picture, while ]UVNR is used to remove color noise, whose intensity does not affect the clarity, but too much intensity will lead to color distortion. For specific tuning methods of YNR and UVNR, please refer to Section 4.6 "YNR and UVNR". please refer to Section 4.6 "YNR and UVNR".
Step 4: Sharpen and Edgefilter tuning principle is mainly, adjust the texture detail and edge sharpness of the image to the right level. In laboratory static scene, for example, sharpen and Edgefilter this two modules need sharpening details (such as green vine, green algae, little bear, hemp rope, etc.) before go through 3DNR static scene, as well as the strong edge sharpening out such as the circle in the center of the map. The details are shown in the following figure. Refer to 4.7 "Sharpen and EdgeFilter" section for detailed tuning methods for Sharpen and EdgeFilter.
Figure 3-11 ISO50 in a static scene requires attention to sharpened textures
Step 5: DPCC dynamic bad point intensity only needs to confirm clearly in the scene with slightly lower illumination. It is suggested that set DPCC level a bit weaker when scene illuminance is good. For specific tuning methods of DPCC, please refer to Section 4.8 "DPCC".
Step 6: 3DNR is the key to the overall balance of noise and sharpness, including DEC,REC, and NR tuning. The module breaks down the noise into different frequency bands and then removes them separately and then fuses them. When optimizing the 3DNR, we need to pay attention to the edges of moving objects, the ghosting degree of moving objects, and the overall noise acceptability. As shown in the red box below, there needs to be a balance between the motion blur of the figure and the overall noise. Please refer to Section 4.9 "3DNR" for specific tuning methods of 3DNR. Figure 3-12 Schematic diagram of 3DNR test points
Step 7: After the above steps have been completed, the final results need to be tested at each ISO, and weaked if necessary, to achieve the overall clarity and noise balance
---The end of Clarity and noise Dimension
3.1.2 HDR mode IQ tuning
For HDR mode, the image quality mainly focuses on the following dimensions: dynamic range, brightness, sharpness and noise, permeability, color restoration and the performance of motion trailing, etc. In these modules, the modules that affect brightness mainly include AE and LSC and the dynamic range mainly depends on the exposure ratio control. the modules that affect definition and noise mainly include Bayer NR, Demosaic, DPCC, YNR, UVNR, 3DNR, Sharpen, EdgeFilter, etc. the modules that affect permeability mainly include Gamma, Dehaze, Enhance, etc.the modules that affect color mainly include AWB, CCM and 3DLUT. The severity of the trailing motion depends on the control of the HDR parameter and the exposure ratio. Most typical application scenarios of HDR include face acquisition under backlight or license plate acquisition under strong light.
The overall architectural diagram of HDR mode image tuning is shown in Figure 3-13. Figure 3-13 HDR mode image tuning architecture diagram Before the image quality tuning of HDR mode, the docking of sensors and the calibration of lens modules are required. For the docking steps of sensors, please refer to the description about the docking of sensors in the section 3.1.1. In the calibration of the lens module, AWB, Shading, Bayer NR and other modules can refer to the parameter calibration of linear mode. If the HDR mode of the sensor is HCG/LCG mode, different modes shall be followed up to calibrate Bayer NR, YUV NR, 3DNR and other modules respectively. Since CCM is after HDR TMO, the TMO module destroys the linear relationship of data, so the CCM in HDR mode needs to be adjusted appropriately:
-
The saturation calibration value is about 80%~90%;
-
If some colors appear abrupt, it can be fine tuned by 3D LUT.
-
Appropriately reduce the TMO module to greatly improve the brightness and reduce the impact on color restoration. When the brightness is insufficient, joint tuning of Gamma module and HDR TMO can be considered.
After the Sensor docking and Sensor lens calibration are completed, tuning is mainly carried out for the dimension of image quality concern in HDR mode.
Application Scene Tuning Guide of Enhance Face Brightness under HDR Backlight Scene
Dimension one: Brightness Dimension
The brightness dimension of HDR, mainly refers to the rationality of AE exposure, and mainly be changed by tuning AE module, which has two sub-control modules: HDR AE and Linear AE. The difference between HDR AE and linear AE is that, the adjusting of multiple frames exposure ratio is needed in HDR mode, which isn't needed in linear mode. The tuning of HDR AE exposure ratio will be mainly introduced here. Other parameters of AE include AE weight table, AE Route, AE target value, and AE convergence speed and smoothness. For details, please refer to the brightness dimension section of 3.1.1 "Linear Mode Image Quality Tuning".
The exposure ratio of HDR AE determines the dynamic range of images in HDR mode, so for different dynamic range of scenes, AE exposure ratio in HDR mode needs to be adjusted adaptively. The mode of HDR AE exposure ratio supports the mode of automatic exposure ratio which means that HDR AE will automatically calculate the dynamic range of the scene according to the histogram of the scene and obtain a reasonable exposure ratio. The rationality of the exposure ratio means that bright details are not over-exposed and the brightness of long frames is reasonable. Long frame exposures are the benchmark for HDR AE, while short frame exposures are determined by exposure ratio.
In HDR mode, short frame images are preferred for bright areas and long frame images are preferred for dark areas. In a backlit scene, the face is in the dark area of the scene. The steps to improve the brightness of the face are suggested as follows:
- Improve the brightness of long-frame image by adjusting AE parameters, including weight table, AE Route, AE long-frame target value, etc 2. Enhance dark area brightness by adjusting HDR TMO module parameters including DetailSlowLight. 3. limiting the maximum exposure ratio to control the dynamic range of the image, and the brightness of the dark area will also be slightly increased to some extent.
Figure 3-14 Schematic diagram of long frame dark area
Dimension two: Motion trailing dimension of the composite region
HDR mode affects the composite area of images from long and short frames respectively. In principle, motion trailing is caused by the movement of the image content due to the time difference between the exposure time of long frame and short frame. The exposure ratio of HDR modules and HDR AE was adjusted for this dimension mianly. The larger the exposure ratio, the greater the probability of motion trailing in the synthesis region.
- Tuning reasonable HDR AE exposure ratio with consideration of dynamic range and motion trailing of the scene. 2. Under the same exposure ratio condition, adjust the exposure time of short frames to reduce the exposure delay between short and long frames, thus reducing the tailing degree. 3. By adjusting the parameters of the HDR MERGE module including OECurve_XXX and MDCurve_XXX, reduced the probability of misuse of short frames cased by motion in the composite region, thus reducing the motion trailing situation. Figure 3-15 Schematic diagram of motion tailing in HDR synthesis area
Dimension two: Scene dynamic scope dimension
HDR mode affects the dynamic range of image including: AE exposure ratio, HDR TMO module and Gamma module.The entry conditions for tuning TMO module are: correct calibration of black level, complete calibration of ShadimNG, reasonable tuning of AE module, complete calibration of AWB and CCM, and a set of Gamma parameters.
The HDR TMO module supports both Global TMO and Local TMO. Local TMO dynamic range is better on the whole, but due to the small filtering window, the contrast of the light and dark interface area in the image is stretched to form the edge line. The TMO Contrast parameter can be adjusted when tuning TMO module, which can adjust the blend effects and balance the final effect of these two .The recommended value is around 0.3.
As shown in Figure 3-16, similar scenes are arranged in separate boxes, illuminometers are placed, and dimmable LED supplementary lights are placed at 45 degrees on both sides of the boxes, so that scenes with different dynamic ranges can be simulated. Figure 3-16 Diagram of dynamic range tuning scenario
Dimension three: color dimension
Please refer to the color tuning method in linear mode; Note that in HDR mode, the color performance is slightly different from linear due toToneMap. After calibration, it is recommended to appropriately desaturate according to the situation.
Dimension four: Contrast dimension
Please refer to the color tuning method in linear mode.
Dimension five: Clarity and noise Dimension
Please refer to the Clarity and noise tuning method in linear mode;
4 Module Introduction
This chapter mainly introduces the functions and parameters of each module. The parameters are stored in the form of XML file in firmware, and some of these parameters can be tuned by tuning tools. The format of the parameter specification is briefly described in this section as follows:
“ ” :indicates that the parameter is a string form
xxx/yyy : indicates that yyy element entity is as xxx child element entity in the XML file
Multi-scenario Apply Operation mode of IPC Products IPC applications require multiple scenarios, such as daytime color, night vision black and white, and high dynamic range (HDR). According to the operation mode of different scenes, the emphasis on tuning effect of each image processing module is different. The modules that support the independent configuration of parameters in the operation mode of the scene are such as:
BNR YNR UVNR MFNR Edgefilter Gamma Dehaze & Enhance
4.1 AEC
4.1.1 Function Description
AE module is mainly composed of two parts: the metering statistics module and AE control algorithm module. The metering statistics module transport brightness statistics information, which includes histogram statistics information and block average brightness statistics information, to AE control algorithm module. The statistical information mainly includes the following parts: 256-segment weighted histogram statistical information based on RAW, partitioned R/G/B/Y mean statistical information based on RAW; the 32-segment weighted histogram statistics based on the pre-Gamma RGB data and the block R/G/B/Y mean statistics based on the pre-Gamma RGB data.
Then the AE control algorithm module compares the input brightness statistics value with the target brightness, calculates the new exposure value, and finally automatically seperate the new expsoure value into sensor exposure time, gain and lens aperture value to obtain the image with appropriate brightness.
Figure 4-1 AEC module schematic diagram
4.1.2 Key Parameter
According to the function, the parameters of AEC module can be roughly divided into 3 parts: common control parameters, linear exposureTuning parameters and HDR exposureTuning parameters respectively.In addition, this chapter will also introduce SensorInfo and System parameters related to exposure. See the detailed description on following pages.
4.1.2.1 AEC Module Common Control Parameters
Enable
AEC module switching function. 0:off;1:on
【Notes】
When Enable is 0, the AEC algorithm is turned off. Exposure will be kept at the current value.
AecRunInterval
AE algorithm running interval value, its range is [0,255] and the default value is 0. When value is 0, AE algorithm run for each frame.When the value is 1, AE algorithm run every one frame, and so on.
It is recommended that the value should not be too large, otherwise it may lead to slow and uneven AE convergence.
AecOpType
Exposure mode, is divided into Auto mode and Manual mode.
The manual exposure mode needs to be combined with AecManualCtrl to set the manual exposure value.
HistStatsMode
Histogram statistical mode. There are five modes in total: Y/R/G/B/RGB, and the default mode is Y.。
RawStatsMode
Luminance statistical mode. There are four modes in total: Y/R/G/B, and the default mode is Y.
YrangeMode
Y channel statistical mode.There are two modes in total: FULL/LIMITED, and the default mode is FULL.
AecSpeed
Speed of AE convergence
【Member 】
| Member | Description |
|---|---|
| DampOver | Exposure convergence speed when the ambient brightness range is small and the image brightness value is higher than the target value. The value range of this speed is [0,1]. |
| DampUnder | Exposure adjustment speed when the ambient brightness range is small and the image brightness value is below the target value.The value range of this speed is [0,1]. |
| DampDark2Bright | The speed of exposure adjustment when the ambient brightness varies widely from dark to light. The value range of this speed is [0,1]. |
| DampBright2Dark | The speed of exposure adjustment when the ambient brightness varies widely from light to dark. The value range of this speed is [0,1]. |
【Notes】
The damping coefficient is used to adjust the exposure speed by adjusting the weight of the current exposure value and the current exposure value. Final exposure value = current exposure value *Dampcoef + new exposure x (1 - DampCoef )The greater the damping coefficientis, the slower the exposure adjustment speed is, and vice versa. In order to ensure the smooth adjustment process, it is recommended to set the adjustment speed within the range of [0.4,0.7] When there is a sudden change in ambient brightness (dark to light/light to dark), use DampDark2Bright/ DampBright2Dark as damping coefficients;When the ambient brightness is stable, DampOver/DampUnder is used as the damping coefficients. It is suggested that the value of DampDark2Bright/ DampBright2Dark is smaller than the DampPover /DampUnder, the value of DampDark2Bright is smaller than the DampBright2Dark and the value of DampOver is smaller than the DampUnder.
AecDelayFrmNum
Auto exposure delay triggers property.
【Member 】
| Member | Description |
|---|---|
| BlackDelay | Auto exposure triggers delay property. When the image brightness falls below the target value, lasting over Blackdelay frames, AE starts to work. |
| WhiteDelay | Auto exposure triggers delay property. When the image brightness exceeds the target value, lasting over WhiteDelay frames, AE starts to work. |
【Notes】
BlackDelay/ Whitedelay should not be too large, otherwise it will cause slow response of AE trigger.
AecFrameRateMode Automatic exposure frame rate mode, can be divided into fixed- frame-rate mode and automatic- drop-frame mode.
【Member】
| Member | Description |
|---|---|
| isFpsFix | When the value is 0, namely using automatic-frame-drop mode; while the value of 1 indicates a fixed-frame-rate mode. |
| FpsValue | Only valid in fixed-frame-rate mode. When the default value is 0, default frame rate in sensor driver will be used; When the Value is not 0, the set frame rate value is used. |
【Notes】
Fixed-frame-rate mode: need to enable isFpsFix. When FpsValue is 0, the default frame rate in the driver is used;Value is not 0, the set frame rate value is used.In fixed- frame-rate mode, the maximum exposure time will be determined by the frame rate and the maximum exposure time set in AECRoute.When the maximum exposure time set in AECRoute exceeds the current fixed frame rate, the algorithm internally corrects the maximum exposure time. automatic drop frame mode:set isFpsFix to 0, and the FpsValue is invalid. The minimum frame rate for automatic frame drop mode is determined by a combination of the maximum exposure time in AECRoute and the CISMINFPS in SensorInfo.When the maximum exposure time in AECRoute exceeds the maximum exposure time allowed by CISMINFPS, the value is corrected internally by the algorithm.After the seperation of exposure value, if the exposure time is greater than the value allowed by the default frame rate of sensor driver, the VBLANK value will be modified to reduce the frame rate and increase the exposure time.If the exposure time is less than or equal to the exposure time allowed by the driver's default frame rate, the current frame rate is set to the driver's default frame rate.
AecAntiFlicker
Automatic exposure resistance to power flicker
【Member 】
| Member | Description |
|---|---|
| enable | When the value is 1, anti-flicker function is enabled, otherwise it is closed. |
| Frequency | Setting power frequency, divided into:FLICKER 50HZ和FLICKER 60HZ _ _ |
| Mode | Working mode of anti-flicker function, which has two types: NORMAL mode, AUTO mode |
【Notes】
When enable is set to 0,it stands for turning off anti-flicker function。Normal anti-flicker mode:The minimum exposure time and exposure time adjustment step are fixed at 1/120 S (60Hz) or 1/100 S (50Hz). Therefore, in high brightness environments, over-exposure may occur. In the presence of light, the exposure time should be matched to the power frequency of the light source to prevent flicker. Auto anti-flicker mode:The exposure time is adjusted according to the brightness. The minimum exposure time can reach the minimum exposure time allowed by the sensor. The difference between the auto mode and normal mode is that over-exposure can be avoided under high brightness environment, but with flicker.
AecInitValue
Initial exposure value setting. According to the exposure working type, there are two sets of parameters: LinearAE and HDR AE.
【Member 】
| Member | Description |
|---|---|
| LinearAE | Auto exposure initial value property in linear mode |
| InitTimeValue | Initial exposure time value. The unit is second. |
| InitGainValue | Initial sensor gain value, whitch is the actual value. The unit is 1X. |
| InitIspDGainValue | Initial ISP gain value, whitch is the actual value.The unit is 1X. |
| InitPIrisGainValue | Initial P aperture equivalent gain value, whitch is the actual value. The unit is 1X. |
| InitDCIrisDutyValue | Initial DC aperture pwm, within the range of [0,100] |
| HdrAE | Auto exposure initial value property in Hdr mode |
【Notes】
When the initial values of automatic exposure are not set, the system default values will be used. The value of the initial exposure is limited by the maximum/minimum value of the auto exposure seperation route(namely AecRoute).When it exceeds or falls below the maximum/minimum value of the auto exposure seperation route, the maximum/minimum value of the auto exposure seperation route will be used. The initial value of the equivalent gain of P aperture for automatic exposure, which is valid only when the aperture type is P aperture. The default initial value is the equivalent gain of the maximum aperture supported by P aperture.For detailed explanation of equivalent gain , please see AECIRISCTRL module. The initial value of the equivalent gain of DC aperture for automatic exposure, which is only valid when the aperture type is DC aperture. The default initial value is the maxPwmValue of the DC aperture, at which point the DC-Iris will open at maximum speed.For detailed explanation of duty cycle and MAXPWMVALUE , please see AECIRISCTRL module. RV1109 /RV1126 does not support ISP digital gain currently, so the initial SPDGainValue is invalid.
AecGridWeight
Weight table of each block in the image【Member 】
| Member | Description |
|---|---|
| DayGridWeights | window (histogram) weight in Day mode, containing 15*15 array elements, with value range [0,32] |
| NightGridWeights | window (histogram) weight in Night mode, containing 15*15 array elements, with value range [0,32] |
【Notes】
DayGridWeights denotes the window weights in day mode, that is, the window weights used without night mode or IR function;NightGridWeights denotes the weight of the window in night mode or IR open mode. Night mode and IR mode cannot be enabled at the same time. IR mode requires hardware support. The current hardware of RV1109/1126 can support weight setting of two specifications, 5X5 and 15X15. In the tuning file, the weight can be set as 5x5 or 15x15 as you like. The algorithm will extended or compress the weight from tuning file, according to the actual hardware configuration.
AecRoute
Automatic exposure seperation properties. It is used to set AE exposure seperation route. The exposure value calculated by AE algorithm will be allocated according to the set route. Users can set the route as exposure time priority (shutter priority), gain priority or aperture priority according to specific application requirements.
【Member】
LinearAE
| Member | Description |
|---|---|
| name | The name of mode, divided into day mode and night mode |
| TimeDot | Exposure time node, in second unit |
| GainDot | Sensor gain node, where the gain value is the actual value, the unit is 1x |
| IspgainDot | ISP gain node, where the gain value is the actual value, the unit is 1x |
| PIrisDot | Aperture equivalent gain node, where the gain value is the actual value, the unit is 1x |
HdrAE
| Member | Description |
|---|---|
| name | The name of mode, divided into day mode and night mode |
| L/M/STimeDot | In HDR 2 frame mode, only M/ STimeDot is effective, while L/M/ STimeDot are all valid when HDR is in 3 frame mode. |
| L/M/SGainDot | Sensor gain node. In HDR 2 frame mode, only M/ sGAINDOT is effective, while L/M/ SGainDot are all valid when HDR is in 3 frame mode. Here the gain value is the actual value, in units of 1x. |
| L/M/SIspDGainDot | ISP digital gain node. In HDR 2 frame mode, only M/ SIspDGainDot is effective, while L/M/ SIspDGainDot are all valid when HDR is in 3 frame mode. Here the gain value is the actual value, in units of 1x. |
| PIrisDot | Aperture equivalent gain node, where the gain value is the actual value, the unit is 1x |
【Notes】
Figure 4-2 Schematic Diagram of Exposure Decomposition
The number of nodes in the exposure seperation route should not be more than 10, and it is recommended to set at least 6 nodes. It should be noted that in HDR 2 frame mode, only M/ STIMEDOT, M/ SGAINDOT and M/ SISPDGAINDOT need to be set to correspond to actual long and short frames respectively;In HDR 3 frame mode, L/M/ STIMEDOT, L/M/ SISPDGAINDOT and L/M/ SISPDGAINDOT should be set to correspond to long, medium and short frames respectively.When setting the sensor exposure time of each frame in HDR mode, the exposure time shall be reasonably allocated. The total exposure time of each frame shall not exceed the maximum exposure time allowed by the frame rate. The exposure value of each node is the product of the exposure time, sensor gain, ISP digital gain, aperture equivalent gain, and must be monotonically increasing, that is, the exposure of the latter node must be greater than the exposure of the previous node.The first node has the smallest exposure and the last node has the largest exposure. The exposure time component in the node is in seconds, and the minimum value is allowed to be 0. The actual minimum exposure time used will be corrected internally according to the sensor limit. Aperture component only supports P-IRIS, not DC-IRIS.The P-Iris equivalent gain component is only valid when the AIRIS automatic aperture function is enabled, otherwise the default aperture is fixed at the initial size.See AECIRISCTRL module for the detailed calculation method of P-IRIS equivalent gain. The exposure seperation route set is not the final result.The actual maximum/minimum value of each exposure component is determined jointly by the exposure seperation route and the manually configured maximum/minimum value of the exposure component.First, the maximum/minimum value of the node in the exposure decomposition route is corrected for the first time. When the maximum/minimum value of the node does not exceed the limit of the sensor or ISP, the maximum/minimum value of the node remains unchanged.If the maximum/minimum value of the node exceeds the sensor or ISP limit, the maximum/minimum value of the node shall be subject to the sensor or ISP limit.When the maximum/minimum value of the manually configured exposure component is 0, the final effective exposure decomposition route shall be the decomposition route of the first correction.When the maximum/minimum value of the manually configured exposure component is not 0, and the maximum/minimum value set does not exceed the limit of the sensor or ISP, the second correction is made for the exposure decomposition route, and the maximum/minimum value of the node is subject to the range set manually.If the maximum/minimum value of the exposure component is set to exceed the limit of the sensor or ISP, the maximum/minimum value of the node of the exposure component of the exposure decomposition route shall be subject to the result of the first correction. If the exposure of neighbor nodes increases, only one exposure component should increase and the others should be fixed.The increased component determines the allocation strategy for this section.For example, the gain component increases while other components are fixed, then the allocation strategy for this section of route is gain-priority. RV1109/RV1126 does not support ISP digital gain currently , so ISPGAINDOT and L/M/ SISPDGAINDOT are invalid.
AecManualCtrl
Manual exposure parameter setting, which is divided into LinearAE and HdrAE according to exposure mode.
【Member】
| Member | Description |
|---|---|
| ManualTimeEn | Manual exposure time enable, default is 1 |
| ManualGainEn | Manual sensor gain enable, the default value is 1 |
| ManualIspDgainEn | Manual ISP digital gain enable, the default value is 1 |
| ManualIrisEn | Manual aperture enable, the default value is 1 |
| TimeValue | Manual exposure time value, in units of s, is limited by the sensor |
| GainValue | Manual sensor gain value,whitch is the actual value, and the unit is 1x. Parameter value is limited by the sensor |
| IspDGainValue | Manual ISP digital gain value, whitch is the actual value, and the unit is 1x. Parameter value is limited by ISP |
| PIrisGainValue | Manual P aperture equivalent gain value, whitch is the actual value, the unit is 1x, the parameter value is limited by the p-aperture equipment, the value range is [1,1024] |
| DCIrisValue | Hold Value of DC aperture, the parameter value is related to DC aperture equipment, and the value range is [0,100] |
【Notes】
This module is only valid when AeOptype = MANUAL. When ManualTimeEn, ManualGainEn, ManualISPDgainEn, and ManualPIrisEn are all enabled, it is manual mode; as long as any one of the above parameterd is disabled, it is semi-automatic mode; if the above mentioned parameters are all disabled, it is equivalent to automatic mode, and the system will report an error reminder. In manual/semi-manual mode, the manual exposure time and gain will be limited by the maximum/minimum exposure time and gain in automatic mode. If the range of auto exposure limit is exceeded, the maximum/minimum value in auto mode will be used instead. ManualIrisEn, manual iris enable. When the aperture type is P aperture, only PirisGainValue is valid; when the aperture type is DC aperture, only DCIrisValue is valid. DCIrisValue, directly set the PWM duty cycle value of the motor in manual mode, the value range is [0, 100]. In manual mode, if it is set to the HoldValue value (that is, the value in the range from ClosePwmDuty to OpenPwmDuty in AecIrisCtrl), the DC iris aperture remains at the current size; if the set value is greater than OpenPwmDuty, the iris is in the open state, and the larger the value is the fast the opening spped is; if the set value is less than ClosePwmDuty, the iris is in closed state. The smaller the value, the higher the closing speed. RV1109/RV1126 does not support ISP digital gain currently , so ManualISPDgainEn and ISPDGainValue are invalid.
AecIrisCtrl
Aperture control parameters
【Member】
| Member | Description |
|---|---|
| Enable | Enable auto iris function |
| IrisType | Aperture type, P (ie P-iris aperture) or DC (ie DC-iris aperture) |
PIrisAttr
| Member | Description |
|---|---|
| TotalStep | The total number of steps of the P-iris motor, whose specific size is related to the P-iris lens. |
| EffcStep | The available number of steps of the P-iris motor, whose specific size is related to the P-iris lens. |
| ZeroIsMax | This parameter denotes to whether the P-iris stepping motor step0 corresponds to the maximum aperture position, whose specific value is related to the P-iris lens. The value is 0, which means that when the position of the stepper motor is step0, the iris is opened to the minimum. The value is 1, which means that when the position of the stepper motor is step0, the iris is opened to the maximum. |
| StepTable | The mapping table of the P-iris stepper motor position and the equivalent gain of the iris. The specific value is related to the P-iris lens. |
DCIrisAttr
| Member | Description |
|---|---|
| Kp | The proportional coefficient, used to limit the opening and closing speed of the aperture when the aperture changes drastically. The larger the value, the slower the aperture opening and closing speed when the light changes drastically. If the value is too large, the braking will be advanced during the adjustment process, resulting in too long adjustment time; if the value is too small, the braking during the adjustment process will lag behind, resulting in an increase in overshoot. The reasonable setting of this value is related to the characteristics of the DC-iris lens and circuit. The recommended value is 0.5. The value range is [0, 1]. |
| Ki | The integral coefficient, used to adjust the opening and closing speed of the iris. The larger the value, the greater the opening and closing speed of the iris. If the value is too large, overshoot is likely to cause oscillation; if the value is too small, the iris adjustment speed is slow and when the environment brightness changes drastically, it is easy to oscillate. The recommended value is 0.2. The value range is [0, 1]. |
| Kd | The differential coefficient, used to adjust the opening and closing speed of the iris. The larger the value, the greater the opening and closing speed of the iris. The recommended value is 0.3. The value range is [0, 1]. |
| MinPwmDuty | The minimum PWM, whose value is related to the DC-iris lens and circuit characteristics, and the unit is %. The smaller the value, the faster the supported aperture closing speed, but it is easy to cause the aperture to oscillate. The value range is [0,100], and the default value is 0. |
| MaxPwmDuty | The maximum PWM, whose value is related to the characteristics of the DC-iris lens and circuit, and the unit is %. The larger the value, the faster the supported aperture opening speed. If the value is too small, it may cause the aperture control to exit when the aperture has not reached the maximum. The value range is [0,100], and the default value is 100. |
| OpenPwmDuty | The PWM threshold when the iris is open. When the PWM the iris is higher than (not included) OpenPwmDuty, the iris is in the open state. The specific size is related to the DC-iris lens, the unit is %, and the value range is [0,100]. |
| ClosePwmDuty | The PWM threshold when the iris is closed. When the PWM of the iris is less than (excluding) ClosePwmDuty, the iris is closed. The specific size is related to the DC-iris lens, the unit is %, and the value range is [0,100]. |
【Notes】
When the auto iris control function is turned off, for DC-iris, the iris will be opened to the maximum by default; for the P-iris iris, it will be opened to the stepper motor position corresponding to the maximum iris by default. If you want to change the position of above , you can refer to the AecInitValue module to modify InitPIrisGainValue and InitDCIrisDutyValue. The basic control process of the automatic iris algorithm is as follows: For the DC-iris lens, Airis controls the aperture size of the DC-iris lens according to the deviation between the current brightness and the target brightness. When the exposure reaches the minimum value and the current brightness exceeds the tolerance range of target brightness , the AE control will be exited with fixed exposure time and exposure gain, and the AIris control algorithem will be enabled. If the current image brightness is stable and the PWM duty value of DC-iris is greater than OpenPwmDuty, it is considered that the current aperture has reached the maximum. AIris aperture control will be exited and be replaced by AE. For P-iris lens, the iris is controlled bythe AecRoute module. The aperture size of the P-iris lens is converted into an equivalent gain, which participates in the exposure seperation calculation For P-iris, the mapping table (StepTable) is generally made according to the corresponding relationship between the step motor position and the iris aperture, which is provided by the lens manufacturer. The control of P-iris is controlled by the AecRoute module of AE, which converts the size of the iris aperture into an equivalent gain. Therefore, the iris control of P- iris requires good linearity. The value range of the equivalent gain is [1,1024], the equivalent gain 1024 represents F1.0, the equivalent gain 512 represents F1.4, and so on, the equivalent gain 1 represents F32.0. When making the table, it is necessary to convert the aperture size,which is corresponding to the position of the stepper motor, into an equivalent gain, in the order of increasing the position of the stepper motor (ie step0, step1...stepN). TotalStep represents the total number of steps of the P-iris stepper motor, the specific size is related to the P-iris lens (provided by the lens manufacturer). EffcStep represents the number of steps used in algorithm , which is generally required to be less than TotalStep. Considering the value of the equivalent gain error is relatively large, when the step position is close to be ending position, the step position near the closing end of the iris is usually not used to avoid oscillation. Table 4-1 is the mapping table of P-iris stepper motor position, iris aperture and equivalent gain. Take this table as an example to explain how to make StepTable. The corresponding relationship between the step motor position step and the aperture area in the 1-2 and 4-5 columns of Table 4-1 is provided by lens manufacturer. The stepper motor of this P-iris lens has a total step number of 81. The corresponding aperture at step0 is the largest, and the nominal maximum number of apertures is 1.4. When the aperture is 1.4, the corresponding equivalent gain is 512, so the corresponding equivalent gain at step 0 is 512. The calculation method to get equivalent gain corresponding to aperture areas, here taking step 3 as an example, is as follows: the aperture area of step 3 is 195.869, the corresponding equivalent gain = 512* (195.869/201.062) = 499 (rounded). Thus, the equivalent gain values corresponding to other stepper motor positions can also be calculated based on the method mentioned above. It can be seen from Table 1-1 that when the stepping motor is close to the closed end, its corresponding aperture area is very small, and the difference between it and the largest aperture area can be several thousand times, which will lead to great error. Therefore, it is recommended to not use the stepping motor position at the closed end to avoid exposure oscillation due to great errors. The equivalent gain corresponding to each stepper motor position in the table is filled into StepTable in increasing order of stepper motor position increment (ie step0, step1...stepN). The values of OpenPwmDuty and ClosePwmDuty of DC-iris need to be measured, and their specific values are related to the DC-iris lens. For some lens, when the PWM duty cycle is greater than OpenPwmDuty, the iris is opened; when the PWM duty cycle is less than ClosePwmDuty , the iris is closed; when the PWM duty cycle is greater than or equal to ClosePwmDuty and less than or equal to OpenPwmDuty, the iris is stable The corresponding pwm value of stable position is called HoldValue. There are also some lens, only having one threshold to control iris open and close, that is, when the PWM duty cycle is greater than the threshold, the iris performs an opening operation; when the PWM duty cycle is less than the threshold, the iris performs a closing operation; when the PWM duty cycle is equal to the threshold, the iris is stable at the current position, and the threshold is HoldValue. At this time, you can set ClosePwmDuty = OpenPwmDuty = HoldValue. The manual setting of the aperture is consistent with that of exposure. When you need to use the manual iris function, you need to set AecOpType to manual mode and enable the ManualIrisEn parameter in the AecManualCtrl module. When IrisType is P-iris, only PirisGainValue is valid; when IrisType is P-iris, only DCIrisValue is valid.
Tab 4-1 Correspondence table of P-iris stepper motor position, iris aperture and equivalent gain
| Step | Aperture Area(mm^2^) | Equivalent Gain | Step | Aperture Area(mm^2^) | Equivalent Gain |
|---|---|---|---|---|---|
| 0 | 201.062 | 512 | 41 | 56.653 | 144 |
| 1 | 200.759 | 511 | 42 | 53.438 | 136 |
| 2 | 198.583 | 506 | 43 | 50.282 | 128 |
| 3 | 195.869 | 499 | 44 | 47.188 | 120 |
| 4 | 192.879 | 491 | 45 | 44.159 | 112 |
| 5 | 189.677 | 483 | 46 | 41.197 | 105 |
| 6 | 186.293 | 474 | 47 | 38.307 | 98 |
| 7 | 182.744 | 465 | 48 | 35.49 | 90 |
| 8 | 179.035 | 456 | 49 | 32.751 | 83 |
| 9 | 175.271 | 446 | 50 | 30.093 | 77 |
| 10 | 171.484 | 437 | 51 | 27.519 | 70 |
| 11 | 167.681 | 427 | 52 | 25.034 | 64 |
| 12 | 163.865 | 417 | 53 | 22.642 | 58 |
| 13 | 160.036 | 408 | 54 | 20.347 | 52 |
| 14 | 156.198 | 398 | 55 | 18.154 | 46 |
| 15 | 152.351 | 388 | 56 | 16.068 | 41 |
| 16 | 148.499 | 378 | 57 | 14.096 | 36 |
| 17 | 144.642 | 368 | 58 | 12.245 | 31 |
| 18 | 140.783 | 359 | 59 | 10.522 | 27 |
| 19 | 136.925 | 349 | 60 | 8.935 | 23 |
| 20 | 133.069 | 339 | 61 | 7.484 | 19 |
| 21 | 129.217 | 329 | 62 | 6.169 | 16 |
| 22 | 125.371 | 319 | 63 | 4.987 | 13 |
| 23 | 121.535 | 309 | 64 | 3.936 | 10 |
| 24 | 117.709 | 300 | 65 | 3.014 | 8 |
| 25 | 113.897 | 290 | 66 | 2.22 | 6 |
| 26 | 110.1 | 280 | 67 | 1.55 | 4 |
| 27 | 106.321 | 271 | 68 | 1.003 | 3 |
| 28 | 102.562 | 261 | 69 | 0.577 | 1 |
| 29 | 98.826 | 252 | 70 | 0.268 | 1 |
| Step | Aperture Area(mm^2^) | Equivalent Gain | Step | Aperture Area(mm^2^) | Equivalent Gain |
|---|---|---|---|---|---|
| 30 | 95.115 | 242 | 71 | 0.075 | 0 |
| 31 | 91.431 | 233 | 72 | close | 0 |
| 32 | 87.777 | 224 | 73 | close | 0 |
| 33 | 84.156 | 214 | 74 | close | 0 |
| 34 | 80.569 | 205 | 75 | close | 0 |
| 35 | 77.02 | 196 | 76 | close | 0 |
| 36 | 73.51 | 187 | 77 | close | 0 |
| 37 | 70.043 | 178 | 78 | close | 0 |
| 38 | 66.621 | 170 | 79 | close | 0 |
| 39 | 63.247 | 161 | 80 | close | 0 |
| 40 | 59.923 | 153 |
AecDNSwitch
The AEC Tuning parameters which are configured to switch between day and night modes, according to this parameter.
【Member】
DNTrigger:Tuning parameters switching enable.
0: AEC parameter does not switch with the day and night mode, and the day parameter is used by default.
1: AEC parameter is switched with the day and night modes.
【Notes】
The AecDNSwitch module is not a module for judging the day and night mode. At present, the judgment of the day and night scene is performed by the CPSL module. For details, please refer to the CPSL module parameter description. In AecDNSwitch module, only DNTrigger is valid. At present, only the weight parameters and exposure seperation route in the AEC module support to be switched with the day/night mode.
4.1.2.2 Tuning parameters of linear exposure in AEC module
RawStatsEn
Linear exposure supports the use of Raw statistical brightness or RGB domain statistical brightness to calculate exposure, which can be switched according to specific application requirements. The raw statistical value is used by default, that is, the position is 1.
RawStatsEn = 0 , indicates that the statistical value of the RGB image (before gamma) is used to calculate the exposure RawStatsEn = 1 , indicates that the statistical value of the raw map (the black level has been subtracted and multiplied by the white balance gain value) is used to calculate the exposure
SetPoint
Denotes the target brightness value in day mode, and the value range is [0,255]
NightSetPoint
Denotes the target brightness value in night mode, and the value range is [0,255]
EvBias
The deviation percentage of the exposure during automatic exposure adjustment. The unit is %, and the value range is [-200,+200]
It is used to adjust the (fixed/dynamic) target brightness value (SetPoint/NightSetPoint) in special cases. The actual effective target brightness is (SetPoint/NightSetPoint)* [1+abs(EvBias)/100]^[EvBias/abs(EvBias)].
For example, when EvBias=100, the brightness is twice the default parameter; when EvBias=-100, the brightness is 1/2 of the default parameter.
ToleranceIn/Out
The tolerance between the target brightness and the actual brightness. The unit is %, and the value range is [0,100]
When the automatic exposure converges, the actual brightness value B should be within the range of [real effective target brightness X (1-tolerance/100), real effective target brightness X (1+tolerance/100)].
ToleranceIn represents the tolerance when the exposure does not converge, and ToleranceOut represents the tolerance when the exposure converges. It is recommended that ToleranceIn <ToleranceOut, to avoid too sensitive exposure changes, and to stabilize exposure.
StrategyMode
Automatic exposure strategy mode, including high light priority or low light priority
【Notes】
This parameter is temporarily invalid
DySetPointEn
Dynamic target brightness value enable switch. When the value is 1, the dynamic target brightness value is used, and when the value is 0, the fixed target brightness value is used, and the dynamic target brightness value is invalid.
DynamicSetpoint Dynamic target brightness value setting. It is valid when DySetPointEn = 1.
【Member 】
| Member | Description |
|---|---|
| name | Mode name, divided into day mode and night mode |
| ExpLevel | Dynamic exposure node attribute, the node value is the ratio of the current exposure to the maximum exposure. The value range is [0,1], and up to 10 nodes can be set. |
| DySetpoint | The dynamic target brightness value node attribute. The node value changes dynamically with the exposure, and the larger the exposure node value, the smaller the target brightness node value. It corresponds to the exposure node one-by-one, and up to 10 nodes can be set. |
【Notes】
ExpLevel is the ratio of current exposure to maximum exposure, which is (Curgain * Curtime) / (Maxgain * Maxtime)。When DySetPointEn = 1, the target brightness is determined by DynamicSetpoint, and SetPoint and NightSetPoint are invalid. When setting the node of DySetpoint, please try to make the value of each node change smoothly with ExpLevel to prevent flicker.
BackLightCtrl
Backlight compensation function, that is, in a backlit scene, it supports the brightness of the dark area to increase and reproduce the details of the dark area.
【Member 】
| Member | Description |
|---|---|
| Enable | Module enable bit, 1: enable, 0: disable |
| MeasArea | The dark area detection area contains 6 modes: AUTO, UP, BOTTOM, LEFT, RIGHT, CENTER |
| LumaDistTh | Regional growth tolerance. |
| OEROILowTh | The lowest brightness threshold defined as over-exposed area, used to distinguish the over-exposed area from the non-over-exposed area |
| LvHighTh | high threshold of environmental luminance |
| LvLowTh | low threshold of environmental luminance |
| ExpLevel | denotes exposure level, which support at most 6 nodes。ExpLevel =Exp/MaxExp |
| NonOEPdfHighTh | Threshold for the proportion of non-over-exposed area (range: 0~1), supports up to 6 nodes and should be corresponding with ExpLevel one by one. |
| LowLightPdfTh | Threshold for the proportion of dark area (range: 0~1), which supports up to 6 nodes and should be corresponding to ExpLevel one-by-one. The value need to increases as ExpLevel increases. |
| TargetLLLuma | Dynamic target brightness value of dark zone, should be corresponding to ExpLevel one by one, and decreases as ExpLevel increases. |
【Notes】
An important step in the backlight compensation function is to determine the position of the dark area (region of interest) in the backlight, and then increase the brightness of the dark area by increasing the exposure. The detection of the dark area of the backlight is divided into automatic mode and manual mode, which are configured in MeasArea. There are 6 modes in total: AUTO, UP, BOTTOM, LEFT, RIGHT, CENTER. When MeasArea is configured as AUTO, it means that the dark area of the backlight adopts automatic detection mode. When MeasArea is configured as UP, BOTTOM, LEFT, RIGHT or CENTER, it represents manual mode, and the position of the dark area is subject to manual setting. When MeasArea is configured as AUTO, it will search for dark areas according to the brightness distribution of the sub-window and the backlight probability of the current scene. The backlight probability of the current scene is mainly composed of three factors: environmental brightness factor (Lv_fac), dark area proportion factor (DarkPdf_fac), and contrast factor (Contrast_fac). The detailed information of above 3 factors are explained in the following text. Environmental brightness Lv=meanluma/exp/1000 (exp=gain*time, unit: s) LvHighTh: The high threshold of environmental brightness. The larger the value, the less likely it is to trigger backlight compensation. On the contrary, it is easier to trigger backlight compensation. It is designed to distinguish the environmental brightness between indoor and outdoor. It is recommended that LvHighTh=setpoint/(outdoor exposure). When MeasArea is configured as AUTO, this parameter is valid. LvLowTh: The low threshold of environmental brightness. The larger the value, the less likely it is to trigger backlight compensation. On the contrary, it is easier to trigger backlight compensation. It is designed to distinguish indoor bright and dark environments. It is recommended that LvHighTh=setpoint/(indoor dark environment exposure). When MeasArea is configured as AUTO, this parameter is valid. The above high and low thresholds of environmental brightness are used to calculate the environmental brightness factor. LowLightPdfTh denotes the threshold of the proportion of the dark area, which affects the calculation of the proportion factor of the dark area. The proportion of the dark area should not be too large, otherwise it will easily trigger the backlight compensation, leading to excessive brightness in the indoor environment. It is recommended that the threshold of the proportion of the dark area in the bright environment be controlled within 20%. As the environmental brightness decreases, the threshold of the proportion of the dark area increases. When MeasArea is configured as AUTO, this parameter is valid. When MeasArea is configured as UP, BOTTOM, LEFT, RIGHT or CENTER, manual mode is used, and the position of the dark area is subject to manual setting. When the brightness of the specified area is lower than the target brightness value of dark area, increase the exposure to increase the brightness of the specified area; when the brightness of the specified area is higher than the target brightness value of dark area, it means that the specified area is not a dark area at this time, or the current scene is not a backlit scene. Then the increase or decrease of the exposure is determined by the global brightness. That is to say, the backlight compensation in this mode is only activated when the brightness of the specified area is lower than the target brightness value of the dark area. TargetLLLuma denotes the target brightness value of dark area. TargetLLLuma should not exceed 50% of the global brightness target value, and it is recommended to control it at 40%~50% of the global target brightness, otherwise the brightness may be too bright in a backlit scene. No matter what MeasArea is configured to, this parameter is always valid.
OverExpCtrl
The highlight suppression module, reduces the exposure to reduces the degree of overexposure of the picture.
【Member 】
| Member | Description |
|---|---|
| Enable | Module enable bit, 1: enable, 0: disable |
| HighLightTh | The brightness threshold of the highlighted area, the value range is [0,255] |
| LowLightTh | The brightness threshold of the lowlighted area, the value range is [0,255] |
| MaxWeight | Maximum weight value |
| OEPdf | The proportion of over-exposed area, support 6 nodes in total. The proportion value changes from small to large, the value range is [0,1] |
| HighLightWeight | The weight of the highlight area is set with 6 points in total, corresponding to the node of the proportion of the over-exposed area, and the maximum value is limited by MaxWeight. |
| LowLightWeight | The weight of the lowlight area is set with 6 points in total, corresponding to the node of the proportion of the over-exposed area, and the maximum value is limited by MaxWeight. |
【Notes】
HighLightTh represents the brightness threshold of the highlight area. The areas whose brightness is higher than this threshold are regarded as the highlight area, and the corresponding weight is HighLightWeight. LowLightTh represents the brightness threshold of the low-light area. The areas whose brightness is lower than this threshold are regarded as low-light areas, and the corresponding weight is LowLightWeight. The weight value of brightness, located in the area between LowLightTh and HighLightTh, is the interpolation of LowLightWeight and HighLightWeight. The greater the HighLightWeight, the greater the intensity of highlight suppression, and vice versa. The greater the LowLightWeight, the smaller the intensity of highlight suppression, and vice versa. It is recommended that HighLightWeight be controlled in the range of 14, and LowLightWeight should be controlled in the range of 0.71. In highlight suppression module, if highlight suppression is performed on any scene where there is an over-exposed area, the overall picture will be too dark. Therefore, HighLightWeight should not be too large. It is recommended that HighLightWeight should be reduced as the proportion of the over-exposed area increases, to avoid excessive glare suppression, resulting in overall picture brightness too dark . When the highlight suppression module is turned on, it is recommended to turn on TMO at the same time to prevent the dark area from being too dark during the highlight suppression process.
4.1.2.3 Tuning parameters of HDR exposure in AEC module
ToleranceIn/Out
The tolerance between the target brightness and the actual brightness. Its unit is %, and the value range is [0,100] When the automatic exposure converges, the actual brightness value B should be within the range of [real effective target brightness X (1-tolerance/100), real effective target brightness X (1+tolerance/100)].
ToleranceIn represents the tolerance when the exposure does not converge, and ToleranceOut represents the tolerance when the exposure converges. It is recommended that ToleranceIn <ToleranceOut, to avoid too sensitive exposure changes, and to stabilize exposure.
StrategyMode
Automatic exposure strategy mode,including High light priority or low light priority.
【Member】
High light priority:HIGHLIGHT_PRIOR
Low light priority.:LOWLIGHT_PRIOR
【Notes】
This parameter behaves differently in different exposure ratio modes. See ExpRatioCtrl parameter for details.
EvBias
During automatic exposure adjustment, the deviation percentage of the brightness, its unit is %, and the value range is [-200,+200]. It is used to adjust the target brightness value in special scenes. The actual effective target brightness is the target value X [1+abs(EvBias)/100]^[EvBias/abs(EvBias)].
For example, when EvBias=100, the target brightness is twice the default parameter; when EvBias=-100, the target brightness is 1/2 of the default parameter.
ExpRatioCtrl
HdrAE exposure ratio control module.
【Member】
| Member | Description |
|---|---|
| ExpRatioType | Exposure ratio mode, only valid in Hdr mode, including two types. AUTO: Automatically calculate the exposure ratio among multi frames according to the scene; FIX: Use a fixed exposure ratio among multi frames. |
| RatioExpDot | Represents the exposure value node, according to the exposure value, dynamically set the fixed exposure ratio or the maximum value of the exposure ratio, and the two is corresponding to each other one by one. |
| M2SRatioFix | When ExpRatioType = AUTO, it is invalid. When ExpRatioType = FIX, it indicates the exposure ratio of the medium frame to the short frame, and corresponds to RatioExpDot one-by-one. . |
| L2MRatioFix | When ExpRatioType = AUTO, it is invalid. When ExpRatioType = FIX, it indicates the exposure ratio of the long frame to the medium frame, and corresponds to RatioExpDot one-to-one. It is invalid in 2- frame Hdr mode, and valid in 3- frame Hdr mode. |
| M2SRatioMax | When ExpRatioType = AUTO, it indicates the maximum value of the exposure ratio between the medium frame and the short frame, which corresponds to RatioExpDot one-to-one. When ExpRatioType = FIX, it is invalid. |
| L2MRatioMax | When ExpRatioType = AUTO, it indicates the maximum value of the exposure ratio between the long frame and the medium frame, which corresponds to the exposure node RatioExpDot one-to-one. It is invalid in 2- frame Hdr mode, and valid in 3- frame Hdr mode. When ExpRatioType = FIX, it is invalid. |
【Notes】
When ExpRatioType is AUTO, automatic exposure ratio mode is used. In 2-frame mode, the maximum exposure ratio of long and short frames is limited by M2SratioMax; in 3 frame mode, the maximum exposure ratio of short and medium frames is limited by M2SratioMax, and the maximum exposure ratio of long and medium frames is limited by L2MratioMax. The minimum exposure ratio is unlimited and must not be less than 1. When ExpRatioType is FIX, a fixed exposure ratio mode is used. In 2 frame mode, the exposure ratio of long and short frames is M2SRatioFix; in 3 frame mode, the exposure ratio of short and medium frames is M2SRatioFix, and the exposure ratio of long and medium frames is L2MratioFix. Auto exposure ratio mode with 2-frame HDR mode, when the exposure ratio obtained by the AEC control algorithm module exceeds the maximum exposure ratio M2SratioMax limit, select the frame that needs to be prioritized according to StrategyMode. If StrategyMode = HIGHLIGHT_PRIOR, prioritize the exposure of short-exposure frames, long-exposure frame exposure=short-exposure frame exposure*M2SratioMax; if StrategyMode = LOWLIGHT_PRIOR, give priority to ensuring long-exposure frame exposure, short-exposure frame exposure=long-exposure frame exposure/M2SratioMax. The same calculaiton of exposure ratio is used in 3-frame HDR mode, when StrategyMode = HIGHLIGHT_PRIOR, prioritize the exposure of shorter frames; StrategyMode = LOWLIGHT _PRIOR, prioritize the exposure of longer frames. Fixed exposure ratio mode with 2-frame HDR mode, when StrategyMode = HIGHLIGHT_PRIOR, calculate the long exposure frame exposure based on the exposure of the short exposure frame, which is equal to the short exposure frame exposure * M2SRatioFix; when StrategyMode = LOWLIGHT_PRIOR, calculate the short-exposure frame exposure based on the exposure of the long exposure frame, which is equal to the long- exposure frame exposure/M2SRatioFix. In 3-frame HDR mode, the same calculation is used.
LongFrmMode
HdrAE long frame mode function control module
【Member 】
| Member | Description |
|---|---|
| Mode | Long frame mode, including 3 types: NORMAL/AUTO LONGFRAME/LONGFRAME _ NORMAL: Normal Hdr mode. The Ae and Hdr modules work according to the manual/automatic exposure ratio. AUTO LONGFRAME: Automatic long frame mode. When the exposure _ exceeds the set threshold, the long frame exposure time is close to the maximum allowed by one frame, and the merge module only outputs long frames. LONGFRAME: Long frame mode. AE sets the short frame exposure time to the minimum, and the long frame exposure time is close to the maximum allowed by one frame, and the merge module only outputs long frames. |
| SfrmMinLine | The short frame minimum exposure line used in long frame mode/auto long frame mode. Due to some limitations of the sensor, in the long frame mode, the minimum exposure line of the short frame may not reach the minimum exposure line allowed by the sensor, so it needs to be set separately. |
| LfrmModeExpTh | In automatic long frame mode, when the long frame exposure exceeds LfrmModeExpTh, switch to long frame mode |
LframeCtrl
Long frame Tuning parameters. In the HdrAE strategy, long frames need to be compatible with general dynamic range (DR) scenes and backlight scenes (high DR), so there are two constraints of brightness : target brightness of global area and target brightness of dark area. While ensuring that the long-frame global brightness is within the tolerance of target brightness of global area, the brightness of dark area is required to be greater than or equal to the target brightness of dark area.
【Member】
| Member | Description |
|---|---|
| OEROILowTh | The lowest value of the brightness of the over-exposed area, used to distinguish the over-exposed area from the non-over-exposed area |
| LvHighTh | High Threshold of environmental brightness |
| LvLowTh | Low threshold of environmental brightness |
| LExpLevel | Dynamic exposure level of long frame. ExpLevel = Exp/MaxExp |
| LSetPoint | Dynamic target brightness value of global area in long frame. One-to- one correspondence with ExpLevel. |
| NonOEPdfHighTh | Threshold for the proportion of non-over-exposed areas (range:0~1). Should be corresponding with ExpLevel one by one. |
| LowLightPdfTh | The threshold of the proportion of dark areas (range:0~1). Should be corresponding to ExpLevel one-by-one, and increases as ExpLevel increases. |
| TargetLLLuma | Dynamic brightness target value of dark area in long-frame, which should correspond to ExpLevel one-to-one. It will decrease as ExpLevel increases. |
【Notes】
environmental brightness Lv=meanluma/exp/1000 (exp=gain*time,unit:s) LvHighTh: The high threshold of environmental brightness. The larger the value, the less likely it is to trigger backlight compensation. On the contrary, it is easier to trigger backlight compensation. It is equivalent to distinguishing the environmental brightness threshold between indoor and outdoor. It is recommended that LvHighTh=setpoint/(outdoor exposure). LvLowTh: The low threshold of environmental brightness. The larger the value, the less likely it is to trigger backlight compensation. On the contrary, it is easier to trigger backlight compensation. It is equivalent to the environmental brightness threshold for distinguishing indoor bright and dark environments. It is recommended that LvHighTh=setpoint/(indoor dark environment exposure). The above high and low thresholds of environmental brightness are used to calculate the environmental brightness factor. LowLightPdfTh The threshold of the proportion of the dark area, which affects the calculation of the proportion factor of the dark area. The proportion of the dark area should not be too small, otherwise it will easily trigger the backlight compensation, resulting in excessive brightness in the indoor environment. It is recommended that the threshold of the proportion of the dark area in the bright environment be controlled around 20%. As the environmental brightness decreases, the threshold of the proportion of the dark area increases. It is recommended that the target value of the dark area should not exceed 50% of the global target value, and should be controlled at 40%~50% of the global target brightness, otherwise the brightness may be too bright in a backlit scene.
MframeCtrl Middle frame tuning parameters (valid only in Hdr 3 frames)
【Member】
| Member | Description |
|---|---|
| MExpLevel | The percentage of the maximum exposure value of the dynamic mid-frame, ExpLevel =Exp/MaxExp |
| MSetPoint | Dynamic mid-frame global target brightness value, should be corresponding with ExpLevel one by one. As the exposure increases, the target value decreases. |
SframeCtrl
Short frame tuning parameters
【Member】
| Member | Description |
|---|---|
| SExpLevel | Dynamic exposure level of short frame, maximum,SExpLevel=SExposure/SmaxExposre |
| SSetPoint | Dynamic global target brightness value of short-frame , shuold be corresponding with SExpLevel one-by-one. |
| TargetHLLuma | The target brightness value of highlight area in short frame, which corresponds to SExpLevel one-to-one. The target brightness value of the bright area in the same interval must be higher than the corresponding global brightness target value. |
| HLLumaTolerance | Set the target tolerance percentage of the short frame highlight area, the unit is % |
| HLROIExpandEn | Enable bit of Short frame highlight area expansion . HLROIExpandEn = 1, ignore the relatively small high-bright area, reduce the sensitivity of the high-bright area; =0, suppress the brightness of all highlight areas, and increase the sensitivity of detecting highlight area |
4.1.2.4 SensorInfo Parameters
The exposure parameter module at Sensor-level should be filled by person responsible for sensor driver or tuning , and it is used to inform the CIS parameter information related to the exposure, which is important for Tuning. Before tuning, it is necessary to confirm whether the parameters of this module are consistent with the sensor datasheet, otherwise it may cause problems such as exposure flicker or HDR effect errors.
GainRange The configuration used for converting sensor gain value into register value. Due to the different gain conversion formulas of different sensor manufacturers, it can be roughly divided into linear (including piecewise linear and inverse proportional) and nonlinear. Nonlinear is mainly aimed at some sensor manufacturers such as Sony, and it currently only supports the gain conversion formula in dB mode.
【Member】
| Member | Description |
|---|---|
| IsLinear | Whether the gain conversion formula is in linear mode, IsLinear = 0, non- linear mode is valid, linear mode is valid; IsLinear =1, linear mode is valid, non-linear mode is invalid |
| Linear | Linear gain conversion formula, support piecewise linear. Support up to 10 segments |
| NonLinear | Nonlinear gain conversion formula, currently only supports dB mode |
【Notes】
The sensor gain in GainRange refers to the sensor's total gain = again*dgain. If the conversion formulas of again and dgain are different, segment settings are supported. As the following example shows, the size needs to be modified adaptively. The linear conversion formula is composed of 3 coefficients (M0, C0, C1), and the detailed information are explained as follows: The conversion formula is: set to driver reg = (gain^M0)*C1 - C0+ 0.5 xml Parameter correspondence:The first column: the start gain value of the gain interval, the second column the end value of the gain interval, the third column: C1, the fourth column: C0, the fifth column: M0, the sixth column: the start reg value of gain interval, the seventh column: the end reg value of gain interval. Non-linear sensor gain conversion formula, currently only supports dB mode. The conversion formula corresponding to dB mode is: reg = 20log10(gain)10/3 For DCG mode, the sensor gain conversion formula here using the LCG gain.
【Example】
s5kgm1sp The analog gain and digital gain conversion formulas of this sensor are different, as shown in Figures 4-3 and 4-4, the analog gain register value is 32 times the analog gain, and the digital gain register value is 256 times the digital gain.
Figure 4-3 Example of analog gain to register value Figure 4-4 Example of digital gain to register value
It is known that the maximum analog gain of s5kgm1sp is 16X, the maximum digital gain is 16X, and Total gain = again*dgain. When Total gain <=16X, again is valid, dgain=1X; when Total gain> 16X, again = 16X, dgain is valid. Therefore, when filling in the conversion formula, [1,16] Total gain and [16,256] Total gain need to be configured separately. The specific configuration is as follows:
[1.0000 16.0000 32.0000 0.0000 1.0000 32.0000 512.0000 16.0000 256.0000 16.0000 -512.0000 1.0000 768.0000 4608.0000 ]
[16,256] total gain interval, the analog gain is fixed at 16X (a_reg=16x32=512), the digital gain d_reg = dgain x 256, and the register value obtained by the corresponding configuration formula is reg=a_reg+d_reg = 512 + Total gain /16 x 256 = 512+Total gain x 16, ie M0=1, C0=-512, C1=16. After obtaining the total gain register value (represented by reg below) from the application, the sensor driver need the following adaptive modifications:
if(reg <= 0x200){
a_reg = reg;
d_reg = 0x0100;
}else{
a_reg = 0x200;
d_reg = reg-0x200;
}
TimeFactor
The conversion formula of sensor exposure time to register exposure line number is composed of four coefficients (C0, C1, C2, C3).
Conversion formula: line (exposure line) = C0*VTS + C1 + C2 * (time * pclk / HTS + C3) xml corresponding parameters: The first one: C0, the second one: C1, the third: C2, the fourth: C3 According to the formula, the exposure time is calculated as: Time = ((line - C0 x vts - C1) / C2 - C3)*hts/pclk
【Notes】
The default 4 coefficients are 0, 0, 1, 0.5, and the calculated number of exposure lines is stepped by 1 line. Generally, this value does not need to be modified.
CISLinTimeRegMaxFac In non-HDR mode, the relationship between the maximum exposure time line and VTS is composed of two coefficients (C0, C1)
MaxTimeLine = C0*vts – C1
For the specific value of the coefficient, please refer to the datasheet given by the sensor manufacturer
CISHdrTimeRegSumFac
In HDR mode, the total limit of the exposure time of multiple frames is composed of two coefficients (C0, C1)
TotalMaxTimeLine = C0*vts – C1
For the specific value of the coefficient, please refer to the datasheet given by the sensor manufacturerCISTimeRegOdevity
CISTimeRegOdevity
In Linear exposure mode, the odevity property of sensor exposure time , composed of two coefficients (C0, C1)
Line = C0*x+C1
No restriction:C0=1 C1=0 Fixed odd lines:C0=2 C1=1 Fixed even lines:C0=2 C1=0 Fixed to an integer multiple of N:C0=N C1=0
CISHdrTimeRegOdevity
In Hdr exposure mode, the odevity property of sensor exposure time , composed of two coefficients (C0, C1)
Line = C0*x+C1
No restriction:C0=1 C1=0 Fixed odd lines:C0=2 C1=1 Fixed even lines:C0=2 C1=0 (Sensor such as imx347, imx307, etc.) Fixed to an integer multiple of N:C0=N C1=0
CISTimeRegUnEqualEn
In Hdr mode, Sensor has unequal restrictions on the exposure time line of each frame (S/M/L)
En=0 sensor allows the exposure time of each frame to be equal;
En=1 sensor does not allow the exposure time of each frame to be equal.
CISTimeRegMin The minimum allowable value of the sensor exposure time line (register value) in linear exposure mode, which is an integer.
CISHdrTimeRegMin
The minimum allowable value of the sensor exposure time line (register value) in the Hdr exposure mode, whitch is an integer.
CISHdrTimeRegMax
The maximum allowable value of the sensor exposure time line (register value) in the Hdr exposure mode,which is an integer.
【Notes】
This parameter is composed of 3 elements. The first 2 elements are valid in Hdr2 frame, which respectively represent the maximum exposure time line of short and long frames. All 3 elements are valid in Hdr3 frame, which represent the maximum exposure time line of short, medium, and long frames. Generally, the sensor has no limit on the maximum exposure time line of each frame in Hdr mode. At this time, this parameter can be filled with 0, which means that the sensor has no limit on the maximum exposure time line. When the value is not 0, the maximum exposure time of each frame is subject to this parameter. Taking imx307 as example, the sensor has a limit on the maximum exposure line of short frames, which is required to be 222 lines, and there is no such limit on long frames. Therefore, the parameter can be filled as: [222 0 0]
CISMinFps
The minimum frame rate allowed, used for automatic frame rate mode to avoid frame rate too low in a low-light environment, causing ghost.
CISAgainRange
The range of sensor analog gain or LCG, contains minimum and maximum, and the minimum must not be less than 1.
When the sensor supports dual conversion gain, this item can indicate the LCG range supported by the sensor. If digital gain is used to supplement the accuracy, this item can indicate the total gain range of the sensor.
CISExtraAgainRange
The range of HCG, contains the minimum and maximum value , and the minimum value shall not be lower than 1.
When the sensor supports dual conversion gain, this item indicates the HCG range supported by the sensor. Its Range is generally = CISAgainRange * dcg_ratio, but there maybe exceptions, such as ov2718. For details, please refer to the datasheet provided by the original sensor. When the sensor does not support dual conversion gain, this item is invalid, and the maximum and minimum values can be set as 1.
CISDgainRange
The range of digital gain supported by the sensor, with the minimum not less than 1.
If digital gain is used to supplement accuracy, fill in both the maximum and minimum values as 1 in this item.
CISISPDgainRange
Range of ISP digital gain , the minimum value shall not be less than 1
【Notes】
RV1109/RV1126 currently does not support ISP digital gain. Fill in the maximum and minimum values of this item with 1.
CISHdrGainIndSetEn
In Hdr mode, sensor whether support multi-frame sensor exposure gain have independent value
The value is 0, which means that multiple frames share the same value, such as sensor gc2093; The value is 1, which means that multiple frames support independent value of gain.
【Notes】
This mode is only used for HDR stagger mode, and invalid for HDR DCG mode
SensorFlip
Sensor output image direction control.
bit 0, denotes the mirror control bit (mirror) bit 1,denotes the up and down flip control bit (flip)
4.1.2.5 System Parameters
System level parameters
HDR
Related setting parameters of HDR mode
【Member】
| Member | Description |
|---|---|
| Enable | Hdr mode enable, = 0 does not support Hdr mode; =1 supports Hdr mode. |
| Support mode _ | Frame mode adopted by Hdr, which supports 4 types in total. They are MODE 2 LINE / MODE 3 LINE, MODE 2 FRAME / MODE 3 FRAME _ _ _ _ _ _ _ _ |
| Line mode _ | Line mode adopted by Hdr, currently only supports DCG and STAGGER _ two modes. Note: DOL is equivalent to STAGGER and is written as STAGGER mode. |
DCG_SETTING
Dual conversion gain function setting parameter module, including linear and HDR modes. This module is used to control the switching of DCG, requiring sensor support the configuration of DCG mode switching. For example, when the DCG function of the sensor is internal automatic switching, the module needs to be closed.
【Member】
| Member | Description |
|---|---|
| Support en _ | Whether to support the dual conversion gain function, when Support en=1, the module parameter is valid, and Support en=0 means _ _ that the dual conversion gain function is not supported. |
| dcg optype _ | Dual conversion gain function switching mode, divided into AUTO and MANUAL. AUTO: Switch between LCG/HCG based on the threshold. MANUAL: No automatic switch, use a fixed value, refering to dcgmode init. _ |
| dcgmode init _ | The initial value of the Dual conversion gain mode for each frame. |
| dcg ratio _ | ratio between HCG and LCG |
| sync switch _ | Sync switch (valid only in HDR mode). sync switch=1, the dual conversion _ gain mode is switched synchronously in each frame, and is the same with long frame; =0, the dual conversion gain is switched asynchronously in each frame |
| gain ctrl _ | Switch to Dual conversion gain based on exposure gain. lcg2hcg th: LCG to _ HCG threshold; hcg2lcg th: HCG to LCG threshold _ |
【Notes】
This module is used to control the switching of DCG, and the sensor is required to support the configuration of DCG mode switching. For example, when the DCG function of the sensor is internal automatic switching, the module needs to be closed. When the Sensor adopts HDR-DCG mode, the short exposure frame is fixed to LCG, and the long exposure frame is fixed to HCG. Therefore, it is necessary to set dcg_optype to MANUAL, dcgmode_init = [0 1 0] for 2 frames, and dcgmode_init = [0 0 1] for 3 frames. If the sensor does not support the Dual conversion gain function, dcg_ratio needs to be set to 1.
EXP_DELAY Exposure effective module parameters, the module parameters are generally obtained from the sensor datasheet. In view of the fact that it would take some frames for exposure becoming effective,the number of frames in normal mode and Hdr mode needs to be filled in separately according to the mode.
【Member】
| Member | Description |
|---|---|
| time delay _ | frame number it takes for Sensor exposure time to be effective |
| gain delay _ | frame number it takes for sensor exposure gain to be effective |
| dcg delay _ | frame number it takes for Dual conversion gain mode to be effective |
【Notes】
The value of this module needs to be based on the datasheet given by the sensor manufacturer, and cannot be set arbitrarily. If the value of this module is wrong, it may cause flicker during the exposure adjustment process. Generally, the sensor datasheet will describe the effective frame number of exposure time and gain. If the exposure time and gain are written in the nth frame and at the n+2 frame it takes effect, then time_delay = 2, gain_delay = 2, and so on. The effective frame number of exposure time and gain of some sensors are different. If the module parameters are wrong, the exposure time and gain may not be effective at the same time, whitch will result in flickering.
4.1.3 Tuning Steps
TheTuning of the AEC module mainly includes the tuning of the target value of AE, the tuning of the exposure seperation route, the tuning of the weight table, and the tuning of the AE convergence speed. Before ISP Tuning, you need to confirm whether the sensor driver is working normally and whether the exposure parameters related to CIS are set correctly to avoid exposure setting errors.
Before tuning AEC, you also need to ensure that the calibration of the following modules has been completed and the functions are correct: BLC, AWB, LSC, CCM, and the gamma module can use a default gamma curve.
Step 1. Sensor exposure parameters and system parameter settings
As described in the parameter introduction in chapter 4.1.2, before the formal tuning, you need to ensure the correctness of the SensorInfo and System module parameters, to avoid problems such as exposure setting errors or flickering. The parameters of these two modules can be get from the datasheet of the sensor, which requires close attention for the person responsible for the driver or tuning. After completing the module parameters mentioned above, you can use the AecSyncTest function in the IQ xml file for testing. The AecSyncTest function sets N groups of different exposure values cyclically, which can test whether the sensor's exposure time, exposure gain, and the number of effective frames of DCG switching are correct. It can also be used to test the linearity of exposure to confirm the register value conversion of exposure time and exposure gain. Whether the formula and related parameters are correct.
If the parameters have been confirmed before calibration, this step can be skipped.
Attachment: AecSyncTest function parameters are introduced as follows: AecSyncTest supports the setting of N groups of different exposure values cyclically at a given interval frame, which is used for tuning and verifying the effective number of frames of exposure components (exposure time, exposure gain) and whether the sensor exposure parameter settings are correct .
【Member】
| Member | Description |
|---|---|
| Enable | Enable the synchronization test function of exposure and statistics |
| IntervalFrm | interval frame number of Exposure switching |
| AlterExp | Exposure switching parameters |
AlterExp
According to the different modes, there are two sets of parameters, LinearAE and HdrAE.
| Member | Description |
|---|---|
| TimeValue | Exposure time value |
| GainValue | Exposure gain value |
| IspDgainValue | Isp digital gain value |
| DcgMode | Dcg Mode Value |
| PIrisGainValue | P-iris equivalent gain value |
After the AecSyncTest function is turned on, open the LOG (1ff3 level) of the AEC module to check the matching of each group of exposure and the corresponding brightness.
Step2.Set AE weight parameters
Metering statistics module of AE contains histogram information and block brightness information. By dividing the screen into NxN blocks at equal intervals, each block is given a corresponding weight. The weight can be increased for the region of interest, so different application requirements will have different weights. Generally for IPC scenarios, the region of interest is generally located in the center of the scene. It is recommended to increase the weight of the central area and lower the weight of the surrounding area to highlight the central area; for CVR scenarios, the subject of interest is generally located in the center of the scene. For the lower area (road area), it is recommended to increase the weight of the middle and lower area, and lower the weight of the upper area (sky area). Figure 4-5 shows an example of AEC weight parameters. As described in section 4.1.2, the weight parameters of the AEC module can be divided into two sets of parameters, day and night, and the switch of parameters is controlled by AecDNSwitch. Figure 4-5 AEC weight parameters
Step3.Set AE exposure seperation route
The exposure calculated by the AEC algorithm needs to be seperated into sensor exposure time component, sensor exposure gain component, ISP digital gain component and aperture component. Each component is set to the corresponding module to obtain the desired brightness image. The seperation operation is completed by the AecRoute module parameters, and the parameter description is detailed in chapter 4.1.2. Different application scenarios need to set different AecRoute: for daytime scenes, it is generally required to limit the exposure time and adjust the gain first to prevent motion ghost caused by long exposure time; for night scenes, it is generally required to adjust the exposure time first and then adjust the exposure gain , to improve the signal-to-noise ratio of the picture and increase the brightness at night.
Step4.Set AE target brightness value
In linear exposure mode, it is recommended to turn on the dynamic target brightness function to meet the needs of different scenes. The target brightness setting of the linear mode involves the DynamicSetpoint, ToleranceIn/ToleranceOut, BackLightCtrl, OverExpCtrl parameters, etc. For detailed description of each parameter, please refer to chapter 4.1.2. It is required for indoor static scenes with appropriate brightness and no large over-exposured area. And when the environment changes from bright to dark, the brightness can transition smoothly.
HDR exposure mode, according to the different exposure ratio mode and StrategyMode, the tuning steps of the target brightness value are also different. According to the exposure ratio mode and StrategyMode, adjust the target brightness parameter of the corresponding frame. The target brightness parameter of long frame involves LSetPoint and TargetLLLuma, which respectively represent the global target brightness and the target brightness of dark area; the target brightness parameter of medium frame involves MSetPoint, which represents the global target brightness of the middle frame; the target brightness of short frame involves SSetPoint and TargetHLLuma, respectively Indicates the global target brightness of the short frame and the target brightness of the highlight area. For detailed description of each parameter, see chapter 4.1.2.
Step5.Set AE convergence and response speed
The adjustment of AE convergence and response speed affects the exposure response speed, convergence speed and smoothness of the adjustment process. The parameters involved in this step include AecRunInterval, AecSpeed, AecDelayFrmNum, and the description of each parameter is detailed in chapter 4.1.2. You can switch the lights in a static indoor scene to check the convergence speed when the light changes drastically. Faster convergence speed may cause unsmooth transition or overshoot when the brightness changes slowly, so a trade-off is required
4.2 NR & SHARP
ISP denoising module contains four modules: bayernr, mfnr, uvnr and ynr.
ISP sharpening module includes two modules, sharp and edgefilter.
Figure 4-6 NR pipeline block diagram
It is recommended to perform noiseTuning according to the sequence on the pipeline. WhenTuning each module, it is necessary to consider the mutual influence of the effects of the module before and after and the comprehensive effect.
In the process of noiseTuning, you need to check the corresponding output of each step in order to clarify the impact of each step on denoising.
If you want to view the bayernr effect, you need to compare the original image without denoising and only the bayernr effect image; If you want to view the mfnr effect, you need to compare the bayernr output effect map, and compare the image with only mfnr but uvnr, ynr, sharp.edgefilter turned off. And so on.
4.2.1 BayerNR
4.2.1.1 Function Description
This module performs spatial denoising processing on the image in the Raw domain. Based on the noise calibration results, the denoising module establishes a denoising model that is more in line with the noise characteristics.
Supports two kinds of noise calibration and noise parameters for high signal-to-noise ratio and low signal-to-noise ratio, for example: CIS supporting dual conversion gain mode (Dual convertion gain DCG), high conversion gain (HCG) corresponding to high signal-to-noise ratio mode, Low conversion gain (HCG) corresponds to low signal-to-noise ratio mode. Figure 4-2-1-1 BayerNR functional block diagram
4.2.1.2 Key Parameter
Enable
Bayernr module enable bit, 0: closed, 1: open.
Mode
Parameter configuration of BNR 3 kinds of scene operation modes
【Member】
| Member | Description |
|---|---|
| cell/Name | Identifies the name of the scene running mode. "normal": BNR parameters applied in linear and color modes. For example: IPC Daytime Color "hdr": BNR parameters applied in hdr mode. "gray": BNR parameters applied in black and white mode |
| cell/Setting | Specific BNR parameter settings. For details, please refer to the following Setting/xxx member parameter description |
Setting
SNR_Mode
"HSNR": Identifies the BNR parameters used in HSNR mode
"LSNR": Identifies the BNR parameters used in LSNR mode
ISO Currently supports 13 iso configuration parameters.
Iso supports up to 2048.
The iso parameters between files are obtained by parameter interpolation.
Calibration data
luLevel/ luLevelVal
Adjust the noise reduction intensity according to the pixel brightness, 0-255 divided into 8 points,
Each point represents the brightness of the x-axis pixel.
luRatio
Adjust the noise reduction intensity according to the pixel brightness, corresponding to the above luLevel, and the y-axis noise reduction intensity corresponding to the x-axis pixel brightness.
This parameter is the data calibrated by the noise calibration of the bayernr module. The value range is [0, 15.9].
Gauss-oriented parameters
gauss_en
Gaussian guided filter 3x3 enable bit. 0: disable, 1: enable.
Denoising intensity parameter
filtPara
Single frame noise reduction intensity, the value range is [0, 15.9]. The larger the value, the stronger the noise reduction.
This parameter is generally set not to exceed 0.2, which is likely to affect the clarity and details.
If it is in hdr mode, the software will automatically convert the filtPara's single frame strength internally to hdr corresponding to the long, medium and short 3 frames corresponding to the denoising strength.
Random noise backfill parameters
Lamda Segmented noise threshold, the larger the lamda, the larger the adjustment range. The value range is [0 16383].
fixW
4 levels of weights for segmented noise. Value range [0 7.9].
The difference between the original image noise and the denoised image is divided into 4 intervals according to 1Lamda, 2lamda, 3*lamda,
The weight of each interval is determined by fixw0, fixw1, fixw2, and fixw3.
The larger the fixW value, the larger the noise weight of the original image.
4.2.1.3 Tuning steps
BayerNR module can suppresses the high-frequency color noise , but too much power may easily cause some high-frequency details to be lost.
Generally, under low iso, bayernr does not need to be opened too much, but under high iso, the intensity can be increased appropriately to suppress high-frequency noise of bright and chromaticity.
The picture below shows the difference between bayernr's high strength and low strength, which has a greater impact on details.
Figure 4-2-1-3 Bayernr denoising example diagram
4.2.2 MFNR
4.2.2.1 Function Description
This module performs time-domain noise reduction in the YUV domain.
Based on the noise calibration results, the denoising module establishes a denoising model that is more fit the noise characteristics. First, the module processes y and uv data separately. y data is divided into 4 scales, high and low frequencies for processing. The uv data is divided into 3 scales, high and low frequencies for processing.
According to the similarity and difference between the frames, the motion judgment is performed, and the texture detection finally calculates the corresponding weights, and performs multi-frame overlay denoising.
Supports two kinds of noise calibration and noise parameters for high signal-to-noise ratio and low signal-to-noise ratio, for example: CIS supporting dual conversion gain mode (Dual convertion gain DCG), high conversion gain (HCG) corresponding to high signal-to-noise ratio mode, Low conversion gain (HCG) corresponds to low signal-to-noise ratio mode. MFNR supports 2 in 1 (2to1) or 3 in 1 (3to1) mode. 3to1 mode has better denoising effect, but the overall system bandwidth is higher.
Figure 4-2-2-1-1 MFNR functional block diagram Figure 4-2-2-1-2 MFNR sub-function block diagram
4.2.2.2 Key Parameter
Enable:
MFNR module enable bit, 0: close, 1: open.
mode_3to1
MFNR 2to1 mode and 3to1 mode selection.
0: 2to1 mode
1: 3to1 mode
local_gain_en
The MFNR is the post processing module in the ISP pipeline. The data processed by the former module will be superimposed with local gain on some modules, including: LSC / HDR MERGE / HDR TMO / Dehaze & Enhance. The noise model analysis of MFNR needs to consider the superimposed gain of the data. The module supports the use of the previous local gain mode, or the manual configuration of the global estimated gain mode.
1: Use local gain mode. 1: Use local gain mode. 0: Use global gain mode.【Notes】
It is recommended to use local gain mode.
Mode
MFNR parameter configuration in 3 scene operation modes
【Member】
| Member | Description |
|---|---|
| cell/Name | Identifies the name of the scene running mode. "normal": MFNR parameters applied in linear and color modes. For example: IPC daytime color "hdr": MFNR parameter applied in hdr mode. "gray": MFNR parameters applied in black and white mode |
| cell/Setting | Specific MFNR parameter settings. For details, please refer to the following Setting/xxx member parameter description |
Setting
SNR_Mode
"HSNR": Identifies the MFNR parameters used in HSNR mode
"LSNR": Identifies the MFNR parameters used in LSNR mode
MFNR_ISO
MFNR parameters under each ISO.
MFNR_ISO / Iso
The current parameters corresponds to the iso value
MFNR_ISO /weight_limit_y
The minimum value of the forward weight value of the brightness 0th layer.
The minimum value of the forward weight value of the brightness level 1-3. The value range is [1 256].
The larger the value, the smaller the weight. Approximate weight 256/weight_limit_y[i].
Used to calculate the weight value of the current frame forward denoising.
MFNR_ISO / weight_limit_uv
The minimum value of the forward weight value of the chroma 0-1 layer.
The minimum value of the forward weight value of the chroma layer 2.
The value range is [1 256].
The larger the value, the smaller the weight. Approximately 256/weight_limit_uv[i].
Used to calculate the weight value of the current frame forward denoising.
MFNR_ISO / ratio_frq
The low-order boundary when judging the texture value of the low-frequency layer 0 of the luminance.
The high-order boundary when judging the texture value of the low-frequency layer 0 of the luminance.
The low-order boundary when judging the texture value of the chroma low-frequency layer 0.
The high-order boundary when judging the texture value of the chroma low-frequency layer 0.
The larger the value, the smaller the denoising intensity. Generally set 0.5 and 2. The value range is [0 8).
MFNR_ISO / luma_w_in_chroma
luma_w_in_chroma is the weight for luma gradient guides the chroma denoising in the 0th layer.
The larger the value, the greater the influence of the y component and the smaller the influence of the uv component.
The value range is [0 1].
Y calibration data
MFNR_ISO / noise_curve
y component noise sigma curve, y value.
The value is calibrated by the tuning tool. MFNR_ISO / noise_curve_x00
y component noise sigma curve, x value.
MFNR_ISO / y_lo_noiseprofile
Y-component low-frequency 4-layers noise curve correction parameters.
The value is calibrated by the tool.
The smaller the value, the greater the denoising intensity.
MFNR_ISO / y_hi_noiseprofile
Y-component high-frequency 4-layers noise curve correction parameters.
The value is calibrated by the tool.
The smaller the value, the greater the denoising intensity.
Y low frequency denoising adjustment parameters
MFNR_ISO / y_lo_bfscale
Y-component low-frequency 4-layer noise curve influence factor.
The smaller the value, the greater the denoising intensity.
The value range is [0, 8].
MFNR_ISO / y_lumanrpoint
Luma denoise strength of different luma value in low-frequency .
This parameter corresponds to pixel brightness division.
The value range is [0, 255].
MFNR_ISO / y_lumanrcurve
Luma denoise strength of different luma value in low-frequency .
This parameter corresponds to the denoise strength factor. The value range is [0, 4).
MFNR_ISO / y_denoisestrength
The denoising intensity factor in luma.
The larger the value, the stronger the denoising strength.
The value range is [0, 4].
MFNR_ISO / y_lo_lvl0_gfdelta
Y-component low-frequency zero-layer similarity 5x5 Gaussian filter parameters.
coef0+coef14+coef24+coef34 +coef48+coef5*4 = 1
MFNR_ISO / y_lo_lvl1_gfdelta
Y-component low-frequency first-layer similarity 3x3 Gaussian filter parameters.
coef0+coef14+coef24 = 256
MFNR_ISO / y_lo_lvl2_gfdelta
Y-component low-frequency second-layer similarity 3x3 Gaussian filter parameters.
coef0+coef14+coef24 = 256
MFNR_ISO / y_lo_lvl3_gfdelta
Y component low-frequency third layer similarity 3x3 Gaussian filter parameters.
coef0+coef14+coef24 = 256
UV calibration parameters
MFNR_ISO / uv_lo_noiseprofile
UV component low-frequency 3-layers noise curve correction parameters.
The value is calibrated by the tool.
The smaller the value, the greater the denoising intensity. MFNR_ISO / uv_hi_noiseprofile
UV component high-frequency 3-layer noise curve correction parameters.
The value is calibrated by the tool.
The smaller the value, the greater the denoising intensity.
UV low frequency denoising parameters
MFNR_ISO / uv_lo_bfscale
UV component low-frequency 3-layer noise curve influence factor.
The smaller the value, the greater the denoising intensity.
The value range is [0, 16].
MFNR_ISO / uv_lumanrpoint
Chroma denoise strength of different luma value in low-frequency .
This parameter corresponds to pixel brightness division.
The value range is [0, 255].
MFNR_ISO / uv_lumanrcurve
Chroma denoise strength of different luma value in low-frequency .
This parameter corresponds to the denoise strength.
The value range is [0,4).
MFNR_ISO / uv_denoisestrength
UV component denoising intensity factor.
The larger the value, the stronger the denoising force.
The value range is [0, 4].
MFNR_ISO / uv_lo_lvl0_gfdelta The low-frequency level 0 similarity of UV components is 5x5 Gaussian filter parameters.
coef0+coef14+coef24+coef34 +coef48+coef5*4 = 1
MFNR_ISO / uv_lo_lvl1_gfdelta
UV component low-frequency first layer 3 similarity x3 Gaussian filter parameters.
coef0+coef14+coef24 = 256
MFNR_ISO / uv_lo_lvl2_gfdelta
The second layer similarity of UV components is 3x3 Gaussian filter parameters.
coef0+coef14+coef24 = 256
UV high frequency denoising parameters
MFNR_ISO / uv_hi_bfscale
UV component high-frequency 3-layer noise curve influence factor.
The smaller the value, the greater the denoising intensity.
The value range is [0, 16].
MFNR_ISO / uv_hi_lvl0_gfdelta
5x5 Gaussian filter parameters for the similarity of the high frequency layer 0 of the UV component.
coef0+coef14+coef24+coef34 +coef48+coef5*4 = 1
MFNR_ISO / uv_hi_lvl1_gfdelta
UV component high frequency first layer similarity 3x3 Gaussian filter parameters.
coef0+coef14+coef24 = 256
MFNR_ISO / uv_hi_lvl2_gfdelta
The high-frequency second-layer similarity of UV components is 3x3 Gaussian filter parameters. coef0+coef14+coef24 = 256
Gaussian filter operator parameters
MFNR_ISO / lvl0_gfsigma
When calculating the noise expectation for the denoised image, Gaussian filtering will be performed first, and then the noise expectation value will be indexed.
This parameter is the operator of the 0th layer 5x5 Gaussian filter mentioned above.
coef0+coef14+coef24+coef34 +coef48+coef5*4 = 1
MFNR_ISO / lvl1_gfsigma
When calculating the noise expectation for the denoised image, Gaussian filtering is performed first, and then the noise expectation value is indexed.
This parameter is the operator of the first layer 3x3 Gaussian filter mentioned above.
coef0+coef14+coef24 = 256
MFNR_ISO / lvl2_gfsigma
When calculating the noise expectation for the denoised image, Gaussian filtering will be performed first, and then the noise expectation value will be indexed.
This parameter is the operator of the 2nd layer 3x3 Gaussian filtering mentioned above.
coef0+coef14+coef24 = 256
MFNR_ISO / Lvl3_gfsigma
When calculating the noise expectation for the denoised image, Gaussian filtering is performed first, and then the noise expectation value is indexed.
This parameter is the operator of the third layer 3x3 Gaussian filtering mentioned above.
coef0+coef14+coef24 = 256
Motion and static judgment parameters motion_detection
[Principle]: By judging whether the object is moving, the static area and the moving area are divided.
The multi-frame superimposition of moving objects weakens to prevent the problems of smear and penetration. [Debug]: It is recommended to debug a basic level of mfnr first when turning off multi-frame overlay to balance the basic level of smear and penetration.
Then turn on the enable bit for dynamic and static judgment, and first set mfnr_sigma_scale to 1 to see how the noise is.
When the dynamic and static judgment function is turned on and mfnr_sigma_scale is 1:
The denoising level of mfnr in the static area is basically the same as that of the unopened situation;
The denoising level of mfnr in the moving area will be much weaker than when it is not turned on, and the smear and penetration will be reduced more.
If the noise in the static area is still quite strong, you can increase the intensity of mfnr_sigma_scale.
Enable
The switch enable bit for dynamic and static judgment in each mode, 1: enable, 0: disable.
ISO
Different ISO grades correspond to different parameter settings. iso supports up to 204800.
sigmaHScale
Dynamic and static judgment high frequency ratio. The value range is [0, 1]. The default value is 1, there is no need to change this value during debugging.
sigmaLScale
Dynamic and static decision low frequency ratio. The value range is [0, 1]. The default value is 0.5, and this value does not need to be changed during debugging.
light_clp
Unused.
uv_weight The dynamics and statics determine the proportion of chrominance components. The value range is [0, 1]. The default value is 1.
mfnr_sigma_scale
The overall strength of the dynamic judgment. The value range is [1, 4], and the default value is 4.
The larger the value, the better the multi-frame overlay effect.
yuvnr_gain_scale0
The current frame movement area ynr enhances the intensity 0 in low frequency . The value range is [1, 2], and the default value is 2.
The larger the value, the better the denoising effect.
yuvnr_gain_scale1
Strength ynr of the current frame motion area increases the strength by 1 in high frequency. The value range is [1, 2], and the default value is 2.
The larger the value, the better the denoising effect.
yuvnr_gain_scale2
The intensity of the movement area of the past frame ynr enhances the intensity. The value range is [1, 2], and the default value is 2.
The larger the value, the better the denoising effect.
4.2.2.3 Tuning steps
Mfnr-first turn off bayernr, gic, ynr, uvnr, sharp, edgefilter, adjust the scale value of mfnr, and choose a balance value between smear and denoising. Generally speaking, the superimposition effect equivalent to 6 frames is better, because the mfnr denoising power will increase while the income will be reduced, but the smear and other defects will increase.
As shown in the figure below, from left to right, mfnr is turned off , mfnr is superimposed for about 6 frames, mfnr is extremely effective,
4.2.3 YNR
4.2.3.1 Function Description
This module performs wavelet denoising processing on the image brightness signal in the YUV domain.
Based on the noise calibration results, the denoising module establishes a denoising model that is more fit the noise characteristics.
The algorithm is mainly to layer 4 scales, and each scale is divided into high and low frequency to denoise the luminance signal separately.
Supports two kinds of noise calibration and noise parameters for high signal-to-noise ratio and low signal-to-noise ratio, for example: CIS supporting dual conversion gain mode (Dual convertion gain DCG), high conversion gain (HCG) corresponding to high signal-to-noise ratio mode, Low conversion gain (HCG) corresponds to low signal-to-noise ratio mode.
Figure 4-2-3-1 YNR functional block diagram Figure 4-2-3-2 YNR sub-function block diagram
4.2.3.2 Key Parameter
Enable:
YNR module enable bit, 0: closed, 1: open.
Mode
Parameter configuration of YNR 3 kinds of scene operation modes
【Member】
| Member | Description |
|---|---|
| cell/Name | Identifies the name of the scene running mode. "normal": YNR parameters applied in linear and color modes. For example: IPC Daytime Color "hdr": YNR parameter applied in hdr mode. "gray": YNR parameters applied in black and white mode |
| cell/Setting | Specific YNR parameter settings. For details, please refer to the following Setting/xxx member parameter description |
Setting
SNR_Mode
"HSNR": Identifies the YNR parameter used in HSNR mode
"LSNR": Identifies the YNR parameter used in LSNR mode
YNR_ISO
YNR parameters under each ISO.
YNR_ISO / Iso
The current file corresponds to the iso value, and the value range is [50 2048].
Calibration Data
YNR_ISO / sigma_curve
Noise sigma curve. The noise curve value calibrated by the ynr module calibration tool.
YNR_ISO / ynr_lci, ynr_lhci, ynr_hlci, ynr_hhci
The value is calibrated by the calibration tool. Affect the noise sigma value. This negative value is definitely wrong.
ynr_lci: the ratio of low frequency LL noise curve, 1~4 correspond to four layers respectively.
ynr_lhci: the ratio of high frequency LH noise curve, 1~4 correspond to four layers respectively.
ynr_hlc: the ratio of high frequency HL noise curve, 14 correspond to four layers respectively. ynr_hhci: ratio of high frequency HH noise curve, 14 correspond to four layers respectively.
Low-frequency layer denoising adjustment parameters
YNR_ISO / lo_lumaPoint
Luma denoise strength of different luma value in low-frequency . Corresponds to the value of the pixel.
The value range [0 255].
YNR_ISO / lo_lumaRatio
Luma denoise strength of different luma value in low-frequency . Corresponding to the denoise strength.
The value range [0 2].
YNR_ISO / lo_directionStrength
The maximum value of the low frequency sigma adjustment factor. The value range is [0 16).
The algorithm detects the texture at low frequencies to determine the edge area and flat area,
According to the weight of the center point, judge the weight and calculate the sigma influence factor.
YNR_ISO / lo_bfScale
The minimum value of the low-frequency sigma adjustment factor. Divided into 1-4 layers. Value range (0-16).
The larger the value, the greater the denoising.
YNR_ISO / imerge_ratio
The algorithm detects texture values at low frequencies, uses bilateral filtering results at edges, and uses Gaussian filtering results in flat areas.
In the middle of these two texture thresholds, the results of bilateral and Gaussian interpolation are used. One parameter is the weighted ratio parameter.
The greater the value, the greater the Gaussian filter weight. The smaller the value, the greater the bilateral filtering weight. Value range (0 16).
YNR_ISO / imerge_bound
The texture threshold mentioned above is related. The texture threshold is imerge_bound, 2*imerge_bound].
The value range [1 16].
YNR_ISO / denoise_weight
Adjust the intensity of noise reduction at low frequency in 1-4 layers, the value range is [0 1].
It is realized by weighting the filtering result and the original value according to the ratio of the denoising weight value.
The larger the value, the larger the filtering ratio, the better the denoising effect.
If the value is small, the original value accounts for a large proportion, and there will be more noise.
High-frequency layer denoising adjustment parameters
YNR_ISO / hi_lumaPoint
Luma denoise strength of different pixel value in high-frequency . Corresponds to the pixel value.
The value range [0 255].
YNR_ISO / hi_lumaRatio
Luma denoise strength of different pixel value in high-frequency . Corresponds to the denoise strength. The value range (0 2).
The greater the value, the greater the intensity of noise reduction.
YNR_ISO / hi_bfScale
The high-frequency bilateral filter sigma influence factor, the greater the value, the greater the noise reduction intensity. Value range (0-16).
YNR_ISO / hwith_d The spatial weight of the bilateral filtering of high frequency 1-4 layers.
The weights of high-frequency bilateral filtering are d0d4, and the following 14 indicate four layers.
YNR_ISO / hi_denoiseStrength
Intensity adjustment of high frequency denoising. The larger the value, the greater the intensity of noise reduction. Value range (0 16).
YNR_ISO / hi_detailMinAdjDnW
The range of high frequency limit threshold adjustment. Value range [0 2).
YNR_ISO / hi_denoiseWeight
1-4 layers of high frequency adjust the intensity of noise reduction, the value range is [0-64).
It is realized by weighting the filtering result and the original value according to the ratio of the denoising weight value.
The larger the value, the greater the noise reduction intensity.
YNR_ISO / y_luma_point
Gradient partition. Gradient calculation threshold adjustment parameter
YNR_ISO / hgrad_y_level1~4
Gradient threshold adjustment factor. High frequency 1-4 layers, the gradient adjustment factor corresponds to the y-axis of the curve. Value range [0-4).
First calculate the gradient of the current position, and then look up the table and interpolate according to the gradient to obtain the parameter adjustment factor.
The larger the value, the more filtering results are used. The smaller the value, the less filtering is used.
If the gradient is small, the value of this parameter will be set relatively large. If the gradient is large, the value of this parameter will be set relatively small. Monotonically decreasing. YNR_ISO / hi_soft_thresh_scale
Soft threshold adjustment factor. Corresponding to the overall adjustment factor of high frequency 1-4 layers. Value range [0-1).
The greater the value, the greater the denoising intensity.
4.2.3.3 Tuning steps
Ynr-turn off sharp, edgefilter, adjust ynr's scale, weight, strength and other related parameters to achieve a balance between denoising and blemishes. strength*scale is the final zoom factor, used to adjust the sigma value of the filter and control the strength of denoising. The weight controls the ratio of noise removal. The weight should not exceed 70%. After fixing the weight, adjust the scale to select a flat area that can remove the noise value, and then determine the final weight according to the balance of denoising and blemishes.
The following figure corresponds to the results of weight 1.0, 0.8, ynr off from left to right:
Figure 4-2-3-3-1 YNR weight example diagram
It can be seen that 0.8 has an obvious denoising result relative to 0, and the noise defects have reached a better balance.And 1.0 has more obvious flaws, even exceeding the noise level.
As shown in the figure below, the schematic diagrams corresponding to ynr off, scale high, and scale low from left to right: Figure 4-2-3-3-2 YNR scale example diagram
It can be seen that the middle scale high corresponds to a larger scale, and the filter can remove the noise in the flat area. And the scale low corresponding to the scale on the right is too small, which cannot be fully achieved.
4.2.4 UVNR
4.2.4.1 Function Description
This module performs spatial denoising processing on the image chrominance signal (i.e. uv data) in the YUV domain.
The uv data will first be divided into 3 different scales, the color noise on different scales will be removed, and then multi-scale fusion will be performed back to the original image size.
The denoising process on each scale is similar, with median filtering, y-guided UV denoising strength, and UV data denoising and noise backfilling.
Supports two kinds of noise calibration and noise parameters for high signal-to-noise ratio and low signal-to-noise ratio, for example: CIS supporting dual conversion gain mode (Dual convertion gain DCG), high conversion gain (HCG) corresponding to high signal-to-noise ratio mode, Low conversion gain (HCG) corresponds to low signal-to-noise ratio mode.
Figure 4-2-4-1 UVNR functional block diagram
Figure4-2-4-2 UVNR Sub-function block diagram
4.2.4.2 Key parameters
Enable:
UVNR module enable bit, 0: closed, 1: open.
Mode
UVNR parameter configuration in three scene operating modes
【Member】
| Member | Description |
|---|---|
| cell/Name | Identifies the name of the scene running mode. "normal": UVNR parameters applied in linear and color modes. For example: IPC daytime color "hdr": UVNR parameter applied in hdr mode. "gray": UVNR parameters applied in black and white mode |
| cell/Setting | Specific UVNR parameter settings. For details, please refer to the following Setting/xxx member parameter description |
Setting
SNR_Mode
"HSNR": Identifies the UVNR parameters used in HSNR mode
"LSNR": Identifies the UVNR parameters used in LSNR mode
UVNR_ISO
UVNR parameters under each ISO.
UVNR_ISO / Iso
The current file corresponds to the iso value, and the value range is [50 2048].
UVNR_ISO / step0_uvgrad_ratio Adjust color saturation based on gradient, larger value results in high saturation.
The value range is [1 63].
UVNR_ISO / step0_uvgrad_offset
Weight of step0_uvgrad_ratio,0 means that step0_uvgrad_ratio has no effect on color saturation, larger value results in greater influence.
The value range is [0, 1].
Denoising adjustment parameters on scale 1
UVNR_ISO / step1_median_ratio
The weighting factor of the filtered median image and the un-denoised image after 4x4 down- sampling.
The larger the value, the greater the weight of the median filtered image and the smaller the noise.
The value range is [0, 1].
UVNR_ISO / step1_bf_sigmaR
The sigma scale factor of bilateral filter on scale1, the larger the value, the greater the denoising.
The value range is [1.68, 13824], and [5, 64] is recommended.
UVNR_ISO / step1_bf_uvgain
This parameter determines color saturation on scale1,larger value results in high saturation .
The value range is [0, 7.9].
UVNR_ISO / step1_bf_ratio
The weight of the denoised image and the un-denoised image on scale1.
The smaller the value, the greater the weight of the bilateral denoised image, the smaller the weight of the un-denoised image, the greater the overall denoising.
The value range is [0, 1]. Denoising adjustment parameters on scale 2
UVNR_ISO / Step2_median_ratio
After 32x32 down-sampling, the weighting factor of the median filtered image and the un- denoised image. The value range is [0, 1].
UVNR_ISO / step2_bf_sigmaR
The sigma scale factor of bilateral filter on scale2, the larger the value, the greater the denoising.
The value range is [1.68, 13824], and [5, 32] is recommended.
UVNR_ISO / step2_bf_uvgain
This parameter determines color saturation on scale2,larger value results in high saturation .
The value range is [0, 7.9].
UVNR_ISO / step2_bf_ratio
The weight of the denoised image and the un-denoised image on scale2. The value range is [0, 1].
The smaller the value, the greater the weight of the bilateral denoised image, the smaller the weight of the un-denoised image, the greater the overall denoising and denoising.
Denoising adjustment parameters on scale 3
UVNR_ISO / Step3_bf_sigmaR
The sigma scale factor of bilateral filter on scale3, the greater the value, the greater the denoising.
The value range is [1.68, 13824], and [3, 12] is recommended.
If this value is too large, it may cause jagged edges in uv color.
If this value is too high, under very low light, the uv color may change drastically.
UVNR_ISO / Step3_bf_uvgain
This parameter determines color saturation on scale3,larger value results in high saturation .
The value range is [0, 7.9]. UVNR_ISO / Step3_bf_ratio
The weight of the denoised image and the un-denoised image on scale3. The value range is [0, 1].
The smaller the value, the greater the weight of the bilateral denoised image, the smaller the weight of the un-denoised image, the greater the overall denoising and denoising.
Adjustable parameters of bilateral distance weight
UVNR_ISO / kernel_3x3
Distance weight configuration of bilateral filter on scale3 .
UVNR_ISO / kernel_5x5
Distance weight configuration of bilateral filter on scale2 .
UVNR_ISO / kernel_9x9
Distance weight configuration of bilateral filter on scale1 .
UVNR_ISO / kernel_9x9_num
There are a total of 4 types pixel data for bilateral filter on scale1.
Value range [0-3]
4.2.4.3 Tuning steps
When debugging uvnr, you need to turn off sharp and edgefilter modules, adjust step1/2/3_bf_sigmaR, step1/2/3_bf_uvgain value to remove the high-frequency and low- frequency color noise, and trade the balance between chroma noise reduction and saturation decrease. Pay attention to the strength of low-frequency color noise removal, if the force is too strong, there will be frame-to-frame flicker.
From left to right, the following figure corresponds to removing low-frequency color noise, removing high-frequency color noise, and uvnr is turned off; Figure 4-2-4-3-1 UVNR high and low frequency decolorization example diagra
From left to right, the figure below corresponds to uvnr step 1 with the highest intensity, uvnr step 1 with moderate intensity, and uvnr off;
Figure 4-2-4-3-2 UVNR
From left to right, uvnr step 3 has the highest intensity, uvnr step 3 has moderate intensity, and uvnr off. Figure 4-2-4-3-3 UVNR step3 example diagram of different strengths
4.2.5 SHARP
4.2.5.1 Function description
The Sharpen module is used to enhance the sharpness of the image, which can realize the individual sharpening and enhancement of the directional edge and the non-directional detailed texture of the image, and by adjusting the frequency band to be enhanced, a variety of sharpness style enhancement effects can be achieved .
Support the sharpening parameter settings for the two noise modes of high signal-to-noise ratio and low signal-to-noise ratio respectively, for example: CIS supporting dual conversion gain mode (Dual conversion gain DCG), high conversion gain (HCG) corresponding to high signal-to- noise ratio Mode, low conversion gain (HCG) corresponds to low signal-to-noise ratio mode.
Figure 4-2-5-1 SHARP functional block diagram
4.2.5.2 Key parameters
Enable:
Sharp module enable bit, 0: disable, 1: enable. Mode
Sharp parameter configuration in three scene operating modes
【Member】
| Member | Description |
|---|---|
| cell/Name | Identifies the name of the scene running mode. "normal": Sharp parameters applied in linear and color modes. For example: IPC Daytime Color "hdr": Sharp parameters applied in hdr mode. "gray": Sharp parameters applied in black and white mode |
| cell/Setting | Specific Sharp parameter settings. For details, please refer to the following Setting/xxx member parameter description |
Setting
SNR_Mode
"HSNR": Identifies the Sharp parameters used in HSNR mode
"LSNR": Identifies the Sharp parameters used in LSNR mode
SHARP_ISO
Sharp parameters under each ISO.
SHARP_ISO / Iso
The current file corresponds to the iso value.
ISO supports up to 204800.
range clip to limit related adjustment parameters
SHARP_ISO / Lratio
The low ratio used to extract high frequency from image, the smaller the value, the sharper the image with more halo. The value range [0 1]. SHARP_ISO / Hratio
the high ratio used to extract high frequency from image, the greater the value, the sharper the image with more halo. The value range [1 2].
Pre-filtering related adjustment parameters
SHARP_ISO / luma_sigma
Pre-filtering sigma curve y-axis, 0~255.
SHARP_ISO / pbf_gain
The ratio of src image noise reduction intensity, the greater value can reduce more noise and detail.
The value range [0 2].
SHARP_ISO / pbf_ratio
The ratio of the denoise image and src image, the greater value can reduce more noise and detail.
The value range [0 1].
SHARP_ISO / pbf_add
The add value of src image noise reduction intensity, the greater value can reduce more noise and detail.
The value range [0 255].
Intermediate frequency sharpening related adjustment parameters
SHARP_ISO / mf_sharp_ratio
Mid frequency sharp degree, the greater the value, the sharper the image.
The value range [0 8).
SHARP_ISO / mf_clip_pos The positive clamp value of mid frequency value, smaller clamps can reduce the halo effect and the sharpness of image. The value range [0 255].
SHARP_ISO / mf_clip_neg
The negative clamp ratio of mid frequency value, greater value can reduce the halo effect and the sharpness of image. The value range [-2 0].
SHARP_ISO / mbf_gain
The ratio of mid frequency filter intensity, the greater value can reduce more halo and detail.
The value range [0 2].
SHARP_ISO / mbf_add
The add value of mid frequency filter intensity, the greater value can reduce more halo and detail.
The value range [0 255].
High-frequency sharpening related adjustment parameters
SHARP_ISO / hf_sharp_ratio
High frequency sharp degree, the greater the value, the sharper the image. The value range [0 8).
SHARP_ISO / hf_clip
The clamp value of high frequency value, tighter clamps (smaller absolute value) can add less detail and noise. The value range [0 255].
SHARP_ISO / hbf_gain
The ratio of high frequency filter intensity, the greater value can reduce more noise and detail.
The value range [0 2]. SHARP_ISO / hbf_ratio
The ratio of the denoise high frequency image and src high frequency image, the greater value can reduce more noise and detail. The value range [0 1].
SHARP_ISO / hbf_add
The add value of high frequency filter intensity, the greater value can reduce more noise and detail.
The value range [0 255].
SHARP_ISO / local_sharp_strength
This parameter is relate to the local high frequency sharp degree, greater the value can add more detail and noise. The value range [0 255].
4.2.5.3 Tuning steps
Sharp——All modules are turned on.
hf_sharp_ratio controls the strength of high-frequency edge enhancement. mf_sharp_ratio controls the strength of mid-frequency contrast and edge enhancement. pbf_ratio, pbf_gain, pbf_add, hbf_ratio, hbf_gain, hbf_add are used for the balance of high frequency enhancement and noise suppression. mbf_gain, mbf_add are used for the balance of mid-frequency enhancement and noise suppression.
As shown in the figure below, from left to right are the high-frequency enhancement, no enhancement, and mid-frequency enhancement:
Figure 4-2-5-3 Schematic diagram of SHARP mid and high frequency enhancement It can be seen that the contrast has been enhanced in the right, and not enhanced in the left.
4.2.6 Edgefilter
4.2.6.1 Function description
This module mainly detects and filters the edges to make the edge enhancement cleaner.
In addition, this module also supports high-frequency noise superimposition (DOG module), making the details richer and more delicate.
Supports Edgefilter parameter settings in two noise modes: high signal-to-noise ratio and low signal-to-noise ratio, for example: CIS supporting dual conversion gain mode (Dual convertion gain DCG), high conversion gain (HCG) corresponding to high signal-to-noise ratio mode , Low conversion gain (HCG) corresponds to low signal-to-noise ratio mode.
Figure 4-2-6-1 Functional block diagram of EdgefilterNR
4.2.6.2 Key Parameter
Enable:
Edgefilter module enable bit, 0: closed, 1: open.
Mode
Parameter configuration of Edgefilter in three scene operating modes
【Member】
| Member | Description |
|---|---|
| cell/Name | Identifies the name of the scene running mode. "normal": Edgefilter parameters applied in linear and color modes. For example: IPC Daytime Color "hdr": Edgefilter parameters applied in hdr mode. "gray": Edgefilter parameters applied in black and white mode |
| cell/Setting | Specific Edgefilter parameter settings. For details, please refer to the following Setting/xxx member parameter description |
Setting
SNR_Mode
"HSNR": Identifies the Edgefilter parameters used in HSNR mode
"LSNR": Identifies the Edgefilter parameters used in LSNR mode
EDGEFILTER_ISO
Edgefilter parameters under each ISO.
EDGEFILTER_ISO / iso
The current file corresponds to the iso value.
ISO supports up to 2048.
Edge filtering related adjustment parameters
EDGEFILTER_ISO / direct_filter_coeff
Edge filter horizontal direction coefficient.
EDGEFILTER_ISO / edge_thed
The value of the high frequency threshold, the smaller the value, the stronger the edge filter of flat region, and the more fabric texture. The range value [0 255].
EDGEFILTER_ISO / src_wgt The ratio of src image, the smaller value means more denoising and cleaner edges. The range value [0 1].
EDGEFILTER_ISO / alpha_adp_en
Adaptive edge filter switch. 0: off, 1: on.
when it set to 1, use the adaptive edge filter and the flat area denoising strength is weaker, at this case, local_alpha is not used.
EDGEFILTER_ISO / local_alpha
When alpha_adp_en is set to 0, the ratio of the edge filter image and src image, the higher value means more denoising and cleaner edges. The range value [0 1].
EDGEFILTER_ISO / global_alpha
The global ratio of the edge filter image and src image, the higher value means more denoising and cleaner edges. The range value [0 1].
EDGEFILTER_ISO / noise_clip
The clamp value used for edge filter, the higher value means more denoising and cleaner edges. The range value [0 255].
DOG related adjustment parameters
EDGEFILTER_ISO / dog_clip_pos
The positive clamp value of high frequency detail, the higher the value, the more high frequency detail be added. The range value [0 255].
EDGEFILTER_ISO / dog_clip_neg
The negative clamp value of high frequency detail, the higher the value, the more high frequency detail be added. The range value [0 255]. EDGEFILTER_ISO / dog_alpha
The ratio of high frequency detail, the higher the value, the more high frequency detail be added. The range value [0 3].
EDGEFILTER_ISO / dog_kernel_row0~4
Dog filter coefficient.
4.2.6.3 Tuning steps
Edgefilter is divided into 2 parts, edge enhancement and dog detail restoration. The former is controlled by edge_thed, alpha_adp_en, local_alpha, global_alpha, etc.
edge_thed is used to determine the threshold of edge validity. The larger the value, the fewer edges will be enhanced.
If alpha_adp_en is 1, the edge_thed cannot control the ratio of edge enhancement, and local_alpha determine the ratio of edge enhancement.
When alpha_adp_en is 0, global_alpha can be set to 0, and use local_alpha to keep balance between edge enhancement and noise suppression.
The principle of Dog details is to control the multiple of restoration based on dog_alpha, while dog_kernel is used to calculate the information that needs to be restored. Different Gaussian coefficient can determine different dog_kernel.
4.2.7 NR & Sharp Tuning steps
ISP debugging is mainly divided into low frequency, high frequency and noise form, mainly considering the size and form of noise in a single frame. As a result of cascading with the encoder, the size and shape of the inter-frame noise need to be considered.
4.2.7.1 Scale concept understanding
In digital images, the higher the sampling frequency, the higher the frequency. One pixel sampling is the highest frequency, and two pixels sampling is the sub-high frequency. The more pixels are separated, the lower the frequency. We can also the size of the details or noise in the image (which can also be regarded as the scale of down-sampling) is divided. The larger the size, the lower the frequency, and vice versa. In mfnr and ynr denoising, the image is divided into different frequencies for denoising. The one used to divide high and low frequencies is level, 0-2 in mfnr is high frequency, 3 is medium and low frequency; ynr is 0-1 is high frequency, 2-3 is the middle and low frequency. The watershed for dividing the high and low frequencies here is about 1/8 of the scale of the down-sampling. In fact, there is no absolute watershed for the high and low frequencies, so the parameters need to be smooth during debugging.
4.2.7.2 Module Association Debugging
The following is an overall introduction to the modules associated with low-frequency noise and contrast adjustment, high-frequency adjustment and noise pattern adjustment. 4.2.7.2.1 Debugging of low frequency signal
Figure 4-2-7-2-1 Main related modules for low frequency and contrast debugging
Dehaze adjusts the degree of contrast enhancement through enhancement_value, and the low-frequency noise will also be increased proportionally.
MFNR suppresses low frequency noise by adjusting y_hi_bfscale and y_lo_bfscale lvl2-3, and chooses a balance between smear and denoising level.
YNR suppresses the low-frequency noise by adjusting the strength of the 2-3 layer parameters. If the denoising power is too large, it will change the noise pattern and image content, and produce blemishes, so it needs to be controlled within a certain range, such as denoise_weight preferably below 0.7 , And hi_soft_thresh_scale should not be too large.
The mbf parameters in sharp can control the details and noises in mid-frequency. mf_sharp_ratio controls the details. mbf_add and mbf_gain control the noise suppression, but no matter how you control it, the noise will be improved in the end. So you need pay the attention to the balance between details and noises.
4.2.7.2.2 Debugging of high-frequency signals
Figure 4-2-7-2-2 Main related modules of high frequency debugging
Bayernr suppresses the high-frequency noise by adjusting filtPara, but it will affect the image details and noise shape.
Dehaze adjusts the degree of contrast enhancement through enhancement_value, and high- frequency noise will also be increased proportionally.
Mfnr suppresses high frequency noise by adjusting y_hi_bfscale and y_lo_bfscale in lvl0-2, and chooses a balance between smear and denoising level.
Ynr suppresses high-frequency noise by adjusting the strength of the 0-2 layer parameters. If the denoising power is too large, it will change the noise shape and image content, and produce blemishes. Therefore, it needs to be controlled within a certain range. And hi_soft_thresh_scale should not be too large. The hbf and pbf related parameters in Sharp control the enhancement details and noise in high-frequency . While suppressing noise, it also suppresses some weaker mid- and high- frequency details. The introduction of high-frequency noise here needs to be adjusted by gain, add, and ratio of mbf, hbf, and pbf respectively, but no matter how you control it, the noise will be increased a little, so you need to pay attention when adjusting the parameters.
Edgefilter strengthens high-frequency edges and suppresses high-frequency noise, which also affects high-frequency details and affect the shape of high-frequency noise. The former is achieved through edge filtering, that is, local_alpha, edge_thed, alpha_adp_end and other parameters; the latter is through dog_alpha and dog_kernel.
4.7.2.2.3 Debugging of noise patterns
Figure 4-2-7-2-3 Main related modules for noise pattern debugging
The increase in Bayernr strength makes the image noise particles larger, and the high frequency details of the image are less.
If the Ynr denoising power is too large, it will change the shape of the noise and the content of the image, and introduce blemishes. Therefore, it needs to be controlled within a certain range.
Both pbf and hbf in Sharp affect the shape and size of high-frequency noise. Generally speaking, gain and add control the intensity of denoising, and ratio determines the proportion of the final noise to be subtracted. The larger the ratio, the more noise will be removed. In theory, if the parameters is not appropriate, the noise will be uneven, some will be suppressed ,and some will be amplified at the same time.
The edge filter in Edgefilter will affect the shape of high-frequency noise, which will cause the particles of high-frequency noise to become larger and lower-frequency.
4.3 MERGE
4.3.1 Function Description
Through this module, you can adjust the ratio of long (medium) and short frames used in the synthesis process. The ratio of using a certain frame is determined by the frame's overexposure weight and motion weight. The two are in a product relationship. The overexposure weight is determined by the overexposure curve, and the motion weight is determined by the motion curve. The overexposure curve is determined by the two parameters OECurve_smooth and OECurve_offset. In the two-frame mode, whether the overexposure is judged between the long frame and the short frame, and in the three-frame mode, whether the overexposure is judged between the long frame and the middle frame.
The motion curve includes the long and medium frame motion curves (determined by the two parameters of MDCurveLM_smooth and MDCurveLM_offset) and the medium and short frame motion curves (determined by the two parameters of MDCurveMS_smooth and MDCurveMS_offset). In the two-frame mode, only the medium and short frame motion curves are effective. .
Figure 4-3-1 Merge block diagram
4.3.2 Key Parameter
4.3.2.1 EnvLv
Environment brightness, the value range is [0,1], where 0 means the environment is completely black, and 1 means the environment is the brightest. Control OECurve_smooth and OECurve_offset through EnvLv.
【Notes】
The brightness of the current environment can be obtained from the online debugging module of the tool.
4.3.2.2 OECurve_smooth
Indicates the slope of the overexposure curve, the value range is [0,1], and the default value is 0.4.
4.3.2.3 OECurve_offset
Indicates the offset value of the overexposure curve, the value range is [108,280], and the default value is 210. 4.3.2.4 MoveCoef
Indicates the degree of motion of the screen, with a value range of [0,1], where 0 represents completely still, and 1 represents complete motion. Use MoveCoef to control MDCurveLM_smooth, MDCurveLM_offset, MDCurveMS_smooth and MDCurveMS_offset. (Because the current scene detection has not been done, the amount of exercise cannot be obtained, and the actual use is that MoveCoef is equal to 1).
4.3.2.5 MDCurveLM_smooth
Indicates the slope of the motion curve between the long frame and the middle frame, the value range is [0,1], and the default value is 0.4. In two-frame mode, this value is invalid
4.3.2.6 MDCurveLM_offset
Indicates the offset value of the motion curve between the long frame and the middle frame, the value range is [0.26,1], and the default value is 0.38. In two-frame mode, this value is invalid
4.3.2.7 MDCurveMS_smooth
Indicates the slope of the motion curve between the medium frame and the short frame, the value range is [0,1], and the default value is 0.4.
4.3.2.8 MDCurveMS_offset
Indicates the offset value of the motion curve between the medium frame and the short frame, the value range is [0.26,1], and the default value is 0.38.
4.3.2.9 OECurve_damp
Represents the smoothing coefficient of the change of the overexposure curve, which is the proportion of the current frame parameter, the value range is [0,1], and the default value is 0.3.
4.3.2.10 MDCurveLM_damp Represents the smoothing coefficient of the motion curve change between frames in the long frame, which is the proportion of the current frame parameter, the value range is [0,1], and the default value is 0.3. (In the two-frame mode, this value is invalid)
4.3.2.11 MDCurveMS_damp
Represents the smoothing coefficient of the change of the motion curve between the medium and short frames, which is the proportion of the current frame parameter, the value range is [0,1], and the default value is 0.3.
4.3.3 Tuning steps
Merge debugging mainly includes two parts: overexposure curve debugging and motion curve debugging.
4.3.3.1 Overexposure curve debugging
The overexposure curve OECurve is determined by OECurve_smooth and OECurve_offset (the curve is shown in the figure below). At the same time, different overexposure curves are set under different Envlv.
OECurve diagram【Member】
| Member | Description |
|---|---|
| OECurve smooth _ | Overexposure curve slope |
| OECurve offset _ | Overexposure curve slope |
【Notes】
- OECurve_smooth:
From the image point of view, this value indicates the smoothness of the excessive area of the long and short frames: the smaller the value, the smoother the transition between the overexposed area and the non-overexposed area, and the larger the transition area. Conversely, the overexposed area and the non-overexposed area The transition between the exposed areas is more abrupt, but the transition area is smaller. As shown in the figure below, the red curve represents a value of 0, the green curve represents a value of 0.4, and the blue curve represents a value of 1.
OECurve_smooth schematic diagram
- OECurve_offset:
From the image point of view, this value represents the initial value of the short frame used at the overexposure. The smaller the value, the maximum weight of the medium frame (or short frame) is used. A few more special points: 108 represents, the value of the overexposure curve that is set down is all 1023, at this time the weight of the medium frame (or short frame) is the largest, as shown in the yellow curve in the figure below; 128 is the value representing the secondary brightness When starting at 128, the medium frame (or short frame) may be used, as shown by the blue curve in the following figure; 215 is the representative, and the value of 215 is the value that starts from the brightness of 215, the medium frame (or short frame) may be used At the same time, when it reaches 256, the weight of the middle frame (or short frame) is just 1023, as shown by the green curve in the figure below; 280 means that the overexposure curve values are all 0, and the merge will not use the middle frame ( Or short frame), as shown by the red curve in the figure below:
Schematic diagram of OECurve_offset
4.3.3.2 Motion curve debugging
The motion curve MDCurve includes the long frame and the middle frame motion curve (determined by the two parameters of MDCurveLM_smooth and MDCurveLM_offset) and the middle frame and the short frame motion curve (determined by the two parameters of MDCurveMS_smooth and MDCurveMS_offset) (the curve is shown in the figure below). MDCurve diagram
When the picture is moving, it is necessary to reduce the weight, thereby reducing the use of short frames (or medium frames), thereby reducing the ghosting caused by motion. At the same time, set different motion curves under different MoveCoef
【Member】
| Member | Description |
|---|---|
| MDCurve smooth _ | Motion curve slope |
| MDCurve offset _ | Slope of motion curve |
【Notes】
- MDCurve_smooth:
This value indicates the smoothness of the transition area of short and medium frames (or long and medium frames): the smaller the value, the smoother the transition between the overexposed area and the non-overexposed area, and the larger the transition area. On the contrary, the overexposed area The transition between the non-overexposed areas is more abrupt, but the transition area is smaller. As shown in the figure below, the green curve represents a value of 0, the red curve represents a value of 0.4, and the blue curve represents a value of 1. MDCurve_smooth schematic diagram
- MDCurve_offset:
From the image point of view, this value represents the initial value of the frame in use at the overexposure. The smaller the value, the maximum weight of the medium frame (or short frame) is used. When the green curve represents a value of 0, the blue curve represents a value of 0.38, and the red curve represents a value of 1. MDCurve_offset diagram
4.4 TMO
4.4.1 Function description
SDR (standard dynamic range) monitors usually can only display 8bit data. If you directly display the captured high-dynamic scene image on the SDR monitor, a lot of details will be lost, so dynamic range compression is required before display.
The role of TMO is to compress the content of high dynamic scenes while preserving the original contrast and details as much as possible and displaying them on the monitor. The displayed effect should be close to that directly observed by the human eye. The image can be adjusted through this module.
The framework of TMO algorithm and key parameters of the TMO module are shown in the figure. TMO block diagram
4.4.2 Key Parameter
4.4.2.1 Enable
TMO function switch in different modes
0: open
1: Close
【Member】
【Notes】
4.4.2.2 GlobalLuma
This parameters control the global luminance of the image after TMO.
【Member】
| Member | Description |
|---|---|
| GlobalLumaMode | Selection of GlobelLuma controlling factor, 0: EnvLv, 1: ISO |
| EnvLv | Environment Luminance, value range [0,1], 0: black, 1: the brightest. |
| ISO | ISO |
| Tolerance | Tolerance of EnvLv or ISO. |
| GlobalLuma | Global luminance of the image after TMO, controlled by EnvLv or ISO. The value range is [0,1], and the default value is 0.25. |
【Notes】Tolerance is to prevent the DetailsHighlight from changing too frequently whick will cause flicker. When the percentage of EnvLv or ISO changing is less than Tolerance, the value of GlobalLuma remains still. For products such as IPC, Tolerance should be 0.
4.4.2.3 DetailsHighLight
Through this part of the parameters, you can control the detail (luminance) of the highlight region.
【Member】
| Member | Description |
|---|---|
| DetailsHighLightMode | Selection of DetailsHighLight controlling factor, 0: OEPdf, 1: EnvLv |
| OEPdf | The percentage of the overexposed area in the image. This parameter is obtained from AE. The range is [0,1]. To determine whether it is an overexposed area, please refer to OEROILowTh in AE parameters. |
| EnvLv | Environment luminance, value range [0,1], 0: black, 1: brightest |
| Tolerance | Tolerance of OEPdf or EnvLv. |
| DetailsHighLight | The details of the highlight region in image after TMO, the range is [0,1], and the default value is 0.5. |
【Notes】
Tolerance is to prevent the DetailsHighlight from changing too frequently which will cause flicker. When the percentage of OEPdf or EnvLv changing is less than Tolerance, the value of DetailsHighlight remains still. For products such as IPC, tolerance should be 0.
4.4.2.4 DetailsLowLight
This parameter controls the details (luminance) of the dark region.
【Member】
| Member | Description |
|---|---|
| DetailsLowLightMode | Selection of DetailsLowLight controlling factor, 0: FocusLuma, 1: DarkPdf, 2: ISO |
| FocusLuma | The luminance(8bit) at the focus area , the range is [1,100]. |
| DarkPdf | The percentage of the dark area in image, the range is [0,1]. |
| ISO | ISO |
| Tolerance | Tolerance of FocusLuma, DarkPdf or ISO. |
| DetailsLowLight | The details of the low light region in image after TMO. The range is [1,4], and the default value is 1. |
【Notes】
When using FocusLuma, AF should work normally. If AF does not work and DetailsHighLightMode is 0, the value of DetailsHighLight will be fixed to DetailsHighLight[0].
DarkPdf equals the percentage of the dark area in long frames when in 2x hdr mode, and in 3x hdr mode equals the percentage of medium frame . This value is obtained from AE.
Tolerance is to prevent the DetailsLowlight from changing too frequently which cause flicker. When the percentage of FocusLuma, DarkPdf or ISO changing is less than Tolerance, the value of DetailsLowlight remains still. For products such as IPC, Tolerance should be 0.
4.4.2.5 GlobalTMO
Since Local TMO will increase the chance of TMO flicker, in some products with large resolution and high frame rate, please use GlobalTMO.
【Member】
| Member | Description |
|---|---|
| Enable | Function switch, 0: off, 1: on |
| IIR | The number of IIR filter frame. the range is [1,1000], and the default value is 64 |
| Mode | Selection of GlobalTMOStrength controlling factor, 0: DynamicRange, 1: EnvLv |
| DynamicRange | Dynamic range of the image, and the range is [1,84] |
| EnvLv | Environment luminance, and the is range [0,1]. 0: black, 1: brightest |
| Tolerance | Tolerance of DynamicRange or EnvLv |
| GlobalTMOStrength | The strength of Global TMO, the range is [0,1], and the default value is 0.5 |
【Notes】
When Enable is turned on, the type of TMO is GlobalTMO, and all the parameters in LocalTMO are invalid. When Enable is turned off, the type of TMO is a mix of GlobalTMO and LocalTMO, and the parameters in both GlobalTMO and LocalTMO are valid.
Tolerance is to prevent GlobalTMOStrength from changing too frequently which cause flicker. When the percentage of DynamicRange or EnvLv changing is less than Tolerance, the value of GlobalTMOStrength does not change. For products such as IPC, Tolerance should be 0.
when the type of TMO is a mix of GlobalTMO and LocalTMO, GlobalTMOStrength will only change the GlobalTMO part.
4.4.2.6 LocalTMO
The parameters of this part are used to control the percentage of Local TMO.
【Member】
| Member | Description |
|---|---|
| LocalTMOMode | Selection of LocalTMOStrength controlling factor, 0: DynamicRange, 1: EnvLv |
| DynamicRange | The dynamic range of the current screen, the value range is [1,84]. |
| EnvLv | Environment luminance, and the range is [0,1], 0: black, 1: the brightest. |
| Tolerance | Tolerance of DynamicRange or EnvLv. |
| LocalTMOStrength | This value represents the percentage of local TMO, and the range is [0,1]. The default value is 0.3. |
【Notes】
Tolerance is to prevent LocalTMOStrength from changing too frequently which cause flicker. When the percentage of DynamicRange or EnvLv changing is less than Tolerance, the value of LocalTMOStrength does not change. For products such as IPC, Tolerance should be 0.
4.4.2.7 Damp
Represents the smoothing coefficient of GlobalLuma, DetailsHighLight, DetailsLowLight, GlobalTMOStrength and LocalTMOStrength parameter changeing, which is the percentage of the current frame parameter. The value range is [0,1], and the default value is 0.9.
4.4.3 Tuning steps
TMO debugging mainly includes five parts: GlobalLuma, HighLightDetails, LowLightDetails, GlobalTMO and LocalTMO debugging.
4.4.3.1 GlobalLuma debugging
The GlobalLuma is determined by the GlobalLuma value, and the controlling factor of GlobalLuma can be selected by GlobalLumaMode. When GlobalLumaMode is 0, the GlobalLuma value changes with EnvLv, and when GlobalLumaMode is 1, the GlobalLuma value changes with ISO.
【Member】
| Member | Description |
|---|---|
| GlobalLumaMode | Selection of GlobelLuma Control Volume |
| GlobalLuma | Indicates the overall brightness of the image after TMO |
【Notes】
From image, the higher the GlobalLuma value, the brighter of the image after TMO, as shown in the figure below, the orange line represents when GlobalLuma is 0.5, and the blue line represents when GlobalLuma is 0.25. GlobalLuma diagram
The real images are as follows (GlobalLuma=0.25 on the left, GlobalLuma=0.5 on the right):
GlobalLuma comparison chart
4.4.3.2 Highlight details debugging
The DetailsHighLight is determined by the DetailsHighLight value, and the controlling factor of DetailsHighLight can be selected by DetailsHighLightMode. When DetailsHighLightMode is 0, the DetailsHighLight value changes with OEPdf, and when DetailsHighLightMode is 1, the DetailsHighLight value changes with EnvLv.
【Member】
| Member | Description |
|---|---|
| DetailsHighLightMode | DetailsHighLight controlling factor selection |
| DetailsHighLight | The details of the highlight part of the image after TMO |
【Notes】
For image, when the DetailsHighLight value is smaller, the details of the highlights are more. As shown in the figure below, the left represents when DetailsHighLight is 0.5, and the right represents when DetailsHighLight is 0.45.
DetailsHighLight comparison chart
4.4.3.3 Low-light detail debugging
The DetailsLowLight is determined by the value of DetailsLowLight, and the controlling factor of DetailsLowLight can be selected by DetailsLowLightMode. When DetailsLowLightMode is 0, the DetailsLowLight value changes with FocusLuma, when DetailsLowLightMode is 1, the DetailsLowLight value changes with EnvLv, and when DetailsLowLightMode is 2, the DetailsLowLight value changes with ISO.
【Member】
| Member | Description |
|---|---|
| DetailsLowLightMode | DetailsLowLight controlling factor selection |
| DetailsLowLight | Indicates the detailsof the low light part of the picture after TMO |
【Notes】
For image, when the DetailsLowLight value is larger, the low-light part has more details.However, When the brightness increases more, the contrast may decrease. The corresponding meaning of the value is to increase the brightness of the dark area by 1x~4x. The actual comparison chart is as follows (DetailsLowLight=1 on the left, DetailsLowLight=4 on the right): DetailsLowLight comparison chart
4.4.3.4 GlobalTMO debugging
The GlobalTMO is determined by the value of GlobalTMOStrength, and the controlling factor of GlobalTMOStrength can be selected by GlobalTMOMode. When GlobalTMOMode is 0, the GlobalTMOStrength value changes with DynamicRange, and when GlobalTMOMode is 1, the GlobalTMOStrength value changes with EnvLv.
【Member】
| Member | Description |
|---|---|
| GlobalTMOMode | Selection of LocalTMO Controlling factor |
| IIR | The frame number of IIR filter |
| GlobalTMOStrength | This parameter is to adjust the global luma in Global TMO mode |
【Notes】
The benchmark value of GlobalTMOStrength is 0.5. For image, when the value of GlobalTMOStrength is larger, the global image is brighter,however the contrast is lower, and the highlight area details are less. On the contrary, the overall brightness is smaller, the contrast is greater, and the highlight area details are more detailed. .
The larger the IIR value, the smoother the brightness transition between frames. The IIR value interval is recommended to be [16,128].
4.4.3.5 LocalTMO debugging The LocalTMO is determined by the value of LocalTMOStrength, and the controlling factor of LocalTMOStrength can be selected by LocalTMOMode. When LocalTMOMode is 0, the LocalTMOStrength value changes with DynamicRange, and when LocalTMOMode is 1, the LocalTMOStrength value changes with EnvLv.
【Member】
| Member | Description |
|---|---|
| LocalTMOMode | Selection of LocalTMO Controlling factor |
| LocalTMOStrength | This value represents the percentage of local TMO in TMO |
【Notes】
When the value of LocalTMOStrength is 0, TMO is Global TMO; when the value is 255, TMO is local TMO; when the value is between 0 and 1, it is a mixture of Global TMO and Local TMO. The real images is as follows (LocalTMOStrength=0 on the left, LocalTMOStrength=0.3 on the right):
LocalTMOStrength comparison chart
The larger the value of LocalTMOStrength is (the more Local TMO is used), the higher the contrast of the picture, the more detail in the highlight and low-light areas, and the more artifacts there are, such as the halo and flicker. The value needs to be compromised.
4.5 FEC
4.5.1 Function description
The squint distortion, pincushion, barrel distortion, etc. caused by the distortion of the optical system and the electronic scanning system may cause the geometric characteristics of the image to be distorted. Image distortion correction is a process of transforming a distorted image into an ideal image in a certain transformation manner.
This module corrects image distortion in the x and y directions.
4.5.2 Key Parameter
4.5.2.1 enable
Switch function
1: Enable
0: Disable
4.5.2.2 correct_level
Distortion correction strength: 0~255
【Notes】
Users can modify Distortion correction strength by the API
4.5.2.3 light_center
Optical axis center of lens, calibration generation
4.5.2.4 distortion_coeff
Lens distortion related parameters, calibration generation
4.6 LDCH
4.6.1 Function Description
The squint distortion, pincushion, barrel distortion, etc. caused by the distortion of the optical system and the electronic scanning system may cause the geometric characteristics of the image to be distorted. Image distortion correction is a process of transforming a distorted image into an ideal image in a certain transformation manner.
This module only corrects the image distortion in the x direction.
4.6.2 Key Parameter
4.6.2.1 enable
Module enable
1: Enable
0: Disable
4.6.2.2 correct_level
Distortion correction strength: 0~255
【Notes】
Users can modify Distortion correction strength by the API
4.6.2.3 correct_level_max
The maximum level of distortion correction: 0~255, calibration generation
【Notes】
There is a limit to the range of ldch correction. Exceeding the range may cause ISP processing exception.
4.6.2.4 light_center
Optical axis center of lens,, calibration generation
4.6.2.5 distortion_coeff
Lens distortion related parameters, calibration generation
4.7 Dehaze & Enhance
4.7.1 Function Description
In weather such as fog and haze, the quality of images will be severely reduced due to atmospheric scattering, such as making the image color more gray and white, the contrast reduced, and the object features difficult to identify. Therefore, image defogging technology is needed to enhance or repair to improve the quality of image. This module contains three modules, namely Dehaze, Enhance and Hist. Dehaze is mainly used when the picture is foggy and haze. Enhance and Hist are mostly used to enhance picture contrast. Among the Dehaze and Enhance, only one module can only be turned on at the same time. If both Dehaze and Enhance are turned on at the same time, only the Enhance module will be valid. Hist can be turned on together with other modules.
Dehaze module block diagram
4.7.2 Key Parameter
4.7.2.1 Enable
Dehaze&Enhance function switch
0: off
1: open
4.7.2.2 cfg_alpha_normal
The software configuration percentage in normal mode, the value range is [0,1], and the default value is 1.
0: Fullly use of adaptive parameters
1: Fully use software configuration parameters, which can control adaptive parameters and software configuration parameters to be mixed in proportion
【Notes】
When the value is 0, cfg_wt, cfg_air, cfg_tmax in Dehaze, and cfg_gratio in Hist are invalid; on the contrary, when the value is 1, the Dehaze parameter is completely determined by cfg_wt, cfg_air, and cfg_tmax, and the Hist parameter is completely determined by cfg_gratio.
4.7.2.3 cfg_alpha_HDR
The software configuration ratio in HDR mode, the value range is [0,1], and the default value is 1.
0: Fullly use of adaptive parameters 1: Fully use software configuration parameters, which can control adaptive parameters and software configuration parameters to be mixed in proportion
【Notes】
When the value is 0, cfg_wt, cfg_air, cfg_tmax in Dehaze, and cfg_gratio in Hist are invalid; on the contrary, when the value is 1, the Dehaze parameter is completely determined by cfg_wt, cfg_air, and cfg_tmax, and the Hist parameter is completely determined by cfg_gratio.
4.7.2.4 cfg_alpha_night
The software configuration ratio in night mode, the value range is [0,1], and the default value is 1.
0: Fullly use of adaptive parameters
1: Fully use software configuration parameters, which can control adaptive parameters and software configuration parameters to be mixed in proportion
【Notes】
When the value is 0, cfg_wt, cfg_air, cfg_tmax in Dehaze, and cfg_gratio in Hist are invalid; on the contrary, when the value is 1, the Dehaze parameter is completely determined by cfg_wt, cfg_air, and cfg_tmax, and the Hist parameter is completely determined by cfg_gratio.
4.7.2.5 Dehaze_Setting
Adjust the defogging parameters through this module.
【Member】
| Member | Description |
|---|---|
| Name | name |
| Dehaze en _ | Dehaze module function switch, 0: close, 1: open |
| ISO | ISO |
| dc min th _ _ | wt adaptive statistical range, value range [16, 120], default value 64 |
| dc max th _ _ | wt adaptive high-exposure zone statistical range, value range [170, 255], default value 192 |
| yhist th _ | y-component high-exposure area statistical range, value range [170, 255], default value 249 |
| yblk th _ | Threshold for the proportion of the number of y-component blocks, the value range is [0.002, 0.01], the default value is 0.002 |
| dark th _ | wt adaptive y component block minimum threshold, value range [230, 250], default value 250 |
| bright min _ | The minimum value of air adaptive threshold, the value range is [160, 200], the default value is 180 |
| bright max _ | The maximum value of air adaptive threshold, the value range is [210, 250], the default value is 240 |
| wt max _ | The maximum limit of wt adaptive, the value range is [0.75, 0.9], the default value is 0.9 |
| air min _ | The minimum value of air adaptation, the value range is [200, 220], the default value is 200 |
| air max _ | The maximum limit of air adaptation, the value range is [230, 250], and the default value is 250 |
| tmax base _ | tmax adaptive base value, default 125, corresponding configuration is as follows, 200 (131), 210 (125), 220 (119), 230 (114), 240 (109), 250 (105), recommended 131-105 |
| tmax off _ | Fixed value of tmax adaptive, value range [0.1, 0.5], default value 0.1 |
| tmax max _ | The maximum value of tmax adaptive, the value range is [0.1, 0.5], the default value is 0.5 |
| cfg wt _ | Software configuration wt, image dehazing strength, value range [0, 1] |
| cfg air _ | Software configuration air, atmospheric light coefficient, value range [0, 255] |
| cfg tmax _ | Software configuration tmax, the maximum value of dehazing, value range [0, 1] |
| dc thed _ | The bilateral sigma of the dark channel part, the value range is [0, 255], the default value is 32 |
| dc weitcur _ | The bilateral weight of the dark channel part, the default value is 1 |
| Member | Description |
|---|---|
| air thed _ | The bilateral sigma of the airlight part, the value range is [0, 255], and the default value is 32 |
| air weitcur _ | The bilateral weight of the airlight part, the default value is 0.14 |
| stab fnum _ | The maximum value of frame stabilization, the value range is [1,31], the default value is 10 |
| sigma | sigma controlled by iir, default 6, maximum 255 |
| wt sigma _ | Inter-frame wt filter coefficient, value range [0,256) |
| air sigma _ | Inter-frame air filter coefficient, value range [0,255] |
| tmax sigma _ | Inter-frame tmax filter coefficient, value range [0,2] |
【Notes】
stab_fnum: is the frame number from 0 to where the dehaze is stable. The maximum value of this parameter can be configured to 31, and the maximum time of 1s will be entered stable state. Generally 10 frames are more appropriate.
4.7.2.6 Enhance_Setting
Adjust the image contrast through this module.
【Member】
| Member | Description |
|---|---|
| Name | name |
| Enhance en _ | Enhance module function switch, 0: off, 1: on |
| ISO | ISO |
| enhance value _ | General contrast strength, value range [0, 16], recommended range [1, 2] |
【Notes】
enhance_value: the larger the value is, the higher the contrast is.
4.7.2.7 Hist_Setting
This module is used to improve contrast, when higher contrast is needed after defogging.
【Member】
| Member | Description |
|---|---|
| Name | Name |
| Hist en _ | Hist module function switch, 0: close, 1: open |
| ISO | ISO |
| hist channel _ | Histogram equalization three-channel separation switch function, 1: histogram three-channel unification; 0: histogram three-channel separation, the default is 0 |
| hist para en _ _ | Histogram stretching control parameter, the value is 0, 1 |
| hist gratio _ | Histogram stretching factor, histogram equalization control coefficient, value range [0, 32] |
| hist th off _ _ | The histogram statistics threshold, the value range is [0, 255], the default value is 64 |
| hist k _ | Histogram adaptive threshold magnification, value range [0, 7), default value 2 |
| hist scale _ | Histogram equalization control coefficient, value range [0, 32] |
| hist min _ | The minimum value of the histogram statistical threshold, the value range is [0,2), the default value is 0.016 |
| cfg gratio _ | The software configures the histogram stretching factor and the histogram equalization control coefficient, the value range is [0, 32) |
【Notes】
hist_para_en: When the value is 1, hist_scale is valid, and hist_gratio is invalid; conversely, when the value is 0, hist_scale is invalid and hist_gratio is valid. hist_gratio: The larger the value, the greater the histogram stretch coef and the brighter the image is. hist_th_off: The larger the value, the larger the statistical value of the histogram, and the brighter the image is. hist_k: The larger the value, the larger the statistical value of the histogram, and the brighter the image is. hist_min: The larger the value, the larger the statistical value of the histogram, and the brighter the image is.
4.7.3 Tuning steps
TMO debugging mainly includes three parts: Dehaze, Enhance and Hist debugging.
4.7.3.1 Dehaze debugging
It is recommended to adjust the defogging intensity through the following three parameters. The following three parameters vary according to ISO. Need to set cfg_alpha to 1 during the tuning process.【Member】
| Member | Description |
|---|---|
| cfg wt _ | Software configuration wt, image dehazing strength |
| cfg air _ | Software configuration air, atmospheric light coefficient |
| cfg tmax _ | Software configuration tmax, the maximum value of dehazing |
【Notes】
- cfg_wt: The greater the value, the greater the dehaze strength. It should be noted that wt should not exceed 0.9. In most cases, if wt exceeds 0.9, the processing effect will appear unnatural, unless the fog in the scene is very heavy. (As shown in the figure below, from left to right, Dehaze_en = 0, Dehaze_en = 1 and cfg_wt = 0.4, Dehaze_en = 1 and cfg_wt = 0.8)
cfg_wt comparison chart
- cfg_air: Control the defogging strength, and at the same time it will affect the defogging effect of the over-exposed area of the image. Use with sw_dhaz_cfg_wt. As shown in the figure below, the larger the cfg_air, the more natural the dehazing effect at the boundary of sky. When cfg_air is 250, the boundary looks natural. when debugging of Cfg_air whether there is sky in the image is mainly considered. If there is overexposed area , you need to increase the Cfg_air to avoid the problem of layering or loss of details. (As shown in the figure below, from left to right, Dehaze_en = 0, Dehaze_en = 1 and cfg_air = 200, Dehaze_en = 1 and cfg_air = 250)
cfg_air comparison chart
- cfg_tmax: The smaller the value, the greater the defogging strength in the depth of field direction. And the larger the value, the smaller the defogging strength in the depth of field direction. As you can see in the figure below, when cfg_tmax is 0.1, the fog in the depth of field is removed relatively cleanly, and some details can be seen. When cfg_tmax is 0.5, it is much weaker. To avoid the layering of the image, 0.2 is usually a appropriate value. (As shown in the figure below, from left to right, Dehaze_en = 0, Dehaze_en = 1 and cfg_tmax = 0.1, Dehaze_en = 1 and cfg_tmax = 0.5)
cfg_tmax comparison chart
4.7.3.2 Enhance debugging
The general contrast enhancement is adjusted by enhancement_value. The enhance_value changes with ISO.
【Member】
| Member | Description |
|---|---|
| enhance value _ | General Contrast Strength |
【Notes】
enhance_value: The larger the value, the higher the contrast is. (As shown in the figure below, from left to right, Enhance_en = 0, Enhance_en = 1 and enhancement_value = 1.5)
cfg_wt comparison chart
4.7.3.3 Hist debugging
The histogram equalization Hist recommends adjusting through the following two parameters. The following two parameters vary according to ISO. Need to set cfg_alpha to 1 during the tuning process.
【Member】
| Member | Description |
|---|---|
| hist channel _ | Histogram equalization three-channel separation switch function |
| cfg gratio _ | The software configures the histogram stretching coefficient |
【Notes】
1.hist_channel: The histogram equalization can correct the color cast at a limit amount when the three channels are separated, but in some scenes, the three-channel separation will cause color layering. (As shown in the figure below, from left to right, Hist_en = 0, Hist_en = 1 and hist_channel = 0, Hist_en = 1 and hist_channel = 1)
hist_channel comparison chart
- cfg_gratio: It is related to wt. The larger the wt, the larger the gratio. Excessive value will
make that the image looks unnatural, the color of image is bluish, and some details will be
lost. The gratio is a coefficient of histogram stretching, and its size is related to wt. A large value of wt needs a large the Cfg_gratio value , and a small value of wt needs a small the Cfg_gratio value. Avoid to configure a large Cfg_gratio with a smalle Cfg_wt. (As shown in the figure below, from left to right, Hist_en = 0, Hist_en = 1 and cfg_gratio = 0.768, Hist_en = 1 and cfg_gratio = 2)
cfg_gratio comparison chart
4.8 DPCC
4.8.1 Function description
Use this module to check and remove dead pixels.
The module includes three parts, Fast_mode, Expert_mode and sensor_dpcc. Among Fast_mode and Expert_mode, only one can be enabled. DPCC block diagram
4.8.2 Key Parameter
4.8.2.1 Enable
DPCC function switch
0: off
1: open
4.8.2.2 Fast_mode
Use this part to adjust the parameters of Fast_mode.
【Member】
| Member | Description |
|---|---|
| Fast mode enable _ _ | Fast mode switch function, 0: off, 1: on _ |
| ISO | Environmental ISO |
| Single enable _ | Single dead pixel removal function switch, 0: off, 1: on |
| Single level _ | Single dead pixel removal strength, value range [0, 10] |
| Double enable _ | Double dead pixel removal function switch, 0: off, 1: on |
| Double level _ | Double dead pixel removal strength, value range [0, 10] |
| Triple enable _ | Multiple dead pixel removal function switch, 0: off, 1: on |
| Triple level _ | Multi-dead pixel removal strength, value range [0, 10] |
【Notes】
Fast_mode_enable: When the value is 0, Fast_mode is turned off and Expert_mode is turned on; conversely, when the value is 1, Fast_mode is turned on and Expert_mode is turned off.
Double dead pixels and multiple dead pixels refer to multiple neighbouring dead pixels. Dead pixel removal strength, 0 means no processing, 1~10 means bad pixel removal strength of different intensities, the greater the value, the greater the strength.
If using Fast_mode cannot achieve the desired intensity, please use Expert_mode.
4.8.2.3 Expert_mode
Adjust the relevant parameters of Expert_mode through this part.
【Member】
| Member | Description |
|---|---|
| ISO | ISO |
| Stage1 enable _ | Default value 1 |
| grayscale mode _ | Black and color mode switch, 0: off, 1: on |
| rk out sel _ _ | The use of ro lim in the RK dead pixel algorithm, 0: ro lim1, 1: _ _ ro lim2, 2: ro lim3 _ _ |
| dpcc out sel _ _ | Dead pixel correction mode, 0: median mode, 1: RK mode |
| stage1 rb 3x3 _ _ | Default value 0 |
| stage1 g 3x3 _ _ | Default value 0 |
| stage1 inc rb center _ _ _ | When the red/blue channel uses the median mode to remove the dead pixels, whether to include the points to be removed, 0: No, 1: Yes, the default value is 1 |
| stage1 inc g center _ _ _ | When the green channel uses the median mode to remove the dead pixels, whether to include the points to be removed, 0: No, 1: Yes, the default value is 1 |
| stage1 use fix set _ _ _ | Built-in dead pixel detection algorithm switch, 0: closed, 1: open |
| stage1 use set3 _ _ | The third type of dead pixel detection algorithm switch in set cell, _ 0: closed, 1: open |
| stage1 use set2 _ _ | The second type of dead pixel detection algorithm switch in set cell, 0: closed, 1: open _ |
| stage1 use set1 _ _ | The first type of dead pixel detection algorithm switch in set cell, 0: _ closed, 1: open |
| set cell _ | Dead pixel detection algorithm |
【Notes】
grayscale_mode: When the sensor is color, set to 0; conversely, when the sensor is black and white, set to 1.
4.8.2.4 set_cell Through this part, the threshold for bad pixel detection algorithm can be adjusted, which mainly includes six detection algorithm, RK, LC, PG, RND, RG, and RO, and the six conditions are and.
set_cell block diagram
【Member】
| Member | Description |
|---|---|
| RK | RK dead pixel detection algorithm |
| LC | LC dead Pixel detection algorithm |
| PG | PG dead pixel detection algorithm |
| RNG | RND dead Pixel detection algorithm |
| RG | RG dead Pixel detection algorithm |
| RO | RO dead Pixel detection algorithm |
【Notes】
4.8.2.4.1 RK
Through this part, the parameters of the RK dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| RK red blue enable _ _ _ | Red/blue channel switch of RK dead pixel detection algorithm, 0: off, 1: on |
| RK green enable _ _ | Green channel switch of RK dead pixel detection algorithm, 0: off, 1: on |
| rb sw mindis _ _ | Red/blue channel threshold 1 of RK dead pixel detection algorithm, value range [0,255] |
| g sw mindis _ _ | Green channel threshold 1 of RK dead pixel detection algorithm, value range [0,255] |
| sw dis scale min _ _ _ | Threshold 2 of RK dead pixel detection algorithm, value range [0,63] |
| sw dis scale max _ _ _ | Threshold 2 of RK dead pixel detection algorithm, value range [0,63] |
【Notes】
4.8.2.4.2 LC
Through this part, the parameters of the LC dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| LC red blue enable _ _ _ | Red/blue channel switch of LC dead pixel detection algorithm, 0: off, 1: on |
| LC green enable _ _ | Green channel switch of LC dead pixel detection algorithm, 0: off, 1: on |
| rb line thr _ _ | The red/blue channel threshold of the LC dead pixel detection algorithm, the value range is [0,255], the default value is 16 |
| g line thr _ _ | The green channel threshold of the LC dead pixel detection algorithm, the value range is [0,255], the default value is 12 |
| rb line mad fac _ _ _ | Red/blue channel coefficient of LC dead pixel detection algorithm , value range [0,63], default value 34 |
| g line mad fac _ _ _ | Green channel coefficient of the LC dead pixel detection algorithm, the value range is [0,63], the default value is 16 |
【Notes】
4.8.2.4.3 PG
Through this part, the parameters of the PG dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| PG red blue enable _ _ _ | Red/blue channel switch of PG dead pixel detection algorithm, 0: off, 1: on |
| PG green enable _ _ | Green channel switch of PG dead pixel detection algorithm, 0: off, 1: on |
| rb pg fac _ _ | Red/blue channel coefficient of PG dead pixel detection algorithm, value range [0,63], default value 4 |
| g pg fac _ _ | Green channel coefficient of PG dead pixel detection algorithm, value range [0,63], default value 3 |
【Notes】
4.8.2.4.4 RND
Through this part, the parameters of the RND dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| RND red blue enable _ _ _ | Red/blue channel switch of RND dead pixel detection algorithm, 0: off, 1: on |
| RND green enable _ _ | Green channel switch of RND dead pixel detection algorithm, 0: off, 1: on |
| rb rnd thr _ _ | Red/blue channel threshold of RND dead pixel detection algorithm red/blue channel threshold, value range [0,255], default value 8 |
| g rnd thr _ _ | Green channel threshold of RND bad pixel detection algorithm, value range [0,255], default value 8 |
| rb rnd offs _ _ | Red/blue channel offset value of RND dead pixel detection algorithm, value range [0,3], default value 3 |
| g rnd offs _ _ | Green channel offset value of RND dead pixel detection algorithm, value range [0,3], default value 3 |
【Notes】
4.8.2.4.5 RG
Through this part, the parameters of the RG dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| RG red blue enable _ _ _ | Red/blue channel switch of RG dead pixel detection algorithm, 0: off, 1: on |
| RG green enable _ _ | Green channel switch of RG dead pixel detection algorithm, 0: off, 1: on |
| rb rg fac _ _ | Red/blue channel coefficient of RG dead pixel detection algorithm, value range [0,63], default value 8 |
| g rg fac _ _ | Green channel coefficient of RG dead pixel detection algorithm, value range [0,63], default value 8 |
【Notes】
4.8.2.4.6 RO
Through this part, the parameters of the RO dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| RO red blue enable _ _ _ | Red/blue channel switch of RO dead pixel detection algorithm, 0: off, 1: on |
| RO green enable _ _ | Green channel switch of RO dead pixel detection algorithm, 0: off, 1: on |
| rb ro lim _ _ | Red/blue channel threshold of RO dead pixel detection algorithm, value range [0,3], default value 1 |
| g ro lim _ _ | Green channel threshold of RO dead pixel detection algorithm, value range [0,3], default value 1 |
【Notes】
4.8.2.5 sensor_dpcc
Through this part, you can adjust the sensor's own dead pixel correction strength.
【Member】
| Member | Description |
|---|---|
| sensor dpcc auto en _ _ _ | sensor dpcc function switch, 0: closed, 1: open |
| max level _ | Maximum level to dead pixels correction |
| ISO | ISO |
| level single _ | single dead pixel correction strength |
| level multiple _ | multiple dead pixelscorrection strength |
4.8.3 Tuning steps
DPCC debugging mainly includes three parts: Fast_mode, Expert_mode and sensor_dpcc debugging. Fast_mode and Expert_mode are mutually exclusive and are determined by Fast_mode_enable in Fast_mode. When Fast_mode_enable is 0, Fast_mode is turned off and Expert_mode is turned on; conversely, when Fast_mode_enable is 1, Fast_mode is turned on and Expert_mode is turned off.
In debugging, it is recommended to use Fast_mode for dead pixel removal first. If Fast_mode cannot achieve the desired goal use Expert_mode.
4.8.3.1 Fast_mode debugging
Fast_mode mainly uses Single_level to remove single dead pixels, Double_level to removes two neighbouring dead pixels, and Triple_level to remove more than two neighbouring dead pixels.
The three functions do not affect each other, but Triple_level will increase the strength of Double_level, and Double_level will increase the strength of Single_level.
【Member】
| Member | Description |
|---|---|
| Fast mode enable _ _ | Fast mode switch function, 0: off, 1: on _ |
| Single level _ | Single dead pixel correction strength, value range [0, 10] |
| Double level _ | Double dead pixel correction strength, value range [0, 10] |
| Triple level _ | Multi-dead pixel correction strength, value range [0, 10] |
【Notes】
Dead pixel correction strength, 0 means no processing, 1~10 means bad pixel correction strength of different intensities, the greater the value, the higher the strength.
When a certain dead pixel mode is turned on, the corresponding dead pixel correction strength cannot be 0. For example, when Single_enable is turned on, the value in Single_level cannot be 0.
4.8.3.2 Expert_mode debugging
In Expert_mode, use stage1_use_fix_set, stage1_use_set1, stage1_use_set2, stage1_use_set3 and set_cell to remove dead pixel.
stage1_use_fix_set, stage1_use_set1, stage1_use_set2, and stage1_use_set3 are four methods for detecting dead pixels. The four methods work individually, that is, if the four methods are enabled, one of the methods detects a dead pixel, the point is dead pixel.
The condition of the stage1_use_fix_set detection method is fixed in the hardware, and the conditions of the three methods stage1_use_set1, stage1_use_set2 and stage1_use_set3 correspond to cell1, cell2, and cell3 in set_cell, respectively. The set_cell contains six dead pixel correction algorithms, RK, LC, PG, RND, RG, and RO. The six algorithms have an "and" relationship, that is, if all six determination conditions are turned on, dead pixel needs to meet the six algorithm conditions.
【Member】
| Member | Description |
|---|---|
| stage1 use fix set _ _ _ | Built-in dead pixel correction condition switch, 0: closed, 1: open |
| stage1 use set1 _ _ | The first type of dead pixel correction condition switch in set cell, 0: _ closed, 1: open |
| stage1 use set2 _ _ | The second type of dead pixel correction condition switch in set cell, _ 0: closed, 1: open |
| stage1 use set3 _ _ | The third type of dead pixelc orrection condition switch in set cell, 0: _ closed, 1: open |
| set cell _ | Dead pixel correction condition |
【Notes】
The six algorithms of RK, LC, PG, RND, RG and RO are divided into two channels: green, red and blue to detect the dead pixels. It is recommended that the two channels be turned on and off simultaneously.
The six algorithms can be turned on and off independently. Because the six algorithms have an "and" relationship, the more the algorithms are turned on, the more difficult it is to detect the dead pixels. However, due to the presence of noise, when the algorithm is turned on less , "edge jitter" may occur in the picture, that is, wavy lines appear on the fixed edges of the picture, and there are differences between frames. Therefore, in actual use, it is recommended to enable at least three algorithms for each set.
4.8.3.2.1 RK
Through this part, the parameters of the RK dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| RK green enable _ _ | Switch of RK dead pixel detection algorithm, 0: off, 1: on |
| ro lim _ | RK dead pixel detection algorithm offset value, value range [0,3] |
| g sw mindis _ _ | Threshold 1 of RK dead pixel detection algorithm, value range [0,255] |
| sw dis scale min _ _ _ | Threshold 2 of RK dead pixel detection algorithm, value range [0,63] |
| sw dis scale max _ _ _ | Threshold 2 of RK dead pixel detection algorithm, value range [0,63] |
【Notes】
ro_lim: The larger the value, the easier it is to detect as a dead pixel.
sw_mindis: The smaller the value, the easier it is to detect as a dead pixel. sw_dis_scale_max: The smaller the value, the easier it is to detect as a dead pixel.
sw_dis_scale_max: The smaller the value, the easier it is to detect as a dead pixel.
4.8.3.2.2 LC
Through this part, the parameters of the LC dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| enable | LC dead pixel detection algorithm switch, 0: disable, 1: enable |
| line thr _ | LC dead pixel detection algorithm threshold, value range [0,255], default value 12 |
| line mad fac _ _ | LC dead pixel detection algorithm coefficient, value range [0,63], default value 16 |
【Notes】
line_thr: The smaller the value, the easier it is to judge as a dead pixel.
line_mad_fac: The smaller the value, the easier it is to judge as a dead pixel.
4.8.3.2.3 PG
Through this part, the parameters of the PG dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| enable | PG dead pixel detection algorithm switch, 0: off, 1: on |
| pg fac _ | PG dead pixel detection algorithm coefficient, value range [0,63], default value 3 |
【Notes】
pg_fac: The smaller the value, the easier it is to judge as a dead pixel.
4.8.3.2.4 RND
Through this part, the parameters of the RND dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| enable | RND dead pixel detection algorithm switch, 0: disable, 1: enable |
| rnd thr _ | RND bad pixel detection algorithm threshold, value range [0,255], default value 8 |
| rnd offs _ | RND dead pixel detection algorithm offset value, value range [0,3], default value 3 |
【Notes】
rnd_thr: The smaller the value, the easier it is to judge as a dead pixel.
rnd_offs: The smaller the value, the easier it is to judge as dead pixels.
4.8.3.2.5 RG
Through this part, the parameters of the RG pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| enable | RG dead pixel detection algorithm switch, 0: off, 1: on |
| rg fac _ | RG dead pixel detection algorithm coefficient, value range [0,63], default value 8 |
【Notes】
rg_fac: The smaller the value, the easier it is to judge as a dead pixel.
4.8.3.2.6 RO
Through this part, the parameters of the RO dead pixel detection algorithm can be adjusted.
【Member】
| Member | Description |
|---|---|
| enable | RO dead pixel detection algorithm switch, 0: off, 1: on |
| ro lim _ | RO dead pixel detection algorithm threshold, value range [0,3], default value 1 |
【Notes】
ro_lim: The larger the value, the easier it is to judge as a dead pixel.
4.8.3.3 sensor_dpcc debugging
sensor_dpcc controls the dead pixel correction function in sensor through max_level, level_single, and level_multiple. This function can only be used when the sensor itself has the function of dead pixels correction and the driver configuration is completed.【Member】
| Member | Description |
|---|---|
| max level _ | Maximum level of dead pixels correction |
| level single _ | Strength of a single dead pixels correction |
| level multiple _ | Strength of multiple dead pixels correction |
【Notes】
max_level: Defines the maximum level of the dead pixel correction in sensor, mainly for subdividing level for dead pixel correction.
The strength of level_single and level_multiple cannot exceed max_level.
4.9 Gamma
4.9.1 Function Description
Use this module to adjust the gamma curve, including three gamma curves, curve_normal, curve_hdr and curve_night.
GAMMA block diagram
4.9.2 Key parameters
4.9.2.1 gamma_en
Gamma function switch
0: off
1: open
4.9.2.2 gamma_out_segnum
Gamma curve X-axis space type
0: Log space 1: Linear space
4.9.2.3 gamma_out_offset
Gamma curve correction function, the value range is [-2048,2048], and the default value is 0.
【Member】
【Notes】
4.9.2.4 curve_normal
The gamma curve in linear mode, the value range is [0,4095].
【Member】
【Notes】
4.9.2.5 curve_hdr
The gamma curve in HDR mode, the value range is [0,4095].
【Member】
【Notes】
4.9.2.6 curve_night
The gamma curve in night mode, the value range is [0,4095].
【Member】
【Notes】
4.9.3 Tuning steps
4.10 Debayer
4.10.1 Function Description
Since most color cameras use a single sensor to obtain image information, and each sensor surface is covered with a CFA (Color Filter Array), each pixel can only obtain one of the three primary colors of R, G, and B. Color component. Since only one color component on each pixel of the color filter array is known, in order to obtain a color image, it is necessary to use the known color information to interpolate the other two missing color components. This process is called demosaicing. (Debayer or Demosaic):
Figure 4-1-1 Debayer function diagram
4.10.2 Key Parameter
Enable:
Debayer module enable bit, 0: closed, 1: open.
debayer_filter1
Low-frequency gradient filter, the value range is [-8, 7].
debayer_filter2
High-frequency gradient filter, the value range is [-8, 7].
debayer_gain_offset
Calculate the offset value of the gradient when the sharpening weight in the G channel interpolation coefficient is in the range of [0, 15].
ISO
The ISO value corresponding to the current gear, the value range is [50, 2048].
sharp_strength
The maximum value of G channel interpolation sharpening weight, the value range is [0, 4].
debayer_hf_offset
The offset value when calculating the gradient, the value range is [0, 4095].
debayer_offset
The offset of the G channel clip, the value range is [0, 15]. The larger the value, the larger the clip range.
debayer_clip_en
G channel interpolation clip switch, 0: close, 1: open.
debayer_filter_g_en
G channel interpolation result filter switch, 0: closed, 1: open.
debayer_filter_c_en
Color difference graph filter switch, 0: closed, 1: open.
debayer_thed0
Control the selection of high and low frequency weights. The larger the value, the smaller the probability of selecting high frequency weights. The value range is [0, 16].
debayer_thed1
Control the selection of high and low frequency weights. The larger the value, the lower the probability of selecting low frequency weights. The value range is [0, 16].
debayer_dist_scale
Control the selection of high and low frequency weights. The larger the value, the smaller the probability of selecting high frequency weights. The value range is [0, 16].
debayer_cnr_strength
The intensity of the clip when filtering the color difference map, the value range is [0, 9].
debayer_shift_num
The smaller the value, the larger the range of the color difference clip, and the value range is [0, 4].
4.10.3 Glossary
| Abbreviation | Description |
|---|---|
| CFA | Color Filter Array, Color Filter Array |
| Demosaic | Debayer or Demosaic, the process of converting single-pixel monochrome Bayer RGB to three primary colors RGB |
| Filter | A set of filtering parameters to remove interference signals on digital images |
| Color difference image | G channel image obtained by interpolation and the original raw image after difference |
4.11 CPSL
4.11.1 Function Description
CPSL is the abbreviation of compensation light, used to control infrared, color fill light and ircutter, divided into automatic and manual modes. The automatic control is mainly to automatically turn on and off the fill light according to the ambient brightness, and the manual mode requires the user to call the API to turn on and off the fill light. For related API usage, please refer to "Rockchip_Development_Guide_ISP2x_".
4.11.2 Key parameters
enable
Module enable switch. If it is 0, the module does not work, that is, manual and automatic modes do not work, and CPSL related API calls do not take effect. If the fill light is not configured in the driver, it needs to be set to 0; on the contrary, it needs to be set to 1, otherwise the CPSL related API will not take effect.
mode
Operating mode. 0 is automatic mode, 1 is manual mode. The fill light is controlled by the AIQ algorithm in automatic mode, and the user can control the fill light through API in manual mode.
force_gray
When the fill light is turned on, whether to force the switch to black and white mode, note that this field only takes effect in the CPSL module; if you want to control the black and white mode outside of the CPSL module, you can call the API or set COLOR_AS_GREY to enable in the IQ file. COLOR_AS_GREY is more The force_gray in this module has a high priority.
light_src
Fill light type information, you can use this field to indicate the type of fill light that needs to be controlled.
0: Only control color fill light 1: Only control infrared fill light 2: Control color and infrared fill light
auto_adjust_sens
Auto mode parameter, used for sensitivity adjustment. The adjustment range is 0.0 to 100.0, and the default is 50.0. The adjusted target parameters are auto_on2off_th and auto_off2on_th, and the target parameters can be changed between plus or minus 1.5 times at most.
auto_on2off_t
The auto mode parameter is used to control the threshold value of the automatic turn off after the fill light is turned on. The calculation formula is: image brightness/(sensor exposure/maximum exposure).
auto_off2on_th
Auto mode parameter, used to control the threshold of whether the fill light is turned on, the calculation formula is: image brightness/(sensor exposure/maximum exposure).
auto_sw_interval
The auto mode parameter is used to control the time interval between the turn-on and turn- off of the fill light, in seconds. After the fill light is turned on, regardless of the brightness of the external environment, only after the interval time has passed, the detection of whether to switch will be activated.
manual_on
Manual mode parameter, used to control whether the fill light is fixed on.
manual_strength
Manual mode parameter, used to control the intensity of the fill light, the value range is 0~100.
4.12 GIC
4.12.1 Function description
Adjust GIC parameters through this module. The main parameters of GIC are divided into GIC- related parameters and noise-related parameters in GIC_ISO. Noise-related parameters are obtained by calibration, and GIC-related parameters can be adjusted for GIC strength.
4.12.2 Key parameters
4.12.2.1 enable
GIC function swtich
0: off
1: open
4.12.2.2 edge_en
GIC edge function switch
0: off
1: open
When the function is turned on, the GIC effect is better, but the edges will become blurred. The defalut value is 0
4.12.2.3 gr_ration
Determine gr and gb compensation value, the value range is [0, 3], and the default value is 0.
4.12.2.4 noise_cut_en
External noise figure using function swtich
0: off
1: open
This switch controls whether noise_coea and noise_coea take effect. It is recommended to turn them off.
4.12.2.5 GIC_ISO
Parameters change with ISO.【Member】
| Member | Description |
|---|---|
| iso | iso |
| min busy thre _ _ | busy area detection thread, value range [0, 1023], default value 160 |
| min grad thr1 _ _ | The number of non-edge regions threshold 1, GIC intensity control value, value range [0, 1023], default value 32 |
| min grad thr2 _ _ | The number of non-edge areas threshold 2, GIC intensity control value, value range [0, 1023], default value 32 |
| k grad1 _ | Edge (horizontal, vertical gradient) response degree threshold 1, value range [0, 15], default value 5 |
| k grad2 _ | Edge (horizontal, vertical gradient) response degree threshold 2, value range [0, 15], default value 1 |
| smoothness gb _ | Algorithm intermediate amount |
| smoothness gb weak _ _ | Algorithm intermediate amount |
| gb thre _ | coef for scaling, value range [0, 15], default value 7 |
| maxCorV | Limit the maximum compensation value of the edge area gb, the value range is [0, 1023], the default value is 40 |
| maxCorVboth | Limit the maximum compensation value for flat (non-edge) area gb, the value range is [0, 1023], the default value is 8 |
| maxCutV | Algorithm Intermediate Volume |
| dark thre _ | Define the threshold of the dark area 1, the value range is [0, 2047], the default value is 120 |
| dark threHi _ | Define the threshold of the dark area 2, the value range is [0, 2047], the default value is 240 |
| k grad1 dark _ _ | The edge (horizontal, vertical gradient) response threshold of the dark part of the image is 1, the value range is [0, 15], the default value is 6 |
| k grad2 dark _ _ | The edge of the dark part of the image (horizontal, vertical gradient) response degree threshold 2, value range [0, 15], default value 1 |
| min grad thr dark1 _ _ _ | The threshold value of the number of non-edge regions in the dark part of the image is 1, the value range is [0, 1023], and the default value is 64 |
| min grad thr dark2 _ _ _ | The threshold of the number of non-edge regions in the dark part of the image 2, the value range is [0, 1023], the default value is 32 |
| GValueLimitLo | The lowest threshold of noise standard deviation, value range [0, 4095], default value 1280 |
| Member | Description |
|---|---|
| GValueLimitHi | The maximum threshold of noise standard deviation, value range [0, 4095], default value 1760 |
| textureStrength | Control the strength of the gb compensation value according to the noise intensity, the value range is [0, 2], the default value is 1 |
| ScaleLo | Standard deviation tolerance scale lower limit |
| ScaleHi | Standard deviation tolerance upper limit |
| noiseCurve 0 _ | Noise curve parameter 1 |
| noiseCurve 1 _ | Noise curve parameter 2 |
| globalStrength | Global control adjusts the strength of gb compensation value, the value range is [0, 2], the default value is 1 |
| noise coea _ | Noise figure a |
| noise coeb _ | Noise figure b |
| diff clip _ | Limit the maximum compensation value of the maximum gb |
4.12.3 Steps for debugging
In the debugging process of GIC, it is mainly to adjust the GIC related parameters in GIC_ISO.
4.12.3.1 GIC_ISO debugging
| Member | Description |
|---|---|
| min busy thre _ _ | busy area detection capability, value range [16, 120], default value 64 |
| min grad thr1 _ _ | The number of non-edge areas threshold 1, GIC intensity control value |
| min grad thr2 _ _ | The number of non-edge regions threshold 2, GIC intensity control value |
| k grad1 _ | Edge (horizontal, vertical gradient) response degree threshold 1 |
| k grad2 _ | Edge (horizontal, vertical gradient) response degree threshold 2 |
| gb thre _ | Coef for scaling |
| maxCorV | Limit the maximum compensation value of the edge area gb |
| maxCorVboth | Limit the maximum compensation value of gb in flat (non-edge) area |
| dark thre _ | Define the threshold of the dark area 1 |
| dark threHi _ | Define the threshold of the dark area 2 |
| k grad1 dark _ _ | The edge of the dark part of the image (horizontal, vertical gradient) response degree threshold 1 |
| k grad2 dark _ _ | The edge of the dark part of the image (horizontal, vertical gradient) response degree threshold 2 |
| min grad thr dark1 _ _ _ | Threshold of the number of non-edge regions in the dark part of the image 1 |
| min grad thr dark2 _ _ _ | Threshold of the number of non-edge regions in the dark part of the image 2 |
min_busy_thre: This value mainly corrects the detection ability of busy areas in dark areas (such as irregular text and high contrast areas), that is, a threshold clamp for dark areas. The larger the value, the more busy areas in the dark area, and vice versa. For busy areas, GIC does not do anything. Therefore, the more busy areas are detected, some edge details can be preserved, but at the same time, the GIC will remain in the false detection area.
min_grad_thr1, min_grad_thr2: Their values directly affect the number of non-edge regions. The greater the number of non-edge areas, the stronger the GIC effect, the harder the picture is erased, and the less detail is retained. The smaller the number of non-edge areas, the GIC may remain, which shows that some typical GIC textures (horizontal and vertical bright and dark stripes, false edges) are retained. The larger this value is, the more likely it is to be judged as a flat (non-edge) area during direction judgment. It is a parameter that controls the intensity of GIC.
min_grad_thr_dark1, min_grad_thr_dark2: The function and Tuning are the same as min_grad_thr1, min_grad_thr2, and the value is larger than min_grad_thr in general.
k_grad1, k_grad2: adjust the value of the response to the edge (horizontal, vertical gradient), the larger the value, the larger the threshold for detetct whether it is an edge, and the result is that the weak edge is detetced as a flat area; if this parameter is reduced , You can increase the number of edges. k_grad1_dark, k_grad2_dark: The function and Tuning method are the same as k_grad1, k_grad2, generally larger than k_grad, that is, to reduce the edge response degree of the dark part of the image.
gb_thre: It is a coef used for scaling, not an absolute threshold for direct detetction. The larger it is, the smaller the gb allowed to be compensated, and vice versa. It has a big relationship with Sensor and lens.
maxCorV: It is assumed that the compensation value of gb has an upper limit. If the calculated value exceeds the assumed threshold, it is considered a calculation error. In order to reduce the influence of calculation errors, the compensation value of gb is clamped down.
maxCorVboth: The purpose is the same as maxCorV.
dark_thre: used to determine the lower boundary between the dark area of the image and the normal area.
dark_threHi: used to determine the upper boundary between the dark area of the image and the normal area.