5. AWB¶
5.1. Overview¶
color temperaturewithcanseelight spectrumbecomepartchangeandchange, inlowcolor temperaturelight sourceunder, whitecolorobjectbiasred, inheightcolor temperaturelight sourceunder, whitecolorobjectbiasblue. human visioncanaccording tolargebrain memorydetermine, recognitionobject actualcolor, AWB algorithmfunctionisdecreaselowoutsideboundarylight sourceforobjectactualcolor affects, makeobtainwecapture colorinformationrotatechangeisinidealdaylightlight sourceunder Nonecolor castinformation
5.2. Key Concepts¶
color temperature: color temperatureisaccording toabsoluteforblackbodytoDefine , light source radiationincanseeregionandabsoluteforblackbody radiationcompleteallrelativeat the same time, thiswhenblackbody temperaturedegreethennamethislight source color temperature.
white balance: indifferentcolor temperature light sourceunder, whitecolorinpasssensedevicein responsewillbiasblueorbiasred. white balancealgorithmthroughAdjustR, G, B threecolorchannel strength, makewhitecoloractualappearscurrent.
5.3. Functional Description¶
AWB modulehavehardware WB informationsystemstatisticalmoduleand AWB strategyControlalgorithm firmware twopartconsists of.
ISP WB informationsystemstatisticalmoduledetermine sensor output each pixelwhetherfullsufficientusersettings white pointcondition, calculateallfullsufficientcondition pixel R, G, B threecolorchannelaveragevalue.
itssupportwillimagepartbecome M*N (M line N column) region, systemstatisticaleachregion R, G, B averagevalueandparameterandsystemstatistical white pointnumber, alsosupportoutputwhole imageimage R, G, B averagevalueandparameterandsystemstatistical white pointnumber.
AWB Operating Principlesuch as Figure 5.1 as shown
Figure 5.1 AWB Operating PrincipleFigure¶
5.4. API Reference¶
5.4.1. AWBlibrary interface¶
all AWB library interfaceallonlyisfor CVI AWB library, ifcustomeruserownimplement AWB library, notneed tomanagethissomeinterface, at the same timealsocannotusethissomeinterface.
CVI_AWB_Register : to ISP Register AWB library.
CVI_AWB_UnRegister : to ISP Unregister AWB library.
CVI_AWB_SensorRegCallBack : sensor registration callback interface provided by the AWB library
CVI_AWB_SensorUnRegCallBack : sensor unregistration callback interface provided by the AWB library
5.4.1.1. CVI_AWB_Register¶
[Description]
to ISP Register AWB library.
[Syntax]
CVI_S32 CVI_AWB_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAwbLib |
AWB algorithm librarystructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure,See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
theinterfacecall ISP libraryprovide AWB Registercallback interface CVI_ISP_AWBLibRegCallBack , to implement AWB to ISP libraryRegister function.
This interface does not support multiprocess operation.
[Example]
None.
[Related Topics]
None.
5.4.1.2. CVI_AWB_UnRegister¶
[Description]
to ISP unregister AWB library.
[Syntax]
CVI_S32 CVI_AWB_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAwbLib |
AWB algorithm librarystructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
theinterfacecall ISP libraryprovide AWB unregistercallback interface CVI_ISP_AWBLibUnRegCallBack , to implement AWB to ISP libraryunregister function.
This interface does not support multiprocess operation.
This interface is not currently supported on the dual-system SDK linux side.
[Example]
None.
[Related Topics]
None.
5.4.1.3. CVI_AWB_SensorRegCallBack¶
[Description]
sensor registration callback interface provided by the AWB library.
[Syntax]
CVI_S32 CVI_AWB_SensorRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib, ISP_SNS_ATTR_INFO_S *pstSnsAttrInfo, AWB_SENSOR_REGISTER_S *pstRegister);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAeLib |
AWB algorithm librarystructure pointer |
Input |
pstSnsAttrInfo |
to AWB Register Sensor attribute |
Input |
pstRegister |
Sensor Registerstructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
SensorId is sensor libraryincustom value, mainlyuseincalibrateforto ISP Register sensor andto 3A Register sensor whetherissameone sensor.
AWB through sensor Register onesystemcolumncallback interface, Getdifferencetransform Initializeparameternumber, andControlsensor.
This interface does not support multiprocess operation.
Figure 5.2 AWB libraryand sensor libraryinterval interface¶
[Example]
None.
[Related Topics]
None.
5.4.1.4. CVI_AWB_SensorUnRegCallBack¶
[Description]
AWB libraryprovide sensor unregister callback interface.
[Syntax]
CVI_S32 CVI_AWB_SensorUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAwbLib, SENSOR_ID SensorId);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAwbLib |
AWB algorithm librarystructure pointer |
Input |
SensorId |
to AWB unregister Sensor Id |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
SensorId is sensor libraryincustom value, mainlyuseincalibrateforto ISP Register sensor andto 3A Register sensor whetherissameone sensor.
This interface does not support multiprocess operation.
[Example]
None.
[Related Topics]
None.
5.4.2. AWB control module¶
CVI_ISP_SetWBAttr : Setwhite balanceattribute.
CVI_ISP_GetWBAttr : Getwhite balanceattribute.
CVI_ISP_SetAWBAttrEx : Setwhite balanceextensionattribute.
CVI_ISP_GetAWBAttrEx : Getwhite balanceextensionattribute.
CVI_ISP_QueryWBINfo : Getcurrentwhite balancegainsystemnumber, detectioncolor temperature, saturationvalue, colorcorrectionmatrixsystemnumber.
CVI_ISP_SetAWBLogPath : useCVI Awb lib when,storeAWB Debuglog path.
CVI_ISP_SetAWBLogName : useCVI Awb lib when,storeAWB Debuglog name.
CVI_ISP_GetGrayWorldAwbInfo : GetgrayworldboundaryWBinformation.
5.4.2.1. CVI_ISP_SetWBAttr¶
[Description]
Setwhite balanceattribute.
[Syntax]
CVI_S32 CVI_ISP_SetWBAttr(VI_PIPE ViPipe, const ISP_WB_ATTR_S *pstWBAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstWBAttr |
white balanceattributestructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
white balanceControltypeisautomaticwhen, AWB algorithmautomaticAdjustwhite balancesystemnumber.
white balanceControltypeismanualwhen, AWB algorithminvalid, needselflinesettings Rgain, Ggain, Bgain.
environmentcolor temperature, illuminancewillaffectswhite point partdistributionrange, CVI AWB algorithminRunprocessin, willaccording toenvironmentparameternumberautomaticrefreshnew AWB Byaer domainstatistical information white pointparameternumber. userwantin CVI AWB algorithmRunwhenmodify AWBsystemstatisticalparameternumber, need tocall CVI_ISP_SetWBAttrinterface, Disablesystemstatisticalparameternumberautomaticrefreshnewfunction. userDisablesystemstatisticalparameternumberautomaticrefreshnewfunction, to ISP receivetoconfigurationandresponse, have 2frame delaywhen. becausethis, userSetafterneed toetc.pending 2framewhenintervalagainmodify AWB systemstatisticalparameternumber.
[Example]
None.
[Related Topics]
5.4.2.2. CVI_ISP_GetWBAttr¶
[Description]
Getwhite balanceattribute.
[Syntax]
CVI_S32 CVI_ISP_GetWBAttr(VI_PIPE ViPipe, ISP_WB_ATTR_S *pstWBAttr);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstWBAttr |
white balanceattributestructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
None.
[Example]
None.
[Related Topics]
5.4.2.3. CVI_ISP_SetAWBAttrEx¶
[Description]
Setwhite balanceextensionattribute.
[Syntax]
CVI_S32 CVI_ISP_SetAWBAttrEx(VI_PIPE ViPipe, const ISP_AWB_ATTR_EX_S *pstAWBAttrEx);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
PstAWBAttrEx |
extensionwhite balanceattributestructure pointer |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
when CVI_ISP_SetWBAttr interfaceMembers pstWBAttr->enAlgType is AWB_ALG_ADVANCEwhen, thisinterfaceonly thenvalid.
[Example]
None.
[Related Topics]
5.4.2.4. CVI_ISP_GetAWBAttrEx¶
[Description]
Getwhite balanceextensionattribute.
[Syntax]
CVI_S32 CVI_ISP_GetAWBAttrEx(VI_PIPE ViPipe, ISP_AWB_ATTR_EX_S *pstAWBAttrEx);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
pstAWBAttrEx |
extendReturnextendwhite balanceattributestructure pointer |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
None.
[Example]
None.
[Related Topics]
5.4.2.5. CVI_ISP_QueryWBInfo¶
[Description]
Getcurrentwhite balancegainsystemnumber, detectioncolor temperature, saturationvalue, colorcorrectionmatrixsystemnumber.
[Syntax]
CVI_S32 CVI_ISP_QueryWBInfo(VI_PIPE ViPipe, ISP_WB_INFO_S *pstWBInfo);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipe No. |
Input |
PstWBInfo |
colorrelatedstatusparameternumber |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
None.
[Example]
None.
[Related Topics]
None.
5.4.2.6. CVI_ISP_SetAWBLogPath¶
[Description]
useCVI Awb lib when, storeAWB Debuglog path.
[Syntax]
CVI_S32 CVI_ISP_SetAWBLogPath(const char *szPath)
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
szPath |
Debuglogpath |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
Defaultpathis /var/log
[Example]
None.
[Related Topics]
None.
5.4.2.7. CVI_ISP_SetAWBLogName¶
[Description]
useCVI Awb lib when,storeAWB Debuglog filename.
[Syntax]
CVI_S32 CVI_ISP_SetAWBLogName(const char *szName)
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
szName |
documentcomponentname |
Input |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
presetdocumentcomponentnameisAwbLog0.txt
[Example]
None.
[Related Topics]
None.
5.4.2.8. CVI_ISP_GetGrayWorldAwbInfo¶
[Description]
GetgraydegreeworldboundaryWBinformation.
[Syntax]
CVI_S32 CVI_ISP_GetGrayWorldAwbInfo(VI_PIPE ViPipe, CVI_U16 *pRgain, CVI_U16 *pBgain);
[Parameters]
Parameter Name |
Description |
Input/Output |
|---|---|---|
ViPipe |
ViPipeNo. |
Input |
pRgain |
Rchannel gain |
output |
pBgain |
Bchannel gain |
output |
[Return Value]
Return Value |
Description |
|---|---|
0 |
Success. |
Non-zero |
Failure, See Error Code. |
[Requirements]
Header File: cvi_awb.h
Library File: libawb.a
[Note]
None.
[Example]
None.
[Related Topics]
None.
5.5. Data Types¶
5.5.1. Register¶
AWB_SENSOR_REGISTER_S : Define sensor Registerstructure.
AWB_SENSOR_EXP_FUNC_S : Define sensor callback functionstructure.
AWB_SENSOR_DEFAULT_S : Define AWB algorithm library Initializeparameternumberstructure.
AWB_SPEC_SENSOR_DEFAULT_S : Define SPECAWB algorithm Initializeparameternumberstructure.
AWB_AGC_TABLE_S : Define saturationInitializeparameternumberstructure.
AWB_CCM_TAB_S : Define differentunder the color temperatureautomaticcolorcorrectionmatrixsystemnumber.
AWB_CCM_S : Define CCM colorcorrectionmatrixattribute.
5.5.2. WB¶
ISP_AWB_ATTR_S : Define ISP automaticwhite balanceattribute.
ISP_AWB_CBCR_TRACK_ATTR_S : Define Bayer domainstatistical information linkmoveparameternumber.
ISP_AWB_LUM_HISTGRAM_ATTR_S : Define white balance brightnesshistogramFiguresystemstatisticalparameternumber.
ISP_AWB_ALG_E : Define white balance calculatemethodattribute.
ISP_AWB_CT_LIMIT_ATTR_S : Define white balancegainrangelimitattribute.
ISP_MWB_ATTR_S : Define ISP manualwhite balanceattribute.
ISP_WB_ATTR_S : Define white balanceattribute.
ISP_AWB_ALG_TYPE_E : Define AWBalgorithmattribute.
ISP_AWB_ATTR_EX_S : Automatic Definitionwhite balanceextensionattribute.
ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S : Define independentlight sourcepoint information.
ISP_AWB_IN_OUT_ATTR_S : forsceneoperationindoorinsideoutside determineset.
ISP_AWB_MULTI_LS_TYPE_E : Define blendlight sourceunder AWB strategytype.
ISP_AWB_INDOOR_OUTDOOR_STATUS_E : Define AWBindoorinsideindooroutsidestatus.
ISP_WB_INFO_S : Define white balance, saturation, colorcorrectioninformation.
5.5.2.1. ISP_MWB_ATTR_S¶
[Description]
Manual DefinitionWB
[Definition]
typedef struct _ISP_MWB_ATTR_S {
CVI_U16 u16Rgain;
CVI_U16 u16Grgain;
CVI_U16 u16Gbgain;
CVI_U16 u16Bgain;
} ISP_MWB_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
u16Rgain |
MWB when R channel gain |
u16Grgain |
MWB when Gr channel gain |
u16Grgain |
MWB when Gb channel gain |
u16Bgain |
MWB when B channel gain |
[Precautions]
RGBchannel gainonexis0x400
[Related Data Types and Interfaces]
None.
5.5.2.2. ISP_AWB_CT_LIMIT_ATTR_S¶
[Description]
Define white balancegainrangelimitattribute
[Definition]
typedef struct _ISP_AWB_CT_LIMIT_ATTR_S {
CVI_BOOL bEnable;
ISP_OP_TYPE_E enOpType;
CVI_U16 u16HighRgLimit;
CVI_U16 u16HighBgLimit;
CVI_U16 u16LowRgLimit;
CVI_U16 u16LowBgLimit;
} ISP_AWB_CT_LIMIT_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
white balancegainrangelimitopenclose |
enOpType |
automaticormanualsettingsselfflatbalancegainrange |
u16HighRgLimit |
manual modeunderheightunder the color temperature maximumRgain |
u16HighBgLimit |
manual modeunderheightunder the color temperature minimumBgain |
u16LowRgLimit |
manual modeunderlowunder the color temperature minimumRgain |
u16LowBgLimit |
manual modeunderlowunder the color temperature maximumBgain |
[Precautions]
automatic modeunderAWBalgorithmwillowncalculateonunderlimitgainvalue,whenswitchismanual modewhen,willuseondescribefourR.B gain limitvalue
onexgainis0x400
[Related Data Types and Interfaces]
None.
5.5.2.3. ISP_AWB_ALG_E¶
[Description]
Define AWB algorithmtypeother
[Definition]
typedef enum _ISP_AWB_ALG_E {
ALG_AWB,
ALG_AWB_SPEC,
ALG_BUTT
} ISP_AWB_ALG_E;
[Members]
Member Name |
Description |
|---|---|
AWB |
Generally AWB algorithmReturn |
ALG_AWB_SPEC |
basein machine learning AWB algorithm, currentlynot supported. |
[Precautions]
None.
[Related Data Types and Interfaces]
None.
5.5.2.4. ISP_AWB_ATTR_S¶
[Description]
Automatic DefinitionWBattribute
[Definition]
typedef struct _ISP_AWB_ATTR_S {
CVI_BOOL bEnable;
CVI_U16 u16RefColorTemp;
CVI_U16 au16StaticWB[ISP_BAYER_CHN_NUM];
CVI_S32 as32CurvePara[AWB_CURVE_PARA_NUM];
ISP_AWB_ALG_TYPE_E enAlgType;
CVI_U8 u8RGStrength;
CVI_U8 u8BGStrength;
CVI_U16 u16Speed;
CVI_U16 u16ZoneSel;
CVI_U16 u16HighColorTemp;
CVI_U16 u16LowColorTemp;
ISP_AWB_CT_LIMIT_ATTR_S stCTLimit;
CVI_BOOL bShiftLimitEn;
CVI_U16 u16ShiftLimit[AWB_CURVE_BOUND_NUM];
CVI_BOOL bGainNormEn;
CVI_BOOL bNaturalCastEn;
ISP_AWB_CBCR_TRACK_ATTR_S stCbCrTrack;
ISP_AWB_LUM_HISTGRAM_ATTR_S stLumaHist;
CVI_BOOL bAWBZoneWtEn;
CVI_U8 au8ZoneWt[AWB_ZONE_ORIG_ROW * AWB_ZONE_ORIG_COLUMN];
} ISP_AWB_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
automaticwhite balancealgorithmopenclose |
u16RefColorTemp |
static white balance light sourcecolor temperaturevalue,Recommended:5000Klampsource |
au16StaticWB |
staticwhite balancesystemnumber, byAWB calibrationprovided by the tool. Return Value Range: [0, 0x3FFF]. |
as32CurvePara |
CurvePara[0-2] Planckcurvesystemnumber, byAWB calibrationprovided by the tool. PlanckcurvedrawwhitecolorblockReturn indifferentcolor temperature standardlight sourceunder colortablecurrent. CurvePara[3-5] color temperaturecurvesystemnumber, byAWBcalibrationprovided by the tool. color temperaturecurvedraw draw whitecolorblock colortablecurrentandcolor temperature correspondingclosesystem. |
enAlgType |
AWBalgorithmtypeotherselect, AWB_ALG_LOWCOST,AWB_ALG_ADVANCEtwokind ISP_AWB_ATTR_EX_S extensionattributeonlyhaveinAWB_ALG_ADVANCEonly thenhaveoperationuse |
u8RGStrength |
automaticwhite balanceRchannelcalibratestrength. Value Range: [0, 255] |
u8BGStrength |
automaticwhite balanceBchannelcalibratestrength. Value Range: [0, 255] |
u16Speed |
automaticwhite balancealgorithmconvergencespeed. Value Range: [0, 4095] |
u16ZoneSel |
parameternumber is0or255when,captureusenearsimilargrayworldboundary white balancecalculate method,othervaluethenisperformparttypefilterselect,raiseincreaseprecision |
u16HighColorTemp |
automaticwhite balancealgorithm color temperatureupper limit. Value Range: [8000, 10000] |
u16LowColorTemp |
automaticwhite balancealgorithm under the color temperaturelimit. Value Range: [0x0, u8HighColorTemp) |
stCTLimit |
manualorautomaticlimitwhite balancegainvalue |
bShiftLimitEn |
AWBexceedthroughtypewhite pointrangegainmapmap backwhite pointrange openclose |
u16ShiftLimit |
AWB calculatewhite pointrangeparameternumber |
bGainNormEn |
for RGB channel gainperformReturn limit, canimprovelowcolor temperature, lowilluminancescene signalnoiseratio,presetopenenable |
bNaturalCastEn |
lowunder the color temperatureAWBstyle preferencegoodopenclose. presetDisable |
stCbCrTrack |
AWBsystemstatisticalrangeandISO continuousmoveparameternumber |
stLumaHist |
AWBbrightnessandweightparameternumber |
bAWBZoneWtEn |
imagepartregionweightopenclose,presetisDisable |
au8ZoneWt |
32x32imageweight,Value Range[0,0xFF] (Not implemented yet)Return |
[Precautions]
None.
[Related Data Types and Interfaces]
None.
5.5.2.5. ISP_AWB_ALG_TYPE_E¶
[Description]
Define AWBalgorithmattribute
[Definition]
typedef enum _ISP_AWB_ALG_TYPE_E {
AWB_ALG_LOWCOST,
AWB_ALG_ADVANCE,
AWB_ALG_BUTT
} ISP_AWB_ALG_TYPE_E;
[Members]
Member Name |
Description |
|---|---|
AWB_ALG_LOWCOST |
simpleeasylowoperationamount AWBalgorithm |
AWB_ALG_ADVANCE |
enterextended level extendAWBalgorithm,andISP_AWB_ATTR_EX_Srelated |
AWB_ALG_BUTT |
invalidsettingsvalueReturn |
[Precautions]
None.
[Related Data Types and Interfaces]
5.5.2.6. ISP_AWB_CBCR_TRACK_ATTR_S¶
[Description]
Define AWBsystemstatisticalrangeandISO continuousmoveparameternumber
[Definition]
typedef struct _ISP_AWB_CBCR_TRACK_ATTR_S {
CVI_BOOL bEnable;
CVI_U16 au16CrMax[ISP_AUTO_ISO_STRENGTH_NUM];
CVI_U16 au16CrMin[ISP_AUTO_ISO_STRENGTH_NUM];
CVI_U16 au16CbMax[ISP_AUTO_ISO_STRENGTH_NUM];
CVI_U16 au16CbMin[ISP_AUTO_ISO_STRENGTH_NUM];
} ISP_AWB_CBCR_TRACK_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
AWBsystemstatisticalrangeandISO continuousmoveopenclose |
au16CrMax |
differentISOunderR/Gmaximum value |
au16CrMin |
differentISOunderR/Gminimum value |
au16CbMax |
differentISOunderB/Gmaximum value |
au16CbMin |
differentISOunderB/Gminimum value |
[Precautions]
recommendedinlowunder the color temperaturecalibrationCrMax(R/G),CbMin(B/G)
[Related Data Types and Interfaces]
None.
5.5.2.7. ISP_AWB_LUM_HISTGRAM_ATTR_S¶
[Description]
Define AWBbrightnessandweightparameternumber
[Definition]
typedef struct _ISP_AWB_LUM_HISTGRAM_ATTR_S {
CVI_BOOL bEnable;
ISP_OP_TYPE_E enOpType;
CVI_U8 au8HistThresh[AWB_LUM_HIST_NUM];
CVI_U16 au16HistWt[AWB_LUM_HIST_NUM];
} ISP_AWB_LUM_HISTGRAM_ATTR_S;
macro definitionsuch asunder
#define AWB_LUM_HIST_NUM (6)
[Members]
Member Name |
Description |
|---|---|
bEnable |
differentbrightnesswhetheropenenableweight,presetopenenable |
enOpType |
automatic mode:AWBautomaticpartmatchweight manual mode:usercanselflinesettingsbrightnessparttypeandweight |
au8HistThresh |
brightnessparttype threshold(manual modeundervalid) |
au16HistWt |
brightnessparttype weight(manual modeundervalid) |
[Precautions]
au8HistThresh[0] fixedis0,au8HistThresh[5]fixedis255.
au8HistThresh[i+1]mustlargeinau8HistThresh[i];
au16HistWt weightrangeis32~512
[Related Data Types and Interfaces]
None.
5.5.2.8. ISP_WB_ATTR_S¶
[Description]
Define white balanceattribute
[Definition]
typedef struct _ISP_WB_ATTR_S {
CVI_BOOL bByPass;
CVI_U8 u8AWBRunInterval;
ISP_OP_TYPE_E enOpType;
ISP_MWB_ATTR_S stManual;
ISP_AWB_ATTR_S stAuto;
ISP_AWB_ALG_E enAlgType;
CVI_U8 u8DebugMode;
} ISP_WB_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
bByPass |
white balancemoduleBypassEnable, Default Value CVI_FALSE. Return |
u8AWBRunInterval |
white balancemoduleworkoperationfrequency. Value Range: [0x1, 0xFF] |
enOpType |
automaticwhite balanceandmanualwhite balanceswitch. |
stManual |
manual parameters |
stAuto |
automatic parameters |
enAlgType |
AWB algorithmtypeotherReturn |
u8DebugMode |
Debug whenuse, Generallynotneedsettings |
[Precautions]
bByPassisTRUEwhen,WBotherparameternumbersettingsnottakes effect,RGBchannel gainfixedisonex0x400
u8AWBRunIntervalThe default value is6,indicateseach6frameexecutelineonetimeAWB,canaccording toRequirementsincreasethisvalues,makeAWBRunfrequencydecreaselow
[Related Data Types and Interfaces]
None.
5.5.2.9. ISP_AWB_ATTR_EX_S¶
[Description]
Automatic Definitionwhite balanceextensionattribute
[Definition]
typedef struct _ISP_AWB_ATTR_EX_S {
CVI_U8 u8Tolerance;
CVI_U8 u8ZoneRadius;
CVI_U16 u16CurveLLimit;
CVI_U16 u16CurveRLimit;
CVI_BOOL bExtraLightEn;
ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S stLightInfo[AWB_LS_NUM];
ISP_AWB_IN_OUT_ATTR_S stInOrOut;
CVI_BOOL bMultiLightSourceEn;
ISP_AWB_MULTI_LS_TYPE_E enMultiLSType;
CVI_U16 u16MultiLSScaler;
CVI_U16 au16MultiCTBin[AWB_CT_BIN_NUM];
CVI_U16 au16MultiCTWt[AWB_CT_BIN_NUM];
CVI_BOOL bFineTunEn;
CVI_U8 u8FineTunStrength;
//AWB Algo 6
struct ST_ISP_AWB_INTERFERNCE_S stInterfernce;
struct ST_ISP_AWB_SKIN_S stSkin;
struct ST_ISP_AWB_SKY_S stSky;
struct ST_ISP_AWB_GRASS_S stGrass;
struct ST_ISP_AWB_CT_WGT_S stCtLv;
struct ST_ISP_AWB_SHIFT_LV_S stShiftLv;
struct ST_ISP_AWB_REGION_S stRegion;
CVI_U8 adjBgainMode;
} ISP_AWB_ATTR_EX_S;
// 宏定义如下:
#define AWB_CT_BIN_NUM (8)
#define AWB_LS_NUM (4)
[Members]
Member Name |
Description |
|---|---|
u8Tolerance |
AWBAdjust biasdifferenceReturn range, errordifferenceinthisrangeinsidewhen,AWBnotperformAdjust |
u8ZoneRadius |
AWBsystemstatisticalvaluepartregion largesmall. thethe smaller the value,AWB precisionthe moreheight,butwilldecreaselow AWB algorithmstableproperty |
u16CurveLLimit |
AWBcolor temperaturecurveReturn leftedgeboundarylimit(R/G,B/G), Value Range: [0x0, 0x200] |
u16CurveRLimit |
AWBcolor temperaturecurve rightedgeboundarylimit(R/G,B/G),range: [0x200, 0x3FF] |
bExtraLightEn |
whetheropenenableindependentlight source |
stLightInfo |
AWBcalculatewhenwhetherconsidercolor temperaturecurveoutside independentlight sourcepoint,mostmultiplefourindependentpoint |
stInOrOut |
AWBforsceneperformindoorinsideoutsidedetermine parameternumber |
bMultiLightSourceEn |
AWBdetectioncurrentsceneReturn scenewhetherisblendlight source,toAdjustsaturationorCCM |
enMultiLSType |
AdjustsaturationorisCCM |
u16MultiLSScaler |
whenblendlight sourceunderAdjustsaturationorCCM strength |
au16MultiCTBin |
color temperaturepartsegmentparameternumber,mustispassincreaseordercolumn |
au16MultiCTWt |
color temperaturepartsegmentweight,range: [0x0, 0x400] |
bFineTunEn |
AWBspecialcolordetectionopenclose, For exampleskincolor |
u8FineTunStrength |
skincolor, blueetc.specialcolordetection strength |
[Precautions]
ISP_AWB_ATTR_EX_S extensionattributeonlyhavein pstWBAttr->enAlgType isAWB_ALG_ADVANCEonly thenhaveoperationuse
u8ToleranceisAWB sensitivedegreeparameternumber,valueis0when,AWBparameternumberwillreal-timemorenew,valueratiorelativelylargewhen,environmentcolor temperatureslightslightchangewhenandnotwillmorenewAWBparameternumber,imagewilllightslight color cast,recommendeduseroutsideis0,indoorinsideSetis2
u16CurveLLimit value<512,mainlyisexcludegreenobject, u16CurveRLimitvalue>512,isexcludebiaspurplecolorregion
bMultiLightSourceEn openenableafter,AWBwilldeterminescenewhetherismixlight source,inthisform sceneunderwilldecreaselowsaturationorisCCM,usingreducelesscolor cast
WDRmodeunderwillautomaticDisablemixlight sourcedetectionfunction
[Related Data Types and Interfaces]
None.
5.5.2.10. ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S¶
[Description]
Define independentlight sourcepoint parameternumber
[Definition]
typedef struct _ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S {
CVI_U16 u16WhiteRgain;
CVI_U16 u16WhiteBgain;
CVI_U16 u16ExpQuant;
CVI_U8 u8LightStatus;
CVI_U8 u8Radius;
} ISP_AWB_EXTRA_LIGHTSOURCE_INFO_S;
[Members]
Member Name |
Description |
|---|---|
u16WhiteRgain |
speciallight sourcepoint Rchannel gain |
u16WhiteBgain |
speciallight sourcepoint Bchannel gain |
u16ExpQuant |
according tooutsideinbrightnessperformdetermine. ExpQuant isopenenable brightnesslimitvalue For example ExpQuant = 6, indicatesLV6usingunderReturn openenablethisWBlight sourcepoint(Generallynight sceneisLV6usingunder) ExpQuant =106 indicatesLV6usingonopenenable ExpQuant =112 indicatesLV12usingonopenenable(LV12Generallyisuseroutside) |
u8LightStatus |
speciallight sourcepoint kindtype, 0:No operation 1:include the light-source point in the return value 2:remove calculations near the light-source point |
u8Radius |
speciallight sourcepoint regionlargesmall, Value Range: [0x0, 0xFF] |
[Precautions]
None.
[Related Data Types and Interfaces]
None.
5.5.2.11. ISP_AWB_IN_OUT_ATTR_S¶
[Description]
Define AWBforsceneperformuseroutsideindoorinsidedetermine parameternumber
[Definition]
typedef struct _ISP_AWB_IN_OUT_ATTR_S {
CVI_BOOL bEnable;
ISP_OP_TYPE_E enOpType;
ISP_AWB_INDOOR_OUTDOOR_STATUS_E enOutdoorStatus;
CVI_U32 u32OutThresh;
CVI_U16 u16LowStart;
CVI_U16 u16LowStop;
CVI_U16 u16HighStart;
CVI_U16 u16HighStop;
CVI_BOOL bGreenEnhanceEn;
CVI_U u8OutShiftLimit;
} ISP_AWB_IN_OUT_ATTR_S;
[Members]
Member Name |
Description |
|---|---|
bEnable |
determinesceneisindoorinsideindooroutside openclose |
enOpType |
determineindoorinsideindooroutside(automaticormanual) |
enOutdoorStatus |
indoorinsideorindooroutsidemode(manual modeunder) |
u32OutThresh |
determinesetindoorinsideindooroutside threshold, brightnesssmallinwhen,thendeterminesetisindoorinside,useroutsideLVlargemultipleexceedthrough 15 |
u16LowStart |
willlowcolor temperature weightReturn againstretchlow,lowcolor temperatureregion startpoint,Recommended:5000K |
u16LowStop |
willlowcolor temperature weightReturn stretchlow,lowcolor temperatureregion terminatepoint,Recommended:4500K, Value Range: (0,u16LowStart) |
u16HighStart |
will heightcolor temperature weightstretchlow,heightcolor temperatureregion startpoint, Recommended:6500K, Value Range: (u16LowStart, 0xFFFF] |
u16HighStop |
willheightcolor temperature weightReturn stretchlow,heightcolor temperatureregion terminatepoint,Recommended:8000K, Value Range: (u16HighStart, 0xFFFF] |
bGreenEnhanceEn |
in greenvegetationsceneunder,forgreenchannelincrease openclose |
u8OutShiftLimit |
whendetermineset isuseroutsidescenewhen,AWBalgorithm white pointrangelimit |
[Precautions]
useroutsidebrightnesslargemultipleLVlargein15theusingu32OutThresh Recommended:largein15
fourparameternumber Value Rangerequire: u16LowStop<u16LowStart<u16HighStart<u16HighStop
[Related Data Types and Interfaces]
such asunderFigure, u16LowStopis3800K, u16LowStartis5000K
u16HighStartis6200K, u16HighStopis7200K
Generallyweightis32,indooroutsidecolor temperaturemostheightweightis256
5.5.2.12. ISP_AWB_MULTI_LS_TYPE_E¶
[Description]
Define mixlight sourceunderAWB strategy
[Definition]
typedef enum _ISP_AWB_MULTI_LS_TYPE_E {
AWB_MULTI_LS_SAT,
AWB_MULTI_LS_CCM,
AWB_MULTI_LS_BUTT
} ISP_AWB_MULTI_LS_TYPE_E;
[Members]
Member Name |
Description |
|---|---|
AWB_MULTI_LS_SAT |
blendlight sourceunderAdjustsaturation |
AWB_MULTI_LS_CCM |
blendlight sourceunderAdjustCCM |
AWB_MULTI_LS_BUTT |
invalid |
[Precautions]
None.
[Related Data Types and Interfaces]
None.
5.5.2.13. ISP_AWB_INDOOR_OUTDOOR_STATUS_E¶
[Description]
Define AWBindoorinsideindooroutsidestatus
[Definition]
typedef enum _ISP_AWB_INDOOR_OUTDOOR_STATUS_E {
AWB_INDOOR_MODE,
AWB_OUTDOOR_MODE,
AWB_INDOOR_OUTDOOR_BUTT
} ISP_AWB_INDOOR_OUTDOOR_STATUS_E;
[Members]
Member Name |
Description |
|---|---|
AWB_INDOOR_MODE |
indoorinsidemode |
AWB_OUTDOOR_MODE |
indooroutsidemode |
AWB_INDOOR_OUTDOOR_BUTT |
invalid |
[Precautions]
None.
[Related Data Types and Interfaces]
None.
5.5.2.14. ISP_WB_INFO_S¶
[Description]
Define white balance, saturation, colorcorrectioninformation
[Definition]
typedef struct _ISP_WB_INFO_S {
CVI_U16 u16Rgain;
CVI_U16 u16Grgain;
CVI_U16 u16Gbgain;
CVI_U16 u16Bgain;
CVI_U16 u16Saturation;
CVI_U16 u16ColorTemp;
CVI_U16 au16CCM[CCM_MATRIX_SIZE];
CVI_U16 u16LS0CT;
CVI_U16 u16LS1CT;
CVI_U16 u16LS0Area;
CVI_U16 u16LS1Area;
CVI_U8 u8MultiDegree;
CVI_U16 u16ActiveShift;
CVI_U32 u32FirstStableTime;
ISP_AWB_INDOOR_OUTDOOR_STATUS_E enInOutStatus;
CVI_S16 s16Bv;
} ISP_WB_INFO_S;
[Members]
Member Name |
Description |
|---|---|
u16Rgain |
currentRchannel gainvalue |
u16Grgain |
currentGrchannel gainvalue |
u16Gbgain |
currentGbchannel gainvalue |
u16Bgain |
currentBchannel gainvalue |
u16Saturation |
currentlysaturationReturn |
u16ColorTemp |
currentlypushcalculate color temperaturevalue |
au16CCM |
current colorcorrectionmatrix, 10bitfractional precision. bit 15 issymbolNo.position, 0 indicatespositivenumber, 1 indicatesnegativenumber, For example0x8010table show-16 |
u16LS0CT |
mixlight sourcescene mainlight sourcecolor temperature |
u16LS1CT |
mixlight sourcescene timelight sourcecolor temperature |
u16LS0Area |
mixlight sourcescene mainlight sourcearea |
u16LS1Area |
mixlight sourcescene timelight sourcearea |
u8MultiDegree |
currentlysceneismixlight source machinerate |
u16ActiveShift |
currentlywhite balancerange limitvalue |
u32FirstStableTime |
firsttimeAWBconvergencestable wheninterval,usingframenumberas the unit |
ISP_AWB_INDOOR_OUTDOOR_STATUS_E |
indoorinsideindooroutsidedetectionresult |
s16Bv |
currentenvironment bvvalueReturn |
[Precautions]
None.
[Related Data Types and Interfaces]
None.