14. BNR

14.1. Functional Description

in Bayer Domain perform spatial domainnoise reductionalgorithm.

14.2. API Reference

14.2.1. CVI_ISP_SetBNRAttr

[Description]

SetBayernoise reduction parameter attributes

[Syntax]

CVI_S32 CVI_ISP_SetBNRAttr(VI_PIPE ViPipe, const ISP_BNR_ATTR_S *pstBNRAttr);

[Parameters]

Parameter Name

Description

Input/Output

ViPipe

VI_PIPE No.

Input

pstBNRAttr

Bayernoise reduction parameter attributes

Input

[Return Value]

Return Value

Description

0

Success

Non-zero

Failure, whose value is Error Code.

[Requirements]

  • Header File: cvi_isp.h, cvi_comm_isp.h

  • Library File: libisp.so

[Note]

None

[Example]

VI_PIPE ViPipe = 0;
ISP_BNR_ATTR_S stAttr;
CVI_ISP_GetBNRAttr(ViPipe, &stAttr);
stAttr.enOpType = OP_TYPE_AUTO;
CVI_ISP_SetBNRAttr(ViPipe, &stAttr);

[Related Topics]

14.2.2. CVI_ISP_GetBNRAttr

[Description]

GetBayernoise reduction parameter attributes

[Syntax]

CVI_S32 CVI_ISP_GetBNRAttr(VI_PIPE ViPipe, ISP_BNR_ATTR_S *pstBNRAttr);

[Parameters]

Parameter Name

Description

Input/Output

ViPipe

VI_PIPE No.

Input

pstBNRAttr

Bayernoise reduction parameter attributes

output

[Return Value]

Return Value

Description

0

Success

Non-zero

Failure, whose value is Error Code.

[Requirements]

  • Header File: cvi_isp.h, cvi_comm_isp.h

  • Library File: libisp.so

[Note]

None

[Example]

None

[Related Topics]

14.2.3. CVI_ISP_SetBNRFilterAttr

[Description]

SetBayernoise reduction filter attributes

[Syntax]

CVI_S32 CVI_ISP_SetBNRFilterAttr(VI_PIPE ViPipe, const ISP_BNR_FILTER_ATTR_S *pstBNRFilterAttr);

[Parameters]

Parameter Name

Description

Input/Output

ViPipe

VI_PIPE No.

Input

pstBNRFilterAttr

Bayernoise reduction filter attributes

Input

[Return Value]

Return Value

Description

0

Success

Non-zero

Failure, whose value is Error Code.

[Requirements]

  • Header File: cvi_isp.h, cvi_comm_isp.h

  • Library File: libisp.so

[Note]

None

[Example]

VI_PIPE ViPipe = 0;
ISP_BNR_FILTER_ATTR_S stAttr;
CVI_ISP_GetBNRFilterAttr(ViPipe, &stAttr);
stAttr.enOpType = OP_TYPE_AUTO;
CVI_ISP_SetBNRFilterAttr(ViPipe, &stAttr);

[Related Topics]

14.2.4. CVI_ISP_GetBNRFilterAttr

[Description]

GetBayernoise reduction filter attributes

[Syntax]

CVI_S32 CVI_ISP_GetBNRFilterAttr(VI_PIPE ViPipe, ISP_BNR_FILTER_ATTR_S *pstBNRFilterAttr);

[Parameters]

Parameter Name

Description

Input/Output

ViPipe

VI_PIPE No.

Input

pstBNRFilterAttr

Bayernoise reduction filter attributes

output

[Return Value]

Return Value

Description

0

Success

Non-zero

Failure, whose value is Error Code.

[Requirements]

  • Header File: cvi_isp.h, cvi_comm_isp.h

  • Library File: libisp.so

[Note]

None

[Example]

None

[Related Topics]

14.3. Data Types

14.3.1. ISP_BNR_MANUAL_ATTR_S

[Description]

Manual DefinitionBayernoise reduction parameter attributes

[Definition]

typedef struct _ISP_BNR_MANUAL_ATTR_S {
        CVI_U8 FilterKsize; /*Rw; Range:[0, 1]*/
        CVI_U16 PreFilterStdThr1; /*Rw; Range:[0, 1023]*/
        CVI_U16 PreFilterStdThr2; /*Rw; Range:[0, 1023]*/
        CVI_U8 GussianKernelWt[BNR_WEIGHT_LUT_NUM]; /*Rw; Range:[0, 31]*/
        CVI_U8 NrBlendWt; /*Rw; Range:[0, 16]*/
} ISP_BNR_MANUAL_ATTR_S;

[Members]

Member Name

Description

FilterKsize

noise reductionfilteringkernellargesmall.

Value Range: [0, 1]

Data Types: CVI_U8

PreFilterStdThr1

NR Weight TH1 in Pre filter BF.

Value Range: [0, 1023]

Data Types: CVI_U16

PreFilterStdThr2

NR Weight TH2 in Pre filter BF.

Value Range: [0, 1023]

Data Types: CVI_U16

GussianKernelWt

Spatial NR Weight LUT.

Value Range: [0, 31]

Data Types: CVI_U8

NrBlendWt

Blend Weight between NLMS&BF.

Value Range: [0, 16]

Data Types: CVI_U8

[Precautions]

None

[Related Data Types and Interfaces]

14.3.2. ISP_BNR_AUTO_ATTR_S

[Description]

Automatic DefinitionBayernoise reduction parameter attributes

[Definition]

