hi_mpi_isp_query_exposure_info
Description
Obtains the AE internal status information (global 5-segment histogram, 1024-segment histogram, and average luminance statistics) and AE running status information (exposure time, gain, exposures, and AE route that actually takes effect).
Constraints
- The unit of the obtained exposure time is μs. The obtained sensor analog gain, sensor digital gain, and ISP digital gain are measured by multiples, and their precision is 10 bits.
- Obtained exposure = (Exposure time x Exposure gain). The iris status is not considered. The exposure time is in the unit of line, and the exposure gain includes the sensor analog gain, sensor digital gain, and ISP digital gain. The exposure gain is measured by multiples, with 6-bit decimal precision. If the precision of the value does not meet requirements, you can recalculate an exposure based on the high-precision exposure time (μs) and gain (10-bit decimal precision).
- You can check whether AE is stable by querying hist_error. If the absolute value of hist_error is less than the exposure tolerance, AE is not performed currently.
- Both the AE route obtained by calling this API and the one in the proc information are the AE routes that take effect. The node exposure time of this API is in the unit of μs, and the exposure time in the proc information is in the unit of line. The iris component of this MPI is the f-number, and the value range is [0,10]. However, the iris component in the proc information is the equivalent gain of the f-number, and the value is (1 << f-number). This correspondence rule also applies to the extended AE route, the AE route for short frames, and the extended AE route for short frames.
- Before calling this MPI, ensure that the system is running and statistics are generated. If the system runs the first frame and there is no statistics in the AE, all 0s are returned when this MPI is called. However, the system memory is sufficient in this situation.
- In manual mode, the values that take effect, such as Again and Dgain, may differ from those of hi_mpi_set_exposure_attr, which is caused by different sensor configurations.
Prototype
hi_s32 hi_mpi_isp_query_exposure_info(hi_vi_pipe vi_pipe, hi_isp_exp_info *exp_info)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
vi_pipe |
Input |
VI pipe ID Value range: [0, 8) |
exp_info |
Output |
Pointer to the data structure of exposure status information |
Returns
- 0: success
- Other values: failure. For details, see Error Codes.
Example
hi_vi_pipe vi_pipe = 0;
hi_isp_exp_info exp_info;
hi_mpi_isp_query_exposure_info(vi_pipe, &exp_info);
printf("Sensor exposure time: %d\n",exp_info.exp_time);
printf("Analog Gain: %d\n",exp_info. a_gain);
printf("Digital Gain: %d\n",exp_info. d_gain);
printf("ISP Gain: %d\n",exp_info. isp_d_gain);
printf("Exposure: %d\n",exp_info. exposure);
printf("Average Luminance: %d\n",exp_info.ave_lum);
printf("Hist error: %d\n",exp_info.hist_error);
exp_info.exposure_is_max? printf("Exposure is MAX!\n"):printf("Exposure is NOT MAX!\n");
for(i = 0; i < 1024; i++)
{
printf("Hist1024Value[%d]: %d\n",i, exp_info.ae_hist1024_value [i]);
}
Parent topic: AE Control Module