hi_isp_cmos_sharpen_manual

Description

Defines the CMOS parameters for manual sharpening.

Definition

typedef struct {
    hi_u8  luma_wgt[HI_ISP_SHARPEN_LUMA_NUM];
    hi_u16 texture_strength[HI_ISP_SHARPEN_GAIN_NUM];
    hi_u16 edge_strength[HI_ISP_SHARPEN_GAIN_NUM];
    hi_u16 texture_freq;
    hi_u16 edge_freq;
    hi_u8  over_shoot;
    hi_u8  under_shoot;
    hi_u8  shoot_sup_strength;
    hi_u8  shoot_sup_adj;
    hi_u8  detail_ctrl;
    hi_u8  detail_ctrl_thr;
    hi_u8  edge_filt_str;
    hi_u8  edge_filt_max_cap;
    hi_u8  r_gain;
    hi_u8  g_gain;
    hi_u8  b_gain;
    hi_u8  skin_gain;
    hi_u16 max_sharp_gain;
} hi_isp_cmos_sharpen_manual;

Members

Member

Description

luma_wgt[HI_ISP_SHARPEN_LUMA_NUM]

Luminance sharpening weight.

The full-scale luminance (0–255) is equally divided into 32 luminance regions by 32 equal-division points, and each region corresponds to a luminance weight. For example, the weight of the luminance regions 0–7 is luma_wgt[0], the weight of the luminance regions 8–15 is luma_wgt[1], and the rule applies. For details, see Figure 1. A larger value indicates a higher image sharpening degree.

The value range is [0, 127], and the recommended value is 127.

#define HI_ISP_SHARPEN_LUMA_NUM         32

texture_strength[HI_ISP_SHARPEN_GAIN_NUM]

Sharpness of non-directional detail textures of an image.

A larger value indicates higher resolution of non-directional detail textures.

This parameter is an array with a length of 32, represented as a continuous strength curve with 32 sections, as shown in Figure 2.

The value range is [0, 4095], and the recommended value is 300.

#define HI_ISP_SHARPEN_GAIN_NUM         32

edge_strength[HI_ISP_SHARPEN_GAIN_NUM]

Sharpness of directional edges of an image.

A larger value indicates higher sharpness of directional edges.

This parameter is an array with a length of 32, represented as a continuous strength curve with 32 sections, as shown in Figure 3.

The value range is [0, 4095], and the recommended value is 400.

texture_freq

Enhancement frequency of non-directional detail textures of an image.

A larger value indicates that the enhancement of detail textures is biased towards high-frequency enhancement, with detail textures being finer and smaller. Conversely, the smaller the value, the thicker and rounder the detail textures.

texture_freq corresponds to the strength parameter texture_strength. A larger texture_freq value indicates finer detail textures of an image. However, if this value is too large, detail textures of the image are too fine to be natural and even blur.

The value range is [0, 4095], and the recommended value is 128.

edge_freq

Enhancement frequency of directional edges of an image.

A larger value indicates that the enhancement of edges is biased towards high-frequency enhancement, with the edges of images being slimmer and narrower. Conversely, a smaller value indicates that the edges are thicker and wider. edge_freq corresponds to the strength parameter edge_strength. A larger value of edge_freq indicates thinner and narrower image edges. However, if this value is too large, the image edges are too thin, which may cause dotted edges.

The value range is [0, 4095], and the recommended value is 96.

over_shoot

Parameter for setting the overshoot strength of an image. Overshoot means that white points and white borders occur after sharpening.

A smaller value indicates that the white points and white borders after sharpening are less obvious and the definition is lower. However, if the value of this parameter is too small, oil painting effect occurs.

The value range is [0, 127], and the recommended value is 100.

under_shoot

Parameter for setting the undershoot strength of an image. Undershoot means that black points and black borders occur after sharpening.

