7.3.5 ISP Image System
Overview
AE
The AE algorithm operates by analyzing the histogram to calculate the new exposure value (EV) relative to the AE target set in the calibration. The AE target is dynamically controlled by the algorithm to ensure correct exposure for both low dynamic range (LDR) and high dynamic range (HDR) scenes. For example, in LDR scenes, the AE target will be based on AE_LDR_Target (18% gray target). For HDR scenes, the algorithm dynamically modifies the AE target to prevent overexposure in highlight areas. The local tone mapping engine (Iridix) ensures that shadows are displayed and properly exposed. The HDR target value needs to be calibrated based on the dynamic range of the sensor, and the Iridix engine is used to restore the content in the low-illuminated areas.
Important Concepts
Exposure Time: The time taken for the image sensor to accumulate charge internally, which is the time from the start of exposure until the charge is read out, determining the duration of light exposure for the sensor. The exposure time can be measured in terms of line length.
Exposure Gain: The total amplification factor for the output charge of the sensor, which can be either digital or analog gain. Analog gain introduces slightly less noise, so analog gain is generally preferred.
Basic Principles
The AE algorithm calculates the new EV value by analyzing the histogram statistics and combining it with the calibrated AE target value. To ensure accurate exposure in both low dynamic range and high dynamic range scenes, the algorithm dynamically adjusts the AE target value.
AWB
The AWB module is responsible for color stability because the image sensor's response to neutral tones depends on the lighting conditions of the scene and does not possess the color constancy under different lighting color temperatures as perceived by the human eye, making it particularly apparent in neutral tones such as white and gray. Therefore, the white balance module needs to restore the colors of objects that appear white to the human eye, so that they are also displayed as white in the photos. The AWB algorithm handles a wide range of lighting conditions and spectra to avoid undesirable color casts.
Important Concepts
Color Temperature: The spectral characteristics of the radiation light from a blackbody with a certain surface temperature.
Color Constancy: The tendency of human perception to perceive the surface color of objects as stable even when the illumination conditions change.
Basic Principles
The white balance channel correction is completed based on AWB statistical information and the algorithm's static correction results. The correction results are not updated in the frame data but are instead updated as part of the configuration in the next frame.
Demosaic
The Demosaic unit is responsible for reconstructing a full-color image from the (spatially undersampled) color samples obtained from an image sensor output covered with a color filter array (CFA). In addition, this module provides advanced control for image sharpening.
Digital camera sensor elements can only record the intensity of light falling on them and cannot distinguish between different colors, thus producing only grayscale images. To capture color information, filters must be placed on each pixel sensor, allowing only specific colors of light to pass through. The filters used must be able to reconstruct a full-color image with red, green, and blue (RGB) values for each pixel. The most common type of color filter array is known as the "Bayer array" because the filters are arranged in an RGGB pattern for every 2x2 pixel group.
Half of all pixels are green (G), and one-quarter each are red (R) and blue (B). Green cells in the same row as blue are marked as Gb, and green cells in the same row as red are marked as Gr. The pattern can start with R, Gr, Gb, or B.
This arrangement of the color filter essentially results in undersampled color information. The demosaic unit is responsible for reconstructing a full-color image (with R, G, B information for each pixel) from this incomplete color information. The module consists of many filters, which reconstruct the chroma channel based on the interpolated luma channel. It also takes into account the signal-related sensor noise (based on earlier determined noise profile) to maintain sharpness of edges and smoothness of regions while interpolating missing pixel components. Therefore, the interpolation of missing pixel components includes the noise of the sensor. The built-in sharpening minimizes amplification of high-frequency noise.
Sharpen
Also known as backend sharpening, this module is designed to work in synergy with the Sharpen module of the Demosaic module. The sharpening in the Demosaic module controls sharpening in the RGB domain to achieve the required resolution, but excessive sharpening can lead to artifacts and unnatural textures.
Dark areas use the configuration registers: luma thresh low and luma slope low;
Bright areas use the configuration registers: luma thresh high and luma slope high.
The following image shows the effect of these four parameters on the sharpening effect:
Gamma
This module encodes the output gamma and is typically set to match the BT.709 or sRGB gamma curves.
This module applies gamma LUT to each of the three (R, G, B) color channels.
In a typical configuration, the LUT consists of 129 uniformly spaced nodes labeled 0...128, and linear interpolation is applied between these nodes in hardware.
Each data value is a 16-bit unsigned integer, so it can be expected that Gamma[0] = 0 and Gamma[128] = 0xFFFF, and the other 127 values define the gamma correction curve.
Note:
Adaptive contrast enhancement is dynamically performed by the Iridix module. The LUT should be statically modified according to the desired output gamma characteristics. Gamma also affects the AE, CCM, and Iridix modules, so these modules need to be revalidated when gamma changes.
Iridix
Iridix® uses local tone mapping for dynamic range compression (DRC) to attempt to recover details from low-visibility areas in HDR scenes without affecting the global image. Overall, it increases the available tone range for local regions by increasing the gain relative to the scene content.
CNR
The CNR module corrects the color of each pixel in the YUV space by intelligently estimating the average chroma of the surrounding pixels, reducing chroma noise in the image. In this process, the module maintains the integrity of the intensity information in the image and only processes its chroma part.
Internally, this module operates in the YUV domain. It first converts the RGB image to the YUV domain, and then further subdivides it based on the color component, separately processing the U and V channels. Finally, it converts the YUV back to the RGB domain.
Note: This YUV is not directly outputted. The CNR module will convert RGB to YUV and output it to IPU or DDR.
The processing for U and V involves applying a Gaussian kernel to each U and V channel in the respective segments and configuring them with corresponding offset or slope parameters. To minimize hardware implementation or reduce the number of large kernels, vertical Gaussian filtering is replaced by emerging recursive filters.
Furthermore, to further reduce area, the color channels are downsampled before processing and upsampled again at the output stage. The output U and V channels are a blend of the processed U and V channels and the original U and V channels, configured by incremental offset or slope parameters. The processed U and V, along with the unprocessed Y, are then converted back to the RGB domain.
CCM
In most cases, standard colors may not provide the best image quality. Depending on the application or customer preference, the CCM module can correct and adjust the colors. This module alters the chromatic values of the image to match the chromatic values of a standard color space.
The module applies linear color correction to the input {R, G, B}
or {R, G, B, Ir}
pixel values. The coefficient matrix is calculated as follows:
In1, In2, In3, and In4 are the inputs (corresponding to R, G, B, and Ir, respectively), and A11 to A34 are the configurable matrix coefficients. The coefficients are 13-bit values in the s4.8 fixed-point format, with the MSbit (12 bits) as the sign bit. The MSbit (12 bits) for negative values is set to 1.
Note: If the CFA pattern is RGGB, the IR coefficient and the IR channel offset must be set to zero.
Sinter
Sinter® is an advanced spatial noise reduction module that combines a set of algorithms to suppress sensor noise. The filter operates in the RAW data domain and effectively reduces the noise perceived by the human eye in the image while maintaining texture and details, resulting in more natural-looking processed images.
The module can be simplified by using an externally generated sensor Noise Profile LUT. Once the LUT table is correctly configured, the module can be controlled with a minimal set of registers. In most cases, only the Sinter:Thresh Long and Sinter:Thresh Short registers need to be modified to adjust the strength of the noise filter.
The Sinter:Thresh Long and Sinter:Thresh Short registers correspond to long exposure and short exposure, respectively, for WDR mode. When the exposure ratio is 1 or WDR mode is disabled, the Sinter:Thresh Long and Sinter:Thresh Short should be set to the same value. The thresholds are determined from images captured with various ISO values during a standard calibration process and modulated by the system gain. If the image is created using frame-switching, these values should be set accordingly based on the exposure ratio.
Temper
The Temper module is a motion-adaptive temporal noise filter. It recursively averages the current frame with previous historical frames based on the level of local motion detected in the current frame. The filter works in the RAW domain and requires two frames of external storage with a data width of video width + 4 bits.
Note: The video width is larger in WDR mode.
The recursion depth can be adjusted by increasing or decreasing the Recursion_Limit, which in turn affects the number of effective frames used for recursive averaging. Increasing this parameter will result in a smaller recursion depth, smaller denoising effect, and minimum motion artifacts.
When the Recursion_Limit is set to 0, up to 16 frames can be averaged.
When the Recursion_Limit is set to 0xf, no frames are averaged, which is equivalent to disabling Temper.
The threshold of Temper is used to adjust the strength of the Temper noise filter. The performance of this module is ensured by an externally generated sensor Noise Profile LUT. The reference data is stored in DDR through DMA, with 2 read DMAs and 2 write DMAs managing the storage of the reference data.
Mesh Shading
Due to uneven optical refraction of the lens, there can be a phenomenon of a bright center and dark surroundings in the image. Mesh shading correction provides further correction for non-linear color distortion and fine-tunes the effects caused by radial shading correction.
This module applies mesh shading correction to the image using a maximum 64x64 grid. The mesh correction has 3 pages (R/G/B) of correction tables and 4 different modes:
Setting Mesh Alpha Mode = 0
Setting Mesh Alpha Mode = 1
Setting Mesh Alpha Mode = 2
Setting Mesh Alpha Mode = 3
Radial Shading
Radial shading is a correction method for lens shading that corresponds to mesh shading. It corrects the effects of eccentric and elliptical shading using the radial nature of lens shading.
The radial shading coefficients are stored in a 32-bit, 4x129 entry LUT, with coefficients in x.12 format where the lower 12 bits represent the decimal portion. For each color plane, the coefficients are stored from the center to the outer edge.
Color Space Conversion
This module converts the input {R, G, B}
pixel values to {Y, U, V}
values using standard 3x3 matrix multiplication and vector offset. If the conversion is not activated, the ISP outputs pixel in RGB format.
If needed, the parameters can be modified to provide different conversions. Taking BT.709 as an example, the formula is as follows:
The corresponding parameters in the calibration for RGB2YUV_CONVERSION are as follows:
Where, if the coefficients (Coefft11, Coefft12, Coefft13, Coefft21, Coefft22, Coefft23, Coefft31, Coefft32, Coefft33) are positive, the corresponding parameters in calibration are Coefft11 * 256 rounded to the nearest integer; if the coefficients are negative, the corresponding parameters in calibration are (|Coefft11 * 256| + 1<<15) rounded to the nearest integer. The parameters in calibration for Coefft01 (Coefft02, Coefft01) are Coefft01 (Coefft02, Coefft01) * 1024 rounded to the nearest integer.
Statistical information
The 3A statistical information includes AWB, AE, and AF.
The statistical information collected by the AWB module is used for software white balance adjustment. It accumulates area-level R/G and B/G statistical information and also collects frame-level statistical information.
The AE automatic exposure statistical information is used to adjust sensor exposure. This is done by collecting 5-bin and 1024-bin histograms.
The AF module calculates the statistical sharpness value in the image. Software uses this value/statistical information to adjust the lens for optimal focus in the region of interest (ROI). This module computes edge values for both the region and the entire image.
The ISP provides programmable markers for each statistical module.
AWB Statistical Information
AWB has both global and area statistical information.
Global statistical information: the mean values of R/G and B/G for the entire image and the number of valid statistical points.
Area statistical information: supports up to 33x33 blocks in the image, with each block outputting the mean values of R/G, B/G, and the number of valid statistical points.
The AWB_stats_mode register can be used to configure the type of mean: R/G, B/G, or G/R, G/B.
Through register configuration, valid pixels can be limited:
The values Cb_Ref_Min/Max and Cr_Ref_Min/Max limit the maximum and minimum values of R/G and B/G.
Additionally, Cb_Ref_Low/High and Cr_Ref_Low/High can be used to limit a smaller range of R/G and B/G.
Global statistical information is stored in three registers: AWB RG, AWB BG, and SUM.
Area statistical information:
AE Statistical Information
Automatic exposure (AE) statistical information is collected after applying black level, white balance, and ISP gain. It includes two types of histograms:5-bin local and global histograms;
1024-bin global histogram;
5-bin histogram
Using adjustable histogram bin boundaries, generate a 5-bin normalized histogram for each region and the entire image. Statistics_Hist_Thresh[i][j] is used to define the intensity threshold between bin i and bin j.
Statistics_Hist[i] provides the globally normalized pixel count for bin i, with the sum normalized to 0xFFFF.
The histogram that does not provide the intermediate bins but can be calculated by software:
The internal table containing Histx data provides the normalized values of the histogram for each region, as shown in the table below for mxn regions. The order of the regions is the raster order starting from the top left corner of the image. For each region, the sum of the histogram data is normalized to 0xFFFF.
Supports up to
33x33 blocks.
1024-bin histogram
Construct a global 1024-bin histogram for the entire image. The global histogram can be weighted for regions but is not normalized. ISP Firmware performs the normalization of the statistical data.
AF statistics
Automatic focus (AF) statistics consist of the region of interest (ROI) or region-based, normalized contrast indicators of the entire image. The CPU uses this contrast measure to determine the position of the lens for optimal focusing.
The sharpness evaluation function of the AF statistics module calculates the contrast in four directions of each pixel, as shown in the following figure:
It should be noted that the AF statistics module does not support modifying the coefficients of the sharpness evaluation function. Users can modify the kernel to change the pixel position for sharpness calculation to adapt to different scenes. The sharpness calculation under different kernels of the AF statistics module is shown in the following figure.
For the AF module, the regions can be configured by software. The module calculates the contrast measure for each pixel in the region and accumulates it over the entire region. For each pixel, the contrast is calculated along the four directions. In addition, kernel selection configuration parameters can be used to control the angular direction of the diagonals, as shown in the table above. To improve the response under low light and low-pass imaging conditions, the calculated contrast is in four levels (sum of four contrasts).
These region measure standards are not weighted in the hardware, but the software can apply region-based weights after calculation.
The following figure shows that the best focusing can be achieved when the AF contrast indicator reaches its maximum point:
AF measure data calculation
The accumulated contrast measure standards for each region are stored in a floating-point format with 16-bit mantissa and 5-bit exponent. In addition to the contrast indicator, we also accumulate the squared image and fourth power image data in that region, as shown in the following figures. The value I2 refers to the sum of squares of the differences between the pixel values in the four directions shown in Figure 1, and I4 refers to the sum of fourth powers of the differences between the pixel values in the four directions in Figure 1. E4 refers to the accumulation of the fourth powers of the pixel differences under four kernels, as shown in Figure 2. The 16-bit mantissa stores the mantissa, and the 5-bit exponent stores the exponent. Register1 and Register2 are combined to form a 64-bit value. Users do not need to calculate it directly but can directly obtain the cv value using HB_ISP_GetMeteringData.
The statistical information accumulated for each region is shown in the following table:
The AF region data is stored in the following format:
In addition to the region statistics, AF also accumulates the normalized fourth edge sum, which is stored in a 32-bit register.
Auto Level Statistics
1024-bin statistics data provided by the iridix module.
Average Brightness and Variance Statistics
Statistics information on the average brightness of the YUV domain and the variance of the average brightness provided by the ISP. This module always uses a fixed region size of 32x16 (horizontal x vertical), and the minimum frame resolution required for the available results from this statistical module is 512x256. These statistics are stored in the SRAM at 512 locations, with each location containing the 10-bit (LSB) average value information and 12-bit (MSB) variance information of the average brightness for each region. The storage format is 10 bits reserved + 12 bits brightness variance + 10 bits average brightness.
Functional Description
Interactive Data
Algorithm Library and ISP Firmware Interaction Diagram
The contents in MEM are divided into two parts: data provided to the algorithm library and values passed from the algorithm library to the ISP driver. If the AWB in the ISP driver receives values from algorithm configuration, it will update the ISP register space.
-
This is the context (corresponding to a sensor), and there are multiple sets of data structures for multiple sensors.
-
The yellow blocks are replaceable parts, the Algo Lib needs several callback interfaces (see "API Reference" section), and also requires some input and output data (see "Data Structures" section).
-
The Sensor Driver includes commonly used sensor gain and exposure configuration methods, which generally do not need to be modified.
Interaction Data between Algorithm Library and ISP Firmware
Module | ISP Fw -> Algorithm Library | Algorithm Library -> ISP Fw |
---|---|---|
AE | stats_data[ISP_FULL_HISTOGRAM_SIZE] | ae_exposure |
histogram_sum | ae_exposure_ratio | |
hist4[33 * 33] | frame_id | |
AWB | stats_data[MAX_AWB_ZONES] | awb_red_gain |
curr_AWB_ZONES | awb_green_even_gain | |
awb_green_odd_gain | ||
awb_blue_gain | ||
temperature_detected | ||
p_high | ||
light_source_candidate | ||
awb_warming[3] | ||
mix_light_contrast | ||
frame_id | ||
AF | stats_data[AF_ZONES_COUNT_MAX][2] | frame_to_skip |
zones_horiz | af_position | |
zones_vert | af_last_sharp | |
frame_num | ||
skip_cur_frame | ||
zoom_step_info | ||
Gamma | stats_data[ISP_FULL_HISTOGRAM_SIZE] | gamma_gain |
frame_id | ||
Iridix | N/A(using AE statistics data from AE algorithm) | strength_target |
iridix_dark_enh | ||
iridix_global_DG | ||
iridix_contrast | ||
frame_id |
Development Notes
ISP Firmware consists of two parts, the user space and the kernel space. The kernel space Firmware initializes with the system startup, while the user space Firmware (including the default 3A algorithm) is started by the HB_VIN_StartPipe interface. During the Firmware startup process, the external 3A algorithm is chosen as a priority. If there is no registered external 3A algorithm, the default 3A algorithm will be used. Each type of algorithm has two corresponding input parameters - statistical data (stats) and input parameters (input), and one output parameter - output parameters (output). After the statistical data for each frame is ready, the ISP Firmware calls the proc_func callback function and passes in the two input parameters. The proc_func is the actual algorithm implementation, and after the algorithm calculation, the output parameters should be filled. The ISP Firmware will then apply the output parameters to the Sensor or ISP hardware.
AE Algorithm Registration
AE registers the callback function with the ISP Firmware:
From | User Implementation | To |
---|---|---|
AELIB | init_func | ISP Firmware |
proc_func | ||
deinit_func |
Interface Description:
Callback Function | Description |
---|---|
init_func | Algorithm initialization function |
proc_func | Actual algorithm implementation, such as target and exposure calculation. Called by ISP Firmware when the AE statistical data for each frame is ready. The proc_func passes the input parameters and the parameters to be passed out. See Structural Description for details. |
deinit_func | Algorithm deinitialization function |
AWB Algorithm Registration
AWB registers the callback function with the ISP Firmware:
From | User Implementation | To |
---|---|---|
AWBLIB | init_func | ISP Firmware |
proc_func | ||
deinit_func |
Interface Description:
Callback Function | Description |
---|---|
init_func | Algorithm initialization function |
proc_func | Actual algorithm implementation. Called by ISP Firmware when the AWB statistical data for each frame is ready. The proc_func passes the input parameters and the parameters to be passed out. See Structural Description for details. |
deinit_func | Algorithm deinitialization function |
AF Algorithm Registration
AF registers callback functions to ISP Firmware:
From | User implementation | To |
---|---|---|
AFLIB | init_func | ISP Firmware |
proc_func | ||
deinit_func |
Interface description:
Callback function | Description |
---|---|
init_func | Algorithm initialization function |
proc_func | Actual algorithm implementation, called by ISP Firmware when AF statistics data is ready for each frame. See structure description for input and output parameters |
deinit_func | Algorithm de-initialization function |
Example of algorithm registration
Taking AWB algorithm as an example:
ISP_AWB_FUNC_S stAwbFunc = {
.init_func = awb_init_func,
.proc_func = awb_proc_func,
.deinit_func = awb_deinit_func,
};
HB_ISP_AWBLibRegCallback(0, "libawb.so", &stAwbFunc);
void *awb_init_func(uint32_t ctx_id)
{
pr_info("ctx id is %d", ctx_id);
return NULL;
}
int32_t awb_proc_func(void *awb_ctx, awb_stats_data_t *stats, awb_input_data_t *input, awb_output_data_t *output)
{
awb_acamera_core_obj_t *p_awb_core_obj = (awb_acamera_core_obj_t *)awb_ctx;awb_acamera_input_t *p_acamera_input = (awb_acamera_input_t *)input->acamera_input;
awb_calibration_data_t *p_cali_data = &( p_acamera_input->cali_data );
awb_acamera_output_t *p_acamera_output = (awb_acamera_output_t *)output->acamera_output;
// Specific algorithm implementation, input and statistical data are passed for calculation
awb_calc_avg_weighted_gr_gb_mesh( p_awb_core_obj, stats, input );
awb_detect_light_source( p_awb_core_obj );
awb_calculate_warming_effect( p_awb_core_obj, p_cali_data );
// Assign calculation results to output parameters
p_acamera_output->rg_coef = p_awb_core_obj->rg_coef;
p_acamera_output->bg_coef = p_awb_core_obj->bg_coef;
p_acamera_output->temperature_detected = p_awb_core_obj->temperature_detected;
p_acamera_output->p_high = p_awb_core_obj->p_high;
p_acamera_output->light_source_candidate = p_awb_core_obj->light_source_candidate;
memcpy( p_acamera_output->awb_warming, p_awb_core_obj->awb_warming, sizeof( p_acamera_output->awb_warming ) );
p_acamera_output->awb_converged = p_awb_core_obj->awb_converged;
return 0;
}
int32_t awb_deinit_func(void *awb_ctx)
{
pr_info("done");
return 0;
}
API Reference
HB_ISP_SetFWState/HB_ISP_GetFWState【Function Declaration】
int HB_ISP_SetFWState(uint8_t pipeId, const ISP_FW_STATE_E enState);
int HB_ISP_GetFWState(uint8_t pipeId, ISP_FW_STATE_E *penState);
【Function Description】
Set/Get the state of ISP Firmware.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
penState | ISP Firmware state | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetRegister/HB_ISP_GetRegister
【Function Declaration】
int HB_ISP_SetRegister(uint8_t pipeId, uint32_t u32Addr, uint32_t u32Value);
int HB_ISP_GetRegister(uint8_t pipeId, uint32_t u32Addr, uint32_t *pu32Value);
【Function Description】
Set/Get ISP register.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
u32Addr | ISP register address | Input |
u32Value | Value to set | Input |
【Return Value】| Parameter name | Description | Input/Output | |----------------|---------------------------------|--------------| | pipeId | Pipeline index number | Input | | cname | Calibration library information | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Important points】
【Reference code】
HB_ISP_SetModuleControl/ HB_ISP_GetModuleControl
【Function declaration】
int HB_ISP_SetModuleControl(uint8_t pipeId, const ISP_MODULE_CTRL_U *punModCtrl);
int HB_ISP_GetModuleControl(uint8_t pipeId, ISP_MODULE_CTRL_U *punModCtrl);
【Function description】
Set/get the bypass status of each module inside ISP.
【Parameter description】
Parameter name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
punModCtrl | Bypass control of each module inside ISP | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Important points】
【Reference code】
HB_ISP_SwitchScence
【Function declaration】
int HB_ISP_SwitchScence(uint8_t pipeId, const char *cname);
【Function description】
Set calibration library.
【Parameter description】| Parameter | Description | Input/Output | |------------|---------------------|--------------| | pipeId | Pipeline index number | Input | | cname | Calibration library path | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_StartI2CBus/HB_ISP_StopI2CBus
【Function Declaration】
int HB_ISP_StartI2CBus(uint8_t pipeId);
void HB_ISP_StopI2CBus(uint8_t pipeId);
【Function Description】
Starts, stops writing to I2C bus.
【Parameter Description】
Parameter | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes 】Before StartI2CBus, HB_ISP_GetSetInit initialization and sensor initialization are required.
【Reference Code】
HB_ISP_SendI2CData
【Function Declaration】
int HB_ISP_SendI2CData(ISP_I2C_DATA_S data);
【Function Description】
Write I2C data.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
data | data to be sent | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Note】
HB_ISP_StartI2CBus interface should be called before using it to start the I2C write thread.
【Reference Code】
HB_ISP_AELibRegCallback
【Function Declaration】
int HB_ISP_AELibRegCallback(uint8_t pipeId, char *name, ISP_AE_FUNC_S *pstAeFunc);
【Function Description】
Register AE algorithm library.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
name | Library name, fixed 20 chars length | Input, optional |
pstAeFunc | AE algorithm callback function pointer | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
HB_VIN_StartPipe will start the ISP algorithm and the algorithm registration should be done before calling the HB_VIN_StartPipe function.
【Reference code】see [Algorithm Registration Example](#_Algorithm Registration Example)
HB_ISP_AWBLibRegCallback
【Function declaration】
int HB_ISP_AWBLibRegCallback(uint8_t pipeId, char *name,
ISP_AWB_FUNC_S *pstAWBFunc);
【Function description】
Register the AWB algorithm library.
【Parameter description】
Parameter name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
name | Library name, fixed 20 characters | Input Reserved item, can be omitted |
pstAWBFunc | AWB algorithm callback function pointer | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Caution】
HB_VIN_StartPipe will start the ISP algorithm and the algorithm registration should be done before calling the HB_VIN_StartPipe function.
【Reference code】see [Algorithm Registration Example](#_Algorithm Registration Example)
HB_ISP_AFLibRegCallback
【Function declaration】
int HB_ISP_AFLibRegCallback(uint8_t pipeId, char *name,
ISP_AF_FUNC_S *pstAFFunc);
【Function description】
Register the AF algorithm library.
【Parameter description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
name | Library name, fixed-copy 20 characters long | Input |
pstAFFunc | AF algorithm callback function pointer | Input |
【Return value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Caution】
HB_VIN_StartPipe will start the ISP algorithm, and algorithm registration needs to be done before calling HB_VIN_StartPipe function.
【Reference code】
See [Algorithm Registration Example](#_Algorithm Registration Example)
HB_ISP_AELibUnRegCallback
【Function Declaration】
int HB_ISP_AELibUnRegCallback(uint8_t pipeId);
【Description】
Unregister AE algorithm library.
【Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Caution】
【Reference code】
HB_ISP_AWBLibUnRegCallback
【Function Declaration】
int HB_ISP_AWBLibUnRegCallback(uint8_t pipeId);
【Description】
Unregister the AWB algorithm library.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_AFLibUnRegCallback
【Function Declaration】
int HB_ISP_AFLibUnRegCallback(uint8_t pipeId);
【Description】
Unregister the AF algorithm library.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
Note:
-
If using the default 3A algorithm, there is no need to concern yourself with the interfaces in this chapter.
-
Zoom and aperture control algorithms are not included. Users can implement their own and provide output parameters to modify the ISP (Image Signal Processor) firmware for adaptation.
HB_ISP_GetSetInit/HB_ISP_GetSetExit
【Function Declaration】
int HB_ISP_GetSetInit(void);
int HB_ISP_GetSetExit(void);
【Description】
Initialization before getting/setting parameters.
【Parameter Description】None
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
Only need to call once in the same process, before calling all Get/Set functions, first call HB_ISP_GetSetInit for initialization.
【Reference Code】
HB_ISP_SetAeAttr/HB_ISP_GetAeAttr
【Function Declaration】
int HB_ISP_SetAeAttr(uint8_t pipeId, const ISP_AE_ATTR_S *pstAeAttr);
int HB_ISP_GetAeAttr(uint8_t pipeId, ISP_AE_ATTR_S *pstAeAttr);
【Description】
Set AE algorithm attributes.
【Parameter Description】| Parameter Name | Description | Input/Output | |----------------|------------------|--------------| | pipeId | Pipeline index | Input | | pstAeAttr | Pointer to AE parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
set is only for manual mode, when getting different modes, pass the corresponding mode value.
【Reference Code】
HB_ISP_SetAfAttr/HB_ISP_GetAfAttr
【Function Declaration】
int HB_ISP_SetAfAttr(uint8_t pipeId, ISP_AF_ATTR_S *pstAfAttr);
int HB_ISP_GetAfAttr(uint8_t pipeId, ISP_AF_ATTR_S *pstAfAttr);
【Function Description】
Set AF-ZOOM attribute.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstAfAttr | Pointer to AF parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetAwbAttr/HB_ISP_GetAwbAttr【Function Declaration】
int HB_ISP_SetAwbAttr(uint8_t pipeId, const ISP_AWB_ATTR_S *pstAwbAttr);
int HB_ISP_GetAwbAttr(uint8_t pipeId, ISP_AWB_ATTR_S *pstAwbAttr);
【Description】
Set AWB algorithm attributes.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstAwbAttr | Pointer to AWB parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
Set is only for manual mode. When getting, pass different modes to obtain corresponding values.
【Referenced Code】
HB_ISP_SetBlackLevelAttr/HB_ISP_GetBlackLevelAttr
【Function Declaration】
int HB_ISP_SetBlackLevelAttr(uint8_t pipeId, const ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);
int HB_ISP_GetBlackLevelAttr(uint8_t pipeId, ISP_BLACK_LEVEL_ATTR_S *pstBlackLevelAttr);
【Description】
Set black level attributes.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstBlackLevelAttr | Pointer to black level parameter | Input |
[Return Values] |
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
[Note]
Set is only applicable to manual mode. When getting, different modes can be passed to obtain the corresponding values.
In auto mode, the black_level value is interpolated based on the current exposure gain using calibration parameters BLACK_LEVEL_B/BLACK_LEVEL_GB/BLACK_LEVEL_GR/BLACK_LEVEL_R.
In manual mode, the black_level value can be set by the user.
[Reference Code]
HB_ISP_SetDemosaicAttr/HB_ISP_GetDemosaicAttr
[Function Declaration]
int HB_ISP_SetDemosaicAttr(uint8_t pipeId, const
ISP_DEMOSAIC_ATTR_S *pstDemosaicAttr);
int HB_ISP_GetDemosaicAttr(uint8_t pipeId,
ISP_DEMOSAIC_ATTR_S *pstDemosaicAttr);
[Functional Description]
Set demosaic module attributes.
[Parameter Description]
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstDemosaicAttr | Pointer to demosaic parameters | Input |
[Return Values]
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
[Note]
HB_ISP_SetSharpenAttr/HB_ISP_GetSharpenAttr
【Function declaration】
int HB_ISP_SetSharpenAttr(uint8_t pipeId, const
ISP_SHARPEN_ATTR_S *pstSharpenAttr);
int HB_ISP_GetSharpenAttr(uint8_t pipeId,
ISP_SHARPEN_ATTR_S *pstSharpenAttr);
【Description】
Set the sharpen attribute.
【Parameter description】
Parameter name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstSharpenAttr | Pointer to sharpen attribute | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference code】
HB_ISP_SetGammaAttr/HB_ISP_GetGammaAttr
【Function declaration】
int HB_ISP_SetGammaAttr(uint8_t pipeId, const
ISP_GAMMA_ATTR_S *pstGammaAttr);
int HB_ISP_GetGammaAttr(uint8_t pipeId,
ISP_GAMMA_ATTR_S *pstGammaAttr);
【Description】
Set the gamma attribute.
【Parameter description】| Parameter Name | Description | Input/Output | |--------------|---------------------|-----------| | pipeId | Pipeline Index | Input | | pstGammaAttr | Pointer to Gamma Parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Note】
【Reference Code】
HB_ISP_SetIridixAttr/HB_ISP_GetIridixAttr
【Function Declaration】
int HB_ISP_SetIridixAttr(uint8_t pipeId, const ISP_IRIDIX_ATTR_S *pstIridixAttr);
int HB_ISP_GetIridixAttr(uint8_t pipeId,
ISP_IRIDIX_ATTR_S *pstIridixAttr);
【Function Description】
Set Iridix module attributes.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline Index | Input |
pstIridixAttr | Pointer to Iridix Parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Note】
【Reference Code】
HB_ISP_SetIridixStrengthLevel/HB_ISP_GetIridixStrengthLevel
【Function Declaration】
int HB_ISP_SetIridixStrengthLevel(uint8_t pipeId, uint16_t level);
int HB_ISP_GetIridixStrengthLevel(uint8_t pipeId, uint16_t *level);
【Function Description】
Set the Iridix strength level.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
level | Strength level, range [0, 255] | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
non-zero | Failure |
【Note】
【Reference Code】
HB_ISP_SetCnrAttr/HB_ISP_GetCnrAttr
【Function Declaration】
int HB_ISP_SetCnrAttr(uint8_t pipeId, const ISP_CNR_ATTR_S *pstCnrAttr);
int HB_ISP_GetCnrAttr(uint8_t pipeId, ISP_CNR_ATTR_S *pstCnrAttr);
【Function Description】
Set the chroma noise reduction module attributes.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstCnrAttr | Pointer to chroma noise reduction parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetSinterAttr/HB_ISP_GetSinterAttr
【Function Declaration】
int HB_ISP_SetSinterAttr(uint8_t pipeId, const ISP_SINTER_ATTR_S *pstSinterAttr);
int HB_ISP_GetSinterAttr(uint8_t pipeId,
ISP_SINTER_ATTR_S *pstSinterAttr);
【Function Description】
Set the attributes of the spatial noise reduction module.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstSinterAttr | Pointer to the spatial noise reduction parameter | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetTemperAttr/HB_ISP_GetTemperAttr
【Function Declaration】
int HB_ISP_SetTemperAttr(uint8_t pipeId, const
ISP_TEMPER_ATTR_S *pstTemperAttr);
int HB_ISP_GetTemperAttr(uint8_t pipeId,
ISP_TEMPER_ATTR_S *pstTemperAttr);
【Function Description】【Setting the temporal domain denoising module properties】
【Parameter description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstTemperAttr | Pointer to denoising parameters in the temporal domain | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference code】
HB_ISP_SetMeshShadingAttr/HB_ISP_GetMeshShadingAttr
【Function declaration】
int HB_ISP_SetMeshShadingAttr(uint8_t pipeId, const
MESH_SHADING_ATTR_S *pstMeshShadingAttr);
int HB_ISP_GetMeshShadingAttr(uint8_t pipeId,
MESH_SHADING_ATTR_S *pstMeshShadingAttr);
【Function description】
Set the properties of the Mesh Shading module.
【Parameter description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstMeshShadingAttr | Pointer to Mesh Shading parameters | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
HB_ISP_SetMeshShadingLUT/HB_ISP_GetMeshShadingLUT
【Function Declaration】
int HB_ISP_SetMeshShadingLUT(uint8_t pipeId, const
MESH_SHADING_LUT_S *pstMeshShadingLUT);
int HB_ISP_GetMeshShadingLUT(uint8_t pipeId, MESH_SHADING_LUT_S *pstMeshShadingLUT);
【Function Description】
Set the LUT table of the Mesh Shading module.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstMeshShadingLUT | Pointer to the MeshShading LUT table | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetRadialShadingAttr/HB_ISP_GetRadialShadingAttr
【Function Declaration】
int HB_ISP_SetRadialShadingAttr(uint8_t pipeId, const
RADIAL_SHADING_ATTR_S *pstRadialShadingAttr);
int HB_ISP_GetRadialShadingAttr(uint8_t pipeId,
RADIAL_SHADING_ATTR_S *pstRadialShadingAttr);
【Function Description】
Set the attributes of the Radial Shading module.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstRadialShadingAttr | Pointer to Radial Shading parameters | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetRadialShadingLUT/HB_ISP_GetRadialShadingLUT
【Function Declaration】
int HB_ISP_SetRadialShadingLUT(uint8_t pipeId, const
RADIAL_SHADING_LUT_S *pstRadialShadingLUT);
int HB_ISP_GetRadialShadingLUT(uint8_t pipeId,
RADIAL_SHADING_LUT_S *pstRadialShadingLUT);
【Function Description】
Set the LUT table for Radial Shading module.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstRadialShadingLUT | Pointer to Radial Shading LUT table | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetCSCAttr/HB_ISP_GetCSCAttr
【Function Declaration】
int HB_ISP_SetCSCAttr(uint8_t pipeId, const ISP_CSC_ATTR_S *pstCSCAttr);
int HB_ISP_GetCSCAttr(uint8_t pipeId, ISP_CSC_ATTR_S *pstCSCAttr);
【Function Description】
Set the attributes of the Color Space Conversion (CSC) module.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstCSCAttr | Pointer to CSC attributes | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】
HB_ISP_SetSceneModesAttr/HB_ISP_GetSceneModesAttr
【Function Declaration】
int HB_ISP_SetSceneModesAttr(uint8_t pipeId, const ISP_SCENE_MODES_ATTR_S *pstSceneModesAttr);
int HB_ISP_GetSceneModesAttr(uint8_t pipeId, ISP_SCENE_MODES_ATTR_S *pstSceneModesAttr);
【Function Description】
Set the scene modes.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstSceneModesAttr | Pointer to scene mode parameters | Input |
【Return Value】 Translate the Chinese parts in the following content into English while preserving the original format and content:
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Precautions】
【Reference Code】
HB_ISP_SetAwbZoneInfo/HB_ISP_GetAwbZoneInfo
【Function Declaration】
int HB_ISP_GetAwbZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S *awbZoneInfo);
int HB_ISP_SetAwbZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S awbZoneInfo);
【Description】
Get/Set AWB zone information.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
awbZoneInfo | Pointer to AWB zone information (for Get); AWB zone information data structure (for Set) | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Precautions】None
【Reference Code】None
HB_ISP_SetAfZoneInfo/HB_ISP_GetAfZoneInfo
【Function Declaration】
int HB_ISP_GetAfZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S *afZoneInfo);
int HB_ISP_SetAfZoneInfo(uint8_t pipeId, ISP_ZONE_ATTR_S *afZoneInfo);
【Description】Access/Set AF zones information.
[Parameter Description]
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
afZoneInfo | Pointer to AF zones information (for getting); AF zones information data structure (for setting) | Input |
[Return Value]
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
[Notes] None
[Reference Code] None
HB_ISP_SetAe5binZoneInfo/HB_ISP_GetAe5binZoneInfo
[Function Declaration]
int HB_ISP_GetAe5binZoneInfo(uint8_t pipeId,
ISP_ZONE_ATTR_S *ae5binZoneInfo);
int HB_ISP_SetAe5binZoneInfo(uint8_t pipeId,
ISP_ZONE_ATTR_S ae5binZoneInfo);
[Function Description]
Access/Set AE 5bin zones information.
[Parameter Description]
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
ae5binZoneInfo | Pointer to AE 5bin zones information (for getting); AE 5BIN zones information data structure (for setting) | Input |
[Return Value]
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
[Notes]
HB_ISP_SetAfKernelInfo/HB_ISP_GetAfKernelInfo
【Function Declaration】
int HB_ISP_GetAfKernelInfo(uint8_t pipeId, uint32_t *af_kernel);
int HB_ISP_SetAfKernelInfo(uint8_t pipeId, uint32_t af_kernel);
【Description】
Get/Set AF KERNEL information.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
af_kernel | Pointer to af_kernel pointer (for getting); af_kernel data information (for setting) | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
This interface is mainly used for applications to obtain or modify current af statistical data kernel.
【Reference Code】
HB_ISP_SetAeParam/HB_ISP_GetAeParam
Function Declaration
int HB_ISP_SetAeParam(uint8_t pipeId, const ISP_AE_PARAM_S *pstAeParam);
int HB_ISP_GetAeParam(uint8_t pipeId, ISP_AE_PARAM_S *pstAeParam);
Function Description
Sets/gets AE parameter information, including line and total gain.
Parameter Descriptions
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstAeParam | Pointer to AE parameter structure | Input |
Return Values
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
Cautionary Notes
Reference Code: None
HB_ISP_SetAeRoiInfo/HB_ISP_GetAeRoiInfo
Function Declaration
int HB_ISP_SetAeRoiInfo(uint8_t pipeId, ISP_AE_ROI_ATTR_S aeRoiInfo);
int HB_ISP_GetAeRoiInfo(uint8_t pipeId, ISP_AE_ROI_ATTR_S *aeRoiInfo);
Function Description
Sets the ROI (Region of Interest) weight area for AE, allowing dynamic calls.
Parameter Descriptions
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
aeRoiInfo | ROI attribute structure | Output |
Return Values
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
Cautionary Note
The ROI region setting is independent from the 3A-AE ROI weighting setup. Only one of these functions can be used at any given time.
Reference Code: None
HB_ISP_SetAwbStatAreaAttr / HB_ISP_GetAwbStatAreaAttr
Function Declaration
int HB_ISP_GetAwbStatAreaAttr(uint8_t pipeId, ISP_AWB_STAT_AREA_ATTR_S *pstAwbStatAreaAttr);
int HB_ISP_SetAwbStatAreaAttr(uint8_t pipeId, ISP_AWB_STAT_AREA_ATTR_S *pstAwbStatAreaAttr);
Function Description
Sets or retrieves the AWB statistical data area range.
Parameter Descriptions
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstAwbStatAreaAttr | Statistical data area range parameters | Output |
Return Values
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
Cautionary Notes
Reference Code: None provided (since this is a function description rather than actual code)
HB_ISP_GetAeFullHist
【Function Declaration】
int HB_ISP_GetAeFullHist(uint8_t pipeId, uint32_t *pu32AeFullHist);
【Description】
Get AE statistical data.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pu32AeFullHist | Pointer to AE statistical data | Output |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
This interface is mainly for application use. If some strategy judgments are made based on statistical information, the 3A algorithm library does not need to use this interface.
【Reference Code】
#define HB_ISP_FULL_HISTOGRAM_SIZE 1024
int i;
uint32_t ae[HB_ISP_FULL_HISTOGRAM_SIZE];
memset(ae, 0, sizeof(ae));
HB_ISP_GetAeFullHist(0, ae);
printf("\n--AE--\n");
for (i = 0; i \< HB_ISP_FULL_HISTOGRAM_SIZE; i++) {
printf("%-8d ", ae[i]);
if ((i + 1) % 8 == 0)
printf("\n");
}
HB_ISP_GetAwbZoneHist
【Function Declaration】
int HB_ISP_GetAwbZoneHist(uint8_t pipeId,
ISP_STATISTICS_AWB_ZONE_ATTR_S
*pstAwbZonesAttr);
【Function Description】
Get AWB statistical data.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
This interface is mainly for application use, such as using statistical information for certain strategy judgments. The 3A algorithm library does not need to use this interface.
【Reference Code】
HB_ISP_GetAe5binZoneHist
【Function Declaration】
int HB_ISP_GetAe5binZoneHist(uint8_t
pipeId, ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S
*pst32Ae5bin);
【Function Description】
Gets AE 5bin statistical data.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pst32Ae5bin | Pointer to AE 5bin statistical data | Output |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
This interface is mainly for application use, such as using statistical information for certain strategy judgments. The 3A algorithm library does not need to use this interface.
【Reference Code】
ISP_STATISTICS_AE_5BIN_ZONE_ATTR_S ae_5bin[HB_ISP_MAX_AE_5BIN_ZONES];ISP_ZONE_ATTR_S ae5binZoneInfo;
memset(ae_5bin, 0, sizeof(ae_5bin));
HB_ISP_GetAe5binZoneHist(ctx_idx, ae_5bin);
HB_ISP_GetAfZoneHist
[Function Declaration]
int HB_ISP_GetAfZoneHist(uint8_t pipeId, af_stats_data_t *pstAfZonesAttr);
[Function Description]
Get AF statistics data.
[Parameter Description]
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstAfZonesAttr | Pointer to AF statistics data | Output |
[Return Value]
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
[Notes]
-
This interface is mainly for application use, such as making certain strategy judgments based on statistical information. The 3A algorithm library does not need to use this interface.
-
This interface has several data caches. If you want to get real-time data, please use the HB_ISP_GetMeteringData interface to obtain it. HB_ISP_GetMeteringData gets real-time data.
[Reference Code]
uint32_t af_data[HB_ISP_AF_ZONES_COUNT_MAX * 2];
af_stats_data_t af;
ISP_ZONE_ATTR_S afZoneInfo;
memset(af_data, 0, sizeof(af_data));
af.zones_stats = (uint32_t *)&af_data;HB_ISP_GetAfZoneHist(ctx_idx, &af);
HB_ISP_GetMeteringData
【Function Declaration】
int HB_ISP_GetMeteringData(uint8_t pipeId, void *data, ISP_METERING_DATA_TYPE_E type, int latest_flag);
【Description】
Get AF/LUMVAR statistics data.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
data | Pointer to AF/LUMVAR statistics data | Output |
type | Type of statistics data (AF/LUMVAR) | Input |
latest_flag | Flag indicating whether to get the latest data | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Note】
-
The value fv obtained from this interface can be directly used for focusing calculation.
-
It is not necessary to call the HB_ISP_GetVDTTimeOut frame interrupt interface to obtain the latest value, calling this interface directly will return the latest value.
HB_ISP_GetVDTTimeOut
【Function Declaration】
int HB_ISP_GetVDTTimeOut(uint8_t pipeId, uint8_t vdt_type, uint64_t timeout);
【Description】
Get ISP FRAME_START or FRAME_END information.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
vdt_type | Select for getting ISP frame_start or frame_end | Input |
timeout | Timeout return time | Input |
【Return Value】
Return Value | Description |
---|---|
0 | FS/FE Synchronization |
Non-zero | Timeout return |
【Notes】
This interface is mainly used by applications for timing synchronization.
【Reference Code】None
HB_ISP_GetLumaZoneHist
【Function Declaration】
int HB_ISP_GetLumaZoneHist(uint8_t pipeId, ISP_STATISTICS_LUMVAR_ZONE_ATTR_S
*pst32Luma);
【Function Description】
Get the mean and variance of LUMVAR statistical information.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pst32Luma | Pointer to lumvar statistical information | Output |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】None
HB_ISP_SetAEControl/ HB_ISP_GetAEControl
【Function Declaration】
int HB_ISP_SetAEControl(uint8_t pipeId, const ISP_AE_CONTROL *pstAeControl);
int HB_ISP_GetAEControl(uint8_t pipeId, ISP_AE_CONTROL *pstAeControl);
【Function Description】
Set/Get AE control information
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstAeControl | Pointer to AE control information | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failed |
【Note】
【Reference Code】N/A
HB_ISP_SetAECorrection/ HB_ISP_GetAECorrection
【Function Declaration】
int HB_ISP_SetAECorrection(uint8_t pipeId, const ISP_AE_CORRECTION *pstAeCorrection);
int HB_ISP_GetAECorrection(uint8_t pipeId, ISP_AE_CORRECTION *pstAeCorrection);
【Function Description】
Set/Get AE correction information
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstAeCorrection | Pointer to AE correction information | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
non-0 | Failed |
【Attention】
【Reference Code】None
HB_ISP_Set_AE_5bin_Hist/ HB_ISP_Get_AE_5bin_Hist
【Function Declaration】
int HB_ISP_Set_AE_5bin_Hist(uint8_t pipeId, const ISP_5BIN_HIST * pAe5binHist);
int HB_ISP_Get_AE_5bin_Hist(uint8_t pipeId, ISP_5BIN_HIST * pAe5binHist);
【Function Description】
Set/Get the 5bin statistical information of AE
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pAe5binHist | Pointer to AE 5bin statistics information | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
non-0 | Failed |
【Attention】
【Reference Code】None
HB_ISP_SetExposureRatioAdjustment/ HB_ISP_GetExposureRatioAdjustment
【Function Declaration】
int HB_ISP_SetExposureRatioAdjustment(uint8_t pipeId, const ISP_EXP_RATIO_ADJ *pstExpRatioAdj);
int HB_ISP_GetExposureRatioAdjustment(uint8_t pipeId, ISP_EXP_RATIO_ADJ *pstExpRatioAdj);
【Function Description】
Set/Get Exposure Ratio Adjustment
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstExpRatioAdj | Pointer to ratio | Input |
of exposure |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
non-zero | Failure |
【Notes】
【Reference Code】None
HB_ISP_SetExposurePartitionLuts/ HB_ISP_GetExposurePartitionLuts
【Function Declaration】
int HB_ISP_SetExposurePartitionLuts(uint8_t pipeId, const ISP_EXP_PAT_LUTS
*pstExpPatLuts);
int HB_ISP_SetExposurePartitionLuts(uint8_t pipeId, ISP_EXP_PAT_LUTS
*pstExpPatLuts);
【Function Description】
Set/Get LUT information for exposure partition
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstExpPatLuts | Pointer to partition | Input |
LUT table |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
non-zero | Failure |
【注意事项】
【参考代码】无
HB_ISP_SetAwbBgMaxGain/HB_ISP_GetAwbBgMaxGain
【函数声明】
int HB_ISP_SetAwbBgMaxGain(uint8_t pipeId, const ISP_AWB_BG_MAX_GAIN
*pstAwbBgMaxGain) ;
int HB_ISP_GetAwbBgMaxGain(uint8_t pipeId, ISP_AWB_BG_MAX_GAIN
*pstAwbBgMaxGain);
【功能描述】
Set/Get AWB BG maximum gain.
【参数描述】
参数名称 | 描述 | 输入/输出 |
---|---|---|
pipeId | Pipeline index | Input |
pstAwbBgMaxGain | Pointer to the maximum gain of AWB BG | Input |
【返回值】
返回值 | 描述 |
---|---|
0 | Success |
Non-zero | Failure |
【注意事项】
【参考代码】无
HB_ISP_SetCcmSaturationStrength/ HB_ISP_GetCcmSaturationStrength
【函数声明】
int HB_ISP_SetCcmSaturationStrength(uint8_t pipeId, const ISP_CCM_SATURA_STRENG
*pstCcmSatStre);
int HB_ISP_GetCcmSaturationStrength(uint8_t pipeId, ISP_CCM_SATURA_STRENG
*pstCcmSatStre);
【功能描述】
Set/Get CCM saturation strength information.【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstCcmSatStre | Pointer to CCM saturation strength | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】None
HB_ISP_SetCcmMtLs/ HB_ISP_GetCcmMtLs
【Function Declaration】
int HB_ISP_SetCcmMtLs(uint8_t pipeId, const ISP_MT_ABSOLUTE_LS *pstMtAbsoluteLs);
int HB_ISP_GetCcmMtLs(uint8_t pipeId, ISP_MT_ABSOLUTE_LS *pstMtAbsoluteLs);
【Function Description】
Set/Get CCM Mt Ls
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstMtAbsoluteLs | Pointer to CCM Mt Ls | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】None
HB_ISP_SetCcmAttr/HB_ISP_GetCcmAttr【Function Declaration】
int HB_ISP_SetCcmAttr(uint8_t pipeId, const ISP_CCM_ONE_GAIN_THRESHOLD *pstOneGainThreshold);
int HB_ISP_GetCcmAttr(uint8_t pipeId, ISP_CCM_ONE_GAIN_THRESHOLD *pstOneGainThreshold);
【Function Description】
Set/Get CCM attributes
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstOneGainThreshold | Pointer to CCM attribute | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】 None
【Reference Code】 N/A
HB_ISP_SetGammaEv1/HB_ISP_GetGammaEv1
【Function Declaration】
int HB_ISP_SetGammaEv1(uint8_t pipeId, const ISP_GAMMA_EV1 *pstGammaEv1);
int HB_ISP_GetGammaEv1(uint8_t pipeId, ISP_GAMMA_EV1 *pstGammaEv1);
【Function Description】
Set/Get Gamma Ev1 properties
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstGammaEv1 | Pointer to Gamma Ev1 | Input |
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notice】
【Reference Code】N/A
HB_ISP_SetGammaEv2 / HB_ISP_GetGammaEv2
【Function Declaration】
int HB_ISP_SetGammaEv2(uint8_t pipeId, const ISP_GAMMA_EV2 *pstGammaEv2);
int HB_ISP_GetGammaEv2(uint8_t pipeId, ISP_GAMMA_EV2 *pstGammaEv2);
【Function Description】
Set/Get the Gamma Ev2 property.
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstGammaEv2 | Pointer to Gamma Ev2 | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notice】
【Reference Code】N/A
HB_ISP_SetGammaThreshold / HB_ISP_GetGammaThreshold
【Function Declaration】
int HB_ISP_SetGammaThreshold(uint8_t pipeId, const ISP_GAMMA_THRESHOLD *pstGammaThd);
int HB_ISP_GetGammaThreshold(uint8_t pipeId, ISP_GAMMA_THRESHOLD *pstGammaThd);
【Function Description】
Set/Get Gamma threshold
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstGammaThd | Pointer to Gamma threshold | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Caution】
【Reference Code】None
HB_ISP_GetEvToLuxStatustAttr/ HB_ISP_SetEvToLuxStatustAttr
【Function Declaration】
int HB_ISP_GetEvToLuxStatustAttr(uint8_t pipeId, uint8_t
*pstEvToLuxStatustAttr);
int HB_ISP_SetEvToLuxStatustAttr(uint8_t pipeId, const uint8_t
*pstEvToLuxStatustAttr);
【Function Description】
Get evtolux attribute
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstEvToLuxStatustAttr | Pointer to evtolux attribute | Output |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Reference code】None
HB_ISP_SetCctCtrlAttr/ HB_ISP_GetCctCtrlAttr
【Function declaration】
int HB_ISP_SetCctCtrlAttr(uint8_t pipeId, const ISP_AWB_CCT_CTRL_S
*pstCctAttr);
int HB_ISP_GetCctCtrlAttr(uint8_t pipeId, ISP_AWB_CCT_CTRL_S *pstCctAttr);
【Description】
Set/Get CCT attributes
【Parameter description】
Parameter name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstCctAttr | Pointer to CCT attributes | Input |
【Return value】
Return | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notice】
【Reference code】None
HB_ISP_SetAwbAvgCoeff/HB_ISP_GetAwbAvgCoeff
【Function declaration】
int HB_ISP_SetAwbAvgCoeff(uint8_t pipeId, uint8_t Coeff);
int HB_ISP_GetAwbAvgCoeff(uint8_t pipeId, uint8_t *Coeff);
【Description】
Set AWB average coefficients
【Parameter description】
| Parameter name | Description | Input/Output | |--------|-----------------------------| | pipeId | Pipeline index | | Coeff | Pointer to AWB average coefficients, smaller values result in fewer convergence steps, larger values result in more convergence steps |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Note】
【Reference code】N/A
HB_ISP_SetMixLightAttr/HB_ISP_GetMixLightAttr
【Function declaration】
int HB_ISP_SetMixLightAttr(uint8_t pipeId, const ISP_MIX_LIGHT_PARAM_S
*pstMixLightAttr);
int HB_ISP_GetMixLightAttr(uint8_t pipeId, ISP_MIX_LIGHT_PARAM_S
*pstMixLightAttr);
【Description】
Set MIX LIGHT attributes
【Parameter description】
Parameter name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstMixLightAttr | Pointer to MIX LIGHT attributes | Input |
【Return value】
Return value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Note】
【Reference code】N/A
HB_ISP_SetSkyCtrlAttr/ HB_ISP_GetSkyCtrlAttr
【Function declaration】
int HB_ISP_SetSkyCtrlAttr(uint8_t pipeId, const ISP_SKY_PARAM_S *pstSkyCtrlAttr);
int HB_ISP_GetSkyCtrlAttr(uint8_t pipeId, ISP_SKY_PARAM_S *pstSkyCtrlAttr);
【Function Description】
Set outdoor daylight attributes
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstSkyCtrlAttr | Pointer to outdoor daylight attribute | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】N/A
HB_ISP_ApiCtrl
【Function Declaration】
int HB_ISP_ApiCtrl(uint8_t pipeId, uint8_t direction, int type, int cmd,
uint32_t *val);
【Function Description】
Api Control
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
direction | Set/Get | Input |
type | Major Type | Input |
cmd | Minor Type | Input |
val | Value for Get/Set operation | Input |
【Return Value】| Return | Description | |--------|------| | 0 | Success | | Non-zero | Failure |
【Notes】
【Reference code】N/A
HB_ISP_GetTempLut/ HB_ISP_SetTempLut
【Function declaration】
int HB_ISP_GetTempLut(uint8_t pipeId, TEMPER_NP_LUT_S *pstTemperLUT);
int HB_ISP_SetTempLut(uint8_t pipeId, TEMPER_NP_LUT_S *pstTemperLUT);
【Function description】
Set / Get the temper lut table
【Parameter description】
Parameter name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index | Input |
pstTemperLUT | Pointer to the temper lut table. | Input |
【Return】
Return | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference code】N/A
HB_ISP_SetAwbRgBgWeightAttr/ HB_ISP_GetAwbRgBgWeightAttr
【Function declaration】
int HB_ISP_SetAwbRgBgWeightAttr(uint8_t pipeId, const ISP_MESH_RGBG_WEIGHT_S
*pstWeightAttr);
int HB_ISP_GetAwbRgBgWeightAttr(uint8_t pipeId, ISP_MESH_RGBG_WEIGHT_S
*pstWeightAttr);
【Function description】Setting/Getting AWB RG BG weight table
【Parameter Description】
Parameter Name | Description | Input/Output |
---|---|---|
pipeId | Pipeline index number | Input |
pstWeightAttr | Pointer to Plank curve weight table | Input |
【Return Value】
Return Value | Description |
---|---|
0 | Success |
Non-zero | Failure |
【Notes】
【Reference Code】None
HB_ISP_GetAwbLsWeightAtt/ HB_ISP_SetAwbLsWeightAttr
【Function Declaration】
int HB_ISP_GetAwbLsWeightAttr(uint8_t pipeId, ISP_MESH_LS_WEIGHT_S *pstWeightAttr);
int HB_ISP_SetAwbLsWeightAttr(uint8_t pipeId, const ISP_MESH_LS_WEIGHT_S *pstWeightAttr);
【Function Description】
Setting/Getting AWB LS weight attribute