hi_isp_awb_attr_ex

Description

Defines the extended AWB attribute.

Definition

typedef struct { 
    hi_u8  tolerance; 
    hi_u8  zone_radius; 
    hi_u16 curve_l_limit;  
    hi_u16 curve_r_limit;  
    hi_bool  extra_light_en; 
    hi_isp_awb_extra_light_source_info light_info[HI_ISP_AWB_LS_NUM]; 
    hi_isp_awb_in_out_attr in_or_out; 
    hi_bool multi_light_source_en; 
    hi_isp_awb_multi_ls_type multi_ls_type; 
    hi_u16  multi_ls_scaler;
    hi_u16  multi_ct_bin[HI_ISP_AWB_MULTI_CT_NUM];   
    hi_u16  multi_ct_wt[HI_ISP_AWB_MULTI_CT_NUM];   
    hi_bool fine_tun_en;    
    hi_u8 fine_tun_strength;
} hi_isp_awb_attr_ex;

Members

Member

Description

tolerance

AWB adjustment tolerance. AWB is not performed when the detected tolerance falls within the threshold range.

Value range: [0x0, 0xFF]

zone_radius

Zone radius for classifying pixels during AWB statistics. A smaller value indicates higher AWB precision but lower AWB algorithm stability.

Value range: [0x0, 0xFF]

curve_l_limit

Left border of the AWB color temperature curve. Value range: [0x0, 0x100]

curve_r_limit

Right border of the AWB color temperature curve. Value range: [0x100, 0xFFF]

extra_light_en

Separate illuminant (outside the color temperature curve) enable during AWB calculation

The options are as follows:

  • HI_FALSE: disabled
  • HI_TRUE: enabled

light_info[HI_ISP_AWB_LS_NUM]

Information about the separate illuminants outside the color temperature curve. A maximum of four illuminants can be added.

#define HI_ISP_AWB_LS_NUM    4

in_or_out

Parameter used by the AWB to determine the outdoor or indoor scenario.

multi_light_source_en

Parameter used by the AWB to detect whether the current scenario is a multi-illuminant scenario and adjust the saturation or CCM based on the multi-illuminant degree.

The options are as follows:

  • HI_FALSE: disabled
  • HI_TRUE: enabled

multi_ls_type

Policy in the multi-illuminant scenario to adjust the saturation or CCM.

The options are as follows:

  • AWB_MULTI_LS_SAT: adjusts the saturation.
  • AWB_MULTI_LS_CCM: adjusts CCM.

multi_ls_scaler

Maximum adjustment amplitude of the saturation or CCM in the multi-illuminant scenario. The actual adjustment amplitude is related to the degree of the multi-illuminant in the scenario.

Value range: [0x0, 0x100]

multi_ct_bin[HI_ISP_AWB_MULTI_CT_NUM]

Color temperature segment parameter in the multi-illuminant scenario.

Value range: [0x0, 0xFFFF]. The values must be monotonically increasing.

#define HI_ISP_AWB_MULTI_CT_NUM    8

multi_ct_wt[HI_ISP_AWB_MULTI_CT_NUM]

Color temperature weight parameter in the multi-illuminant scenario.

Value range: [0x0, 0x400]

#define HI_ISP_AWB_MULTI_CT_NUM    8

fine_tun_en

AWB special color detection enable, including complexion detection.

The options are as follows:

  • HI_FALSE: disabled
  • HI_TRUE: enabled

fine_tun_strength

Strength of detecting a single color, such as complexion or blue. This member is valid only when fine_tun_en is enabled. Value range: [0x0, 0xFF]

Figure 1. Parameters of color temperature curves

Figure 2. Example of setting the color temperature weight in the multi-illuminant scenario (n indicates the number of color temperature segments)

