Lens Shading Correction - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

Vignetting/Lensshading refers to the fall-off pixel intensity from the centre towards the edges of the image. In this algorithm, vignette is corrected by considering the distance between the centre pixel and actual image pixel position. This distance is used to calculate intensity gain per pixel per channel which is used for the correction.

API Syntax

template <int SRC_T, int DST_T, int ROWS, int COLS, int NPC = 1, int XFCVDEPTH_IN = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT = _XFCVDEPTH_DEFAULT>
void Lscdistancebased(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN>& src, xf::cv::Mat<DST_T, ROWS, COLS, NPC, XFCVDEPTH_OUT>& dst) {

Parameter Descriptions

The following table describes template parameters and arguments to the function.

Table 629 Table Lensshading correction Parameter Description
Parameter Description
SRC_T Input pixel type. 8/10/12/16-bit, unsigned, Bayer format is supported (XF_8UC1, XF_10UC1, XF_12UC1, XF_16UC1).
DST_T Output pixel type. 8/10/12/16-bit, unsigned, Bayer format is supported (XF_8UC1, XF_10UC1, XF_12UC1, XF_16UC1).
ROWS Maximum height of input and output image
COLS Maximum width of input and output image. In case of N-pixel parallelism, width should be multiple of N.
NPC Number of pixels to be processed per cycle; possible options are XF_NPPC1, XF_NPPC2 AND so on
XFCVDEPTH_IN Depth of the input image.
XFCVDEPTH_OUT Depth of the output image.
src Input image
dst Output image

Resource Utilization

The following table summarizes the resource utilization of the kernel in different configurations, generated using Vitis HLS 2020.2 tool, to process a FULL HD image.

Table 630 Table Lensshading correction Resource Utilization Summary
Operating Mode Operating Frequency (MHz) Utilization Estimate
BRAM_18K DSP_48Es FF LUT CLB
1 pixel-8U 300 0 20 3584 2946 681
1 pixel-16U 300 0 20 3608 2978 673

Performance Estimate

The following table summarizes a performance estimate of the kernel in different configurations, as generated using Vitis HLS 2020.2 tool, to process a FULL HD image.

Table 631 Table Lensshading correction Function Performance Estimate Summary
Operating Mode Operating Frequency (MHz) Latency Estimate Max (ms)
1 pixel 300 7
2 pixel 300 3.6