15. CNR

15.1. Function Overview

Spatial denoising algorithm for chrominance noise in YUV Domain.

15.2. API Reference

15.2.1. CVI_ISP_SetCNRAttr

【Description】

Set chroma noise reduction parameter attribute

【Syntax】

CVI_S32 CVI_ISP_SetCNRAttr(VI_PIPE ViPipe, const ISP_CNR_ATTR_S *pstCNRAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstCNRAttr

Colorimetric Noise Reduction parameter in Properties

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】

15.2.2. CVI_ISP_GetCNRAttr

【Description】

Get chroma noise reduction parameter attribute

【Syntax】

CVI_S32 CVI_ISP_GetCNRAttr(VI_PIPE ViPipe, ISP_CNR_ATTR_S *pstCNRAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstCNRAttr

chroma noise reduction parameter attribute

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】

15.2.3. CVI_ISP_SetCNRMotionNRAttr

【Description】

  • Set the parameter attribute of chroma noise reduction moving object

【Syntax】

CVI_S32 CVI_ISP_SetCNRMotionNRAttr(VI_PIPE ViPipe, const ISP_CNR_MOTION_NR_ATTR_S *pstCNRMotionNRAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstCNRAttr

Chroma noise reduction moving object 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】

15.2.4. CVI_ISP_GetCNRMotionNRAttr

【Description】

Get the parameter attribute of chroma noise reduction moving object

【Syntax】

CVI_S32 CVI_ISP_GetCNRMotionNRAttr(VI_PIPE ViPipe, const ISP_CNR_MOTION_NR_ATTR_S *pstCNRMotionNRAttr);

【Parameter】

Parameter

Description

Input/Output

ViPipe

VI_PIPE number

Input

pstCNRAttr

Chroma noise reduction moving object 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】

15.3. Data Types

15.3.1. ISP_CNR_MANUAL_ATTR_S

【Description】

  • Chroma noise reduction parameter manual attribute

【Syntax】

typedef struct _ISP_CNR_MANUAL_ATTR_S {
  CVI_U8 CnrStr;
  CVI_U8 NoiseSuppressStr;
  CVI_U8 NoiseSuppressGain;
  CVI_U8 FilterType;
  CVI_U8 MotionNrStr;
  CVI_U8 LumaWgt;
  CVI_U8 DetailSmoothMode;
} ISP_CNR_MANUAL_ATTR_S;

【Member】

Member

Description

CnrStr

the intensity of color noise removal; the larger the value is, the stronger the denoising intensity is.

Value range: [0x0, 0xff]

Data type: CVI_U8

NoiseSuppressStr

color noise suppression intensity; the larger the value is, the stronger the color noise removal is.

Value range: [0x0, 0xff]

Data type: CVI_U8

NoiseSuppressGain

intensity gain of color noise suppression; the smaller the value is, the stronger the denoising intensity is.

Value range: [0x1, 0x8]

Data type: CVI_U8

FilterType

the strength of color noise filter; the larger the value is, the stronger the color noise removal is.

Value range: [0x0, 0x1f]

Data type: CVI_U8

MotionNrStr

Adjust the intensity of color noise removal in the moving area; the larger the value is, the less color noise is in the motion region.

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaWgt

the color denoising weight of reference brightness; the larger the value is, the stronger the intensity of color noise is affected by brightness.

Value range: [0x0, 0x8]

Data type: CVI_U8

DetailSmoothMode

Enable the de-noising detail smoothing function;

0: close.

1: Enable.

Value range: [0x0, 0x1]

Data type: CVI_U8

【Note】

None.

【Related Data Type and Interface】

15.3.2. ISP_CNR_AUTO_ATTR_S

【Description】

Chroma noise reduction parameter automatic attribute

【Syntax】

typedef struct _ISP_CNR_AUTO_ATTR_S {
  CVI_U8 CnrStr[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 NoiseSuppressStr[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 NoiseSuppressGain[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 FilterType[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 MotionNrStr[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 LumaWgt[ISP_AUTO_ISO_STRENGTH_NUM];
  CVI_U8 DetailSmoothMode[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_CNR_AUTO_ATTR_S;

【Member】

Member

Description

CnrStr

the intensity of color noise removal; the larger the value is, the stronger the denoising intensity is.

Value range: [0x0, 0xff]

Data type: CVI_U8

NoiseSuppressStr

color noise suppression intensity; the larger the value is, the stronger the color noise removal is.

Value range: [0x0, 0xff]

Data type: CVI_U8

NoiseSuppressGain

intensity gain of color noise suppression; the smaller the value is, the stronger the denoising intensity is.

Value range: [0x1, 0x8]

Data type: CVI_U8

FilterType

the strength of color noise filter; the larger the value is, the stronger the color noise removal is.

Value range: [0x0, 0x1f]

Data type: CVI_U8

MotionNrStr

Adjust the intensity of color noise removal in the moving area; the larger the value is, the less color noise is in the motion region.

Value range: [0x0, 0xff]

Data type: CVI_U8

LumaWgt

the color denoising weight of reference brightness; the larger the value is, the stronger the intensity of color noise is affected by brightness.

Value range: [0x0, 0x8]

Data type: CVI_U8

DetailSmoothMode

Enable the de-noising detail smoothing function; 0: close.

1: Enable.

Value range: [0x0, 0x1]

Data type: CVI_U8

【Note】

None.

【Related Data Type and Interface】

15.3.3. ISP_CNR_ATTR_S

【Description】

Chroma noise reduction parameter attribute.

【Syntax】

typedef struct _ISP_CNR_ATTR_S {
  CVI_BOOL Enable;
  ISP_OP_TYPE_E enOpType;
  CVI_U8 UpdateInterval;
  ISP_CNR_MANUAL_ATTR_S stManual;
  ISP_CNR_AUTO_ATTR_S stAuto;
} ISP_CNR_ATTR_S;

【Member】

Member

Description

Enable

Enable CNR module;

0: close.

1: enable

Value range: [0, 1]

Data type: CVI_BOOL

enOpType

Type of work

OP_TYPE_AUTO: automatic mode

OP_TYPE_MANUAL: manual 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 mode parameter properties

stAuto

Automatic mode parameter properties

【Note】

None.

【Related Data Type and Interface】

15.3.4. ISP_CNR_MOTION_NR_MANUAL_ATTR_S

【Description】

Chroma Noise Reduction Moving Object parameters Manual Properties

【Syntax】

typedef struct _ISP_CNR_MOTION_NR_MANUAL_ATTR_S {
  CVI_U8 MotionCnrCoringLut[16]
  CVI_U8 MotionCnrStrLut[16];
} ISP_CNR_MOTION_NR_MANUAL_ATTR_S;

【Member】

Member

Description

MotionCnrCoringLut[16]

Use LUT to adjust the intensity of color noise suppression corresponding to the amount of motion of different objects, and the amount of motion is divided into 16 levels. The larger the value, the stronger the denoising strength Value range: [0x0, 0xff]

Data type: CVI_U8

MotionCnrStrLut[16]

Use LUT to adjust the denoising intensity corresponding to different object movement, and divide the movement into 16 levels. The larger the value, the stronger the denoising strength.

Value range: [0x0, 0xff]

Data type: CVI_U8

【Note】

None.

【Related Data Type and Interface】

15.3.5. ISP_CNR_MOTION_NR_AUTO_ATTR_S

【Description】

Chroma Noise Reduction Moving Object parameters Automatic Properties

【Syntax】

typedef struct _ISP_CNR_MOTION_NR_ATTR_S {
  CVI_BOOL MotionCnrEnable;
  ISP_CNR_MOTION_NR_MANUAL_ATTR_S stManual;
  ISP_CNR_MOTION_NR_AUTO_ATTR_S stAuto;
} ISP_CNR_MOTION_NR_ATTR_S;

【Member】

Member

Description

MotionCnrEnable

The function of adjusting the strength of denoising by referring to the amount of motion of the object is enabled.

0: off.

1: Enabled.

Value range: [0, 1]

Data type: CVI_BOOL

stManual

Manual Mode parameter Properties

stAuto

Auto Mode parameter Properties

【Note】

None.

【Related Data Type and Interface】

15.3.6. ISP_CNR_MOTION_NR_ATTR_S

【Description】

Chroma Noise Reduction Moving Object parameter Properties

【Syntax】

typedef struct _ISP_CNR_MOTION_NR_ATTR_S {
  CVI_BOOL MotionCnrEnable;
  ISP_CNR_MOTION_NR_MANUAL_ATTR_S stManual;
  ISP_CNR_MOTION_NR_AUTO_ATTR_S stAuto;
} ISP_CNR_MOTION_NR_ATTR_S;

【Member】

Member

Description

MotionCnrEnable

The function of adjusting the strength of denoising by referring to the amount of motion of the object is enabled.

0: off.

1: Enabled.

Value range: [0, 1]

Data type: CVI_BOOL

stManual

Manual Mode parameter Properties

stAuto

Auto Mode parameter Properties

【Note】

None.

【Related Data Type and Interface】