4. AE¶
4.1. Overview¶
The function of the CVI AE module is to get the exposure of the current image according to the auto-metering system, and then automatically configure the lens aperture, sensor shutter and gain to obtain the best image quality.The main algorithms for automatic exposure are aperture priority, shutter priority and gain priority.
When the aperture is preferred, the algorithm will first adjust the aperture to the appropriate position, and then allocate the exposure time and gain to only fit the p-iris lens, which will balance the noise and depth of field.When shutter priority occurs, the algorithm assigns exposure time first, then sensor gain and ISP gain, so that the image noise taken is less.Gain priority is to assign sensor gain and ISP gain first, and then to assign exposure time, which is suitable for shooting scenes of moving objects.The current AE algorithm also supports clients to set more flexible exposure allocation strategies, and the workflow of the AE module is shown in Fig. 4.1 .

Fig. 4.1 AE module workflow diagram¶
4.2. Important Concept¶
Exposure time: The time when the sensor accumulates charge is the period from the beginning of the exposure of the sensor pixel to the time when the charge is read out.
Exposure gain: The total amplification factor of the sensor’s output charge generally has digital gain and analog gain. The noise introduced by analog gain is slightly smaller, so analog gain is generally preferred.
Aperture: Aperture is a mechanical device in the lens that can change the size of the middle hole.
Anti-flicker: Picture flicker caused by the mismatch between the power frequency of the lamp and the frame rate of the sensor. Anti-flicker effect is usually achieved by limiting the exposure time and modifying the frame rate of the sensor.
4.3. Function Overview¶
The AE module mainly consists of the AE statistical information module of ISP and the AE algorithm Firmware of AE control strategy. The AE statistical information module of ISP mainly provides brightness information statistics of sensor input data. The statistical information provided includes histogram and mean value. It also provides histogram and R/Gr/Gb/B four-component mean of 256 segments of the whole image. It also provides four-component mean R/Gr/Gb/B statistics of dividing the whole image into MxN blocks, each block, as shown in Fig. 4.2 .

Fig. 4.2 AE 256 statistical information histogram¶
The main working principle of AE algorithm is to obtain the statistical information of the input image and compare it with the set target brightness instantly, while dynamically adjusting the exposure time and gain of the sensor and the lens aperture size to achieve the actual brightness close to the set target brightness. Its working principle is shown in Fig. 4.3 .

