SPRAD86 March 2023 AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM68A , AM69A
In the target file system on the EVM, go to /opt/edgeai-gst-plugins/ext/tiovx/gsttiovxisp.c, and add the sensor's name to the list (IMX219 shown below as an example):
g_object_class_install_property (gobject_class, PROP_SENSOR_NAME,
g_param_spec_string ("sensor-name", "Sensor name",
"TIOVX camera sensor string ID. Below are the supported sensors\n"
"SENSOR_SONY_IMX219_RPI\n"
Then add a function to configure the auto exposure parameters for the sensor. For example, IMX219 has the following function.
staticint32_tget_imx219_ae_dyn_params (IssAeDynamicParams*p_ae_dynPrms)
{
int32_t status = -1;
uint8_t count = 0;
g_return_val_if_fail (p_ae_dynPrms, status);
p_ae_dynPrms->targetBrightnessRange.min = 40; // min brightness on 0~255 scale
p_ae_dynPrms->targetBrightnessRange.max = 50; // max brightness on 0~255 scale
p_ae_dynPrms->targetBrightness = 45; // target brightness
p_ae_dynPrms->threshold = 5; // difference between target and min/max
p_ae_dynPrms->enableBlc = 0; // not used
p_ae_dynPrms->exposureTimeStepSize = 1; // step size for adjusting exposure time in microseconds
p_ae_dynPrms->exposureTimeRange[count].min = 100; // min exposure time in microseconds
p_ae_dynPrms->exposureTimeRange[count].max = 33333; // max exposure time in microseconds
p_ae_dynPrms->analogGainRange[count].min = 1024; // min analog gain (1024 is for 1.0x gain)
p_ae_dynPrms->analogGainRange[count].max = 8192; // max analog gain (8192 is for 8.0x gain)
p_ae_dynPrms->digitalGainRange[count].min = 256; // digital gain is not used
p_ae_dynPrms->digitalGainRange[count].max = 256; // digital gain is not used
count++;
p_ae_dynPrms->numAeDynParams = count;
status = 0;
return status;
}
Finally, add the exposure time and analog gain mappings. For example, IMX219 has the following mapping:
if (g_strcmp0 (self->sensor_name, "SENSOR_SONY_IMX219_RPI") == 0)
{
double multiplier = 0;
// map AE output exposure time in microseconds to the exposure register value
*exposure_time_mapped = (1080 * exposure_time / 33);
// map AE output analog gain in Q10 integer format to the analog gain register value
multiplier = analog_gain / 1024.0;
*analog_gain_mapped = 256.0 - 256.0 / multiplier;
}