A smaller value indicates that the black points and black borders after sharpening are less obvious and the definition is lower. However, if the value of this parameter is too small, oil painting effect occurs.

The value range is [0, 127], and the recommended value is 127.

shoot_sup_strength

Overshoot and undershoot suppression strength after image sharpening. It is used to suppress the width and amplitude of overshoot and undershoot after image sharpening while ensuring that the definition does not deteriorate significantly.

A larger value indicates narrower and weaker overshoot and undershoot of the image after sharpening. Theoretically, an increase in the value does not affect the image definition. However, the image sharpness in human eyes is weakened after black and white borders become narrower.

Use this option in conjunction with shoot_sup_adj.

The value range is [0, 255], and the recommended value is 8.

shoot_sup_adj

Parameter for adjusting the overshoot and undershoot suppression strength after image sharpening.

This parameter must be used together with shoot_sup_strength to adjust the effect range of shoot_sup_strength. A smaller value indicates that the shoot of more texture regions is suppressed by shoot_sup_strength. A larger value indicates that the shoot of stronger edges is suppressed by shoot_sup_strength, while the shoot of texture regions is less likely to be suppressed.

The value range is [0, 15], and the recommended value is 9.

detail_ctrl

Parameter for controlling the shoot strengths of detail texture regions of an image. Larger shoot strengths indicate higher definition of the detail texture regions.

  • If the value of this parameter is 128, the shoot strengths of detail texture regions are the same as those of strong edges, which are equal to over_shoot and under_shoot.
  • If the value is greater than 128, the shoot strengths of detail texture regions are greater than those of strong edges, and the shoot strengths of strong edges are equal to over_shoot and under_shoot.
  • If the value is less than 128, the shoot strengths of detail texture regions are less than those of strong edges, and the shoot strengths of strong edges are equal to over_shoot and under_shoot.

Value range: [0, 255]

detail_ctrl_thr

Threshold of the shoot strength of image detail textures.

This parameter is used with detail_ctrl to distinguish the texture regions and edges corresponding to the shoot strengths controlled by detail_ctrl, that is, the difference threshold between the texture regions and the edges. A region whose value is less than this threshold is a texture region, and its shoot strengths are separately controlled by detail_ctrl. A region whose value is greater than this threshold is an edge, and its shoot strengths are equal to over_shoot and under_shoot.

The value range is [0, 255], and the recommended value is 160.

edge_filt_str

Edge filtering strength. This parameter is used to control the range of image sharpening edges and the edge smoothness.

A larger value indicates that larger and wider regions of an image will be targeted as edges, and more image edges will be handled by edge_strength. In addition, smoothing filtering along the edges becomes stronger, and the edges become smoother. Or vice versa.

The value range is [0, 63], and the recommended value is 53.

edge_filt_max_cap

Edge filtering strength range. A larger value indicates stronger edge filtering and a larger range of edge_filt_strength.

You are advised to set this parameter to a value less than 30.

The value range is [0, 47], and the recommended value is 18.

r_gain

Sharpening gain control in the dark red area. A larger value indicates stronger sharpening strength in the dark red area.

The value range is [0, 31], and the recommended value is 28.

g_gain

Sharpening gain control in the green area. A larger value indicates stronger sharpening strength in the green area.

The value range is [0, 255], and the recommended value is 32.

b_gain

Sharpening gain control in the dark blue area. A larger value indicates stronger sharpening strength in the dark blue area.

The value range is [0, 31], and the recommended value is 28.

skin_gain

Sharpening gain control in the complexion area. A larger value indicates stronger sharpening strength in the complexion area.

The value range is [0, 31], and the recommended value is 23.

max_sharp_gain

Maximum gain limit of image sharpening. A larger value indicates a larger image sharpening amplitude of the image, and vice versa. Set this parameter to a proper value to avoid oversharpening and reduce the black and white pixels after image sharpening.

The value range is [0, 0x7FF], and the recommended value is 0xA0.