Fig. 4.3 AE working principle¶
4.4. API Reference¶
4.4.1. AE Library Interface¶
All AE library interfaces are for CVI AE libraries only. If the client implements the AE libraries themselves, they do not need to be concerned about these interfaces, and they cannot be used.
CVI_AE_Register :Register AE library with ISP.
CVI_AE_UnRegister :Reverse registration of AE libraries with ISP.
CVI_AE_SensorRegCallBack : Callback interface for sensor registration provided by AE Library
CVI_AE_SensorUnRegCallBack : The sensor deregistered callback interface provided by the AE library.
4.4.1.1. CVI_AE_Register¶
【Description】
Register AE library with ISP.
【Syntax】
CVI_S32 CVI_AE_Register(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAeLib |
AE algorithm library structure pointer |
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_ae.h
Library files: libae.a
【Note】
This interface is not supported on the linux side of the dual-os SDK.
【Example】
None.
【Related Topic】
4.4.1.2. CVI_AE_UnRegister¶
【Description】
Reverse registration of AE libraries with ISP.
【Syntax】
CVI_S32 CVI_AE_UnRegister(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAeLib |
AE algorithm library structure pointer |
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_ae.h
Library files: libae.a
【Note】
This interface invokes the AE anti-registration callback interface provided by the ISP library to implement the function of AE anti-registration with the ISP library.
This interface does not support multiprocess operations.
This interface is not supported on the linux side of the dual-os SDK.
【Example】
None.
【Related Topic】
4.4.1.3. CVI_AE_SensorRegCallBack¶
【Description】
The sensor registered callback interface provided by the AE library.
【Syntax】
CVI_S32 CVI_AE_SensorRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, ISP_SNS_ATTR_INFO_S *pstSnsAttrInfo, AE_SENSOR_REGISTER_S *pstRegister);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAeLib |
AE algorithm library structure pointer |
Input |
pstSnsAttrInfo |
Properties of the Sensor registered with AE |
Input |
pstRegister |
Sensor Registration Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
SensorId is a custom value in the sensor library that is used to proofread whether the sensor registered with ISP and the sensor registered with 3A are the same sensor.
AE obtains the differential initialization parameters and controls the sensor through a series of callback interfaces registered with the sensor.
This interface does not support multiprocess operations.
This interface is not supported on the linux side of the dual-os SDK.

Fig. 4.4 Interface between AE library and sensor Library¶
【Example】
None.
【Related Topic】
4.4.1.4. CVI_AE_SensorUnRegCallBack¶
【Description】
The sensor deregistered callback interface provided by the AE library.
【Syntax】
CVI_S32 CVI_AE_SensorUnRegCallBack(VI_PIPE ViPipe, ALG_LIB_S *pstAeLib, SENSOR_ID SensorId);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAeLib |
AE algorithm library structure pointer |
Input |
SensorId |
The Id of the Sensor that is unregistered with AE |
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_ae_comm.h
Library files: libae.a
【Note】
SensorId is a custom value in the sensor library that is used to proofread whether the sensor registered with ISP and the sensor registered with 3A are the same sensor.
This interface does not support multiprocess operations.
This interface is not supported on the linux side of the dual-os SDK.
【Example】
None.
【Related Topic】
4.4.2. AE control module¶
Exposure Control Interface:
CVI_ISP_SetExposureAttr : Set AE exposure properties.
CVI_ISP_GetExposureAttr : Get the AE exposure properties.
CVI_ISP_SetWDRExposureAttr : Set the AE exposure properties in WDR mode.
CVI_ISP_GetWDRExposureAttr : Get the AE exposure properties in WDR mode.
CVI_ISP_SetAERouteAttr : Set AE route properties.
CVI_ISP_GetAERouteAttr : Get AE route properties.
CVI_ISP_SetAERouteAttrEx : Set the extended properties of AE exposure allocation and support setting the sensor analog gain, sensor digital gain and ISP digital gain in AE allocation policy respectively.
CVI_ISP_GetAERouteAttrEx : Getting AE Exposure Allocation Policy Extended Properties,
CVI_ISP_QueryExposureInfo : Get AE internal status information.
CVI_ISP_SetAntiFlicker : Set AE anti flicker function.
CVI_ISP_GetAntiFlicker : Get AE anti flicker settings.
CVI_ISP_QueryFps : Get the current fps of AE.
CVI_ISP_GetCurrentLvX100 : Get the LV value of the current ambient brightness.
CVI_ISP_SetSmartExposureAttr : Set the AE exposure attribute in smart mode.
CVI_ISP_GetSmartExposureAttr : Get the AE exposure attribute in smart mode.
CVI_ISP_SetAERouteSFAttr : Set AE WDR short detection exposure allocation strategy.
CVI_ISP_GetAERouteSFAttr : Get AE WDR short detection exposure allocation strategy.
CVI_ISP_SetAERouteSFAttrEx : Set AE WDR short detection exposure allocation extended attributes.
CVI_ISP_GetAERouteSFAttrEx : Get AE WDR short detection exposure allocation extended attributes.
4.4.2.1. CVI_ISP_SetExposureAttr¶
【Description】
Set AE exposure properties.
【Syntax】
CVI_S32 CVI_ISP_SetExposureAttr(VI_PIPE ViPipe, const ISP_EXPOSURE_ATTR_S *pstExpAttr)
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstExpAttr |
AE Exposure Attribute Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
When the AE exposure control type is automatic, the exposure time and the exposure gain are automatically controlled by the AE algorithm. Different exposure effects can be obtained by configuring the parameters inside the auto-exposure attribute structure stAuto.
When the AE exposure control type is manual, it is possible to configure the manual exposure attribute structure stManual control to enable the type (Exposure time enable, ISO num enable, sensor analog gain enable, sensor digital gain enable, ISP digital gain enable) and corresponding exposure parameters(Exposure time, ISO Num, Sensor analog gain, Sensor digital gain, ISP digital gain).
When the AE exposure control type is automatic, the parameters for configuring the manual exposure property are invalid.Similarly, when the AE exposure control type is manual, the parameters for configuring the auto-exposure properties are invalid.
When the AE exposure control type is manual, if the exposure parameter is set beyond the maximum (small) value, the maximum (small) value supported by sensor will be used instead.
Whether it is automatic or manual exposure, the exposure time is in microseconds (us), and the exposure gain is in multiples of 10 bit precision, i.e., 1024 is 1 times, 2048 is 2 times, etc.
【Example】
// Automatic exposure property setting
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_AUTO;
stExpAttr.stAuto.stExpTimeRange.u32Max = 40000;
stExpAttr.stAuto.stExpTimeRange.u32Min = 10;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.stAuto.u8Speed = 0x40;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.stAuto.enAEStrategyMode = AE_EXP_HIGHLIGHT_PRIOR;
stExpAttr.stAuto.u16HistRatioSlope = 0x8;
stExpAttr.stAuto.u8MaxHistOffset = 0x10;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.stAuto.stAntiflicker.bEnable = CVI_TRUE;
stExpAttr.stAuto.stAntiflicker.enFrequency = AE_FREQUENCE_50HZ;
stExpAttr.stAuto.stAntiflicker.enMode = ISP_ANTIFLICKER_NORMAL_MODE;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.stAuto.stAEDelayAttr.u16BlackDelayFrame = 10;
stExpAttr.stAuto.stAEDelayAttr.u16WhiteDelayFrame = 0;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Manual exposure property setting (use gain control):
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enExpTimeOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enAGainOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enDGainOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enISPDGainOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enGainType = AE_TYPE_GAIN;
stExpAttr.stManual.u32AGain = 0x400;
stExpAttr.stManual.u32DGain = 0x400;
stExpAttr.stManual.u32ISPDGain = 0x400;
stExpAttr.stManual.u32ExpTime= 0x40000;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Manual exposure property setting (use ISO Num control):
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enExpTimeOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enISONumOpType= OP_TYPE_MANUAL;
stExpAttr.stManual.enGainType = AE_TYPE_ISO;
stExpAttr.stManual.u32ISONum = 1600;
stExpAttr.stManual.u32ExpTime= 0x40000;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
// Automatic mode sets the maximum gain to 32x (use gain control)
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_AUTO;
stExpAttr.stAuto.enGainType = AE_TYPE_GAIN;
stExpAttr.stAuto.stSysGainRange.u32Max = 32767;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
// Automatic mode set maximum gain 32x (using ISO Num control)VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_AUTO;
stExpAttr.stAuto.enGainType = AE_TYPE_ISO;
stExpAttr.stAuto.stISONumRange.u32Max = 3200;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Shutter mode (33333 us) set the maximum gain 32xVI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_AUTO;
stExpAttr.stAuto.stExpTimeRange.u32Min = 33333;
stExpAttr.stAuto.stExpTimeRange.u32Max = 33333;
stExpAttr.stAuto.enGainType = AE_TYPE_ISO;
stExpAttr.stAuto.stISONumRange.u32Max = 3200;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Set fixed gain in manual mode (32x, use ISO Num)VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enGainType = AE_TYPE_ISO;
stExpAttr.stManual.enISONumOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.u32ISONum = 3200;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Set fixed gain in manual mode (32x, use Gain)VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enGainType = AE_TYPE_ISO;
stExpAttr.stManual.enAGainOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enDGainOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.enISPDGainOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.u32AGain = 0x8000;
stExpAttr.stManual.u32DGain = 0x400;
stExpAttr.stManual.u32ISPDGain = 0x400;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//automatic shutter
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_AUTO;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
// Manually set the shutter (16384 us)
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.stManual.enExpTimeOpType = OP_TYPE_MANUAL;
stExpAttr.stManual.u32ExpTime = 16384;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//shutter mode (16384 us)
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bByPass = CVI_FALSE;
stExpAttr.enOpType = OP_TYPE_AUTO;
stExpAttr.stAuto.stExpTimeRange.u32Min = 16384;
stExpAttr.stAuto.stExpTimeRange.u32Max = 16384;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Set antiflicker 50Hz
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.stAuto.stAntiflicker.bEnable = 1;
stExpAttr.stAuto.stAntiflicker.enMode = ISP_ANTIFLICKER_NORMAL_MODE;
stExpAttr.stAuto.stAntiflicker.enFrequency = AE_FREQUENCE_50HZ;
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
//Set the target brightness of each LV
#define TABLE_SIZE 21
CVI_U8 target_max[TABLE_SIZE] = {15, 15, 15, 15,
15, 15, 15, 20, 20, 25, 30, 35, 40, 40, 50, 50, 55, 60, 60,
60, 60};
CVI_U8 target_min[TABLE_SIZE] = {40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 45,
50, 50, 50, 50, 50, 50, 60, 60, 60};
CVI_U8 i;
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
for (i = 0; i < TABLE_SIZE;i++) {
stExpAttr.au8AdjustTargetMin[i] =
stExpAttr.au8AdjustTargetMax[i] = target [i];
}
CVI_ISP_SetExposureAttr(ViPipe, &stExpAttr);
【Related Topic】
4.4.2.2. CVI_ISP_GetExposureAttr¶
【Description】
Gets the AE exposure properties.
【Syntax】
CVI_S32 CVI_ISP_GetExposureAttr(VI_PIPE ViPipe, ISP_EXPOSURE_ATTR_S *pstExpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstExpAttr |
AE Exposure Attribute Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.3. CVI_ISP_SetWDRExposureAttr¶
【Description】
Set the AE exposure properties in WDR mode.
【Syntax】
CVI_S32 CVI_ISP_SetWDRExposureAttr(VI_PIPE ViPipe, const ISP_WDR_EXPOSURE_ATTR_S *pstWDRExpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstWDRExpAttr |
AE Exposure Attribute Structure Pointer in WDR Mode |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
//Manually set the exposure ratio to 8x
VI_PIPE ViPipe = 0;
ISP_WDR_EXPOSURE_ATTR_S stWdrExpAttr;
CVI_ISP_GetWDRExposureAttr(ViPipe, &stWdrExpAttr);
stWdrExpAttr.enExpRatioType = OP_TYPE_MANUAL;
stWdrExpAttr.au32ExpRatio[0] = 512;
CVI_ISP_SetWDRExposureAttr(ViPipe, &stWdrExpAttr);
//Set the auto mode exposure ratio to be limited to 8x ~ 16x
ISP_WDR_EXPOSURE_ATTR_S stWdrExpAttr;
CVI_ISP_GetWDRExposureAttr(ViPipe, &stWdrExpAttr);
stWdrExpAttr.enExpRatioType = OP_TYPE_AUTO;
stWdrExpAttr.u32ExpRatioMin = 512;
stWdrExpAttr.u32ExpRatioMax = 1024;
CVI_ISP_SetWDRExposureAttr(ViPipe, &stWdrExpAttr);
//Set the target brightness of each LV in the long/short frame
#define TABLE_SIZE 21
CVI_U8 LeTarget[TABLE_SIZE] = {15, 15, 15, 15,
15, 15, 15, 20, 20, 25, 30, 35, 40, 40, 50, 50, 55, 60, 60,
60, 60};
CVI_U8 SeTarget[TABLE_SIZE] = {5, 5, 5, 5,
5, 5, 5, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 20, 20,
20, 20};
CVI_U8 i;
ISP_WDR_EXPOSURE_ATTR_S stWdrExpAttr;
CVI_ISP_GetWDRExposureAttr(ViPipe, &stWdrExpAttr);
for (i = 0; i < TABLE_SIZE;i++) {
stWdrExpAttr.au8LEAdjustTargetMin[i] =
stWdrExpAttr.au8LEAdjustTargetMax[i] = LeTarget[i];
stWdrExpAttr.au8SEAdjustTargetMin[i] =
stWdrExpAttr.au8SEAdjustTargetMax[i] = SeTarget[i];
}
CVI_ISP_SetWDRExposureAttr(ViPipe, &stWdrExpAttr);
【Related Topic】
4.4.2.4. CVI_ISP_GetWDRExposureAttr¶
【Description】
Gets the AE exposure properties in WDR mode.
【Syntax】
CVI_S32 CVI_ISP_GetWDRExposureAttr(VI_PIPE ViPipe, ISP_WDR_EXPOSURE_ATTR_S *pstWDRExpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstWDRExpAttr |
AE Exposure Attribute Structure Pointer in WDR Mode |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.5. CVI_ISP_SetAERouteAttr¶
【Description】
Set AE exposure allocation policy.
【Syntax】
CVI_S32 CVI_ISP_SetAERouteAttr(VI_PIPE ViPipe, const ISP_AE_ROUTE_S *pstAERouteAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteAttr |
AE Exposure Allocation Policy Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
This interface is used to set the AE exposure assignment route. The AE calculated exposure will be assigned according to the set route. Users can set the exposure priority, gain priority and aperture priority according to their needs.
The AE assignment route follows the following rules :
A maximum of 16 nodes are supported, each of which has three components: exposure time, gain and aperture. The gain includes analog gain, digital gain and ISP digital gain.
The exposure time unit in the node is us, which cannot be set to 0 or too small to cause the actual number of exposure rows to be 0, otherwise an exception may occur.
The ring component only supports P-Iris, not DC-Iris, because DC-Iris cannot be precisely controlled, the DC-Iris and manual aperture lens aperture components are invalid.That is, when the aperture type is DC-Iris, the node aperture component has no effect on the exposure distribution.
Node exposure is the product of exposure time, gain and aperture.
Node exposure needs to increase monotonically.
The exposure of the latter node should be greater than or equal to that of the previous node.
The first node has the lowest exposure and the last node has the highest exposure.
The exposure of adjacent nodes increases, then there should be one component increase, while the other components are fixed, and the increased component determines the allocation strategy for this segment of the route.For example, if the exposure time component increases, the strategy for assigning this segment of the route is to give priority to the exposure time.
Setting equal exposure nodes is not supported.
Users can set different routes according to different scenarios, and assign routes to support dynamic switching.
For DC-Iris and manual aperture lenses, the default AE allocation strategy is to allocate exposure time first, then gain.For P-Iris lenses, the
default AE allocation strategy is to first adjust the aperture, set the aperture to the maximum, then adjust the exposure time, and finally allocate
the gain.If the current exposure is not within the user-set route range, it is assigned by default policy.
For DC-Iris and P-Iris switching online, AE route is reset to the default allocation policy that matches the aperture type, and the user can set AE
route when switching the aperture type as needed.
When the frame is automatically downscaled, the change in maximum exposure time is updated to the allocation route.
When switching frame rates, if the user sets a maximum exposure target time greater than the maximum exposure time allowed by one frame after
switching, the maximum exposure time of the allocation route will be updated to the maximum exposure time allowed by one frame after switching.
When automatic frame dropping, linear and WDR mode switching, frame rate switching, limiting exposure time or maximum and minimum gain occur, the
actual effective AE route may not be consistent with MPI settings, and the actual effective AE route can be obtained through
CVI_ISP_QueryExposureInfo.
【Example】
//Set the route of gain 128x
VI_PIPE ViPipe = 0;
ISP_AE_ROUTE_S stRoute;
CVI_ISP_SetAERouteAttr(ViPipe, &stRoute);
stRoute.u32TotalNum = 3;
stRoute.astRouteNode[0].u32IntTime = 30;
stRoute.astRouteNode[0].u32SysGain= 1024;
stRoute.astRouteNode[0].enIrisFNO = 10;
stRoute.astRouteNode[0].u32IrisFNOLin = 1024;
stRoute.astRouteNode[1].u32IntTime = 33333;
stRoute.astRouteNode[1].u32SysGain = 1024;
stRoute.astRouteNode[1].enIrisFNO = 10;
stRoute.astRouteNode[1].u32IrisFNOLin = 1024;
stRoute.astRouteNode[2].u32IntTime = 33333;
stRoute.astRouteNode[2].u32SysGain = 131072;
stRoute.astRouteNode[2].enIrisFNO = 10;
stRoute.astRouteNode[2].u32IrisFNOLin = 1024;
CVI_ISP_SetAERouteAttr(ViPipe, &stRoute);
【Related Topic】
4.4.2.6. CVI_ISP_GetAERouteAttr¶
【Description】
Gets the AE exposure allocation policy.
【Syntax】
CVI_S32 CVI_ISP_GetAERouteAttr(VI_PIPE ViPipe, ISP_AE_ROUTE_S *pstAERouteAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteAttr |
AE Exposure Allocation Policy Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.7. CVI_ISP_SetAERouteAttrEx¶
【Description】
Set AE exposure allocation extended properties to support setting sensor analog gain, sensor digital gain and ISP digital gain in AE allocation strategy respectively.
【Syntax】
CVI_S32 CVI_ISP_SetAERouteAttrEx(VI_PIPE ViPipe, const ISP_AE_ROUTE_EX_S *pstAERouteAttrEx);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteAttrEx |
AE Exposure Allocation Policy Extended Attribute Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
This interface is used to set the AE exposure assignment extension properties.
The exposure calculated by AE will be assigned according to the set route.
Users can set exposure time priority, sensor analog gain priority, sensor digital gain priority, ISP digital gain priority and aperture priority
according to their needs.This interface can be used to set exposure assignment route in WDR mode, alleviate power flicker caused by multi-frame
synthetic WDR in normal room illumination, and optimize image effect in WDR mode.
Effectiveness of the AE exposure assignment extended property can be achieved by configuring bAERouteExValid in the CVI_ISP_SetExposureAttr
interface.Use extended AE route when bAERouteExValid is CVI_TRUE, otherwise use normal AE route
Other considerations are the same as the rules for CVI_ISP_SetAERouteAttr
【Example】
None.
【Related Topic】
4.4.2.8. CVI_ISP_GetAERouteAttrEx¶
【Description】
Gets the AE exposure allocation policy extended properties.
【Syntax】
CVI_S32 CVI_ISP_GetAERouteAttrEx(VI_PIPE ViPipe, ISP_AE_ROUTE_EX_S *pstAERouteAttrEx);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteAttrEx |
AE Exposure Allocation Policy Extended Attribute Structure Pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
VI_PIPE ViPipe = 0;
ISP_EXPOSURE_ATTR_S stExpAttr;
ISP_AE_ROUTE_EX_S stRouteEx;
CVI_U32 au32RouteExNode[6][5]
= {{ 30, 1024, 1024, 1024, 0},
{ 30, 1024, 1024, 1024, 10},
{ 30, 16384, 1024, 1024, 10},
{400000, 16384, 1024, 1024, 10},
{400000, 16384, 4096, 1024, 10},
{400000, 16384, 4096, 4096, 10}};
CVI_ISP_GetAERouteAttrEx(ViPipe, &stRouteEx);
CVI_ISP_GetExposureAttr(ViPipe, &stExpAttr);
stExpAttr.bAERouteExValid = CVI_TRUE;
stRouteEx.u32TotalNum = 6;
memcpy(stRouteEx.astRouteExNode, au32RouteExNode, sizeof(au32RouteExNode));
【Related Topic】
4.4.2.9. CVI_ISP_QueryExposureInfo¶
【Descirption】
Obtain AE internal status information, including 256-segment histogram and average brightness statistics, as well as exposure time, gain, exposure and actual effective AE route information in AE operational status.
【Syntax】
CVI_S32 CVI_ISP_QueryExposureInfo(VI_PIPE ViPipe, ISP_EXP_INFO_S *pstExpInfo);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstExpInfo |
Exposure internal state information structure pointer output |
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_ae.h
Library files: libae.a
【Note】
The exposure time is measured in microseconds(us), and the sensor analog gain, sensor digital gain, and ISP digital gain are obtained in multiples with a precision of 10 bits.
【Example】
// get sensor again, sensor dgain, isp dgain and exposure ratio
VI_PIPE ViPipe = 0;
ISP_EXP_INFO_S stExpInfo;
CVI_ISP_QueryExposureInfo(ViPipe, &stExpInfo);
printf(“sensor used again = %d\n”, stExpInfo. u32AGain);
printf(“sensor used dgain = %d\n”, stExpInfo. u32DGain);
printf(“isp used dgain = %d\n”, stExpInfo. u32ISPDGain);
printf(“WDR Exposure ratio = %d\n”, stExpInfo. u32WDRExpRatio);
【Related Topic】
None.
4.4.2.10. CVI_ISP_SetAntiFlicker¶
【Descirption】
Set AE anti flicker function.
【Syntax】
CVI_S32 CVI_ISP_SetAntiFlicker(VI_PIPE ViPipe, CVI_BOOL enable, CVI_U8 frequency);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
enable |
enable AE anti flicker |
Input |
frequency |
Anti-flicker frequency |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
//Set AE anti flicker 50Hz
VI_PIPE ViPipe = 0;
CVI_U8 enable, frequency;
enable = 1;
frequency = 50;
CVI_ISP_SetAntiFlicker(ViPipe, enable, frequency);
【Related Topic】
4.4.2.11. CVI_ISP_GetAntiFlicker¶
【Descirption】
Get AE anti flicker settings.
【Syntax】
CVI_S32 CVI_ISP_GetAntiFlicker(VI_PIPE ViPipe, CVI_BOOL *pEnable, CVI_U8 *pFrequency);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pEnable |
Enable AE anti flicker |
Input |
pFrequency |
Anti-flicker frequency |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.4.2.12. CVI_ISP_QueryFps¶
【Descirption】
Get the current fps of AE.
【Syntax】
CVI_S32 CVI_ISP_QueryFps(VI_PIPE ViPipe, CVI_FLOAT *pFps);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pFps |
AE fps pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.13. CVI_ISP_GetCurrentLvX100¶
【Descirption】
It is used to obtain the light metering result of the current AE, that is, the ambient light brightness value LV. It can be used to judge night and day, and achieve the effect similar to a photoresistor.
【Syntax】
CVI_S32 CVI_ISP_GetCurrentLvX100(VI_PIPE ViPipe, CVI_S16 *ps16Lv);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
ps16Lv |
Returns the current LV value |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
#include "cvi_ae.h"
#define ENTER_NIGHT_LV_LEVEL 0
#define ENTER_DAY_LV_LEVEL 700
#define CHECK_COUNT 5
bool checkDayOrNight(void)
{
static bool dayOrNight = true;
static CVI_U8 checkDayCount = 0;
static CVI_U8 checkNightCount = 0;
CVI_S16 lv = 0;
CVI_ISP_GetCurrentLvX100(0, &lv);
if (lv > ENTER_DAY_LV_LEVEL) {
if (checkDayCount < CHECK_COUNT) {
checkDayCount++;
} else {
dayOrNight = true;
}
checkNightCount = 0;
} else if (lv < ENTER_NIGHT_LV_LEVEL) {
if (checkNightCount < CHECK_COUNT) {
checkNightCount++;
} else {
dayOrNight = false;
}
checkDayCount = 0;
} else {
checkDayCount = 0;
checkNightCount = 0;
}
return dayOrNight;
}
int main(void)
{
while (1) {
sleep(1);
printf("checkDayOrNight: %s\n", checkDayOrNight() ? "day" : "night");
}
return 0;
}
【Related Topic】
None.
4.4.2.14. CVI_ISP_SetSmartExposureAttr¶
【Descirption】
Set AE exposure properties in Smart mode. This parameter takes effect only when intelligent information is available.
【Syntax】
CVI_S32 CVI_ISP_SetSmartExposureAttr(VI_PIPE ViPipe, const ISP_SMART_EXPOSURE_ATTR_S *pstSmartExpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstSmartExpAttr |
AE exposure attribute structure pointer in smart mode |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
#include "cvi_ae.h"
VI_PIPE ViPipe = 0;
ISP_SMART_EXPOSURE_ATTR_S stSmartExpAttr;
CVI_ISP_GetSmartExposureAttr(ViPipe, &stSmartExpAttr);
stSmartExpAttr.bEnable = 1;
stSmartExpAttr.u8LumaTarget = 56;
stSmartExpAttr.u16ExpCoef= 1024;
stSmartExpAttr.u16ExpCoefMax= 4096;
stSmartExpAttr.u16ExpCoefMin = 256;
stSmartExpAttr.u8SmartInterval = 1;
stSmartExpAttr.u8SmartSpeed = 32;
stSmartExpAttr.u16SmartDelayNum = 5;
stSmartExpAttr.u8Weight = 80;
stSmartExpAttr.u8NarrowRatio = 75;
CVI_ISP_SetSmartExposureAttr(ViPipe, &stSmartExpAttr);
【Related Topic】
None.
4.4.2.15. CVI_ISP_GetSmartExposureAttr¶
【Descirption】
Gets the AE exposure properties in Smart mode. This parameter takes effect only when intelligent information is available.
【Syntax】
CVI_S32 CVI_ISP_GetSmartExposureAttr(VI_PIPE ViPipe, ISP_SMART_EXPOSURE_ATTR_S *pstSmartExpAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstSmartExpAttr |
AE exposure attribute structure pointer in smart mode |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.16. CVI_ISP_SetAERouteSFAttr¶
【Descirption】
Set AE WDR short detection exposure allocation strategy.
【Syntax】
CVI_S32 CVI_ISP_SetAERouteSFAttr(VI_PIPE ViPipe, const ISP_AE_ROUTE_S *pstAERouteSFAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteSFAttr |
AE WDR short detection exposure allocation strategy structure pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.17. CVI_ISP_GetAERouteSFAttr¶
【Descirption】
Get AE WDR short detection exposure allocation strategy.
【Syntax】
CVI_S32 CVI_ISP_GetAERouteSFAttr(VI_PIPE ViPipe, ISP_AE_ROUTE_S *pstAERouteSFAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteSFAttr |
AE WDR short detection exposure allocation strategy structure pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.18. CVI_ISP_SetAERouteSFAttrEx¶
【Descirption】
Set AE WDR short detection exposure allocation extended attributes.
【Syntax】
CVI_S32 CVI_ISP_SetAERouteSFAttrEx(VI_PIPE ViPipe, const ISP_AE_ROUTE_S *pstAERouteSFAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteSFAttr |
AE WDR short detection exposure allocation strategy structure pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.2.19. CVI_ISP_GetAERouteSFAttrEx¶
【Descirption】
Get AE WDR short detection exposure allocation extended attributes.
【Syntax】
CVI_S32 CVI_ISP_GetAERouteSFAttrEx(VI_PIPE ViPipe, ISP_AE_ROUTE_S *pstAERouteSFAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstAERouteSFAttr |
AE WDR short detection exposure allocation strategy structure pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
4.4.3. Deep Learning Control Module¶
4.4.3.1. CVI_ISP_SetIrisAttr¶
【Descirption】
Set the control properties of the aperture.
This function can realize the setting of parameters such as manual aperture properties and aperture types.
【Syntax】
CVI_S32 CVI_ISP_SetIrisAttr(VI_PIPE ViPipe, const ISP_IRIS_ATTR_S *pstIrisAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstIrisAttr |
Aperture control attribute structure pointer |
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_ae.h
Library files: libae.a
【Note】
According to the actual aperture type of the connected lens, set the correct aperture type attribute, and then set the related DC-Iris/P-Iris control
attribute.
If it is connected with a manual iris lens, you can set the iris type to ISP_IRIS_DC_TYPE, and it is recommended to disable Deep Learning enablement at this
time.
The manual iris property is mainly used for debugging and can be set through this MPI.
For P-Iris lenses, the manual enIrisFNO value will be affected by the maximum and minimum aperture target values.
More parameters of the auto iris attribute need to be set by calling CVI_ISP_SetDcirisAttr and CVI_ISP_SetPirisAttr.
【Example】
None.
【Related Topic】
4.4.3.2. CVI_ISP_GetIrisAttr¶
【Descirption】
Gets the control properties of the aperture.
【Syntax】
CVI_S32 CVI_ISP_GetIrisAttr(VI_PIPE ViPipe, ISP_IRIS_ATTR_S *pstIrisAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstIrisAttr |
Aperture control attribute structure pointer |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.4.3.3. CVI_ISP_SetDcirisAttr¶
【Descirption】
Set the control properties of the DC-Iris Deep Learning algorithm, this function can realize the parameter setting of the DC-Iris automatic iris.
【Syntax】
CVI_S32 CVI_ISP_SetDcirisAttr(VI_PIPE ViPipe, const ISP_DCIRIS_ATTR_S *pstDcirisAttr);;
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstIrisAttr |
DC-Iris automatic aperture control property structure pointer. |
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_ae.h
Library files: libae.a
【Note】
The DC-Iris aperture control adopts the PID algorithm, which adjusts the PWM duty cycle to control the aperture size according to the screen brightness.
When the exposure time and gain reach the minimum target value, it will enter the aperture control area.
When the iris control can meet the requirements of the target brightness, AE returns directly, keeping the exposure time and gain unchanged.
When the brightness of the screen is stable and the PWM duty cycle is maintained at the open value for a period of time, the Deep Learning algorithm will consider that the aperture has been opened to the maximum, exit the aperture control area, and return the control to AE
【Example】
None.
【Related Topic】
4.4.3.4. CVI_ISP_GetDcirisAttr¶
【Descirption】
Gets the control properties of the DC-Iris automatic aperture.
【Syntax】
CVI_S32 CVI_ISP_GetDcirisAttr(VI_PIPE ViPipe, ISP_DCIRIS_ATTR_S *pstDcirisAttr);;
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstIrisAttr |
DC-Iris automatic aperture control property structure pointer. |
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_ae.h
Library files: libae.a
【Note】
None.
【Example】
None.
【Related Topic】
None.
4.4.3.5. CVI_ISP_SetPirisAttr¶
【Descirption】
Set the control properties of P-Iris automatic aperture
【Syntax】
CVI_S32 CVI_ISP_SetPirisAttr(VI_PIPE ViPipe, const ISP_PIRIS_ATTR_S *pstPirisAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstIrisAttr |
P-Iris auto iris control attribute structure pointer |
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_ae.h
Library files: libae.a
【Note】
P-iris is not currently supported
【Example】
None.
【Related Topic】
4.4.3.6. CVI_ISP_GetPirisAttr¶
【Descirption】
Get the control properties of P-Iris automatic aperture
【Syntax】
CVI_S32 CVI_ISP_GetPirisAttr(VI_PIPE ViPipe, ISP_PIRIS_ATTR_S *pstPirisAttr);
【Parameter】
Parameter |
Description |
Input/Output |
---|---|---|
ViPipe |
ViPipe number |
Input |
pstIrisAttr |
P-Iris auto iris control attribute structure pointer |
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_ae.h
Library files: libae.a
【Note】
P-iris is not currently supported
【Example】
None.
【Related Topic】
4.5. Data Types¶
4.5.1. Register¶
AE_SENSOR_REGISTER_S : Define sensor registration structure.
AE_SENSOR_EXP_FUNC_S : Define the sensor callback function structure.
AE_SENSOR_DEFAULT_S : Defines the initialization parameter structure of the AE algorithm library.
AE_ACCURACY_E : Enumeration of precision types defining exposure time and gain.
AE_ACCURACY_S : A structure that defines the precision of exposure time and gain.
4.5.1.1. AE_SENSOR_REGISTER_S¶
【Description】
Define the sensor registration structure.
【Syntax】
typedef struct cviAE_SENSOR_REGISTER_S
{
AE_SENSOR_EXP_FUNC_S stSnsExp;
} AE_SENSOR_REGISTER_S;
【Member】
Member |
Description |
---|---|
stSnsExp |
Callback function structure registered by sensor |
【Note】
None.
【Related Data Type and Interface】
4.5.1.2. AE_SENSOR_EXP_FUNC_S¶
【Description】
Define the sensor callback function structure.
【Syntax】
typedef struct _AE_SENSOR_EXP_FUNC_S
{
CVI_S32(*pfn_cmos_get_ae_default)(VI_PIPE ViPipe, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
CVI_VOID(*pfn_cmos_fps_set)(VI_PIPE ViPipe, CVI_FLOAT f32Fps,
AE_SENSOR_DEFAULT_S *pstAeSnsDft);
CVI_VOID(*pfn_cmos_slow_framerate_set)(VI_PIPE ViPipe, CVI_U32 u32FullLines, AE_SENSOR_DEFAULT_S *pstAeSnsDft);
CVI_VOID(*pfn_cmos_inttime_update)(VI_PIPE ViPipe, CVI_U32 *u32IntTime);
CVI_VOID(*pfn_cmos_gains_update)(VI_PIPE ViPipe, CVI_U32 *u32Again, CVI_U32 *u32Dgain);
CVI_VOID (*pfn_cmos_again_calc_table)(VI_PIPE ViPipe, CVI_U32 *pu32AgainLin, CVI_U32 *pu32AgainDb);
CVI_VOID (*pfn_cmos_dgain_calc_table)(VI_PIPE ViPipe, CVI_U32 *pu32DgainLin, CVI_U32 *pu32DgainDb);
CVI_VOID (*pfn_cmos_get_inttime_max)(VI_PIPE ViPipe, CVI_U16 u16ManRatioEnable, CVI_U32 *au32Ratio, CVI_U32 *au32IntTimeMax, CVI_U32 *au32IntTimeMin, CVI_U32 *pu32LFMaxIntTime);
CVI_VOID(*pfn_cmos_ae_fswdr_attr_set)(VI_PIPE ViPipe, AE_FSWDR_ATTR_S *pstAeFSWDRAttr);
} AE_SENSOR_EXP_FUNC_S;
【Member】
Member |
Description |
---|---|
pfn_cmos_get_ae_default |
Gets the callback function pointer of the initial value of the AE algorithm library. |
pfn_cmos_fps_set |
Set the frame rate of sensor. |
pfn_cmos_slow_framerate_set |
Set the sensor down frame. |
pfn_cmos_inttime_update |
Set the exposure time of sensor. |
pfn_cmos_gains_update |
Set the analog gain and digital gain of sensor. |
pfn_cmos_again_calc_table |
Calculate the analog gain of TABLE type sensor. |
pfn_cmos_dgain_calc_table |
Calculate the digital gain of TABLE type sensor. |
pfn_cmos_get_inttime_max |
In WDR mode, the pointer of callback function to calculate the maximum exposure time of short frame is strongly related to sensor. |
pfn_cmos_ae_fswdr_attr_set |
In 2to1LineWDR mode, set the long frame mode |
【Note】
If the callback function pointer does not need to be assigned, it needs to be set to NULL.
For information on how to convert the exposure time and gain set in pfn_cmos_inttime_update and pfn_cmos_gains_update into sensor configuration
value and sensor strength, please refer to the sensor manual.
【Related Data Type and Interface】
ISP_SENSOR_EXP_FUNC_S
4.5.1.3. AE_SENSOR_DEFAULT_S¶
【Description】
Define the initialization parameter structure of AE algorithm library.
【Syntax】
typedef struct _AE_SENSOR_DEFAULT_S
{
CVI_U8 au8HistThresh[HIST_THRESH_NUM];
CVI_U8 u8AeCompensation;
CVI_U32 u32LinesPer500ms;
CVI_U32 u32FlickerFreq;
CVI_U32 u32HmaxTimes;
CVI_U32 u32InitExposure;
CVI_U32 u32InitAESpeed;
CVI_U32 u32InitAETolerance;
CVI_U32 u32FullLinesStd;
CVI_U32 u32FullLinesMax;
CVI_U32 u32FullLines;
CVI_U32 u32MaxIntTime;
CVI_U32 u32MinIntTime;
CVI_U32 u32MaxIntTimeTarget;
CVI_U32 u32MinIntTimeTarget;
AE_ACCURACY_S stIntTimeAccu;
CVI_U32 u32MaxAgain;
CVI_U32 u32MinAgain;
CVI_U32 u32MaxAgainTarget;
CVI_U32 u32MinAgainTarget;
AE_ACCURACY_S stAgainAccu;
CVI_U32 u32MaxDgain;
CVI_U32 u32MinDgain;
CVI_U32 u32MaxDgainTarget;
CVI_U32 u32MinDgainTarget;
AE_ACCURACY_S stDgainAccu;
CVI_U32 u32MaxISPDgainTarget;
CVI_U32 u32MinISPDgainTarget;
CVI_U32 u32ISPDgainShift;
CVI_U32 u32MaxIntTimeStep;
CVI_U32 u32LFMaxShortTime;
CVI_U32 u32LFMinExposure;
ISP_AE_STRATEGY_E enAeExpMode;
CVI_U16 u16ISOCalCoef;
CVI_U8 u8AERunInterval;
CVI_FLOAT f32Fps;
CVI_FLOAT f32MinFps;
CVI_U32 denom;
CVI_U32 u32AEResponseFrame;
CVI_U32 u32SnsStableFrame;
AE_BLC_TYPE_E enBlcType;
ISP_SNS_GAIN_MODE_E enWDRGainMode;
} AE_SENSOR_DEFAULT_S;
【Member】
Member |
Description |
---|---|
u8AeCompensation |
AE brightness target value, the value range is [0255], it is recommended to use 0x38 ~ 0x40. |
u32LinesPer500ms |
Total number of rows per 500ms. |
u32FlickerFreq |
The anti-flash frequency is 256 times of the current power frequency. |
u32HmaxTimes |
Time of reading a line by sensor, unit: ns. |
u32InitExposure |
The default initial exposure is equal to the exposure time (lines) * system gain (6bit decimal precision). AE algorithm uses this value as the exposure of the initial 5 frames |
u32InitAESpeed |
The default initial AE adjustment speed is used as the adjustment speed of the initial 100 frames |
u32InitAETolerance |
The AE algorithm uses this value as the initial 100 frame exposure tolerance value, which can be used to set the brightness range of the first AE convergence stability flag |
u32FullLinesStd |
The effective number of lines per frame at the base frame rate. |
u32FullLinesMax |
The maximum number of rows that can be reached in one frame after sensor frame dropping. It is generally set to the maximum number of rows supported by the sensor. |
u32FullLines |
The total number of effective rows per sensor frame. When using CVI AE algorithm, when calling back cmos_fps_set and cmos_slow_framerate_set, this value must be assigned to return the total number of effective rows per frame. |
u32MaxIntTime |
Maximum exposure time, in rows. |
u32MinIntTime |
Minimum exposure time, in rows. |
u32MaxIntTimeTarget |
Maximum exposure time target value, in rows. |
u32MinIntTimeTarget |
Minimum exposure time target value, in rows.。 |
stIntTimeAccu |
Exposure time accuracy. |
u32MaxAgain |
Maximum analog gain in multiples. |
u32MinAgain |
Minimum analog gain in multiples. |
u32MaxAgainTarget |
Maximum analog gain target value, in multiples. |
u32MinAgainTarget |
Minimum analog gain target value, in multiples. |
stAgainAccu |
Simulation gain accuracy. |
u32MaxDgain |
Maximum digital gain in multiples. |
u32MinDgain |
Minimum digital gain in multiples. |
u32MaxDgainTarget |
Maximum digital gain target value, in multiples. |
u32MinDgainTarget |
Minimum digital gain target value, in multiples. |
stDgainAccu |
Digital gain accuracy. |
u32MaxISPDgainTarget |
Maximum ISP digital gain target value, in multiples. |
u32MinISPDgainTarget |
Minimum ISP digital gain target value, in multiples. |
u32ISPDgainShift |
ISP digital gain accuracy. |
u32MaxIntTimeStep |
The maximum adjustment step of short frame exposure time reduction, in rows. Valid only in two frame synthesis mode. |
u32LFMaxShortTime |
Maximum exposure time of short frame in automatic long frame mode. |
u32LFMinExposure |
Minimum exposure time of short frame in automatic long frame mode. |
enAeExpMode |
Default exposure strategy, high light priority or low light priority. It is recommended that FSWDR mode be set to low light priority, linear mode and BuiltIn WDR be set to high light priority. If this value is not set, highlight takes precedence by default. |
u16ISOCalCoef |
ISO calibration coefficient is used to ensure that the ISO displayed in the DCF information required for photographing is standard, with an accuracy of 8bit. Value range: [0x0, 0xFFFF], default value is 0x100. |
u8AERunInterval |
The default AE algorithm running interval, in frames. If it is not set, AE is executed once per frame by default.
|
f32Fps |
Reference frame rate |
u32AEResponseFrame |
The number of frames required for sensor exposure time/gain synchronization to take effect |
【Note】
When the linear/WDR mode is switched, the pfn_cmos_get_ae_default function will be called back to update the AE related default parameters.
If the WDR mode needs to use AE extended route assignment, but linear mode does not, it is recommended to clear AE route in cmos_get_ae_default
function first: bAERouteExValid = CVI_FALSE,stAERouteAttr.u32TotalNum= 0,stAERouteAttrEx.u32TotalNum = 0, and then assign values to the WDR branch as needed.
u32LFMaxShortTime is the maximum exposure time of short frame in automatic long frame mode.
If this parameter is set too small, the noise performance of bright area will be worse in automatic long frame mode.
【Related Data Type and Interface】
ISP_SENSOR_EXP_FUNC_S
4.5.1.4. AE_ACCURACY_E¶
【Description】
Enumeration of precision types defining exposure time and gain
【Syntax】
typedef enum _AE_ACCURACY_E
{
AE_ACCURACY_DB = 0,
AE_ACCURACY_LINEAR,
AE_ACCURACY_TABLE,
AE_ACCURACY_BUTT,
} AE_ACCURACY_E;
【Member】
Member |
Description |
---|---|
AE_ACCURACY_DB DB |
Precision type. |
AE_ACCURACY_LINEAR |
Linear precision type. |
AE_ACCURACY_TABLE |
Form type. |
【Note】
None.
【Related Data Type and Interface】
4.5.1.5. AE_ACCURACY_S¶
【Description】
A structure that defines the precision of exposure time and gain.
【Syntax】
typedef struct _AE_ACCURACY_S
{
AE_ACCURACY_E enAccuType;
float f32Accuracy;
float f32Offset;
} AE_ACCURACY_S;
【Member】
Member |
Description |
---|---|
enAccuType |
Precision type, including linear type, DB type and TABLE type. . |
f32Accuracy |
Precision value. |
f32Offset |
The offset of the exposure time, supports positive and negative offset settings, in units of rows, this value configuration is strongly related to the sensor. |
【Note】
None.
【Related Data Type and Interface】
None.
4.5.2. AE¶
ISP_AE_MODE_E :Define the mode of auto exposure.
ISP_AE_STRATEGY_E :Define AE exposure strategy mode.
ISP_AE_DELAY_S :Define AE delay attributes.
ISP_AE_RANGE_S :Define the maximum and minimum exposure time or gain.
ISP_ANTIFLICKER_MODE_E :Define the anti-flash mode.
ISP_ANTIFLICKER_S :Define the anti-flash attributes.
ISP_SUBFLICKER_S :Define the sub anti flicker attribute of ISP image.
ISP_FSWDR_MODE_E :Define ISP FSWDR operation mode.
ISP_AE_ATTR_S :Define auto exposure attributes.
ISP_ME_ATTR_S :Define manual exposure attributes.
ISP_EXPOSURE_ATTR_S :Define ISP exposure attributes.
ISP_WDR_EXPOSURE_ATTR_S :Define exposure attributes in WDR mode.
ISP_AE_ROUTE_NODE_S :Define AE assignment route node attributes.
ISP_AE_ROUTE_S :Define AE exposure assignment policy attributes.
ISP_AE_ROUTE_EX_NODE_S :Define the attribute of AE extension assignment route node.
ISP_AE_ROUTE_EX_S :Define extended attributes of AE exposure allocation strategy.
ISP_EXP_INFO_S :Define the internal state information of ISP exposure.
4.5.2.1. ISP_AE_MODE_E¶
【Description】
Define the mode of auto exposure.
【Syntax】
typedef enum _ISP_AE_MODE_E
{
AE_MODE_SLOW_SHUTTER = 0,
AE_MODE_FIX_FRAME_RATE = 1,
AE_MODE_BUTT
} ISP_AE_MODE_E;
【Member】
Member |
Description |
---|---|
AE_MODE_SLOW_SHUTTER |
Automatic frame down mode, namely SLOW_SHUTTER mode. |
AE_MODE_FIX_FRAME_RATE |
Fixed frame rate mode. |
【Note】
Auto frame down mode means that the exposure time will be increased first to reduce the gain.
When the sensor gain reaches the maximum value set by the user, the auto exposure adjustment will gradually reduce the frame rate and extend the
exposure time until the exposure time is equal to the maximum time of auto exposure.
In low illumination environment, the noise is small, but the frame rate will be reduced.
The fixed frame rate mode is to keep the frame rate unchanged in the automatic exposure adjustment, and the noise will be greater in the low
illumination environment.
【Related Data Type and Interface】
None.
4.5.2.2. ISP_AE_STRATEGY_E¶
【Description】
Define AE exposure strategy mode.
【Syntax】
typedef enum _ISP_AE_STRATEGY_E
{
AE_EXP_HIGHLIGHT_PRIOR = 0,
AE_EXP_LOWLIGHT_PRIOR = 1,
AE_STRATEGY_MODE_BUTT
} ISP_AE_STRATEGY_E;
【Member】
Member |
Description |
---|---|
AE_EXP_HIGHLIGHT_PRIOR |
High light priority exposure mode. |
AE_EXP_LOWLIGHT_PRIOR |
High light priority exposure mode. |
【Note】
In linear mode, the AE algorithm’s default exposure strategy is highlight first to avoid overexposure, but in backlight scene, the brightness is low in the dark.
At this time, to focus on the dark area, low light priority mode can be adopted, but the bright area will be overexposed easily.
In WDR mode, AE algorithm uses low light priority mode by default to control long frame exposure.
At this time, manual exposure time, maximum and minimum exposure time, AE_Route, and AE_Route_Ex exposure time parameters affect long frame exposure time.
If it is switched to high light priority mode, short frame exposure is controlled.
At this time, manual exposure time, maximum and minimum exposure time, AE_Route, and AE_Route_Ex exposure time parameters affect short frame exposure time.
【Related Data Type and Interface】
None.
4.5.2.3. ISP_AE_DELAY_S¶
【Description】
Define AE delay attributes.
【Syntax】
typedef struct _ISP_AE_DELAY_S
{
CVI_U16 u16BlackDelayFrame;
CVI_U16 u16WhiteDelayFrame;
} ISP_AE_DELAY_S;
【Member】
Member |
Description |
---|---|
u16BlackDelayFrame |
When the image brightness is less than the target brightness for more than u16BlackDelayFrame frames, AE starts to adjust. |
u16WhiteDelayFrame |
When the image brightness exceeds the target brightness for more than u16WhiteDelayFrame frames, AE starts to adjust. |
【Note】
The larger the u16BlackDelayFrame/u16WhiteDelayFrame setting is, the longer it takes to adjust to the target brightness with the same AE adjustment step.
Human eyes are sensitive to overexposure.
It is recommended that u16WhiteDelayFrame be set smaller than u16BlackDelayFrame.
If the frame rate is low, it is recommended that u16BlackDelayFrame/u16WhiteDelayFrame should not be set too large, otherwise the AE convergence time will be longer.
【Related Data Type and Interface】
None.
4.5.2.4. ISP_AE_RANGE_S¶
【Description】
Define the maximum and minimum exposure time or gain.
【Syntax】
typedef struct _ISP_AE_RANGE_S
{
CVI_U32 u32Max;
CVI_U32 u32Min;
} ISP_AE_RANGE_S;
【Member】
Member |
Description |
---|---|
u32Max |
Maximum value |
u32Min |
Minimum Value |
【Note】
The minimum value cannot be greater than the maximum value.
【Related Data Type and Interface】
None.
4.5.2.5. ISP_ANTIFLICKER_MODE_E¶
【Description】
Define the anti-flash mode.
【Syntax】
typedef enum cviISP_ANTIFLICKER_MODE_E
{
ISP_ANTIFLICKER_NORMAL_MODE = 0x0,
ISP_ANTIFLICKER_AUTO_MODE = 0x1,
ISP_ANTIFLICKER_MODE_BUTT
} ISP_ANTIFLICKER_MODE_E;
【Member】
Member |
Description |
---|---|
ISP_ANTIFLICKER_NORMAL_MODE |
Normal anti-flash mode. |
ISP_ANTIFLICKER_AUTO_MODE |
Automatic anti-flash mode. |
【Note】
ISP_ANTIFLICKER_NORMAL_MODE for ordinary flash mode, exposure time can be adjusted according to the brightness, exposure time fixed for the smallest
1/120 SEC (60 hz) or 1/100 SEC (50 hz) and is not restricted by exposure time minimum value.
In an environment with lights: The exposure time matches the frequency of the light source, preventing image flickering.
High brightness environment: The higher the brightness, the shorter the exposure time.
The minimum exposure time of normal anti-flash mode is not adjusted for high brightness, so overexposure can occur.
ISP_ANTIFLICKER_AUTO_MODE resistance for automatic flash mode, exposure time can be adjusted according to the brightness, minimum exposure time can
achieve the minimum exposure time sensor.
The difference with the ordinary anti-flash mode is mainly reflected in the high brightness environment.
High brightness environment: The minimum exposure time can reach the minimum exposure time of the sensor, effectively suppressing overexposure, but
the anti-flash failure in this case.
【Related Data Type and Interface】
None.
4.5.2.6. ISP_ANTIFLICKER_S¶
【Description】
Define the anti-flash attributes.
【Syntax】
typedef struct cviISP_ANTIFLICKER_S
{
CVI_BOOL bEnable;
CVI_U8 u8Frequency;
ISP_ANTIFLICKER_MODE_E enMode;
} ISP_ANTIFLICKER_S;
【Member】
Member |
Description |
---|---|
bEnable |
When bEnable is CVI_TRUE, image anti-flash is enabled, and when it is CVI_FALSE, image anti-flash is not enabled. |
enFrequency |
Anti-flicker frequency value. Value range: [0, 1], the default value is 0. 0: 60Hz 1: 50Hz |
enMode |
Anti-flash mode, normal anti-flash or automatic anti-flash. |
【Note】
The exposure time after anti-flashing is enabled will be limited by the maximum/minimum exposure time.
If the minimum anti-flashing time is greater than the maximum exposure time, the exposure time after anti-flashing is enabled will be limited to the maximum exposure time.
【Related Data Type and Interface】
4.5.2.7. ISP_SUBFLICKER_S¶
【Description】
Define the sub anti flicker attribute of ISP image.
【Syntax】
typedef struct cviISP_SUBFLICKER_S
{
CVI_BOOL bEnable;
CVI_U8 u8LumaDiff;
} ISP_SUBFLICKER_S;
【Member】
Member |
Description |
---|---|
bEnable |
When bEnable is CVI_TRUE, the image sub-anti-flash function is enabled, and when it is CVI_FALSE, the image sub-anti-flash function is not enabled. |
u8LumaDiff |
Anti-flash setting, range [0x0, 0x64]. When the sub-anti-flash function is in effect, the larger the value is, the closer it is to anti-flash. |
【Note】
Force resisting flash mode, the minimum exposure time fixed for the 1/120 SEC (60 hz) or 1/100 SEC (50 hz), in some scenarios, such as indoor
targeting the backlit scenes outside the window) images may be blown severely, but not to flash flash power frequency and the better picture.
In this case, the subantiflash mode is introduced to achieve a balance between overexposure and flicker.
Under the mandatory anti-flicker mode, if the image brightness is less than (AeCompensation + u8LumaDiff) when the sub-anti-flicker function takes
effect, the exposure time will still be fixed as 1/120 sec(60Hz) or 1/100 sec(50Hz), the minimum anti-flicker time, to prevent the image flicker.
If the screen brightness is higher than (AeCompensation + u8LumaDiff), cancel the anti-flicker and adjust the target brightness of the picture to (AeCompensation + u8LumaDiff), and introduce a certain degree of flicker to avoid serious overexposure of the picture.
only in open flash, forced resisting flash mode and under the premise of flash frequency resistance value is not equal to 0, the flash function to
take effect.
【Related Data Type and Interface】
None.
4.5.2.8. ISP_FSWDR_MODE_E¶
【Description】
Define ISP FSWDR operation mode.
【Syntax】
typedef enum cviISP_FSWDR_MODE_E
{
ISP_FSWDR_NORMAL_MODE = 0x0,
ISP_FSWDR_LONG_FRAME_MODE = 0x1,
ISP_FSWDR_AUTO_LONG_FRAME_MODE = 0x2,
ISP_FSWDR_MODE_BUTT
}ISP_FSWDR_MODE_E;
【Member】
Member |
Description |
---|---|
ISP_FSWDR_NORMAL_MODE |
In normal FSWDR mode, the AE and composition modules work according to the automatic/manual exposure ratio. |
ISP_FSWDR_LONG_FRAME_MODE |
Long frame mode. At this time, AE sets the short frame exposure time to the minimum value, and the long frame exposure time is close to the maximum value allowed by 1 frame. |
ISP_FSWDR_AUTO_LONG_FRAME_MODE |
|
【Note】
Long frame mode only WDR mode effective line, automatic line long frame mode in only 2 to1 WDR mode effectively, and to ensure the quality of image
and WDR module fusion threshold of motion detection and the length of the frame are automatically configured, does not support manual configuration.
Switch the mode to WDR mode online.
The default mode is normal FSWDR mode.
Automatic long frame mode, manual exposure than to take effect, if manual exposure is greater than 1, even if the exposure is greater than the set
threshold will not enter the long frame mode; If the manual exposure ratio is 1, it will automatically enter long frame mode.
【Related Data Type and Interface】
None.
4.5.2.9. ISP_AE_GAIN_TYPE_E¶
【Description】
Define how the gain is used.
【Syntax】
typedef enum _ISP_AE_GAIN_TYPE_E {
AE_TYPE_GAIN = 0,
AE_TYPE_ISO = 1,
AE_TYPE_BUTT
} ISP_AE_GAIN_TYPE_E;
【Member】
Member |
Description |
---|---|
enGainType |
0 : use the gain method 1 : The way to use ISO num |
【Note】
None.
4.5.2.10. ISP_AE_ATTR_S¶
【Description】
Define auto exposure attributes.
【Syntax】
typedef struct _ISP_AE_ATTR_S
{
ISP_AE_RANGE_S stExpTimeRange;
ISP_AE_RANGE_S stAGainRange;
ISP_AE_RANGE_S stDGainRange;
ISP_AE_RANGE_S stISPDGainRange;
ISP_AE_RANGE_S stSysGainRange;
CVI_U32 u32GainThreshold;
CVI_U8 u8Speed;
CVI_U16 u16BlackSpeedBias;
CVI_U8 u8Tolerance;
CVI_U8 u8Compensation;
CVI_U16 u16EVBias;
ISP_AE_STRATEGY_E enAEStrategyMode;
CVI_U16 u16HistRatioSlope;
CVI_U8 u8MaxHistOffset;
ISP_AE_MODE_E enAEMode;
ISP_ANTIFLICKER_S stAntiflicker;
ISP_SUBFLICKER_S stSubflicker;
ISP_AE_DELAY_S stAEDelayAttr;
CVI_BOOL bManualExpValue;
CVI_U32 u32ExpValue;
ISP_FSWDR_MODE_E enFSWDRMode;
CVI_BOOL bWDRQuick;
CVI_U16 u16ISOCalCoef;
ISP_AE_GAIN_TYPE_E enGainType;
ISP_AE_RANGE_S stISONumRange;
CVI_S16 s16IRCutOnLv;
CVI_S16 s16IRCutOffLv;
ISP_AE_IR_CUT_FORCE_STATUS enIRCutStatus;
CVI_U8 au8AdjustTargetMin[LV_TOTAL_NUM];
CVI_U8 au8AdjustTargetMax[LV_TOTAL_NUM];
CVI_U16 u16LowBinThr;
CVI_U16 u16HighBinThr;
CVI_BOOL bEnableFaceAE;
CVI_U8 u8FaceTargetLuma;
CVI_U8 u8FaceWeight;
CVI_U8 u8GridBvWeight;
CVI_U32 au32Reserve[RESERVE_SIZE];
CVI_U8 u8HighLightLumaThr;
CVI_U8 u8HighLightBufLumaThr;
CVI_U8 u8LowLightLumaThr;
CVI_U8 u8LowLightBufLumaThr;
CVI_BOOL bHistogramAssist;
} ISP_AE_ATTR_S;
【Member】
Member |
Description |
---|---|
stExpTimeRange |
Exposure time range, set the maximum and minimum values in microseconds (us). Value range: [0x0, 0xFFFFFFFF], The specific range is related to the sensor. |
stISONumRange |
ISO num range, set the maximum and minimum values, this setting is only valid when enGainType = AE_TYPE_ISO. Value range: [0x64, 0xFFFFFFFF], The specific range is related to the sensor. |
stAGainRange |
Sensor analog gain range, set maximum and minimum values, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF], The specific range is related to the sensor. |
stDGainRange |
Sensor digital gain range, set maximum and minimum values, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF], The specific range is related to the sensor. |
stISPDGainRange |
ISP digital gain range, set maximum and minimum values, 10bit decimal precision. Value range: [0x400, 0x7FFF]. |
stSysGainRange |
System gain range, set maximum and minimum values, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF], The specific range is related to the sensor. |
u32GainThreshold |
System gain threshold for automatic frame reduction, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF], The default value is 0x400000 |
u8Speed |
The speed at which auto exposure is adjusted. Value range: [0x0, 0xFF], The default value is 0x40. |
u16BlackSpeedBias |
Screen from dark to bright AE adjusts the deviation of the speed, the larger the value, the faster the screen from dark to bright. Value range: [0x0, 0xFFFF], The default value is 0x90. |
u8Tolerance |
Tolerance deviation of screen brightness during automatic exposure adjustment. Value range: [0x0, 0xFF], The default value is 0x2. |
u8Compensation |
Target brightness during automatic exposure adjustment. Value range: [0x0, 0xFF], The default value is 0x38. |
u16EVBias |
Exposure deviation value during automatic exposure adjustment, 10bit decimal precision. Value range: [0x0, 0xFFFF], The default value is 0x400. |
enAEStrategyMode |
Automatic exposure strategy, high light priority or low light priority, the default value is AE_EXP_HIGHLIGHT_PRIOR |
u16HistRatioSlope |
When high/low light is prioritized, adjust the step size of the target brightness. Value range: [0x0, 0xFFFF], The default value is 0x8. |
u8MaxHistOffset |
The maximum extent to which the region of interest contributes to the statistical mean. Value range: [0x0, 0xFF], The default value is 0x10. |
enAEMode |
Auto exposure mode, auto drop frame mode or fixed frame rate mode. The default value is AE_MODE_FIX_FRAME_RATE |
stAntiflicker |
Anti-flash property settings. Anti-flash is disabled by default. |
stSubflicker |
Sub-anti-flash property setting. By default, sub-anti-flash is not enabled. |
stAEDelayAttr |
Delay property setting. Default u16BlackDelayFrame=0 u16WhiteDelayFrame=0. |
bManualExpValue |
Manual exposure is enabled, when the value is CVI_TRUE, the AE algorithm uses u32ExpValue as the current exposure to allocate exposure time and gain, and when it is CVI_FALSE, it uses the automatically calculated exposure to allocate. The default value is CVI_FALSE. |
u32ExpValue |
Manual exposure value, equal to exposure time (lines) * system gain (6bit decimal precision). The default value is 0 Value range: (0x0, 0xFFFFFFFF]. |
enFSWDRMode |
FSWDR mode of operation. The default is ISP_FSWDR_NORMAL_MODE. |
bWDRQuick |
In WDR mode, when the AE algorithm is readjusted from a stable state (the brightness error is less than or equal to the tolerance value u8Tolerance), the default adjustment of the first 50 frames will perform temporal filtering to make the adjustment smoother. When the value is CVI_TRUE, the 50-frame temporal filtering is canceled to make AE converge faster. Defaults to CVI_FALSE. |
u16ISOCalCoef |
The ISO calibration coefficient is used to ensure that the ISO displayed in the DCF information required for taking pictures is standard and 8bit precision. Value range: [0x0, 0xFFFF], The default value is 0x100. |
enGainType |
use way of gain. Choose to control the gain by ISO Num or Gain. |
au8AdjustTargetMin |
Sets the minimum value of the target brightness for each LV AE of ambient brightness to converge. Value range: (0x0, 0x100) The default value of LV -5 ~ 15 is { 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 45, 50, 50, 50, 50, 50, 50, 60, 60, 60} |
au8AdjustTargetMax |
Set the maximum value of the target luminance where each LV AE of ambient luminance converges. Value range: (0x0, 0x100) The default value of LV -5 ~ 15 is { 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 70, 70, 70} |
u16LowBinThr |
When the statistical value of the AE window is lower than lowBinThr(8 bits) and the cumulative number of windows is lower than 25% of the total number of windows, AE does not use the statistical value of this window to measure light. The default is 10 |
u16HighBinThr |
When the statistical value of the AE window is higher than HighBinThr(8 bits) and the cumulative number of windows is lower than 10% of the total number of windows, AE does not use the statistical value of this window to measure light. The default is 256 |
s16IRCutOnLv |
When IR Cut is switchable, use the ambient Lv value of IR Cut, the precision is 100 threshold, The default value is 0 |
s16IRCutOffLv |
When the IR Cut is switchable, the Lv value of the environment without the IR Cut has an accuracy of 100 The default value is 700 |
enIRCutStatus |
When IR Cut can be switched, the mode setting of IR Cut switching, the default value is AE_IR_CUT_FORCE_AUTO |
bEnableFaceAE |
Face recognition linked AE metering (Face AE) enabled |
u8FaceTargetLuma |
Target brightness for face metering (8 bits) |
u8FaceWeight |
The weight ratio of face metering and overall environment metering |
u8GridBvWeight |
AE metering is divided into two types: block luma / bvStep average. The default is luma-based. This parameter can be used to set the metering weight of luma-based metering mixed with bvStep. Highlight priority. If the image is too dark, you can increase it appropriately This parameter weight |
au32Reserve[RESERVE_SIZE] |
Reserved field, meaningless |
u8HighLightLumaThr |
The brightness threshold of the highlighted area |
u8HighLightBufLumaThr |
Brightness threshold of the highlight buffer |
u8LowLightLumaThr |
Brightness threshold for low light areas |
u8LowLightBufLumaThr |
Brightness threshold for low light buffers |
bHistogramAssist |
Use histogram statistics to assist the highlight strategy to deal with the case where the highlight area is smaller than a block size |
【Note】
Automatic mode, change the manual exposure attribute’s value will not take effect.
The maximum and minimum time and gain of automatic exposure.
The exposure time and gain can be limited according to different scenes.
If there is a high-speed moving object scene, the maximum exposure time can be limited to a small value, which can reduce the dragging phenomenon of
moving objects.
System gain for automatic exposure
If (minimum sensor analog gain * minimum sensor digital gain * minimum ISP digital gain) is less than the minimum system gain, the minimum gain in
the internal calculation of AE algorithm will be limited to the minimum system gain.
If (maximum analog gain of sensor * maximum digital gain of sensor * maximum digital gain of ISP) is greater than maximum system gain, the maximum
gain in the internal calculation of AE algorithm will be limited to the maximum system gain.
It is recommended to set the maximum and minimum system gain to limit the analog gain of the sensor, the digital gain of the sensor, and the ISP
digital gain respectively.
If the ISP digital gain of higher precision is limited to 1 times, flicker may occur.
In fact, the AE algorithm internally uses the system gain to calculate the maximum/minimum exposure, rather than directly limiting the value of a gain.
For example, the maximum system gain is limited to 1 times, but the minimum analog gain of the sensor is limited to 2 times.
Then the actual effective results are subject to the limits of the analog gain of the sensor, and the same applies to the limits of the digital gain
of the sensor and the digital gain of the ISP.
System gain threshold for automatic frame drop
In SLOW_SHUTTER mode, when the system gain reaches a set threshold, the system automatically enters the SLOW_SHUTTER mode.
u8Speed convergence speed for setting automatic exposure, the value is, the greater the exposure of the faster convergence speed, but also leads to repeatedly appeared in the process of convergence oscillation.
u16BlackSpeedBias used to set from dark to bright picture AE to adjust speed deviation. Under default u8Speed, the screen speed from light to dark will be faster than the screen speed from dark to light. If the adjustment speed of AE in both directions is similar, you can adjust u16BlackSpeedBias.
brightness compensation property u8Compensation targets to adjust the exposure intensity. The larger the exposure brightness compensation value, the higher the image brightness.
exposure deviation property u16EVBias targets to under a special scene images to brightness fine-tuning, also can be regarded as the brightness of the higher precision compensation value, by adjusting the value to change the picture target brightness, the real effect of AE target brightness for u8Compensation * u16EVBias / 1024. The larger the u8Compensation value is, the higher the image brightness will be.
exposure tolerance deviation property u8Tolerance used to adjust the exposure to the environment, the sensitivity of the tolerance deviation, the greater the exposure, the less sensitive, and may lead to the same target brightness values repeatedly adjust brightness difference is, the greater the so recommend this property cannot be set too big.
enAEStrategyMode exposure strategy attribute is used to select the high priority or low light exposure policy priority. Highlighting first means being sensitive to highlights and trying to avoid overexposure. Low light priority means being sensitive to low light and trying to see dark areas clearly, whether or not the image is overexposed. The default exposure strategy is highlight first, The user can adjust it according to the needs of the scene. When the highlight is priority, the user can set u8HighLightLumaThr to determine the brightness threshold of the highlight area. When there is windows exceeding this brightness threshold in the screen (the weight of the windows is not 0), When the brightness of all windows is lower than u8HighLightBufLumaThr, the original target brightness will be restored. When the brightness of low light is priority, If there is windows in the screen below the u8LowLightLumaThr brightness threshold (the weight of this windows is not 0), Then the target brightness would be increased to brighten the brightness of the low-light windows. When the brightness of all windows was greater than u8LowLightBufLumaThr, the original target brightness would be restored.
u16HistRatioSlope is used to set the weight of interested area. If the highlight priority mode is used, this value sets the weight of the highlight area. The larger the value, the more sensitive it is to the highlight area. On the other hand, in low-light priority mode, this value sets the weight of the low-light area. A higher value means more sensitive to the dark areas. It is recommended that u16HistRatioSlope not exceed 0x100.
automatic exposure, can be set on the impact of interested area on statistical average u8MaxHistOffset to the greatest extent. This value limits how much weight can be added to raise u16HistRatioSlope. A value of 0, no matter how large the u16HistRatioSlope is, will not give special treatment to the highlighted or low-light areas, and the statistical mean will be the original value. Reasonable setting of this value can ensure that the average brightness of any scene after AE stabilization is within a certain range. In the high-priority exposure mode, if this value is set to a large extent, the overall brightness of the picture may be low in the scene with slightly higher contrast, such as the sunny outdoor scene with sky and trees, because the effect of bright area sky is guaranteed first. This problem can be solved by limiting the value and thus the degree of tilt to bright areas.
exposure switching strategy, it is best update u16HistRatioSlope and u8MaxHistOffset value at the same time, otherwise the two values will adopt a strategy of configuration, may not correspond with the expected effect.
when doing light inhibition, it is suggested that the specular preferred exposure mode, by reducing the AE target brightness, at the same time, setting up reasonable u16HistRatioSlope and u8MaxHistOffset to suppress strong light, dark space will be enabled to DRC to see clearly. Low light priority can be used to realize the backlight compensation of non-specified areas.
AE for automatic exposure control type, can be set enAEMode exposure mode. This value can be set to SLOW_SHUTTER or fixed frame rate mode. Slow shutter mode is usually used to automatically drop frames in low-light scenes to reduce picture noise.
flash attribute structure stAntiflicker resistance can be used to set flash enabled, flash frequency and resisting properties such as flash mode. In FSWDR mode, anti-flicker is effective only for long frames. Since the maximum exposure time for short frames is limited as exposure ratio changes, it is recommended to use automatic anti-flash mode for FSWDR mode.
the flash attribute structure stSubflicker resistance can be used to set the degree of flash flash enabled and resisting properties. If there is an automatic aperture, it is recommended to turn off the sub-anti-flash function.
AE for automatic exposure control type, can be set structure stAEDelayAttr AE delay effect attributes. The reasonable setting of this value can improve the stability of the picture brightness and prevent the change of the picture brightness caused by fast moving objects. This value should be increased appropriately at low bit rate Settings to avoid blocking effect when AE is adjusted.
users can will be for CVI_TRUE bManualExpValue, manually exposure u32ExpValue to block out the AE exposure to adjust part of the algorithm, only to exposure distribution part. The value of u32ExpValue is limited by the maximum and minimum exposure. The maximum and minimum exposures correspond to the product of the maximum and minimum exposure time and gain, respectively.
FSWDR operation mode change, need to modify the cmos. Corresponding callback function in c: cmos_get_ae_default, cmos_fps_set, cmos_get_inttime_max, to ensure the long and short exposure time frame in a reasonable range. When switching between normal WDR and long-frame modes, the cmos_get_ae_default is called back to update the maximum/minimum exposure time, maximum/minimum gain, maximum/minimum aperture, and AE compensation. Internally, AE updates u16HistRatioSlope and u8MaxHistOffset to their algorithm defaults. It is important to note that the exposure ratio Settings will not be updated and will remain the same as last time.
au8AdjustTargetMin/au8AdjustTargetMax can brightness set different goals for different environment brightness min/big value, AE will be based on the current environment brightness convergence target brightness to the area in between
u16LowBinThr/u16HighBinThr this parameter can be set to exclude AE metering, too dark and too bright part of the image, suggest u16LowBinThr not more than 10 (8 bits)
enIRCutStatus s16IRCutOnLv/s16IRCutOffLv when product of the IR Cut for the swappable, this parameter can be used, when switching mode to Auto, depending On the setting of environmental brightness to switch On/Off the IR Cur. It is recommended that the brightness difference between the two environments should be more than 6 LV, so that frequent and repeated switching will not occur
【Related Data Type and Interface】
4.5.2.11. ISP_ME_ATTR_S¶
【Description】
Define manual exposure attributes.
【Syntax】
typedef struct _ISP_ME_ATTR_S
{
ISP_OP_TYPE_E enExpTimeOpType;
ISP_OP_TYPE_E enAGainOpType;
ISP_OP_TYPE_E enDGainOpType;
ISP_OP_TYPE_E enISPDGainOpType;
CVI_U32 u32ExpTime;
CVI_U32 u32AGain;
CVI_U32 u32DGain;
CVI_U32 u32ISPDGain;
ISP_OP_TYPE_E enISONumOpType;
ISP_AE_GAIN_TYPE_E enGainType;
CVI_U32 u32ISONum;
} ISP_ME_ATTR_S;
【Member】
Member |
Description |
---|---|
enExpTimeOpType |
Manual exposure time enable, the default value is OP_TYPE_AUTO |
enAGainOpType |
Manual sensor analog gain enable, the default value is OP_TYPE_AUTO |
enDGainOpType |
Manual sensor digital gain enable, the default value is OP_TYPE_AUTO |
enISPDGainOpType |
Manual ISP digital gain enable, the default value is OP_TYPE_AUTO |
u32ExpTime |
Manual exposure time, in microseconds (us), the default value is 0x4000. Value range: [0x0, 0xFFFFFFFF], the specific range is related to the sensor. |
u32AGain |
Manual sensor analog gain, 10bit decimal precision, the default value is 0x400. Value range: [0x400, 0xFFFFFFFF], the specific range is related to the sensor. |
u32DGain |
Manual sensor digital gain, 10bit decimal precision, the default value is 0x400. Value range: [0x400, 0xFFFFFFFF], the specific range is related to the sensor. |
u32ISPDGain |
Manual ISP digital gain, 10bit decimal precision, the default value is 0x400. Value range: [0x400, 0x40000], the specific range is related to the sensor. |
enISONumOpType |
Choose to control the gain by ISO Num or gain, the default value is 0 |
enGainType |
way of gain. |
u32ISONum |
Manual ISO Num gain, the default value is 100 , only works when enGainType = AE_TYPE_ISO. |
【Note】
manual mode, manual exposure time and gain value will be automatically mode maximum/minimum exposure time and gain.
manual exposure can make effective parameters, you must set up corresponding manual exposure parameters, if not set, USES the system default.
gain unit for 10 bit decimal multiples of accuracy, namely 1024 representative 1 times.
If exposure parameter Settings beyond the maximum (small), will use the sensor to support maximum (small) instead.
【Related Data Type and Interface】
4.5.2.12. ISP_EXPOSURE_ATTR_S¶
【Description】
Define ISP exposure attributes.
【Syntax】
typedef struct _ISP_EXPOSURE_ATTR_S
{
CVI_BOOL bByPass;
ISP_OP_TYPE_E enOpType;
CVI_U8 u8AERunInterval;
CVI_BOOL bHistStatAdjust;
CVI_BOOL bAERouteExValid;
ISP_ME_ATTR_S stManual;
ISP_AE_ATTR_S stAuto;
CVI_U8 u8DebugMode;
ISP_AE_METER_MODE_E enMeterMode;
CVI_BOOL bAEGainSepCfg;
} ISP_EXPOSURE_ATTR_S;
【Member】
Member |
Description |
---|---|
bByPass |
The AE module bypass function is enabled, and the default is CVI_FALSE. |
enOpType |
Automatic exposure or manual exposure switch, the default is OP_TYPE_AUTO. |
u8AERunInterval |
The interval at which the AE algorithm runs, and the value range is [1, 255]. When the value is 1, it means that the AE algorithm is run every frame; When the value is 2, it means to run the AE algorithm every 2 frames, and so on. It is recommended not to set this value greater than 2, otherwise the AE adjustment speed will be affected. In WDR mode, it is recommended to set this value to 1, so that AE convergence will be smoother. This value defaults to 1. |
bHistStatAdjust |
This parameter will lower AE’s metering brightness for bright areas, making the bright areas brighter. For large-area sky scenes, if the metering is too dark, you can set this parameter Default is 0 |
bAERouteExValid |
Whether the AE extended distribution route is valid or not. When CVI_TRUE, use the AE extended distribution route, otherwise use the normal AE distribution route. Defaults to CVI_FALSE. |
stManual |
Manual Exposure Properties Structure |
stAuto |
Auto Exposure Properties Structure |
u8DebugMode |
Set the debug mode of AE, used for debug functions such as dump log, normally 0 |
enMeterMode |
AE metering method. 0 : AE_METER_MULTI central weighted metering. 1 : AE_METER_AVERAGE average weighted metering. 2 : AE_METER_HIGHLIHGT_PRIORITY Bright area priority metering, suitable for IR sensor use, the default value is AE_METER_MULTI |
bAEGainSepCfg |
Whether the long and short frame gains are allocated separately |
【Note】
When AE ByPass is CVI_TRUE, the AE module is bypassed, and any AE configuration will not affect the image brightness. ISP_AE_RESULT_S remains the value of the previous frame of AE bypass.
When WDR/Linear mode is switched, u8AERunInterval will be reset to 1, and the user can modify this value as needed after the switch is completed.
bAEGainSepCfg can only take effect when it is configured in 2to1WDR mode and the sensor supports this function.
Manual mode does not support the separate distribution of long and short frame gains
【Related Data Type and Interface】
4.5.2.13. ISP_WDR_EXPOSURE_ATTR_S¶
【Description】
Define exposure attributes in WDR mode.
【Syntax】
#define EXP_RATIO_NUM (3)
typedef struct _ISP_WDR_EXPOSURE_ATTR_S
{
ISP_OP_TYPE_E enExpRatioType;
CVI_U32 au32ExpRatio[EXP_RATIO_NUM];
CVI_U32 u32ExpRatioMax;
CVI_U32 u32ExpRatioMin;
CVI_U16 u16Tolerance;
CVI_U16 u16Speed;
CVI_U16 u16RatioBias;
CVI_U8 u8SECompensation;
CVI_U16 u16SEHisThr;
CVI_U16 u16SEHisCntRatio1;
CVI_U16 u16SEHisCntRatio2;
CVI_U16 u16SEHis255CntThr1;
CVI_U16 u16SEHis255CntThr2;
CVI_U8 au8LEAdjustTargetMin[LV_TOTAL_NUM];
CVI_U8 au8LEAdjustTargetMax[LV_TOTAL_NUM];
CVI_U8 au8SEAdjustTargetMin[LV_TOTAL_NUM];
CVI_U8 au8SEAdjustTargetMax[LV_TOTAL_NUM];
CVI_U8 u8AdjustTargetDetectFrmNum;
CVI_U32 u32DiffPixelNum;
CVI_U16 u16LELowBinThr;
CVI_U16 u16LEHighBinThr;
CVI_U16 u16SELowBinThr;
CVI_U16 u16SEHighBinThr;
CVI_U8 au8FrameAvgLumaMin[LV_TOTAL_NUM];
CVI_U8 au8FrameAvgLumaMax[LV_TOTAL_NUM];
} ISP_WDR_EXPOSURE_ATTR_S;
【Member】
Member |
Description |
---|---|
enExpRatioType |
Only valid in multi-frame synthesis WDR mode. OP_TYPE_AUTO: Automatically calculate the exposure ratio of long and short frames according to the scene; OP_TYPE_MANUAL: Manually configure the exposure ratio of long and short frames. |
au32ExpRatio |
Only valid in multi-frame synthesis WDR mode. When enExpRatioType is OP_TYPE_AUTO, au32ExpRatio is invalid. When enExpRatioType is OP_TYPE_MANUAL, au32ExpRatio indicates the expected exposure ratio of two adjacent WDR frames for two-frame synthesis. Among them, au32ExpRatio[0] is the exposure ratio of long detection/short detection. 6bit decimal precision, 0x40 means the exposure ratio is 1 times. Value range: [0x40, 0xFFF] |
u32ExpRatioMax |
Only valid in multi-frame synthesis WDR mode. When enExpRatioType is OP_TYPE_AUTO, u32ExpRatioMax indicates the maximum value of the ratio of the exposure time of the longest frame to the shortest frame. That is, when 2 frames are synthesized, it represents the maximum value of the long-d etection/short-detection exposure ratio. u32ExpRatioMax is invalid when enExpRatioType is OP_TYPE_MANUAL. 6bit decimal precision, 0x40 means the exposure ratio is 1 times. Value range: [0x40, 0x4000] |
u32ExpRatioMin |
Only valid in multi-frame synthesis WDR mode. When enExpRatioType is OP_TYPE_AUTO, u32ExpRatioMin indicates the minimum value of the ratio of long frame exposure time to short frame exposure time. When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatioMin is invalid. The format is unsigned 6.6bit fixed point, 0x40 means that the ratio of long frame exposure time to short frame exposure time is 1 times. The default value is 0x40. Value range: [0x40, u32ExpRatioMax] |
u16Tolerance |
The tolerance deviation of the screen brightness during exposure adjustment is only valid in the two-frame composite WDR mode. The default is 5 Value range: [0x0, 0xFF] |
u16Speed |
The automatic exposure ratio adjustment speed is only valid in the two-frame synthesis WDR mode. When enExpRatioType is OP_TYPE_AUTO, the larger the value, the faster the automatic exposure ratio adjustment. The default value is 0x20. Value range: [0x0, 0xFF] |
u16RatioBias |
The exposure ratio deviation value is only valid in multi-frame synthesis WDR mode. When enExpRatioType is OP_TYPE_AUTO, the larger the value, the larger the automatic exposure ratio. The default value is 0x400, which means that the calculation result of the automatic exposure ratio algorithm will not be adjusted. The exposure ratio adjusted by this value will be limited by the maximum/minimum value of the exposure ratio. Value range: [0x0, 0xFFFF] |
u8SECompensation |
The target brightness of short detection, the default value is 56 |
au8LEAdjustTargetMin |
Set the minimum value of the target brightness for each LV AE to converge to the long-term ambient brightness. Value range: (0x0 , 0x100), The default value of LV -5 ~ 15 is { 15, 15, 15, 15, 15, 15, 15, 20, 20, 25, 30, 35, 40, 40, 50, 50, 55, 60, 60, 60, 60} |
au8LEAdjustTargetMax |
Set the maximum value of the target brightness for each LV AE to converge to the ambient brightness of the long-term detection. Value range: (0x0 , 0x100), The default value of LV -5 ~ 15 is {25, 25, 25, 25,25, 25, 25, 30, 30, 35, 40, 45, 50, 50, 60, 60, 70, 75, 75,75, 75} |
au8SEAdjustTargetMin |
Set the minimum value of the target brightness for each LV AE to converge to the short detection ambient brightness. Value range: (0x0 , 0x100), The default value of LV -5 ~ 15 is {5, 5, 5, 5, 5, 5, 5, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 20, 20, 20, 20} |
au8SEAdjustTargetMax |
Set the maximum value of the target brightness for each LV AE to converge to the ambient brightness of the long-term detection. Value range: (0x0 , 0x100), The default value of LV -5 ~ 15 is {15, 15, 15, 15,15, 15, 15, 20, 20, 25, 25, 25, 25, 30, 40, 50, 60, 60, 60, 60, 60} |
u16LELowBinThr |
When the long detection AE window statistical value is lower than lowBinThr(8 bits), long detection AE does not use the statistical value of this window to measure light, the default value is 0 |
u16LEHighBinThr |
Long Detection AE window statistics value is higher than HighBinThr(8 bits) and when the cumulative number of windows does not exceed 25% of the total number of windows, Long Detection AE does not use the statistical value of this window to measure light, the default value is 240 |
u16SELowBinThr |
When the short detection AE window statistical value is lower than lowBinThr(8 bits), short detection AE does not use the statistical value of this window to measure light, the default value is 8 |
u16SEHighBinThr |
When the short detection AE window statistical value is higher than HighBinThr(8 bits), the short detection AE does not use the statistical value of this window to measure light, the default value is 246 |
au8FrameAvgLumaMax |
Not limited by u16LELowBinThr/ u16LEHighBinThr, the average weighted brightness threshold of the long detection screen, when the average weighted brightness of the long detection screen (this brightness can be known from ExposureInfo u8LEFrameAvgLuma) exceeds this threshold, the exposure will limit the brightness to this threshold |
【Note】
For some sensors that have a limit on the maximum exposure time of short frames, the exposure is relatively small, the maximum exposure time of long frames is short, and the image dynamic range and noise performance is poor, resulting in inaccurate automatic exposure ratio calculations. At this time, it is recommended to limit the minimum The exposure ratio ensures that the maximum exposure time of long frames reaches at least 3ms.
It is recommended not to set u16Speed to less than 0x8, to avoid the exposure ratio adjustment being too slow or even not adjusted due to insufficient calculation accuracy in some scenes. Excessive u16Speed may cause the exposure ratio to change too quickly, causing the brightness of the screen to oscillate.
It is recommended not to set u32ExpRatio greater than 0x400 in manual mode. If the exposure ratio is greater than 0x400, in a bright ultra-wide dynamic scene, appropriately increasing the exposure ratio will optimize the long- frame image noise performance. However, in dark or low wide dynamic scenes, if the exposure ratio is too large, the maximum exposure time of short frames will be compressed, resulting in poor image noise performance, and there will be obvious noise discontinuity, and motion performance will also deteriorate.
【Related Data Type and Interface】
4.5.2.14. ISP_AE_ROUTE_NODE_S¶
【Description】
Define AE assignment route node attributes.
【Syntax】
typedef struct _ISP_AE_ROUTE_NODE_S
{
CVI_U32 u32IntTime;
CVI_U32 u32SysGain;
ISP_IRIS_F_NO_E enIrisFNO;
CVI_U32 u32IrisFNOLin;
} ISP_AE_ROUTE_NODE_S;
【Member】
Member |
Descirption |
---|---|
u32IntTime |
Node exposure time, in microseconds (us).Value range: (0x0, 0xFFFFFFFF] |
u32SysGain |
Node gain, including sensor analog gain, sensor digital gain and ISP digital gain, 10bit precision.Value range: [0x400, 0xFFFFFFFF] |
enIrisFNO |
Node aperture F value size, only supports P-Iris, not DC-Iris.Value range: [ISP_IRIS_F_NO_32_0, ISP_IRIS_F_NO_1_0]. |
u32IrisFNOLin |
Node aperture F value equivalent gain size, only supports P-Iris, not DC-Iris.Value range: [1, 1024] |
【Note】
None.
【Related Data Type and Interface】
4.5.2.15. ISP_AE_ROUTE_S¶
【Description】
Define AE exposure assignment policy attributes.
【Syntax】
#define ISP_AE_ROUTE_MAX_NODES (16)
typedef struct _ISP_AE_ROUTE_S
{
CVI_U32 u32TotalNum;
ISP_AE_ROUTE_NODE_S astRouteNode[ISP_AE_ROUTE_MAX_NODES];
} ISP_AE_ROUTE_S;
【Member】
Member |
Descirption |
---|---|
u32TotalNum |
The number of exposure distribution route nodes, currently the maximum is 16. |
astRouteNode [ISP_AE_ROUTE_MAX_NODES] |
Exposure assignment route node properties. |
【Note】
None.
【Related Data Type and Interface】
4.5.2.16. ISP_AE_ROUTE_EX_NODE_S¶
【Description】
Define the attribute of AE extension assignment route node.
【Syntax】
typedef struct _ISP_AE_ROUTE_EX_NODE_S
{
CVI_U32 u32IntTime;
CVI_U32 u32Again;
CVI_U32 u32Dgain;
CVI_U32 u32IspDgain;
ISP_IRIS_F_NO_E enIrisFNO;
CVI_U32 u32IrisFNOLin;
} ISP_AE_ROUTE_EX_NODE_S;
【Member】
Member |
Descirption |
---|---|
u32IntTime |
Node exposure time, in microseconds (us).Value range: (0x0, 0xFFFFFFFF] |
u32Again |
Sensor analog gain, 10bit precision.Value range: [0x400, 0x3FFFFF] |
u32Dgain |
Sensor digital gain, 10bit precision.Value range: [0x400, 0x3FFFFF] |
u32IspDgain |
ISP digital gain, 10bit precision.Value range: [0x400, 0x40000] |
enIrisFNO |
Node aperture F value size, only supports P-Iris, not DC-Iris.Value range: [ISP_IRIS_F_NO_32_0, ISP_IRIS_F_NO_1_0] |
u32IrisFNOLin |
Node aperture F value equivalent gain size, only supports P-Iris, not DC-Iris.Value range: [1, 1024] |
【Note】
None.
【Related Data Type and Interface】
4.5.2.17. ISP_AE_ROUTE_EX_S¶
【Description】
Define extended attributes of AE exposure allocation strategy.
【Syntax】
#define ISP_AE_ROUTE_EX_MAX_NODES (16)
typedef struct _ISP_AE_ROUTE_EX_S
{
CVI_U32 u32TotalNum;
ISP_AE_ROUTE_EX_NODE_S astRouteExNode[ISP_AE_ROUTE_EX_MAX_NODES];
} ISP_AE_ROUTE_EX_S;
【Member】
Member |
Descirption |
---|---|
u32TotalNum |
The number of exposure extension distribution route nodes is currently up to 16. |
astRouteExNode [ISP_AE_ROUTE_EX_MAX_NODES] |
The exposure extension assigns route node properties. |
【Note】
None.
【Related Data Type and Interface】
4.5.2.18. ISP_EXP_INFO_S¶
【Description】
Define the internal state information of ISP exposure.
【Syntax】
#define HIST_NUM (256)
typedef struct _ISP_EXP_INFO_S
{
CVI_U32 u32ExpTime;
CVI_U32 u32ShortExpTime;
CVI_U32 u32MedianExpTime;
CVI_U32 u32LongExpTime;
CVI_U32 u32AGain;
CVI_U32 u32DGain;
CVI_U32 u32ISPDGain;
CVI_U32 u32Exposure;
CVI_BOOL bExposureIsMAX;
CVI_S16 s16HistError;
CVI_U32 au32AE_Hist256Value[HIST_NUM];
CVI_U8 u8AveLum;
CVI_U32 u32LinesPer500ms;
CVI_U32 u32PirisFNO;
CVI_U32 u32Fps;
CVI_U32 u32ISO;
CVI_U32 u32ISOCalibrate;
CVI_U32 u32RefExpRatio;
CVI_U32 u32FirstStableTime;
ISP_AE_ROUTE_S stAERoute;
ISP_AE_ROUTE_EX_S stAERouteEx;
CVI_U8 u8WDRShortAveLuma;
CVI_U32 u32WDRExpRatio;
CVI_U8 u8LEFrameAvgLuma;
CVI_U8 u8SEFrameAvgLuma;
CVI_FLOAT fLightValue;
CVI_U32 u32AGainSF;
CVI_U32 u32DGainSF;
CVI_U32 u32ISPDGainSF;
CVI_U32 u32ISOSF;
ISP_AE_ROUTE_S stAERouteSF;
ISP_AE_ROUTE_EX_S stAERouteSFEx;
CVI_BOOL bGainSepStatus;
}ISP_EXP_INFO_S;
【Member】
Member |
Description |
---|---|
u32ExpTime |
The current exposure time, in microseconds (us). Value range: [0x0, 0xFFFFFFFF] |
u32ShortExpTime |
In FSWDR mode, it indicates the exposure time of the current short frame (S), in microseconds (us). Linear mode does not care about this value. Value range: [0x0, 0xFFFFFFFF] |
u32LongExpTime |
In FSWDR mode, it indicates the current long frame exposure time in microseconds (us). Value range: [0x0, 0xFFFFFFFF] |
u32AGain |
Current sensor analog gain, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF] |
u32DGain |
Current sensor digital gain, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF] |
u32ISPDGain |
Current ISP digital gain, 10bit decimal precision. Value range: [0x400, 0xFFFFFFFF] |
u32Exposure |
The current exposure is equal to the product of exposure time and exposure gain, where the unit of exposure time is the number of exposure lines, and the exposure gain is 6bit decimal precision. Value range: [0x40, 0xFFFFFFFF] |
bExposureIsMAX |
0: ISP has not reached the maximum exposure level; 1: ISP reaches maximum exposure level. |
s16HistError |
Statistical information, the difference between the target luminance value of AE and the actual value. A positive value indicates that the current expected luminance information is greater than the actual luminance information. A negative value indicates that the expected luminance information is smaller than the actual luminance information. |
au32AE_Hist256Value |
Global 256-segment histogram statistics Value range: [0x0, 0xFFFFFFFF] |
u8AveLum |
average brightness information Value range: [0x0, 0xFF] |
u32LinesPer500ms |
The current number of exposure lines corresponding to every 500ms can be used to convert the unit of exposure time from us to the number of lines. Value range: [0x0, 0xFFFFFFFF] |
u32PirisFNO |
The equivalent gain corresponding to the current P-Iris aperture F value. Value range: [0x0, 0x400] |
u32Fps |
Actual image frame rate * 100. Value range: [0x0, 0xFFFFFFFF] |
u32ISO |
Current sensor analog gain * sensor digital gain * ISP digital gain * 100, where the accuracy of the gain is 10bit. Value range: [0x64, 0xFFFFFFFF] |
u32ISOCalibrate |
Standard ISO, used for displaying DCF information in photos. u32ISOCalibrate = u32ISO * 256 / u16ISOCalCoef. |
u32RefExpRatio |
The reference exposure ratio, used to estimate the dynamic range of the current scene, will be affected by the values of Tolerance and Speed in ISP_WDR_EXPOSURE_ATTR_S. Value range: [0x40, 0x4000] |
u32FirstStableTime |
The time for the first AE to converge and stabilize, in microseconds (us). Value range: [0x0, 0xFFFFFFFF] |
stAERoute |
For the actual effective AE route, the exposure time in each node is in us, the gain is 10bit precision, and the aperture value range is [ISP_IRIS_F_NO_32_0, ISP_IRIS_F_NO_1_0]. When the aperture type is DC-Iris, the node aperture value will not affect the exposure distribution. |
stAERouteEx |
For the extended AE route that actually takes effect, the exposure time in each node is in us, the gain is 10bit precision, and the aperture value range is [ISP_IRIS_F_NO_32_0, ISP_IRIS_F_NO_1_0]. When the aperture type is DC-Iris, the node aperture value will not affect the exposure distribution. |
u32WDRExpRatio |
WDR long/short detection exposure ratio, 6 bits precision |
u8WDRShortAveLuma |
The screen brightness of short detection |
u8LEFrameAvgLuma |
The average brightness of the screen of Long Detection |
u8SEFrameAvgLuma |
The average brightness of the short detection screen |
fLightValue |
Ambient brightness value |
【Note】
None.
【Related Data Type and Interface】
4.5.3. IRIS¶
ISP_IRIS_STATUS_E :Define ISP aperture status.
ISP_IRIS_TYPE_E :Define ISP aperture type.
ISP_IRIS_F_NO_E :Define ISP aperture F value.
ISP_MI_ATTR_S :Define manual aperture attributes.
ISP_DCIRIS_ATTR_S :Define DC-Iris Deep Learning algorithm attributes.
ISP_PIRIS_ATTR_S :Define the P-Iris attribute.
ISP_IRIS_ATTR_S :Define the ISP aperture properties.
4.5.3.1. ISP_IRIS_STATUS_E¶
【Description】
Define ISP aperture status.
【Syntax】
typedef enum _ISP_IRIS_STATUS_E
{
ISP_IRIS_KEEP = 0,
ISP_IRIS_OPEN = 1,
ISP_IRIS_CLOSE = 2,
ISP_IRIS_BUTT
} ISP_IRIS_STATUS_E;
【Member】
Member |
Description |
---|---|
ISP_IRIS_KEEP |
The aperture maintains its current state. |
ISP_IRIS_OPEN |
Aperture wide open. |
ISP_IRIS_CLOSE |
Aperture fully closed. |
【Note】
When the value is set to ISP_IRIS_OPEN or ISP_IRIS_CLOSE, the iris is fully open or fully closed, which can be used to test whether the Deep Learning circuit and driver are correct.
The priority of OPEN and CLOSE is higher than that of Deep Learning enable and manual/auto mode.
When the Deep Learning algorithm is running, in order to ensure its normal operation, the value needs to be set to ISP_IRIS_KEEP.
【Related Data Type and Interface】
None.
4.5.3.2. ISP_IRIS_TYPE_E¶
【Description】
Define ISP aperture type.
【Syntax】
typedef enum _ISP_IRIS_TYPE_E
{
ISP_IRIS_DC_TYPE = 0,
ISP_IRIS_P_TYPE,
ISP_IRIS_TYPE_BUTT,
} ISP_IRIS_TYPE_E;
【Member】
Member |
Description |
---|---|
ISP_IRIS_DC_TYPE |
DC-Iris aperture |
ISP_IRIS_P_TYPE |
P-Iris aperture |
【Note】
The correct aperture type must be set for the Deep Learning algorithm to work properly.
If it is connected with a manual iris lens, this value can be set to ISP_IRIS_DC_TYPE, and it is recommended to disable Deep Learning enablement at this time.
【Related Data Type and Interface】
None.
4.5.3.3. ISP_IRIS_F_NO_E¶
【Description】
Define ISP aperture F value.
【Syntax】
typedef enum _ISP_IRIS_F_NO_E
{
ISP_IRIS_F_NO_32_0 = 0,ISP_IRIS_F_NO_22_0,ISP_IRIS_F_NO_16_0,ISP_IRIS_F_NO_11_0,ISP_IRIS_F_NO_8_0,ISP_IRIS_F_NO_5_6,ISP_IRIS_F_NO_4_0,ISP_IRIS_F_NO_2_
8,ISP_IRIS_F_NO_2_0,ISP_IRIS_F_NO_1_4,ISP_IRIS_F_NO_1_0,ISP_IRIS_F_NO_BUTT,
} ISP_IRIS_F_NO_E;
【Member】
Member |
Description |
Equivalent Gain |
---|---|---|
ISP_IRIS_F_NO_32_0 |
Aperture F32.0 |
1 |
ISP_IRIS_F_NO_22_0 |
Aperture F22.0 |
2 |
ISP_IRIS_F_NO_16_0 |
Aperture F16.0 |
4 |
ISP_IRIS_F_NO_11_0 |
Aperture F11.0 |
8 |
ISP_IRIS_F_NO_8_0 |
Aperture F8.0 |
16 |
ISP_IRIS_F_NO_5_6 |
Aperture F5.6 |
32 |
ISP_IRIS_F_NO_4_0 |
Aperture F4.0 |
64 |
ISP_IRIS_F_NO_2_8 |
Aperture F2.8 |
128 |
ISP_IRIS_F_NO_2_0 |
Aperture F2.0 |
256 |
ISP_IRIS_F_NO_1_4 |
Aperture F1.4 |
512 |
ISP_IRIS_F_NO_1_0 |
Aperture F1.0 |
1024 |
【Note】
For P-Iris, when the AE algorithm calculates the exposure according to the distribution route, the aperture F value should be equivalent to a gain, the formula is as follows: equivalent gain FNO = 1 << ISP_IRIS_F_NO_XX_XX.
It can be seen that F32.0 corresponds to gain 1, F22.0 corresponds to gain 2, F16.0 corresponds to gain 4, and so on, F1.0 corresponds to gain 1024.
【Related Data Type and Interface】
None.
4.5.3.4. ISP_MI_ATTR_S¶
【Description】
Define manual aperture attributes.
【Syntax】
typedef struct _ISP_MI_ATTR_S
{
CVI_U32 u32HoldValue;
ISP_IRIS_F_NO_E enIrisFNO;
} ISP_MI_ATTR_S;
【Member】
Member |
Description |
---|---|
u32HoldValue |
Deep Learning correction value, used for DC-Iris debugging.The value range is [0x0, 0x3E8]. |
enIrisFNO |
The size of the manual aperture is distinguished according to the aperture F value, only supports P-Iris, not DC-Iris. |
【Note】
When docking DC-Iris lens, if ISP_IRIS_STATUS_E is set to ISP_IRIS_KEEP, manual iris is enabled, u32HoldValue can be used for DC-Iris debugging, and the duty cycle of PWM at this time is u32HoldValue.
When docking a P-Iris lens, if ISP_IRIS_STATUS_E is set to ISP_IRIS_KEEP, the manual iris is enabled, and enIrisFNO can be used for P-Iris debugging. At this time, the P-Iris stepping motor will be controlled to move to the position where the iris F value is closest to enIrisFNO. In the automatic exposure mode, the P-Iris manual aperture does not take effect. If you want to fix the aperture to a certain F value, you can set enMaxIrisFNOTarget/ enMinIrisFNOTarget to the same value to achieve.
【Related Data Type and Interface】
None.
4.5.3.5. ISP_DCIRIS_ATTR_S¶
【Description】
Define DC-Iris Deep Learning algorithm attributes.
【Syntax】
typedef struct _ISP_DCIRIS_ATTR_S
{
CVI_S32 s32Kp;
CVI_S32 s32Ki;
CVI_S32 s32Kd;CVI_U32 u32MinPwmDuty;CVI_U32 u32MaxPwmDuty;CVI_U32 u32OpenPwmDuty;
} ISP_DCIRIS_ATTR_S;
【Member】
Member |
Description |
---|---|
s32Kp |
Proportional gain, used to adjust the opening and closing speed of the aperture, the larger the value is, the faster the opening and closing speed of the aperture will be. If the value is too small, it is easy to cause oscillation during the convergence process of light changes, and if the value is too large, it is easy to overshoot and cause oscillation. The reasonable setting of this value is related to circuit characteristics and lens. The recommended value is 7000. The value range is [0, 100000]. |
s32Ki |
Integral gain, used to adjust the opening and closing speed of the aperture, the larger the value, the faster the opening and closing speed of the aperture. When the value is small, the screen will stabilize at a relatively low brightness when the strong light converges; when the value is large, the aperture may not be closed in strong light scenes. The reasonable setting of this value is related to circuit characteristics and lens. The recommended value is 100, which generally does not need to be modified. The value range is [0, 1000]. |
s32Kd |
Differential gain, used to limit the opening and closing speed of the aperture when the light changes drastically, the larger the value is, the opening and closing speed of the aperture when the light changes drastically slower. If the value is too large, it is too sensitive to instantaneous brightness changes, which will cause the screen to oscillate when the scene brightness changes rapidly. The reasonable setting of this value is related to circuit characteristics and lens. The recommended value is 3000. The value range is [0, 100000]. |
u32MinPwmDuty |
Minimum PWM duty cycle. The smaller the value, the faster the closing speed of the aperture will be when the overexposure is over, but it will easily cause the aperture to oscillate back and forth. The reasonable setting of this value is related to circuit characteristics and lens. The recommended value is 250. The value range is [0, 1000]. |
u32MaxPwmDuty |
Maximum PWM duty cycle. The larger the value is, the faster the aperture will open when the screen is completely dark. If the value is too small, the aperture may not reach the maximum when exiting the aperture control area, resulting in serious image noise. The reasonable setting of this value is related to circuit characteristics and lens. The recommended value is 950. The value range is [0, 1000]. |
u32OpenPwmDuty |
PWM duty cycle when the iris is open. When the screen brightness is stable and the PWM duty cycle is greater than this value for a period of time, exit the aperture control area area. Therefore, the value should not be too small, otherwise it will easily cause the aperture to exit the aperture control area before reaching the maximum, resulting in serious image noise. The reasonable setting of this value is related to circuit characteristics and lens. The recommended value is 800. The value range is [0, 1000]. |
【Note】
When the iris closes and oscillates, it generally means that the iris is closed too fast, which can be solved by appropriately reducing s32Kp and increasing u32MinPwmDuty.
The value of u32OpenPwmDuty is required to be between u32MinPwmDuty and u32MaxPwmDuty, and it must be ensured that this value can open the aperture faster.
【Related Data Type and Interface】
4.5.3.6. ISP_PIRIS_ATTR_S¶
【Description】
Define the P-Iris attribute.
【Syntax】
None.
【Member】
【Note】
Support for P-Iris is currently not implemented
【Related Data Type and Interface】
None.
4.5.3.7. ISP_IRIS_ATTR_S¶
【Description】
Define the ISP aperture properties.
【Syntax】
typedef struct _ISP_IRIS_ATTR_S {
CVI_BOOL bEnable;
ISP_OP_TYPE_E enOpType;
ISP_IRIS_TYPE_E enIrisType;
ISP_IRIS_STATUS_E enIrisStatus;
ISP_MI_ATTR_S stMIAttr;
} ISP_IRIS_ATTR_S;
【Member】
Member |
Description |
---|---|
bEnable |
Auto iris enabled. |
enOpType |
Auto iris or manual iris mode selection. |
enIrisType |
Aperture type, DC-Iris or P-Iris. |
enIrisStatus |
Aperture status. |
stMIAttr |
Manual aperture property setting structure. |
【Note】
When the value is set to ISP_IRIS_OPEN or ISP_IRIS_CLOSE, the iris is fully open or fully closed, which can be used to test whether the Deep Learning circuit and driver are correct. The priority of OPEN and CLOSE is higher than that of Deep Learning enable and manual/auto mode. When the Deep Learning algorithm is running, in order to ensure its normal operation, the value needs to be set to ISP_IRIS_KEEP.
【Related Data Type and Interface】