22. DCI

22.1. Function Overview

Dynamic contrast improvement is the abbreviation of dynamic contrast improvement. By adjusting the histogram to enhance the image contrast and enhance the details of the dark part.

22.2. API Reference

22.2.1. CVI_ISP_SetDCIAttr

【Description】

Set DCI parameter properties

【Syntax】

CVI_S32 CVI_ISP_SetDCIAttr(VI_PIPE ViPipe, const ISP_DCI_ATTR_S *pstDCIAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstDCIAttr

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】

22.2.2. CVI_ISP_GetDCIAttr

【Description】

Get DCI parameter properties

【Syntax】

CVI_S32 CVI_ISP_GetDCIAttr(VI_PIPE ViPipe, ISP_DCI_ATTR_S *pstDCIAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstDCIAttr

DCI parameter properties

Output

【Return 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】

22.3. Data Types

22.3.1. ISP_DCI_MANUAL_ATTR_S

【Description】

DCI parameter Manual Properties

【Syntax】

 typedef struct _ISP_DCI_MANUAL_ATTR_S {
  CVI_U16 ContrastGain;
  CVI_U8 BlcThr;
  CVI_U8 WhtThr;
  CVI_U16 BlcCtrl;
  CVI_U16 WhtCtrl;
  CVI_U16 DciGainMax;
} ISP_DCI_MANUAL_ATTR_S;

【Member】

Member

Description

ContrastGain

It is used to control the intensity of DCI. The higher the value is, the greater the contrast is

Value range: [0x0, 0x100]

Data type: CVI_U16

BlcThr

The threshold used to determine the range of dark areas. The larger the value is, the larger the range of dark areas is.

Value range: [0x0, 0xff]

Data type: CVI_U8

WhtThr

The threshold used to determine the range of bright areas. The smaller the value is, the larger the range of bright areas is.

Value range: [0x0, 0xff]

Data type: CVI_U8

BlcCtrl

Used to determine the contrast of dark areas. When the value is 256, the contrast of dark area remains unchanged. When the ratio is larger than 256, the larger the value is, the greater the contrast in the dark area is; On the contrary, the smaller the value is, the smaller the contrast is.

Value range: [0x0, 0x7fff]

Data type: CVI_U16

WhtCtrl

Used to determine the contrast of bright areas.When the value is 256, the brightness contrast is unchanged.When it is larger than 256, the larger the value, the greater the contrast of bright area.Conversely, the smaller the value, the smaller the contrast in the bright area.

Value range: [0x0, 0x7fff]

Data type: CVI_U16

DciGainMax

Used to control the upper limit of contrast. The larger the value, the stronger the contrast.

Value range: 0x0, 0x100

Data type: CVI_U16

【Note】

None.

【Related Data Type and Interface】

22.3.2. ISP_DCI_AUTO_ATTR_S

【Description】

DCI parameter Auto Properties

【Syntax】

 typedef struct _ISP_DCI_AUTO_ATTR_S {
  CVI_U16 ContrastGain[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 BlcThr[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 WhtThr[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 BlcCtrl[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 WhtCtrl[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 DciGainMax[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_DCI_AUTO_ATTR_S;

【Member】

Member

Description

ContrastGain

It is used to control the intensity of DCI. The larger the value is, the greater the contrast is.

Value range: [0x0, 0x100]

Data type: CVI_U16

BlcThr

The threshold used to determine the range of dark areas. The larger the value, the larger the range of dark areas.

Value range: [0x0, 0xff]

Data type: CVI_U8

WhtThr

Threshold used to determine the range of the bright area. The smaller the value, the larger the range of the light areas included.

Value range: [0x0, 0xff]

Data type: CVI_U8

BlcCtrl

Used to determine the contrast of dark areas. If the value is 256, the contrast of dark area remains unchanged. If the value is larger than 256, the larger the value, the greater the contrast in the dark area is; On the contrary, the smaller the value is, the smaller the contrast is.

Value range: [0x0, 0x7fff]

Data type: CVI_U16

WhtCtrl

Used to determine the contrast of the bright area. When the value is 256, the contrast of the bright area remains unchanged. When the value is larger than 256, the higher the value is, the greater the contrast is; On the contrary, the smaller the value is, the smaller the contrast is.

Value range: [0x0, 0x7fff]

Data type: CVI_U16

DciGainMax

Used to control the upper limit of contrast. The larger the value, the stronger the contrast.

Value range: 0x0, 0x100

Data type: CVI_U16

【Note】

None.

【Related Data Type and Interface】

22.3.3. ISP_DCI_ATTR_S

【Description】

DCI parameter Properties

【Syntax】

 typedef struct _ISP_DCI_ATTR_S {
  CVI_BOOL Enable;
  CVI_BOOL TuningMode;
  ISP_OP_TYPE_E enOpType;
  CVI_U8 UpdateInterval;
  CVI_U8 Method;
  CVI_U32 Speed;
  CVI_U16 DciStrength;
  CVI_U16 DciGamma;
  CVI_U8 DciOffset;
  CVI_U8 ToleranceY;
  CVI_U8 Sensitivity;
  ISP_DCI_MANUAL_ATTR_S stManual;
  ISP_DCI_AUTO_ATTR_S stAuto;
} ISP_DCI_ATTR_S;

【Member】

Member

Description

Enable

DCI module enable

0: shut down

1: enable

TuningMode

The original image and the result image are displayed at the same time on the same screen to assist in adjusting parameters.

0: CAC image results.

1: The original image and the result image are displayed on the same screen at the same time.

Value range: [0, 1]

Data type: CVI_BOOL

enOpType

Working type

OP_TYPE_AUTO: auto 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

Method

Used to select DCI algo version,

0: adaptive version,

1: manually adjust version

Value range: [0x0, 0x1]

Data type: CVI_U8

Speed

Smooth intensity, the higher the value, the slower the change.

Value range: [0x0, 0x400]

Data type: CVI_U16

DciStrength

Keep the lowest slope of each BIN. The larger the value is, the smaller the slope is

Value range: [0x0, 0x100]

Data type: CVI_U16

DciGamma

It is used to control the contrast. The larger the value, the greater the contrast, but the brightness of the screen will decrease. It is recommended to adjust it together with DciOffset.

Value range: [0x64, 0x320]

Data type: CVI_U16

DciOffset

Adjustment of overall screen brightness. The larger the value, the greater the overall brightness. It is recommended to adjust together with DciGamma.

Value range: [0x0, 0xff]

Data type: CVI_U8

ToleranceY

Tolerable luminance error to reach target luminance

Value range: [0x0, 0xff]

Data type: CVI_U8

Sensitivity

Sensitivity: The higher the sensitivity, the lower the threadhold for dci heavy operations

Value range: [0x0, 0xff]

Data type: CVI_U8

stManual

Manual mode parameter properties

stAuto

Automatic mode parameter properties

【Note】

None.

【Related Data Type and Interface】