typedef struct _ISP_BNR_AUTO_ATTR_S {
        CVI_U8 FilterKsize[ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1]*/
        CVI_U16 PreFilterStdThr1[ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 PreFilterStdThr2[ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U8 GussianKernelWt[BNR_WEIGHT_LUT_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 31]*/
        CVI_U8 NrBlendWt[ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 16]*/
} ISP_BNR_AUTO_ATTR_S;

[Members]

Member Name

Description

FilterKsize

noise reductionfilteringkernellargesmall.

Value Range: [0, 1]

Data Types: CVI_U8

PreFilterStdThr1

NR Weight TH1 in Pre filter BF.

Value Range: [0, 1023]

Data Types: CVI_U16

PreFilterStdThr2

NR Weight TH2 in Pre filter BF.

Value Range: [0, 1023]

Data Types: CVI_U16

GussianKernelWt

Spatial NR Weight LUT.

Value Range: [0, 31]

Data Types: CVI_U8

NrBlendWt

Blend Weight between NLMS&BF.

Value Range: [0, 16]

Data Types: CVI_U8

[Precautions]

None

[Related Data Types and Interfaces]

14.3.3. ISP_BNR_ATTR_S

[Description]

Defines Bayer noise reduction parameter attributes

[Definition]

typedef struct _ISP_BNR_ATTR_S {
        CVI_BOOL Enable; /*Rw; Range:[0, 1]*/
        ISP_OP_TYPE_E enOpType;
        CVI_U8 UpdateInterval; /*Rw; Range:[0, 255]*/
        CVI_BOOL PreFilterEnable; /*Rw; Range:[0, 1]*/
        CVI_BOOL PreFilterModeSel; /*Rw; Range:[0, 1]*/
        ISP_BNR_MANUAL_ATTR_S stManual;
        ISP_BNR_AUTO_ATTR_S stAuto;
} ISP_BNR_ATTR_S;

[Members]

Member Name

Description

Enable

module enable switch

Value Range: [0, 1]

Data Types: CVI_BOOL

enOpType

operation type

OP_TYPE_AUTO: automatic mode

OP_TYPE_MANUAL: manual mode

Data Types: ISP_OP_TYPE_E

UpdateInterval

affects the parameter update interval,the larger the value, the slower the image changes,the better the performance.

Value Range: [0, 255]

Data Types: CVI_U8

PreFilterEnable

Pre filter BF Enable

Value Range: [0, 1]

Data Types: CVI_BOOL

PreFilterModeSel

Pre filter BF center mode sel when similar pixel cnt <= 2

Value Range: [0, 1]

Data Types: CVI_BOOL

stManual

manual parameters

stAuto

automatic parameters

[Precautions]

None

[Related Data Types and Interfaces]

14.3.4. ISP_BNR_FILTER_MANUAL_ATTR_S

[Description]

Manual DefinitionBayernoise reduction filter attributes

[Definition]

typedef struct _ISP_BNR_FILTER_MANUAL_ATTR_S {
        CVI_U16 Filter1GaussianCurve[BNR_BASE_LUT_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 Filter1LumaOffset[BNR_LUMA_LUT_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 Filter2GaussianCurve[BNR_BASE_LUT_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 Filter2LumaOffset[BNR_LUMA_LUT_NUM]; /*Rw; Range:[0, 1023]*/
} ISP_BNR_FILTER_MANUAL_ATTR_S;

[Members]

Member Name

Description

Filter1GaussianCurve

NLMS base LUT, Gaussian.

Value Range: [0, 1023]

Data Types: CVI_U16

Filter1LumaOffset

NLMS Luma LUT, Signal independen.

Value Range: [0, 1023]

Data Types: CVI_U16

Filter2GaussianCurve

BF base LUT, Gaussian.

Value Range: [0, 1023]

Data Types: CVI_U16

Filter2LumaOffset

BF Luma LUT, Signal independen.

Value Range: [0, 1023]

Data Types: CVI_U16

[Precautions]

None

[Related Data Types and Interfaces]

14.3.5. ISP_BNR_FILTER_AUTO_ATTR_S

[Description]

Automatic DefinitionBayernoise reduction filter attributes

[Definition]

typedef struct _ISP_BNR_FILTER_AUTO_ATTR_S {
        CVI_U16 Filter1GaussianCurve[BNR_BASE_LUT_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 Filter1LumaOffset[BNR_LUMA_LUT_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 Filter2GaussianCurve[BNR_BASE_LUT_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1023]*/
        CVI_U16 Filter2LumaOffset[BNR_LUMA_LUT_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /*Rw; Range:[0, 1023]*/
} ISP_BNR_FILTER_AUTO_ATTR_S;

[Members]

Member Name

Description

Filter1GaussianCurve

NLMS base LUT, Gaussian.

Value Range: [0, 1023]

Data Types: CVI_U16

Filter1LumaOffset

NLMS Luma LUT, Signal independen.

Value Range: [0, 1023]

Data Types: CVI_U16

Filter2GaussianCurve

BF base LUT, Gaussian.

Value Range: [0, 1023]

Data Types: CVI_U16

Filter2LumaOffset

BF Luma LUT, Signal independen.

Value Range: [0, 1023]

Data Types: CVI_U16

[Precautions]

None

[Related Data Types and Interfaces]

14.3.6. ISP_BNR_FILTER_ATTR_S

[Description]

Defines Bayer noise reduction filter attributes

[Definition]

typedef struct _ISP_BNR_FILTER_ATTR_S {
        CVI_U8 DebugMode; /*Rw; Range:[0, 3]*/
        ISP_BNR_FILTER_MANUAL_ATTR_S stManual;
        ISP_BNR_FILTER_AUTO_ATTR_S stAuto;
} ISP_BNR_FILTER_ATTR_S;

[Members]

Member Name

Description

DebugMode

SetDebugmode

Value Range: [0, 3]

Data Types: CVI_U8

stManual

manual parameters

stAuto

automatic parameters

[Precautions]

None

[Related Data Types and Interfaces]