Gamma Correction - 2023.1 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.1 English

The gammacorrection modules improves the overall brightness of image. The gamma lookuptable is generated using the gamma value and with following equation.

image162

image163

API Syntax

template <int SRC_T, int DST_T, int ROWS, int COLS, int NPC = 1, int XFCVDEPTH_IN_1 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT_1 = _XFCVDEPTH_DEFAULT>
void gammacorrection(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_1>& src,
                     xf::cv::Mat<DST_T, ROWS, COLS, NPC, XFCVDEPTH_OUT_1>& dst,
                     unsigned char lut_table[256 * 3])

The following table describes the template and the function parameters.

Table 508 Table gammacorrection Parameter Description
Parameter Description
SRC_T Input Pixel Type.
DST_T 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 image
dst Output image
lut_table Lookup table for gamma values.first 256 will be R,next 256 values are G gamma and last 256 values are B values

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 a 4K image.

Table 509 Table gammacorrection Resource Utilization Summary
Operating Mode

Operating Frequency

(MHz)

Utilization Estimate        
BRAM_18K DSP_48Es FF LUT CLB
1 pixel 300 3 0 177 360 120

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 FPGA, to process a 4K image.

Table 510 Table gammacorrection Resource Utilization Summary
Operating Mode

Operating Frequency

(MHz)

Latency Estimate
Max (ms)
1 pixel 300 27.9
4 pixel 300 7