The gain control modules improve the overall brightness of the input image. In this module, applying a multiplicative gain (weight) for red and blue channel of the input bayerized image.
API Syntax
template <int BFORMAT, int SRC_T, int ROWS, int COLS, int NPC = 1, int XFCVDEPTH_IN_1 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT_1 = _XFCVDEPTH_DEFAULT>
void gaincontrol(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_1>& src,
xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_OUT_1>& dst,
unsigned short rgain,
unsigned short bgain)
The following table describes the template and the function parameters.
Parameter | Description |
---|---|
BFORMAT | Input Bayer pattern. |
SRC_T | Input and Output Pixel Type. |
ROWS | Maximum height of input and output image (Must be multiple of NPC) |
COLS | Maximum width of input and output image (Must be multiple of NPC) |
NPC | Number of Pixels to be processed per cycle. |
XFCVDEPTH_IN_1 | Depth of the input image. |
XFCVDEPTH_OUT_1 | Depth of the output image. |
src | Input Bayer image |
dst | Output Bayer image |
rgain | gain value for red channel in Q9.7 format |
bgain | gain value for red channel in Q9.7 format |
Resource Utilization
The following table summarizes the resource utilization of the kernel in different configurations, generated using Vivado HLS 2019.2 tool for the Xilinx xc7vx485t-ffg1157-1 FPGA, to process 4K image.
Operating Mode | Operating Frequency (MHz) |
Utilization Estimate | ||||
---|---|---|---|---|---|---|
BRAM_18K | DSP_48Es | FF | LUT | SLICE | ||
1 pixel | 300 | 0 | 3 | 233 | 95 | 59 |
2 pixel | 300 | 0 | 3 | 235 | 95 | 59 |
Performance Estimate
The following table summarizes a performance estimate of the kernel in different configurations, as generated using Vivado HLS 2019.2 tool for the Xilinx xc7vx485t-ffg1157-1, to process a 4K image.
Operating Mode Operating Frequency
(MHz)
Latency Estimate Max (ms) 1 pixel 300 27.7 2 pixel 300 14.2