10. LSC¶
10.1. Functional Description¶
LSC, that isLens shading correction, lensshadowcorrection.
in cv184x systemcolumnin, LSCwillpartbecometwopart: oneisMLSC, that isMLSC (Mesh Lens shading correction) , mainlyusetocorrectionColor Shading. inprocessingdevicein LSC algorithmusegridmethodforimagefirstperformcalibration, thenaftercorrectpositive, algorithmwillwillBayeron domainimagedividepartbecome 37×37 subregionblock. Bayerdomainfourchannelbythreegroupdifferent RGBgainarraytoperformcalculate. byinonlyperformcoloron correction, theusingGenerallyGchannelgainkeeponex settings, that is512. whencalibrationMLSCgroupnumberismultiplegroupwhen, thenwillaccording tocurrent color temperatureselectoutputadjacentnear twocolor temperatureofMLSCcalibrationtableperforminterpolate, producecorrespondingcurrentcolor temperature MLSCgain. calibration groupnumberthenby LscGainLutSize parameternumberDefine of.
anotheroneisRLSC (Radius Lens shading correction) , mainlyusetocorrectionLuma Shading. inLSCalgorithmin, willusingimage brightnesscenteriscenter, eachpixelpointandcenterofinterval distanceisradius, performdifferentdegreebrightnesscompensation. Generallydistancebrightnesscenterthe morefar, compensationstrengththe morelarge.
thisinmainlyintroduceMLSC relatedAPIandnumberdatastructure, RLSC willinunderonechaptersectionintroduce.
10.2. API Reference¶
CVI_ISP_SetMeshShadingAttr : SetMesh Shadingalgorithm parameters
CVI_ISP_GetMeshShadingAttr : GetMesh Shadingalgorithm parameters
CVI_ISP_SetMeshShadingGainLutAttr : SetLSC grid-form compensation gain table
CVI_ISP_GetMeshShadingGainLutAttr : GetLSC grid-form compensation gain table
10.2.1. CVI_ISP_SetMeshShadingAttr¶
[Description]
SetMesh Shadingalgorithm parameters
[Syntax]
CVI_S32 CVI_ISP_SetMeshShadingAttr(VI_PIPE ViPipe, const ISP_MESH_SHADING_ATTR_S *pstMeshShadingAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
VI_PIPE No. |
Input |
pstMeshShadingAttr |
Mesh Shadingalgorithm parameters |
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_MESH_SHADING_ATTR_S stAttr;
CVI_ISP_GetMeshShadingAttr(ViPipe, &stAttr);
stAttr.enOpType = OP_TYPE_AUTO;
CVI_ISP_SetMeshShadingAttr(ViPipe, &stAttr);
[Related Topics]
10.2.2. CVI_ISP_GetMeshShadingAttr¶
[Description]
GetMesh Shadingalgorithm parameters
[Syntax]
CVI_S32 CVI_ISP_GetMeshShadingAttr(VI_PIPE ViPipe, ISP_MESH_SHADING_ATTR_S *pstMeshShadingAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
VI_PIPE No. |
Input |
pstMeshShadingAttr |
Mesh Shadingalgorithm parameters |
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]
10.2.3. CVI_ISP_SetMeshShadingGainLutAttr¶
[Description]
SetLSC grid-form compensation gain table
[Syntax]
CVI_S32 CVI_ISP_SetMeshShadingGainLutAttr(VI_PIPE ViPipe, const ISP_MESH_SHADING_GAIN_LUT_ATTR_S *pstMeshShadingGainLutAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
VI_PIPE No. |
Input |
pstMeshShadingGainLutAttr |
LSC grid-form compensation gain table |
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_MESH_SHADING_GAIN_LUT_ATTR_S stAttr;
CVI_ISP_GetMeshShadingGainLutAttr(ViPipe, &stAttr);
stAttr.enOpType = OP_TYPE_AUTO;
CVI_ISP_SetMeshShadingGainLutAttr(ViPipe, &stAttr);
[Related Topics]
10.2.4. CVI_ISP_GetMeshShadingGainLutAttr¶
[Description]
GetLSC grid-form compensation gain table
[Syntax]
CVI_S32 CVI_ISP_GetMeshShadingGainLutAttr(VI_PIPE ViPipe, ISP_MESH_SHADING_GAIN_LUT_ATTR_S *pstMeshShadingGainLutAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
VI_PIPE No. |
Input |
pstMeshShadingGainLutAttr |
LSC grid-form compensation gain table |
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]
10.3. Data Types¶
ISP_MESH_SHADING_ATTR_S : Define Mesh Shadingalgorithm parameters
ISP_MESH_SHADING_GAIN_LUT_ATTR_S : Define LSC grid-form compensation gain table
ISP_MESH_SHADING_GAIN_LUT_S : Define LSC gridlinear formcompensationgaintabledetailitem
10.3.1. ISP_MESH_SHADING_ATTR_S¶
[Description]
Define Mesh Shadingalgorithm parameters
[Definition]
typedef struct _ISP_MESH_SHADING_ATTR_S {
CVI_BOOL Enable; /*Rw; Range:[0, 1]*/
ISP_OP_TYPE_E enOpType;
CVI_U8 UpdateInterval; /*Rw; Range:[0, 255]*/
} ISP_MESH_SHADING_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 |
[Precautions]
None
[Related Data Types and Interfaces]
10.3.2. ISP_MESH_SHADING_GAIN_LUT_ATTR_S¶
[Description]
Define LSC grid-form compensation gain table
[Definition]
typedef struct _ISP_MESH_SHADING_GAIN_LUT_ATTR_S {
CVI_U8 Size; /*Rw; Range:[1, 7]*/
ISP_MESH_SHADING_GAIN_LUT_S LscGainLut[ISP_MLSC_COLOR_TEMPERATURE_SIZE];
} ISP_MESH_SHADING_GAIN_LUT_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
Size |
color temperatureadaptiveLSCcompensationgaintablequantity Value Range: [1, 7] Data Types: CVI_U8 |
LscGainLut |
LSC gridlinear formcompensationgaintable Data Types: ISP_MESH_SHADING_GAIN_LUT_S |
[Precautions]
None
[Related Data Types and Interfaces]
10.3.3. ISP_MESH_SHADING_GAIN_LUT_S¶
[Description]
Define LSC gridlinear formcompensationgaintabledetailitem
[Definition]
typedef struct _ISP_MESH_SHADING_GAIN_LUT_S {
CVI_U16 ColorTemperature; /*Rw; Range:[0, 30000]*/
CVI_U16 RGain[CVI_ISP_LSC_GRID_POINTS]; /*Rw; Range:[0, 4095]*/
CVI_U16 GGain[CVI_ISP_LSC_GRID_POINTS]; /*Rw; Range:[0, 4095]*/
CVI_U16 BGain[CVI_ISP_LSC_GRID_POINTS]; /*Rw; Range:[0, 4095]*/
} ISP_MESH_SHADING_GAIN_LUT_S;
[Members]
Member Name |
Description |
|---|---|
ColorTemperature |
color temperatureadaptiveLSCcompensationgaintablethecorrespondingofcolor temperature, unitis K Value Range: [0, 30000] Data Types: CVI_U16 |
RGain |
redcolorchannel gain Value Range: [0, 4095] Data Types: CVI_U16 |
GGain |
greenchannel gain Value Range: [0, 4095] Data Types: CVI_U16 |
BGain |
bluechannel gain Value Range: [0, 4095] Data Types: CVI_U16 |
[Precautions]
None
[Related Data Types and Interfaces]