Restrictions

  • tolerance is an AWB sensitivity parameter. If tolerance is 0, AWB coefficients are updated in real time, and the CPU usage is high. If tolerance is large, the AWB updates AWB coefficients only when the AWB detects that the ambient color temperature changes, and therefore the CPU usage is low. When the ambient color temperature is fine-tuned, the image may have a slight color cast. You are advised to set tolerance to 0 in the outdoor scenario and 2 in the indoor scenario.
  • zone_radius indicates the color difference radius of white blocks under illuminant. A larger value indicates that the restrictions on white blocks are more loose, more white blocks are found, the stability is better, but the precision is lower, and vice versa. It is recommended that the value of zone_radius under hybrid illuminant be greater than common illuminant.
  • The value of curve_l_limit must be less than or equal to 0x100, and the value of curve_r_limit must be greater than or equal to 0x100. curve_l_limit and curve_r_limit are used to exclude color blocks. As shown in the figure, curve_l_limit excludes the shadow area on the left, and curve_r_limit excludes the shadow area on the right.
  • The AWB algorithm allows you to add the information about independent illuminant points outside the color temperature curve to improve the AWB effect under a special illuminant.
  • After multi_light_source_en is enabled, the AWB algorithm determines whether the current scenario is a multi-illuminant scenario. In the multi-illuminant scenario, the saturation is decreased or the CCM is adjusted automatically to reduce the color cast degree. The maximum adjustment amplitude is determined by multi_ls_scaler. Adjusting the CCM changes the hue.
  • When multi_ls_type is set to HI_ISP_AWB_MULTI_LS_SAT, the saturation is adjusted to alleviate the color cast issue in the multi-illuminant scenario. multi_ls_scaler/0x100 indicates the lower limit of the saturation gain coefficient. When multi_ls_scaler is 0xC0, the lower limit of the saturation gain coefficient is 0xC0/0x100 = 0.75, and the fluctuation range of the image saturation is [0.75, 1.0] (1.0 indicates that the image saturation when multi_light_source_en is disabled). When multi_ls_scaler is 0x0, the lower limit of the saturation gain coefficient is 0x0/0x100 = 0, and the fluctuation range of the image saturation is [0, 1]. In the multi-illuminant scenario, the image may become black and white. Smaller multi_ls_scaler indicates a larger fluctuation range of the image saturation and lower color stability.
  • When multi_ls_type is set to HI_ISP_AWB_MULTI_LS_CCM, the CCM is adjusted to alleviate the color cast issue in the multi-illuminant scenario. multi_ls_scaler/0x100 indicates the CCM adjustment amplitude. A larger value indicates lower image saturation. If multi_ls_scaler is set to 0xC0, the maximum adjustment amplitude of CCM is 0xC0. If multi_ls_scaler is set to 0x0, the maximum adjustment amplitude of CCM is 0, the effect of which is equivalent to setting multi_light_source_en to 0.
  • In WDR mode, the Ascend AWB algorithm automatically disables the function of judging whether the current scenario is a multi-illuminant scenario.
  • Parameters in arrays multi_ct_bin and multi_ct_wt can be properly configured to improve the color effect in the high-color-temperature and low-color-temperature regions in the multi-illuminant scenario. The parameter setting does not take effect in the non-multi-illuminant scenario. For details about the mapping between the color temperature and weight, see the preceding figure.
  • If you do not want to adjust the saturation or CCM in the multi-illuminant scenario and only enable the color temperature weight to improve the AWB effect, configure the related parameters as follows: multi_light_source_en = HI_TRUE, multi_ls_type = HI_ISP_AWB_MULTI_LS_SAT, and multi_ls_scaler = 0x100.
  • If fine_tun_en is enabled, the AWB automatically detects special colors such as complexion, which improves the AWB effect and precision in the complexion scenario. However, errors may occur in the blue background and 3500K illuminant scenario, which results in a slight yellow cast of the image.
  • fine_tun_strength is used to adjust the complexion detection strength. A larger value indicates that the AWB effect is better in the complexion scenario but the side effect is more obvious when misjudgment occurs. The default value 0x80 is recommended.