hi_isp_local_cac_attr
Description
Defines the purple fringing detection and correction attribute.
Definition
typedef struct {
hi_bool enable;
hi_u16 purple_detect_range;
hi_u16 var_threshold;
hi_u16 r_detect_threshold[HI_ISP_LCAC_DET_NUM];
hi_u16 g_detect_threshold[HI_ISP_LCAC_DET_NUM];
hi_u16 b_detect_threshold[HI_ISP_LCAC_DET_NUM];
hi_u16 luma_detect_threshold[HI_ISP_LCAC_DET_NUM];
hi_s16 cb_cr_ratio[HI_ISP_LCAC_DET_NUM];
hi_op_mode op_type;
hi_isp_depurplestr_manual_attr manual_attr;
hi_isp_depurplestr_auto_attr auto_attr;
} hi_isp_local_cac_attr;
Members
Member |
Description |
|---|---|
enable |
CAC enable. The value can be HI_FALSE (disabled) and HI_TRUE (enabled). |
purple_detect_range |
Purple detection range. This value controls whether the r_detect_threshold, g_detect_threshold, b_detect_threshold, Iuma_detect_threshold, and cb_cr_ratio parameters take effect. A larger value indicates that purple in more non-highlighted regions are defined as purple regions. purple_detect_range may cause unsmooth purple fringing removal. You can check the settings of r_detect_threshold, g_detect_threshold, b_detect_threshold, Iuma_detect_threshold, and cb_cr_ratio. Value range: [0, 410] |
var_threshold |
Edge detection threshold Value range: [0, 4095] |
r_detect_threshold[HI_ISP_LCAC_DET_NUM] |
The parameter value is divided into three segments. The value of each segment indicates the R component threshold in the highlight detection module. The value that takes effect depends on the value of the purple_detect_range parameter. A smaller value of purple_detect_range indicates the tendency to the first segment of r_detect_threshold while a larger value of purple_detect_range indicates the tendency to the third segment of r_detect_threshold. Value range: [0, 4095] #define HI_ISP_LCAC_DET_NUM 3 |
g_detect_threshold[HI_ISP_LCAC_DET_NUM] |
The parameter value is divided into three segments. The value of each segment indicates the G component threshold in the highlight detection module. The value that takes effect depends on the value of the purple_detect_range parameter. A smaller value of purple_detect_range indicates the tendency to the first segment of g_detect_threshold while a larger value of purple_detect_range indicates the tendency to the third segment of g_detect_threshold. Value range: [0, 4095] |
b_detect_threshold[HI_ISP_LCAC_DET_NUM] |
The parameter value is divided into three segments. The value of each segment indicates the B component threshold in the highlight detection module. The value that takes effect depends on the value of the purple_detect_range parameter. A smaller value of purple_detect_range indicates the tendency to the first segment of b_detect_threshold while a larger value of purple_detect_range indicates the tendency to the third segment of b_detect_threshold. Value range: [0, 4095] |
luma_detect_threshold[HI_ISP_LCAC_DET_NUM] |
The parameter value is divided into three segments. The value of each segment indicates the luminance component threshold in the highlight detection module. The value that takes effect depends on the value of the purple_detect_range parameter. A smaller value of purple_detect_range indicates the tendency to the first segment of luma_detect_threshold while a larger value of purple_detect_range indicates the tendency to the third segment of luma_detect_threshold. Value range: [0, 4095] |
cb_cr_ratio[HI_ISP_LCAC_DET_NUM] |
The parameter value is divided into three segments. The value of each segment indicates the blue degree of the purple detection module. The value that takes effect depends on the value of the purple_detect_range parameter. A smaller value of purple_detect_range indicates the tendency to the first segment of cb_cr_ratio while a larger value of purple_detect_range indicates the tendency to the third segment of cb_cr_ratio. Value range: [-2048, 2047] |
op_type |
Purple fringing correction working mode
|
manual_attr |
Purple fringing correction strength parameter in manual mode |
auto_attr |
Purple fringing correction strength parameter in automatic mode |
Restrictions
- Due to the algorithm design, the local CAC strength is affected by the demosaic result. When the local CAC strength is set to the minimum value, the purple fringing removal capability is still functional, which has impact on purple fringing in highlight regions. To completely disable local CAC, set the enabling switch (enable) to HI_FALSE.
- When purple fringes are wide, if the value of cb_cr_ratio does not reach the threshold for completely detecting purple fringes, some purple fringes are removed, while some purple fringes remain, resulting in aliasing.
- In some scenarios with serious purple fringing, R or B is prone to saturation. In this case, unsmooth purple fringing removal occurs when b_detect_threshold or r_detect_threshold is close to the maximum value, which needs to be adjusted together with de_purple_cr_str and de_purple_cb_str.