23. LDCI

23.1. Function Overview

Local Dynamic Contrast Improvement is a method to enhance image contrast and improve dark area details by adjusting histogram.

23.2. API Reference

23.2.1. CVI_ISP_SetLDCIAttr

【Description】

Set LDCI parameter attribute

【Syntax】

CVI_S32 CVI_ISP_SetLDCIAttr(VI_PIPE ViPipe, const ISP_LDCI_ATTR_S *pstLDCIAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstLDCIAttr

DCI parameter properties

Input

【Retrun Value】

Return Value

Description

0

Success

non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

23.2.2. CVI_ISP_GetLDCIAttr

【Description】

Get LDCI parameter attribute

【Syntax】


CVI_S32 CVI_ISP_GetLDCIAttr(VI_PIPE ViPipe, ISP_LDCI_ATTR_S *pstLDCIAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstLDCIAttr

DCI parameter properties

Output

【Retrun Value】

Return Value

Description

0

Success

non 0

Failure. An error code is returned. For details, see chapter Error Codes.

【Requirement】

  • Header files: cvi_isp.h, cvi_comm_isp.h

  • Library files: libisp.so

【Note】

None.

【Example】

None.

【Related Topic】

23.3. Data Types

23.3.1. ISP_LDCI_GAUSS_COEF_ATTR_S

【Description】

  • LDCI Gaussian structure parameter attribute

【Syntax】

 typedef struct _ISP_LDCI_GAUSS_COEF_ATTR_S {
  CVI_U8 Wgt;
  CVI_U8 Sigma;
  CVI_U8 Mean;
} ISP_LDCI_GAUSS_COEF_ATTR_S;

【Member】

Member

Description

Wgt

Control the LDCI effect intensity according to the brightness, and determine the weight curve of the fusion of the LDCI result and the original image

Value range: [0x0, 0x80]

Data type: CVI_U8

Sigma

Control the LDCI effect intensity according to the brightness, and determine the weight curve of the fusion of the LDCI result and the original image

Value range: [0x0, 0xff]

Data type: CVI_U8

Mean

Control the LDCI effect intensity according to the brightness, and determine the weight curve of the fusion of the LDCI result and the original image

Value range: [0x0, 0xff]

Data type: CVI_U8

【Note】

None.

【Related Data Type and Interface】

None

23.3.2. ISP_LDCI_MANUAL_ATTR_S

【Description】

  • LDCI parameter manual attribute

【Syntax】

 typedef struct _ISP_LDCI_MANUAL_ATTR_S {
  CVI_U16 LdciStrength;
  CVI_U16 LdciRange;
  CVI_U16 TprCoef;
  CVI_U8 EdgeCoring;
  CVI_U8 LumaWgtMax;
  CVI_U8 LumaWgtMin;
  CVI_U8 VarMapMax;
  CVI_U8 VarMapMin;
  CVI_U8 UvGainMax;
  CVI_U8 UvGainMin;
  CVI_U8 BrightContrastHigh;
  CVI_U8 BrightContrastLow;
  CVI_U8 DarkContrastHigh;
  CVI_U8 DarkContrastLow;
  ISP_LDCI_GAUSS_COEF_ATTR_S LumaPosWgt;
} ISP_LDCI_MANUAL_ATTR_S;

【Member】

Member

Description

LdciStrength

Controls the LDCI enhancement effect parameters. The larger the value, the | stronger the local contrast stretch

Value range: [0x0, 0x100]

Data type: CVI_U16

LdciRange

Controls the degree of contrast enhancement for high frequency areas of the image. The larger the value, the stronger the contrast of the high frequency area of the image

Value range: [0x0, 0x3ff]

Data type: CVI_U16

TprCoef

The smoothness of changes in the time domain of the LDCI curve. The smaller the value, the smoother the change in the time domain, and vice versa, the faster the change

Value range: [0x0, 0x3ff]

Data type: CVI_U16

EdgeCoring

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaWgtMax

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaWgtMin

Value range: [0x0, 0xff]

Data type: CVI_U8

VarMapMax

Value range: [0x0, 0xff]

Data type: CVI_U8

VarMapMin

Value range: [0x0, 0xff]

Data type: CVI_U8

UvGainMax

Value range: [0x0, 0x7f]

Data type: CVI_U8

UvGainMin

Value range: [0x0, 0x7f]

Data type: CVI_U8

BrightContrastHigh

Value range: [0x0, 0xff]

Data type: CVI_U8

BrightContrastLow

Value range: [0x0, 0xff]

Data type: CVI_U8

DarkContrastHigh

Value range: [0x0, 0xff]

Data type: CVI_U8

DarkContrastLow

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaPosWgt

Control the LDCI effect intensity according to the brightness, and determine the weight curve of the fusion of the LDCI result and the original image

【Note】

None.

【Related Data Type and Interface】

23.3.3. ISP_LDCI_AUTO_ATTR_S

【Description】

LDCI parameter automatic attribute

【Syntax】

 typedef struct _ISP_LDCI_AUTO_ATTR_S {
  CVI_U16 LdciStrength[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 LdciRange[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 TprCoef[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 EdgeCoring[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 LumaWgtMax[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 LumaWgtMin[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 VarMapMax[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 VarMapMin[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 UvGainMax[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 UvGainMin[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 BrightContrastHigh[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 BrightContrastLow[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 DarkContrastHigh[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 DarkContrastLow[ISP_AUTO_ISO_STRENGTH_NUM];
  ISP_LDCI_GAUSS_COEF_ATTR_S LumaPosWgt[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_LDCI_AUTO_ATTR_S;

【Member】

Member

Description

LdciStrength

Controls the LDCI enhancement effect parameters. The larger the value, the | stronger the local contrast stretch

Value range: [0x0, 0x100]

Data type: CVI_U16

LdciRange

Controls the degree of contrast enhancement for high frequency areas of the image. The larger the value, the stronger the contrast of the high frequency area of the image

Value range: [0x0, 0x3ff]

Data type: CVI_U16

TprCoef

The smoothness of changes in the time domain of the LDCI curve. The smaller the value, the smoother the change in the time domain, and vice versa, the faster the change

Value range: [0x0, 0x3ff]

Data type: CVI_U16

EdgeCoring

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaWgtMax

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaWgtMin

Value range: [0x0, 0xff]

Data type: CVI_U8

VarMapMax

Value range: [0x0, 0xff]

Data type: CVI_U8

VarMapMin

Value range: [0x0, 0xff]

Data type: CVI_U8

UvGainMax

Value range: [0x0, 0x7f]

Data type: CVI_U8

UvGainMin

Value range: [0x0, 0x7f]

Data type: CVI_U8

BrightContrastHigh

Value range: [0x0, 0xff]

Data type: CVI_U8

BrightContrastLow

Value range: [0x0, 0xff]

Data type: CVI_U8

DarkContrastHigh

Value range: [0x0, 0xff]

Data type: CVI_U8

DarkContrastLow

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaPosWgt

Control the LDCI effect intensity according to the brightness, and determine the weight curve of the fusion of the LDCI result and the original image

【Note】

None.

【Related Data Type and Interface】

23.3.4. ISP_LDCI_ATTR_S

【Description】

LDCI parameter attribute

【Syntax】

 typedef struct _ISP_LDCI_ATTR_S {
  CVI_BOOL Enable;
  ISP_OP_TYPE_E enOpType;
  CVI_U8 UpdateInterval;
  CVI_U8 GaussLPFSigma;
  ISP_LDCI_MANUAL_ATTR_S stManual;
  ISP_LDCI_AUTO_ATTR_S stAuto;
} ISP_LDCI_ATTR_S;

【Member】

Member

Description

Enable

LDCI module enable

enOpType

job type

OP_TYPE_AUTO: automatic mode

OP_TYPE_MANUAL: manual mode

UpdateInterval

Affects the parameter update terval, the larger the value, the slower the screen changes and the better the performance

Value range: [0x0, 0xff]

Data type: CVI_U8

GaussLPFSigma

Local filtering degree, the smaller the value, the more localized the local contrast enhancement effect, and vice versa, the more globalized Value range: [0x0, 0xff]

Data type: CVI_U8

stManual

Manual Mode parameter Properties

stAuto

Auto Mode parameter Properties

【Note】

None.

【Related Data Type and Interface】