11. CCM¶
11.1. Function Overview¶
CCM is the acronym for color correction matrix.
Because the sensor’s response in RGB is not the same as that of human eye,
this matrix needs to be used for conversion,
so that the brightness of the image captured by the front end is consistent with that of human eye.
11.2. API Reference¶
CVI_ISP_SetCCMAttr: Set attribute parameters of color correction matrix.
CVI_ISP_GetCCMAttr: Get attribute parameters of color correction matrix.
CVI_ISP_SetCCMSaturationAttr: Set attribute parameters of color Saturation correction matrix.
CVI_ISP_GetCCMSaturationAttr: Get attribute parameters of color Saturation correction matrix.
11.2.1. CVI_ISP_SetCCMAttr¶
【Description】
Set attribute parameters of color correction matrix.
【Syntax】
CVI_S32 CVI_ISP_SetCCMAttr(VI_PIPE ViPipe, const ISP_CCM_ATTR_S *pstCCMAttr);
【Parameter】
Parameter |
Description |
Input / Output |
---|---|---|
ViPipe |
VI_PIPE number |
Input |
pstCCMAttr |
attribute parameters of color correction matrix |
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】
11.2.2. CVI_ISP_GetCCMAttr¶
【Description】
Get attribute parameters of color correction matrix.
【Syntax】
CVI_S32 CVI_ISP_GetCCMAttr(VI_PIPE ViPipe, ISP_CCM_ATTR_S *pstCCMAttr);
【Parameter】
Parameter |
Description |
Input / Output |
---|---|---|
ViPipe |
VI_PIPE number |
Input |
pstCCMAttr |
attribute parameters of color correction matrix |
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】
11.2.3. CVI_ISP_SetCCMSaturationAttr¶
【Description】
Set color saturation property parameters
【Syntax】
CVI_S32 CVI_ISP_SetCCMSaturationAttr (VI_PIPE ViPipe, const ISP_CCM_SATURATION_ATTR_S * pstCCMSaturationAttr);
【Parameter】
参数名称 |
Description |
Input / Output |
---|---|---|
ViPipe |
VI_PIPE number |
Input |
pstCCMSaturationAttr |
Color saturation attribute parameter |
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】
11.2.4. CVI_ISP_GetCCMSaturationAttr¶
【Description】
Get color saturation property parameters
【Syntax】
CVI_S32 CVI_ISP_GetCCMSaturationAttr (VI_PIPE ViPipe, const ISP_CCM_SATURATION_ATTR_S * pstCCMSaturationAttr);
【Parameter】
参数名称 |
Description |
Input / Output |
---|---|---|
ViPipe |
VI_PIPE number |
Input |
pstCCMSaturationAttr |
Color saturation attribute parameter |
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】
11.3. Data Types¶
ISP_COLORMATRIX_ATTR_S : Color correction matrix
ISP_CCM_MANUAL_ATTR_S : Color correction matrix attribute manual parameters
ISP_CCM_AUTO_ATTR_S : Color correction matrix attribute automatic parameter
ISP_CCM_ATTR_S : Color correction matrix attribute parameters
ISP_CCM_SATURATION_MANUAL_ATTR_S : Color saturation attribute manual parameter
ISP_CCM_SATURATION_AUTO_ATTR_S : Color saturation attribute automatic parameter
ISP_CCM_SATURATION_ATTR_S : Color saturation attribute parameter
11.3.1. ISP_COLORMATRIX_ATTR_S¶
【Description】
Color correction matrix
【Syntax】
typedef struct _ISP_COLORMATRIX_ATTR_S {
CVI_U16 ColorTemp;
CVI_S16 CCM[9];
} ISP_COLORMATRIX_ATTR_S;
【Member】
Member |
Description |
---|---|
ColorTemp |
the color temperature of the color correction matrix; Value range: [0x1f4, 0x7530] Data type: CVI_U16 |
CCM[9] |
Actual content of 3x3 color correction matrix; Value range: [0x-2000, 0x1fff] Data type: CVI_S16 |
【Note】
None.
【Related Data Type and Interface】
11.3.2. ISP_CCM_MANUAL_ATTR_S¶
【Description】
Color correction matrix attribute manual parameters.
【Syntax】
typedef struct _ISP_CCM_MANUAL_ATTR_S {
CVI_U8 SatEnable;
CVI_S16 CCM[9];
} ISP_CCM_MANUAL_ATTR_S;
【Member】
Member |
Description |
---|---|
SatEnable |
In manual mode, whether saturation is enabled. Value range: [0, 1] Data type: CVI_BOOL |
CCM[9] |
Value range: [0x-2000, 0x1fff] Data type: CVI_S16 |
【Note】
None.
【Related Data Type and Interface】
11.3.3. ISP_CCM_AUTO_ATTR_S¶
【Description】
Color correction matrix attribute automatic parameter
【Syntax】
typedef struct _ISP_CCM_AUTO_ATTR_S {
CVI_U8 ISOActEnable;
CVI_U8 TempActEnable;
CVI_U8 CCMTabNum;
ISP_COLORMATRIX_ATTR_S CCMTab[7];
} ISP_CCM_AUTO_ATTR_S;
【Member】
Member |
Description |
---|---|
ISOActEnable |
CCM Bypass function is enabled under low illumination. 0: close. 1: Enable. Value range: [0, 1] Data type: CVI_BOOL |
TempActEnable |
CCM bypass function is enabled at high and low color temperatures. 0: close. 1: Enable. Value range: [0, 1] Data type: CVI_BOOL |
CCMTabNum |
the number of CCM matrices currently configured. Value range: [0x3, 0x7] Data type: CVI_U8 |
CCMTab |
Color correction matrix under different color temperature |
【Note】
None.
【Related Data Type and Interface】
11.3.4. ISP_CCM_ATTR_S¶
【Description】
Color correction matrix attribute parameters
【Syntax】
typedef struct _ISP_CCM_ATTR_S {
CVI_BOOL Enable;
ISP_OP_TYPE_E enOpType;
CVI_U8 UpdateInterval;
ISP_CCM_MANUAL_ATTR_S stManual;
ISP_CCM_AUTO_ATTR_S stAuto;
} ISP_CCM_ATTR_S;
【Member】
Member |
Description |
---|---|
Enable |
CCM module is enabled. 0: close. 1: Enable. Value range: [0, 1] Data type: CVI_BOOL |
enOpType |
Select 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 |
stAuto |
Automatic parameters |
stManual |
Manual parameters |
【Note】
None.
【Related Data Type and Interface】
11.3.5. ISP_CCM_SATURATION_MANUAL_ATTR_S¶
【Description】
Color saturation attribute manual parameter
【Syntax】
typedef struct _ISP_CCM_SATURATION_MANUAL_ATTR_S {
CVI_U8 SaturationLE;
CVI_U8 SaturationSE;
} ISP_CCM_SATURATION_MANUAL_ATTR_S;
【Member】
Member |
Description |
---|---|
SaturationLE |
long exposure saturation Value range: [0, 0xff] Data type: CVI_U8 |
SaturationSE |
short exposure saturation Value range: [0, 0xff] Data type: CVI_U8 |
【Note】
None.
【Related Data Type and Interface】
11.3.6. ISP_CCM_SATURATION_AUTO_ATTR_S¶
【Description】
Color saturation attribute automatic parameter
【Syntax】
typedef struct _ISP_CCM_SATURATION_AUTO_ATTR_S {
CVI_U8 SaturationLE[ISP_AUTO_ISO_STRENGTH_NUM];
CVI_U8 SaturationSE[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_CCM_SATURATION_AUTO_ATTR_S;
【Member】
Member |
Description |
---|---|
SaturationLE |
long exposure saturation Value range: [0, 0xff] Data type: CVI_U8 |
SaturationSE |
short exposure saturation Value range: [0, 0xff] Data type: CVI_U8 |
【Note】
None.
【Related Data Type and Interface】
11.3.7. ISP_CCM_SATURATION_ATTR_S¶
【Description】
Color saturation attribute parameter
【Syntax】
typedef struct _ISP_CCM_SATURATION_ATTR_SS {
ISP_CCM_SATURATION_MANUAL_ATTR_S stManual;
ISP_CCM_SATURATION_AUTO_ATTR_S stAuto;
} ISP_CCM_SATURATION_ATTR_S;
【Member】
Member |
Description |
---|---|
stManual |
manual parameters |
stAuto |
automatic parameters |
【Note】
None.
【Related Data Type and Interface】