昇腾社区首页
中文
注册

hi_isp_local_cac_attr

说明

紫边检测校正属性。

定义

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;

成员

成员名称

描述

enable

紫边校正使能。

取值范围:HI_FALSE:禁止;HI_TURE:使能。

purple_detect_range

紫色检测的范围,该值控制的是r_detect_threshold,g_detect_threshold,b_detect_threshold,Iuma_detect_threshold,cb_cr_ratio这几个参数的生效情况。值越大,越多非高亮区域的紫色被界定为紫边区域。

purple_detect_range可能会引入紫边去除不平滑的问题,可以检查r_detect_threshold,g_detect_threshold, b_detect_threshold,Iuma_detect_threshold,cb_cr_ratio这几个参数的配置。

取值范围:[0,410]。

var_threshold

边缘检测阈值。

取值范围:[0, 4095]。

r_detect_threshold[HI_ISP_LCAC_DET_NUM]

它分了3段,每一段的值表示高亮检测模块里面R分量阈值。

实际中生效的值取决于purple_detect_range这个参数的大小。purple_detect_range越小,越倾向于r_detect_threshold第一段的值,purple_detect_range越大,越倾向于r_detect_threshold第3段的值。

取值范围:[0, 4095]。

#define HI_ISP_LCAC_DET_NUM             3

g_detect_threshold[HI_ISP_LCAC_DET_NUM]

它分了3段,每一段的值表示高亮检测模块里面G分量阈值。

实际中生效的值取决于purple_detect_range这个参数的大小。purple_detect_range越小,越倾向于g_detect_threshold第一段的值,purple_detect_range越大,越倾向于g_detect_threshold第3段的值。

取值范围:[0, 4095]。

b_detect_threshold[HI_ISP_LCAC_DET_NUM]

它分了 3 段,每一段的值表示高亮检测模块里面B分量阈值。

实际中生效的值取决于purple_detect_range这个参数的大小。purple_detect_range越小,越倾向于b_detect_threshold第一段的值,purple_detect_range越大,越倾向于b_detect_threshold第3段的值。

取值范围:[0, 4095]。

luma_detect_threshold[HI_ISP_LCAC_DET_NUM]

它分了3段,每一段的值表示高亮检测模块里面Luma分量阈值。实际中生效的值取决于purple_detect_range这个参数的大小。purple_detect_range越小,越倾向于luma_detect_threshold第一段的值,purple_detect_range越大,越倾向于 luma_detect_threshold第 3 段的值。

取值范围:[0, 4095]

cb_cr_ratio[HI_ISP_LCAC_DET_NUM]

它分了3段,每一段的值表示紫色检测模块蓝色程度。实际中生效的值取决于 purple_detect_range这个参数的大小。 purple_detect_range越小,越倾向于cb_cr_ratio 第一段的值,purple_detect_range越大,越倾向于cb_cr_ratio第3段的值。

取值范围:[-2048, 2047]。

op_type

紫边校正工作模式。

  • HI_OP_MODE_AUTO:自动 ;
  • HI_OP_MODE_MANUAL:手动。

manual_attr

手动模式下配置紫边校正强度参数。

auto_attr

自动模式下配置紫边校正强度参数。

注意事项

  • 由于算法设计,LocalCAC矫正强度会受到Demosaic结果影响。因此将LocalCAC强度设为最小时依然会保留一定去紫边能力,对高光处紫边表现有一定影响。如果想完全关闭LocalCAC效果需直接将使能开关enable置为HI_FALSE。
  • 在紫边很宽的时候,若cb_cr_ratio的值未达到完全检测出紫边,会导致部分紫边去除,部分紫边残留而形成锯齿。
  • 有一些紫边比较严重的场景,R或者B容易出现饱和的情况,这时,b_detect_threshold或者r_detect_threshold在最大值附近有去除紫边不平滑的现象。需要跟de_purple_cr_str和 de_purple_cb_str联合调整。