7. BlackLevel

7.1. Function Overview

Black level is the brightness value that the sensor still outputs when there is no light from outside. ISP needs to be deducted to make brightness and color normal.

7.2. API Reference

7.2.1. CVI_ISP_SetBlackLevelAttr

【Description】

Set the black level attribute parameters

【Syntax】

CVI_S32 CVI_ISP_SetBlackLevelAttr(VI_PIPE ViPipe, const ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);

【Parameter】

Parameter

Description

Input/ Output

ViPipe

VI_PIPE number

Input

pstBlackLevelAttr

Black level attribute parameters

Input

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

7.2.2. CVI_ISP_GetBlackLevelAttr

【Description】

Get the black level attribute parameters

【Syntax】

CVI_S32 CVI_ISP_GetBlackLevelAttr(VI_PIPE ViPipe, ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);

【Parameter】

Parameter

Description

Input/ Output

ViPipe

VI_PIPE number

Input

pstBlackLevelAttr

Black level attribute parameters

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】

7.3. Data Types

7.3.1. ISP_BlACK_LEVEL_MANUAL_ATTR_S

【Description】

Define black level manual attributes

【定义】

typedef struct _ISP_BLACK_LEVEL_MANUAL_ATTR_S {
  CVI_U16 OffsetR;
  CVI_U16 OffsetGr;
  CVI_U16 OffsetGb;
  CVI_U16 OffsetB;
  CVI_U16 OffsetR2;
  CVI_U16 OffsetGr2;
  CVI_U16 OffsetGb2;
  CVI_U16 OffsetB2;
} ISP_BLACK_LEVEL_MANUAL_ATTR_S;

【成员】

Member

Description

OffsetR

BLC R pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGr

BLC GR pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGb

BLC GB pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetB

BLC B pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetR2

BLC second stage R pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGr2

BLC second level GR pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGb2

BLC second level GB pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetB2

BLC second level B pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

【Note】

None

【Related Data Type and Interface】

7.3.2. ISP_BLACK_LEVEL_AUTO_ATTR_S

【Description】

Define black level auto attributes

【定义】

typedef struct _ISP_BLACK_LEVEL_AUTO_ATTR_S {
  CVI_U16 OffsetR[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetGr[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetGb[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetB[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetR2[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetGr2[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetGb2[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U16 OffsetB2[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_BLACK_LEVEL_AUTO_ATTR_S;

【成员】

Member

Description

OffsetR

BLC R pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGr

BLC GR pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGb

BLC GB pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetB

BLC B pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetR2

BLC second stage R pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGr2

BLC second level GR pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetGb2

BLC second level GB pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

OffsetB2

BLC second level B pixel dark current value

Value range: [0x0, 0xfff]

Data type: CVI_U16

【Note】

None

【Related Data Type and Interface】

7.3.3. ISP_BLACK_LEVEL_ATTR_S

【Description】

Define black level attributes

【定义】

typedef struct _ISP_BLACK_LEVEL_ATTR_S {
  CVI_U8 Enable;
  ISP_OP_TYPE_E enOpType;
  CVI_U8 UpdateInterval;
  ISP_BLACK_LEVEL_MANUAL_ATTR_S stManual;
  ISP_BLACK_LEVEL_AUTO_ATTR_S stAuto;
} ISP_BLACK_LEVEL_ATTR_S;

【成员】

Member

Description

Enable

The BLC module enable

Value range: [0x0, 0x1]

Data type: CVI_U8

enOpType

Choose manual or automatic mode

UpdateInterval

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

Value range: [0x0, 0xff]

Data type: CVI_U8

stManual

manual parameters

stAuto

automatic parameters

【Note】

None

【Related Data Type and Interface】