The GaussianBlur
function applies Gaussian blur on the input image.
Gaussian filtering is done by convolving each point in the input image
with a Gaussian kernel.
Where , are the mean values and , are the variances in x and y directions respectively. In the GaussianBlur function, values of , are considered as zeroes and the values of , are equal.
API Syntax
template<int FILTER_SIZE, int BORDER_TYPE, int SRC_T, int ROWS, int COLS, int NPC = 1, int XFCVDEPTH_IN_1 = _XFCVDEPTH_DEFAULT, int XFCVDEPTH_OUT_1 = _XFCVDEPTH_DEFAULT>
void GaussianBlur(xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_IN_1> & src, xf::cv::Mat<SRC_T, ROWS, COLS, NPC, XFCVDEPTH_OUT_1> & dst, float sigma)
Parameter Descriptions
The following table describes the template and the function parameters.
Parameter | Description |
---|---|
FILTER_SIZE | Filter size. Filter size of 3 (XF_FILTER_3X3), 5 (XF_FILTER_5X5) and 7 (XF_FILTER_7X7) are supported. |
BORDER_TYPE | Border type supported is XF_BORDER_CONSTANT |
SRC_T | Input and Output pixel type. Only 8-bit, unsigned, 1 and 3 channels are supported (XF_8UC1 and XF_8UC3) |
ROWS | Maximum height of input and output image. |
COLS | Maximum width of input and output image (must be a multiple of 8, for 8-pixel operation) |
NPC | Number of pixels to be processed per cycle; possible values are XF_NPPC1 and XF_NPPC8 for 1 pixel and 8 pixel operations respectively. |
XFCVDEPTH_IN_1 | Depth of the input image. |
XFCVDEPTH_OUT_1 | Depth of the output image. |
src | Input image |
dst | Output image |
sigma | Standard deviation of Gaussian filter |
Resource Utilization
The following table summarizes the resource utilization of the Gaussian Filter in different configurations, generated using Vivado HLS 2019.1 version tool for the Xczu9eg-ffvb1156-1-i-es1 FPGA, to progress a grayscale HD (1080x1920) image.
Operating Mode | Filter Size | Operating Frequency (MHz) | Utilization Estimate | ||||
---|---|---|---|---|---|---|---|
BRAM_18K | DSP_48Es | FF | LUT | CLB | |||
1 Pixel | 3x3 | 300 | 3 | 17 | 3641 | 2791 | 610 |
5x5 | 300 | 5 | 27 | 4461 | 3544 | 764 | |
7x7 | 250 | 7 | 35 | 4770 | 4201 | 894 | |
8 Pixel | 3x3 | 150 | 6 | 52 | 3939 | 3784 | 814 |
5x5 | 150 | 10 | 111 | 5688 | 5639 | 1133 | |
7x7 | 150 | 14 | 175 | 7594 | 7278 | 1518 |
The following table summarizes the resource utilization of the Gaussian Filter in different configurations, generated using Vivado HLS 2019.1 version tool for the Xczu9eg-ffvb1156-1-i-es1 FPGA, to progress a 4K 3 Channel image.
Operating Mode | Filter Size | Operating Frequency (MHz) |
Utilization Estimate | |||
---|---|---|---|---|---|---|
BRAM_18K | DSP_48Es | LUT | CLB | |||
1 Pixel | 3x3 | 300 | 18 | 33 | 4835 | 3742 |
5x5 | 300 | 30 | 51 | 5755 | 3994 | |
7x7 | 300 | 42 | 135 | 8086 | 5422 |
Performance Estimate
The following table summarizes a performance estimate of the Gaussian Filter in different configurations, as generated using Vivado HLS 2019.1 tool for Xczu9eg-ffvb1156-1-i-es1 FPGA, to process a grayscale HD (1080x1920) image.
Operating Mode | Filter Size | Latency Estimate |
---|---|---|
Max Latency (ms) | ||
1 pixel operation (300 MHz) | 3x3 | 7.01 |
5x5 | 7.03 | |
7x7 | 7.06 | |
8 pixel operation (150 MHz) | 3x3 | 1.6 |
5x5 | 1.7 | |
7x7 | 1.74 |